flexium 0.13.1 → 0.13.2

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/canvas.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkACYN2UKT_js=require('./chunk-ACYN2UKT.js');require('./chunk-3CKIHQIE.js'),require('./chunk-E6Z7AI4J.js');var chunkDUGPBZZ3_js=require('./chunk-DUGPBZZ3.js');var D=[];function l(t){D.push(t);}function C(t){let{width:y,height:w,children:e,style:u,ref:a}=t,s,n=null,i=()=>{!s||!n||(n.clearRect(0,0,y,w),D.length=0,Array.isArray(e)?e.forEach(o=>{typeof o=="function"&&o();}):typeof e=="function"&&e(),D.forEach(o=>{g(n,o);}),null);};return chunkACYN2UKT_js.c(()=>{s&&i();}),chunkDUGPBZZ3_js.a("canvas",{ref:o=>{s=o,n=o.getContext("2d"),a&&a(o),i();},width:y,height:w,style:u})}function r(t){return chunkACYN2UKT_js.b(t)?t.valueOf?.()??t:t}function g(t,y){let{type:w,props:e}=y,u=r(e.opacity);switch(u!==void 0&&(t.globalAlpha=u),w){case "rect":{let a=r(e.x),s=r(e.y),n=r(e.width),i=r(e.height),o=r(e.fill),f=r(e.stroke),c=r(e.strokeWidth);o&&(t.fillStyle=o,t.fillRect(a,s,n,i)),f&&(t.strokeStyle=f,c&&(t.lineWidth=c),t.strokeRect(a,s,n,i));break}case "circle":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.fill),o=r(e.stroke),f=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,0,Math.PI*2),i&&(t.fillStyle=i,t.fill()),o&&(t.strokeStyle=o,f&&(t.lineWidth=f),t.stroke());break}case "arc":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.startAngle),o=r(e.endAngle),f=r(e.counterclockwise)||false,c=r(e.fill),m=r(e.stroke),h=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,i,o,f),c&&(t.fillStyle=c,t.fill()),m&&(t.strokeStyle=m,h&&(t.lineWidth=h),t.stroke());break}case "line":{let a=r(e.x1),s=r(e.y1),n=r(e.x2),i=r(e.y2),o=r(e.stroke)||"black",f=r(e.strokeWidth)||1;t.beginPath(),t.moveTo(a,s),t.lineTo(n,i),t.strokeStyle=o,t.lineWidth=f,t.stroke();break}case "text":{let a=r(e.x),s=r(e.y),n=r(e.text),i=r(e.fill)||"black",o=r(e.fontSize)||16,f=r(e.fontFamily)||"sans-serif",c=r(e.fontWeight)||"normal",m=r(e.textAlign)||"left";t.font=`${c} ${o}px ${f}`,t.textAlign=m,t.fillStyle=i,t.fillText(n,a,s);break}case "path":{let a=r(e.d),s=r(e.fill),n=r(e.stroke),i=r(e.strokeWidth),o=new Path2D(a);s&&(t.fillStyle=s,t.fill(o)),n&&(t.strokeStyle=n,i&&(t.lineWidth=i),t.stroke(o));break}}u!==void 0&&(t.globalAlpha=1);}function x(t){return chunkACYN2UKT_js.c(()=>{l({type:"rect",props:t});}),null}function v(t){return chunkACYN2UKT_js.c(()=>{l({type:"circle",props:t});}),null}function A(t){return chunkACYN2UKT_js.c(()=>{l({type:"arc",props:t});}),null}function W(t){return chunkACYN2UKT_js.c(()=>{l({type:"line",props:t});}),null}function b(t){return chunkACYN2UKT_js.c(()=>{l({type:"text",props:t});}),null}function R(t){return chunkACYN2UKT_js.c(()=>{l({type:"path",props:t});}),null}exports.Canvas=C;exports.DrawArc=A;exports.DrawCircle=v;exports.DrawLine=W;exports.DrawPath=R;exports.DrawRect=x;exports.DrawText=b;//# sourceMappingURL=canvas.js.map
1
+ 'use strict';var chunkACYN2UKT_js=require('./chunk-ACYN2UKT.js');require('./chunk-3CKIHQIE.js'),require('./chunk-E6Z7AI4J.js');var chunkLHOIM4QY_js=require('./chunk-LHOIM4QY.js');var D=[];function l(t){D.push(t);}function C(t){let{width:y,height:w,children:e,style:u,ref:a}=t,s,n=null,i=()=>{!s||!n||(n.clearRect(0,0,y,w),D.length=0,Array.isArray(e)?e.forEach(o=>{typeof o=="function"&&o();}):typeof e=="function"&&e(),D.forEach(o=>{g(n,o);}),null);};return chunkACYN2UKT_js.c(()=>{s&&i();}),chunkLHOIM4QY_js.a("canvas",{ref:o=>{s=o,n=o.getContext("2d"),a&&a(o),i();},width:y,height:w,style:u})}function r(t){return chunkACYN2UKT_js.b(t)?t.valueOf?.()??t:t}function g(t,y){let{type:w,props:e}=y,u=r(e.opacity);switch(u!==void 0&&(t.globalAlpha=u),w){case "rect":{let a=r(e.x),s=r(e.y),n=r(e.width),i=r(e.height),o=r(e.fill),f=r(e.stroke),c=r(e.strokeWidth);o&&(t.fillStyle=o,t.fillRect(a,s,n,i)),f&&(t.strokeStyle=f,c&&(t.lineWidth=c),t.strokeRect(a,s,n,i));break}case "circle":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.fill),o=r(e.stroke),f=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,0,Math.PI*2),i&&(t.fillStyle=i,t.fill()),o&&(t.strokeStyle=o,f&&(t.lineWidth=f),t.stroke());break}case "arc":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.startAngle),o=r(e.endAngle),f=r(e.counterclockwise)||false,c=r(e.fill),m=r(e.stroke),h=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,i,o,f),c&&(t.fillStyle=c,t.fill()),m&&(t.strokeStyle=m,h&&(t.lineWidth=h),t.stroke());break}case "line":{let a=r(e.x1),s=r(e.y1),n=r(e.x2),i=r(e.y2),o=r(e.stroke)||"black",f=r(e.strokeWidth)||1;t.beginPath(),t.moveTo(a,s),t.lineTo(n,i),t.strokeStyle=o,t.lineWidth=f,t.stroke();break}case "text":{let a=r(e.x),s=r(e.y),n=r(e.text),i=r(e.fill)||"black",o=r(e.fontSize)||16,f=r(e.fontFamily)||"sans-serif",c=r(e.fontWeight)||"normal",m=r(e.textAlign)||"left";t.font=`${c} ${o}px ${f}`,t.textAlign=m,t.fillStyle=i,t.fillText(n,a,s);break}case "path":{let a=r(e.d),s=r(e.fill),n=r(e.stroke),i=r(e.strokeWidth),o=new Path2D(a);s&&(t.fillStyle=s,t.fill(o)),n&&(t.strokeStyle=n,i&&(t.lineWidth=i),t.stroke(o));break}}u!==void 0&&(t.globalAlpha=1);}function x(t){return chunkACYN2UKT_js.c(()=>{l({type:"rect",props:t});}),null}function v(t){return chunkACYN2UKT_js.c(()=>{l({type:"circle",props:t});}),null}function A(t){return chunkACYN2UKT_js.c(()=>{l({type:"arc",props:t});}),null}function W(t){return chunkACYN2UKT_js.c(()=>{l({type:"line",props:t});}),null}function b(t){return chunkACYN2UKT_js.c(()=>{l({type:"text",props:t});}),null}function R(t){return chunkACYN2UKT_js.c(()=>{l({type:"path",props:t});}),null}exports.Canvas=C;exports.DrawArc=A;exports.DrawCircle=v;exports.DrawLine=W;exports.DrawPath=R;exports.DrawRect=x;exports.DrawText=b;//# sourceMappingURL=canvas.js.map
2
2
  //# sourceMappingURL=canvas.js.map
package/dist/canvas.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {c,b as b$1}from'./chunk-3AKECLKA.mjs';import'./chunk-NRPWBHKP.mjs';import'./chunk-MI76R42D.mjs';import {a}from'./chunk-NY6NOGFU.mjs';var D=[];function l(t){D.push(t);}function C(t){let{width:y,height:w,children:e,style:u,ref:a$1}=t,s,n=null,i=()=>{!s||!n||(n.clearRect(0,0,y,w),D.length=0,Array.isArray(e)?e.forEach(o=>{typeof o=="function"&&o();}):typeof e=="function"&&e(),D.forEach(o=>{g(n,o);}),null);};return c(()=>{s&&i();}),a("canvas",{ref:o=>{s=o,n=o.getContext("2d"),a$1&&a$1(o),i();},width:y,height:w,style:u})}function r(t){return b$1(t)?t.valueOf?.()??t:t}function g(t,y){let{type:w,props:e}=y,u=r(e.opacity);switch(u!==void 0&&(t.globalAlpha=u),w){case "rect":{let a=r(e.x),s=r(e.y),n=r(e.width),i=r(e.height),o=r(e.fill),f=r(e.stroke),c=r(e.strokeWidth);o&&(t.fillStyle=o,t.fillRect(a,s,n,i)),f&&(t.strokeStyle=f,c&&(t.lineWidth=c),t.strokeRect(a,s,n,i));break}case "circle":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.fill),o=r(e.stroke),f=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,0,Math.PI*2),i&&(t.fillStyle=i,t.fill()),o&&(t.strokeStyle=o,f&&(t.lineWidth=f),t.stroke());break}case "arc":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.startAngle),o=r(e.endAngle),f=r(e.counterclockwise)||false,c=r(e.fill),m=r(e.stroke),h=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,i,o,f),c&&(t.fillStyle=c,t.fill()),m&&(t.strokeStyle=m,h&&(t.lineWidth=h),t.stroke());break}case "line":{let a=r(e.x1),s=r(e.y1),n=r(e.x2),i=r(e.y2),o=r(e.stroke)||"black",f=r(e.strokeWidth)||1;t.beginPath(),t.moveTo(a,s),t.lineTo(n,i),t.strokeStyle=o,t.lineWidth=f,t.stroke();break}case "text":{let a=r(e.x),s=r(e.y),n=r(e.text),i=r(e.fill)||"black",o=r(e.fontSize)||16,f=r(e.fontFamily)||"sans-serif",c=r(e.fontWeight)||"normal",m=r(e.textAlign)||"left";t.font=`${c} ${o}px ${f}`,t.textAlign=m,t.fillStyle=i,t.fillText(n,a,s);break}case "path":{let a=r(e.d),s=r(e.fill),n=r(e.stroke),i=r(e.strokeWidth),o=new Path2D(a);s&&(t.fillStyle=s,t.fill(o)),n&&(t.strokeStyle=n,i&&(t.lineWidth=i),t.stroke(o));break}}u!==void 0&&(t.globalAlpha=1);}function x(t){return c(()=>{l({type:"rect",props:t});}),null}function v(t){return c(()=>{l({type:"circle",props:t});}),null}function A(t){return c(()=>{l({type:"arc",props:t});}),null}function W(t){return c(()=>{l({type:"line",props:t});}),null}function b(t){return c(()=>{l({type:"text",props:t});}),null}function R(t){return c(()=>{l({type:"path",props:t});}),null}export{C as Canvas,A as DrawArc,v as DrawCircle,W as DrawLine,R as DrawPath,x as DrawRect,b as DrawText};//# sourceMappingURL=canvas.mjs.map
1
+ import {c,b as b$1}from'./chunk-3AKECLKA.mjs';import'./chunk-NRPWBHKP.mjs';import'./chunk-MI76R42D.mjs';import {a}from'./chunk-J3542Z77.mjs';var D=[];function l(t){D.push(t);}function C(t){let{width:y,height:w,children:e,style:u,ref:a$1}=t,s,n=null,i=()=>{!s||!n||(n.clearRect(0,0,y,w),D.length=0,Array.isArray(e)?e.forEach(o=>{typeof o=="function"&&o();}):typeof e=="function"&&e(),D.forEach(o=>{g(n,o);}),null);};return c(()=>{s&&i();}),a("canvas",{ref:o=>{s=o,n=o.getContext("2d"),a$1&&a$1(o),i();},width:y,height:w,style:u})}function r(t){return b$1(t)?t.valueOf?.()??t:t}function g(t,y){let{type:w,props:e}=y,u=r(e.opacity);switch(u!==void 0&&(t.globalAlpha=u),w){case "rect":{let a=r(e.x),s=r(e.y),n=r(e.width),i=r(e.height),o=r(e.fill),f=r(e.stroke),c=r(e.strokeWidth);o&&(t.fillStyle=o,t.fillRect(a,s,n,i)),f&&(t.strokeStyle=f,c&&(t.lineWidth=c),t.strokeRect(a,s,n,i));break}case "circle":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.fill),o=r(e.stroke),f=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,0,Math.PI*2),i&&(t.fillStyle=i,t.fill()),o&&(t.strokeStyle=o,f&&(t.lineWidth=f),t.stroke());break}case "arc":{let a=r(e.x),s=r(e.y),n=r(e.radius),i=r(e.startAngle),o=r(e.endAngle),f=r(e.counterclockwise)||false,c=r(e.fill),m=r(e.stroke),h=r(e.strokeWidth);t.beginPath(),t.arc(a,s,n,i,o,f),c&&(t.fillStyle=c,t.fill()),m&&(t.strokeStyle=m,h&&(t.lineWidth=h),t.stroke());break}case "line":{let a=r(e.x1),s=r(e.y1),n=r(e.x2),i=r(e.y2),o=r(e.stroke)||"black",f=r(e.strokeWidth)||1;t.beginPath(),t.moveTo(a,s),t.lineTo(n,i),t.strokeStyle=o,t.lineWidth=f,t.stroke();break}case "text":{let a=r(e.x),s=r(e.y),n=r(e.text),i=r(e.fill)||"black",o=r(e.fontSize)||16,f=r(e.fontFamily)||"sans-serif",c=r(e.fontWeight)||"normal",m=r(e.textAlign)||"left";t.font=`${c} ${o}px ${f}`,t.textAlign=m,t.fillStyle=i,t.fillText(n,a,s);break}case "path":{let a=r(e.d),s=r(e.fill),n=r(e.stroke),i=r(e.strokeWidth),o=new Path2D(a);s&&(t.fillStyle=s,t.fill(o)),n&&(t.strokeStyle=n,i&&(t.lineWidth=i),t.stroke(o));break}}u!==void 0&&(t.globalAlpha=1);}function x(t){return c(()=>{l({type:"rect",props:t});}),null}function v(t){return c(()=>{l({type:"circle",props:t});}),null}function A(t){return c(()=>{l({type:"arc",props:t});}),null}function W(t){return c(()=>{l({type:"line",props:t});}),null}function b(t){return c(()=>{l({type:"text",props:t});}),null}function R(t){return c(()=>{l({type:"path",props:t});}),null}export{C as Canvas,A as DrawArc,v as DrawCircle,W as DrawLine,R as DrawPath,x as DrawRect,b as DrawText};//# sourceMappingURL=canvas.mjs.map
2
2
  //# sourceMappingURL=canvas.mjs.map
@@ -1,2 +1,2 @@
1
- function i(e,r,t){let{children:n,...o}=r||{};return {type:e,props:o,children:Array.isArray(n)?n:n!=null?[n]:[],key:t}}function a(e,r,t){return i(e,r,t)}function d(e){return e.children}export{i as a,a as b,d as c};//# sourceMappingURL=chunk-NY6NOGFU.mjs.map
2
- //# sourceMappingURL=chunk-NY6NOGFU.mjs.map
1
+ function i(e,r,t){let{children:n,...o}=r||{};return {type:e,props:o,children:Array.isArray(n)?n:n!=null?[n]:[],key:t}}function a(e,r,t){return i(e,r,t)}function d(e){return e.children}export{i as a,a as b,d as c};//# sourceMappingURL=chunk-J3542Z77.mjs.map
2
+ //# sourceMappingURL=chunk-J3542Z77.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/jsx-runtime.ts"],"names":["jsx","type","props","key","children","otherProps","jsxs","Fragment"],"mappings":"AAEO,SAASA,CAAAA,CAAIC,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CACzD,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAW,CAAA,CAAIH,CAAAA,EAAS,EAAC,CAC9C,OAAO,CACH,IAAA,CAAAD,CAAAA,CACA,KAAA,CAAOI,CAAAA,CACP,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQD,CAAQ,CAAA,CAAIA,CAAAA,CAAYA,CAAAA,EAAY,KAAO,CAACA,CAAQ,CAAA,CAAI,EAAC,CACjF,GAAA,CAAAD,CACJ,CACJ,CAEO,SAASG,CAAAA,CAAKL,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CAC1D,OAAOH,CAAAA,CAAIC,CAAAA,CAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAEO,SAASI,CAAAA,CAASL,CAAAA,CAAwB,CAC7C,OAAOA,CAAAA,CAAM,QACjB","file":"chunk-J3542Z77.mjs","sourcesContent":["import type { FNode, FNodeChild } from './dom/types'\n\nexport function jsx(type: any, props: any, key?: any): FNode {\n const { children, ...otherProps } = props || {}\n return {\n type,\n props: otherProps,\n children: Array.isArray(children) ? children : (children != null ? [children] : []),\n key\n }\n}\n\nexport function jsxs(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\nexport function Fragment(props: any): FNodeChild {\n return props.children\n}\n\nexport namespace JSX {\n export interface IntrinsicElements {\n [elemName: string]: any\n }\n export type Element = FNode | FNodeChild\n export interface ElementChildrenAttribute {\n children: {}\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';function i(e,r,t){let{children:n,...o}=r||{};return {type:e,props:o,children:Array.isArray(n)?n:n!=null?[n]:[],key:t}}function a(e,r,t){return i(e,r,t)}function d(e){return e.children}exports.a=i;exports.b=a;exports.c=d;//# sourceMappingURL=chunk-DUGPBZZ3.js.map
2
- //# sourceMappingURL=chunk-DUGPBZZ3.js.map
1
+ 'use strict';function i(e,r,t){let{children:n,...o}=r||{};return {type:e,props:o,children:Array.isArray(n)?n:n!=null?[n]:[],key:t}}function a(e,r,t){return i(e,r,t)}function d(e){return e.children}exports.a=i;exports.b=a;exports.c=d;//# sourceMappingURL=chunk-LHOIM4QY.js.map
2
+ //# sourceMappingURL=chunk-LHOIM4QY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/jsx-runtime.ts"],"names":["jsx","type","props","key","children","otherProps","jsxs","Fragment"],"mappings":"aAEO,SAASA,CAAAA,CAAIC,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CACzD,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAW,CAAA,CAAIH,CAAAA,EAAS,EAAC,CAC9C,OAAO,CACH,IAAA,CAAAD,CAAAA,CACA,KAAA,CAAOI,CAAAA,CACP,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQD,CAAQ,CAAA,CAAIA,CAAAA,CAAYA,CAAAA,EAAY,KAAO,CAACA,CAAQ,CAAA,CAAI,EAAC,CACjF,GAAA,CAAAD,CACJ,CACJ,CAEO,SAASG,CAAAA,CAAKL,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CAC1D,OAAOH,CAAAA,CAAIC,CAAAA,CAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAEO,SAASI,CAAAA,CAASL,CAAAA,CAAwB,CAC7C,OAAOA,CAAAA,CAAM,QACjB","file":"chunk-LHOIM4QY.js","sourcesContent":["import type { FNode, FNodeChild } from './dom/types'\n\nexport function jsx(type: any, props: any, key?: any): FNode {\n const { children, ...otherProps } = props || {}\n return {\n type,\n props: otherProps,\n children: Array.isArray(children) ? children : (children != null ? [children] : []),\n key\n }\n}\n\nexport function jsxs(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\nexport function Fragment(props: any): FNodeChild {\n return props.children\n}\n\nexport namespace JSX {\n export interface IntrinsicElements {\n [elemName: string]: any\n }\n export type Element = FNode | FNodeChild\n export interface ElementChildrenAttribute {\n children: {}\n }\n}\n"]}
package/dist/dom.d.cts CHANGED
@@ -6,7 +6,6 @@ import { S as SerializedState } from './types-CxlS2F2j.cjs';
6
6
  */
7
7
  declare function f(type: string | Function, props?: any, ...children: any[]): FNode;
8
8
 
9
- declare function reconcile(oldNodes: Node[], newNodes: Node[], parent: Node, beforeMarker: Node): Node[];
10
9
  declare function render(app: any, container: HTMLElement): void;
11
10
 
12
11
  interface HydrateOptions {
@@ -53,12 +52,6 @@ interface LazyComponent<P = any> {
53
52
  _promise?: Promise<any>;
54
53
  _error?: Error;
55
54
  }
56
- interface SuspenseContextValue {
57
- /** Register a pending promise with the suspense boundary */
58
- register: (promise: Promise<any>) => void;
59
- /** Whether there's an active suspense boundary */
60
- hasBoundary: boolean;
61
- }
62
55
  interface ErrorInfo {
63
56
  /** Component stack trace */
64
57
  componentStack: string;
@@ -152,6 +145,4 @@ declare function lazy<P = {}>(loader: () => Promise<{
152
145
  default: (props: P) => FNodeChild;
153
146
  }>): LazyComponent<P>;
154
147
 
155
- declare function suspenseContext(): SuspenseContextValue;
156
-
157
- export { ErrorBoundary, type ErrorBoundaryProps, type ErrorInfo, FNode, FNodeChild, type HydrateOptions, type LazyComponent, Portal, type PortalProps, Suspense, type SuspenseContextValue, type SuspenseProps, f, hydrate, lazy, reconcile, render, suspenseContext };
148
+ export { ErrorBoundary, type ErrorBoundaryProps, type ErrorInfo, type HydrateOptions, type LazyComponent, Portal, type PortalProps, Suspense, type SuspenseProps, f, hydrate, lazy, render };
package/dist/dom.d.ts CHANGED
@@ -6,7 +6,6 @@ import { S as SerializedState } from './types-CxlS2F2j.js';
6
6
  */
7
7
  declare function f(type: string | Function, props?: any, ...children: any[]): FNode;
8
8
 
9
- declare function reconcile(oldNodes: Node[], newNodes: Node[], parent: Node, beforeMarker: Node): Node[];
10
9
  declare function render(app: any, container: HTMLElement): void;
11
10
 
12
11
  interface HydrateOptions {
@@ -53,12 +52,6 @@ interface LazyComponent<P = any> {
53
52
  _promise?: Promise<any>;
54
53
  _error?: Error;
55
54
  }
56
- interface SuspenseContextValue {
57
- /** Register a pending promise with the suspense boundary */
58
- register: (promise: Promise<any>) => void;
59
- /** Whether there's an active suspense boundary */
60
- hasBoundary: boolean;
61
- }
62
55
  interface ErrorInfo {
63
56
  /** Component stack trace */
64
57
  componentStack: string;
@@ -152,6 +145,4 @@ declare function lazy<P = {}>(loader: () => Promise<{
152
145
  default: (props: P) => FNodeChild;
153
146
  }>): LazyComponent<P>;
154
147
 
155
- declare function suspenseContext(): SuspenseContextValue;
156
-
157
- export { ErrorBoundary, type ErrorBoundaryProps, type ErrorInfo, FNode, FNodeChild, type HydrateOptions, type LazyComponent, Portal, type PortalProps, Suspense, type SuspenseContextValue, type SuspenseProps, f, hydrate, lazy, reconcile, render, suspenseContext };
148
+ export { ErrorBoundary, type ErrorBoundaryProps, type ErrorInfo, type HydrateOptions, type LazyComponent, Portal, type PortalProps, Suspense, type SuspenseProps, f, hydrate, lazy, render };
package/dist/dom.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkPUXZJ7OV_js=require('./chunk-PUXZJ7OV.js'),chunkACYN2UKT_js=require('./chunk-ACYN2UKT.js'),chunk3CKIHQIE_js=require('./chunk-3CKIHQIE.js'),chunkE6Z7AI4J_js=require('./chunk-E6Z7AI4J.js');function W(e,t,...o){return {type:e,props:t||{},children:o,key:t?.key}}var l=null,F=new WeakMap,h=null;function j(e,t,o={}){let{state:n,onHydrated:r,onMismatch:i}=o;l=t.firstChild;try{let s;typeof e=="function"&&!_(e)?s={type:e,props:{},children:[],key:void 0}:s=e,E(s,t),r?.();}catch(s){console.warn("[Flexium] Hydration mismatch, falling back to full render:",s),i?.(s),t.innerHTML="",import('./render-MJ2LCNSG.js').then(({render:p})=>{p(e,t);});}finally{l=null;}}function _(e){return e&&typeof e=="object"&&"type"in e&&"props"in e}function E(e,t){if(e==null||typeof e=="boolean")return v(),null;if(typeof e=="string"||typeof e=="number")return R(String(e));if(Array.isArray(e)){let o=[];for(let n of e){let r=E(n,t);r&&(Array.isArray(r)?o.push(...r):o.push(r));}return o}if(typeof e=="function")return T({type:e,props:{},children:[],key:void 0},t);if(typeof e=="object"&&_(e)){if(typeof e.type=="string")return K(e);if(typeof e.type=="function")return T(e,t)}return null}function v(){for(;l&&l.nodeType===Node.TEXT_NODE&&(!l.textContent||l.textContent.trim()==="");)l=l.nextSibling;}function R(e){v();let t=l;if(!t)return null;if(t.nodeType!==Node.TEXT_NODE){if(e.trim()==="")return null;throw new Error(`Hydration mismatch: expected text node "${e}", got ${t.nodeName}`)}return l=t.nextSibling,t}function K(e){v();let t=l,o=e.type;if(!t||t.nodeType!==Node.ELEMENT_NODE)throw new Error(`Hydration mismatch: expected element <${o}>, got ${t?.nodeName||"nothing"}`);if(t.tagName.toLowerCase()!==o.toLowerCase())throw new Error(`Hydration mismatch: expected <${o}>, got <${t.tagName.toLowerCase()}>`);if(e.props){for(let[n,r]of Object.entries(e.props))if(n==="ref")typeof r=="function"?r(t):r&&typeof r=="object"&&"current"in r&&(r.current=t);else if(n.startsWith("on")&&typeof r=="function"){let i=n.slice(2).toLowerCase();t.addEventListener(i,r),t.__eventHandlers||(t.__eventHandlers={}),t.__eventHandlers[i]=r;}}if(l=t.nextSibling,e.children&&e.children.length>0){let n=l;l=t.firstChild;for(let r of e.children)E(r,t);l=n;}return t}function T(e,t){let o=e.type,n={...e.props};e.children&&e.children.length>0&&(n.children=e.children.length===1?e.children[0]:e.children);let r=o._contextId,i=r!==void 0,s;i&&(s=chunkE6Z7AI4J_js.e(r,n.value)),F.has(t)||F.set(t,new Map);let p=F.get(t),C=e.key!==void 0,u;if(C)u=e.key;else {let y=0,f=o.name||"anonymous";p.forEach((g,x)=>{typeof x=="string"&&x.startsWith(`__auto_${f}_`)&&y++;}),u=`__auto_${f}_${y}`;}let a={hooks:[],hookIndex:0,nodes:[],parent:t,fnode:e,props:n,key:u,children:new Set,parentInstance:h||void 0};h&&h.children.add(a),p.set(u,a);let c=h;h=a;try{let y=chunkE6Z7AI4J_js.a(a,()=>o(n)),f=E(y,t);a.nodes=f?Array.isArray(f)?f:[f]:[];let g=!0,x=()=>{if(g){g=!1;return}let D=a.props;chunkE6Z7AI4J_js.a(a,()=>o(D));};return a.renderFn=x,chunk3CKIHQIE_js.b(x),a.nodes}finally{h=c,i&&chunkE6Z7AI4J_js.f(r,s);}}function b(e){let{target:t,children:o}=e,n=chunkE6Z7AI4J_js.b(()=>({container:null,mounted:false}));return chunkACYN2UKT_js.c(({onCleanup:r})=>{let i=null;if(typeof t=="string"?i=document.querySelector(t):t instanceof HTMLElement&&(i=t),!i){console.warn("[Flexium Portal] Target container not found:",t);return}let s=document.createElement("div");s.setAttribute("data-flexium-portal","true"),i.appendChild(s),n.container=s,n.mounted=true,chunkPUXZJ7OV_js.b(o,s),r(()=>{s.parentNode&&s.parentNode.removeChild(s),n.container=null,n.mounted=false;});},[t,o]),null}var X={register:()=>{},hasBoundary:false},I=new chunkE6Z7AI4J_js.c(X);function N(){let[e]=chunkACYN2UKT_js.c(I);return e}function z(e){let{fallback:t,children:o}=e,n=chunkE6Z7AI4J_js.b(()=>new Set),[,r]=chunkACYN2UKT_js.c(0),[i,s]=chunkACYN2UKT_js.c(false),C={register:a=>{n.has(a)||(n.add(a),r(c=>c+1),s(true),a.finally(()=>{n.delete(a),r(c=>{let y=c-1;return y===0&&s(false),y});}));},hasBoundary:true},u=i?t:o;return {type:I.Provider,props:{value:C},children:[u],key:void 0}}function V(e){let{fallback:t,onError:o,children:n,resetKey:r}=e,[i,s]=chunkACYN2UKT_js.c({error:null,info:null}),p=chunkE6Z7AI4J_js.b(()=>({current:r}));r!==p.current&&(p.current=r,i.error!==null&&s({error:null,info:null}));if(i.error)return typeof t=="function"?t(i.error,i.info):t;try{return n}finally{}}function $(e){let t=null,o=null,n=null,r=i=>{if(t)return t(i);if(n)throw n;let s=N();return o||(o=e().then(p=>{t=p.default;}).catch(p=>{n=p instanceof Error?p:new Error(String(p));})),s.hasBoundary&&s.register(o),null};return r._lazy=true,r._loader=e,r}Object.defineProperty(exports,"reconcile",{enumerable:true,get:function(){return chunkPUXZJ7OV_js.a}});Object.defineProperty(exports,"render",{enumerable:true,get:function(){return chunkPUXZJ7OV_js.b}});exports.ErrorBoundary=V;exports.Portal=b;exports.Suspense=z;exports.f=W;exports.hydrate=j;exports.lazy=$;exports.suspenseContext=N;//# sourceMappingURL=dom.js.map
1
+ 'use strict';var chunkPUXZJ7OV_js=require('./chunk-PUXZJ7OV.js'),chunkACYN2UKT_js=require('./chunk-ACYN2UKT.js'),chunk3CKIHQIE_js=require('./chunk-3CKIHQIE.js'),chunkE6Z7AI4J_js=require('./chunk-E6Z7AI4J.js');function A(e,t,...o){return {type:e,props:t||{},children:o,key:t?.key}}var l=null,P=new WeakMap,h=null;function W(e,t,o={}){let{state:n,onHydrated:r,onMismatch:i}=o;l=t.firstChild;try{let s;typeof e=="function"&&!T(e)?s={type:e,props:{},children:[],key:void 0}:s=e,E(s,t),r?.();}catch(s){console.warn("[Flexium] Hydration mismatch, falling back to full render:",s),i?.(s),t.innerHTML="",import('./render-MJ2LCNSG.js').then(({render:p})=>{p(e,t);});}finally{l=null;}}function T(e){return e&&typeof e=="object"&&"type"in e&&"props"in e}function E(e,t){if(e==null||typeof e=="boolean")return F(),null;if(typeof e=="string"||typeof e=="number")return j(String(e));if(Array.isArray(e)){let o=[];for(let n of e){let r=E(n,t);r&&(Array.isArray(r)?o.push(...r):o.push(r));}return o}if(typeof e=="function")return M({type:e,props:{},children:[],key:void 0},t);if(typeof e=="object"&&T(e)){if(typeof e.type=="string")return R(e);if(typeof e.type=="function")return M(e,t)}return null}function F(){for(;l&&l.nodeType===Node.TEXT_NODE&&(!l.textContent||l.textContent.trim()==="");)l=l.nextSibling;}function j(e){F();let t=l;if(!t)return null;if(t.nodeType!==Node.TEXT_NODE){if(e.trim()==="")return null;throw new Error(`Hydration mismatch: expected text node "${e}", got ${t.nodeName}`)}return l=t.nextSibling,t}function R(e){F();let t=l,o=e.type;if(!t||t.nodeType!==Node.ELEMENT_NODE)throw new Error(`Hydration mismatch: expected element <${o}>, got ${t?.nodeName||"nothing"}`);if(t.tagName.toLowerCase()!==o.toLowerCase())throw new Error(`Hydration mismatch: expected <${o}>, got <${t.tagName.toLowerCase()}>`);if(e.props){for(let[n,r]of Object.entries(e.props))if(n==="ref")typeof r=="function"?r(t):r&&typeof r=="object"&&"current"in r&&(r.current=t);else if(n.startsWith("on")&&typeof r=="function"){let i=n.slice(2).toLowerCase();t.addEventListener(i,r),t.__eventHandlers||(t.__eventHandlers={}),t.__eventHandlers[i]=r;}}if(l=t.nextSibling,e.children&&e.children.length>0){let n=l;l=t.firstChild;for(let r of e.children)E(r,t);l=n;}return t}function M(e,t){let o=e.type,n={...e.props};e.children&&e.children.length>0&&(n.children=e.children.length===1?e.children[0]:e.children);let r=o._contextId,i=r!==void 0,s;i&&(s=chunkE6Z7AI4J_js.e(r,n.value)),P.has(t)||P.set(t,new Map);let p=P.get(t),C=e.key!==void 0,u;if(C)u=e.key;else {let y=0,f=o.name||"anonymous";p.forEach((N,x)=>{typeof x=="string"&&x.startsWith(`__auto_${f}_`)&&y++;}),u=`__auto_${f}_${y}`;}let a={hooks:[],hookIndex:0,nodes:[],parent:t,fnode:e,props:n,key:u,children:new Set,parentInstance:h||void 0};h&&h.children.add(a),p.set(u,a);let c=h;h=a;try{let y=chunkE6Z7AI4J_js.a(a,()=>o(n)),f=E(y,t);a.nodes=f?Array.isArray(f)?f:[f]:[];let N=!0,x=()=>{if(N){N=!1;return}let D=a.props;chunkE6Z7AI4J_js.a(a,()=>o(D));};return a.renderFn=x,chunk3CKIHQIE_js.b(x),a.nodes}finally{h=c,i&&chunkE6Z7AI4J_js.f(r,s);}}function _(e){let{target:t,children:o}=e,n=chunkE6Z7AI4J_js.b(()=>({container:null,mounted:false}));return chunkACYN2UKT_js.c(({onCleanup:r})=>{let i=null;if(typeof t=="string"?i=document.querySelector(t):t instanceof HTMLElement&&(i=t),!i){console.warn("[Flexium Portal] Target container not found:",t);return}let s=document.createElement("div");s.setAttribute("data-flexium-portal","true"),i.appendChild(s),n.container=s,n.mounted=true,chunkPUXZJ7OV_js.b(o,s),r(()=>{s.parentNode&&s.parentNode.removeChild(s),n.container=null,n.mounted=false;});},[t,o]),null}var K={register:()=>{},hasBoundary:false},v=new chunkE6Z7AI4J_js.c(K);function b(){let[e]=chunkACYN2UKT_js.c(v);return e}function z(e){let{fallback:t,children:o}=e,n=chunkE6Z7AI4J_js.b(()=>new Set),[,r]=chunkACYN2UKT_js.c(0),[i,s]=chunkACYN2UKT_js.c(false),C={register:a=>{n.has(a)||(n.add(a),r(c=>c+1),s(true),a.finally(()=>{n.delete(a),r(c=>{let y=c-1;return y===0&&s(false),y});}));},hasBoundary:true},u=i?t:o;return {type:v.Provider,props:{value:C},children:[u],key:void 0}}function V(e){let{fallback:t,onError:o,children:n,resetKey:r}=e,[i,s]=chunkACYN2UKT_js.c({error:null,info:null}),p=chunkE6Z7AI4J_js.b(()=>({current:r}));r!==p.current&&(p.current=r,i.error!==null&&s({error:null,info:null}));if(i.error)return typeof t=="function"?t(i.error,i.info):t;try{return n}finally{}}function $(e){let t=null,o=null,n=null,r=i=>{if(t)return t(i);if(n)throw n;let s=b();return o||(o=e().then(p=>{t=p.default;}).catch(p=>{n=p instanceof Error?p:new Error(String(p));})),s.hasBoundary&&s.register(o),null};return r._lazy=true,r._loader=e,r}Object.defineProperty(exports,"render",{enumerable:true,get:function(){return chunkPUXZJ7OV_js.b}});exports.ErrorBoundary=V;exports.Portal=_;exports.Suspense=z;exports.f=A;exports.hydrate=W;exports.lazy=$;//# sourceMappingURL=dom.js.map
2
2
  //# sourceMappingURL=dom.js.map
package/dist/dom.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {b as b$3}from'./chunk-TP5HUAIN.mjs';export{a as reconcile,b as render}from'./chunk-TP5HUAIN.mjs';import {c as c$1}from'./chunk-3AKECLKA.mjs';import {b as b$1}from'./chunk-NRPWBHKP.mjs';import {c,e,a,f,b as b$2}from'./chunk-MI76R42D.mjs';function W(e,t,...o){return {type:e,props:t||{},children:o,key:t?.key}}var l=null,F=new WeakMap,h=null;function j(e,t,o={}){let{state:n,onHydrated:r,onMismatch:i}=o;l=t.firstChild;try{let s;typeof e=="function"&&!_(e)?s={type:e,props:{},children:[],key:void 0}:s=e,E(s,t),r?.();}catch(s){console.warn("[Flexium] Hydration mismatch, falling back to full render:",s),i?.(s),t.innerHTML="",import('./render-4HB53K66.mjs').then(({render:p})=>{p(e,t);});}finally{l=null;}}function _(e){return e&&typeof e=="object"&&"type"in e&&"props"in e}function E(e,t){if(e==null||typeof e=="boolean")return v(),null;if(typeof e=="string"||typeof e=="number")return R(String(e));if(Array.isArray(e)){let o=[];for(let n of e){let r=E(n,t);r&&(Array.isArray(r)?o.push(...r):o.push(r));}return o}if(typeof e=="function")return T({type:e,props:{},children:[],key:void 0},t);if(typeof e=="object"&&_(e)){if(typeof e.type=="string")return K(e);if(typeof e.type=="function")return T(e,t)}return null}function v(){for(;l&&l.nodeType===Node.TEXT_NODE&&(!l.textContent||l.textContent.trim()==="");)l=l.nextSibling;}function R(e){v();let t=l;if(!t)return null;if(t.nodeType!==Node.TEXT_NODE){if(e.trim()==="")return null;throw new Error(`Hydration mismatch: expected text node "${e}", got ${t.nodeName}`)}return l=t.nextSibling,t}function K(e){v();let t=l,o=e.type;if(!t||t.nodeType!==Node.ELEMENT_NODE)throw new Error(`Hydration mismatch: expected element <${o}>, got ${t?.nodeName||"nothing"}`);if(t.tagName.toLowerCase()!==o.toLowerCase())throw new Error(`Hydration mismatch: expected <${o}>, got <${t.tagName.toLowerCase()}>`);if(e.props){for(let[n,r]of Object.entries(e.props))if(n==="ref")typeof r=="function"?r(t):r&&typeof r=="object"&&"current"in r&&(r.current=t);else if(n.startsWith("on")&&typeof r=="function"){let i=n.slice(2).toLowerCase();t.addEventListener(i,r),t.__eventHandlers||(t.__eventHandlers={}),t.__eventHandlers[i]=r;}}if(l=t.nextSibling,e.children&&e.children.length>0){let n=l;l=t.firstChild;for(let r of e.children)E(r,t);l=n;}return t}function T(e$1,t){let o=e$1.type,n={...e$1.props};e$1.children&&e$1.children.length>0&&(n.children=e$1.children.length===1?e$1.children[0]:e$1.children);let r=o._contextId,i=r!==void 0,s;i&&(s=e(r,n.value)),F.has(t)||F.set(t,new Map);let p=F.get(t),C=e$1.key!==void 0,u;if(C)u=e$1.key;else {let y=0,f=o.name||"anonymous";p.forEach((g,x)=>{typeof x=="string"&&x.startsWith(`__auto_${f}_`)&&y++;}),u=`__auto_${f}_${y}`;}let a$1={hooks:[],hookIndex:0,nodes:[],parent:t,fnode:e$1,props:n,key:u,children:new Set,parentInstance:h||void 0};h&&h.children.add(a$1),p.set(u,a$1);let c=h;h=a$1;try{let y=a(a$1,()=>o(n)),f=E(y,t);a$1.nodes=f?Array.isArray(f)?f:[f]:[];let g=!0,x=()=>{if(g){g=!1;return}let D=a$1.props;a(a$1,()=>o(D));};return a$1.renderFn=x,b$1(x),a$1.nodes}finally{h=c,i&&f(r,s);}}function b(e){let{target:t,children:o}=e,n=b$2(()=>({container:null,mounted:false}));return c$1(({onCleanup:r})=>{let i=null;if(typeof t=="string"?i=document.querySelector(t):t instanceof HTMLElement&&(i=t),!i){console.warn("[Flexium Portal] Target container not found:",t);return}let s=document.createElement("div");s.setAttribute("data-flexium-portal","true"),i.appendChild(s),n.container=s,n.mounted=true,b$3(o,s),r(()=>{s.parentNode&&s.parentNode.removeChild(s),n.container=null,n.mounted=false;});},[t,o]),null}var X={register:()=>{},hasBoundary:false},I=new c(X);function N(){let[e]=c$1(I);return e}function z(e){let{fallback:t,children:o}=e,n=b$2(()=>new Set),[,r]=c$1(0),[i,s]=c$1(false),C={register:a=>{n.has(a)||(n.add(a),r(c=>c+1),s(true),a.finally(()=>{n.delete(a),r(c=>{let y=c-1;return y===0&&s(false),y});}));},hasBoundary:true},u=i?t:o;return {type:I.Provider,props:{value:C},children:[u],key:void 0}}function V(e){let{fallback:t,onError:o,children:n,resetKey:r}=e,[i,s]=c$1({error:null,info:null}),p=b$2(()=>({current:r}));r!==p.current&&(p.current=r,i.error!==null&&s({error:null,info:null}));if(i.error)return typeof t=="function"?t(i.error,i.info):t;try{return n}finally{}}function $(e){let t=null,o=null,n=null,r=i=>{if(t)return t(i);if(n)throw n;let s=N();return o||(o=e().then(p=>{t=p.default;}).catch(p=>{n=p instanceof Error?p:new Error(String(p));})),s.hasBoundary&&s.register(o),null};return r._lazy=true,r._loader=e,r}export{V as ErrorBoundary,b as Portal,z as Suspense,W as f,j as hydrate,$ as lazy,N as suspenseContext};//# sourceMappingURL=dom.mjs.map
1
+ import {b as b$3}from'./chunk-TP5HUAIN.mjs';export{b as render}from'./chunk-TP5HUAIN.mjs';import {c as c$1}from'./chunk-3AKECLKA.mjs';import {b as b$1}from'./chunk-NRPWBHKP.mjs';import {c,e,a,f,b as b$2}from'./chunk-MI76R42D.mjs';function A(e,t,...o){return {type:e,props:t||{},children:o,key:t?.key}}var l=null,P=new WeakMap,h=null;function W(e,t,o={}){let{state:n,onHydrated:r,onMismatch:i}=o;l=t.firstChild;try{let s;typeof e=="function"&&!T(e)?s={type:e,props:{},children:[],key:void 0}:s=e,E(s,t),r?.();}catch(s){console.warn("[Flexium] Hydration mismatch, falling back to full render:",s),i?.(s),t.innerHTML="",import('./render-4HB53K66.mjs').then(({render:p})=>{p(e,t);});}finally{l=null;}}function T(e){return e&&typeof e=="object"&&"type"in e&&"props"in e}function E(e,t){if(e==null||typeof e=="boolean")return F(),null;if(typeof e=="string"||typeof e=="number")return j(String(e));if(Array.isArray(e)){let o=[];for(let n of e){let r=E(n,t);r&&(Array.isArray(r)?o.push(...r):o.push(r));}return o}if(typeof e=="function")return M({type:e,props:{},children:[],key:void 0},t);if(typeof e=="object"&&T(e)){if(typeof e.type=="string")return R(e);if(typeof e.type=="function")return M(e,t)}return null}function F(){for(;l&&l.nodeType===Node.TEXT_NODE&&(!l.textContent||l.textContent.trim()==="");)l=l.nextSibling;}function j(e){F();let t=l;if(!t)return null;if(t.nodeType!==Node.TEXT_NODE){if(e.trim()==="")return null;throw new Error(`Hydration mismatch: expected text node "${e}", got ${t.nodeName}`)}return l=t.nextSibling,t}function R(e){F();let t=l,o=e.type;if(!t||t.nodeType!==Node.ELEMENT_NODE)throw new Error(`Hydration mismatch: expected element <${o}>, got ${t?.nodeName||"nothing"}`);if(t.tagName.toLowerCase()!==o.toLowerCase())throw new Error(`Hydration mismatch: expected <${o}>, got <${t.tagName.toLowerCase()}>`);if(e.props){for(let[n,r]of Object.entries(e.props))if(n==="ref")typeof r=="function"?r(t):r&&typeof r=="object"&&"current"in r&&(r.current=t);else if(n.startsWith("on")&&typeof r=="function"){let i=n.slice(2).toLowerCase();t.addEventListener(i,r),t.__eventHandlers||(t.__eventHandlers={}),t.__eventHandlers[i]=r;}}if(l=t.nextSibling,e.children&&e.children.length>0){let n=l;l=t.firstChild;for(let r of e.children)E(r,t);l=n;}return t}function M(e$1,t){let o=e$1.type,n={...e$1.props};e$1.children&&e$1.children.length>0&&(n.children=e$1.children.length===1?e$1.children[0]:e$1.children);let r=o._contextId,i=r!==void 0,s;i&&(s=e(r,n.value)),P.has(t)||P.set(t,new Map);let p=P.get(t),C=e$1.key!==void 0,u;if(C)u=e$1.key;else {let y=0,f=o.name||"anonymous";p.forEach((N,x)=>{typeof x=="string"&&x.startsWith(`__auto_${f}_`)&&y++;}),u=`__auto_${f}_${y}`;}let a$1={hooks:[],hookIndex:0,nodes:[],parent:t,fnode:e$1,props:n,key:u,children:new Set,parentInstance:h||void 0};h&&h.children.add(a$1),p.set(u,a$1);let c=h;h=a$1;try{let y=a(a$1,()=>o(n)),f=E(y,t);a$1.nodes=f?Array.isArray(f)?f:[f]:[];let N=!0,x=()=>{if(N){N=!1;return}let D=a$1.props;a(a$1,()=>o(D));};return a$1.renderFn=x,b$1(x),a$1.nodes}finally{h=c,i&&f(r,s);}}function _(e){let{target:t,children:o}=e,n=b$2(()=>({container:null,mounted:false}));return c$1(({onCleanup:r})=>{let i=null;if(typeof t=="string"?i=document.querySelector(t):t instanceof HTMLElement&&(i=t),!i){console.warn("[Flexium Portal] Target container not found:",t);return}let s=document.createElement("div");s.setAttribute("data-flexium-portal","true"),i.appendChild(s),n.container=s,n.mounted=true,b$3(o,s),r(()=>{s.parentNode&&s.parentNode.removeChild(s),n.container=null,n.mounted=false;});},[t,o]),null}var K={register:()=>{},hasBoundary:false},v=new c(K);function b(){let[e]=c$1(v);return e}function z(e){let{fallback:t,children:o}=e,n=b$2(()=>new Set),[,r]=c$1(0),[i,s]=c$1(false),C={register:a=>{n.has(a)||(n.add(a),r(c=>c+1),s(true),a.finally(()=>{n.delete(a),r(c=>{let y=c-1;return y===0&&s(false),y});}));},hasBoundary:true},u=i?t:o;return {type:v.Provider,props:{value:C},children:[u],key:void 0}}function V(e){let{fallback:t,onError:o,children:n,resetKey:r}=e,[i,s]=c$1({error:null,info:null}),p=b$2(()=>({current:r}));r!==p.current&&(p.current=r,i.error!==null&&s({error:null,info:null}));if(i.error)return typeof t=="function"?t(i.error,i.info):t;try{return n}finally{}}function $(e){let t=null,o=null,n=null,r=i=>{if(t)return t(i);if(n)throw n;let s=b();return o||(o=e().then(p=>{t=p.default;}).catch(p=>{n=p instanceof Error?p:new Error(String(p));})),s.hasBoundary&&s.register(o),null};return r._lazy=true,r._loader=e,r}export{V as ErrorBoundary,_ as Portal,z as Suspense,A as f,W as hydrate,$ as lazy};//# sourceMappingURL=dom.mjs.map
2
2
  //# sourceMappingURL=dom.mjs.map
package/dist/dom.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dom/f.ts","../src/dom/hydrate.ts","../src/dom/components/Portal.tsx","../src/dom/components/suspenseContext.ts","../src/dom/components/Suspense.tsx","../src/dom/components/ErrorBoundary.tsx","../src/dom/components/lazy.ts"],"names":["f","type","props","children","hydrationCursor","hydratedInstanceRegistry","currentHydratingInstance","hydrate","app","container","options","state","onHydrated","onMismatch","fnode","isFNode","hydrateNode","error","render","value","parent","skipEmptyTextNodes","hydrateTextNode","nodes","child","result","hydrateComponent","hydrateElement","text","current","tag","key","eventName","savedCursor","Component","contextId","isProvider","prevContextValue","pushContext","parentRegistry","hasExplicitKey","instanceCount","componentName","_","k","instance","previousHydratingInstance","runWithComponent","isFirstRender","renderFn","currentProps","unsafeEffect","popContext","Portal","target","portalState","hook","use","onCleanup","portalWrapper","defaultValue","SuspenseCtx","Context","suspenseContext","Suspense","fallback","pendingSet","setPendingCount","showFallback","setShowFallback","contextValue","promise","newCount","content","ErrorBoundary","onError","resetKey","errorState","setErrorState","prevResetKeyRef","lazy","loader","resolved","LazyWrapper","suspense","module","err"],"mappings":"qPAKO,SAASA,CAAAA,CACZC,CAAAA,CACAC,CAAAA,CAAAA,GACGC,CAAAA,CACE,CACL,OAAO,CACH,IAAA,CAAAF,CAAAA,CACA,KAAA,CAAOC,CAAAA,EAAS,GAChB,QAAA,CAAAC,CAAAA,CACA,GAAA,CAAKD,CAAAA,EAAO,GAChB,CACJ,CCTA,IACIE,CAAAA,CAA+B,IAAA,CAkC7BC,EAA2B,IAAI,OAAA,CACjCC,CAAAA,CAAwD,KAarD,SAASC,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CAA0B,EAAC,CACrB,CACN,GAAM,CAAE,MAAAC,CAAAA,CAAO,UAAA,CAAAC,CAAAA,CAAY,UAAA,CAAAC,CAAW,CAAA,CAAIH,CAAAA,CAO1CN,CAAAA,CAAkBK,CAAAA,CAAU,WAE5B,GAAI,CAEF,IAAIK,CAAAA,CACA,OAAON,CAAAA,EAAQ,UAAA,EAAc,CAACO,CAAAA,CAAQP,CAAG,CAAA,CAC3CM,CAAAA,CAAQ,CAAE,IAAA,CAAMN,EAAK,KAAA,CAAO,EAAC,CAAG,QAAA,CAAU,EAAC,CAAG,GAAA,CAAK,KAAA,CAAU,CAAA,CAE7DM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AAA,CACkB,CAElB,IAAIC,CAAAA,CAA8C,IAAA,CAC9CX,CAAAA,CAA+B,KAC/BtD,CAAAA,CAAsB,IAAA,CAGpBkE,EAAejF,CAAAA,EAAyB,CAE5C,GAAIgF,CAAAA,CACF,OAAOA,CAAAA,CAAShF,CAAK,CAAA,CAIvB,GAAIe,EACF,MAAMA,CAAAA,CAIR,IAAMmE,CAAAA,CAAWrB,CAAAA,GAGjB,OAAKQ,CAAAA,GACHA,CAAAA,CAAUU,CAAAA,EAAO,CACd,IAAA,CAAKI,GAAU,CACdH,CAAAA,CAAWG,EAAO,QACpB,CAAC,EACA,KAAA,CAAMC,CAAAA,EAAO,CACZrE,CAAAA,CAAQqE,CAAAA,YAAe,KAAA,CAAQA,EAAM,IAAI,KAAA,CAAM,OAAOA,CAAG,CAAC,EAC5D,CAAC,CAAA,CAAA,CAIDF,CAAAA,CAAS,WAAA,EACXA,CAAAA,CAAS,QAAA,CAASb,CAAO,CAAA,CAIpB,IACT,EAGC,OAACY,CAAAA,CAAiC,MAAQ,IAAA,CACzCA,CAAAA,CAAiC,OAAA,CAAUF,CAAAA,CAEtCE,CACT","file":"dom.mjs","sourcesContent":["import type { FNode } from './types'\n\n/**\n * f() - Create FNodes without JSX\n */\nexport function f(\n type: string | Function,\n props?: any,\n ...children: any[]\n): FNode {\n return {\n type,\n props: props || {},\n children,\n key: props?.key\n }\n}\n","import type { FNode, FNodeChild } from './types'\nimport type { SerializedState } from '../server/types'\nimport { runWithComponent, type ComponentInstance } from '../core/hook'\nimport { pushContext, popContext } from '../core/context'\nimport { unsafeEffect } from '../core/lifecycle'\n\n// Hydration state\nlet isHydrating = false\nlet hydrationCursor: Node | null = null\nlet hydrationState: SerializedState | null = null\n\nexport interface HydrateOptions {\n /**\n * Serialized state from server\n * Typically embedded in HTML as JSON script tag\n */\n state?: SerializedState\n\n /**\n * Called when hydration completes successfully\n */\n onHydrated?: () => void\n\n /**\n * Called when hydration fails (falls back to full render)\n */\n onMismatch?: (error: Error) => void\n}\n\n// Extended ComponentInstance for DOM tracking (same as render.ts)\ninterface DOMComponentInstance extends ComponentInstance {\n nodes: Node[]\n parent: HTMLElement\n fnode: any\n props: any\n key?: any\n renderFn?: () => void\n children: Set<DOMComponentInstance>\n parentInstance?: DOMComponentInstance\n}\n\n// Registry for hydrated components\nconst hydratedInstanceRegistry = new WeakMap<HTMLElement, Map<any, DOMComponentInstance>>()\nlet currentHydratingInstance: DOMComponentInstance | null = null\n\nexport function getIsHydrating(): boolean {\n return isHydrating\n}\n\nexport function getHydrationState(): SerializedState | null {\n return hydrationState\n}\n\n/**\n * Hydrate server-rendered HTML with client-side interactivity\n */\nexport function hydrate(\n app: FNodeChild | (() => FNodeChild),\n container: HTMLElement,\n options: HydrateOptions = {}\n): void {\n const { state, onHydrated, onMismatch } = options\n\n // Store state for rehydration\n hydrationState = state || null\n\n // Initialize hydration mode\n isHydrating = true\n hydrationCursor = container.firstChild\n\n try {\n // Normalize input\n let fnode: FNodeChild\n if (typeof app === 'function' && !isFNode(app)) {\n fnode = { type: app, props: {}, children: [], key: undefined }\n } else {\n fnode = app\n }\n\n // Hydrate the tree\n hydrateNode(fnode, container)\n\n onHydrated?.()\n } catch (error) {\n // Hydration mismatch - fall back to full render\n console.warn('[Flexium] Hydration mismatch, falling back to full render:', error)\n onMismatch?.(error as Error)\n\n // Clear and re-render\n container.innerHTML = ''\n // Import dynamically to avoid circular deps\n import('./render').then(({ render }) => {\n render(app, container)\n })\n } finally {\n isHydrating = false\n hydrationCursor = null\n hydrationState = null\n }\n}\n\nfunction isFNode(value: any): value is FNode {\n return value && typeof value === 'object' && 'type' in value && 'props' in value\n}\n\nfunction hydrateNode(fnode: FNodeChild, parent: HTMLElement): Node | Node[] | null {\n // Null/undefined/boolean -> skip empty text nodes\n if (fnode === null || fnode === undefined || typeof fnode === 'boolean') {\n // Server might have rendered an empty text node\n skipEmptyTextNodes()\n return null\n }\n\n // String/number -> expect text node\n if (typeof fnode === 'string' || typeof fnode === 'number') {\n return hydrateTextNode(String(fnode))\n }\n\n // Array -> hydrate each child\n if (Array.isArray(fnode)) {\n const nodes: Node[] = []\n for (const child of fnode) {\n const result = hydrateNode(child, parent)\n if (result) {\n if (Array.isArray(result)) {\n nodes.push(...result)\n } else {\n nodes.push(result)\n }\n }\n }\n return nodes\n }\n\n // Function (standalone) -> wrap in FNode and hydrate\n if (typeof fnode === 'function') {\n const wrappedFnode: FNode = { type: fnode, props: {}, children: [], key: undefined }\n return hydrateComponent(wrappedFnode, parent)\n }\n\n // Object (FNode)\n if (typeof fnode === 'object' && isFNode(fnode)) {\n if (typeof fnode.type === 'string') {\n return hydrateElement(fnode)\n }\n\n if (typeof fnode.type === 'function') {\n return hydrateComponent(fnode, parent)\n }\n }\n\n return null\n}\n\nfunction skipEmptyTextNodes(): void {\n while (\n hydrationCursor &&\n hydrationCursor.nodeType === Node.TEXT_NODE &&\n (!hydrationCursor.textContent || hydrationCursor.textContent.trim() === '')\n ) {\n hydrationCursor = hydrationCursor.nextSibling\n }\n}\n\nfunction hydrateTextNode(text: string): Node | null {\n skipEmptyTextNodes()\n\n const current = hydrationCursor\n\n if (!current) {\n // No node to hydrate - this is okay for conditional rendering\n return null\n }\n\n if (current.nodeType !== Node.TEXT_NODE) {\n // Try to find a text node nearby (whitespace handling)\n if (text.trim() === '') {\n return null\n }\n throw new Error(`Hydration mismatch: expected text node \"${text}\", got ${current.nodeName}`)\n }\n\n // Update cursor\n hydrationCursor = current.nextSibling\n\n return current\n}\n\nfunction hydrateElement(fnode: FNode): Node {\n skipEmptyTextNodes()\n\n const current = hydrationCursor as Element\n const tag = fnode.type as string\n\n // Validate element type\n if (!current || current.nodeType !== Node.ELEMENT_NODE) {\n throw new Error(`Hydration mismatch: expected element <${tag}>, got ${current?.nodeName || 'nothing'}`)\n }\n\n if (current.tagName.toLowerCase() !== tag.toLowerCase()) {\n throw new Error(`Hydration mismatch: expected <${tag}>, got <${current.tagName.toLowerCase()}>`)\n }\n\n // Attach event handlers and refs (don't modify DOM structure)\n if (fnode.props) {\n for (const [key, value] of Object.entries(fnode.props)) {\n if (key === 'ref') {\n if (typeof value === 'function') {\n value(current)\n } else if (value && typeof value === 'object' && 'current' in value) {\n value.current = current\n }\n } else if (key.startsWith('on') && typeof value === 'function') {\n const eventName = key.slice(2).toLowerCase()\n current.addEventListener(eventName, value as EventListener)\n\n // Store for reconciliation\n if (!(current as any).__eventHandlers) {\n (current as any).__eventHandlers = {}\n }\n (current as any).__eventHandlers[eventName] = value\n }\n }\n }\n\n // Move cursor past this element\n hydrationCursor = current.nextSibling\n\n // Hydrate children\n if (fnode.children && fnode.children.length > 0) {\n const savedCursor = hydrationCursor\n\n hydrationCursor = current.firstChild\n\n for (const child of fnode.children) {\n hydrateNode(child, current as HTMLElement)\n }\n\n hydrationCursor = savedCursor\n }\n\n return current\n}\n\nfunction hydrateComponent(fnode: FNode, parent: HTMLElement): Node | Node[] | null {\n const Component = fnode.type as Function\n\n // Merge props\n const props = { ...fnode.props }\n if (fnode.children && fnode.children.length > 0) {\n props.children = fnode.children.length === 1\n ? fnode.children[0]\n : fnode.children\n }\n\n // Handle context providers\n const contextId = (Component as any)._contextId\n const isProvider = contextId !== undefined\n let prevContextValue: any\n\n if (isProvider) {\n prevContextValue = pushContext(contextId, props.value)\n }\n\n // Generate key (same logic as render.ts)\n if (!hydratedInstanceRegistry.has(parent)) {\n hydratedInstanceRegistry.set(parent, new Map())\n }\n const parentRegistry = hydratedInstanceRegistry.get(parent)!\n\n const hasExplicitKey = fnode.key !== undefined\n let key: any\n if (hasExplicitKey) {\n key = fnode.key\n } else {\n let instanceCount = 0\n const componentName = (Component as any).name || 'anonymous'\n parentRegistry.forEach((_, k) => {\n if (typeof k === 'string' && k.startsWith(`__auto_${componentName}_`)) {\n instanceCount++\n }\n })\n key = `__auto_${componentName}_${instanceCount}`\n }\n\n // Create component instance\n const instance: DOMComponentInstance = {\n hooks: [],\n hookIndex: 0,\n nodes: [],\n parent,\n fnode,\n props,\n key,\n children: new Set(),\n parentInstance: currentHydratingInstance || undefined\n }\n\n if (currentHydratingInstance) {\n currentHydratingInstance.children.add(instance)\n }\n\n parentRegistry.set(key, instance)\n\n const previousHydratingInstance = currentHydratingInstance\n currentHydratingInstance = instance\n\n try {\n // First render during hydration - just match DOM\n const result = runWithComponent(instance, () => Component(props))\n const nodes = hydrateNode(result, parent)\n instance.nodes = nodes ? (Array.isArray(nodes) ? nodes : [nodes]) : []\n\n // Set up reactive re-rendering for future updates\n let isFirstRender = true\n const renderFn = () => {\n if (isFirstRender) {\n isFirstRender = false\n return // Skip first render, already done during hydration\n }\n\n // Re-render logic (same as render.ts but simplified)\n const currentProps = instance.props\n runWithComponent(instance, () => Component(currentProps))\n\n // For subsequent renders, use full render path\n // This will be handled by the normal reconciliation\n }\n\n instance.renderFn = renderFn\n unsafeEffect(renderFn)\n\n return instance.nodes\n } finally {\n currentHydratingInstance = previousHydratingInstance\n\n if (isProvider) {\n popContext(contextId, prevContextValue)\n }\n }\n}\n","import { use } from '../../core/use'\nimport { hook } from '../../core/hook'\nimport { render } from '../render'\nimport type { PortalProps } from './types'\n\n/**\n * Portal component that renders children into a different DOM node\n *\n * @example\n * ```tsx\n * function Modal({ isOpen, onClose, children }) {\n * if (!isOpen) return null\n *\n * return (\n * <Portal target={document.body}>\n * <div class=\"modal-backdrop\" onClick={onClose}>\n * <div class=\"modal-content\" onClick={e => e.stopPropagation()}>\n * {children}\n * </div>\n * </div>\n * </Portal>\n * )\n * }\n * ```\n */\nexport function Portal(props: PortalProps): null {\n const { target, children } = props\n\n // Store rendered container for cleanup\n const portalState = hook(() => ({\n container: null as HTMLElement | null,\n mounted: false\n }))\n\n use(({ onCleanup }) => {\n // Resolve target container\n let container: HTMLElement | null = null\n\n if (typeof target === 'string') {\n container = document.querySelector(target)\n } else if (target instanceof HTMLElement) {\n container = target\n }\n\n if (!container) {\n console.warn('[Flexium Portal] Target container not found:', target)\n return\n }\n\n // Create a wrapper div to contain portal content\n const portalWrapper = document.createElement('div')\n portalWrapper.setAttribute('data-flexium-portal', 'true')\n container.appendChild(portalWrapper)\n\n portalState.container = portalWrapper\n portalState.mounted = true\n\n // Render children into the portal wrapper\n render(children, portalWrapper)\n\n // Cleanup function\n onCleanup(() => {\n if (portalWrapper.parentNode) {\n portalWrapper.parentNode.removeChild(portalWrapper)\n }\n portalState.container = null\n portalState.mounted = false\n })\n }, [target, children])\n\n // Portal renders nothing in its original location\n return null\n}\n","import { Context } from '../../core/context'\nimport { use } from '../../core/use'\nimport type { SuspenseContextValue } from './types'\n\nconst defaultValue: SuspenseContextValue = {\n register: () => {},\n hasBoundary: false\n}\n\nexport const SuspenseCtx = new Context<SuspenseContextValue>(defaultValue)\n\nexport function suspenseContext(): SuspenseContextValue {\n const [value] = use(SuspenseCtx)\n return value\n}\n","import { use } from '../../core/use'\nimport { hook } from '../../core/hook'\nimport { SuspenseCtx } from './suspenseContext'\nimport type { SuspenseProps, SuspenseContextValue } from './types'\nimport type { FNodeChild } from '../types'\n\n/**\n * Suspense component that shows fallback while children are loading\n *\n * @example\n * ```tsx\n * const Dashboard = lazy(() => import('./Dashboard'))\n *\n * function App() {\n * return (\n * <Suspense fallback={<div>Loading...</div>}>\n * <Dashboard />\n * </Suspense>\n * )\n * }\n * ```\n */\nexport function Suspense(props: SuspenseProps): FNodeChild {\n const { fallback, children } = props\n\n // Track pending promises using hook for mutable Set\n const pendingSet = hook(() => new Set<Promise<any>>())\n const [, setPendingCount] = use(0)\n const [showFallback, setShowFallback] = use(false)\n\n // Register function for lazy components\n const register = (promise: Promise<any>) => {\n if (!pendingSet.has(promise)) {\n // Add to pending set\n pendingSet.add(promise)\n setPendingCount(c => c + 1)\n setShowFallback(true)\n\n // Wait for resolution\n promise.finally(() => {\n pendingSet.delete(promise)\n setPendingCount(c => {\n const newCount = c - 1\n if (newCount === 0) {\n setShowFallback(false)\n }\n return newCount\n })\n })\n }\n }\n\n const contextValue: SuspenseContextValue = {\n register,\n hasBoundary: true\n }\n\n // Render fallback or children based on pending state\n const content = showFallback ? fallback : children\n\n // Wrap content with Suspense context provider\n return {\n type: SuspenseCtx.Provider,\n props: { value: contextValue },\n children: [content],\n key: undefined\n } as any\n}\n","import { use } from '../../core/use'\nimport { hook } from '../../core/hook'\nimport type { FNodeChild } from '../types'\nimport type { ErrorInfo, ErrorBoundaryProps } from './types'\n\n// Component name stack for error messages\nlet componentNameStack: string[] = []\n\nexport function pushComponentName(name: string): void {\n componentNameStack.push(name)\n}\n\nexport function popComponentName(): void {\n componentNameStack.pop()\n}\n\nexport function getComponentStack(): string {\n return componentNameStack\n .map(name => ` at ${name}`)\n .reverse()\n .join('\\n')\n}\n\n// Stack of error boundaries for nested error propagation\ninterface ErrorBoundaryInstance {\n handleError: (error: Error, phase: 'render' | 'effect' | 'event') => void\n}\n\nlet errorBoundaryStack: ErrorBoundaryInstance[] = []\n\nexport function pushErrorBoundary(instance: ErrorBoundaryInstance): void {\n errorBoundaryStack.push(instance)\n}\n\nexport function popErrorBoundary(): void {\n errorBoundaryStack.pop()\n}\n\nexport function getNearestErrorBoundary(): ErrorBoundaryInstance | null {\n return errorBoundaryStack[errorBoundaryStack.length - 1] || null\n}\n\n/**\n * ErrorBoundary component that catches errors in its children and displays fallback UI\n *\n * @example\n * ```tsx\n * <ErrorBoundary\n * fallback={(error, info) => <div>Error: {error.message}</div>}\n * onError={(error, info) => console.error(error)}\n * >\n * <App />\n * </ErrorBoundary>\n * ```\n */\nexport function ErrorBoundary(props: ErrorBoundaryProps): FNodeChild {\n const { fallback, onError, children, resetKey } = props\n\n // Error state\n const [errorState, setErrorState] = use<{\n error: Error | null\n info: ErrorInfo | null\n }>({ error: null, info: null })\n\n // Track reset key changes to clear error\n const prevResetKeyRef = hook(() => ({ current: resetKey }))\n\n if (resetKey !== prevResetKeyRef.current) {\n prevResetKeyRef.current = resetKey\n if (errorState.error !== null) {\n setErrorState({ error: null, info: null })\n }\n }\n\n // Error boundary instance\n const boundaryInstance: ErrorBoundaryInstance = {\n handleError: (error: Error, phase: 'render' | 'effect' | 'event') => {\n const info: ErrorInfo = {\n componentStack: getComponentStack(),\n phase\n }\n\n // Call error callback\n onError?.(error, info)\n\n // Update error state (triggers re-render with fallback)\n setErrorState({ error, info })\n }\n }\n\n // If we have an error, render fallback\n if (errorState.error) {\n if (typeof fallback === 'function') {\n return fallback(errorState.error, errorState.info!)\n }\n return fallback\n }\n\n // Push boundary onto stack for children to use\n pushErrorBoundary(boundaryInstance)\n\n try {\n // Return children - they will be rendered with this boundary active\n return children\n } finally {\n popErrorBoundary()\n }\n}\n","import { suspenseContext } from './suspenseContext'\nimport type { FNodeChild } from '../types'\nimport type { LazyComponent } from './types'\n\n/**\n * Creates a lazy-loaded component for code splitting\n *\n * @example\n * ```tsx\n * const Dashboard = lazy(() => import('./Dashboard'))\n * const Settings = lazy(() => import('./Settings'))\n *\n * function App() {\n * return (\n * <Suspense fallback={<div>Loading...</div>}>\n * <Dashboard />\n * </Suspense>\n * )\n * }\n * ```\n */\nexport function lazy<P = {}>(\n loader: () => Promise<{ default: (props: P) => FNodeChild }>\n): LazyComponent<P> {\n // Shared state across all instances\n let resolved: ((props: P) => FNodeChild) | null = null\n let promise: Promise<any> | null = null\n let error: Error | null = null\n\n // The wrapper component\n const LazyWrapper = (props: P): FNodeChild => {\n // If already resolved, render immediately\n if (resolved) {\n return resolved(props)\n }\n\n // If error occurred, throw it (will be caught by ErrorBoundary)\n if (error) {\n throw error\n }\n\n // Get suspense context\n const suspense = suspenseContext()\n\n // Start loading if not already\n if (!promise) {\n promise = loader()\n .then(module => {\n resolved = module.default\n })\n .catch(err => {\n error = err instanceof Error ? err : new Error(String(err))\n })\n }\n\n // Register with suspense boundary if available\n if (suspense.hasBoundary) {\n suspense.register(promise)\n }\n\n // Return null - Suspense will show fallback\n return null\n }\n\n // Mark as lazy component\n ;(LazyWrapper as LazyComponent<P>)._lazy = true\n ;(LazyWrapper as LazyComponent<P>)._loader = loader\n\n return LazyWrapper as LazyComponent<P>\n}\n"]}
1
+ {"version":3,"sources":["../src/dom/f.ts","../src/dom/hydrate.ts","../src/dom/components/Portal.tsx","../src/dom/components/suspenseContext.ts","../src/dom/components/Suspense.tsx","../src/dom/components/ErrorBoundary.tsx","../src/dom/components/lazy.ts"],"names":["f","type","props","children","hydrationCursor","hydratedInstanceRegistry","currentHydratingInstance","hydrate","app","container","options","state","onHydrated","onMismatch","fnode","isFNode","hydrateNode","error","render","value","parent","skipEmptyTextNodes","hydrateTextNode","nodes","child","result","hydrateComponent","hydrateElement","text","current","tag","key","eventName","savedCursor","Component","contextId","isProvider","prevContextValue","pushContext","parentRegistry","hasExplicitKey","instanceCount","componentName","_","k","instance","previousHydratingInstance","runWithComponent","isFirstRender","renderFn","currentProps","unsafeEffect","popContext","Portal","target","portalState","hook","use","onCleanup","portalWrapper","defaultValue","SuspenseCtx","Context","suspenseContext","Suspense","fallback","pendingSet","setPendingCount","showFallback","setShowFallback","contextValue","promise","newCount","content","ErrorBoundary","onError","resetKey","errorState","setErrorState","prevResetKeyRef","lazy","loader","resolved","LazyWrapper","suspense","module","err"],"mappings":"sOAKO,SAASA,CAAAA,CACZC,CAAAA,CACAC,CAAAA,CAAAA,GACGC,CAAAA,CACE,CACL,OAAO,CACH,IAAA,CAAAF,CAAAA,CACA,KAAA,CAAOC,CAAAA,EAAS,GAChB,QAAA,CAAAC,CAAAA,CACA,GAAA,CAAKD,CAAAA,EAAO,GAChB,CACJ,CCTA,IACIE,CAAAA,CAA+B,IAAA,CAkC7BC,EAA2B,IAAI,OAAA,CACjCC,CAAAA,CAAwD,KAarD,SAASC,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CAA0B,EAAC,CACrB,CACN,GAAM,CAAE,MAAAC,CAAAA,CAAO,UAAA,CAAAC,CAAAA,CAAY,UAAA,CAAAC,CAAW,CAAA,CAAIH,CAAAA,CAO1CN,CAAAA,CAAkBK,CAAAA,CAAU,WAE5B,GAAI,CAEF,IAAIK,CAAAA,CACA,OA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AW,MACb,OAAI,OAAOZ,CAAAA,EAAa,UAAA,CACfA,CAAAA,CAASY,CAAAA,CAAW,MAAOA,CAAAA,CAAW,IAAK,EAE7CZ,CAAAA,CAMT,GAAI,CAEF,OAAO9D,CACT,CAAA,OAAE,CAEF,CACF,CCtFO,SAAS6E,EACdC,CAAAA,CACkB,CAElB,IAAIC,CAAAA,CAA8C,IAAA,CAC9CX,CAAAA,CAA+B,KAC/BtD,CAAAA,CAAsB,IAAA,CAGpBkE,EAAejF,CAAAA,EAAyB,CAE5C,GAAIgF,CAAAA,CACF,OAAOA,CAAAA,CAAShF,CAAK,CAAA,CAIvB,GAAIe,EACF,MAAMA,CAAAA,CAIR,IAAMmE,CAAAA,CAAWrB,CAAAA,GAGjB,OAAKQ,CAAAA,GACHA,CAAAA,CAAUU,CAAAA,EAAO,CACd,IAAA,CAAKI,GAAU,CACdH,CAAAA,CAAWG,EAAO,QACpB,CAAC,EACA,KAAA,CAAMC,CAAAA,EAAO,CACZrE,CAAAA,CAAQqE,CAAAA,YAAe,KAAA,CAAQA,EAAM,IAAI,KAAA,CAAM,OAAOA,CAAG,CAAC,EAC5D,CAAC,CAAA,CAAA,CAIDF,CAAAA,CAAS,WAAA,EACXA,CAAAA,CAAS,QAAA,CAASb,CAAO,CAAA,CAIpB,IACT,EAGC,OAACY,CAAAA,CAAiC,MAAQ,IAAA,CACzCA,CAAAA,CAAiC,OAAA,CAAUF,CAAAA,CAEtCE,CACT","file":"dom.mjs","sourcesContent":["import type { FNode } from './types'\n\n/**\n * f() - Create FNodes without JSX\n */\nexport function f(\n type: string | Function,\n props?: any,\n ...children: any[]\n): FNode {\n return {\n type,\n props: props || {},\n children,\n key: props?.key\n }\n}\n","import type { FNode, FNodeChild } from './types'\nimport type { SerializedState } from '../server/types'\nimport { runWithComponent, type ComponentInstance } from '../core/hook'\nimport { pushContext, popContext } from '../core/context'\nimport { unsafeEffect } from '../core/lifecycle'\n\n// Hydration state\nlet isHydrating = false\nlet hydrationCursor: Node | null = null\nlet hydrationState: SerializedState | null = null\n\nexport interface HydrateOptions {\n /**\n * Serialized state from server\n * Typically embedded in HTML as JSON script tag\n */\n state?: SerializedState\n\n /**\n * Called when hydration completes successfully\n */\n onHydrated?: () => void\n\n /**\n * Called when hydration fails (falls back to full render)\n */\n onMismatch?: (error: Error) => void\n}\n\n// Extended ComponentInstance for DOM tracking (same as render.ts)\ninterface DOMComponentInstance extends ComponentInstance {\n nodes: Node[]\n parent: HTMLElement\n fnode: any\n props: any\n key?: any\n renderFn?: () => void\n children: Set<DOMComponentInstance>\n parentInstance?: DOMComponentInstance\n}\n\n// Registry for hydrated components\nconst hydratedInstanceRegistry = new WeakMap<HTMLElement, Map<any, DOMComponentInstance>>()\nlet currentHydratingInstance: DOMComponentInstance | null = null\n\nexport function getIsHydrating(): boolean {\n return isHydrating\n}\n\nexport function getHydrationState(): SerializedState | null {\n return hydrationState\n}\n\n/**\n * Hydrate server-rendered HTML with client-side interactivity\n */\nexport function hydrate(\n app: FNodeChild | (() => FNodeChild),\n container: HTMLElement,\n options: HydrateOptions = {}\n): void {\n const { state, onHydrated, onMismatch } = options\n\n // Store state for rehydration\n hydrationState = state || null\n\n // Initialize hydration mode\n isHydrating = true\n hydrationCursor = container.firstChild\n\n try {\n // Normalize input\n let fnode: FNodeChild\n if (typeof app === 'function' && !isFNode(app)) {\n fnode = { type: app, props: {}, children: [], key: undefined }\n } else {\n fnode = app\n }\n\n // Hydrate the tree\n hydrateNode(fnode, container)\n\n onHydrated?.()\n } catch (error) {\n // Hydration mismatch - fall back to full render\n console.warn('[Flexium] Hydration mismatch, falling back to full render:', error)\n onMismatch?.(error as Error)\n\n // Clear and re-render\n container.innerHTML = ''\n // Import dynamically to avoid circular deps\n import('./render').then(({ render }) => {\n render(app, container)\n })\n } finally {\n isHydrating = false\n hydrationCursor = null\n hydrationState = null\n }\n}\n\nfunction isFNode(value: any): value is FNode {\n return value && typeof value === 'object' && 'type' in value && 'props' in value\n}\n\nfunction hydrateNode(fnode: FNodeChild, parent: HTMLElement): Node | Node[] | null {\n // Null/undefined/boolean -> skip empty text nodes\n if (fnode === null || fnode === undefined || typeof fnode === 'boolean') {\n // Server might have rendered an empty text node\n skipEmptyTextNodes()\n return null\n }\n\n // String/number -> expect text node\n if (typeof fnode === 'string' || typeof fnode === 'number') {\n return hydrateTextNode(String(fnode))\n }\n\n // Array -> hydrate each child\n if (Array.isArray(fnode)) {\n const nodes: Node[] = []\n for (const child of fnode) {\n const result = hydrateNode(child, parent)\n if (result) {\n if (Array.isArray(result)) {\n nodes.push(...result)\n } else {\n nodes.push(result)\n }\n }\n }\n return nodes\n }\n\n // Function (standalone) -> wrap in FNode and hydrate\n if (typeof fnode === 'function') {\n const wrappedFnode: FNode = { type: fnode, props: {}, children: [], key: undefined }\n return hydrateComponent(wrappedFnode, parent)\n }\n\n // Object (FNode)\n if (typeof fnode === 'object' && isFNode(fnode)) {\n if (typeof fnode.type === 'string') {\n return hydrateElement(fnode)\n }\n\n if (typeof fnode.type === 'function') {\n return hydrateComponent(fnode, parent)\n }\n }\n\n return null\n}\n\nfunction skipEmptyTextNodes(): void {\n while (\n hydrationCursor &&\n hydrationCursor.nodeType === Node.TEXT_NODE &&\n (!hydrationCursor.textContent || hydrationCursor.textContent.trim() === '')\n ) {\n hydrationCursor = hydrationCursor.nextSibling\n }\n}\n\nfunction hydrateTextNode(text: string): Node | null {\n skipEmptyTextNodes()\n\n const current = hydrationCursor\n\n if (!current) {\n // No node to hydrate - this is okay for conditional rendering\n return null\n }\n\n if (current.nodeType !== Node.TEXT_NODE) {\n // Try to find a text node nearby (whitespace handling)\n if (text.trim() === '') {\n return null\n }\n throw new Error(`Hydration mismatch: expected text node \"${text}\", got ${current.nodeName}`)\n }\n\n // Update cursor\n hydrationCursor = current.nextSibling\n\n return current\n}\n\nfunction hydrateElement(fnode: FNode): Node {\n skipEmptyTextNodes()\n\n const current = hydrationCursor as Element\n const tag = fnode.type as string\n\n // Validate element type\n if (!current || current.nodeType !== Node.ELEMENT_NODE) {\n throw new Error(`Hydration mismatch: expected element <${tag}>, got ${current?.nodeName || 'nothing'}`)\n }\n\n if (current.tagName.toLowerCase() !== tag.toLowerCase()) {\n throw new Error(`Hydration mismatch: expected <${tag}>, got <${current.tagName.toLowerCase()}>`)\n }\n\n // Attach event handlers and refs (don't modify DOM structure)\n if (fnode.props) {\n for (const [key, value] of Object.entries(fnode.props)) {\n if (key === 'ref') {\n if (typeof value === 'function') {\n value(current)\n } else if (value && typeof value === 'object' && 'current' in value) {\n value.current = current\n }\n } else if (key.startsWith('on') && typeof value === 'function') {\n const eventName = key.slice(2).toLowerCase()\n current.addEventListener(eventName, value as EventListener)\n\n // Store for reconciliation\n if (!(current as any).__eventHandlers) {\n (current as any).__eventHandlers = {}\n }\n (current as any).__eventHandlers[eventName] = value\n }\n }\n }\n\n // Move cursor past this element\n hydrationCursor = current.nextSibling\n\n // Hydrate children\n if (fnode.children && fnode.children.length > 0) {\n const savedCursor = hydrationCursor\n\n hydrationCursor = current.firstChild\n\n for (const child of fnode.children) {\n hydrateNode(child, current as HTMLElement)\n }\n\n hydrationCursor = savedCursor\n }\n\n return current\n}\n\nfunction hydrateComponent(fnode: FNode, parent: HTMLElement): Node | Node[] | null {\n const Component = fnode.type as Function\n\n // Merge props\n const props = { ...fnode.props }\n if (fnode.children && fnode.children.length > 0) {\n props.children = fnode.children.length === 1\n ? fnode.children[0]\n : fnode.children\n }\n\n // Handle context providers\n const contextId = (Component as any)._contextId\n const isProvider = contextId !== undefined\n let prevContextValue: any\n\n if (isProvider) {\n prevContextValue = pushContext(contextId, props.value)\n }\n\n // Generate key (same logic as render.ts)\n if (!hydratedInstanceRegistry.has(parent)) {\n hydratedInstanceRegistry.set(parent, new Map())\n }\n const parentRegistry = hydratedInstanceRegistry.get(parent)!\n\n const hasExplicitKey = fnode.key !== undefined\n let key: any\n if (hasExplicitKey) {\n key = fnode.key\n } else {\n let instanceCount = 0\n const componentName = (Component as any).name || 'anonymous'\n parentRegistry.forEach((_, k) => {\n if (typeof k === 'string' && k.startsWith(`__auto_${componentName}_`)) {\n instanceCount++\n }\n })\n key = `__auto_${componentName}_${instanceCount}`\n }\n\n // Create component instance\n const instance: DOMComponentInstance = {\n hooks: [],\n hookIndex: 0,\n nodes: [],\n parent,\n fnode,\n props,\n key,\n children: new Set(),\n parentInstance: currentHydratingInstance || undefined\n }\n\n if (currentHydratingInstance) {\n currentHydratingInstance.children.add(instance)\n }\n\n parentRegistry.set(key, instance)\n\n const previousHydratingInstance = currentHydratingInstance\n currentHydratingInstance = instance\n\n try {\n // First render during hydration - just match DOM\n const result = runWithComponent(instance, () => Component(props))\n const nodes = hydrateNode(result, parent)\n instance.nodes = nodes ? (Array.isArray(nodes) ? nodes : [nodes]) : []\n\n // Set up reactive re-rendering for future updates\n let isFirstRender = true\n const renderFn = () => {\n if (isFirstRender) {\n isFirstRender = false\n return // Skip first render, already done during hydration\n }\n\n // Re-render logic (same as render.ts but simplified)\n const currentProps = instance.props\n runWithComponent(instance, () => Component(currentProps))\n\n // For subsequent renders, use full render path\n // This will be handled by the normal reconciliation\n }\n\n instance.renderFn = renderFn\n unsafeEffect(renderFn)\n\n return instance.nodes\n } finally {\n currentHydratingInstance = previousHydratingInstance\n\n if (isProvider) {\n popContext(contextId, prevContextValue)\n }\n }\n}\n","import { use } from '../../core/use'\nimport { hook } from '../../core/hook'\nimport { render } from '../render'\nimport type { PortalProps } from './types'\n\n/**\n * Portal component that renders children into a different DOM node\n *\n * @example\n * ```tsx\n * function Modal({ isOpen, onClose, children }) {\n * if (!isOpen) return null\n *\n * return (\n * <Portal target={document.body}>\n * <div class=\"modal-backdrop\" onClick={onClose}>\n * <div class=\"modal-content\" onClick={e => e.stopPropagation()}>\n * {children}\n * </div>\n * </div>\n * </Portal>\n * )\n * }\n * ```\n */\nexport function Portal(props: PortalProps): null {\n const { target, children } = props\n\n // Store rendered container for cleanup\n const portalState = hook(() => ({\n container: null as HTMLElement | null,\n mounted: false\n }))\n\n use(({ onCleanup }) => {\n // Resolve target container\n let container: HTMLElement | null = null\n\n if (typeof target === 'string') {\n container = document.querySelector(target)\n } else if (target instanceof HTMLElement) {\n container = target\n }\n\n if (!container) {\n console.warn('[Flexium Portal] Target container not found:', target)\n return\n }\n\n // Create a wrapper div to contain portal content\n const portalWrapper = document.createElement('div')\n portalWrapper.setAttribute('data-flexium-portal', 'true')\n container.appendChild(portalWrapper)\n\n portalState.container = portalWrapper\n portalState.mounted = true\n\n // Render children into the portal wrapper\n render(children, portalWrapper)\n\n // Cleanup function\n onCleanup(() => {\n if (portalWrapper.parentNode) {\n portalWrapper.parentNode.removeChild(portalWrapper)\n }\n portalState.container = null\n portalState.mounted = false\n })\n }, [target, children])\n\n // Portal renders nothing in its original location\n return null\n}\n","import { Context } from '../../core/context'\nimport { use } from '../../core/use'\nimport type { SuspenseContextValue } from './types'\n\nconst defaultValue: SuspenseContextValue = {\n register: () => {},\n hasBoundary: false\n}\n\nexport const SuspenseCtx = new Context<SuspenseContextValue>(defaultValue)\n\nexport function suspenseContext(): SuspenseContextValue {\n const [value] = use(SuspenseCtx)\n return value\n}\n","import { use } from '../../core/use'\nimport { hook } from '../../core/hook'\nimport { SuspenseCtx } from './suspenseContext'\nimport type { SuspenseProps, SuspenseContextValue } from './types'\nimport type { FNodeChild } from '../types'\n\n/**\n * Suspense component that shows fallback while children are loading\n *\n * @example\n * ```tsx\n * const Dashboard = lazy(() => import('./Dashboard'))\n *\n * function App() {\n * return (\n * <Suspense fallback={<div>Loading...</div>}>\n * <Dashboard />\n * </Suspense>\n * )\n * }\n * ```\n */\nexport function Suspense(props: SuspenseProps): FNodeChild {\n const { fallback, children } = props\n\n // Track pending promises using hook for mutable Set\n const pendingSet = hook(() => new Set<Promise<any>>())\n const [, setPendingCount] = use(0)\n const [showFallback, setShowFallback] = use(false)\n\n // Register function for lazy components\n const register = (promise: Promise<any>) => {\n if (!pendingSet.has(promise)) {\n // Add to pending set\n pendingSet.add(promise)\n setPendingCount(c => c + 1)\n setShowFallback(true)\n\n // Wait for resolution\n promise.finally(() => {\n pendingSet.delete(promise)\n setPendingCount(c => {\n const newCount = c - 1\n if (newCount === 0) {\n setShowFallback(false)\n }\n return newCount\n })\n })\n }\n }\n\n const contextValue: SuspenseContextValue = {\n register,\n hasBoundary: true\n }\n\n // Render fallback or children based on pending state\n const content = showFallback ? fallback : children\n\n // Wrap content with Suspense context provider\n return {\n type: SuspenseCtx.Provider,\n props: { value: contextValue },\n children: [content],\n key: undefined\n } as any\n}\n","import { use } from '../../core/use'\nimport { hook } from '../../core/hook'\nimport type { FNodeChild } from '../types'\nimport type { ErrorInfo, ErrorBoundaryProps } from './types'\n\n// Component name stack for error messages\nlet componentNameStack: string[] = []\n\nexport function pushComponentName(name: string): void {\n componentNameStack.push(name)\n}\n\nexport function popComponentName(): void {\n componentNameStack.pop()\n}\n\nexport function getComponentStack(): string {\n return componentNameStack\n .map(name => ` at ${name}`)\n .reverse()\n .join('\\n')\n}\n\n// Stack of error boundaries for nested error propagation\ninterface ErrorBoundaryInstance {\n handleError: (error: Error, phase: 'render' | 'effect' | 'event') => void\n}\n\nlet errorBoundaryStack: ErrorBoundaryInstance[] = []\n\nexport function pushErrorBoundary(instance: ErrorBoundaryInstance): void {\n errorBoundaryStack.push(instance)\n}\n\nexport function popErrorBoundary(): void {\n errorBoundaryStack.pop()\n}\n\nexport function getNearestErrorBoundary(): ErrorBoundaryInstance | null {\n return errorBoundaryStack[errorBoundaryStack.length - 1] || null\n}\n\n/**\n * ErrorBoundary component that catches errors in its children and displays fallback UI\n *\n * @example\n * ```tsx\n * <ErrorBoundary\n * fallback={(error, info) => <div>Error: {error.message}</div>}\n * onError={(error, info) => console.error(error)}\n * >\n * <App />\n * </ErrorBoundary>\n * ```\n */\nexport function ErrorBoundary(props: ErrorBoundaryProps): FNodeChild {\n const { fallback, onError, children, resetKey } = props\n\n // Error state\n const [errorState, setErrorState] = use<{\n error: Error | null\n info: ErrorInfo | null\n }>({ error: null, info: null })\n\n // Track reset key changes to clear error\n const prevResetKeyRef = hook(() => ({ current: resetKey }))\n\n if (resetKey !== prevResetKeyRef.current) {\n prevResetKeyRef.current = resetKey\n if (errorState.error !== null) {\n setErrorState({ error: null, info: null })\n }\n }\n\n // Error boundary instance\n const boundaryInstance: ErrorBoundaryInstance = {\n handleError: (error: Error, phase: 'render' | 'effect' | 'event') => {\n const info: ErrorInfo = {\n componentStack: getComponentStack(),\n phase\n }\n\n // Call error callback\n onError?.(error, info)\n\n // Update error state (triggers re-render with fallback)\n setErrorState({ error, info })\n }\n }\n\n // If we have an error, render fallback\n if (errorState.error) {\n if (typeof fallback === 'function') {\n return fallback(errorState.error, errorState.info!)\n }\n return fallback\n }\n\n // Push boundary onto stack for children to use\n pushErrorBoundary(boundaryInstance)\n\n try {\n // Return children - they will be rendered with this boundary active\n return children\n } finally {\n popErrorBoundary()\n }\n}\n","import { suspenseContext } from './suspenseContext'\nimport type { FNodeChild } from '../types'\nimport type { LazyComponent } from './types'\n\n/**\n * Creates a lazy-loaded component for code splitting\n *\n * @example\n * ```tsx\n * const Dashboard = lazy(() => import('./Dashboard'))\n * const Settings = lazy(() => import('./Settings'))\n *\n * function App() {\n * return (\n * <Suspense fallback={<div>Loading...</div>}>\n * <Dashboard />\n * </Suspense>\n * )\n * }\n * ```\n */\nexport function lazy<P = {}>(\n loader: () => Promise<{ default: (props: P) => FNodeChild }>\n): LazyComponent<P> {\n // Shared state across all instances\n let resolved: ((props: P) => FNodeChild) | null = null\n let promise: Promise<any> | null = null\n let error: Error | null = null\n\n // The wrapper component\n const LazyWrapper = (props: P): FNodeChild => {\n // If already resolved, render immediately\n if (resolved) {\n return resolved(props)\n }\n\n // If error occurred, throw it (will be caught by ErrorBoundary)\n if (error) {\n throw error\n }\n\n // Get suspense context\n const suspense = suspenseContext()\n\n // Start loading if not already\n if (!promise) {\n promise = loader()\n .then(module => {\n resolved = module.default\n })\n .catch(err => {\n error = err instanceof Error ? err : new Error(String(err))\n })\n }\n\n // Register with suspense boundary if available\n if (suspense.hasBoundary) {\n suspense.register(promise)\n }\n\n // Return null - Suspense will show fallback\n return null\n }\n\n // Mark as lazy component\n ;(LazyWrapper as LazyComponent<P>)._lazy = true\n ;(LazyWrapper as LazyComponent<P>)._loader = loader\n\n return LazyWrapper as LazyComponent<P>\n}\n"]}
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- declare const VERSION = "0.13.1";
1
+ declare const VERSION = "0.13.2";
2
2
 
3
3
  export { VERSION };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const VERSION = "0.13.1";
1
+ declare const VERSION = "0.13.2";
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var o="0.13.1";exports.VERSION=o;//# sourceMappingURL=index.js.map
1
+ 'use strict';var o="0.13.2";exports.VERSION=o;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"aAAO,IAAMA,CAAAA,CAAU","file":"index.js","sourcesContent":["export const VERSION = '0.13.1' // Bump version to signify rebuild\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"aAAO,IAAMA,CAAAA,CAAU","file":"index.js","sourcesContent":["export const VERSION = '0.13.2' // Bump version to signify rebuild\n"]}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var o="0.13.1";export{o as VERSION};//# sourceMappingURL=index.mjs.map
1
+ var o="0.13.2";export{o as VERSION};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"AAAO,IAAMA,CAAAA,CAAU","file":"index.mjs","sourcesContent":["export const VERSION = '0.13.1' // Bump version to signify rebuild\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"AAAO,IAAMA,CAAAA,CAAU","file":"index.mjs","sourcesContent":["export const VERSION = '0.13.2' // Bump version to signify rebuild\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkDUGPBZZ3_js=require('./chunk-DUGPBZZ3.js');function x(r,a,e,t,i,s){return chunkDUGPBZZ3_js.a(r,a,e)}Object.defineProperty(exports,"Fragment",{enumerable:true,get:function(){return chunkDUGPBZZ3_js.c}});exports.jsxDEV=x;//# sourceMappingURL=jsx-dev-runtime.js.map
1
+ 'use strict';var chunkLHOIM4QY_js=require('./chunk-LHOIM4QY.js');function x(r,a,e,t,i,s){return chunkLHOIM4QY_js.a(r,a,e)}Object.defineProperty(exports,"Fragment",{enumerable:true,get:function(){return chunkLHOIM4QY_js.c}});exports.jsxDEV=x;//# sourceMappingURL=jsx-dev-runtime.js.map
2
2
  //# sourceMappingURL=jsx-dev-runtime.js.map
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-NY6NOGFU.mjs';export{c as Fragment}from'./chunk-NY6NOGFU.mjs';function x(r,a$1,e,t,i,s){return a(r,a$1,e)}export{x as jsxDEV};//# sourceMappingURL=jsx-dev-runtime.mjs.map
1
+ import {a}from'./chunk-J3542Z77.mjs';export{c as Fragment}from'./chunk-J3542Z77.mjs';function x(r,a$1,e,t,i,s){return a(r,a$1,e)}export{x as jsxDEV};//# sourceMappingURL=jsx-dev-runtime.mjs.map
2
2
  //# sourceMappingURL=jsx-dev-runtime.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkDUGPBZZ3_js=require('./chunk-DUGPBZZ3.js');Object.defineProperty(exports,"Fragment",{enumerable:true,get:function(){return chunkDUGPBZZ3_js.c}});Object.defineProperty(exports,"jsx",{enumerable:true,get:function(){return chunkDUGPBZZ3_js.a}});Object.defineProperty(exports,"jsxs",{enumerable:true,get:function(){return chunkDUGPBZZ3_js.b}});//# sourceMappingURL=jsx-runtime.js.map
1
+ 'use strict';var chunkLHOIM4QY_js=require('./chunk-LHOIM4QY.js');Object.defineProperty(exports,"Fragment",{enumerable:true,get:function(){return chunkLHOIM4QY_js.c}});Object.defineProperty(exports,"jsx",{enumerable:true,get:function(){return chunkLHOIM4QY_js.a}});Object.defineProperty(exports,"jsxs",{enumerable:true,get:function(){return chunkLHOIM4QY_js.b}});//# sourceMappingURL=jsx-runtime.js.map
2
2
  //# sourceMappingURL=jsx-runtime.js.map
@@ -1,2 +1,2 @@
1
- export{c as Fragment,a as jsx,b as jsxs}from'./chunk-NY6NOGFU.mjs';//# sourceMappingURL=jsx-runtime.mjs.map
1
+ export{c as Fragment,a as jsx,b as jsxs}from'./chunk-J3542Z77.mjs';//# sourceMappingURL=jsx-runtime.mjs.map
2
2
  //# sourceMappingURL=jsx-runtime.mjs.map
@@ -1 +1 @@
1
- {"inputs":{"src/index.ts":{"bytes":67,"imports":[],"format":"esm"},"src/core/lifecycle.ts":{"bytes":2686,"imports":[],"format":"esm"},"src/core/reactive.ts":{"bytes":2080,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"}],"format":"esm"},"src/core/hook.ts":{"bytes":986,"imports":[],"format":"esm"},"src/core/devtools.ts":{"bytes":1841,"imports":[],"format":"esm"},"src/core/context.ts":{"bytes":1918,"imports":[],"format":"esm"},"src/core/use.ts":{"bytes":8125,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"./reactive"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"},{"path":"src/core/devtools.ts","kind":"import-statement","original":"./devtools"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/core/ref.ts":{"bytes":812,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"}],"format":"esm"},"src/core/index.ts":{"bytes":315,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"./use"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/ref.ts","kind":"import-statement","original":"./ref"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/dom/f.ts":{"bytes":285,"imports":[],"format":"esm"},"src/dom/render.ts":{"bytes":15127,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"}],"format":"esm"},"src/dom/hydrate.ts":{"bytes":9324,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"},{"path":"src/dom/render.ts","kind":"dynamic-import","original":"./render"}],"format":"esm"},"src/dom/components/Portal.tsx":{"bytes":1937,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/render.ts","kind":"import-statement","original":"../render"}],"format":"esm"},"src/dom/components/suspenseContext.ts":{"bytes":412,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"}],"format":"esm"},"src/dom/components/Suspense.tsx":{"bytes":1770,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/ErrorBoundary.tsx":{"bytes":2854,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"}],"format":"esm"},"src/dom/components/lazy.ts":{"bytes":1767,"imports":[{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/index.ts":{"bytes":598,"imports":[{"path":"src/dom/components/Portal.tsx","kind":"import-statement","original":"./Portal"},{"path":"src/dom/components/Suspense.tsx","kind":"import-statement","original":"./Suspense"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"src/dom/components/lazy.ts","kind":"import-statement","original":"./lazy"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"}],"format":"esm"},"src/dom/index.ts":{"bytes":457,"imports":[{"path":"src/dom/f.ts","kind":"import-statement","original":"./f"},{"path":"src/dom/render.ts","kind":"import-statement","original":"./render"},{"path":"src/dom/hydrate.ts","kind":"import-statement","original":"./hydrate"},{"path":"src/dom/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"},"src/server/escape.ts":{"bytes":364,"imports":[],"format":"esm"},"src/server/serverState.ts":{"bytes":896,"imports":[],"format":"esm"},"src/server/renderToString.ts":{"bytes":6572,"imports":[{"path":"src/server/escape.ts","kind":"import-statement","original":"./escape"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"}],"format":"esm"},"src/server/index.ts":{"bytes":243,"imports":[{"path":"src/server/renderToString.ts","kind":"import-statement","original":"./renderToString"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"}],"format":"esm"},"src/router/types.ts":{"bytes":807,"imports":[],"format":"esm"},"src/router/utils.ts":{"bytes":3745,"imports":[{"path":"./types","kind":"import-statement","external":true}],"format":"esm"},"src/router/router.ts":{"bytes":3207,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/router/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/jsx-runtime.ts":{"bytes":735,"imports":[],"format":"esm"},"src/router/dom/Route.tsx":{"bytes":106,"imports":[],"format":"esm"},"src/router/dom/Routes.tsx":{"bytes":2584,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"},{"path":"src/router/utils.ts","kind":"import-statement","original":"../utils"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./Route"}],"format":"esm"},"src/router/dom/Outlet.tsx":{"bytes":744,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/dom/Link.tsx":{"bytes":447,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/index.ts":{"bytes":309,"imports":[{"path":"src/router/types.ts","kind":"import-statement","original":"./types"},{"path":"src/router/router.ts","kind":"import-statement","original":"./router"},{"path":"src/router/dom/Routes.tsx","kind":"import-statement","original":"./dom/Routes"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./dom/Route"},{"path":"src/router/dom/Outlet.tsx","kind":"import-statement","original":"./dom/Outlet"},{"path":"src/router/dom/Link.tsx","kind":"import-statement","original":"./dom/Link"}],"format":"esm"},"src/canvas/Canvas.tsx":{"bytes":5526,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"flexium/jsx-runtime"}],"format":"esm"},"src/canvas/dom/DrawRect.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawCircle.tsx":{"bytes":303,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawArc.tsx":{"bytes":288,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawLine.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawText.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawPath.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/index.ts":{"bytes":427,"imports":[{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"./Canvas"},{"path":"src/canvas/dom/DrawRect.tsx","kind":"import-statement","original":"./dom/DrawRect"},{"path":"src/canvas/dom/DrawCircle.tsx","kind":"import-statement","original":"./dom/DrawCircle"},{"path":"src/canvas/dom/DrawArc.tsx","kind":"import-statement","original":"./dom/DrawArc"},{"path":"src/canvas/dom/DrawLine.tsx","kind":"import-statement","original":"./dom/DrawLine"},{"path":"src/canvas/dom/DrawText.tsx","kind":"import-statement","original":"./dom/DrawText"},{"path":"src/canvas/dom/DrawPath.tsx","kind":"import-statement","original":"./dom/DrawPath"}],"format":"esm"},"src/interactive/loop.ts":{"bytes":1687,"imports":[],"format":"esm"},"src/interactive/types.ts":{"bytes":1937,"imports":[],"format":"esm"},"src/interactive/keyboard.ts":{"bytes":2398,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/mouse.ts":{"bytes":3174,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/index.ts":{"bytes":215,"imports":[{"path":"src/interactive/loop.ts","kind":"import-statement","original":"./loop"},{"path":"src/interactive/keyboard.ts","kind":"import-statement","original":"./keyboard"},{"path":"src/interactive/mouse.ts","kind":"import-statement","original":"./mouse"}],"format":"esm"},"src/jsx-dev-runtime.ts":{"bytes":211,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"./jsx-runtime"}],"format":"esm"}},"outputs":{"dist/jsx-dev-runtime.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":510},"dist/jsx-dev-runtime.js":{"imports":[{"path":"dist/chunk-DUGPBZZ3.js","kind":"import-statement"}],"exports":["Fragment","jsxDEV"],"entryPoint":"src/jsx-dev-runtime.ts","inputs":{"src/jsx-dev-runtime.ts":{"bytesInOutput":40}},"bytes":122},"dist/render-MJ2LCNSG.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/render-MJ2LCNSG.js":{"imports":[{"path":"dist/chunk-PUXZJ7OV.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["reconcile","render"],"entryPoint":"src/dom/render.ts","inputs":{},"bytes":129},"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":204},"dist/index.js":{"imports":[],"exports":["VERSION"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":15}},"bytes":37},"dist/core.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":1066},"dist/core.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["Context","sync","use","useRef"],"entryPoint":"src/core/index.ts","inputs":{"src/core/index.ts":{"bytesInOutput":0},"src/core/ref.ts":{"bytesInOutput":42}},"bytes":222},"dist/dom.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":27792},"dist/dom.js":{"imports":[{"path":"dist/chunk-PUXZJ7OV.js","kind":"import-statement"},{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"},{"path":"dist/render-MJ2LCNSG.js","kind":"dynamic-import"}],"exports":["ErrorBoundary","Portal","Suspense","f","hydrate","lazy","reconcile","render","suspenseContext"],"entryPoint":"src/dom/index.ts","inputs":{"src/dom/f.ts":{"bytesInOutput":70},"src/dom/index.ts":{"bytesInOutput":0},"src/dom/hydrate.ts":{"bytesInOutput":2733},"src/dom/components/Portal.tsx":{"bytesInOutput":500},"src/dom/components/index.ts":{"bytesInOutput":0},"src/dom/components/suspenseContext.ts":{"bytesInOutput":84},"src/dom/components/Suspense.tsx":{"bytesInOutput":293},"src/dom/components/ErrorBoundary.tsx":{"bytesInOutput":500},"src/dom/components/lazy.ts":{"bytesInOutput":249}},"bytes":4756},"dist/chunk-PUXZJ7OV.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":23945},"dist/chunk-PUXZJ7OV.js":{"imports":[{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["a","b"],"inputs":{"src/dom/render.ts":{"bytesInOutput":4853}},"bytes":4963},"dist/server.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":12945},"dist/server.js":{"imports":[{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["getIsServer","renderToStaticMarkup","renderToString"],"entryPoint":"src/server/index.ts","inputs":{"src/server/escape.ts":{"bytesInOutput":157},"src/server/serverState.ts":{"bytesInOutput":186},"src/server/renderToString.ts":{"bytesInOutput":2125},"src/server/index.ts":{"bytesInOutput":0}},"bytes":2594},"dist/router.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":17327},"dist/router.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"},{"path":"dist/chunk-DUGPBZZ3.js","kind":"import-statement"}],"exports":["Link","Outlet","Route","Routes","useLocation","useNavigate","useParams","useQuery","useRouter"],"entryPoint":"src/router/index.ts","inputs":{"src/router/index.ts":{"bytesInOutput":0},"src/router/utils.ts":{"bytesInOutput":1073},"src/router/router.ts":{"bytesInOutput":859},"src/router/dom/Route.tsx":{"bytesInOutput":26},"src/router/dom/Routes.tsx":{"bytesInOutput":638},"src/router/dom/Outlet.tsx":{"bytesInOutput":244},"src/router/dom/Link.tsx":{"bytesInOutput":133}},"bytes":3255},"dist/canvas.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":12688},"dist/canvas.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"},{"path":"dist/chunk-DUGPBZZ3.js","kind":"import-statement"}],"exports":["Canvas","DrawArc","DrawCircle","DrawLine","DrawPath","DrawRect","DrawText"],"entryPoint":"src/canvas/index.ts","inputs":{"src/canvas/Canvas.tsx":{"bytesInOutput":1875},"src/canvas/index.ts":{"bytesInOutput":0},"src/canvas/dom/DrawRect.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawCircle.tsx":{"bytesInOutput":62},"src/canvas/dom/DrawArc.tsx":{"bytesInOutput":59},"src/canvas/dom/DrawLine.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawText.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawPath.tsx":{"bytesInOutput":60}},"bytes":2485},"dist/interactive.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":15153},"dist/interactive.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["Keys","MouseButton","useKeyboard","useLoop","useMouse"],"entryPoint":"src/interactive/index.ts","inputs":{"src/interactive/loop.ts":{"bytesInOutput":459},"src/interactive/index.ts":{"bytesInOutput":0},"src/interactive/types.ts":{"bytesInOutput":701},"src/interactive/keyboard.ts":{"bytesInOutput":689},"src/interactive/mouse.ts":{"bytesInOutput":1150}},"bytes":3175},"dist/chunk-ACYN2UKT.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":18028},"dist/chunk-ACYN2UKT.js":{"imports":[{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["a","b","c"],"inputs":{"src/core/reactive.ts":{"bytesInOutput":590},"src/core/devtools.ts":{"bytesInOutput":372},"src/core/use.ts":{"bytesInOutput":2043}},"bytes":3143},"dist/chunk-3CKIHQIE.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4599},"dist/chunk-3CKIHQIE.js":{"imports":[],"exports":["a","b","c","d","e"],"inputs":{"src/core/lifecycle.ts":{"bytesInOutput":813}},"bytes":857},"dist/chunk-E6Z7AI4J.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4337},"dist/chunk-E6Z7AI4J.js":{"imports":[],"exports":["a","b","c","d","e","f"],"inputs":{"src/core/hook.ts":{"bytesInOutput":227},"src/core/context.ts":{"bytesInOutput":307}},"bytes":585},"dist/jsx-runtime.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/jsx-runtime.js":{"imports":[{"path":"dist/chunk-DUGPBZZ3.js","kind":"import-statement"}],"exports":["Fragment","jsx","jsxs"],"entryPoint":"src/jsx-runtime.ts","inputs":{},"bytes":81},"dist/chunk-DUGPBZZ3.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":1291},"dist/chunk-DUGPBZZ3.js":{"imports":[],"exports":["a","b","c"],"inputs":{"src/jsx-runtime.ts":{"bytesInOutput":183}},"bytes":213}}}
1
+ {"inputs":{"src/index.ts":{"bytes":67,"imports":[],"format":"esm"},"src/core/lifecycle.ts":{"bytes":2686,"imports":[],"format":"esm"},"src/core/reactive.ts":{"bytes":2080,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"}],"format":"esm"},"src/core/hook.ts":{"bytes":986,"imports":[],"format":"esm"},"src/core/devtools.ts":{"bytes":1841,"imports":[],"format":"esm"},"src/core/context.ts":{"bytes":1918,"imports":[],"format":"esm"},"src/core/use.ts":{"bytes":8125,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"./reactive"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"},{"path":"src/core/devtools.ts","kind":"import-statement","original":"./devtools"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/core/ref.ts":{"bytes":812,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"}],"format":"esm"},"src/core/index.ts":{"bytes":315,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"./use"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/ref.ts","kind":"import-statement","original":"./ref"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/dom/f.ts":{"bytes":285,"imports":[],"format":"esm"},"src/dom/render.ts":{"bytes":15127,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"}],"format":"esm"},"src/dom/hydrate.ts":{"bytes":9324,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"},{"path":"src/dom/render.ts","kind":"dynamic-import","original":"./render"}],"format":"esm"},"src/dom/components/Portal.tsx":{"bytes":1937,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/render.ts","kind":"import-statement","original":"../render"}],"format":"esm"},"src/dom/components/suspenseContext.ts":{"bytes":412,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"}],"format":"esm"},"src/dom/components/Suspense.tsx":{"bytes":1770,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/ErrorBoundary.tsx":{"bytes":2854,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"}],"format":"esm"},"src/dom/components/lazy.ts":{"bytes":1767,"imports":[{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/index.ts":{"bytes":598,"imports":[{"path":"src/dom/components/Portal.tsx","kind":"import-statement","original":"./Portal"},{"path":"src/dom/components/Suspense.tsx","kind":"import-statement","original":"./Suspense"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"src/dom/components/lazy.ts","kind":"import-statement","original":"./lazy"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"}],"format":"esm"},"src/dom/index.ts":{"bytes":373,"imports":[{"path":"src/dom/f.ts","kind":"import-statement","original":"./f"},{"path":"src/dom/render.ts","kind":"import-statement","original":"./render"},{"path":"src/dom/hydrate.ts","kind":"import-statement","original":"./hydrate"},{"path":"src/dom/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"},"src/server/escape.ts":{"bytes":364,"imports":[],"format":"esm"},"src/server/serverState.ts":{"bytes":896,"imports":[],"format":"esm"},"src/server/renderToString.ts":{"bytes":6572,"imports":[{"path":"src/server/escape.ts","kind":"import-statement","original":"./escape"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"}],"format":"esm"},"src/server/index.ts":{"bytes":243,"imports":[{"path":"src/server/renderToString.ts","kind":"import-statement","original":"./renderToString"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"}],"format":"esm"},"src/router/types.ts":{"bytes":807,"imports":[],"format":"esm"},"src/router/utils.ts":{"bytes":3745,"imports":[{"path":"./types","kind":"import-statement","external":true}],"format":"esm"},"src/router/router.ts":{"bytes":3207,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/router/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/jsx-runtime.ts":{"bytes":741,"imports":[],"format":"esm"},"src/router/dom/Route.tsx":{"bytes":106,"imports":[],"format":"esm"},"src/router/dom/Routes.tsx":{"bytes":2590,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"},{"path":"src/router/utils.ts","kind":"import-statement","original":"../utils"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./Route"}],"format":"esm"},"src/router/dom/Outlet.tsx":{"bytes":744,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/dom/Link.tsx":{"bytes":447,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/index.ts":{"bytes":309,"imports":[{"path":"src/router/types.ts","kind":"import-statement","original":"./types"},{"path":"src/router/router.ts","kind":"import-statement","original":"./router"},{"path":"src/router/dom/Routes.tsx","kind":"import-statement","original":"./dom/Routes"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./dom/Route"},{"path":"src/router/dom/Outlet.tsx","kind":"import-statement","original":"./dom/Outlet"},{"path":"src/router/dom/Link.tsx","kind":"import-statement","original":"./dom/Link"}],"format":"esm"},"src/canvas/Canvas.tsx":{"bytes":5526,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"flexium/jsx-runtime"}],"format":"esm"},"src/canvas/dom/DrawRect.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawCircle.tsx":{"bytes":303,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawArc.tsx":{"bytes":288,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawLine.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawText.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawPath.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/index.ts":{"bytes":427,"imports":[{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"./Canvas"},{"path":"src/canvas/dom/DrawRect.tsx","kind":"import-statement","original":"./dom/DrawRect"},{"path":"src/canvas/dom/DrawCircle.tsx","kind":"import-statement","original":"./dom/DrawCircle"},{"path":"src/canvas/dom/DrawArc.tsx","kind":"import-statement","original":"./dom/DrawArc"},{"path":"src/canvas/dom/DrawLine.tsx","kind":"import-statement","original":"./dom/DrawLine"},{"path":"src/canvas/dom/DrawText.tsx","kind":"import-statement","original":"./dom/DrawText"},{"path":"src/canvas/dom/DrawPath.tsx","kind":"import-statement","original":"./dom/DrawPath"}],"format":"esm"},"src/interactive/loop.ts":{"bytes":1687,"imports":[],"format":"esm"},"src/interactive/types.ts":{"bytes":1937,"imports":[],"format":"esm"},"src/interactive/keyboard.ts":{"bytes":2398,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/mouse.ts":{"bytes":3174,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/index.ts":{"bytes":215,"imports":[{"path":"src/interactive/loop.ts","kind":"import-statement","original":"./loop"},{"path":"src/interactive/keyboard.ts","kind":"import-statement","original":"./keyboard"},{"path":"src/interactive/mouse.ts","kind":"import-statement","original":"./mouse"}],"format":"esm"},"src/jsx-dev-runtime.ts":{"bytes":211,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"./jsx-runtime"}],"format":"esm"}},"outputs":{"dist/jsx-dev-runtime.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":510},"dist/jsx-dev-runtime.js":{"imports":[{"path":"dist/chunk-LHOIM4QY.js","kind":"import-statement"}],"exports":["Fragment","jsxDEV"],"entryPoint":"src/jsx-dev-runtime.ts","inputs":{"src/jsx-dev-runtime.ts":{"bytesInOutput":40}},"bytes":122},"dist/render-MJ2LCNSG.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/render-MJ2LCNSG.js":{"imports":[{"path":"dist/chunk-PUXZJ7OV.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["reconcile","render"],"entryPoint":"src/dom/render.ts","inputs":{},"bytes":129},"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":204},"dist/index.js":{"imports":[],"exports":["VERSION"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":15}},"bytes":37},"dist/core.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":1066},"dist/core.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["Context","sync","use","useRef"],"entryPoint":"src/core/index.ts","inputs":{"src/core/index.ts":{"bytesInOutput":0},"src/core/ref.ts":{"bytesInOutput":42}},"bytes":222},"dist/dom.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":27792},"dist/dom.js":{"imports":[{"path":"dist/chunk-PUXZJ7OV.js","kind":"import-statement"},{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"},{"path":"dist/render-MJ2LCNSG.js","kind":"dynamic-import"}],"exports":["ErrorBoundary","Portal","Suspense","f","hydrate","lazy","render"],"entryPoint":"src/dom/index.ts","inputs":{"src/dom/f.ts":{"bytesInOutput":70},"src/dom/index.ts":{"bytesInOutput":0},"src/dom/hydrate.ts":{"bytesInOutput":2733},"src/dom/components/Portal.tsx":{"bytesInOutput":500},"src/dom/components/index.ts":{"bytesInOutput":0},"src/dom/components/suspenseContext.ts":{"bytesInOutput":84},"src/dom/components/Suspense.tsx":{"bytesInOutput":293},"src/dom/components/ErrorBoundary.tsx":{"bytesInOutput":500},"src/dom/components/lazy.ts":{"bytesInOutput":249}},"bytes":4713},"dist/chunk-PUXZJ7OV.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":23945},"dist/chunk-PUXZJ7OV.js":{"imports":[{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["a","b"],"inputs":{"src/dom/render.ts":{"bytesInOutput":4853}},"bytes":4963},"dist/server.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":12945},"dist/server.js":{"imports":[{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["getIsServer","renderToStaticMarkup","renderToString"],"entryPoint":"src/server/index.ts","inputs":{"src/server/escape.ts":{"bytesInOutput":157},"src/server/serverState.ts":{"bytesInOutput":186},"src/server/renderToString.ts":{"bytesInOutput":2125},"src/server/index.ts":{"bytesInOutput":0}},"bytes":2594},"dist/router.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":17333},"dist/router.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"},{"path":"dist/chunk-LHOIM4QY.js","kind":"import-statement"}],"exports":["Link","Outlet","Route","Routes","useLocation","useNavigate","useParams","useQuery","useRouter"],"entryPoint":"src/router/index.ts","inputs":{"src/router/index.ts":{"bytesInOutput":0},"src/router/utils.ts":{"bytesInOutput":1073},"src/router/router.ts":{"bytesInOutput":859},"src/router/dom/Route.tsx":{"bytesInOutput":26},"src/router/dom/Routes.tsx":{"bytesInOutput":638},"src/router/dom/Outlet.tsx":{"bytesInOutput":244},"src/router/dom/Link.tsx":{"bytesInOutput":133}},"bytes":3255},"dist/canvas.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":12688},"dist/canvas.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"},{"path":"dist/chunk-LHOIM4QY.js","kind":"import-statement"}],"exports":["Canvas","DrawArc","DrawCircle","DrawLine","DrawPath","DrawRect","DrawText"],"entryPoint":"src/canvas/index.ts","inputs":{"src/canvas/Canvas.tsx":{"bytesInOutput":1875},"src/canvas/index.ts":{"bytesInOutput":0},"src/canvas/dom/DrawRect.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawCircle.tsx":{"bytesInOutput":62},"src/canvas/dom/DrawArc.tsx":{"bytesInOutput":59},"src/canvas/dom/DrawLine.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawText.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawPath.tsx":{"bytesInOutput":60}},"bytes":2485},"dist/interactive.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":15153},"dist/interactive.js":{"imports":[{"path":"dist/chunk-ACYN2UKT.js","kind":"import-statement"},{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["Keys","MouseButton","useKeyboard","useLoop","useMouse"],"entryPoint":"src/interactive/index.ts","inputs":{"src/interactive/loop.ts":{"bytesInOutput":459},"src/interactive/index.ts":{"bytesInOutput":0},"src/interactive/types.ts":{"bytesInOutput":701},"src/interactive/keyboard.ts":{"bytesInOutput":689},"src/interactive/mouse.ts":{"bytesInOutput":1150}},"bytes":3175},"dist/chunk-ACYN2UKT.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":18028},"dist/chunk-ACYN2UKT.js":{"imports":[{"path":"dist/chunk-3CKIHQIE.js","kind":"import-statement"},{"path":"dist/chunk-E6Z7AI4J.js","kind":"import-statement"}],"exports":["a","b","c"],"inputs":{"src/core/reactive.ts":{"bytesInOutput":590},"src/core/devtools.ts":{"bytesInOutput":372},"src/core/use.ts":{"bytesInOutput":2043}},"bytes":3143},"dist/chunk-3CKIHQIE.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4599},"dist/chunk-3CKIHQIE.js":{"imports":[],"exports":["a","b","c","d","e"],"inputs":{"src/core/lifecycle.ts":{"bytesInOutput":813}},"bytes":857},"dist/chunk-E6Z7AI4J.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4337},"dist/chunk-E6Z7AI4J.js":{"imports":[],"exports":["a","b","c","d","e","f"],"inputs":{"src/core/hook.ts":{"bytesInOutput":227},"src/core/context.ts":{"bytesInOutput":307}},"bytes":585},"dist/jsx-runtime.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/jsx-runtime.js":{"imports":[{"path":"dist/chunk-LHOIM4QY.js","kind":"import-statement"}],"exports":["Fragment","jsx","jsxs"],"entryPoint":"src/jsx-runtime.ts","inputs":{},"bytes":81},"dist/chunk-LHOIM4QY.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":1297},"dist/chunk-LHOIM4QY.js":{"imports":[],"exports":["a","b","c"],"inputs":{"src/jsx-runtime.ts":{"bytesInOutput":183}},"bytes":213}}}
@@ -1 +1 @@
1
- {"inputs":{"src/index.ts":{"bytes":67,"imports":[],"format":"esm"},"src/core/lifecycle.ts":{"bytes":2686,"imports":[],"format":"esm"},"src/core/reactive.ts":{"bytes":2080,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"}],"format":"esm"},"src/core/hook.ts":{"bytes":986,"imports":[],"format":"esm"},"src/core/devtools.ts":{"bytes":1841,"imports":[],"format":"esm"},"src/core/context.ts":{"bytes":1918,"imports":[],"format":"esm"},"src/core/use.ts":{"bytes":8125,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"./reactive"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"},{"path":"src/core/devtools.ts","kind":"import-statement","original":"./devtools"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/core/ref.ts":{"bytes":812,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"}],"format":"esm"},"src/core/index.ts":{"bytes":315,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"./use"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/ref.ts","kind":"import-statement","original":"./ref"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/dom/f.ts":{"bytes":285,"imports":[],"format":"esm"},"src/dom/render.ts":{"bytes":15127,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"}],"format":"esm"},"src/dom/hydrate.ts":{"bytes":9324,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"},{"path":"src/dom/render.ts","kind":"dynamic-import","original":"./render"}],"format":"esm"},"src/dom/components/Portal.tsx":{"bytes":1937,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/render.ts","kind":"import-statement","original":"../render"}],"format":"esm"},"src/dom/components/suspenseContext.ts":{"bytes":412,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"}],"format":"esm"},"src/dom/components/Suspense.tsx":{"bytes":1770,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/ErrorBoundary.tsx":{"bytes":2854,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"}],"format":"esm"},"src/dom/components/lazy.ts":{"bytes":1767,"imports":[{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/index.ts":{"bytes":598,"imports":[{"path":"src/dom/components/Portal.tsx","kind":"import-statement","original":"./Portal"},{"path":"src/dom/components/Suspense.tsx","kind":"import-statement","original":"./Suspense"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"src/dom/components/lazy.ts","kind":"import-statement","original":"./lazy"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"}],"format":"esm"},"src/dom/index.ts":{"bytes":457,"imports":[{"path":"src/dom/f.ts","kind":"import-statement","original":"./f"},{"path":"src/dom/render.ts","kind":"import-statement","original":"./render"},{"path":"src/dom/hydrate.ts","kind":"import-statement","original":"./hydrate"},{"path":"src/dom/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"},"src/server/escape.ts":{"bytes":364,"imports":[],"format":"esm"},"src/server/serverState.ts":{"bytes":896,"imports":[],"format":"esm"},"src/server/renderToString.ts":{"bytes":6572,"imports":[{"path":"src/server/escape.ts","kind":"import-statement","original":"./escape"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"}],"format":"esm"},"src/server/index.ts":{"bytes":243,"imports":[{"path":"src/server/renderToString.ts","kind":"import-statement","original":"./renderToString"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"}],"format":"esm"},"src/router/types.ts":{"bytes":807,"imports":[],"format":"esm"},"src/router/utils.ts":{"bytes":3745,"imports":[{"path":"./types","kind":"import-statement","external":true}],"format":"esm"},"src/router/router.ts":{"bytes":3207,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/router/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/jsx-runtime.ts":{"bytes":735,"imports":[],"format":"esm"},"src/router/dom/Route.tsx":{"bytes":106,"imports":[],"format":"esm"},"src/router/dom/Routes.tsx":{"bytes":2584,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"},{"path":"src/router/utils.ts","kind":"import-statement","original":"../utils"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./Route"}],"format":"esm"},"src/router/dom/Outlet.tsx":{"bytes":744,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/dom/Link.tsx":{"bytes":447,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/index.ts":{"bytes":309,"imports":[{"path":"src/router/types.ts","kind":"import-statement","original":"./types"},{"path":"src/router/router.ts","kind":"import-statement","original":"./router"},{"path":"src/router/dom/Routes.tsx","kind":"import-statement","original":"./dom/Routes"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./dom/Route"},{"path":"src/router/dom/Outlet.tsx","kind":"import-statement","original":"./dom/Outlet"},{"path":"src/router/dom/Link.tsx","kind":"import-statement","original":"./dom/Link"}],"format":"esm"},"src/canvas/Canvas.tsx":{"bytes":5526,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"flexium/jsx-runtime"}],"format":"esm"},"src/canvas/dom/DrawRect.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawCircle.tsx":{"bytes":303,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawArc.tsx":{"bytes":288,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawLine.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawText.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawPath.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/index.ts":{"bytes":427,"imports":[{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"./Canvas"},{"path":"src/canvas/dom/DrawRect.tsx","kind":"import-statement","original":"./dom/DrawRect"},{"path":"src/canvas/dom/DrawCircle.tsx","kind":"import-statement","original":"./dom/DrawCircle"},{"path":"src/canvas/dom/DrawArc.tsx","kind":"import-statement","original":"./dom/DrawArc"},{"path":"src/canvas/dom/DrawLine.tsx","kind":"import-statement","original":"./dom/DrawLine"},{"path":"src/canvas/dom/DrawText.tsx","kind":"import-statement","original":"./dom/DrawText"},{"path":"src/canvas/dom/DrawPath.tsx","kind":"import-statement","original":"./dom/DrawPath"}],"format":"esm"},"src/interactive/loop.ts":{"bytes":1687,"imports":[],"format":"esm"},"src/interactive/types.ts":{"bytes":1937,"imports":[],"format":"esm"},"src/interactive/keyboard.ts":{"bytes":2398,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/mouse.ts":{"bytes":3174,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/index.ts":{"bytes":215,"imports":[{"path":"src/interactive/loop.ts","kind":"import-statement","original":"./loop"},{"path":"src/interactive/keyboard.ts","kind":"import-statement","original":"./keyboard"},{"path":"src/interactive/mouse.ts","kind":"import-statement","original":"./mouse"}],"format":"esm"},"src/jsx-dev-runtime.ts":{"bytes":211,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"./jsx-runtime"}],"format":"esm"}},"outputs":{"dist/jsx-dev-runtime.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":510},"dist/jsx-dev-runtime.mjs":{"imports":[{"path":"dist/chunk-NY6NOGFU.mjs","kind":"import-statement"}],"exports":["Fragment","jsxDEV"],"entryPoint":"src/jsx-dev-runtime.ts","inputs":{"src/jsx-dev-runtime.ts":{"bytesInOutput":40}},"bytes":123},"dist/render-4HB53K66.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/render-4HB53K66.mjs":{"imports":[{"path":"dist/chunk-TP5HUAIN.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["reconcile","render"],"entryPoint":"src/dom/render.ts","inputs":{},"bytes":132},"dist/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":204},"dist/index.mjs":{"imports":[],"exports":["VERSION"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":15}},"bytes":37},"dist/core.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1066},"dist/core.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["Context","sync","use","useRef"],"entryPoint":"src/core/index.ts","inputs":{"src/core/index.ts":{"bytesInOutput":0},"src/core/ref.ts":{"bytesInOutput":42}},"bytes":225},"dist/dom.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27792},"dist/dom.mjs":{"imports":[{"path":"dist/chunk-TP5HUAIN.mjs","kind":"import-statement"},{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"},{"path":"dist/render-4HB53K66.mjs","kind":"dynamic-import"}],"exports":["ErrorBoundary","Portal","Suspense","f","hydrate","lazy","reconcile","render","suspenseContext"],"entryPoint":"src/dom/index.ts","inputs":{"src/dom/f.ts":{"bytesInOutput":70},"src/dom/index.ts":{"bytesInOutput":0},"src/dom/hydrate.ts":{"bytesInOutput":2734},"src/dom/components/Portal.tsx":{"bytesInOutput":500},"src/dom/components/index.ts":{"bytesInOutput":0},"src/dom/components/suspenseContext.ts":{"bytesInOutput":84},"src/dom/components/Suspense.tsx":{"bytesInOutput":293},"src/dom/components/ErrorBoundary.tsx":{"bytesInOutput":500},"src/dom/components/lazy.ts":{"bytesInOutput":249}},"bytes":4761},"dist/chunk-TP5HUAIN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23945},"dist/chunk-TP5HUAIN.mjs":{"imports":[{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["a","b"],"inputs":{"src/dom/render.ts":{"bytesInOutput":4853}},"bytes":4965},"dist/server.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12945},"dist/server.mjs":{"imports":[{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["getIsServer","renderToStaticMarkup","renderToString"],"entryPoint":"src/server/index.ts","inputs":{"src/server/escape.ts":{"bytesInOutput":157},"src/server/serverState.ts":{"bytesInOutput":186},"src/server/renderToString.ts":{"bytesInOutput":2125},"src/server/index.ts":{"bytesInOutput":0}},"bytes":2595},"dist/router.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17327},"dist/router.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"},{"path":"dist/chunk-NY6NOGFU.mjs","kind":"import-statement"}],"exports":["Link","Outlet","Route","Routes","useLocation","useNavigate","useParams","useQuery","useRouter"],"entryPoint":"src/router/index.ts","inputs":{"src/router/index.ts":{"bytesInOutput":0},"src/router/utils.ts":{"bytesInOutput":1073},"src/router/router.ts":{"bytesInOutput":859},"src/router/dom/Route.tsx":{"bytesInOutput":26},"src/router/dom/Routes.tsx":{"bytesInOutput":638},"src/router/dom/Outlet.tsx":{"bytesInOutput":244},"src/router/dom/Link.tsx":{"bytesInOutput":133}},"bytes":3259},"dist/canvas.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12688},"dist/canvas.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"},{"path":"dist/chunk-NY6NOGFU.mjs","kind":"import-statement"}],"exports":["Canvas","DrawArc","DrawCircle","DrawLine","DrawPath","DrawRect","DrawText"],"entryPoint":"src/canvas/index.ts","inputs":{"src/canvas/Canvas.tsx":{"bytesInOutput":1875},"src/canvas/index.ts":{"bytesInOutput":0},"src/canvas/dom/DrawRect.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawCircle.tsx":{"bytesInOutput":62},"src/canvas/dom/DrawArc.tsx":{"bytesInOutput":59},"src/canvas/dom/DrawLine.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawText.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawPath.tsx":{"bytesInOutput":60}},"bytes":2489},"dist/interactive.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15153},"dist/interactive.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["Keys","MouseButton","useKeyboard","useLoop","useMouse"],"entryPoint":"src/interactive/index.ts","inputs":{"src/interactive/loop.ts":{"bytesInOutput":459},"src/interactive/index.ts":{"bytesInOutput":0},"src/interactive/types.ts":{"bytesInOutput":701},"src/interactive/keyboard.ts":{"bytesInOutput":689},"src/interactive/mouse.ts":{"bytesInOutput":1150}},"bytes":3178},"dist/chunk-3AKECLKA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18028},"dist/chunk-3AKECLKA.mjs":{"imports":[{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["a","b","c"],"inputs":{"src/core/reactive.ts":{"bytesInOutput":590},"src/core/devtools.ts":{"bytesInOutput":372},"src/core/use.ts":{"bytesInOutput":2043}},"bytes":3145},"dist/chunk-NRPWBHKP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4599},"dist/chunk-NRPWBHKP.mjs":{"imports":[],"exports":["a","b","c","d","e"],"inputs":{"src/core/lifecycle.ts":{"bytesInOutput":813}},"bytes":857},"dist/chunk-MI76R42D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4337},"dist/chunk-MI76R42D.mjs":{"imports":[],"exports":["a","b","c","d","e","f"],"inputs":{"src/core/hook.ts":{"bytesInOutput":227},"src/core/context.ts":{"bytesInOutput":307}},"bytes":585},"dist/jsx-runtime.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/jsx-runtime.mjs":{"imports":[{"path":"dist/chunk-NY6NOGFU.mjs","kind":"import-statement"}],"exports":["Fragment","jsx","jsxs"],"entryPoint":"src/jsx-runtime.ts","inputs":{},"bytes":82},"dist/chunk-NY6NOGFU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1291},"dist/chunk-NY6NOGFU.mjs":{"imports":[],"exports":["a","b","c"],"inputs":{"src/jsx-runtime.ts":{"bytesInOutput":183}},"bytes":213}}}
1
+ {"inputs":{"src/index.ts":{"bytes":67,"imports":[],"format":"esm"},"src/core/lifecycle.ts":{"bytes":2686,"imports":[],"format":"esm"},"src/core/reactive.ts":{"bytes":2080,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"}],"format":"esm"},"src/core/hook.ts":{"bytes":986,"imports":[],"format":"esm"},"src/core/devtools.ts":{"bytes":1841,"imports":[],"format":"esm"},"src/core/context.ts":{"bytes":1918,"imports":[],"format":"esm"},"src/core/use.ts":{"bytes":8125,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"./reactive"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"},{"path":"src/core/devtools.ts","kind":"import-statement","original":"./devtools"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/core/ref.ts":{"bytes":812,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"}],"format":"esm"},"src/core/index.ts":{"bytes":315,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"./use"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/ref.ts","kind":"import-statement","original":"./ref"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/dom/f.ts":{"bytes":285,"imports":[],"format":"esm"},"src/dom/render.ts":{"bytes":15127,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"}],"format":"esm"},"src/dom/hydrate.ts":{"bytes":9324,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"},{"path":"src/dom/render.ts","kind":"dynamic-import","original":"./render"}],"format":"esm"},"src/dom/components/Portal.tsx":{"bytes":1937,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/render.ts","kind":"import-statement","original":"../render"}],"format":"esm"},"src/dom/components/suspenseContext.ts":{"bytes":412,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"}],"format":"esm"},"src/dom/components/Suspense.tsx":{"bytes":1770,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/ErrorBoundary.tsx":{"bytes":2854,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../../core/hook"}],"format":"esm"},"src/dom/components/lazy.ts":{"bytes":1767,"imports":[{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"}],"format":"esm"},"src/dom/components/index.ts":{"bytes":598,"imports":[{"path":"src/dom/components/Portal.tsx","kind":"import-statement","original":"./Portal"},{"path":"src/dom/components/Suspense.tsx","kind":"import-statement","original":"./Suspense"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"src/dom/components/lazy.ts","kind":"import-statement","original":"./lazy"},{"path":"src/dom/components/suspenseContext.ts","kind":"import-statement","original":"./suspenseContext"},{"path":"src/dom/components/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"}],"format":"esm"},"src/dom/index.ts":{"bytes":373,"imports":[{"path":"src/dom/f.ts","kind":"import-statement","original":"./f"},{"path":"src/dom/render.ts","kind":"import-statement","original":"./render"},{"path":"src/dom/hydrate.ts","kind":"import-statement","original":"./hydrate"},{"path":"src/dom/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"},"src/server/escape.ts":{"bytes":364,"imports":[],"format":"esm"},"src/server/serverState.ts":{"bytes":896,"imports":[],"format":"esm"},"src/server/renderToString.ts":{"bytes":6572,"imports":[{"path":"src/server/escape.ts","kind":"import-statement","original":"./escape"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"},{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"}],"format":"esm"},"src/server/index.ts":{"bytes":243,"imports":[{"path":"src/server/renderToString.ts","kind":"import-statement","original":"./renderToString"},{"path":"src/server/serverState.ts","kind":"import-statement","original":"./serverState"}],"format":"esm"},"src/router/types.ts":{"bytes":807,"imports":[],"format":"esm"},"src/router/utils.ts":{"bytes":3745,"imports":[{"path":"./types","kind":"import-statement","external":true}],"format":"esm"},"src/router/router.ts":{"bytes":3207,"imports":[{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"},{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/router/utils.ts","kind":"import-statement","original":"./utils"}],"format":"esm"},"src/jsx-runtime.ts":{"bytes":741,"imports":[],"format":"esm"},"src/router/dom/Route.tsx":{"bytes":106,"imports":[],"format":"esm"},"src/router/dom/Routes.tsx":{"bytes":2590,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"},{"path":"src/router/utils.ts","kind":"import-statement","original":"../utils"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./Route"}],"format":"esm"},"src/router/dom/Outlet.tsx":{"bytes":744,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/dom/Link.tsx":{"bytes":447,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"../../jsx-runtime"},{"path":"src/router/router.ts","kind":"import-statement","original":"../router"}],"format":"esm"},"src/router/index.ts":{"bytes":309,"imports":[{"path":"src/router/types.ts","kind":"import-statement","original":"./types"},{"path":"src/router/router.ts","kind":"import-statement","original":"./router"},{"path":"src/router/dom/Routes.tsx","kind":"import-statement","original":"./dom/Routes"},{"path":"src/router/dom/Route.tsx","kind":"import-statement","original":"./dom/Route"},{"path":"src/router/dom/Outlet.tsx","kind":"import-statement","original":"./dom/Outlet"},{"path":"src/router/dom/Link.tsx","kind":"import-statement","original":"./dom/Link"}],"format":"esm"},"src/canvas/Canvas.tsx":{"bytes":5526,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/core/reactive.ts","kind":"import-statement","original":"../core/reactive"},{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"flexium/jsx-runtime"}],"format":"esm"},"src/canvas/dom/DrawRect.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawCircle.tsx":{"bytes":303,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawArc.tsx":{"bytes":288,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawLine.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawText.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawPath.tsx":{"bytes":293,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../../core/use"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/index.ts":{"bytes":427,"imports":[{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"./Canvas"},{"path":"src/canvas/dom/DrawRect.tsx","kind":"import-statement","original":"./dom/DrawRect"},{"path":"src/canvas/dom/DrawCircle.tsx","kind":"import-statement","original":"./dom/DrawCircle"},{"path":"src/canvas/dom/DrawArc.tsx","kind":"import-statement","original":"./dom/DrawArc"},{"path":"src/canvas/dom/DrawLine.tsx","kind":"import-statement","original":"./dom/DrawLine"},{"path":"src/canvas/dom/DrawText.tsx","kind":"import-statement","original":"./dom/DrawText"},{"path":"src/canvas/dom/DrawPath.tsx","kind":"import-statement","original":"./dom/DrawPath"}],"format":"esm"},"src/interactive/loop.ts":{"bytes":1687,"imports":[],"format":"esm"},"src/interactive/types.ts":{"bytes":1937,"imports":[],"format":"esm"},"src/interactive/keyboard.ts":{"bytes":2398,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/mouse.ts":{"bytes":3174,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"../core/use"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/index.ts":{"bytes":215,"imports":[{"path":"src/interactive/loop.ts","kind":"import-statement","original":"./loop"},{"path":"src/interactive/keyboard.ts","kind":"import-statement","original":"./keyboard"},{"path":"src/interactive/mouse.ts","kind":"import-statement","original":"./mouse"}],"format":"esm"},"src/jsx-dev-runtime.ts":{"bytes":211,"imports":[{"path":"src/jsx-runtime.ts","kind":"import-statement","original":"./jsx-runtime"}],"format":"esm"}},"outputs":{"dist/jsx-dev-runtime.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":510},"dist/jsx-dev-runtime.mjs":{"imports":[{"path":"dist/chunk-J3542Z77.mjs","kind":"import-statement"}],"exports":["Fragment","jsxDEV"],"entryPoint":"src/jsx-dev-runtime.ts","inputs":{"src/jsx-dev-runtime.ts":{"bytesInOutput":40}},"bytes":123},"dist/render-4HB53K66.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/render-4HB53K66.mjs":{"imports":[{"path":"dist/chunk-TP5HUAIN.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["reconcile","render"],"entryPoint":"src/dom/render.ts","inputs":{},"bytes":132},"dist/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":204},"dist/index.mjs":{"imports":[],"exports":["VERSION"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":15}},"bytes":37},"dist/core.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1066},"dist/core.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["Context","sync","use","useRef"],"entryPoint":"src/core/index.ts","inputs":{"src/core/index.ts":{"bytesInOutput":0},"src/core/ref.ts":{"bytesInOutput":42}},"bytes":225},"dist/dom.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27792},"dist/dom.mjs":{"imports":[{"path":"dist/chunk-TP5HUAIN.mjs","kind":"import-statement"},{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"},{"path":"dist/render-4HB53K66.mjs","kind":"dynamic-import"}],"exports":["ErrorBoundary","Portal","Suspense","f","hydrate","lazy","render"],"entryPoint":"src/dom/index.ts","inputs":{"src/dom/f.ts":{"bytesInOutput":70},"src/dom/index.ts":{"bytesInOutput":0},"src/dom/hydrate.ts":{"bytesInOutput":2734},"src/dom/components/Portal.tsx":{"bytesInOutput":500},"src/dom/components/index.ts":{"bytesInOutput":0},"src/dom/components/suspenseContext.ts":{"bytesInOutput":84},"src/dom/components/Suspense.tsx":{"bytesInOutput":293},"src/dom/components/ErrorBoundary.tsx":{"bytesInOutput":500},"src/dom/components/lazy.ts":{"bytesInOutput":249}},"bytes":4718},"dist/chunk-TP5HUAIN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23945},"dist/chunk-TP5HUAIN.mjs":{"imports":[{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["a","b"],"inputs":{"src/dom/render.ts":{"bytesInOutput":4853}},"bytes":4965},"dist/server.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12945},"dist/server.mjs":{"imports":[{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["getIsServer","renderToStaticMarkup","renderToString"],"entryPoint":"src/server/index.ts","inputs":{"src/server/escape.ts":{"bytesInOutput":157},"src/server/serverState.ts":{"bytesInOutput":186},"src/server/renderToString.ts":{"bytesInOutput":2125},"src/server/index.ts":{"bytesInOutput":0}},"bytes":2595},"dist/router.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17333},"dist/router.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"},{"path":"dist/chunk-J3542Z77.mjs","kind":"import-statement"}],"exports":["Link","Outlet","Route","Routes","useLocation","useNavigate","useParams","useQuery","useRouter"],"entryPoint":"src/router/index.ts","inputs":{"src/router/index.ts":{"bytesInOutput":0},"src/router/utils.ts":{"bytesInOutput":1073},"src/router/router.ts":{"bytesInOutput":859},"src/router/dom/Route.tsx":{"bytesInOutput":26},"src/router/dom/Routes.tsx":{"bytesInOutput":638},"src/router/dom/Outlet.tsx":{"bytesInOutput":244},"src/router/dom/Link.tsx":{"bytesInOutput":133}},"bytes":3259},"dist/canvas.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12688},"dist/canvas.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"},{"path":"dist/chunk-J3542Z77.mjs","kind":"import-statement"}],"exports":["Canvas","DrawArc","DrawCircle","DrawLine","DrawPath","DrawRect","DrawText"],"entryPoint":"src/canvas/index.ts","inputs":{"src/canvas/Canvas.tsx":{"bytesInOutput":1875},"src/canvas/index.ts":{"bytesInOutput":0},"src/canvas/dom/DrawRect.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawCircle.tsx":{"bytesInOutput":62},"src/canvas/dom/DrawArc.tsx":{"bytesInOutput":59},"src/canvas/dom/DrawLine.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawText.tsx":{"bytesInOutput":60},"src/canvas/dom/DrawPath.tsx":{"bytesInOutput":60}},"bytes":2489},"dist/interactive.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15153},"dist/interactive.mjs":{"imports":[{"path":"dist/chunk-3AKECLKA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["Keys","MouseButton","useKeyboard","useLoop","useMouse"],"entryPoint":"src/interactive/index.ts","inputs":{"src/interactive/loop.ts":{"bytesInOutput":459},"src/interactive/index.ts":{"bytesInOutput":0},"src/interactive/types.ts":{"bytesInOutput":701},"src/interactive/keyboard.ts":{"bytesInOutput":689},"src/interactive/mouse.ts":{"bytesInOutput":1150}},"bytes":3178},"dist/chunk-3AKECLKA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18028},"dist/chunk-3AKECLKA.mjs":{"imports":[{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-MI76R42D.mjs","kind":"import-statement"}],"exports":["a","b","c"],"inputs":{"src/core/reactive.ts":{"bytesInOutput":590},"src/core/devtools.ts":{"bytesInOutput":372},"src/core/use.ts":{"bytesInOutput":2043}},"bytes":3145},"dist/chunk-NRPWBHKP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4599},"dist/chunk-NRPWBHKP.mjs":{"imports":[],"exports":["a","b","c","d","e"],"inputs":{"src/core/lifecycle.ts":{"bytesInOutput":813}},"bytes":857},"dist/chunk-MI76R42D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4337},"dist/chunk-MI76R42D.mjs":{"imports":[],"exports":["a","b","c","d","e","f"],"inputs":{"src/core/hook.ts":{"bytesInOutput":227},"src/core/context.ts":{"bytesInOutput":307}},"bytes":585},"dist/jsx-runtime.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/jsx-runtime.mjs":{"imports":[{"path":"dist/chunk-J3542Z77.mjs","kind":"import-statement"}],"exports":["Fragment","jsx","jsxs"],"entryPoint":"src/jsx-runtime.ts","inputs":{},"bytes":82},"dist/chunk-J3542Z77.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1297},"dist/chunk-J3542Z77.mjs":{"imports":[],"exports":["a","b","c"],"inputs":{"src/jsx-runtime.ts":{"bytesInOutput":183}},"bytes":213}}}
package/dist/router.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkACYN2UKT_js=require('./chunk-ACYN2UKT.js');require('./chunk-3CKIHQIE.js');var chunkE6Z7AI4J_js=require('./chunk-E6Z7AI4J.js'),chunkDUGPBZZ3_js=require('./chunk-DUGPBZZ3.js');function k(t){if(!t)return {};if(typeof URLSearchParams<"u"){let e=new URLSearchParams(t),r={};return e.forEach((n,o)=>r[o]=n),r}return t.substring(1).split("&").reduce((e,r)=>{let[n,o]=r.split("=");return n&&(e[decodeURIComponent(n)]=decodeURIComponent(o||"")),e},{})}function D(t){return !!(t.length>2048||t.includes("__proto__")||t.includes("constructor")||/^\s*javascript:/i.test(t))}function R(t){let e=[];return t.forEach(r=>{if(!r)return;let{path:n,component:o,children:i,beforeEnter:f}=r.props||{},u={path:n||"/",component:o,beforeEnter:f};if(i){let c=Array.isArray(i)?i:[i];u.children=R(c);}!u.children&&r.children&&r.children.length>0&&(u.children=R(r.children)),e.push(u);}),e}function E(t,e){for(let r of t){let n=r.path,o=T(n,e);if(o)return [{route:r,params:o.params,pathname:o.path}]}return null}function T(t,e){let r=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++){let f=r[i],u=n[i];if(f.startsWith(":")){let c=f.slice(1);o[c]=u;}else if(f!==u)return null}return {params:o,path:e}}var L=new chunkE6Z7AI4J_js.c(null),p=new chunkE6Z7AI4J_js.c(0),U=()=>({pathname:"/",search:"",hash:"",query:{}}),w=()=>typeof window>"u"?U():{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,query:k(window.location.search)},l=null,y=null,N=false;function d(){if(l&&y)return [l,y];l=chunkACYN2UKT_js.a(w());let t=e=>{l&&(l.pathname=e.pathname,l.search=e.search,l.hash=e.hash,l.query=e.query);};return y=e=>{if(typeof window>"u")return;if(D(e)){console.error("[Flexium Router] Blocked navigation to unsafe path:",e);return}window.history.pushState({},"",e);let r=w();t(r);},typeof window<"u"&&!N&&(window.addEventListener("popstate",()=>{t(w());}),N=true),[l,y]}function m(){let[t]=chunkACYN2UKT_js.c(L);if(!t)throw new Error("useRouter() must be called within a <Routes> component");return t}function j(){let[,t]=d();return t}function q(){return m().params}function _(){let[t]=d();return t.query}function x(t){return null}function F(t){return t&&typeof t=="object"&&("type"in t||Array.isArray(t))}function Q(t){let[e,r]=d(),n=Array.isArray(t.children)?t.children:[t.children],o=n.filter(s=>F(s)&&s.type===x),i=n.filter(s=>!F(s)||s.type!==x),f=R(o),u=e.pathname,c=E(f,u)||[],A=c.length>0?c[c.length-1].params:{},S={location:e,navigate:r,matches:c,params:A},C=null;if(c.length>0){let s=c[0],P=s.route.component,g=u;s.route.beforeEnter?s.route.beforeEnter(s.params)!==false&&(C=chunkDUGPBZZ3_js.a(p.Provider,{value:1,key:g,children:chunkDUGPBZZ3_js.a(P,{params:s.params,key:g})})):C=chunkDUGPBZZ3_js.a(p.Provider,{value:1,key:g,children:chunkDUGPBZZ3_js.a(P,{params:s.params,key:g})});}return chunkDUGPBZZ3_js.a(L.Provider,{value:S,children:[...i,C]})}function B(){let t=m(),[e]=chunkACYN2UKT_js.c(p),r=e??0,[n]=chunkACYN2UKT_js.c(()=>t.matches);if(r>=n.length)return null;let o=n[r],i=o.route.component;return o.route.beforeEnter&&o.route.beforeEnter(o.params)===false?null:chunkDUGPBZZ3_js.a(p.Provider,{value:r+1,children:chunkDUGPBZZ3_js.a(i,{params:o.params})})}function M(t){let e=m();return chunkDUGPBZZ3_js.a("a",{href:t.to,class:t.class,onclick:r=>{r.preventDefault(),e.navigate(t.to);},children:t.children})}exports.Link=M;exports.Outlet=B;exports.Route=x;exports.Routes=Q;exports.useLocation=d;exports.useNavigate=j;exports.useParams=q;exports.useQuery=_;exports.useRouter=m;//# sourceMappingURL=router.js.map
1
+ 'use strict';var chunkACYN2UKT_js=require('./chunk-ACYN2UKT.js');require('./chunk-3CKIHQIE.js');var chunkE6Z7AI4J_js=require('./chunk-E6Z7AI4J.js'),chunkLHOIM4QY_js=require('./chunk-LHOIM4QY.js');function k(t){if(!t)return {};if(typeof URLSearchParams<"u"){let e=new URLSearchParams(t),r={};return e.forEach((n,o)=>r[o]=n),r}return t.substring(1).split("&").reduce((e,r)=>{let[n,o]=r.split("=");return n&&(e[decodeURIComponent(n)]=decodeURIComponent(o||"")),e},{})}function D(t){return !!(t.length>2048||t.includes("__proto__")||t.includes("constructor")||/^\s*javascript:/i.test(t))}function R(t){let e=[];return t.forEach(r=>{if(!r)return;let{path:n,component:o,children:i,beforeEnter:f}=r.props||{},u={path:n||"/",component:o,beforeEnter:f};if(i){let c=Array.isArray(i)?i:[i];u.children=R(c);}!u.children&&r.children&&r.children.length>0&&(u.children=R(r.children)),e.push(u);}),e}function E(t,e){for(let r of t){let n=r.path,o=T(n,e);if(o)return [{route:r,params:o.params,pathname:o.path}]}return null}function T(t,e){let r=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++){let f=r[i],u=n[i];if(f.startsWith(":")){let c=f.slice(1);o[c]=u;}else if(f!==u)return null}return {params:o,path:e}}var L=new chunkE6Z7AI4J_js.c(null),p=new chunkE6Z7AI4J_js.c(0),U=()=>({pathname:"/",search:"",hash:"",query:{}}),w=()=>typeof window>"u"?U():{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,query:k(window.location.search)},l=null,y=null,N=false;function d(){if(l&&y)return [l,y];l=chunkACYN2UKT_js.a(w());let t=e=>{l&&(l.pathname=e.pathname,l.search=e.search,l.hash=e.hash,l.query=e.query);};return y=e=>{if(typeof window>"u")return;if(D(e)){console.error("[Flexium Router] Blocked navigation to unsafe path:",e);return}window.history.pushState({},"",e);let r=w();t(r);},typeof window<"u"&&!N&&(window.addEventListener("popstate",()=>{t(w());}),N=true),[l,y]}function m(){let[t]=chunkACYN2UKT_js.c(L);if(!t)throw new Error("useRouter() must be called within a <Routes> component");return t}function j(){let[,t]=d();return t}function q(){return m().params}function _(){let[t]=d();return t.query}function x(t){return null}function F(t){return t&&typeof t=="object"&&("type"in t||Array.isArray(t))}function Q(t){let[e,r]=d(),n=Array.isArray(t.children)?t.children:[t.children],o=n.filter(s=>F(s)&&s.type===x),i=n.filter(s=>!F(s)||s.type!==x),f=R(o),u=e.pathname,c=E(f,u)||[],A=c.length>0?c[c.length-1].params:{},S={location:e,navigate:r,matches:c,params:A},C=null;if(c.length>0){let s=c[0],P=s.route.component,g=u;s.route.beforeEnter?s.route.beforeEnter(s.params)!==false&&(C=chunkLHOIM4QY_js.a(p.Provider,{value:1,key:g,children:chunkLHOIM4QY_js.a(P,{params:s.params,key:g})})):C=chunkLHOIM4QY_js.a(p.Provider,{value:1,key:g,children:chunkLHOIM4QY_js.a(P,{params:s.params,key:g})});}return chunkLHOIM4QY_js.a(L.Provider,{value:S,children:[...i,C]})}function B(){let t=m(),[e]=chunkACYN2UKT_js.c(p),r=e??0,[n]=chunkACYN2UKT_js.c(()=>t.matches);if(r>=n.length)return null;let o=n[r],i=o.route.component;return o.route.beforeEnter&&o.route.beforeEnter(o.params)===false?null:chunkLHOIM4QY_js.a(p.Provider,{value:r+1,children:chunkLHOIM4QY_js.a(i,{params:o.params})})}function M(t){let e=m();return chunkLHOIM4QY_js.a("a",{href:t.to,class:t.class,onclick:r=>{r.preventDefault(),e.navigate(t.to);},children:t.children})}exports.Link=M;exports.Outlet=B;exports.Route=x;exports.Routes=Q;exports.useLocation=d;exports.useNavigate=j;exports.useParams=q;exports.useQuery=_;exports.useRouter=m;//# sourceMappingURL=router.js.map
2
2
  //# sourceMappingURL=router.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/router/utils.ts","../src/router/router.ts","../src/router/dom/Route.tsx","../src/router/dom/Routes.tsx","../src/router/dom/Outlet.tsx","../src/router/dom/Link.tsx"],"names":["parseQuery","search","params","result","value","key","accumulator","part","isUnsafePath","path","createRoutesFromChildren","children","routes","child","component","subChildren","beforeEnter","route","nestedChildren","matchRoutes","locationPathname","routePath","matchResult","matchPath","locationPath","routeSegments","locationSegments","routeSegment","locationSegment","RouterCtx","Context","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","useLocation","reactive","updateLocation","newLocation","useRouter","routerContext","use","useNavigate","navigate","useParams","useQuery","location","Route","_props","isFNode","node","Routes","props","currentLocation","childrenList","routeNodes","otherChildren","routeDefinitions","currentPath","matches","matchedContent","rootMatch","Component","routeKey","jsx","Outlet","depthValue","depth","match","Link","event"],"mappings":"oMAGA,SAASA,CAAAA,CAAWC,EAAwC,CAC1D,GAAI,CAACA,CAAAA,CAAQ,OAAO,EAAC,CACrB,GAAI,OAAO,eAAA,CAAoB,GAAA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AAMZ,CAAAA,CAAgBD,CAAAA,EAAU,CAChC,OAAOyB,kBAAAA,CAAE,IAAK,CACV,IAAA,CAAMZ,EAAM,EAAA,CACZ,KAAA,CAAOA,EAAM,KAAA,CACb,OAAA,CAAUkB,CAAAA,EAAiB,CACvBA,CAAAA,CAAM,cAAA,GACN9B,CAAAA,CAAc,QAAA,CAASY,EAAM,EAAE,EACnC,EACA,QAAA,CAAUA,CAAAA,CAAM,QACpB,CAAC,CACL","file":"router.js","sourcesContent":["import { RouteDefinition, RouteMatch } from './types'\n\n// Simple query parser (native URLSearchParams fallback) - internal use only\nfunction parseQuery(search: string): Record<string, string> {\n if (!search) return {}\n if (typeof URLSearchParams !== 'undefined') {\n const params = new URLSearchParams(search)\n const result: Record<string, string> = {}\n params.forEach((value, key) => result[key] = value)\n return result\n }\n return search\n .substring(1)\n .split('&')\n .reduce((accumulator, part) => {\n const [key, value] = part.split('=')\n if (key) accumulator[decodeURIComponent(key)] = decodeURIComponent(value || '')\n return accumulator\n }, {} as Record<string, string>)\n}\n\nfunction isUnsafePath(path: string): boolean {\n // Prevent prototype pollution or massive strings\n if (path.length > 2048) return true\n if (path.includes('__proto__') || path.includes('constructor')) return true\n // Basic XSS check for javascript: protocol\n if (/^\\s*javascript:/i.test(path)) return true\n return false\n}\n\n// Convert children FNodes to RouteDefinitions - internal use only\nfunction createRoutesFromChildren(children: any[]): RouteDefinition[] {\n const routes: RouteDefinition[] = []\n\n children.forEach(child => {\n if (!child) return\n\n // Assuming child is an FNode-like object (config)\n // In Flexium, Route component returns null, but 'createNode' isn't called here.\n // We are traversing the props passed to Router.\n\n const { path, component, children: subChildren, beforeEnter } = child.props || {}\n\n const route: RouteDefinition = {\n path: path || '/',\n component: component,\n beforeEnter\n }\n\n if (subChildren) {\n // If subChildren is array\n const nestedChildren = Array.isArray(subChildren) ? subChildren : [subChildren]\n // We expect the children of a Route to be other Routes\n // However, the 'children' prop in JSX might be the Route components themselves.\n route.children = createRoutesFromChildren(nestedChildren)\n }\n\n // Also check child.children if props.children is empty (direct FNode structure)\n if (!route.children && child.children && child.children.length > 0) {\n route.children = createRoutesFromChildren(child.children)\n }\n\n routes.push(route)\n })\n return routes\n}\n\n// Simple Matcher - internal use only\nfunction matchRoutes(routes: RouteDefinition[], locationPathname: string): RouteMatch[] | null {\n // We want to find the best matching branch\n\n for (const route of routes) {\n // 1. Match current segment\n // Simple exact match or parameter match logic needed?\n // Let's implement simple param matching: /user/:id\n\n const routePath = route.path\n\n const matchResult = matchPath(routePath, locationPathname)\n if (matchResult) {\n return [{ route, params: matchResult.params, pathname: matchResult.path }]\n }\n }\n return null\n}\n\nfunction matchPath(routePath: string, locationPath: string) {\n // 1. Split into segments\n const routeSegments = routePath.split('/').filter(Boolean)\n const locationSegments = locationPath.split('/').filter(Boolean)\n\n if (routeSegments.length !== locationSegments.length) return null\n\n const params: Record<string, string> = {}\n\n for (let i = 0; i < routeSegments.length; i++) {\n const routeSegment = routeSegments[i]\n const locationSegment = locationSegments[i]\n\n if (routeSegment.startsWith(':')) {\n const key = routeSegment.slice(1)\n params[key] = locationSegment\n } else if (routeSegment !== locationSegment) {\n return null\n }\n }\n\n return { params, path: locationPath }\n}\n\n// Export only what's needed by other router files\nexport { parseQuery, isUnsafePath, createRoutesFromChildren, matchRoutes }\n","import { reactive } from '../core/reactive'\nimport { Context } from '../core/context'\nimport { use } from '../core/use'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = new Context<RouterContext>(null as any)\nexport const RouteDepthCtx = new Context<number>(0)\n\n// Helper functions\nconst getDefaultLocation = (): Location => ({\n pathname: '/',\n search: '',\n hash: '',\n query: {},\n})\n\nconst getCurrentLocation = (): Location => {\n if (typeof window === 'undefined') {\n return getDefaultLocation()\n }\n return {\n pathname: window.location.pathname,\n search: window.location.search,\n hash: window.location.hash,\n query: parseQuery(window.location.search),\n }\n}\n\n// Global singleton location state\nlet globalLocation: Location | null = null\nlet globalNavigate: ((path: string) => void) | null = null\nlet popstateListenerAttached = false\n\n// Create location state and navigation (singleton pattern)\nexport function useLocation(): [Location, (path: string) => void] {\n // Return existing singleton if already created\n if (globalLocation && globalNavigate) {\n return [globalLocation, globalNavigate]\n }\n\n // Create a reactive location object (only once)\n globalLocation = reactive<Location>(getCurrentLocation())\n\n const updateLocation = (newLocation: Location) => {\n if (!globalLocation) return\n globalLocation.pathname = newLocation.pathname\n globalLocation.search = newLocation.search\n globalLocation.hash = newLocation.hash\n globalLocation.query = newLocation.query\n }\n\n globalNavigate = (path: string) => {\n if (typeof window === 'undefined') return\n if (isUnsafePath(path)) {\n console.error('[Flexium Router] Blocked navigation to unsafe path:', path)\n return\n }\n window.history.pushState({}, '', path)\n const newLocation = getCurrentLocation()\n updateLocation(newLocation)\n }\n\n // Listen to popstate (only once)\n if (typeof window !== 'undefined' && !popstateListenerAttached) {\n window.addEventListener('popstate', () => {\n updateLocation(getCurrentLocation())\n })\n popstateListenerAttached = true\n }\n\n return [globalLocation, globalNavigate]\n}\n\n// Router hook - returns full router context\nexport function useRouter(): RouterContext {\n const [routerContext] = use(RouterCtx)\n if (!routerContext) {\n throw new Error('useRouter() must be called within a <Routes> component')\n }\n return routerContext\n}\n\n// Navigate hook - returns navigate function\nexport function useNavigate(): (path: string) => void {\n const [, navigate] = useLocation()\n return navigate\n}\n\n// Params hook - returns route params\nexport function useParams<T extends Record<string, string> = Record<string, string>>(): T {\n const router = useRouter()\n return router.params as T\n}\n\n// Query hook - returns query params\nexport function useQuery<T extends Record<string, string> = Record<string, string>>(): T {\n const [location] = useLocation()\n return location.query as T\n}\n","import type { RouteProps } from '../types'\n\nexport function Route(_props: RouteProps) {\n return null\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { FNode, FNodeChild } from '../../dom'\nimport { RouterCtx, RouteDepthCtx, useLocation } from '../router'\nimport { createRoutesFromChildren, matchRoutes } from '../utils'\nimport { Route } from './Route'\n\nfunction isFNode(node: any): node is FNode {\n return node && typeof node === 'object' && ('type' in node || Array.isArray(node))\n}\n\nexport function Routes(props: { children: FNodeChild }) {\n const [currentLocation, navigate] = useLocation()\n\n // Parse children to find <Route> definitions and other content\n let childrenList: any[] = Array.isArray(props.children) ? props.children : [props.children]\n\n // Separate routes from other children (like Nav components)\n const routeNodes = childrenList.filter(child => isFNode(child) && child.type === Route)\n const otherChildren = childrenList.filter(child => !isFNode(child) || child.type !== Route)\n\n // Create route definitions\n const routeDefinitions = createRoutesFromChildren(routeNodes)\n\n // DIRECT access to currentLocation.pathname\n // This should trigger reactive tracking in the component's effect context\n const currentPath = currentLocation.pathname\n const matches = matchRoutes(routeDefinitions, currentPath) || []\n const params = matches.length > 0 ? matches[matches.length - 1].params : {}\n\n const routerContext = {\n location: currentLocation,\n navigate,\n matches: matches,\n params: params\n }\n\n // Render matched component\n let matchedContent: FNodeChild = null\n\n if (matches.length > 0) {\n const rootMatch = matches[0]\n const Component = rootMatch.route.component\n\n // Use pathname as key to force re-mount on route change\n const routeKey = currentPath\n\n // Guard Check\n if (rootMatch.route.beforeEnter) {\n const result = rootMatch.route.beforeEnter(rootMatch.params)\n if (result !== false) {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n } else {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n }\n\n return f(RouterCtx.Provider, {\n value: routerContext,\n children: [...otherChildren, matchedContent]\n })\n}\n","import { use } from '../../core/use'\nimport { jsx as f } from '../../jsx-runtime'\nimport { RouteDepthCtx, useRouter } from '../router'\n\nexport function Outlet() {\n const routerContext = useRouter()\n const [depthValue] = use(RouteDepthCtx)\n const depth = depthValue ?? 0\n\n const [matches] = use(() => routerContext.matches)\n\n if (depth >= matches.length) return null\n\n const match = matches[depth]\n const Component = match.route.component\n\n // Guard\n if (match.route.beforeEnter) {\n if (match.route.beforeEnter(match.params) === false) return null\n }\n\n // Render next level\n return f(RouteDepthCtx.Provider, {\n value: depth + 1,\n children: f(Component, { params: match.params })\n })\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { LinkProps } from '../types'\nimport { useRouter } from '../router'\n\nexport function Link(props: LinkProps) {\n const routerContext = useRouter()\n return f('a', {\n href: props.to,\n class: props.class,\n onclick: (event: Event) => {\n event.preventDefault()\n routerContext.navigate(props.to)\n },\n children: props.children\n })\n}\n"]}
1
+ {"version":3,"sources":["../src/router/utils.ts","../src/router/router.ts","../src/router/dom/Route.tsx","../src/router/dom/Routes.tsx","../src/router/dom/Outlet.tsx","../src/router/dom/Link.tsx"],"names":["parseQuery","search","params","result","value","key","accumulator","part","isUnsafePath","path","createRoutesFromChildren","children","routes","child","component","subChildren","beforeEnter","route","nestedChildren","matchRoutes","locationPathname","routePath","matchResult","matchPath","locationPath","routeSegments","locationSegments","routeSegment","locationSegment","RouterCtx","Context","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","useLocation","reactive","updateLocation","newLocation","useRouter","routerContext","use","useNavigate","navigate","useParams","useQuery","location","Route","_props","isFNode","node","Routes","props","currentLocation","childrenList","routeNodes","otherChildren","routeDefinitions","currentPath","matches","matchedContent","rootMatch","Component","routeKey","jsx","Outlet","depthValue","depth","match","Link","event"],"mappings":"oMAGA,SAASA,CAAAA,CAAWC,EAAwC,CAC1D,GAAI,CAACA,CAAAA,CAAQ,OAAO,EAAC,CACrB,GAAI,OAAO,eAAA,CAAoB,GAAA,CAAa,CAC1C,IAAMC,CAAAA,CAAS,IAAI,eAAA,CAAgBD,CAAM,CAAA,CACnCE,CAAAA,CAAiC,EAAC,CACxC,OAAAD,CAAAA,CAAO,OAAA,CAAQ,CAACE,CAAAA,CAAOC,CAAAA,GAAQF,EAAOE,CAAG,CAAA,CAAID,CAAK,CAAA,CAC3CD,CACT,CACA,OAAOF,CAAAA,CACJ,UAAU,CAAC,CAAA,CACX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A,CAAM,QACpB,CAAC,CACL","file":"router.js","sourcesContent":["import { RouteDefinition, RouteMatch } from './types'\n\n// Simple query parser (native URLSearchParams fallback) - internal use only\nfunction parseQuery(search: string): Record<string, string> {\n if (!search) return {}\n if (typeof URLSearchParams !== 'undefined') {\n const params = new URLSearchParams(search)\n const result: Record<string, string> = {}\n params.forEach((value, key) => result[key] = value)\n return result\n }\n return search\n .substring(1)\n .split('&')\n .reduce((accumulator, part) => {\n const [key, value] = part.split('=')\n if (key) accumulator[decodeURIComponent(key)] = decodeURIComponent(value || '')\n return accumulator\n }, {} as Record<string, string>)\n}\n\nfunction isUnsafePath(path: string): boolean {\n // Prevent prototype pollution or massive strings\n if (path.length > 2048) return true\n if (path.includes('__proto__') || path.includes('constructor')) return true\n // Basic XSS check for javascript: protocol\n if (/^\\s*javascript:/i.test(path)) return true\n return false\n}\n\n// Convert children FNodes to RouteDefinitions - internal use only\nfunction createRoutesFromChildren(children: any[]): RouteDefinition[] {\n const routes: RouteDefinition[] = []\n\n children.forEach(child => {\n if (!child) return\n\n // Assuming child is an FNode-like object (config)\n // In Flexium, Route component returns null, but 'createNode' isn't called here.\n // We are traversing the props passed to Router.\n\n const { path, component, children: subChildren, beforeEnter } = child.props || {}\n\n const route: RouteDefinition = {\n path: path || '/',\n component: component,\n beforeEnter\n }\n\n if (subChildren) {\n // If subChildren is array\n const nestedChildren = Array.isArray(subChildren) ? subChildren : [subChildren]\n // We expect the children of a Route to be other Routes\n // However, the 'children' prop in JSX might be the Route components themselves.\n route.children = createRoutesFromChildren(nestedChildren)\n }\n\n // Also check child.children if props.children is empty (direct FNode structure)\n if (!route.children && child.children && child.children.length > 0) {\n route.children = createRoutesFromChildren(child.children)\n }\n\n routes.push(route)\n })\n return routes\n}\n\n// Simple Matcher - internal use only\nfunction matchRoutes(routes: RouteDefinition[], locationPathname: string): RouteMatch[] | null {\n // We want to find the best matching branch\n\n for (const route of routes) {\n // 1. Match current segment\n // Simple exact match or parameter match logic needed?\n // Let's implement simple param matching: /user/:id\n\n const routePath = route.path\n\n const matchResult = matchPath(routePath, locationPathname)\n if (matchResult) {\n return [{ route, params: matchResult.params, pathname: matchResult.path }]\n }\n }\n return null\n}\n\nfunction matchPath(routePath: string, locationPath: string) {\n // 1. Split into segments\n const routeSegments = routePath.split('/').filter(Boolean)\n const locationSegments = locationPath.split('/').filter(Boolean)\n\n if (routeSegments.length !== locationSegments.length) return null\n\n const params: Record<string, string> = {}\n\n for (let i = 0; i < routeSegments.length; i++) {\n const routeSegment = routeSegments[i]\n const locationSegment = locationSegments[i]\n\n if (routeSegment.startsWith(':')) {\n const key = routeSegment.slice(1)\n params[key] = locationSegment\n } else if (routeSegment !== locationSegment) {\n return null\n }\n }\n\n return { params, path: locationPath }\n}\n\n// Export only what's needed by other router files\nexport { parseQuery, isUnsafePath, createRoutesFromChildren, matchRoutes }\n","import { reactive } from '../core/reactive'\nimport { Context } from '../core/context'\nimport { use } from '../core/use'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = new Context<RouterContext>(null as any)\nexport const RouteDepthCtx = new Context<number>(0)\n\n// Helper functions\nconst getDefaultLocation = (): Location => ({\n pathname: '/',\n search: '',\n hash: '',\n query: {},\n})\n\nconst getCurrentLocation = (): Location => {\n if (typeof window === 'undefined') {\n return getDefaultLocation()\n }\n return {\n pathname: window.location.pathname,\n search: window.location.search,\n hash: window.location.hash,\n query: parseQuery(window.location.search),\n }\n}\n\n// Global singleton location state\nlet globalLocation: Location | null = null\nlet globalNavigate: ((path: string) => void) | null = null\nlet popstateListenerAttached = false\n\n// Create location state and navigation (singleton pattern)\nexport function useLocation(): [Location, (path: string) => void] {\n // Return existing singleton if already created\n if (globalLocation && globalNavigate) {\n return [globalLocation, globalNavigate]\n }\n\n // Create a reactive location object (only once)\n globalLocation = reactive<Location>(getCurrentLocation())\n\n const updateLocation = (newLocation: Location) => {\n if (!globalLocation) return\n globalLocation.pathname = newLocation.pathname\n globalLocation.search = newLocation.search\n globalLocation.hash = newLocation.hash\n globalLocation.query = newLocation.query\n }\n\n globalNavigate = (path: string) => {\n if (typeof window === 'undefined') return\n if (isUnsafePath(path)) {\n console.error('[Flexium Router] Blocked navigation to unsafe path:', path)\n return\n }\n window.history.pushState({}, '', path)\n const newLocation = getCurrentLocation()\n updateLocation(newLocation)\n }\n\n // Listen to popstate (only once)\n if (typeof window !== 'undefined' && !popstateListenerAttached) {\n window.addEventListener('popstate', () => {\n updateLocation(getCurrentLocation())\n })\n popstateListenerAttached = true\n }\n\n return [globalLocation, globalNavigate]\n}\n\n// Router hook - returns full router context\nexport function useRouter(): RouterContext {\n const [routerContext] = use(RouterCtx)\n if (!routerContext) {\n throw new Error('useRouter() must be called within a <Routes> component')\n }\n return routerContext\n}\n\n// Navigate hook - returns navigate function\nexport function useNavigate(): (path: string) => void {\n const [, navigate] = useLocation()\n return navigate\n}\n\n// Params hook - returns route params\nexport function useParams<T extends Record<string, string> = Record<string, string>>(): T {\n const router = useRouter()\n return router.params as T\n}\n\n// Query hook - returns query params\nexport function useQuery<T extends Record<string, string> = Record<string, string>>(): T {\n const [location] = useLocation()\n return location.query as T\n}\n","import type { RouteProps } from '../types'\n\nexport function Route(_props: RouteProps) {\n return null\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { FNode, FNodeChild } from '../../dom/types'\nimport { RouterCtx, RouteDepthCtx, useLocation } from '../router'\nimport { createRoutesFromChildren, matchRoutes } from '../utils'\nimport { Route } from './Route'\n\nfunction isFNode(node: any): node is FNode {\n return node && typeof node === 'object' && ('type' in node || Array.isArray(node))\n}\n\nexport function Routes(props: { children: FNodeChild }) {\n const [currentLocation, navigate] = useLocation()\n\n // Parse children to find <Route> definitions and other content\n let childrenList: any[] = Array.isArray(props.children) ? props.children : [props.children]\n\n // Separate routes from other children (like Nav components)\n const routeNodes = childrenList.filter(child => isFNode(child) && child.type === Route)\n const otherChildren = childrenList.filter(child => !isFNode(child) || child.type !== Route)\n\n // Create route definitions\n const routeDefinitions = createRoutesFromChildren(routeNodes)\n\n // DIRECT access to currentLocation.pathname\n // This should trigger reactive tracking in the component's effect context\n const currentPath = currentLocation.pathname\n const matches = matchRoutes(routeDefinitions, currentPath) || []\n const params = matches.length > 0 ? matches[matches.length - 1].params : {}\n\n const routerContext = {\n location: currentLocation,\n navigate,\n matches: matches,\n params: params\n }\n\n // Render matched component\n let matchedContent: FNodeChild = null\n\n if (matches.length > 0) {\n const rootMatch = matches[0]\n const Component = rootMatch.route.component\n\n // Use pathname as key to force re-mount on route change\n const routeKey = currentPath\n\n // Guard Check\n if (rootMatch.route.beforeEnter) {\n const result = rootMatch.route.beforeEnter(rootMatch.params)\n if (result !== false) {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n } else {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n }\n\n return f(RouterCtx.Provider, {\n value: routerContext,\n children: [...otherChildren, matchedContent]\n })\n}\n","import { use } from '../../core/use'\nimport { jsx as f } from '../../jsx-runtime'\nimport { RouteDepthCtx, useRouter } from '../router'\n\nexport function Outlet() {\n const routerContext = useRouter()\n const [depthValue] = use(RouteDepthCtx)\n const depth = depthValue ?? 0\n\n const [matches] = use(() => routerContext.matches)\n\n if (depth >= matches.length) return null\n\n const match = matches[depth]\n const Component = match.route.component\n\n // Guard\n if (match.route.beforeEnter) {\n if (match.route.beforeEnter(match.params) === false) return null\n }\n\n // Render next level\n return f(RouteDepthCtx.Provider, {\n value: depth + 1,\n children: f(Component, { params: match.params })\n })\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { LinkProps } from '../types'\nimport { useRouter } from '../router'\n\nexport function Link(props: LinkProps) {\n const routerContext = useRouter()\n return f('a', {\n href: props.to,\n class: props.class,\n onclick: (event: Event) => {\n event.preventDefault()\n routerContext.navigate(props.to)\n },\n children: props.children\n })\n}\n"]}
package/dist/router.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {a,c as c$1}from'./chunk-3AKECLKA.mjs';import'./chunk-NRPWBHKP.mjs';import {c}from'./chunk-MI76R42D.mjs';import {a as a$1}from'./chunk-NY6NOGFU.mjs';function k(t){if(!t)return {};if(typeof URLSearchParams<"u"){let e=new URLSearchParams(t),r={};return e.forEach((n,o)=>r[o]=n),r}return t.substring(1).split("&").reduce((e,r)=>{let[n,o]=r.split("=");return n&&(e[decodeURIComponent(n)]=decodeURIComponent(o||"")),e},{})}function D(t){return !!(t.length>2048||t.includes("__proto__")||t.includes("constructor")||/^\s*javascript:/i.test(t))}function R(t){let e=[];return t.forEach(r=>{if(!r)return;let{path:n,component:o,children:i,beforeEnter:f}=r.props||{},u={path:n||"/",component:o,beforeEnter:f};if(i){let c=Array.isArray(i)?i:[i];u.children=R(c);}!u.children&&r.children&&r.children.length>0&&(u.children=R(r.children)),e.push(u);}),e}function E(t,e){for(let r of t){let n=r.path,o=T(n,e);if(o)return [{route:r,params:o.params,pathname:o.path}]}return null}function T(t,e){let r=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++){let f=r[i],u=n[i];if(f.startsWith(":")){let c=f.slice(1);o[c]=u;}else if(f!==u)return null}return {params:o,path:e}}var L=new c(null),p=new c(0),U=()=>({pathname:"/",search:"",hash:"",query:{}}),w=()=>typeof window>"u"?U():{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,query:k(window.location.search)},l=null,y=null,N=false;function d(){if(l&&y)return [l,y];l=a(w());let t=e=>{l&&(l.pathname=e.pathname,l.search=e.search,l.hash=e.hash,l.query=e.query);};return y=e=>{if(typeof window>"u")return;if(D(e)){console.error("[Flexium Router] Blocked navigation to unsafe path:",e);return}window.history.pushState({},"",e);let r=w();t(r);},typeof window<"u"&&!N&&(window.addEventListener("popstate",()=>{t(w());}),N=true),[l,y]}function m(){let[t]=c$1(L);if(!t)throw new Error("useRouter() must be called within a <Routes> component");return t}function j(){let[,t]=d();return t}function q(){return m().params}function _(){let[t]=d();return t.query}function x(t){return null}function F(t){return t&&typeof t=="object"&&("type"in t||Array.isArray(t))}function Q(t){let[e,r]=d(),n=Array.isArray(t.children)?t.children:[t.children],o=n.filter(s=>F(s)&&s.type===x),i=n.filter(s=>!F(s)||s.type!==x),f=R(o),u=e.pathname,c=E(f,u)||[],A=c.length>0?c[c.length-1].params:{},S={location:e,navigate:r,matches:c,params:A},C=null;if(c.length>0){let s=c[0],P=s.route.component,g=u;s.route.beforeEnter?s.route.beforeEnter(s.params)!==false&&(C=a$1(p.Provider,{value:1,key:g,children:a$1(P,{params:s.params,key:g})})):C=a$1(p.Provider,{value:1,key:g,children:a$1(P,{params:s.params,key:g})});}return a$1(L.Provider,{value:S,children:[...i,C]})}function B(){let t=m(),[e]=c$1(p),r=e??0,[n]=c$1(()=>t.matches);if(r>=n.length)return null;let o=n[r],i=o.route.component;return o.route.beforeEnter&&o.route.beforeEnter(o.params)===false?null:a$1(p.Provider,{value:r+1,children:a$1(i,{params:o.params})})}function M(t){let e=m();return a$1("a",{href:t.to,class:t.class,onclick:r=>{r.preventDefault(),e.navigate(t.to);},children:t.children})}export{M as Link,B as Outlet,x as Route,Q as Routes,d as useLocation,j as useNavigate,q as useParams,_ as useQuery,m as useRouter};//# sourceMappingURL=router.mjs.map
1
+ import {a,c as c$1}from'./chunk-3AKECLKA.mjs';import'./chunk-NRPWBHKP.mjs';import {c}from'./chunk-MI76R42D.mjs';import {a as a$1}from'./chunk-J3542Z77.mjs';function k(t){if(!t)return {};if(typeof URLSearchParams<"u"){let e=new URLSearchParams(t),r={};return e.forEach((n,o)=>r[o]=n),r}return t.substring(1).split("&").reduce((e,r)=>{let[n,o]=r.split("=");return n&&(e[decodeURIComponent(n)]=decodeURIComponent(o||"")),e},{})}function D(t){return !!(t.length>2048||t.includes("__proto__")||t.includes("constructor")||/^\s*javascript:/i.test(t))}function R(t){let e=[];return t.forEach(r=>{if(!r)return;let{path:n,component:o,children:i,beforeEnter:f}=r.props||{},u={path:n||"/",component:o,beforeEnter:f};if(i){let c=Array.isArray(i)?i:[i];u.children=R(c);}!u.children&&r.children&&r.children.length>0&&(u.children=R(r.children)),e.push(u);}),e}function E(t,e){for(let r of t){let n=r.path,o=T(n,e);if(o)return [{route:r,params:o.params,pathname:o.path}]}return null}function T(t,e){let r=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(r.length!==n.length)return null;let o={};for(let i=0;i<r.length;i++){let f=r[i],u=n[i];if(f.startsWith(":")){let c=f.slice(1);o[c]=u;}else if(f!==u)return null}return {params:o,path:e}}var L=new c(null),p=new c(0),U=()=>({pathname:"/",search:"",hash:"",query:{}}),w=()=>typeof window>"u"?U():{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,query:k(window.location.search)},l=null,y=null,N=false;function d(){if(l&&y)return [l,y];l=a(w());let t=e=>{l&&(l.pathname=e.pathname,l.search=e.search,l.hash=e.hash,l.query=e.query);};return y=e=>{if(typeof window>"u")return;if(D(e)){console.error("[Flexium Router] Blocked navigation to unsafe path:",e);return}window.history.pushState({},"",e);let r=w();t(r);},typeof window<"u"&&!N&&(window.addEventListener("popstate",()=>{t(w());}),N=true),[l,y]}function m(){let[t]=c$1(L);if(!t)throw new Error("useRouter() must be called within a <Routes> component");return t}function j(){let[,t]=d();return t}function q(){return m().params}function _(){let[t]=d();return t.query}function x(t){return null}function F(t){return t&&typeof t=="object"&&("type"in t||Array.isArray(t))}function Q(t){let[e,r]=d(),n=Array.isArray(t.children)?t.children:[t.children],o=n.filter(s=>F(s)&&s.type===x),i=n.filter(s=>!F(s)||s.type!==x),f=R(o),u=e.pathname,c=E(f,u)||[],A=c.length>0?c[c.length-1].params:{},S={location:e,navigate:r,matches:c,params:A},C=null;if(c.length>0){let s=c[0],P=s.route.component,g=u;s.route.beforeEnter?s.route.beforeEnter(s.params)!==false&&(C=a$1(p.Provider,{value:1,key:g,children:a$1(P,{params:s.params,key:g})})):C=a$1(p.Provider,{value:1,key:g,children:a$1(P,{params:s.params,key:g})});}return a$1(L.Provider,{value:S,children:[...i,C]})}function B(){let t=m(),[e]=c$1(p),r=e??0,[n]=c$1(()=>t.matches);if(r>=n.length)return null;let o=n[r],i=o.route.component;return o.route.beforeEnter&&o.route.beforeEnter(o.params)===false?null:a$1(p.Provider,{value:r+1,children:a$1(i,{params:o.params})})}function M(t){let e=m();return a$1("a",{href:t.to,class:t.class,onclick:r=>{r.preventDefault(),e.navigate(t.to);},children:t.children})}export{M as Link,B as Outlet,x as Route,Q as Routes,d as useLocation,j as useNavigate,q as useParams,_ as useQuery,m as useRouter};//# sourceMappingURL=router.mjs.map
2
2
  //# sourceMappingURL=router.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/router/utils.ts","../src/router/router.ts","../src/router/dom/Route.tsx","../src/router/dom/Routes.tsx","../src/router/dom/Outlet.tsx","../src/router/dom/Link.tsx"],"names":["parseQuery","search","params","result","value","key","accumulator","part","isUnsafePath","path","createRoutesFromChildren","children","routes","child","component","subChildren","beforeEnter","route","nestedChildren","matchRoutes","locationPathname","routePath","matchResult","matchPath","locationPath","routeSegments","locationSegments","routeSegment","locationSegment","RouterCtx","Context","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","useLocation","reactive","updateLocation","newLocation","useRouter","routerContext","use","useNavigate","navigate","useParams","useQuery","location","Route","_props","isFNode","node","Routes","props","currentLocation","childrenList","routeNodes","otherChildren","routeDefinitions","currentPath","matches","matchedContent","rootMatch","Component","routeKey","jsx","Outlet","depthValue","depth","match","Link","event"],"mappings":"4JAGA,SAASA,CAAAA,CAAWC,EAAwC,CAC1D,GAAI,CAACA,CAAAA,CAAQ,OAAO,EAAC,CACrB,GAAI,OAAO,eAAA,CAAoB,GAAA,CAAa,CAC1C,IAAMC,CAAAA,CAAS,IAAI,eAAA,CAAgBD,CAAM,C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A,CAAMZ,EAAM,EAAA,CACZ,KAAA,CAAOA,EAAM,KAAA,CACb,OAAA,CAAUkB,CAAAA,EAAiB,CACvBA,CAAAA,CAAM,cAAA,GACN9B,CAAAA,CAAc,QAAA,CAASY,EAAM,EAAE,EACnC,EACA,QAAA,CAAUA,CAAAA,CAAM,QACpB,CAAC,CACL","file":"router.mjs","sourcesContent":["import { RouteDefinition, RouteMatch } from './types'\n\n// Simple query parser (native URLSearchParams fallback) - internal use only\nfunction parseQuery(search: string): Record<string, string> {\n if (!search) return {}\n if (typeof URLSearchParams !== 'undefined') {\n const params = new URLSearchParams(search)\n const result: Record<string, string> = {}\n params.forEach((value, key) => result[key] = value)\n return result\n }\n return search\n .substring(1)\n .split('&')\n .reduce((accumulator, part) => {\n const [key, value] = part.split('=')\n if (key) accumulator[decodeURIComponent(key)] = decodeURIComponent(value || '')\n return accumulator\n }, {} as Record<string, string>)\n}\n\nfunction isUnsafePath(path: string): boolean {\n // Prevent prototype pollution or massive strings\n if (path.length > 2048) return true\n if (path.includes('__proto__') || path.includes('constructor')) return true\n // Basic XSS check for javascript: protocol\n if (/^\\s*javascript:/i.test(path)) return true\n return false\n}\n\n// Convert children FNodes to RouteDefinitions - internal use only\nfunction createRoutesFromChildren(children: any[]): RouteDefinition[] {\n const routes: RouteDefinition[] = []\n\n children.forEach(child => {\n if (!child) return\n\n // Assuming child is an FNode-like object (config)\n // In Flexium, Route component returns null, but 'createNode' isn't called here.\n // We are traversing the props passed to Router.\n\n const { path, component, children: subChildren, beforeEnter } = child.props || {}\n\n const route: RouteDefinition = {\n path: path || '/',\n component: component,\n beforeEnter\n }\n\n if (subChildren) {\n // If subChildren is array\n const nestedChildren = Array.isArray(subChildren) ? subChildren : [subChildren]\n // We expect the children of a Route to be other Routes\n // However, the 'children' prop in JSX might be the Route components themselves.\n route.children = createRoutesFromChildren(nestedChildren)\n }\n\n // Also check child.children if props.children is empty (direct FNode structure)\n if (!route.children && child.children && child.children.length > 0) {\n route.children = createRoutesFromChildren(child.children)\n }\n\n routes.push(route)\n })\n return routes\n}\n\n// Simple Matcher - internal use only\nfunction matchRoutes(routes: RouteDefinition[], locationPathname: string): RouteMatch[] | null {\n // We want to find the best matching branch\n\n for (const route of routes) {\n // 1. Match current segment\n // Simple exact match or parameter match logic needed?\n // Let's implement simple param matching: /user/:id\n\n const routePath = route.path\n\n const matchResult = matchPath(routePath, locationPathname)\n if (matchResult) {\n return [{ route, params: matchResult.params, pathname: matchResult.path }]\n }\n }\n return null\n}\n\nfunction matchPath(routePath: string, locationPath: string) {\n // 1. Split into segments\n const routeSegments = routePath.split('/').filter(Boolean)\n const locationSegments = locationPath.split('/').filter(Boolean)\n\n if (routeSegments.length !== locationSegments.length) return null\n\n const params: Record<string, string> = {}\n\n for (let i = 0; i < routeSegments.length; i++) {\n const routeSegment = routeSegments[i]\n const locationSegment = locationSegments[i]\n\n if (routeSegment.startsWith(':')) {\n const key = routeSegment.slice(1)\n params[key] = locationSegment\n } else if (routeSegment !== locationSegment) {\n return null\n }\n }\n\n return { params, path: locationPath }\n}\n\n// Export only what's needed by other router files\nexport { parseQuery, isUnsafePath, createRoutesFromChildren, matchRoutes }\n","import { reactive } from '../core/reactive'\nimport { Context } from '../core/context'\nimport { use } from '../core/use'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = new Context<RouterContext>(null as any)\nexport const RouteDepthCtx = new Context<number>(0)\n\n// Helper functions\nconst getDefaultLocation = (): Location => ({\n pathname: '/',\n search: '',\n hash: '',\n query: {},\n})\n\nconst getCurrentLocation = (): Location => {\n if (typeof window === 'undefined') {\n return getDefaultLocation()\n }\n return {\n pathname: window.location.pathname,\n search: window.location.search,\n hash: window.location.hash,\n query: parseQuery(window.location.search),\n }\n}\n\n// Global singleton location state\nlet globalLocation: Location | null = null\nlet globalNavigate: ((path: string) => void) | null = null\nlet popstateListenerAttached = false\n\n// Create location state and navigation (singleton pattern)\nexport function useLocation(): [Location, (path: string) => void] {\n // Return existing singleton if already created\n if (globalLocation && globalNavigate) {\n return [globalLocation, globalNavigate]\n }\n\n // Create a reactive location object (only once)\n globalLocation = reactive<Location>(getCurrentLocation())\n\n const updateLocation = (newLocation: Location) => {\n if (!globalLocation) return\n globalLocation.pathname = newLocation.pathname\n globalLocation.search = newLocation.search\n globalLocation.hash = newLocation.hash\n globalLocation.query = newLocation.query\n }\n\n globalNavigate = (path: string) => {\n if (typeof window === 'undefined') return\n if (isUnsafePath(path)) {\n console.error('[Flexium Router] Blocked navigation to unsafe path:', path)\n return\n }\n window.history.pushState({}, '', path)\n const newLocation = getCurrentLocation()\n updateLocation(newLocation)\n }\n\n // Listen to popstate (only once)\n if (typeof window !== 'undefined' && !popstateListenerAttached) {\n window.addEventListener('popstate', () => {\n updateLocation(getCurrentLocation())\n })\n popstateListenerAttached = true\n }\n\n return [globalLocation, globalNavigate]\n}\n\n// Router hook - returns full router context\nexport function useRouter(): RouterContext {\n const [routerContext] = use(RouterCtx)\n if (!routerContext) {\n throw new Error('useRouter() must be called within a <Routes> component')\n }\n return routerContext\n}\n\n// Navigate hook - returns navigate function\nexport function useNavigate(): (path: string) => void {\n const [, navigate] = useLocation()\n return navigate\n}\n\n// Params hook - returns route params\nexport function useParams<T extends Record<string, string> = Record<string, string>>(): T {\n const router = useRouter()\n return router.params as T\n}\n\n// Query hook - returns query params\nexport function useQuery<T extends Record<string, string> = Record<string, string>>(): T {\n const [location] = useLocation()\n return location.query as T\n}\n","import type { RouteProps } from '../types'\n\nexport function Route(_props: RouteProps) {\n return null\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { FNode, FNodeChild } from '../../dom'\nimport { RouterCtx, RouteDepthCtx, useLocation } from '../router'\nimport { createRoutesFromChildren, matchRoutes } from '../utils'\nimport { Route } from './Route'\n\nfunction isFNode(node: any): node is FNode {\n return node && typeof node === 'object' && ('type' in node || Array.isArray(node))\n}\n\nexport function Routes(props: { children: FNodeChild }) {\n const [currentLocation, navigate] = useLocation()\n\n // Parse children to find <Route> definitions and other content\n let childrenList: any[] = Array.isArray(props.children) ? props.children : [props.children]\n\n // Separate routes from other children (like Nav components)\n const routeNodes = childrenList.filter(child => isFNode(child) && child.type === Route)\n const otherChildren = childrenList.filter(child => !isFNode(child) || child.type !== Route)\n\n // Create route definitions\n const routeDefinitions = createRoutesFromChildren(routeNodes)\n\n // DIRECT access to currentLocation.pathname\n // This should trigger reactive tracking in the component's effect context\n const currentPath = currentLocation.pathname\n const matches = matchRoutes(routeDefinitions, currentPath) || []\n const params = matches.length > 0 ? matches[matches.length - 1].params : {}\n\n const routerContext = {\n location: currentLocation,\n navigate,\n matches: matches,\n params: params\n }\n\n // Render matched component\n let matchedContent: FNodeChild = null\n\n if (matches.length > 0) {\n const rootMatch = matches[0]\n const Component = rootMatch.route.component\n\n // Use pathname as key to force re-mount on route change\n const routeKey = currentPath\n\n // Guard Check\n if (rootMatch.route.beforeEnter) {\n const result = rootMatch.route.beforeEnter(rootMatch.params)\n if (result !== false) {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n } else {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n }\n\n return f(RouterCtx.Provider, {\n value: routerContext,\n children: [...otherChildren, matchedContent]\n })\n}\n","import { use } from '../../core/use'\nimport { jsx as f } from '../../jsx-runtime'\nimport { RouteDepthCtx, useRouter } from '../router'\n\nexport function Outlet() {\n const routerContext = useRouter()\n const [depthValue] = use(RouteDepthCtx)\n const depth = depthValue ?? 0\n\n const [matches] = use(() => routerContext.matches)\n\n if (depth >= matches.length) return null\n\n const match = matches[depth]\n const Component = match.route.component\n\n // Guard\n if (match.route.beforeEnter) {\n if (match.route.beforeEnter(match.params) === false) return null\n }\n\n // Render next level\n return f(RouteDepthCtx.Provider, {\n value: depth + 1,\n children: f(Component, { params: match.params })\n })\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { LinkProps } from '../types'\nimport { useRouter } from '../router'\n\nexport function Link(props: LinkProps) {\n const routerContext = useRouter()\n return f('a', {\n href: props.to,\n class: props.class,\n onclick: (event: Event) => {\n event.preventDefault()\n routerContext.navigate(props.to)\n },\n children: props.children\n })\n}\n"]}
1
+ {"version":3,"sources":["../src/router/utils.ts","../src/router/router.ts","../src/router/dom/Route.tsx","../src/router/dom/Routes.tsx","../src/router/dom/Outlet.tsx","../src/router/dom/Link.tsx"],"names":["parseQuery","search","params","result","value","key","accumulator","part","isUnsafePath","path","createRoutesFromChildren","children","routes","child","component","subChildren","beforeEnter","route","nestedChildren","matchRoutes","locationPathname","routePath","matchResult","matchPath","locationPath","routeSegments","locationSegments","routeSegment","locationSegment","RouterCtx","Context","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","useLocation","reactive","updateLocation","newLocation","useRouter","routerContext","use","useNavigate","navigate","useParams","useQuery","location","Route","_props","isFNode","node","Routes","props","currentLocation","childrenList","routeNodes","otherChildren","routeDefinitions","currentPath","matches","matchedContent","rootMatch","Component","routeKey","jsx","Outlet","depthValue","depth","match","Link","event"],"mappings":"4JAGA,SAASA,CAAAA,CAAWC,EAAwC,CAC1D,GAAI,CAACA,CAAAA,CAAQ,OAAO,EAAC,CACrB,GAAI,OAAO,eAAA,CAAoB,GAAA,CAAa,CAC1C,IAAMC,CAAAA,CAAS,IAAI,eAAA,CAAgBD,CAAM,CAAA,CACnCE,CAAAA,CAAiC,EAAC,CACxC,OAAAD,CAAAA,CAAO,OAAA,CAAQ,CAACE,CAAAA,CAAOC,CAAAA,GAAQF,EAAOE,CAAG,CAAA,CAAID,CAAK,CAAA,CAC3CD,CACT,CACA,OAAOF,CAAAA,CACJ,UAAU,CAAC,CAAA,CACX,MAAM,GAAG,CAAA,CACT,MAAA,CAAO,CAACK,CAAAA,CAAaC,CAAAA,GAAS,CAC7B,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ams fallback) - internal use only\nfunction parseQuery(search: string): Record<string, string> {\n if (!search) return {}\n if (typeof URLSearchParams !== 'undefined') {\n const params = new URLSearchParams(search)\n const result: Record<string, string> = {}\n params.forEach((value, key) => result[key] = value)\n return result\n }\n return search\n .substring(1)\n .split('&')\n .reduce((accumulator, part) => {\n const [key, value] = part.split('=')\n if (key) accumulator[decodeURIComponent(key)] = decodeURIComponent(value || '')\n return accumulator\n }, {} as Record<string, string>)\n}\n\nfunction isUnsafePath(path: string): boolean {\n // Prevent prototype pollution or massive strings\n if (path.length > 2048) return true\n if (path.includes('__proto__') || path.includes('constructor')) return true\n // Basic XSS check for javascript: protocol\n if (/^\\s*javascript:/i.test(path)) return true\n return false\n}\n\n// Convert children FNodes to RouteDefinitions - internal use only\nfunction createRoutesFromChildren(children: any[]): RouteDefinition[] {\n const routes: RouteDefinition[] = []\n\n children.forEach(child => {\n if (!child) return\n\n // Assuming child is an FNode-like object (config)\n // In Flexium, Route component returns null, but 'createNode' isn't called here.\n // We are traversing the props passed to Router.\n\n const { path, component, children: subChildren, beforeEnter } = child.props || {}\n\n const route: RouteDefinition = {\n path: path || '/',\n component: component,\n beforeEnter\n }\n\n if (subChildren) {\n // If subChildren is array\n const nestedChildren = Array.isArray(subChildren) ? subChildren : [subChildren]\n // We expect the children of a Route to be other Routes\n // However, the 'children' prop in JSX might be the Route components themselves.\n route.children = createRoutesFromChildren(nestedChildren)\n }\n\n // Also check child.children if props.children is empty (direct FNode structure)\n if (!route.children && child.children && child.children.length > 0) {\n route.children = createRoutesFromChildren(child.children)\n }\n\n routes.push(route)\n })\n return routes\n}\n\n// Simple Matcher - internal use only\nfunction matchRoutes(routes: RouteDefinition[], locationPathname: string): RouteMatch[] | null {\n // We want to find the best matching branch\n\n for (const route of routes) {\n // 1. Match current segment\n // Simple exact match or parameter match logic needed?\n // Let's implement simple param matching: /user/:id\n\n const routePath = route.path\n\n const matchResult = matchPath(routePath, locationPathname)\n if (matchResult) {\n return [{ route, params: matchResult.params, pathname: matchResult.path }]\n }\n }\n return null\n}\n\nfunction matchPath(routePath: string, locationPath: string) {\n // 1. Split into segments\n const routeSegments = routePath.split('/').filter(Boolean)\n const locationSegments = locationPath.split('/').filter(Boolean)\n\n if (routeSegments.length !== locationSegments.length) return null\n\n const params: Record<string, string> = {}\n\n for (let i = 0; i < routeSegments.length; i++) {\n const routeSegment = routeSegments[i]\n const locationSegment = locationSegments[i]\n\n if (routeSegment.startsWith(':')) {\n const key = routeSegment.slice(1)\n params[key] = locationSegment\n } else if (routeSegment !== locationSegment) {\n return null\n }\n }\n\n return { params, path: locationPath }\n}\n\n// Export only what's needed by other router files\nexport { parseQuery, isUnsafePath, createRoutesFromChildren, matchRoutes }\n","import { reactive } from '../core/reactive'\nimport { Context } from '../core/context'\nimport { use } from '../core/use'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = new Context<RouterContext>(null as any)\nexport const RouteDepthCtx = new Context<number>(0)\n\n// Helper functions\nconst getDefaultLocation = (): Location => ({\n pathname: '/',\n search: '',\n hash: '',\n query: {},\n})\n\nconst getCurrentLocation = (): Location => {\n if (typeof window === 'undefined') {\n return getDefaultLocation()\n }\n return {\n pathname: window.location.pathname,\n search: window.location.search,\n hash: window.location.hash,\n query: parseQuery(window.location.search),\n }\n}\n\n// Global singleton location state\nlet globalLocation: Location | null = null\nlet globalNavigate: ((path: string) => void) | null = null\nlet popstateListenerAttached = false\n\n// Create location state and navigation (singleton pattern)\nexport function useLocation(): [Location, (path: string) => void] {\n // Return existing singleton if already created\n if (globalLocation && globalNavigate) {\n return [globalLocation, globalNavigate]\n }\n\n // Create a reactive location object (only once)\n globalLocation = reactive<Location>(getCurrentLocation())\n\n const updateLocation = (newLocation: Location) => {\n if (!globalLocation) return\n globalLocation.pathname = newLocation.pathname\n globalLocation.search = newLocation.search\n globalLocation.hash = newLocation.hash\n globalLocation.query = newLocation.query\n }\n\n globalNavigate = (path: string) => {\n if (typeof window === 'undefined') return\n if (isUnsafePath(path)) {\n console.error('[Flexium Router] Blocked navigation to unsafe path:', path)\n return\n }\n window.history.pushState({}, '', path)\n const newLocation = getCurrentLocation()\n updateLocation(newLocation)\n }\n\n // Listen to popstate (only once)\n if (typeof window !== 'undefined' && !popstateListenerAttached) {\n window.addEventListener('popstate', () => {\n updateLocation(getCurrentLocation())\n })\n popstateListenerAttached = true\n }\n\n return [globalLocation, globalNavigate]\n}\n\n// Router hook - returns full router context\nexport function useRouter(): RouterContext {\n const [routerContext] = use(RouterCtx)\n if (!routerContext) {\n throw new Error('useRouter() must be called within a <Routes> component')\n }\n return routerContext\n}\n\n// Navigate hook - returns navigate function\nexport function useNavigate(): (path: string) => void {\n const [, navigate] = useLocation()\n return navigate\n}\n\n// Params hook - returns route params\nexport function useParams<T extends Record<string, string> = Record<string, string>>(): T {\n const router = useRouter()\n return router.params as T\n}\n\n// Query hook - returns query params\nexport function useQuery<T extends Record<string, string> = Record<string, string>>(): T {\n const [location] = useLocation()\n return location.query as T\n}\n","import type { RouteProps } from '../types'\n\nexport function Route(_props: RouteProps) {\n return null\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { FNode, FNodeChild } from '../../dom/types'\nimport { RouterCtx, RouteDepthCtx, useLocation } from '../router'\nimport { createRoutesFromChildren, matchRoutes } from '../utils'\nimport { Route } from './Route'\n\nfunction isFNode(node: any): node is FNode {\n return node && typeof node === 'object' && ('type' in node || Array.isArray(node))\n}\n\nexport function Routes(props: { children: FNodeChild }) {\n const [currentLocation, navigate] = useLocation()\n\n // Parse children to find <Route> definitions and other content\n let childrenList: any[] = Array.isArray(props.children) ? props.children : [props.children]\n\n // Separate routes from other children (like Nav components)\n const routeNodes = childrenList.filter(child => isFNode(child) && child.type === Route)\n const otherChildren = childrenList.filter(child => !isFNode(child) || child.type !== Route)\n\n // Create route definitions\n const routeDefinitions = createRoutesFromChildren(routeNodes)\n\n // DIRECT access to currentLocation.pathname\n // This should trigger reactive tracking in the component's effect context\n const currentPath = currentLocation.pathname\n const matches = matchRoutes(routeDefinitions, currentPath) || []\n const params = matches.length > 0 ? matches[matches.length - 1].params : {}\n\n const routerContext = {\n location: currentLocation,\n navigate,\n matches: matches,\n params: params\n }\n\n // Render matched component\n let matchedContent: FNodeChild = null\n\n if (matches.length > 0) {\n const rootMatch = matches[0]\n const Component = rootMatch.route.component\n\n // Use pathname as key to force re-mount on route change\n const routeKey = currentPath\n\n // Guard Check\n if (rootMatch.route.beforeEnter) {\n const result = rootMatch.route.beforeEnter(rootMatch.params)\n if (result !== false) {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n } else {\n matchedContent = f(RouteDepthCtx.Provider, {\n value: 1,\n key: routeKey,\n children: f(Component, { params: rootMatch.params, key: routeKey })\n })\n }\n }\n\n return f(RouterCtx.Provider, {\n value: routerContext,\n children: [...otherChildren, matchedContent]\n })\n}\n","import { use } from '../../core/use'\nimport { jsx as f } from '../../jsx-runtime'\nimport { RouteDepthCtx, useRouter } from '../router'\n\nexport function Outlet() {\n const routerContext = useRouter()\n const [depthValue] = use(RouteDepthCtx)\n const depth = depthValue ?? 0\n\n const [matches] = use(() => routerContext.matches)\n\n if (depth >= matches.length) return null\n\n const match = matches[depth]\n const Component = match.route.component\n\n // Guard\n if (match.route.beforeEnter) {\n if (match.route.beforeEnter(match.params) === false) return null\n }\n\n // Render next level\n return f(RouteDepthCtx.Provider, {\n value: depth + 1,\n children: f(Component, { params: match.params })\n })\n}\n","import { jsx as f } from '../../jsx-runtime'\nimport type { LinkProps } from '../types'\nimport { useRouter } from '../router'\n\nexport function Link(props: LinkProps) {\n const routerContext = useRouter()\n return f('a', {\n href: props.to,\n class: props.class,\n onclick: (event: Event) => {\n event.preventDefault()\n routerContext.navigate(props.to)\n },\n children: props.children\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flexium",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "A lightweight, signals-based UI framework with cross-platform renderers",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/jsx-runtime.ts"],"names":["jsx","type","props","key","children","otherProps","jsxs","Fragment"],"mappings":"aAEO,SAASA,CAAAA,CAAIC,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CACzD,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAW,CAAA,CAAIH,CAAAA,EAAS,EAAC,CAC9C,OAAO,CACH,IAAA,CAAAD,CAAAA,CACA,KAAA,CAAOI,CAAAA,CACP,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQD,CAAQ,CAAA,CAAIA,CAAAA,CAAYA,CAAAA,EAAY,KAAO,CAACA,CAAQ,CAAA,CAAI,EAAC,CACjF,GAAA,CAAAD,CACJ,CACJ,CAEO,SAASG,CAAAA,CAAKL,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CAC1D,OAAOH,CAAAA,CAAIC,CAAAA,CAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAEO,SAASI,CAAAA,CAASL,CAAAA,CAAwB,CAC7C,OAAOA,CAAAA,CAAM,QACjB","file":"chunk-DUGPBZZ3.js","sourcesContent":["import type { FNode, FNodeChild } from './dom'\n\nexport function jsx(type: any, props: any, key?: any): FNode {\n const { children, ...otherProps } = props || {}\n return {\n type,\n props: otherProps,\n children: Array.isArray(children) ? children : (children != null ? [children] : []),\n key\n }\n}\n\nexport function jsxs(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\nexport function Fragment(props: any): FNodeChild {\n return props.children\n}\n\nexport namespace JSX {\n export interface IntrinsicElements {\n [elemName: string]: any\n }\n export type Element = FNode | FNodeChild\n export interface ElementChildrenAttribute {\n children: {}\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/jsx-runtime.ts"],"names":["jsx","type","props","key","children","otherProps","jsxs","Fragment"],"mappings":"AAEO,SAASA,CAAAA,CAAIC,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CACzD,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAW,CAAA,CAAIH,CAAAA,EAAS,EAAC,CAC9C,OAAO,CACH,IAAA,CAAAD,CAAAA,CACA,KAAA,CAAOI,CAAAA,CACP,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQD,CAAQ,CAAA,CAAIA,CAAAA,CAAYA,CAAAA,EAAY,KAAO,CAACA,CAAQ,CAAA,CAAI,EAAC,CACjF,GAAA,CAAAD,CACJ,CACJ,CAEO,SAASG,CAAAA,CAAKL,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CAC1D,OAAOH,CAAAA,CAAIC,CAAAA,CAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAEO,SAASI,CAAAA,CAASL,CAAAA,CAAwB,CAC7C,OAAOA,CAAAA,CAAM,QACjB","file":"chunk-NY6NOGFU.mjs","sourcesContent":["import type { FNode, FNodeChild } from './dom'\n\nexport function jsx(type: any, props: any, key?: any): FNode {\n const { children, ...otherProps } = props || {}\n return {\n type,\n props: otherProps,\n children: Array.isArray(children) ? children : (children != null ? [children] : []),\n key\n }\n}\n\nexport function jsxs(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\nexport function Fragment(props: any): FNodeChild {\n return props.children\n}\n\nexport namespace JSX {\n export interface IntrinsicElements {\n [elemName: string]: any\n }\n export type Element = FNode | FNodeChild\n export interface ElementChildrenAttribute {\n children: {}\n }\n}\n"]}