markshelf 0.1.4 → 0.2.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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +12 -0
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/asset/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/asset/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/asset/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/asset/route.js +7 -0
- package/.next/standalone/.next/server/app/api/asset/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/asset/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/asset/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/diff/route.js +3 -2
- package/.next/standalone/.next/server/app/api/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/file/route.js +3 -2
- package/.next/standalone/.next/server/app/api/file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/graph/route.js +3 -2
- package/.next/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/history/route.js +3 -2
- package/.next/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js +3 -2
- package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/timeline/route.js +3 -2
- package/.next/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tree/route.js +3 -2
- package/.next/standalone/.next/server/app/api/tree/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/watch/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/watch/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/watch/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/watch/route.js +6 -0
- package/.next/standalone/.next/server/app/api/watch/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/watch/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/watch/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/favicon.ico/route.js +2 -1
- package/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-_k816._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01e7zo7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04mxfkc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__053gm34._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d.-s5p._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i.wyss._.js +6 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__01cq2u6._.js → [root-of-the-server]__0nr71d2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0op9af~._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rwylex._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13vatcq._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_asset_route_actions_03nkw38.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_watch_route_actions_0go0kk3.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_04~_e52._.js +13 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05ar4zx._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09qrkq5._.js +5 -5
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0serya4._.js → [root-of-the-server]__0u7hi3-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0eva9q1._.js → node_modules_035nqw0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_06r3o30._.js → node_modules_0_lpyzd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_09.cbx4._.js → node_modules_0d0g.gp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0ic-wja._.js → node_modules_0m258l0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0w2-q.z._.js → node_modules_0sxu8tl._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_11wp0ye._.js → node_modules_0ub-k6d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_05e-8m3._.js → node_modules_0uebmgu._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_10cz306._.js → node_modules_0~vmgv6._.js} +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/0.z3b.-~oogkw.js +11 -0
- package/.next/standalone/.next/static/chunks/13tjphiswda64.css +1 -0
- package/.next/standalone/Dockerfile +54 -0
- package/.next/standalone/LICENSE +21 -0
- package/.next/standalone/README.md +71 -21
- package/.next/standalone/docker/README.md +65 -0
- package/.next/standalone/docker-entrypoint.sh +40 -0
- package/.next/standalone/docs//344/273/225/346/247/230/README.md +9 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/README.md +8 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.1-bin-cli.md +14 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.2-Dockerfile.md +18 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.3-basePath.md +11 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.4-/347/222/260/345/242/203/345/244/211/346/225/260.md +14 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC2-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273/README.md +3 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC2-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273/SPEC2.1-graph-api.md +16 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC2-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273/SPEC2.2-breadthfirst-layout.md +10 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC2-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273/SPEC2.3-/343/203/252/343/203/263/343/202/257/350/247/243/346/236/220.md +32 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/README.md +12 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.1-PreviewPopup.md +10 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.2-TreeView.md +10 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.3-TableOfContents.md +11 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.4-DetailPanel/343/202/277/343/203/226.md +13 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.5-Markdown/343/203/254/343/203/263/343/203/200/343/203/252/343/203/263/343/202/260.md +22 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.6-SearchBar.md +15 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.7-/343/203/221/343/203/215/343/203/253/343/203/252/343/202/265/343/202/244/343/202/266/343/203/274.md +11 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.8-/347/224/273/345/203/217/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274.md +11 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/README.md +12 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.1-tree.md +23 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.2-file.md +14 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.3-search.md +23 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.4-watch.md +17 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.5-history.md +22 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.6-timeline.md +26 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.7-diff.md +13 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.8-asset.md +22 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC5-/346/260/270/347/266/232/345/214/226/README.md +8 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC5-/346/260/270/347/266/232/345/214/226/SPEC5.1-localStorage.md +20 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC5-/346/260/270/347/266/232/345/214/226/SPEC5.2-URL/343/202/257/343/202/250/343/203/252.md +17 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/Cytoscape.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/Markdown.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/Nextjs.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/breadthfirst.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/npx.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/standalone.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206//343/203/204/343/203/252/343/203/274/343/203/223/343/203/245/343/203/274.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206//343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/203/235/343/203/203/343/203/227/343/202/242/343/203/203/343/203/227.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206//343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225.md +5 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/README.md +9 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ1-/343/203/223/343/203/245/343/203/274/343/202/242/350/265/267/345/213/225/README.md +5 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ1-/343/203/223/343/203/245/343/203/274/343/202/242/350/265/267/345/213/225/REQ1.1-npx/350/265/267/345/213/225.md +13 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ1-/343/203/223/343/203/245/343/203/274/343/202/242/350/265/267/345/213/225/REQ1.2-Docker/350/265/267/345/213/225.md +14 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ1-/343/203/223/343/203/245/343/203/274/343/202/242/350/265/267/345/213/225/REQ1.3-BASE_PATH/351/205/215/344/277/241.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/REQ2.1-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273.md +11 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/REQ2.2-/351/232/216/345/261/244/345/210/207/346/233/277.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/REQ2.3-/343/203/225/343/202/251/343/203/253/343/203/200/351/231/244/345/244/226.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/README.md +5 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.1-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/203/235/343/203/203/343/203/227/343/202/242/343/203/203/343/203/227.md +15 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.2-/343/203/204/343/203/252/343/203/274/343/203/223/343/203/245/343/203/274.md +14 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.3-/347/233/256/346/254/241.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.4-/343/203/221/343/203/215/343/203/253/343/203/252/343/202/265/343/202/244/343/202/266/343/203/274.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.5-/343/202/277/343/203/226/343/202/267/343/202/271/343/203/206/343/203/240.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.6-/347/224/273/345/203/217/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ4-/343/203/212/343/203/223/343/202/262/343/203/274/343/202/267/343/203/247/343/203/263/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ4-/343/203/212/343/203/223/343/202/262/343/203/274/343/202/267/343/203/247/343/203/263/REQ4.1-/346/210/273/343/202/213/351/200/262/343/202/200.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ4-/343/203/212/343/203/223/343/202/262/343/203/274/343/202/267/343/203/247/343/203/263/REQ4.2-/345/205/261/346/234/211/345/217/257/350/203/275URL.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ5-/343/203/225/343/202/241/343/202/244/343/203/253/346/244/234/347/264/242/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ5-/343/203/225/343/202/241/343/202/244/343/203/253/346/244/234/347/264/242/REQ5.1-/343/203/225/343/202/241/343/202/244/343/203/253/345/220/215/346/244/234/347/264/242.md +11 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ6-/343/203/225/343/202/241/343/202/244/343/203/253/347/233/243/350/246/226/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ6-/343/203/225/343/202/241/343/202/244/343/203/253/347/233/243/350/246/226/REQ6.1-SSE/345/244/211/346/233/264/351/200/232/347/237/245.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/REQ7.1-/343/203/225/343/202/241/343/202/244/343/203/253/345/244/211/346/233/264/345/261/245/346/255/264.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/REQ7.2-/343/202/277/343/202/244/343/203/240/343/203/251/343/202/244/343/203/263.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/REQ7.3-diff/350/241/250/347/244/272.md +10 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.1-/347/213/254/347/253/213/343/203/223/343/203/245/343/203/274/343/202/242.md +11 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.2-/345/244/247/347/224/273/351/235/242/350/241/250/347/244/272.md +11 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.3-/343/203/212/343/203/223/343/202/262/343/203/274/343/202/267/343/203/247/343/203/263/345/261/245/346/255/264.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.4-/344/277/235/345/255/230/345/215/263/345/217/215/346/230/240.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.5-/345/205/261/346/234/211/345/217/257/350/203/275URL.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/README.md +7 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R2-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/242/344/277/202/343/201/256/345/217/257/350/246/226/345/214/226/R2.1-/344/276/235/345/255/230/351/226/242/344/277/202/343/201/256/346/212/212/346/217/241.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R2-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/242/344/277/202/343/201/256/345/217/257/350/246/226/345/214/226/R2.2-/345/217/202/347/205/247/345/205/203/343/201/256/346/212/212/346/217/241.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R2-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/242/344/277/202/343/201/256/345/217/257/350/246/226/345/214/226/README.md +8 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R3-/343/202/252/343/203/263/343/203/234/343/203/274/343/203/207/343/202/243/343/203/263/343/202/260/346/224/257/346/217/264/R3.1-/347/224/250/350/252/236/343/201/256/345/215/263/346/231/202/347/242/272/350/252/215.md +11 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R3-/343/202/252/343/203/263/343/203/234/343/203/274/343/203/207/343/202/243/343/203/263/343/202/260/346/224/257/346/217/264/README.md +7 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R4-/345/244/211/346/233/264/345/261/245/346/255/264/343/201/256/346/212/212/346/217/241/R4.1-/345/244/211/346/233/264/345/206/205/345/256/271/343/201/256/350/277/275/350/267/241.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R4-/345/244/211/346/233/264/345/261/245/346/255/264/343/201/256/346/212/212/346/217/241/R4.2-/345/275/261/351/237/277/347/257/204/345/233/262/343/201/256/344/277/257/347/236/260.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R4-/345/244/211/346/233/264/345/261/245/346/255/264/343/201/256/346/212/212/346/217/241/README.md +7 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R5-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/346/216/242/347/264/242/346/200/247/R5.1-/343/203/225/343/202/241/343/202/244/343/203/253/345/220/215/346/244/234/347/264/242.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R5-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/346/216/242/347/264/242/346/200/247/README.md +7 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R6-/343/203/207/343/203/227/343/203/255/343/202/244/346/237/224/350/273/237/346/200/247/R6.1-Docker/351/205/215/344/277/241.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R6-/343/203/207/343/203/227/343/203/255/343/202/244/346/237/224/350/273/237/346/200/247/R6.2-/343/202/265/343/203/226/343/203/221/343/202/271/351/205/215/344/277/241.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R6-/343/203/207/343/203/227/343/203/255/343/202/244/346/237/224/350/273/237/346/200/247/README.md +7 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/README.md +9 -0
- package/.next/standalone/next.config.ts +7 -0
- package/.next/standalone/package.json +23 -1
- package/.next/standalone/scripts/docker-run.mjs +24 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/app/api/asset/route.ts +40 -0
- package/.next/standalone/src/app/api/watch/route.ts +89 -0
- package/.next/standalone/src/app/page.tsx +72 -9
- package/.next/standalone/src/components/DetailPanel.tsx +40 -7
- package/.next/standalone/src/components/DiffView.tsx +2 -1
- package/.next/standalone/src/components/HistoryPanel.tsx +5 -2
- package/.next/standalone/src/components/LinkGraph.tsx +181 -10
- package/.next/standalone/src/components/Markdown.tsx +128 -8
- package/.next/standalone/src/components/PreviewPopup.tsx +6 -3
- package/.next/standalone/src/components/SearchBar.tsx +2 -1
- package/.next/standalone/src/components/TimelinePanel.tsx +5 -2
- package/.next/standalone/src/components/TreeView.tsx +36 -9
- package/.next/standalone/src/lib/basePath.ts +8 -0
- package/.next/standalone/src/lib/docs.ts +12 -0
- package/.next/standalone/src/lib/links.ts +98 -25
- package/.next/standalone/src/lib/useRefreshTick.ts +44 -0
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/.next/static/chunks/0.z3b.-~oogkw.js +11 -0
- package/.next/static/chunks/13tjphiswda64.css +1 -0
- package/LICENSE +21 -0
- package/README.md +71 -21
- package/package.json +23 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04otwp7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_gt~a4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j8-xkl._.js +0 -13
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0owpp0l._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qnrcw7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yvq0sd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zoyna0._.js +0 -3
- package/.next/standalone/.next/static/chunks/04x.fjh8sw0s1.css +0 -1
- package/.next/standalone/.next/static/chunks/0z_707.y37o2..js +0 -11
- package/.next/standalone/AGENTS.md +0 -5
- package/.next/standalone/CLAUDE.md +0 -1
- package/.next/standalone/markshelf-0.1.0.tgz +0 -0
- package/.next/standalone/markshelf-0.1.2.tgz +0 -0
- package/.next/static/chunks/04x.fjh8sw0s1.css +0 -1
- package/.next/static/chunks/0z_707.y37o2..js +0 -11
- /package/.next/standalone/.next/static/{JkyieJgBB2eU8MtnlBGvG → JZXBFyFBzt6ffFpnmO9cB}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{JkyieJgBB2eU8MtnlBGvG → JZXBFyFBzt6ffFpnmO9cB}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{JkyieJgBB2eU8MtnlBGvG → JZXBFyFBzt6ffFpnmO9cB}/_ssgManifest.js +0 -0
- /package/.next/static/{JkyieJgBB2eU8MtnlBGvG → JZXBFyFBzt6ffFpnmO9cB}/_buildManifest.js +0 -0
- /package/.next/static/{JkyieJgBB2eU8MtnlBGvG → JZXBFyFBzt6ffFpnmO9cB}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{JkyieJgBB2eU8MtnlBGvG → JZXBFyFBzt6ffFpnmO9cB}/_ssgManifest.js +0 -0
|
@@ -5,6 +5,7 @@ import ReactMarkdown, { Components } from "react-markdown";
|
|
|
5
5
|
import remarkGfm from "remark-gfm";
|
|
6
6
|
import type { HeadingInfo } from "./TableOfContents";
|
|
7
7
|
import { MermaidBlock } from "./MermaidBlock";
|
|
8
|
+
import { withBasePath } from "@/lib/basePath";
|
|
8
9
|
|
|
9
10
|
export interface FileRef {
|
|
10
11
|
displayName: string;
|
|
@@ -34,9 +35,25 @@ function slugify(text: string): string {
|
|
|
34
35
|
function parseHeadings(markdown: string): HeadingInfo[] {
|
|
35
36
|
const headings: HeadingInfo[] = [];
|
|
36
37
|
const seen = new Map<string, number>();
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const headingRe = /^(#{1,4})\s+(.+)$/;
|
|
39
|
+
const fenceRe = /^[ \t]*(`{3,}|~{3,})/;
|
|
40
|
+
let fence: string | null = null;
|
|
41
|
+
for (const line of markdown.split("\n")) {
|
|
42
|
+
const fenceMatch = fenceRe.exec(line);
|
|
43
|
+
if (fenceMatch) {
|
|
44
|
+
const marker = fenceMatch[1][0];
|
|
45
|
+
if (fence === null) {
|
|
46
|
+
fence = marker;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (fenceMatch[1].startsWith(fence)) {
|
|
50
|
+
fence = null;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (fence !== null) continue;
|
|
55
|
+
const m = headingRe.exec(line);
|
|
56
|
+
if (!m) continue;
|
|
40
57
|
const level = m[1].length;
|
|
41
58
|
const text = m[2].replace(/[#*_`[\]]/g, "").trim();
|
|
42
59
|
const base = slugify(text) || "heading";
|
|
@@ -100,6 +117,90 @@ export function Markdown({
|
|
|
100
117
|
return new RegExp(`(${escaped.join("|")})`, "g");
|
|
101
118
|
}, [autolinkMap]);
|
|
102
119
|
|
|
120
|
+
const fileSet = useMemo(
|
|
121
|
+
() => new Set((fileRefs ?? []).map((f) => f.path)),
|
|
122
|
+
[fileRefs],
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
function resolveRelativeLink(href: string): string | null {
|
|
126
|
+
const cleanUrl = href.split("#")[0].split("?")[0].trim();
|
|
127
|
+
if (!cleanUrl) return null;
|
|
128
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(cleanUrl)) return null;
|
|
129
|
+
if (cleanUrl.startsWith("//")) return null;
|
|
130
|
+
|
|
131
|
+
let decoded: string;
|
|
132
|
+
try {
|
|
133
|
+
decoded = decodeURI(cleanUrl);
|
|
134
|
+
} catch {
|
|
135
|
+
decoded = cleanUrl;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const currentDir =
|
|
139
|
+
currentPath && currentPath.includes("/")
|
|
140
|
+
? currentPath.slice(0, currentPath.lastIndexOf("/"))
|
|
141
|
+
: "";
|
|
142
|
+
const joined = decoded.startsWith("/")
|
|
143
|
+
? decoded.slice(1)
|
|
144
|
+
: currentDir
|
|
145
|
+
? currentDir + "/" + decoded
|
|
146
|
+
: decoded;
|
|
147
|
+
|
|
148
|
+
const parts = joined.split("/");
|
|
149
|
+
const normalized: string[] = [];
|
|
150
|
+
for (const p of parts) {
|
|
151
|
+
if (p === "" || p === ".") continue;
|
|
152
|
+
if (p === "..") {
|
|
153
|
+
normalized.pop();
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
normalized.push(p);
|
|
157
|
+
}
|
|
158
|
+
const resolved = normalized.join("/");
|
|
159
|
+
if (!resolved) return null;
|
|
160
|
+
|
|
161
|
+
if (fileSet.has(resolved)) return resolved;
|
|
162
|
+
if (fileSet.has(resolved + "/README.md")) return resolved + "/README.md";
|
|
163
|
+
if (!/\.md$/i.test(resolved) && fileSet.has(resolved + ".md")) return resolved + ".md";
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function resolveAssetPath(src: string): string | null {
|
|
168
|
+
const cleanUrl = src.split("#")[0].split("?")[0].trim();
|
|
169
|
+
if (!cleanUrl) return null;
|
|
170
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(cleanUrl)) return null;
|
|
171
|
+
if (cleanUrl.startsWith("//")) return null;
|
|
172
|
+
|
|
173
|
+
let decoded: string;
|
|
174
|
+
try {
|
|
175
|
+
decoded = decodeURI(cleanUrl);
|
|
176
|
+
} catch {
|
|
177
|
+
decoded = cleanUrl;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const currentDir =
|
|
181
|
+
currentPath && currentPath.includes("/")
|
|
182
|
+
? currentPath.slice(0, currentPath.lastIndexOf("/"))
|
|
183
|
+
: "";
|
|
184
|
+
const joined = decoded.startsWith("/")
|
|
185
|
+
? decoded.slice(1)
|
|
186
|
+
: currentDir
|
|
187
|
+
? currentDir + "/" + decoded
|
|
188
|
+
: decoded;
|
|
189
|
+
|
|
190
|
+
const parts = joined.split("/");
|
|
191
|
+
const normalized: string[] = [];
|
|
192
|
+
for (const p of parts) {
|
|
193
|
+
if (p === "" || p === ".") continue;
|
|
194
|
+
if (p === "..") {
|
|
195
|
+
normalized.pop();
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
normalized.push(p);
|
|
199
|
+
}
|
|
200
|
+
const resolved = normalized.join("/");
|
|
201
|
+
return resolved || null;
|
|
202
|
+
}
|
|
203
|
+
|
|
103
204
|
function getIdForHeading(text: string): string {
|
|
104
205
|
const ids = headingIdMap.get(text);
|
|
105
206
|
if (!ids) return slugify(text) || "heading";
|
|
@@ -153,21 +254,29 @@ export function Markdown({
|
|
|
153
254
|
}
|
|
154
255
|
return <pre>{children}</pre>;
|
|
155
256
|
},
|
|
156
|
-
// Auto-link rendering: intercept <a> with "autolink:" prefix
|
|
257
|
+
// Auto-link rendering: intercept <a> with "autolink:" prefix,
|
|
258
|
+
// and resolve relative markdown links to docs paths so they behave like autolinks.
|
|
157
259
|
a: ({ href, children: linkChildren, ...rest }) => {
|
|
260
|
+
let targetPath: string | null = null;
|
|
158
261
|
if (href?.startsWith("autolink:")) {
|
|
159
|
-
|
|
262
|
+
targetPath = href.slice("autolink:".length);
|
|
263
|
+
} else if (href) {
|
|
264
|
+
targetPath = resolveRelativeLink(href);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (targetPath) {
|
|
268
|
+
const resolved = targetPath;
|
|
160
269
|
return (
|
|
161
270
|
<span
|
|
162
|
-
className="text-[var(--brand-primary)]
|
|
271
|
+
className="text-[var(--brand-primary)] font-medium cursor-pointer hover:underline transition-colors"
|
|
163
272
|
onClick={(e) => {
|
|
164
273
|
e.preventDefault();
|
|
165
274
|
onPreviewHide?.();
|
|
166
|
-
onNavigate?.(
|
|
275
|
+
onNavigate?.(resolved);
|
|
167
276
|
}}
|
|
168
277
|
onMouseEnter={(e) => {
|
|
169
278
|
const rect = (e.target as HTMLElement).getBoundingClientRect();
|
|
170
|
-
onPreviewShow?.(
|
|
279
|
+
onPreviewShow?.(resolved, rect);
|
|
171
280
|
}}
|
|
172
281
|
onMouseLeave={() => onPreviewHide?.()}
|
|
173
282
|
>
|
|
@@ -177,6 +286,17 @@ export function Markdown({
|
|
|
177
286
|
}
|
|
178
287
|
return <a href={href} {...rest}>{linkChildren}</a>;
|
|
179
288
|
},
|
|
289
|
+
// Images: rewrite relative src to the asset API so files under DOCS_ROOT
|
|
290
|
+
// are reachable; leave absolute, data:, and protocol-relative URLs alone.
|
|
291
|
+
img: ({ src, alt, ...rest }) => {
|
|
292
|
+
if (typeof src !== "string") {
|
|
293
|
+
return <img src={src as string | undefined} alt={alt} {...rest} />;
|
|
294
|
+
}
|
|
295
|
+
const resolved = resolveAssetPath(src);
|
|
296
|
+
if (!resolved) return <img src={src} alt={alt} {...rest} />;
|
|
297
|
+
const apiSrc = withBasePath(`/api/asset?path=${encodeURIComponent(resolved)}`);
|
|
298
|
+
return <img src={apiSrc} alt={alt} {...rest} />;
|
|
299
|
+
},
|
|
180
300
|
// Inject auto-links into text content
|
|
181
301
|
p: ({ children: pChildren, ...rest }) => {
|
|
182
302
|
return <p {...rest}>{processAutolinks(pChildren)}</p>;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState, useRef, useCallback } from "react";
|
|
4
4
|
import { Markdown, FileRef } from "./Markdown";
|
|
5
|
+
import { useRefreshTick } from "@/lib/useRefreshTick";
|
|
6
|
+
import { withBasePath } from "@/lib/basePath";
|
|
5
7
|
import { ExternalLink } from "lucide-react";
|
|
6
8
|
|
|
7
9
|
interface Props {
|
|
@@ -27,6 +29,7 @@ export function PreviewPopup({ path, position, onNavigate, onMouseEnter, onMouse
|
|
|
27
29
|
const [nestedPos, setNestedPos] = useState<{ x: number; y: number } | null>(null);
|
|
28
30
|
const nestedShowTimer = useRef<ReturnType<typeof setTimeout>>(null);
|
|
29
31
|
const nestedHideTimer = useRef<ReturnType<typeof setTimeout>>(null);
|
|
32
|
+
const refreshTick = useRefreshTick();
|
|
30
33
|
|
|
31
34
|
useEffect(() => {
|
|
32
35
|
// Cancel any pending nested popup timers whenever path changes
|
|
@@ -43,12 +46,12 @@ export function PreviewPopup({ path, position, onNavigate, onMouseEnter, onMouse
|
|
|
43
46
|
setContent(null);
|
|
44
47
|
setNestedPath(null);
|
|
45
48
|
setNestedPos(null);
|
|
46
|
-
fetch(`/api/file?path=${encodeURIComponent(path)}`)
|
|
49
|
+
fetch(withBasePath(`/api/file?path=${encodeURIComponent(path)}`))
|
|
47
50
|
.then((r) => r.json())
|
|
48
51
|
.then((data) => setContent(data.content ?? null))
|
|
49
52
|
.catch(() => setContent(null))
|
|
50
53
|
.finally(() => setLoading(false));
|
|
51
|
-
}, [path]);
|
|
54
|
+
}, [path, refreshTick]);
|
|
52
55
|
|
|
53
56
|
// Adjust position to stay within viewport
|
|
54
57
|
useEffect(() => {
|
|
@@ -113,7 +116,7 @@ export function PreviewPopup({ path, position, onNavigate, onMouseEnter, onMouse
|
|
|
113
116
|
// Also hide nested if mouse leaves this popup entirely
|
|
114
117
|
handleNestedHide();
|
|
115
118
|
}}
|
|
116
|
-
className="fixed bg-[var(--bg-surface)] border border-[var(--border-default)] rounded-lg shadow-xl w-[480px] max-h-[420px] overflow-y-auto"
|
|
119
|
+
className="fixed bg-[var(--bg-surface)] border border-[var(--border-default)] rounded-lg shadow-xl w-[min(480px,30vw)] max-h-[min(420px,30vh)] overflow-y-auto"
|
|
117
120
|
style={{
|
|
118
121
|
left: adjustedPos?.x ?? position.x,
|
|
119
122
|
top: adjustedPos?.y ?? position.y,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState, useRef, useCallback, useEffect } from "react";
|
|
4
4
|
import { Search, X } from "lucide-react";
|
|
5
|
+
import { withBasePath } from "@/lib/basePath";
|
|
5
6
|
|
|
6
7
|
interface SearchMatch {
|
|
7
8
|
line: number;
|
|
@@ -34,7 +35,7 @@ export function SearchBar({ onSelect }: Props) {
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
setIsSearching(true);
|
|
37
|
-
fetch(`/api/search?q=${encodeURIComponent(q.trim())}`)
|
|
38
|
+
fetch(withBasePath(`/api/search?q=${encodeURIComponent(q.trim())}`))
|
|
38
39
|
.then((r) => r.json())
|
|
39
40
|
.then((data) => {
|
|
40
41
|
setResults(data.results ?? []);
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { GitCommit, FileText, ChevronDown, ChevronRight, X, Clock } from "lucide-react";
|
|
5
5
|
import { DiffView } from "./DiffView";
|
|
6
|
+
import { useRefreshTick } from "@/lib/useRefreshTick";
|
|
7
|
+
import { withBasePath } from "@/lib/basePath";
|
|
6
8
|
|
|
7
9
|
interface TimelineEntry {
|
|
8
10
|
hash: string;
|
|
@@ -44,17 +46,18 @@ export function TimelinePanel({ onNavigate, onClose }: Props) {
|
|
|
44
46
|
const [loading, setLoading] = useState(true);
|
|
45
47
|
const [expandedHash, setExpandedHash] = useState<string | null>(null);
|
|
46
48
|
const [expandedFile, setExpandedFile] = useState<{ hash: string; file: string } | null>(null);
|
|
49
|
+
const refreshTick = useRefreshTick();
|
|
47
50
|
|
|
48
51
|
useEffect(() => {
|
|
49
52
|
setLoading(true);
|
|
50
|
-
fetch("/api/timeline")
|
|
53
|
+
fetch(withBasePath("/api/timeline"))
|
|
51
54
|
.then((r) => r.json())
|
|
52
55
|
.then((data) => {
|
|
53
56
|
setEntries(data.entries ?? []);
|
|
54
57
|
setLoading(false);
|
|
55
58
|
})
|
|
56
59
|
.catch(() => setLoading(false));
|
|
57
|
-
}, []);
|
|
60
|
+
}, [refreshTick]);
|
|
58
61
|
|
|
59
62
|
useEffect(() => {
|
|
60
63
|
const handleKeyDown = (e: KeyboardEvent) => {
|
|
@@ -18,6 +18,8 @@ interface Props {
|
|
|
18
18
|
onSelect: (path: string) => void;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
const EXPANDED_KEY = "markshelf:treeExpanded";
|
|
22
|
+
|
|
21
23
|
/** Collect all folder paths that are ancestors of targetPath */
|
|
22
24
|
function getAncestorPaths(entries: TreeEntry[], targetPath: string): Set<string> {
|
|
23
25
|
const result = new Set<string>();
|
|
@@ -47,17 +49,42 @@ function getAncestorPaths(entries: TreeEntry[], targetPath: string): Set<string>
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
export function TreeView({ entries, selectedPath, onSelect }: Props) {
|
|
50
|
-
// Track which folders are expanded (by path)
|
|
51
|
-
const [expanded, setExpanded] = useState<Set<string>>(()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
// Track which folders are expanded (by path). Hydrated from localStorage on mount.
|
|
53
|
+
const [expanded, setExpanded] = useState<Set<string>>(new Set());
|
|
54
|
+
const hydratedRef = useRef(false);
|
|
55
|
+
|
|
56
|
+
// Load saved state once on mount; if none, default to expanding top-level hasReadme folders.
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (hydratedRef.current) return;
|
|
59
|
+
const saved = localStorage.getItem(EXPANDED_KEY);
|
|
60
|
+
if (saved) {
|
|
61
|
+
try {
|
|
62
|
+
const arr = JSON.parse(saved);
|
|
63
|
+
if (Array.isArray(arr)) {
|
|
64
|
+
setExpanded(new Set(arr.filter((s) => typeof s === "string")));
|
|
65
|
+
hydratedRef.current = true;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
} catch {
|
|
69
|
+
/* ignore */
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
// No saved state: expand top-level hasReadme folders as the default.
|
|
73
|
+
if (entries.length > 0) {
|
|
74
|
+
const initial = new Set<string>();
|
|
75
|
+
for (const e of entries) {
|
|
76
|
+
if (e.type === "folder" && e.hasReadme) initial.add(e.path);
|
|
77
|
+
}
|
|
78
|
+
setExpanded(initial);
|
|
79
|
+
hydratedRef.current = true;
|
|
80
|
+
}
|
|
81
|
+
}, [entries]);
|
|
82
|
+
|
|
83
|
+
// Persist expanded state to localStorage (only after hydration, to avoid overwriting with empty set).
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!hydratedRef.current) return;
|
|
86
|
+
localStorage.setItem(EXPANDED_KEY, JSON.stringify([...expanded]));
|
|
87
|
+
}, [expanded]);
|
|
61
88
|
|
|
62
89
|
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
|
63
90
|
const selectedRef = useRef<HTMLDivElement>(null);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const raw = process.env.NEXT_PUBLIC_BASE_PATH?.trim();
|
|
2
|
+
const basePath =
|
|
3
|
+
raw && raw !== "/" && raw !== "" ? raw.replace(/\/$/, "") : "";
|
|
4
|
+
|
|
5
|
+
export function withBasePath(path: string): string {
|
|
6
|
+
if (!path.startsWith("/")) return path;
|
|
7
|
+
return basePath + path;
|
|
8
|
+
}
|
|
@@ -105,6 +105,18 @@ export function readFile(relPath: string): string | null {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
export function readAsset(relPath: string): Buffer | null {
|
|
109
|
+
const fullPath = path.resolve(DOCS_ROOT, relPath);
|
|
110
|
+
if (!fullPath.startsWith(path.resolve(DOCS_ROOT))) return null;
|
|
111
|
+
try {
|
|
112
|
+
const stat = fs.statSync(fullPath);
|
|
113
|
+
if (!stat.isFile()) return null;
|
|
114
|
+
return fs.readFileSync(fullPath);
|
|
115
|
+
} catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
108
120
|
export function statFile(relPath: string): number | null {
|
|
109
121
|
const fullPath = path.resolve(DOCS_ROOT, relPath);
|
|
110
122
|
if (!fullPath.startsWith(path.resolve(DOCS_ROOT))) return null;
|
|
@@ -15,6 +15,64 @@ export interface LinkGraph {
|
|
|
15
15
|
edges: GraphEdge[];
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// Matches markdown link `[label](url)` excluding image syntax `![...]`.
|
|
19
|
+
// The leading capture group absorbs a non-"!" char (or string start) to avoid
|
|
20
|
+
// matching image links.
|
|
21
|
+
const LINK_RE = /(^|[^!])\[([^\]]*)\]\(([^)]+)\)/g;
|
|
22
|
+
// Fenced code blocks (``` or ~~~) — stripped before scanning
|
|
23
|
+
const FENCE_RE = /(^|\n)(```|~~~)[^\n]*\n[\s\S]*?\n\2/g;
|
|
24
|
+
// Inline code `...`
|
|
25
|
+
const INLINE_CODE_RE = /`[^`\n]*`/g;
|
|
26
|
+
|
|
27
|
+
function stripCode(content: string): string {
|
|
28
|
+
return content.replace(FENCE_RE, "").replace(INLINE_CODE_RE, "");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function resolveLink(
|
|
32
|
+
currentPath: string,
|
|
33
|
+
rawUrl: string,
|
|
34
|
+
fileSet: Set<string>,
|
|
35
|
+
): string | null {
|
|
36
|
+
const cleanUrl = rawUrl.split("#")[0].split("?")[0].trim();
|
|
37
|
+
if (!cleanUrl) return null;
|
|
38
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(cleanUrl)) return null;
|
|
39
|
+
if (cleanUrl.startsWith("//")) return null;
|
|
40
|
+
|
|
41
|
+
let decoded: string;
|
|
42
|
+
try {
|
|
43
|
+
decoded = decodeURI(cleanUrl);
|
|
44
|
+
} catch {
|
|
45
|
+
decoded = cleanUrl;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const currentDir = currentPath.includes("/")
|
|
49
|
+
? currentPath.slice(0, currentPath.lastIndexOf("/"))
|
|
50
|
+
: "";
|
|
51
|
+
const joined = decoded.startsWith("/")
|
|
52
|
+
? decoded.slice(1)
|
|
53
|
+
: currentDir
|
|
54
|
+
? currentDir + "/" + decoded
|
|
55
|
+
: decoded;
|
|
56
|
+
|
|
57
|
+
const parts = joined.split("/");
|
|
58
|
+
const normalized: string[] = [];
|
|
59
|
+
for (const p of parts) {
|
|
60
|
+
if (p === "" || p === ".") continue;
|
|
61
|
+
if (p === "..") {
|
|
62
|
+
normalized.pop();
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
normalized.push(p);
|
|
66
|
+
}
|
|
67
|
+
const resolved = normalized.join("/");
|
|
68
|
+
if (!resolved) return null;
|
|
69
|
+
|
|
70
|
+
if (fileSet.has(resolved)) return resolved;
|
|
71
|
+
if (fileSet.has(resolved + "/README.md")) return resolved + "/README.md";
|
|
72
|
+
if (!/\.md$/i.test(resolved) && fileSet.has(resolved + ".md")) return resolved + ".md";
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
18
76
|
export function buildLinkGraph(
|
|
19
77
|
files: FileRef[],
|
|
20
78
|
readFile: (path: string) => string | null,
|
|
@@ -23,43 +81,59 @@ export function buildLinkGraph(
|
|
|
23
81
|
.filter((f) => f.displayName.length > 2)
|
|
24
82
|
.sort((a, b) => b.displayName.length - a.displayName.length);
|
|
25
83
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// Build regex from all displayNames
|
|
29
|
-
const escaped = filtered.map((f) =>
|
|
30
|
-
f.displayName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
|
|
31
|
-
);
|
|
32
|
-
const regex = new RegExp(`(${escaped.join("|")})`, "g");
|
|
33
|
-
|
|
34
|
-
// Map displayName → path for lookup
|
|
84
|
+
const fileSet = new Set(files.map((f) => f.path));
|
|
35
85
|
const nameToPath = new Map<string, string>();
|
|
36
86
|
for (const f of filtered) {
|
|
37
87
|
nameToPath.set(f.displayName, f.path);
|
|
38
88
|
}
|
|
39
89
|
|
|
90
|
+
const displayNameRegex =
|
|
91
|
+
filtered.length === 0
|
|
92
|
+
? null
|
|
93
|
+
: new RegExp(
|
|
94
|
+
`(${filtered
|
|
95
|
+
.map((f) => f.displayName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))
|
|
96
|
+
.join("|")})`,
|
|
97
|
+
"g",
|
|
98
|
+
);
|
|
99
|
+
|
|
40
100
|
const edgeSet = new Set<string>();
|
|
41
101
|
const referencedPaths = new Set<string>();
|
|
42
102
|
|
|
103
|
+
const addEdge = (source: string, target: string) => {
|
|
104
|
+
if (target === source) return;
|
|
105
|
+
const key = `${source}\0${target}`;
|
|
106
|
+
if (edgeSet.has(key)) return;
|
|
107
|
+
edgeSet.add(key);
|
|
108
|
+
referencedPaths.add(source);
|
|
109
|
+
referencedPaths.add(target);
|
|
110
|
+
};
|
|
111
|
+
|
|
43
112
|
for (const file of files) {
|
|
44
|
-
const
|
|
45
|
-
if (!
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
113
|
+
const raw = readFile(file.path);
|
|
114
|
+
if (!raw) continue;
|
|
115
|
+
let content = stripCode(raw);
|
|
116
|
+
|
|
117
|
+
// 1) Explicit markdown links: resolve URL → add edge, then strip (url) portion
|
|
118
|
+
// so URL path segments don't create spurious displayName matches.
|
|
119
|
+
content = content.replace(LINK_RE, (_m, lead, label, url) => {
|
|
120
|
+
const target = resolveLink(file.path, url, fileSet);
|
|
121
|
+
if (target) addEdge(file.path, target);
|
|
122
|
+
return `${lead}[${label}]`;
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// 2) DisplayName auto-matching on the stripped content
|
|
126
|
+
if (displayNameRegex) {
|
|
127
|
+
displayNameRegex.lastIndex = 0;
|
|
128
|
+
let match: RegExpExecArray | null;
|
|
129
|
+
while ((match = displayNameRegex.exec(content)) !== null) {
|
|
130
|
+
const targetPath = nameToPath.get(match[0]);
|
|
131
|
+
if (!targetPath) continue;
|
|
132
|
+
addEdge(file.path, targetPath);
|
|
58
133
|
}
|
|
59
134
|
}
|
|
60
135
|
}
|
|
61
136
|
|
|
62
|
-
// Only include nodes that have at least one edge
|
|
63
137
|
const nodes: GraphNode[] = files
|
|
64
138
|
.filter((f) => referencedPaths.has(f.path))
|
|
65
139
|
.map((f) => ({ id: f.path, label: f.displayName }));
|
|
@@ -81,7 +155,6 @@ function computeSignature(
|
|
|
81
155
|
files: FileRef[],
|
|
82
156
|
statFile: (path: string) => number | null,
|
|
83
157
|
): string {
|
|
84
|
-
// Sort paths for stability, then join "path\0mtime"
|
|
85
158
|
const sorted = [...files].sort((a, b) => a.path.localeCompare(b.path));
|
|
86
159
|
const parts: string[] = [];
|
|
87
160
|
for (const f of sorted) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { withBasePath } from "@/lib/basePath";
|
|
5
|
+
|
|
6
|
+
type Listener = (tick: number) => void;
|
|
7
|
+
|
|
8
|
+
let currentTick = 0;
|
|
9
|
+
const listeners = new Set<Listener>();
|
|
10
|
+
let eventSource: EventSource | null = null;
|
|
11
|
+
let debounceTimer: ReturnType<typeof setTimeout> | null = null;
|
|
12
|
+
|
|
13
|
+
function bump() {
|
|
14
|
+
currentTick++;
|
|
15
|
+
for (const l of listeners) l(currentTick);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function ensureConnected() {
|
|
19
|
+
if (eventSource || typeof window === "undefined") return;
|
|
20
|
+
try {
|
|
21
|
+
eventSource = new EventSource(withBasePath("/api/watch"));
|
|
22
|
+
} catch {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
eventSource.addEventListener("change", () => {
|
|
26
|
+
if (debounceTimer) clearTimeout(debounceTimer);
|
|
27
|
+
debounceTimer = setTimeout(bump, 150);
|
|
28
|
+
});
|
|
29
|
+
// If the connection errors out, EventSource will reconnect automatically.
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Returns a tick that increments when any file under the docs root changes. */
|
|
33
|
+
export function useRefreshTick(): number {
|
|
34
|
+
const [value, setValue] = useState(currentTick);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
ensureConnected();
|
|
37
|
+
const listener: Listener = (t) => setValue(t);
|
|
38
|
+
listeners.add(listener);
|
|
39
|
+
return () => {
|
|
40
|
+
listeners.delete(listener);
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
return value;
|
|
44
|
+
}
|