@lickle/docs 0.0.0-dev.1
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 +3 -0
- package/dist/esm/_lib/fs/index.js +20 -0
- package/dist/esm/_lib/fs/index.js.map +1 -0
- package/dist/esm/_lib/fs/watch.js +30 -0
- package/dist/esm/_lib/fs/watch.js.map +1 -0
- package/dist/esm/_lib/index.js +9 -0
- package/dist/esm/_lib/index.js.map +1 -0
- package/dist/esm/_lib/jiti/index.js +16 -0
- package/dist/esm/_lib/jiti/index.js.map +1 -0
- package/dist/esm/_lib/path/index.js +42 -0
- package/dist/esm/_lib/path/index.js.map +1 -0
- package/dist/esm/_lib/pkg/index.js +128 -0
- package/dist/esm/_lib/pkg/index.js.map +1 -0
- package/dist/esm/_lib/repo/index.js +100 -0
- package/dist/esm/_lib/repo/index.js.map +1 -0
- package/dist/esm/_lib/slug/index.js +23 -0
- package/dist/esm/_lib/slug/index.js.map +1 -0
- package/dist/esm/_lib/t.js +2 -0
- package/dist/esm/_lib/t.js.map +1 -0
- package/dist/esm/_lib/tsconfig/index.js +12 -0
- package/dist/esm/_lib/tsconfig/index.js.map +1 -0
- package/dist/esm/_lib/util/index.js +54 -0
- package/dist/esm/_lib/util/index.js.map +1 -0
- package/dist/esm/cli/cmd/dev.js +74 -0
- package/dist/esm/cli/cmd/dev.js.map +1 -0
- package/dist/esm/cli/cmd/index.js +4 -0
- package/dist/esm/cli/cmd/index.js.map +1 -0
- package/dist/esm/cli/cmd/init.js +74 -0
- package/dist/esm/cli/cmd/init.js.map +1 -0
- package/dist/esm/cli/cmd/json.js +28 -0
- package/dist/esm/cli/cmd/json.js.map +1 -0
- package/dist/esm/cli/env.js +5 -0
- package/dist/esm/cli/env.js.map +1 -0
- package/dist/esm/cli/index.js +13 -0
- package/dist/esm/cli/index.js.map +1 -0
- package/dist/esm/cli/vite/client/index.jsx +20 -0
- package/dist/esm/cli/vite/client/index.jsx.map +1 -0
- package/dist/esm/cli/vite/index.js +100 -0
- package/dist/esm/cli/vite/index.js.map +1 -0
- package/dist/esm/cli.js +5 -0
- package/dist/esm/cli.js.map +1 -0
- package/dist/esm/config/defaults.js +32 -0
- package/dist/esm/config/defaults.js.map +1 -0
- package/dist/esm/config/file.js +48 -0
- package/dist/esm/config/file.js.map +1 -0
- package/dist/esm/config/index.js +7 -0
- package/dist/esm/config/index.js.map +1 -0
- package/dist/esm/config/load.js +79 -0
- package/dist/esm/config/load.js.map +1 -0
- package/dist/esm/config/types.js +2 -0
- package/dist/esm/config/types.js.map +1 -0
- package/dist/esm/core/index.js +3 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/project/debug.js +26 -0
- package/dist/esm/core/project/debug.js.map +1 -0
- package/dist/esm/core/project/index.js +39 -0
- package/dist/esm/core/project/index.js.map +1 -0
- package/dist/esm/core/project/naming.js +39 -0
- package/dist/esm/core/project/naming.js.map +1 -0
- package/dist/esm/core/project/routing.js +173 -0
- package/dist/esm/core/project/routing.js.map +1 -0
- package/dist/esm/core/project/types.js +4 -0
- package/dist/esm/core/project/types.js.map +1 -0
- package/dist/esm/core/reflect/index.js +10 -0
- package/dist/esm/core/reflect/index.js.map +1 -0
- package/dist/esm/core/reflect/indexed.js +195 -0
- package/dist/esm/core/reflect/indexed.js.map +1 -0
- package/dist/esm/core/reflect/resolve.js +157 -0
- package/dist/esm/core/reflect/resolve.js.map +1 -0
- package/dist/esm/core/reflect/scan.js +787 -0
- package/dist/esm/core/reflect/scan.js.map +1 -0
- package/dist/esm/core/reflect/state.js +29 -0
- package/dist/esm/core/reflect/state.js.map +1 -0
- package/dist/esm/core/reflect/types.js +16 -0
- package/dist/esm/core/reflect/types.js.map +1 -0
- package/dist/esm/core/reflect/walk.js +106 -0
- package/dist/esm/core/reflect/walk.js.map +1 -0
- package/dist/esm/solidjs/index.js +2 -0
- package/dist/esm/solidjs/index.js.map +1 -0
- package/dist/esm/solidjs/jsx-runtime.js +2 -0
- package/dist/esm/solidjs/jsx-runtime.js.map +1 -0
- package/dist/esm/ui/App.jsx +71 -0
- package/dist/esm/ui/App.jsx.map +1 -0
- package/dist/esm/ui/components/Breadcrumb.jsx +45 -0
- package/dist/esm/ui/components/Breadcrumb.jsx.map +1 -0
- package/dist/esm/ui/components/Code/index.jsx +89 -0
- package/dist/esm/ui/components/Code/index.jsx.map +1 -0
- package/dist/esm/ui/components/Comment.jsx +176 -0
- package/dist/esm/ui/components/Comment.jsx.map +1 -0
- package/dist/esm/ui/components/Declaration.jsx +147 -0
- package/dist/esm/ui/components/Declaration.jsx.map +1 -0
- package/dist/esm/ui/components/Header.jsx +66 -0
- package/dist/esm/ui/components/Header.jsx.map +1 -0
- package/dist/esm/ui/components/Layout.jsx +44 -0
- package/dist/esm/ui/components/Layout.jsx.map +1 -0
- package/dist/esm/ui/components/Link.jsx +34 -0
- package/dist/esm/ui/components/Link.jsx.map +1 -0
- package/dist/esm/ui/components/LivePreview/Example.jsx +76 -0
- package/dist/esm/ui/components/LivePreview/Example.jsx.map +1 -0
- package/dist/esm/ui/components/LivePreview/Sandbox.jsx +25 -0
- package/dist/esm/ui/components/LivePreview/Sandbox.jsx.map +1 -0
- package/dist/esm/ui/components/LivePreview/index.js +4 -0
- package/dist/esm/ui/components/LivePreview/index.js.map +1 -0
- package/dist/esm/ui/components/LivePreview/transform.js +16 -0
- package/dist/esm/ui/components/LivePreview/transform.js.map +1 -0
- package/dist/esm/ui/components/Markdown.jsx +14 -0
- package/dist/esm/ui/components/Markdown.jsx.map +1 -0
- package/dist/esm/ui/components/Page.jsx +121 -0
- package/dist/esm/ui/components/Page.jsx.map +1 -0
- package/dist/esm/ui/components/References.jsx +32 -0
- package/dist/esm/ui/components/References.jsx.map +1 -0
- package/dist/esm/ui/components/SearchPalette.jsx +178 -0
- package/dist/esm/ui/components/SearchPalette.jsx.map +1 -0
- package/dist/esm/ui/components/Sidebar.jsx +63 -0
- package/dist/esm/ui/components/Sidebar.jsx.map +1 -0
- package/dist/esm/ui/components/Syntax.jsx +10 -0
- package/dist/esm/ui/components/Syntax.jsx.map +1 -0
- package/dist/esm/ui/components/ThemeToggle.jsx +25 -0
- package/dist/esm/ui/components/ThemeToggle.jsx.map +1 -0
- package/dist/esm/ui/components/Type.jsx +444 -0
- package/dist/esm/ui/components/Type.jsx.map +1 -0
- package/dist/esm/ui/components/index.js +16 -0
- package/dist/esm/ui/components/index.js.map +1 -0
- package/dist/esm/ui/context/components.jsx +30 -0
- package/dist/esm/ui/context/components.jsx.map +1 -0
- package/dist/esm/ui/context/global.js +15 -0
- package/dist/esm/ui/context/global.js.map +1 -0
- package/dist/esm/ui/context/index.js +5 -0
- package/dist/esm/ui/context/index.js.map +1 -0
- package/dist/esm/ui/context/markup/index.jsx +25 -0
- package/dist/esm/ui/context/markup/index.jsx.map +1 -0
- package/dist/esm/ui/context/markup/markdown.js +34 -0
- package/dist/esm/ui/context/markup/markdown.js.map +1 -0
- package/dist/esm/ui/context/markup/shiki.js +58 -0
- package/dist/esm/ui/context/markup/shiki.js.map +1 -0
- package/dist/esm/ui/context/markup/util.js +22 -0
- package/dist/esm/ui/context/markup/util.js.map +1 -0
- package/dist/esm/ui/context/project/index.jsx +27 -0
- package/dist/esm/ui/context/project/index.jsx.map +1 -0
- package/dist/esm/ui/context/project/indexed.js +47 -0
- package/dist/esm/ui/context/project/indexed.js.map +1 -0
- package/dist/esm/ui/context/project/types.js +2 -0
- package/dist/esm/ui/context/project/types.js.map +1 -0
- package/dist/esm/ui/context/theme.jsx +36 -0
- package/dist/esm/ui/context/theme.jsx.map +1 -0
- package/dist/esm/ui/hooks/index.js +94 -0
- package/dist/esm/ui/hooks/index.js.map +1 -0
- package/dist/esm/ui/index.js +5 -0
- package/dist/esm/ui/index.js.map +1 -0
- package/dist/esm/ui/renderer.jsx +21 -0
- package/dist/esm/ui/renderer.jsx.map +1 -0
- package/dist/esm/ui/util/comment.js +14 -0
- package/dist/esm/ui/util/comment.js.map +1 -0
- package/dist/esm/ui/util/kind.js +85 -0
- package/dist/esm/ui/util/kind.js.map +1 -0
- package/dist/esm/ui/util/markdown.js +66 -0
- package/dist/esm/ui/util/markdown.js.map +1 -0
- package/dist/esm/ui/util/search.js +75 -0
- package/dist/esm/ui/util/search.js.map +1 -0
- package/dist/ts/_lib/fs/index.d.ts +6 -0
- package/dist/ts/_lib/fs/index.d.ts.map +1 -0
- package/dist/ts/_lib/fs/watch.d.ts +14 -0
- package/dist/ts/_lib/fs/watch.d.ts.map +1 -0
- package/dist/ts/_lib/index.d.ts +10 -0
- package/dist/ts/_lib/index.d.ts.map +1 -0
- package/dist/ts/_lib/jiti/index.d.ts +2 -0
- package/dist/ts/_lib/jiti/index.d.ts.map +1 -0
- package/dist/ts/_lib/path/index.d.ts +12 -0
- package/dist/ts/_lib/path/index.d.ts.map +1 -0
- package/dist/ts/_lib/pkg/index.d.ts +28 -0
- package/dist/ts/_lib/pkg/index.d.ts.map +1 -0
- package/dist/ts/_lib/repo/index.d.ts +30 -0
- package/dist/ts/_lib/repo/index.d.ts.map +1 -0
- package/dist/ts/_lib/slug/index.d.ts +4 -0
- package/dist/ts/_lib/slug/index.d.ts.map +1 -0
- package/dist/ts/_lib/t.d.ts +11 -0
- package/dist/ts/_lib/t.d.ts.map +1 -0
- package/dist/ts/_lib/tsconfig/index.d.ts +8 -0
- package/dist/ts/_lib/tsconfig/index.d.ts.map +1 -0
- package/dist/ts/_lib/util/index.d.ts +9 -0
- package/dist/ts/_lib/util/index.d.ts.map +1 -0
- package/dist/ts/cli/cmd/dev.d.ts +27 -0
- package/dist/ts/cli/cmd/dev.d.ts.map +1 -0
- package/dist/ts/cli/cmd/index.d.ts +4 -0
- package/dist/ts/cli/cmd/index.d.ts.map +1 -0
- package/dist/ts/cli/cmd/init.d.ts +14 -0
- package/dist/ts/cli/cmd/init.d.ts.map +1 -0
- package/dist/ts/cli/cmd/json.d.ts +12 -0
- package/dist/ts/cli/cmd/json.d.ts.map +1 -0
- package/dist/ts/cli/env.d.ts +2 -0
- package/dist/ts/cli/env.d.ts.map +1 -0
- package/dist/ts/cli/index.d.ts +78 -0
- package/dist/ts/cli/index.d.ts.map +1 -0
- package/dist/ts/cli/vite/client/index.d.ts +10 -0
- package/dist/ts/cli/vite/client/index.d.ts.map +1 -0
- package/dist/ts/cli/vite/index.d.ts +12 -0
- package/dist/ts/cli/vite/index.d.ts.map +1 -0
- package/dist/ts/cli.d.ts +3 -0
- package/dist/ts/cli.d.ts.map +1 -0
- package/dist/ts/config/defaults.d.ts +10 -0
- package/dist/ts/config/defaults.d.ts.map +1 -0
- package/dist/ts/config/file.d.ts +3 -0
- package/dist/ts/config/file.d.ts.map +1 -0
- package/dist/ts/config/index.d.ts +6 -0
- package/dist/ts/config/index.d.ts.map +1 -0
- package/dist/ts/config/load.d.ts +36 -0
- package/dist/ts/config/load.d.ts.map +1 -0
- package/dist/ts/config/types.d.ts +56 -0
- package/dist/ts/config/types.d.ts.map +1 -0
- package/dist/ts/core/index.d.ts +3 -0
- package/dist/ts/core/index.d.ts.map +1 -0
- package/dist/ts/core/project/debug.d.ts +3 -0
- package/dist/ts/core/project/debug.d.ts.map +1 -0
- package/dist/ts/core/project/index.d.ts +17 -0
- package/dist/ts/core/project/index.d.ts.map +1 -0
- package/dist/ts/core/project/naming.d.ts +23 -0
- package/dist/ts/core/project/naming.d.ts.map +1 -0
- package/dist/ts/core/project/routing.d.ts +61 -0
- package/dist/ts/core/project/routing.d.ts.map +1 -0
- package/dist/ts/core/project/types.d.ts +56 -0
- package/dist/ts/core/project/types.d.ts.map +1 -0
- package/dist/ts/core/reflect/index.d.ts +22 -0
- package/dist/ts/core/reflect/index.d.ts.map +1 -0
- package/dist/ts/core/reflect/indexed.d.ts +83 -0
- package/dist/ts/core/reflect/indexed.d.ts.map +1 -0
- package/dist/ts/core/reflect/resolve.d.ts +3 -0
- package/dist/ts/core/reflect/resolve.d.ts.map +1 -0
- package/dist/ts/core/reflect/scan.d.ts +218 -0
- package/dist/ts/core/reflect/scan.d.ts.map +1 -0
- package/dist/ts/core/reflect/state.d.ts +44 -0
- package/dist/ts/core/reflect/state.d.ts.map +1 -0
- package/dist/ts/core/reflect/types.d.ts +289 -0
- package/dist/ts/core/reflect/types.d.ts.map +1 -0
- package/dist/ts/core/reflect/walk.d.ts +28 -0
- package/dist/ts/core/reflect/walk.d.ts.map +1 -0
- package/dist/ts/solidjs/index.d.ts +2 -0
- package/dist/ts/solidjs/index.d.ts.map +1 -0
- package/dist/ts/solidjs/jsx-runtime.d.ts +2 -0
- package/dist/ts/solidjs/jsx-runtime.d.ts.map +1 -0
- package/dist/ts/ui/App.d.ts +17 -0
- package/dist/ts/ui/App.d.ts.map +1 -0
- package/dist/ts/ui/components/Breadcrumb.d.ts +4 -0
- package/dist/ts/ui/components/Breadcrumb.d.ts.map +1 -0
- package/dist/ts/ui/components/Code/index.d.ts +17 -0
- package/dist/ts/ui/components/Code/index.d.ts.map +1 -0
- package/dist/ts/ui/components/Comment.d.ts +49 -0
- package/dist/ts/ui/components/Comment.d.ts.map +1 -0
- package/dist/ts/ui/components/Declaration.d.ts +122 -0
- package/dist/ts/ui/components/Declaration.d.ts.map +1 -0
- package/dist/ts/ui/components/Header.d.ts +5 -0
- package/dist/ts/ui/components/Header.d.ts.map +1 -0
- package/dist/ts/ui/components/Layout.d.ts +5 -0
- package/dist/ts/ui/components/Layout.d.ts.map +1 -0
- package/dist/ts/ui/components/Link.d.ts +15 -0
- package/dist/ts/ui/components/Link.d.ts.map +1 -0
- package/dist/ts/ui/components/LivePreview/Example.d.ts +16 -0
- package/dist/ts/ui/components/LivePreview/Example.d.ts.map +1 -0
- package/dist/ts/ui/components/LivePreview/Sandbox.d.ts +20 -0
- package/dist/ts/ui/components/LivePreview/Sandbox.d.ts.map +1 -0
- package/dist/ts/ui/components/LivePreview/index.d.ts +4 -0
- package/dist/ts/ui/components/LivePreview/index.d.ts.map +1 -0
- package/dist/ts/ui/components/LivePreview/transform.d.ts +19 -0
- package/dist/ts/ui/components/LivePreview/transform.d.ts.map +1 -0
- package/dist/ts/ui/components/Markdown.d.ts +11 -0
- package/dist/ts/ui/components/Markdown.d.ts.map +1 -0
- package/dist/ts/ui/components/Page.d.ts +21 -0
- package/dist/ts/ui/components/Page.d.ts.map +1 -0
- package/dist/ts/ui/components/References.d.ts +2 -0
- package/dist/ts/ui/components/References.d.ts.map +1 -0
- package/dist/ts/ui/components/SearchPalette.d.ts +5 -0
- package/dist/ts/ui/components/SearchPalette.d.ts.map +1 -0
- package/dist/ts/ui/components/Sidebar.d.ts +5 -0
- package/dist/ts/ui/components/Sidebar.d.ts.map +1 -0
- package/dist/ts/ui/components/Syntax.d.ts +15 -0
- package/dist/ts/ui/components/Syntax.d.ts.map +1 -0
- package/dist/ts/ui/components/ThemeToggle.d.ts +2 -0
- package/dist/ts/ui/components/ThemeToggle.d.ts.map +1 -0
- package/dist/ts/ui/components/Type.d.ts +82 -0
- package/dist/ts/ui/components/Type.d.ts.map +1 -0
- package/dist/ts/ui/components/index.d.ts +15 -0
- package/dist/ts/ui/components/index.d.ts.map +1 -0
- package/dist/ts/ui/context/components.d.ts +124 -0
- package/dist/ts/ui/context/components.d.ts.map +1 -0
- package/dist/ts/ui/context/global.d.ts +210 -0
- package/dist/ts/ui/context/global.d.ts.map +1 -0
- package/dist/ts/ui/context/index.d.ts +5 -0
- package/dist/ts/ui/context/index.d.ts.map +1 -0
- package/dist/ts/ui/context/markup/index.d.ts +20 -0
- package/dist/ts/ui/context/markup/index.d.ts.map +1 -0
- package/dist/ts/ui/context/markup/markdown.d.ts +4 -0
- package/dist/ts/ui/context/markup/markdown.d.ts.map +1 -0
- package/dist/ts/ui/context/markup/shiki.d.ts +17 -0
- package/dist/ts/ui/context/markup/shiki.d.ts.map +1 -0
- package/dist/ts/ui/context/markup/util.d.ts +11 -0
- package/dist/ts/ui/context/markup/util.d.ts.map +1 -0
- package/dist/ts/ui/context/project/index.d.ts +25 -0
- package/dist/ts/ui/context/project/index.d.ts.map +1 -0
- package/dist/ts/ui/context/project/indexed.d.ts +4 -0
- package/dist/ts/ui/context/project/indexed.d.ts.map +1 -0
- package/dist/ts/ui/context/project/types.d.ts +13 -0
- package/dist/ts/ui/context/project/types.d.ts.map +1 -0
- package/dist/ts/ui/context/theme.d.ts +12 -0
- package/dist/ts/ui/context/theme.d.ts.map +1 -0
- package/dist/ts/ui/hooks/index.d.ts +29 -0
- package/dist/ts/ui/hooks/index.d.ts.map +1 -0
- package/dist/ts/ui/index.d.ts +5 -0
- package/dist/ts/ui/index.d.ts.map +1 -0
- package/dist/ts/ui/renderer.d.ts +200 -0
- package/dist/ts/ui/renderer.d.ts.map +1 -0
- package/dist/ts/ui/util/comment.d.ts +4 -0
- package/dist/ts/ui/util/comment.d.ts.map +1 -0
- package/dist/ts/ui/util/kind.d.ts +15 -0
- package/dist/ts/ui/util/kind.d.ts.map +1 -0
- package/dist/ts/ui/util/markdown.d.ts +8 -0
- package/dist/ts/ui/util/markdown.d.ts.map +1 -0
- package/dist/ts/ui/util/search.d.ts +20 -0
- package/dist/ts/ui/util/search.d.ts.map +1 -0
- package/package.json +89 -0
- package/src/_lib/fs/index.ts +23 -0
- package/src/_lib/fs/watch.ts +40 -0
- package/src/_lib/index.ts +9 -0
- package/src/_lib/jiti/index.ts +18 -0
- package/src/_lib/path/index.ts +44 -0
- package/src/_lib/pkg/index.ts +165 -0
- package/src/_lib/repo/index.ts +138 -0
- package/src/_lib/slug/index.ts +26 -0
- package/src/_lib/t.ts +17 -0
- package/src/_lib/tsconfig/index.ts +20 -0
- package/src/_lib/util/index.ts +53 -0
- package/src/cli/cmd/dev.ts +86 -0
- package/src/cli/cmd/index.ts +3 -0
- package/src/cli/cmd/init.ts +80 -0
- package/src/cli/cmd/json.ts +28 -0
- package/src/cli/env.ts +6 -0
- package/src/cli/index.ts +14 -0
- package/src/cli/vite/client/index.html +27 -0
- package/src/cli/vite/client/index.tsx +30 -0
- package/src/cli/vite/client/public/apple-touch-icon.png +0 -0
- package/src/cli/vite/client/public/favicon-96x96.png +0 -0
- package/src/cli/vite/client/public/favicon.ico +0 -0
- package/src/cli/vite/client/public/favicon.svg +1 -0
- package/src/cli/vite/client/public/site.webmanifest +21 -0
- package/src/cli/vite/client/public/web-app-manifest-192x192.png +0 -0
- package/src/cli/vite/client/public/web-app-manifest-512x512.png +0 -0
- package/src/cli/vite/index.ts +115 -0
- package/src/cli.ts +6 -0
- package/src/config/defaults.ts +36 -0
- package/src/config/file.ts +53 -0
- package/src/config/index.ts +11 -0
- package/src/config/load.ts +95 -0
- package/src/config/types.ts +59 -0
- package/src/core/index.ts +2 -0
- package/src/core/project/debug.ts +30 -0
- package/src/core/project/index.ts +58 -0
- package/src/core/project/naming.ts +49 -0
- package/src/core/project/routing.ts +234 -0
- package/src/core/project/types.ts +47 -0
- package/src/core/reflect/index.ts +18 -0
- package/src/core/reflect/indexed.ts +242 -0
- package/src/core/reflect/resolve.ts +159 -0
- package/src/core/reflect/scan.ts +816 -0
- package/src/core/reflect/state.ts +75 -0
- package/src/core/reflect/types.ts +164 -0
- package/src/core/reflect/walk.ts +121 -0
- package/src/solidjs/index.ts +1 -0
- package/src/solidjs/jsx-runtime.ts +1 -0
- package/src/ui/App.tsx +115 -0
- package/src/ui/components/Breadcrumb.tsx +53 -0
- package/src/ui/components/Code/index.tsx +112 -0
- package/src/ui/components/Comment.tsx +221 -0
- package/src/ui/components/Declaration.tsx +210 -0
- package/src/ui/components/Header.tsx +99 -0
- package/src/ui/components/Layout.tsx +62 -0
- package/src/ui/components/Link.tsx +43 -0
- package/src/ui/components/LivePreview/Example.tsx +104 -0
- package/src/ui/components/LivePreview/Sandbox.tsx +36 -0
- package/src/ui/components/LivePreview/index.ts +3 -0
- package/src/ui/components/LivePreview/transform.ts +28 -0
- package/src/ui/components/Markdown.tsx +16 -0
- package/src/ui/components/Page.tsx +162 -0
- package/src/ui/components/References.tsx +34 -0
- package/src/ui/components/SearchPalette.tsx +266 -0
- package/src/ui/components/Sidebar.tsx +107 -0
- package/src/ui/components/Syntax.tsx +10 -0
- package/src/ui/components/ThemeToggle.tsx +50 -0
- package/src/ui/components/Type.tsx +583 -0
- package/src/ui/components/index.ts +15 -0
- package/src/ui/context/components.tsx +103 -0
- package/src/ui/context/global.ts +33 -0
- package/src/ui/context/index.ts +4 -0
- package/src/ui/context/markup/index.tsx +39 -0
- package/src/ui/context/markup/markdown.ts +37 -0
- package/src/ui/context/markup/shiki.ts +72 -0
- package/src/ui/context/markup/util.ts +20 -0
- package/src/ui/context/project/index.tsx +47 -0
- package/src/ui/context/project/indexed.ts +52 -0
- package/src/ui/context/project/types.ts +14 -0
- package/src/ui/context/theme.tsx +45 -0
- package/src/ui/hooks/index.ts +116 -0
- package/src/ui/index.ts +4 -0
- package/src/ui/renderer.tsx +31 -0
- package/src/ui/util/comment.ts +12 -0
- package/src/ui/util/kind.ts +120 -0
- package/src/ui/util/markdown.ts +74 -0
- package/src/ui/util/search.ts +84 -0
- package/theme.css +301 -0
- package/tsconfig.client.json +12 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { createMemo, For, Show } from 'solid-js'
|
|
2
|
+
import type { JSX } from 'solid-js/jsx-runtime'
|
|
3
|
+
|
|
4
|
+
import { createSlot, type Types } from '../context/index.ts'
|
|
5
|
+
import { useCommentMarkdown } from '../hooks/index.ts'
|
|
6
|
+
|
|
7
|
+
import { CodeBlock } from './Code/index.tsx'
|
|
8
|
+
import { Markdown } from './Markdown.tsx'
|
|
9
|
+
import { Type } from './Type.tsx'
|
|
10
|
+
import { Link } from './Link.tsx'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Render a single doc comment: summary markdown first, then every tag in
|
|
14
|
+
* source order. Consecutive `@param` (or `@property`) runs are merged into
|
|
15
|
+
* one labelled table so a five-parameter signature reads as one block.
|
|
16
|
+
*
|
|
17
|
+
* Per-tag rendering goes through the component registry — `defaults` from
|
|
18
|
+
* `theme/tags/`, with user overrides taking precedence. Unknown tags fall
|
|
19
|
+
* through to {@link UnknownTag}.
|
|
20
|
+
*/
|
|
21
|
+
export const Comment = createSlot('comment', (props) => {
|
|
22
|
+
return (
|
|
23
|
+
<Show when={props.comment}>
|
|
24
|
+
{(c) => {
|
|
25
|
+
const summary = useCommentMarkdown(c)
|
|
26
|
+
const groups = createMemo(() => groupTags(c().tags ?? []))
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Show when={summary() || props.comment?.tags?.length}>
|
|
30
|
+
<div class={props.class}>
|
|
31
|
+
<Show when={summary()}>{(c) => <Markdown source={c()} />}</Show>
|
|
32
|
+
<For each={groups()}>
|
|
33
|
+
{(g) => {
|
|
34
|
+
if (g.kind === '@param') return <Parameters tags={g.items} />
|
|
35
|
+
if (g.kind === '@property') return <Properties tags={g.items} />
|
|
36
|
+
if (g.tag.tag === '@module') return null
|
|
37
|
+
return <Tag tag={g.tag} />
|
|
38
|
+
}}
|
|
39
|
+
</For>
|
|
40
|
+
</div>
|
|
41
|
+
</Show>
|
|
42
|
+
)
|
|
43
|
+
}}
|
|
44
|
+
</Show>
|
|
45
|
+
)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const Properties = createSlot('comment.properties', (p) => <NamedTable title="Properties" tags={p.tags} />)
|
|
49
|
+
const Parameters = createSlot('comment.parameters', (p) => <NamedTable title="Parameters" tags={p.tags} />)
|
|
50
|
+
|
|
51
|
+
const NamedTable = (props: {
|
|
52
|
+
title: string
|
|
53
|
+
tags: Types.CommentTagMap['@property'][] | Types.CommentTagMap['@param'][]
|
|
54
|
+
}) => {
|
|
55
|
+
return (
|
|
56
|
+
<section class="mt-6">
|
|
57
|
+
<div class="flex items-baseline gap-2 mb-2">
|
|
58
|
+
<h4 class="text-mute uppercase text-[0.7rem] font-semibold tracking-wider">{props.title}</h4>
|
|
59
|
+
</div>
|
|
60
|
+
<dl class="grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 items-baseline">
|
|
61
|
+
<For each={props.tags}>{(it) => <NamedRow item={it} />}</For>
|
|
62
|
+
</dl>
|
|
63
|
+
</section>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const NamedRow = (props: { item: Types.CommentTagMap['@property'] | Types.CommentTagMap['@param'] }) => (
|
|
68
|
+
<>
|
|
69
|
+
<dt class="font-mono text-sm whitespace-nowrap">
|
|
70
|
+
<span class="font-semibold">{props.item.name}</span>
|
|
71
|
+
<Show when={props.item.optional}>
|
|
72
|
+
<span class="text-mute">?</span>
|
|
73
|
+
</Show>
|
|
74
|
+
<Show when={props.item.type}>
|
|
75
|
+
<>
|
|
76
|
+
<span class="text-mute">: </span>
|
|
77
|
+
<Type type={props.item.type!} />
|
|
78
|
+
</>
|
|
79
|
+
</Show>
|
|
80
|
+
<Show when={props.item.default}>
|
|
81
|
+
<span class="text-mute"> = {props.item.default}</span>
|
|
82
|
+
</Show>
|
|
83
|
+
</dt>
|
|
84
|
+
<dd class="text-sm text-mute min-w-0">
|
|
85
|
+
<Show when={trimLead(props.item.text)}>
|
|
86
|
+
<Markdown.Inline source={trimLead(props.item.text)} />
|
|
87
|
+
</Show>
|
|
88
|
+
</dd>
|
|
89
|
+
</>
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
type Named = Types.CommentTagMap['@property'] | Types.CommentTagMap['@param']
|
|
93
|
+
|
|
94
|
+
/** Strip a single leading `- ` so `@param foo - desc` collapses cleanly. */
|
|
95
|
+
const trimLead = (s: string): string => (s ?? '').replace(/^\s*-\s*/, '').trim()
|
|
96
|
+
|
|
97
|
+
type Group =
|
|
98
|
+
| { kind: '@param'; items: Types.CommentTagMap['@param'][] }
|
|
99
|
+
| { kind: '@property'; items: Types.CommentTagMap['@property'][] }
|
|
100
|
+
| { kind: 'tag'; tag: Types.CommentTag }
|
|
101
|
+
|
|
102
|
+
const groupTags = (tags: Types.CommentTag[]): Group[] => {
|
|
103
|
+
const out: Group[] = []
|
|
104
|
+
const pushRun = <K extends '@param' | '@property'>(kind: K, item: Named) => {
|
|
105
|
+
const last = out[out.length - 1]
|
|
106
|
+
if (last && last.kind === kind) (last.items as Named[]).push(item)
|
|
107
|
+
else out.push({ kind, items: [item] } as Group)
|
|
108
|
+
}
|
|
109
|
+
for (const t of tags) {
|
|
110
|
+
if (t.tag === '@param') pushRun('@param', t as Named)
|
|
111
|
+
else if (t.tag === '@property') pushRun('@property', t as Named)
|
|
112
|
+
else out.push({ kind: 'tag', tag: t })
|
|
113
|
+
}
|
|
114
|
+
return out
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const Tag = createSlot('tag', (props) => {
|
|
118
|
+
if (props.tag.tag === '@returns') return <TagReturns tag={props.tag as Types.CommentTagMap['@returns']} />
|
|
119
|
+
if (props.tag.tag === '@throws') return <TagThrows tag={props.tag as Types.CommentTagMap['@throws']} />
|
|
120
|
+
if (props.tag.tag === '@type') return <TagType tag={props.tag as Types.CommentTagMap['@type']} />
|
|
121
|
+
if (props.tag.tag === '@satisfies') return <TagSatisfies tag={props.tag as Types.CommentTagMap['@satisfies']} />
|
|
122
|
+
if (props.tag.tag === '@example') return <TagExample tag={props.tag as Types.CommentTagMap['@example']} />
|
|
123
|
+
if (props.tag.tag === '@see') return <TagSee tag={props.tag as Types.CommentTagMap['@see']} />
|
|
124
|
+
if (props.tag.tag === '@template') return <TagTemplate tag={props.tag as Types.CommentTagMap['@template']} />
|
|
125
|
+
return <TagOther tag={props.tag} />
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
/** Section frame shared across tag renderers. */
|
|
129
|
+
export const TagSection = (props: { tag: Types.CommentTag; description?: string; children: JSX.Element }) => (
|
|
130
|
+
<section class="mt-6">
|
|
131
|
+
<div class="flex items-baseline gap-2 mb-2">
|
|
132
|
+
<TagTitle tag={props.tag} />
|
|
133
|
+
<Show when={props.description}>
|
|
134
|
+
{(description) => (
|
|
135
|
+
<div class="text-xs text-mute min-w-0">
|
|
136
|
+
<Markdown.Inline source={description()} />
|
|
137
|
+
</div>
|
|
138
|
+
)}
|
|
139
|
+
</Show>
|
|
140
|
+
</div>
|
|
141
|
+
{props.children}
|
|
142
|
+
</section>
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
const TagTitle = (props: { tag: Types.CommentTag }) => {
|
|
146
|
+
const title = props.tag.tag.replace(/^@/, '')
|
|
147
|
+
return <h4 class="text-mute uppercase text-[0.7rem] font-semibold tracking-wider">{title}</h4>
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const TagExample = createSlot('tag.example', (props: { tag: Types.CommentTagMap['@example'] }) => (
|
|
151
|
+
<TagSection tag={props.tag}>
|
|
152
|
+
<CodeBlock code={props.tag.code} />
|
|
153
|
+
</TagSection>
|
|
154
|
+
))
|
|
155
|
+
|
|
156
|
+
export const TagReturns = createSlot('tag.returns', (props: { tag: Types.CommentTagMap['@returns'] }) => (
|
|
157
|
+
<TagSection tag={props.tag}>
|
|
158
|
+
<Type.Inline type={props.tag.type} text={props.tag.text} />
|
|
159
|
+
</TagSection>
|
|
160
|
+
))
|
|
161
|
+
|
|
162
|
+
export const TagSatisfies = createSlot('tag.satisfies', (props: { tag: Types.CommentTagMap['@satisfies'] }) => (
|
|
163
|
+
<TagSection tag={props.tag}>
|
|
164
|
+
<Type.Inline type={props.tag.type} text={props.tag.text} />
|
|
165
|
+
</TagSection>
|
|
166
|
+
))
|
|
167
|
+
|
|
168
|
+
export const TagSee = createSlot('tag.see', (props: { tag: Types.CommentTagMap['@see'] }) => (
|
|
169
|
+
<TagSection tag={props.tag}>
|
|
170
|
+
<Show when={props.tag.target}>
|
|
171
|
+
<div class="font-mono text-sm mb-1">
|
|
172
|
+
<Link.ByName name={props.tag.target ?? ''} />
|
|
173
|
+
</div>
|
|
174
|
+
</Show>
|
|
175
|
+
</TagSection>
|
|
176
|
+
))
|
|
177
|
+
|
|
178
|
+
export const TagTemplate = createSlot('tag.template', (props: { tag: Types.CommentTagMap['@template'] }) => (
|
|
179
|
+
<TagSection tag={props.tag}>
|
|
180
|
+
<dl class="grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 items-baseline">
|
|
181
|
+
<For each={props.tag.generics}>
|
|
182
|
+
{(tp) => (
|
|
183
|
+
<>
|
|
184
|
+
<dt class="font-mono text-sm font-semibold">{tp.name}</dt>
|
|
185
|
+
<dd class="text-sm text-mute">
|
|
186
|
+
<Show when={tp.constraint}>
|
|
187
|
+
<>
|
|
188
|
+
<span class="text-accent">extends </span>
|
|
189
|
+
<Type type={tp.constraint!} />
|
|
190
|
+
</>
|
|
191
|
+
</Show>
|
|
192
|
+
</dd>
|
|
193
|
+
</>
|
|
194
|
+
)}
|
|
195
|
+
</For>
|
|
196
|
+
</dl>
|
|
197
|
+
<Show when={props.tag.text?.trim()}>
|
|
198
|
+
<div class="mt-2">
|
|
199
|
+
<Markdown.Inline source={props.tag.text} />
|
|
200
|
+
</div>
|
|
201
|
+
</Show>
|
|
202
|
+
</TagSection>
|
|
203
|
+
))
|
|
204
|
+
|
|
205
|
+
export const TagThrows = createSlot('tag.throws', (props: { tag: Types.CommentTagMap['@throws'] }) => (
|
|
206
|
+
<TagSection tag={props.tag}>
|
|
207
|
+
<Type.Inline type={props.tag.type} text={props.tag.text} />
|
|
208
|
+
</TagSection>
|
|
209
|
+
))
|
|
210
|
+
|
|
211
|
+
export const TagType = createSlot('tag.type', (props: { tag: Types.CommentTagMap['@type'] }) => (
|
|
212
|
+
<TagSection tag={props.tag}>
|
|
213
|
+
<Type.Inline type={props.tag.type} text={props.tag.text} />
|
|
214
|
+
</TagSection>
|
|
215
|
+
))
|
|
216
|
+
|
|
217
|
+
export const TagOther = createSlot('tag.*', (props) => (
|
|
218
|
+
<TagSection tag={props.tag}>
|
|
219
|
+
<Markdown source={(props.tag as { text?: string }).text ?? ''} />
|
|
220
|
+
</TagSection>
|
|
221
|
+
))
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { For, Show, type Component } from 'solid-js'
|
|
2
|
+
import { Dynamic } from 'solid-js/web'
|
|
3
|
+
|
|
4
|
+
import { createSlot, type Types } from '../context/index.ts'
|
|
5
|
+
import { Syntax } from './Syntax.tsx'
|
|
6
|
+
import { Comment } from './Comment.tsx'
|
|
7
|
+
import { Type } from './Type.tsx'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Dispatch a declaration to its per-kind renderer. Implemented via `Dynamic`
|
|
11
|
+
* (not an `if`/`switch`) so the active sub-component swaps reactively when
|
|
12
|
+
* `props.decl.kind` changes — otherwise navigating between pages of different
|
|
13
|
+
* kinds would freeze on the original branch.
|
|
14
|
+
*/
|
|
15
|
+
export const Declaration = createSlot('declaration', (props) => (
|
|
16
|
+
<Dynamic component={dispatch(props.decl.kind)} decl={props.decl} />
|
|
17
|
+
))
|
|
18
|
+
|
|
19
|
+
const dispatch = (kind: Types.Declaration['kind']): Component<{ decl: any }> => RENDERERS[kind]
|
|
20
|
+
|
|
21
|
+
/** Heritage line — `extends A, B` / `implements C`. */
|
|
22
|
+
const ExtendsLine = (props: { label: string; types?: Types.Type[] }) => (
|
|
23
|
+
<Show when={props.types?.length}>
|
|
24
|
+
<div class="text-sm text-mute font-mono mt-2">
|
|
25
|
+
<span class="text-accent">{props.label} </span>
|
|
26
|
+
<Type.Join sep=", " items={props.types!} />
|
|
27
|
+
</div>
|
|
28
|
+
</Show>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
export const DeclarationFunction = createSlot('declaration.function', (props) => (
|
|
32
|
+
<div class="mt-2">
|
|
33
|
+
<For each={props.decl.signatures}>
|
|
34
|
+
{(sig) => <Type.SignatureLine sig={sig} name={props.decl.name} id={props.decl.id} kind="function" />}
|
|
35
|
+
</For>
|
|
36
|
+
<Comment comment={props.decl.comment} />
|
|
37
|
+
</div>
|
|
38
|
+
))
|
|
39
|
+
|
|
40
|
+
export const DeclarationVariable = createSlot('declaration.variable', (props) => (
|
|
41
|
+
<div>
|
|
42
|
+
<div class="font-mono text-sm leading-relaxed">
|
|
43
|
+
<Syntax.Kw>const </Syntax.Kw>
|
|
44
|
+
<span class="font-semibold">{props.decl.name}</span>
|
|
45
|
+
<Syntax.Punct>: </Syntax.Punct>
|
|
46
|
+
<Type type={props.decl.type} />
|
|
47
|
+
<Show when={props.decl.defaultValue}>
|
|
48
|
+
<Syntax.Punct>{` = ${props.decl.defaultValue}`}</Syntax.Punct>
|
|
49
|
+
</Show>
|
|
50
|
+
</div>
|
|
51
|
+
<Comment comment={props.decl.comment} />
|
|
52
|
+
</div>
|
|
53
|
+
))
|
|
54
|
+
|
|
55
|
+
export const DeclarationTypeAlias = createSlot('declaration.type-alias', (props) => (
|
|
56
|
+
<div>
|
|
57
|
+
<div class="font-mono text-sm leading-relaxed">
|
|
58
|
+
<Syntax.Kw>type </Syntax.Kw>
|
|
59
|
+
<span class="font-semibold">{props.decl.name}</span>
|
|
60
|
+
<Type.Generics generics={props.decl.generics} />
|
|
61
|
+
<Syntax.Punct> = </Syntax.Punct>
|
|
62
|
+
<Type type={props.decl.type} />
|
|
63
|
+
</div>
|
|
64
|
+
<Comment comment={props.decl.comment} />
|
|
65
|
+
</div>
|
|
66
|
+
))
|
|
67
|
+
|
|
68
|
+
export const DeclarationClass = createSlot('declaration.class', (props) => (
|
|
69
|
+
<div>
|
|
70
|
+
<ExtendsLine label="extends" types={props.decl.extends} />
|
|
71
|
+
<ExtendsLine label="implements" types={props.decl.implements} />
|
|
72
|
+
<Comment comment={props.decl.comment} />
|
|
73
|
+
<Members
|
|
74
|
+
constructors={props.decl.constructors}
|
|
75
|
+
properties={props.decl.properties}
|
|
76
|
+
methods={props.decl.methods}
|
|
77
|
+
indexSignature={props.decl.indexSignature}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
))
|
|
81
|
+
|
|
82
|
+
export const DeclarationInterface = createSlot('declaration.interface', (props) => (
|
|
83
|
+
<div>
|
|
84
|
+
<ExtendsLine label="extends" types={props.decl.extends} />
|
|
85
|
+
<Comment comment={props.decl.comment} />
|
|
86
|
+
<Members
|
|
87
|
+
properties={props.decl.properties}
|
|
88
|
+
methods={props.decl.methods}
|
|
89
|
+
callSignatures={props.decl.callSignatures}
|
|
90
|
+
constructSignatures={props.decl.constructSignatures}
|
|
91
|
+
indexSignature={props.decl.indexSignature}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
))
|
|
95
|
+
|
|
96
|
+
/** Section heading matching the module-children layout in `Page.tsx`. */
|
|
97
|
+
const MemberSection = (props: { title: string; when: unknown; children: any }) => (
|
|
98
|
+
<Show when={props.when}>
|
|
99
|
+
<section class="mt-8">
|
|
100
|
+
<h2 class="text-sm font-semibold mb-3 pb-1.5 border-b border-line capitalize">{props.title}</h2>
|
|
101
|
+
{props.children}
|
|
102
|
+
</section>
|
|
103
|
+
</Show>
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
const PropertyRow = (props: { prop: Types.Part<'property'> }) => (
|
|
107
|
+
<div class="py-2">
|
|
108
|
+
<div class="font-mono text-sm leading-relaxed">
|
|
109
|
+
<span class="font-semibold">{props.prop.name}</span>
|
|
110
|
+
<Show when={props.prop.optional}>
|
|
111
|
+
<Syntax.Punct>?</Syntax.Punct>
|
|
112
|
+
</Show>
|
|
113
|
+
<Syntax.Punct>: </Syntax.Punct>
|
|
114
|
+
<Type type={props.prop.type} />
|
|
115
|
+
<Show when={props.prop.defaultValue}>
|
|
116
|
+
<Syntax.Punct>{` = ${props.prop.defaultValue}`}</Syntax.Punct>
|
|
117
|
+
</Show>
|
|
118
|
+
</div>
|
|
119
|
+
<Show when={props.prop.comment}>
|
|
120
|
+
<div class="mt-1">
|
|
121
|
+
<Comment comment={props.prop.comment} />
|
|
122
|
+
</div>
|
|
123
|
+
</Show>
|
|
124
|
+
</div>
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
const IndexRow = (props: { sig: Types.Part<'index-signature'> }) => (
|
|
128
|
+
<div class="font-mono text-sm leading-relaxed py-2">
|
|
129
|
+
<Syntax.Punct>[</Syntax.Punct>
|
|
130
|
+
<span class="font-semibold">{props.sig.parameter.name}</span>
|
|
131
|
+
<Syntax.Punct>: </Syntax.Punct>
|
|
132
|
+
<Type type={props.sig.parameter.type} />
|
|
133
|
+
<Syntax.Punct>]: </Syntax.Punct>
|
|
134
|
+
<Type type={props.sig.type} />
|
|
135
|
+
</div>
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
/** Member listing shared by classes and interfaces. */
|
|
139
|
+
const Members = (props: {
|
|
140
|
+
constructors?: Types.Part<'signature'>[]
|
|
141
|
+
properties?: Types.Part<'property'>[]
|
|
142
|
+
methods?: Types.Part<'method'>[]
|
|
143
|
+
callSignatures?: Types.Part<'signature'>[]
|
|
144
|
+
constructSignatures?: Types.Part<'signature'>[]
|
|
145
|
+
indexSignature?: Types.Part<'index-signature'>
|
|
146
|
+
}) => (
|
|
147
|
+
<>
|
|
148
|
+
<MemberSection title="Constructors" when={props.constructors?.length}>
|
|
149
|
+
<For each={props.constructors}>{(sig) => <Type.Signature sig={sig} name="constructor" kind="constructor" />}</For>
|
|
150
|
+
</MemberSection>
|
|
151
|
+
<MemberSection title="Properties" when={props.properties?.length || props.indexSignature}>
|
|
152
|
+
<For each={props.properties}>{(p) => <PropertyRow prop={p} />}</For>
|
|
153
|
+
<Show when={props.indexSignature}>{(sig) => <IndexRow sig={sig()} />}</Show>
|
|
154
|
+
</MemberSection>
|
|
155
|
+
<MemberSection title="Methods" when={props.methods?.length}>
|
|
156
|
+
<For each={props.methods}>
|
|
157
|
+
{(m) => <For each={m.signatures}>{(sig) => <Type.Signature sig={sig} name={m.name} kind="method" />}</For>}
|
|
158
|
+
</For>
|
|
159
|
+
</MemberSection>
|
|
160
|
+
<MemberSection title="Call Signatures" when={props.callSignatures?.length}>
|
|
161
|
+
<For each={props.callSignatures}>{(sig) => <Type.Signature sig={sig} />}</For>
|
|
162
|
+
</MemberSection>
|
|
163
|
+
<MemberSection title="Construct Signatures" when={props.constructSignatures?.length}>
|
|
164
|
+
<For each={props.constructSignatures}>{(sig) => <Type.Signature sig={sig} kind="constructor" />}</For>
|
|
165
|
+
</MemberSection>
|
|
166
|
+
</>
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
export const DeclarationEnum = createSlot('declaration.enum', (props) => (
|
|
170
|
+
<div>
|
|
171
|
+
<Comment comment={props.decl.comment} />
|
|
172
|
+
<MemberSection title="Members" when={props.decl.members?.length}>
|
|
173
|
+
<For each={props.decl.members}>{(m) => <EnumMemberRow member={m} />}</For>
|
|
174
|
+
</MemberSection>
|
|
175
|
+
</div>
|
|
176
|
+
))
|
|
177
|
+
|
|
178
|
+
const EnumMemberRow = (props: { member: Types.Part<'enum-member'> }) => (
|
|
179
|
+
<div class="py-2">
|
|
180
|
+
<div class="font-mono text-sm leading-relaxed">
|
|
181
|
+
<span class="font-semibold">{props.member.name}</span>
|
|
182
|
+
<Show when={props.member.value !== undefined}>
|
|
183
|
+
<Syntax.Punct>{` = ${typeof props.member.value === 'string' ? `"${props.member.value}"` : props.member.value}`}</Syntax.Punct>
|
|
184
|
+
</Show>
|
|
185
|
+
</div>
|
|
186
|
+
<Show when={props.member.comment}>
|
|
187
|
+
<div class="mt-1">
|
|
188
|
+
<Comment comment={props.member.comment} />
|
|
189
|
+
</div>
|
|
190
|
+
</Show>
|
|
191
|
+
</div>
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
export const DeclarationModule = createSlot('declaration.module', (props) => <Comment comment={props.decl.comment} />)
|
|
195
|
+
|
|
196
|
+
export const DeclarationNamespace = createSlot('declaration.namespace', (props) => (
|
|
197
|
+
<Comment comment={props.decl.comment} />
|
|
198
|
+
))
|
|
199
|
+
|
|
200
|
+
const RENDERERS: Record<Types.Declaration['kind'], Component<{ decl: any }>> = {
|
|
201
|
+
class: DeclarationClass,
|
|
202
|
+
interface: DeclarationInterface,
|
|
203
|
+
enum: DeclarationEnum,
|
|
204
|
+
function: DeclarationFunction,
|
|
205
|
+
variable: DeclarationVariable,
|
|
206
|
+
'type-alias': DeclarationTypeAlias,
|
|
207
|
+
module: DeclarationModule,
|
|
208
|
+
namespace: DeclarationNamespace,
|
|
209
|
+
export: () => null,
|
|
210
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { For, Show, createMemo } from 'solid-js'
|
|
2
|
+
import { A } from '@solidjs/router'
|
|
3
|
+
|
|
4
|
+
import { useProject } from '../context/index.ts'
|
|
5
|
+
import { createSlot } from '../context/index.ts'
|
|
6
|
+
import { ThemeToggle } from './ThemeToggle.tsx'
|
|
7
|
+
|
|
8
|
+
const isMac = () => typeof navigator !== 'undefined' && /mac/i.test(navigator.platform || navigator.userAgent || '')
|
|
9
|
+
|
|
10
|
+
const ICON_BY_NAME: Record<string, string> = {
|
|
11
|
+
github: 'github-icon',
|
|
12
|
+
bluesky: 'bluesky-icon',
|
|
13
|
+
discord: 'discord-icon',
|
|
14
|
+
x: 'x-icon',
|
|
15
|
+
twitter: 'x-icon',
|
|
16
|
+
npm: 'documentation-icon',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const iconFor = (label: string): string | null => {
|
|
20
|
+
const k = label.toLowerCase()
|
|
21
|
+
return ICON_BY_NAME[k] ?? null
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Header = createSlot('header', (props: { onMenu?: () => void; onSearch?: () => void }) => {
|
|
25
|
+
const project = useProject()
|
|
26
|
+
const searchHint = createMemo(() => (isMac() ? '\u2318K' : 'Ctrl K'))
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<header class="sticky top-0 z-30 border-b border-line bg-bg/80 backdrop-blur-md backdrop-saturate-150">
|
|
30
|
+
<div class="flex items-center h-14 px-4 lg:px-6 gap-4">
|
|
31
|
+
<button
|
|
32
|
+
type="button"
|
|
33
|
+
aria-label="Open menu"
|
|
34
|
+
class="lg:hidden p-1.5 rounded hover:bg-hover cursor-pointer"
|
|
35
|
+
onClick={() => props.onMenu?.()}
|
|
36
|
+
>
|
|
37
|
+
<svg
|
|
38
|
+
width="18"
|
|
39
|
+
height="18"
|
|
40
|
+
viewBox="0 0 24 24"
|
|
41
|
+
fill="none"
|
|
42
|
+
stroke="currentColor"
|
|
43
|
+
stroke-width="1.8"
|
|
44
|
+
stroke-linecap="round"
|
|
45
|
+
>
|
|
46
|
+
<path d="M4 7h16M4 12h16M4 17h16" />
|
|
47
|
+
</svg>
|
|
48
|
+
</button>
|
|
49
|
+
<A href="/" class="flex items-baseline gap-2 hover:opacity-70 transition-opacity">
|
|
50
|
+
<span class="font-semibold text-[0.95rem] tracking-tight">{project().name}</span>
|
|
51
|
+
<Show when={project().version}>
|
|
52
|
+
<span class="text-xs text-mute font-mono">v{project().version}</span>
|
|
53
|
+
</Show>
|
|
54
|
+
</A>
|
|
55
|
+
|
|
56
|
+
<button
|
|
57
|
+
type="button"
|
|
58
|
+
onClick={() => props.onSearch?.()}
|
|
59
|
+
aria-label="Search"
|
|
60
|
+
class="ml-4 flex items-center gap-2 px-2.5 py-1 text-xs text-mute border border-line rounded-md hover:text-fg hover:bg-hover transition-colors cursor-pointer"
|
|
61
|
+
>
|
|
62
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
|
|
63
|
+
<circle cx="11" cy="11" r="7" />
|
|
64
|
+
<path d="m20 20-3.5-3.5" stroke-linecap="round" />
|
|
65
|
+
</svg>
|
|
66
|
+
<span class="hidden sm:inline">Search</span>
|
|
67
|
+
<kbd class="font-mono text-[0.65rem] text-mute">{searchHint()}</kbd>
|
|
68
|
+
</button>
|
|
69
|
+
|
|
70
|
+
<nav class="ml-auto flex items-center gap-1">
|
|
71
|
+
<For each={project().links}>
|
|
72
|
+
{({ label, href }) => {
|
|
73
|
+
const icon = iconFor(label)
|
|
74
|
+
return (
|
|
75
|
+
<a
|
|
76
|
+
href={href}
|
|
77
|
+
target="_blank"
|
|
78
|
+
rel="noreferrer"
|
|
79
|
+
class="flex items-center gap-1.5 px-2 py-1 text-xs text-mute hover:text-fg transition-colors duration-150"
|
|
80
|
+
title={label}
|
|
81
|
+
>
|
|
82
|
+
<Show when={icon} fallback={<span>{label}</span>}>
|
|
83
|
+
<svg width="14" height="14">
|
|
84
|
+
<use href={`/icons.svg#${icon}`} />
|
|
85
|
+
</svg>
|
|
86
|
+
<span class="sr-only">{label}</span>
|
|
87
|
+
</Show>
|
|
88
|
+
</a>
|
|
89
|
+
)
|
|
90
|
+
}}
|
|
91
|
+
</For>
|
|
92
|
+
<div class="ml-2">
|
|
93
|
+
<ThemeToggle />
|
|
94
|
+
</div>
|
|
95
|
+
</nav>
|
|
96
|
+
</div>
|
|
97
|
+
</header>
|
|
98
|
+
)
|
|
99
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createSignal, onCleanup, onMount } from 'solid-js'
|
|
2
|
+
import type { JSX } from 'solid-js/jsx-runtime'
|
|
3
|
+
|
|
4
|
+
import { useLocation } from '@solidjs/router'
|
|
5
|
+
import { createEffect } from 'solid-js'
|
|
6
|
+
|
|
7
|
+
import { createSlot } from '../context/index.ts'
|
|
8
|
+
|
|
9
|
+
import { SearchPalette } from './SearchPalette.tsx'
|
|
10
|
+
import { Sidebar } from './Sidebar.tsx'
|
|
11
|
+
import { Header } from './Header.tsx'
|
|
12
|
+
|
|
13
|
+
export const Layout = createSlot('layout', (props: { children: JSX.Element }) => {
|
|
14
|
+
const [menuOpen, setMenuOpen] = createSignal(false)
|
|
15
|
+
const [searchOpen, setSearchOpen] = createSignal(false)
|
|
16
|
+
const loc = useLocation()
|
|
17
|
+
createEffect(() => {
|
|
18
|
+
void loc.pathname
|
|
19
|
+
setMenuOpen(false)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
onMount(() => {
|
|
23
|
+
const onKey = (e: KeyboardEvent) => {
|
|
24
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
|
|
25
|
+
e.preventDefault()
|
|
26
|
+
setSearchOpen((v) => !v)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
window.addEventListener('keydown', onKey)
|
|
30
|
+
onCleanup(() => window.removeEventListener('keydown', onKey))
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div class="min-h-screen flex flex-col">
|
|
35
|
+
<Header onMenu={() => setMenuOpen((v) => !v)} onSearch={() => setSearchOpen(true)} />
|
|
36
|
+
|
|
37
|
+
<div class="flex-1 grid grid-cols-1 lg:grid-cols-[220px_1fr] max-w-[1400px] w-full mx-auto">
|
|
38
|
+
<Sidebar class="hidden lg:block border-r border-line sticky top-14 self-start h-[calc(100vh-3.5rem)] overflow-y-auto" />
|
|
39
|
+
|
|
40
|
+
<div
|
|
41
|
+
class={`lg:hidden fixed inset-0 z-40 bg-black/30 transition-opacity duration-200 ${
|
|
42
|
+
menuOpen() ? 'opacity-100' : 'opacity-0 pointer-events-none'
|
|
43
|
+
}`}
|
|
44
|
+
onClick={() => setMenuOpen(false)}
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
class={`absolute inset-y-0 left-0 w-64 bg-bg border-r border-line overflow-y-auto pt-14 transition-transform duration-200 ease-out ${
|
|
48
|
+
menuOpen() ? 'translate-x-0' : '-translate-x-full'
|
|
49
|
+
}`}
|
|
50
|
+
onClick={(e) => e.stopPropagation()}
|
|
51
|
+
>
|
|
52
|
+
<Sidebar onNavigate={() => setMenuOpen(false)} />
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<main class="min-w-0 px-6 lg:px-12 pt-8 pb-20 max-w-[860px] wrap-break-word">{props.children}</main>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<SearchPalette open={searchOpen} onClose={() => setSearchOpen(false)} />
|
|
60
|
+
</div>
|
|
61
|
+
)
|
|
62
|
+
})
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Show } from 'solid-js'
|
|
2
|
+
import { A } from '@solidjs/router'
|
|
3
|
+
|
|
4
|
+
import { useSlugFor } from '../hooks/index.ts'
|
|
5
|
+
import { Syntax } from './Syntax.tsx'
|
|
6
|
+
|
|
7
|
+
export const Link = (props: { href: string; children: string }) => {
|
|
8
|
+
return (
|
|
9
|
+
<A href={props.href} class="underline decoration-line underline-offset-[3px] hover:opacity-70">
|
|
10
|
+
{props.children}
|
|
11
|
+
</A>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Link to an in-project declaration by id, with a fallback rendering when
|
|
17
|
+
* the target isn't resolvable. The `?` prefix marks anonymous external
|
|
18
|
+
* references the resolver couldn't anchor to anything.
|
|
19
|
+
*/
|
|
20
|
+
Link.Type = (props: { id?: number; name: string; external?: 'stdlib' | 'package' | 'anonymous' | 'type-parameter' }) => {
|
|
21
|
+
const slugs = useSlugFor()
|
|
22
|
+
const slug = () => (props.id != null ? slugs.byId(props.id) : undefined)
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<Show when={props.external === 'anonymous'}>
|
|
26
|
+
<Syntax.Punct>?</Syntax.Punct>
|
|
27
|
+
</Show>
|
|
28
|
+
<Show when={slug()} fallback={<Syntax.Name>{props.name}</Syntax.Name>}>
|
|
29
|
+
<Link href={`/${slug()}`}>{props.name}</Link>
|
|
30
|
+
</Show>
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Link.ByName = (props: { name: string }) => {
|
|
36
|
+
const slugs = useSlugFor()
|
|
37
|
+
const slug = () => slugs.byName(props.name)
|
|
38
|
+
return (
|
|
39
|
+
<Show when={slug()} fallback={<Syntax.Name>{props.name}</Syntax.Name>}>
|
|
40
|
+
<Link href={`/${slug()}`}>{props.name}</Link>
|
|
41
|
+
</Show>
|
|
42
|
+
)
|
|
43
|
+
}
|