flexium 0.12.19 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -25
- package/dist/advanced.d.cts +5 -0
- package/dist/advanced.d.ts +5 -0
- package/dist/advanced.js +2 -0
- package/dist/advanced.js.map +1 -0
- package/dist/advanced.mjs +2 -0
- package/dist/advanced.mjs.map +1 -0
- package/dist/canvas.d.cts +1 -1
- package/dist/canvas.d.ts +1 -1
- package/dist/canvas.js +1 -1
- package/dist/canvas.js.map +1 -1
- package/dist/canvas.mjs +1 -1
- package/dist/canvas.mjs.map +1 -1
- package/dist/chunk-3CKIHQIE.js +2 -0
- package/dist/chunk-3CKIHQIE.js.map +1 -0
- package/dist/{chunk-PSKDIB7J.js → chunk-CGB4YXKS.js} +2 -2
- package/dist/chunk-CGB4YXKS.js.map +1 -0
- package/dist/chunk-INJXOHFD.mjs +2 -0
- package/dist/chunk-INJXOHFD.mjs.map +1 -0
- package/dist/{chunk-E75BJDOQ.mjs → chunk-JUP6RTZA.mjs} +2 -2
- package/dist/{chunk-E75BJDOQ.mjs.map → chunk-JUP6RTZA.mjs.map} +1 -1
- package/dist/{chunk-3DKZ2J4D.mjs → chunk-NDPEE2TQ.mjs} +2 -2
- package/dist/chunk-NDPEE2TQ.mjs.map +1 -0
- package/dist/chunk-NRPWBHKP.mjs +2 -0
- package/dist/chunk-NRPWBHKP.mjs.map +1 -0
- package/dist/chunk-W2L7BLE7.js +2 -0
- package/dist/chunk-W2L7BLE7.js.map +1 -0
- package/dist/{chunk-6Z33DLMI.js → chunk-X6HXRSMG.js} +2 -2
- package/dist/{chunk-6Z33DLMI.js.map → chunk-X6HXRSMG.js.map} +1 -1
- package/dist/core.d.cts +18 -74
- package/dist/core.d.ts +18 -74
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/core.mjs.map +1 -1
- package/dist/dom.d.cts +1 -1
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +1 -1
- package/dist/dom.js.map +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/dom.mjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interactive.d.cts +2 -2
- package/dist/interactive.d.ts +2 -2
- package/dist/interactive.js +1 -1
- package/dist/interactive.js.map +1 -1
- package/dist/interactive.mjs +1 -1
- package/dist/interactive.mjs.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-runtime.d.cts +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/render-L57MA662.mjs +2 -0
- package/dist/{render-UIWHIMS2.mjs.map → render-L57MA662.mjs.map} +1 -1
- package/dist/render-VERKNIPR.js +2 -0
- package/dist/{render-QZAFAGIM.js.map → render-VERKNIPR.js.map} +1 -1
- package/dist/router.d.cts +7 -3
- package/dist/router.d.ts +7 -3
- package/dist/router.js +1 -1
- package/dist/router.js.map +1 -1
- package/dist/router.mjs +1 -1
- package/dist/router.mjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/types--emg3Tgw.d.cts +10 -0
- package/dist/types--emg3Tgw.d.ts +10 -0
- package/dist/{types-y2GGaXXk.d.cts → types-DH8L3A5z.d.cts} +1 -1
- package/dist/{types-y2GGaXXk.d.ts → types-DH8L3A5z.d.ts} +1 -1
- package/package.json +6 -1
- package/dist/chunk-3DKZ2J4D.mjs.map +0 -1
- package/dist/chunk-6VIRXD2Y.js +0 -2
- package/dist/chunk-6VIRXD2Y.js.map +0 -1
- package/dist/chunk-IWFEXW4F.mjs +0 -2
- package/dist/chunk-IWFEXW4F.mjs.map +0 -1
- package/dist/chunk-JY6CE6RN.mjs +0 -2
- package/dist/chunk-JY6CE6RN.mjs.map +0 -1
- package/dist/chunk-LTT43APF.js +0 -2
- package/dist/chunk-LTT43APF.js.map +0 -1
- package/dist/chunk-PSKDIB7J.js.map +0 -1
- package/dist/chunk-WGKD63GN.mjs +0 -2
- package/dist/chunk-WGKD63GN.mjs.map +0 -1
- package/dist/chunk-YWTD32NA.js +0 -2
- package/dist/chunk-YWTD32NA.js.map +0 -1
- package/dist/render-QZAFAGIM.js +0 -2
- package/dist/render-UIWHIMS2.mjs +0 -2
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/index.ts":{"bytes":68,"imports":[],"format":"esm"},"src/core/hook.ts":{"bytes":986,"imports":[],"format":"esm"},"src/core/lifecycle.ts":{"bytes":3525,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"./hook"}],"format":"esm"},"src/core/reactive.ts":{"bytes":2080,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"}],"format":"esm"},"src/core/devtools.ts":{"bytes":1841,"imports":[],"format":"esm"},"src/core/state.ts":{"bytes":5816,"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"}],"format":"esm"},"src/core/context.ts":{"bytes":1400,"imports":[],"format":"esm"},"src/ref/ref.ts":{"bytes":803,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"}],"format":"esm"},"src/ref/forwardRef.ts":{"bytes":1604,"imports":[],"format":"esm"},"src/ref/index.ts":{"bytes":268,"imports":[{"path":"src/ref/ref.ts","kind":"import-statement","original":"./ref"},{"path":"src/ref/forwardRef.ts","kind":"import-statement","original":"./forwardRef"}],"format":"esm"},"src/core/index.ts":{"bytes":406,"imports":[{"path":"src/core/state.ts","kind":"import-statement","original":"./state"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/core/context.ts","kind":"import-statement","original":"./context"},{"path":"src/ref/index.ts","kind":"import-statement","original":"../ref"}],"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":1932,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../../core/lifecycle"},{"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":372,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../../core/context"}],"format":"esm"},"src/dom/components/Suspense.tsx":{"bytes":1778,"imports":[{"path":"src/core/state.ts","kind":"import-statement","original":"../../core/state"},{"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":2860,"imports":[{"path":"src/core/state.ts","kind":"import-statement","original":"../../core/state"},{"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":2599,"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/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":2578,"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":769,"imports":[{"path":"src/core/state.ts","kind":"import-statement","original":"../../core/state"},{"path":"src/core/context.ts","kind":"import-statement","original":"../../core/context"},{"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":441,"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":259,"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":5538,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../core/lifecycle"},{"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":305,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../../core/lifecycle"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawCircle.tsx":{"bytes":315,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../../core/lifecycle"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawArc.tsx":{"bytes":300,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../../core/lifecycle"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawLine.tsx":{"bytes":305,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../../core/lifecycle"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawText.tsx":{"bytes":305,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../../core/lifecycle"},{"path":"src/canvas/Canvas.tsx","kind":"import-statement","original":"../Canvas"}],"format":"esm"},"src/canvas/dom/DrawPath.tsx":{"bytes":305,"imports":[{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"../../core/lifecycle"},{"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":1684,"imports":[],"format":"esm"},"src/interactive/types.ts":{"bytes":1937,"imports":[],"format":"esm"},"src/interactive/keyboard.ts":{"bytes":2405,"imports":[{"path":"src/core/state.ts","kind":"import-statement","original":"../core/state"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/mouse.ts":{"bytes":3183,"imports":[{"path":"src/core/state.ts","kind":"import-statement","original":"../core/state"},{"path":"src/interactive/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/interactive/index.ts":{"bytes":206,"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-UIWHIMS2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/render-UIWHIMS2.mjs":{"imports":[{"path":"dist/chunk-E75BJDOQ.mjs","kind":"import-statement"},{"path":"dist/chunk-3DKZ2J4D.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"}],"exports":["reconcile","render"],"entryPoint":"src/dom/render.ts","inputs":{},"bytes":161},"dist/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":205},"dist/index.mjs":{"imports":[],"exports":["VERSION"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":16}},"bytes":38},"dist/core.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3072},"dist/core.mjs":{"imports":[{"path":"dist/chunk-3DKZ2J4D.mjs","kind":"import-statement"},{"path":"dist/chunk-WGKD63GN.mjs","kind":"import-statement"},{"path":"dist/chunk-JY6CE6RN.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"}],"exports":["context","createContext","effect","forwardRef","ref","state","sync"],"entryPoint":"src/core/index.ts","inputs":{"src/core/index.ts":{"bytesInOutput":0},"src/ref/ref.ts":{"bytesInOutput":42},"src/ref/index.ts":{"bytesInOutput":0},"src/ref/forwardRef.ts":{"bytesInOutput":131}},"bytes":479},"dist/dom.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27703},"dist/dom.mjs":{"imports":[{"path":"dist/chunk-E75BJDOQ.mjs","kind":"import-statement"},{"path":"dist/chunk-3DKZ2J4D.mjs","kind":"import-statement"},{"path":"dist/chunk-WGKD63GN.mjs","kind":"import-statement"},{"path":"dist/chunk-JY6CE6RN.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/render-UIWHIMS2.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":491},"src/dom/components/index.ts":{"bytesInOutput":0},"src/dom/components/suspenseContext.ts":{"bytesInOutput":71},"src/dom/components/Suspense.tsx":{"bytesInOutput":293},"src/dom/components/ErrorBoundary.tsx":{"bytesInOutput":500},"src/dom/components/lazy.ts":{"bytesInOutput":249}},"bytes":4816},"dist/chunk-E75BJDOQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23945},"dist/chunk-E75BJDOQ.mjs":{"imports":[{"path":"dist/chunk-3DKZ2J4D.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"}],"exports":["a","b"],"inputs":{"src/dom/render.ts":{"bytesInOutput":4853}},"bytes":4999},"dist/server.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12945},"dist/server.mjs":{"imports":[{"path":"dist/chunk-3DKZ2J4D.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.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":2629},"dist/router.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16422},"dist/router.mjs":{"imports":[{"path":"dist/chunk-3DKZ2J4D.mjs","kind":"import-statement"},{"path":"dist/chunk-WGKD63GN.mjs","kind":"import-statement"},{"path":"dist/chunk-JY6CE6RN.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NY6NOGFU.mjs","kind":"import-statement"}],"exports":["Link","Outlet","Route","Routes","router"],"entryPoint":"src/router/index.ts","inputs":{"src/router/index.ts":{"bytesInOutput":0},"src/router/utils.ts":{"bytesInOutput":1073},"src/router/router.ts":{"bytesInOutput":743},"src/router/dom/Route.tsx":{"bytesInOutput":26},"src/router/dom/Routes.tsx":{"bytesInOutput":638},"src/router/dom/Outlet.tsx":{"bytesInOutput":238},"src/router/dom/Link.tsx":{"bytesInOutput":133}},"bytes":3141},"dist/chunk-3DKZ2J4D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2198},"dist/chunk-3DKZ2J4D.mjs":{"imports":[],"exports":["a","b","c","d"],"inputs":{"src/core/context.ts":{"bytesInOutput":284}},"bytes":316},"dist/canvas.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12793},"dist/canvas.mjs":{"imports":[{"path":"dist/chunk-JY6CE6RN.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.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":2494},"dist/interactive.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15153},"dist/interactive.mjs":{"imports":[{"path":"dist/chunk-WGKD63GN.mjs","kind":"import-statement"},{"path":"dist/chunk-JY6CE6RN.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"}],"exports":["Keys","MouseButton","keyboard","loop","mouse"],"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":3198},"dist/chunk-WGKD63GN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11319},"dist/chunk-WGKD63GN.mjs":{"imports":[{"path":"dist/chunk-JY6CE6RN.mjs","kind":"import-statement"},{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"}],"exports":["a"],"inputs":{"src/core/devtools.ts":{"bytesInOutput":372},"src/core/state.ts":{"bytesInOutput":1581}},"bytes":2092},"dist/chunk-JY6CE6RN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3715},"dist/chunk-JY6CE6RN.mjs":{"imports":[{"path":"dist/chunk-IWFEXW4F.mjs","kind":"import-statement"}],"exports":["a","b"],"inputs":{"src/core/reactive.ts":{"bytesInOutput":590}},"bytes":668},"dist/chunk-IWFEXW4F.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5910},"dist/chunk-IWFEXW4F.mjs":{"imports":[{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"}],"exports":["a","b","c","d","e","f"],"inputs":{"src/core/lifecycle.ts":{"bytesInOutput":1072}},"bytes":1164},"dist/chunk-5PNH2ARD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1694},"dist/chunk-5PNH2ARD.mjs":{"imports":[],"exports":["a","b"],"inputs":{"src/core/hook.ts":{"bytesInOutput":227}},"bytes":250},"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":1403,"imports":[],"format":"esm"},"src/core/use.ts":{"bytes":8217,"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/ref/ref.ts":{"bytes":818,"imports":[{"path":"src/core/hook.ts","kind":"import-statement","original":"../core/hook"}],"format":"esm"},"src/ref/index.ts":{"bytes":113,"imports":[{"path":"src/ref/ref.ts","kind":"import-statement","original":"./ref"}],"format":"esm"},"src/core/index.ts":{"bytes":271,"imports":[{"path":"src/core/use.ts","kind":"import-statement","original":"./use"},{"path":"src/core/lifecycle.ts","kind":"import-statement","original":"./lifecycle"},{"path":"src/ref/index.ts","kind":"import-statement","original":"../ref"}],"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":378,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../../core/context"}],"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":3200,"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/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":2395,"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":3171,"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":209,"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/advanced/index.ts":{"bytes":116,"imports":[{"path":"src/core/context.ts","kind":"import-statement","original":"../core/context"}],"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-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/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-L57MA662.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/render-L57MA662.mjs":{"imports":[{"path":"dist/chunk-JUP6RTZA.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.mjs","kind":"import-statement"}],"exports":["reconcile","render"],"entryPoint":"src/dom/render.ts","inputs":{},"bytes":161},"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":1071},"dist/core.mjs":{"imports":[{"path":"dist/chunk-INJXOHFD.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.mjs","kind":"import-statement"}],"exports":["sync","use","useRef"],"entryPoint":"src/core/index.ts","inputs":{"src/core/index.ts":{"bytesInOutput":0},"src/ref/ref.ts":{"bytesInOutput":42},"src/ref/index.ts":{"bytesInOutput":0}},"bytes":234},"dist/dom.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27737},"dist/dom.mjs":{"imports":[{"path":"dist/chunk-JUP6RTZA.mjs","kind":"import-statement"},{"path":"dist/chunk-INJXOHFD.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.mjs","kind":"import-statement"},{"path":"dist/render-L57MA662.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":71},"src/dom/components/Suspense.tsx":{"bytesInOutput":293},"src/dom/components/ErrorBoundary.tsx":{"bytesInOutput":500},"src/dom/components/lazy.ts":{"bytesInOutput":249}},"bytes":4789},"dist/chunk-JUP6RTZA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23945},"dist/chunk-JUP6RTZA.mjs":{"imports":[{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.mjs","kind":"import-statement"}],"exports":["a","b"],"inputs":{"src/dom/render.ts":{"bytesInOutput":4853}},"bytes":4999},"dist/server.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12945},"dist/server.mjs":{"imports":[{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.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":2629},"dist/router.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17313},"dist/router.mjs":{"imports":[{"path":"dist/chunk-NY6NOGFU.mjs","kind":"import-statement"},{"path":"dist/chunk-INJXOHFD.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.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":850},"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":3286},"dist/canvas.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12688},"dist/canvas.mjs":{"imports":[{"path":"dist/chunk-NY6NOGFU.mjs","kind":"import-statement"},{"path":"dist/chunk-INJXOHFD.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.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":2518},"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},"dist/interactive.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15141},"dist/interactive.mjs":{"imports":[{"path":"dist/chunk-INJXOHFD.mjs","kind":"import-statement"},{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.mjs","kind":"import-statement"}],"exports":["Keys","MouseButton","keyboard","mouse","useLoop"],"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":3201},"dist/chunk-INJXOHFD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18116},"dist/chunk-INJXOHFD.mjs":{"imports":[{"path":"dist/chunk-NRPWBHKP.mjs","kind":"import-statement"},{"path":"dist/chunk-5PNH2ARD.mjs","kind":"import-statement"},{"path":"dist/chunk-NDPEE2TQ.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":3179},"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-5PNH2ARD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1694},"dist/chunk-5PNH2ARD.mjs":{"imports":[],"exports":["a","b"],"inputs":{"src/core/hook.ts":{"bytesInOutput":227}},"bytes":250},"dist/advanced.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/advanced.mjs":{"imports":[{"path":"dist/chunk-NDPEE2TQ.mjs","kind":"import-statement"}],"exports":["createContext"],"entryPoint":"src/advanced/index.ts","inputs":{"src/advanced/index.ts":{"bytesInOutput":0}},"bytes":69},"dist/chunk-NDPEE2TQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2204},"dist/chunk-NDPEE2TQ.mjs":{"imports":[],"exports":["a","b","c","d"],"inputs":{"src/core/context.ts":{"bytesInOutput":284}},"bytes":316}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"render-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"render-L57MA662.mjs"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkX6HXRSMG_js=require('./chunk-X6HXRSMG.js');require('./chunk-3CKIHQIE.js'),require('./chunk-UWFVCKRU.js'),require('./chunk-CGB4YXKS.js');Object.defineProperty(exports,"reconcile",{enumerable:true,get:function(){return chunkX6HXRSMG_js.a}});Object.defineProperty(exports,"render",{enumerable:true,get:function(){return chunkX6HXRSMG_js.b}});//# sourceMappingURL=render-VERKNIPR.js.map
|
|
2
|
+
//# sourceMappingURL=render-VERKNIPR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"render-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"render-VERKNIPR.js"}
|
package/dist/router.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as FNodeChild, F as FNode } from './types-DH8L3A5z.cjs';
|
|
2
2
|
|
|
3
3
|
interface Location {
|
|
4
4
|
pathname: string;
|
|
@@ -35,7 +35,11 @@ interface LinkProps {
|
|
|
35
35
|
children?: any;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
declare function
|
|
38
|
+
declare function useLocation(): [Location, (path: string) => void];
|
|
39
|
+
declare function useRouter(): RouterContext;
|
|
40
|
+
declare function useNavigate(): (path: string) => void;
|
|
41
|
+
declare function useParams<T extends Record<string, string> = Record<string, string>>(): T;
|
|
42
|
+
declare function useQuery<T extends Record<string, string> = Record<string, string>>(): T;
|
|
39
43
|
|
|
40
44
|
declare function Routes(props: {
|
|
41
45
|
children: FNodeChild;
|
|
@@ -47,4 +51,4 @@ declare function Outlet(): FNode | null;
|
|
|
47
51
|
|
|
48
52
|
declare function Link(props: LinkProps): FNode;
|
|
49
53
|
|
|
50
|
-
export { Link, type LinkProps, type Location, Outlet, Route, type RouteDefinition, type RouteMatch, type RouteProps, type RouterContext, Routes,
|
|
54
|
+
export { Link, type LinkProps, type Location, Outlet, Route, type RouteDefinition, type RouteMatch, type RouteProps, type RouterContext, Routes, useLocation, useNavigate, useParams, useQuery, useRouter };
|
package/dist/router.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as FNodeChild, F as FNode } from './types-DH8L3A5z.js';
|
|
2
2
|
|
|
3
3
|
interface Location {
|
|
4
4
|
pathname: string;
|
|
@@ -35,7 +35,11 @@ interface LinkProps {
|
|
|
35
35
|
children?: any;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
declare function
|
|
38
|
+
declare function useLocation(): [Location, (path: string) => void];
|
|
39
|
+
declare function useRouter(): RouterContext;
|
|
40
|
+
declare function useNavigate(): (path: string) => void;
|
|
41
|
+
declare function useParams<T extends Record<string, string> = Record<string, string>>(): T;
|
|
42
|
+
declare function useQuery<T extends Record<string, string> = Record<string, string>>(): T;
|
|
39
43
|
|
|
40
44
|
declare function Routes(props: {
|
|
41
45
|
children: FNodeChild;
|
|
@@ -47,4 +51,4 @@ declare function Outlet(): FNode | null;
|
|
|
47
51
|
|
|
48
52
|
declare function Link(props: LinkProps): FNode;
|
|
49
53
|
|
|
50
|
-
export { Link, type LinkProps, type Location, Outlet, Route, type RouteDefinition, type RouteMatch, type RouteProps, type RouterContext, Routes,
|
|
54
|
+
export { Link, type LinkProps, type Location, Outlet, Route, type RouteDefinition, type RouteMatch, type RouteProps, type RouterContext, Routes, useLocation, useNavigate, useParams, useQuery, useRouter };
|
package/dist/router.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkDUGPBZZ3_js=require('./chunk-DUGPBZZ3.js'),chunkW2L7BLE7_js=require('./chunk-W2L7BLE7.js');require('./chunk-3CKIHQIE.js'),require('./chunk-UWFVCKRU.js');var chunkCGB4YXKS_js=require('./chunk-CGB4YXKS.js');function D(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 E(t){return !!(t.length>2048||t.includes("__proto__")||t.includes("constructor")||/^\s*javascript:/i.test(t))}function g(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=g(c);}!u.children&&r.children&&r.children.length>0&&(u.children=g(r.children)),e.push(u);}),e}function N(t,e){for(let r of t){let n=r.path,o=U(n,e);if(o)return [{route:r,params:o.params,pathname:o.path}]}return null}function U(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 w=chunkCGB4YXKS_js.a(null),p=chunkCGB4YXKS_js.a(0),j=()=>({pathname:"/",search:"",hash:"",query:{}}),L=()=>typeof window>"u"?j():{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,query:D(window.location.search)},l=null,R=null,F=false;function h(){if(l&&R)return [l,R];l=chunkW2L7BLE7_js.a(L());let t=e=>{l&&(l.pathname=e.pathname,l.search=e.search,l.hash=e.hash,l.query=e.query);};return R=e=>{if(typeof window>"u")return;if(E(e)){console.error("[Flexium Router] Blocked navigation to unsafe path:",e);return}window.history.pushState({},"",e);let r=L();t(r);},typeof window<"u"&&!F&&(window.addEventListener("popstate",()=>{t(L());}),F=true),[l,R]}function m(){let t=chunkCGB4YXKS_js.b(w);if(!t)throw new Error("useRouter() must be called within a <Routes> component");return t}function q(){let[,t]=h();return t}function _(){return m().params}function Q(){let[t]=h();return t.query}function y(t){return null}function A(t){return t&&typeof t=="object"&&("type"in t||Array.isArray(t))}function B(t){let[e,r]=h(),n=Array.isArray(t.children)?t.children:[t.children],o=n.filter(s=>A(s)&&s.type===y),i=n.filter(s=>!A(s)||s.type!==y),f=g(o),u=e.pathname,c=N(f,u)||[],S=c.length>0?c[c.length-1].params:{},T={location:e,navigate:r,matches:c,params:S},x=null;if(c.length>0){let s=c[0],P=s.route.component,d=u;s.route.beforeEnter?s.route.beforeEnter(s.params)!==false&&(x=chunkDUGPBZZ3_js.a(p.Provider,{value:1,key:d,children:chunkDUGPBZZ3_js.a(P,{params:s.params,key:d})})):x=chunkDUGPBZZ3_js.a(p.Provider,{value:1,key:d,children:chunkDUGPBZZ3_js.a(P,{params:s.params,key:d})});}return chunkDUGPBZZ3_js.a(w.Provider,{value:T,children:[...i,x]})}function M(){let t=m(),[e]=chunkW2L7BLE7_js.c(p),r=e??0,[n]=chunkW2L7BLE7_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 I(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=I;exports.Outlet=M;exports.Route=y;exports.Routes=B;exports.useLocation=h;exports.useNavigate=q;exports.useParams=_;exports.useQuery=Q;exports.useRouter=m;//# sourceMappingURL=router.js.map
|
|
2
2
|
//# sourceMappingURL=router.js.map
|
package/dist/router.js.map
CHANGED
|
@@ -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","i","routeSegment","locationSegment","RouterCtx","createContext","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","location","reactive","updateLocation","newLocation","router","routerContext","context","Route","_props","isFNode","node","Routes","props","currentLocation","navigate","childrenList","routeNodes","otherChildren","routeDefinitions","currentPath","matches","matchedContent","rootMatch","Component","routeKey","jsx","Outlet","depth","state","match","Link","event"],"mappings":"mRAGA,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,EACnCE,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QZ,CAAa,CAAA,EAAgB,EAE9C,CAAC0B,CAAO,EAAIQ,kBAAAA,CAAM,IAAMvB,EAAc,OAAO,CAAA,CAEnD,GAAIsB,CAAAA,EAASP,CAAAA,CAAQ,OAAQ,OAAO,IAAA,CAEpC,IAAMS,CAAAA,CAAQT,CAAAA,CAAQO,CAAK,CAAA,CACrBJ,CAAAA,CAAYM,EAAM,KAAA,CAAM,SAAA,CAG9B,OAAIA,CAAAA,CAAM,KAAA,CAAM,aACRA,CAAAA,CAAM,KAAA,CAAM,YAAYA,CAAAA,CAAM,MAAM,IAAM,KAAA,CAAc,IAAA,CAIzDJ,mBAAE/B,CAAAA,CAAc,QAAA,CAAU,CAC7B,KAAA,CAAOiC,CAAAA,CAAQ,EACf,QAAA,CAAUF,kBAAAA,CAAEF,EAAW,CAAE,MAAA,CAAQM,EAAM,MAAO,CAAC,CACnD,CAAC,CACL,CCtBO,SAASC,CAAAA,CAAKlB,EAAkB,CACnC,IAAMP,EAAgBD,CAAAA,EAAO,CAC7B,OAAOqB,kBAAAA,CAAE,GAAA,CAAK,CACV,IAAA,CAAMb,CAAAA,CAAM,GACZ,KAAA,CAAOA,CAAAA,CAAM,MACb,OAAA,CAAUmB,CAAAA,EAAiB,CACvBA,CAAAA,CAAM,cAAA,GACN1B,CAAAA,CAAc,QAAA,CAASO,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 { createContext, context } from '../core/context'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = createContext<RouterContext>(null as any)\nexport const RouteDepthCtx = createContext<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 location(): [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\nexport function router(): RouterContext {\n const routerContext = context(RouterCtx)\n if (!routerContext) {\n throw new Error('router() must be called within a <Routes> component')\n }\n return routerContext\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, location } 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] = location()\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 { state } from '../../core/state'\nimport { context } from '../../core/context'\nimport { jsx as f } from '../../jsx-runtime'\nimport { RouteDepthCtx, router } from '../router'\n\nexport function Outlet() {\n const routerContext = router()\n const depth = (context(RouteDepthCtx) as number) || 0\n\n const [matches] = state(() => 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 { router } from '../router'\n\nexport function Link(props: LinkProps) {\n const routerContext = router()\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","createContext","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","useLocation","reactive","updateLocation","newLocation","useRouter","routerContext","useContext","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","use","depth","match","Link","event"],"mappings":"mOAGA,SAASA,CAAAA,CAAWC,EAAwC,CAC1D,GAAI,CAACA,CAAAA,C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A,CAAkB,CACnC,IAAMZ,CAAAA,CAAgBD,CAAAA,EAAU,CAChC,OAAOyB,kBAAAA,CAAE,IAAK,CACV,IAAA,CAAMZ,EAAM,EAAA,CACZ,KAAA,CAAOA,EAAM,KAAA,CACb,OAAA,CAAUmB,CAAAA,EAAiB,CACvBA,CAAAA,CAAM,cAAA,GACN/B,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 { createContext, useContext } from '../core/context'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = createContext<RouterContext>(null as any)\nexport const RouteDepthCtx = createContext<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 = useContext(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"]}
|
package/dist/router.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a
|
|
1
|
+
import {a as a$2}from'./chunk-NY6NOGFU.mjs';import {a as a$1,c}from'./chunk-INJXOHFD.mjs';import'./chunk-NRPWBHKP.mjs';import'./chunk-5PNH2ARD.mjs';import {a,b}from'./chunk-NDPEE2TQ.mjs';function D(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 E(t){return !!(t.length>2048||t.includes("__proto__")||t.includes("constructor")||/^\s*javascript:/i.test(t))}function g(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=g(c);}!u.children&&r.children&&r.children.length>0&&(u.children=g(r.children)),e.push(u);}),e}function N(t,e){for(let r of t){let n=r.path,o=U(n,e);if(o)return [{route:r,params:o.params,pathname:o.path}]}return null}function U(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 w=a(null),p=a(0),j=()=>({pathname:"/",search:"",hash:"",query:{}}),L=()=>typeof window>"u"?j():{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,query:D(window.location.search)},l=null,R=null,F=false;function h(){if(l&&R)return [l,R];l=a$1(L());let t=e=>{l&&(l.pathname=e.pathname,l.search=e.search,l.hash=e.hash,l.query=e.query);};return R=e=>{if(typeof window>"u")return;if(E(e)){console.error("[Flexium Router] Blocked navigation to unsafe path:",e);return}window.history.pushState({},"",e);let r=L();t(r);},typeof window<"u"&&!F&&(window.addEventListener("popstate",()=>{t(L());}),F=true),[l,R]}function m(){let t=b(w);if(!t)throw new Error("useRouter() must be called within a <Routes> component");return t}function q(){let[,t]=h();return t}function _(){return m().params}function Q(){let[t]=h();return t.query}function y(t){return null}function A(t){return t&&typeof t=="object"&&("type"in t||Array.isArray(t))}function B(t){let[e,r]=h(),n=Array.isArray(t.children)?t.children:[t.children],o=n.filter(s=>A(s)&&s.type===y),i=n.filter(s=>!A(s)||s.type!==y),f=g(o),u=e.pathname,c=N(f,u)||[],S=c.length>0?c[c.length-1].params:{},T={location:e,navigate:r,matches:c,params:S},x=null;if(c.length>0){let s=c[0],P=s.route.component,d=u;s.route.beforeEnter?s.route.beforeEnter(s.params)!==false&&(x=a$2(p.Provider,{value:1,key:d,children:a$2(P,{params:s.params,key:d})})):x=a$2(p.Provider,{value:1,key:d,children:a$2(P,{params:s.params,key:d})});}return a$2(w.Provider,{value:T,children:[...i,x]})}function M(){let t=m(),[e]=c(p),r=e??0,[n]=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:a$2(p.Provider,{value:r+1,children:a$2(i,{params:o.params})})}function I(t){let e=m();return a$2("a",{href:t.to,class:t.class,onclick:r=>{r.preventDefault(),e.navigate(t.to);},children:t.children})}export{I as Link,M as Outlet,y as Route,B as Routes,h as useLocation,q as useNavigate,_ as useParams,Q as useQuery,m as useRouter};//# sourceMappingURL=router.mjs.map
|
|
2
2
|
//# sourceMappingURL=router.mjs.map
|
package/dist/router.mjs.map
CHANGED
|
@@ -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","i","routeSegment","locationSegment","RouterCtx","createContext","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","location","reactive","updateLocation","newLocation","router","routerContext","context","Route","_props","isFNode","node","Routes","props","currentLocation","navigate","childrenList","routeNodes","otherChildren","routeDefinitions","currentPath","matches","matchedContent","rootMatch","Component","routeKey","jsx","Outlet","depth","state","match","Link","event"],"mappings":"qOAGA,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,EACnCE,CAAAA,CAAiC,GACvC,OAAAD,CAAAA,CAAO,QAAQ,CAACE,CAAAA,CAAOC,IAAQF,CAAAA,CAAOE,CAAG,EAAID,CAAK,CAAA,CAC3CD,CACT,CACA,OAAOF,EACJ,SAAA,CAAU,CAAC,EACX,KAAA,CAAM,GAAG,EACT,MAAA,CAAO,CAACK,EAAaC,CAAAA,GAAS,CAC7B,GAAM,CAACF,CAAAA,CAAKD,CAAK,CAAA,CAAIG,CAAAA,CAAK,MAAM,GAAG,CAAA,CACnC,OAAIF,CAAAA,GAAKC,CAAAA,CAAY,mBAAmBD,CAAG,CAAC,EAAI,kBAAA,CAAmBD,CAAAA,EAAS,EAAE,CAAA,CAAA,CACvEE,CACT,EAAG,EAA4B,CACnC,C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UF,GAAAA,CAAEF,EAAW,CAAE,MAAA,CAAQM,EAAM,MAAO,CAAC,CACnD,CAAC,CACL,CCtBO,SAASC,CAAAA,CAAKlB,EAAkB,CACnC,IAAMP,EAAgBD,CAAAA,EAAO,CAC7B,OAAOqB,GAAAA,CAAE,GAAA,CAAK,CACV,IAAA,CAAMb,CAAAA,CAAM,GACZ,KAAA,CAAOA,CAAAA,CAAM,MACb,OAAA,CAAUmB,CAAAA,EAAiB,CACvBA,CAAAA,CAAM,cAAA,GACN1B,CAAAA,CAAc,QAAA,CAASO,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 { createContext, context } from '../core/context'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = createContext<RouterContext>(null as any)\nexport const RouteDepthCtx = createContext<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 location(): [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\nexport function router(): RouterContext {\n const routerContext = context(RouterCtx)\n if (!routerContext) {\n throw new Error('router() must be called within a <Routes> component')\n }\n return routerContext\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, location } 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] = location()\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 { state } from '../../core/state'\nimport { context } from '../../core/context'\nimport { jsx as f } from '../../jsx-runtime'\nimport { RouteDepthCtx, router } from '../router'\n\nexport function Outlet() {\n const routerContext = router()\n const depth = (context(RouteDepthCtx) as number) || 0\n\n const [matches] = state(() => 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 { router } from '../router'\n\nexport function Link(props: LinkProps) {\n const routerContext = router()\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","createContext","RouteDepthCtx","getDefaultLocation","getCurrentLocation","globalLocation","globalNavigate","popstateListenerAttached","useLocation","reactive","updateLocation","newLocation","useRouter","routerContext","useContext","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","use","depth","match","Link","event"],"mappings":"2LAGA,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,GAAM,CAACF,EAAKD,CAAK,CAAA,CAAIG,EAAK,KAAA,CAAM,GAAG,EACnC,OAAIF,CA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,SAASK,CAAAA,EAAS,CACrB,IAAMzB,CAAAA,CAAgBD,GAAU,CAC1B,CAAC2B,CAAU,CAAA,CAAIC,CAAAA,CAAItC,CAAa,CAAA,CAChCuC,CAAAA,CAAQF,GAAc,CAAA,CAEtB,CAACP,CAAO,CAAA,CAAIQ,CAAAA,CAAI,IAAM3B,CAAAA,CAAc,OAAO,EAEjD,GAAI4B,CAAAA,EAAST,CAAAA,CAAQ,MAAA,CAAQ,OAAO,IAAA,CAEpC,IAAMU,CAAAA,CAAQV,CAAAA,CAAQS,CAAK,CAAA,CACrBN,CAAAA,CAAYO,EAAM,KAAA,CAAM,SAAA,CAG9B,OAAIA,CAAAA,CAAM,KAAA,CAAM,aACRA,CAAAA,CAAM,KAAA,CAAM,YAAYA,CAAAA,CAAM,MAAM,IAAM,KAAA,CAAc,IAAA,CAIzDL,GAAAA,CAAEnC,CAAAA,CAAc,QAAA,CAAU,CAC7B,MAAOuC,CAAAA,CAAQ,CAAA,CACf,SAAUJ,GAAAA,CAAEF,CAAAA,CAAW,CAAE,MAAA,CAAQO,CAAAA,CAAM,MAAO,CAAC,CACnD,CAAC,CACL,CCtBO,SAASC,CAAAA,CAAKlB,CAAAA,CAAkB,CACnC,IAAMZ,CAAAA,CAAgBD,CAAAA,EAAU,CAChC,OAAOyB,GAAAA,CAAE,IAAK,CACV,IAAA,CAAMZ,EAAM,EAAA,CACZ,KAAA,CAAOA,EAAM,KAAA,CACb,OAAA,CAAUmB,CAAAA,EAAiB,CACvBA,CAAAA,CAAM,cAAA,GACN/B,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 { createContext, useContext } from '../core/context'\nimport type { Location, RouterContext } from './types'\nimport { parseQuery, isUnsafePath } from './utils'\n\n// Contexts\nexport const RouterCtx = createContext<RouterContext>(null as any)\nexport const RouteDepthCtx = createContext<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 = useContext(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"]}
|
package/dist/server.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as SSROptions, b as SSRResult } from './types-CxlS2F2j.cjs';
|
|
2
2
|
export { S as SerializedState } from './types-CxlS2F2j.cjs';
|
|
3
|
-
import {
|
|
3
|
+
import { a as FNodeChild } from './types-DH8L3A5z.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Render component tree to HTML string with hydration markers
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as SSROptions, b as SSRResult } from './types-CxlS2F2j.js';
|
|
2
2
|
export { S as SerializedState } from './types-CxlS2F2j.js';
|
|
3
|
-
import {
|
|
3
|
+
import { a as FNodeChild } from './types-DH8L3A5z.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Render component tree to HTML string with hydration markers
|
package/dist/server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkUWFVCKRU_js=require('./chunk-UWFVCKRU.js'),chunkCGB4YXKS_js=require('./chunk-CGB4YXKS.js');var $={"&":"&","<":"<",">":">",'"':""","'":"'"},F=/[&<>"']/g;function l(e){return String(e).replace(F,r=>$[r])}function a(e){return l(e)}var f=false,d=null,h=0;function I(){return f}function b(){f=true,d=new Map,h=0;}function S(){f=false;let e=Object.fromEntries(d||new Map);return d=null,{states:e}}function x(){return `fid-${h++}`}var T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),v=new Set(["disabled","checked","readonly","required","hidden","selected","autofocus","autoplay","controls","loop","muted","multiple","open","defer","async","novalidate"]),A={className:"class",htmlFor:"for"};function R(e,r={}){let{hydrate:n=true}=r;b();try{let t;typeof e=="function"&&!N(e)?t={type:e,props:{},children:[],key:void 0}:t=e;let o=p(t,n),i=S();return {html:o,state:i}}catch(t){throw S(),t}}function E(e){let{html:r}=R(e,{hydrate:false});return r}function N(e){return e&&typeof e=="object"&&"type"in e&&"props"in e}function p(e,r){if(e==null||typeof e=="boolean")return "";if(typeof e=="string"||typeof e=="number")return l(String(e));if(Array.isArray(e))return e.map(n=>p(n,r)).join("");if(typeof e=="function")return C({type:e,props:{},children:[]},r);if(typeof e=="object"&&N(e)){if(typeof e.type=="string")return w(e,r);if(typeof e.type=="function")return C(e,r)}return ""}function w(e,r){let n=e.type,t=j(e.props,r);if(e.props?.dangerouslySetInnerHTML){let i=e.props.dangerouslySetInnerHTML.__html||"";return `<${n}${t}>${i}</${n}>`}if(T.has(n))return `<${n}${t}>`;let o=(e.children||[]).map(i=>p(i,r)).join("");return `<${n}${t}>${o}</${n}>`}function j(e,r){if(!e)return "";let n=[];if(r){let t=x();n.push(`data-fid="${t}"`);}for(let[t,o]of Object.entries(e)){if(t.startsWith("on")||t==="ref"||t==="key"||t==="children"||t==="dangerouslySetInnerHTML"||o==null)continue;let i=A[t]||t;if(t==="style"&&typeof o=="object"){let c=Object.entries(o).filter(([,s])=>s!=null).map(([s,u])=>`${k(s)}:${u}`).join(";");c&&n.push(`style="${a(c)}"`);continue}if(v.has(i)){o&&n.push(i);continue}o!==false&&n.push(`${i}="${a(String(o))}"`);}return n.length?" "+n.join(" "):""}function C(e,r){let n=e.type,t={...e.props};e.children&&e.children.length>0&&(t.children=e.children.length===1?e.children[0]:e.children);let o=n._contextId,i=o!==void 0,c;i&&(c=chunkCGB4YXKS_js.c(o,t.value));let s={hooks:[],hookIndex:0};try{let u=chunkUWFVCKRU_js.a(s,()=>n(t));return p(u,r)}finally{i&&chunkCGB4YXKS_js.d(o,c);}}function k(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}exports.getIsServer=I;exports.renderToStaticMarkup=E;exports.renderToString=R;//# sourceMappingURL=server.js.map
|
|
2
2
|
//# sourceMappingURL=server.js.map
|
package/dist/server.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {a as a$1}from'./chunk-5PNH2ARD.mjs';import {c,d as d$1}from'./chunk-NDPEE2TQ.mjs';var $={"&":"&","<":"<",">":">",'"':""","'":"'"},F=/[&<>"']/g;function l(e){return String(e).replace(F,r=>$[r])}function a(e){return l(e)}var f=false,d=null,h=0;function I(){return f}function b(){f=true,d=new Map,h=0;}function S(){f=false;let e=Object.fromEntries(d||new Map);return d=null,{states:e}}function x(){return `fid-${h++}`}var T=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),v=new Set(["disabled","checked","readonly","required","hidden","selected","autofocus","autoplay","controls","loop","muted","multiple","open","defer","async","novalidate"]),A={className:"class",htmlFor:"for"};function R(e,r={}){let{hydrate:n=true}=r;b();try{let t;typeof e=="function"&&!N(e)?t={type:e,props:{},children:[],key:void 0}:t=e;let o=p(t,n),i=S();return {html:o,state:i}}catch(t){throw S(),t}}function E(e){let{html:r}=R(e,{hydrate:false});return r}function N(e){return e&&typeof e=="object"&&"type"in e&&"props"in e}function p(e,r){if(e==null||typeof e=="boolean")return "";if(typeof e=="string"||typeof e=="number")return l(String(e));if(Array.isArray(e))return e.map(n=>p(n,r)).join("");if(typeof e=="function")return C({type:e,props:{},children:[]},r);if(typeof e=="object"&&N(e)){if(typeof e.type=="string")return w(e,r);if(typeof e.type=="function")return C(e,r)}return ""}function w(e,r){let n=e.type,t=j(e.props,r);if(e.props?.dangerouslySetInnerHTML){let i=e.props.dangerouslySetInnerHTML.__html||"";return `<${n}${t}>${i}</${n}>`}if(T.has(n))return `<${n}${t}>`;let o=(e.children||[]).map(i=>p(i,r)).join("");return `<${n}${t}>${o}</${n}>`}function j(e,r){if(!e)return "";let n=[];if(r){let t=x();n.push(`data-fid="${t}"`);}for(let[t,o]of Object.entries(e)){if(t.startsWith("on")||t==="ref"||t==="key"||t==="children"||t==="dangerouslySetInnerHTML"||o==null)continue;let i=A[t]||t;if(t==="style"&&typeof o=="object"){let c=Object.entries(o).filter(([,s])=>s!=null).map(([s,u])=>`${k(s)}:${u}`).join(";");c&&n.push(`style="${a(c)}"`);continue}if(v.has(i)){o&&n.push(i);continue}o!==false&&n.push(`${i}="${a(String(o))}"`);}return n.length?" "+n.join(" "):""}function C(e,r){let n=e.type,t={...e.props};e.children&&e.children.length>0&&(t.children=e.children.length===1?e.children[0]:e.children);let o=n._contextId,i=o!==void 0,c$1;i&&(c$1=c(o,t.value));let s={hooks:[],hookIndex:0};try{let u=a$1(s,()=>n(t));return p(u,r)}finally{i&&d$1(o,c$1);}}function k(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}export{I as getIsServer,E as renderToStaticMarkup,R as renderToString};//# sourceMappingURL=server.mjs.map
|
|
2
2
|
//# sourceMappingURL=server.mjs.map
|