@geenius/docs 0.1.0 → 0.4.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/CHANGELOG.md +7 -0
- package/README.md +53 -1
- package/package.json +96 -13
- package/packages/convex/dist/index.d.ts +503 -0
- package/packages/convex/dist/index.js +482 -0
- package/packages/convex/dist/index.js.map +1 -0
- package/packages/react/dist/index.d.ts +439 -0
- package/packages/react/dist/index.js +4954 -0
- package/packages/react/dist/index.js.map +1 -0
- package/packages/react-css/{src/styles.css → dist/index.css} +183 -223
- package/packages/react-css/dist/index.css.map +1 -0
- package/packages/react-css/dist/index.d.ts +443 -0
- package/packages/react-css/dist/index.js +5058 -0
- package/packages/react-css/dist/index.js.map +1 -0
- package/packages/shared/dist/index.d.ts +684 -0
- package/packages/shared/dist/index.js +788 -0
- package/packages/shared/dist/index.js.map +1 -0
- package/packages/solidjs/dist/index.d.ts +435 -0
- package/packages/solidjs/dist/index.js +4584 -0
- package/packages/solidjs/dist/index.js.map +1 -0
- package/packages/solidjs-css/{src/styles.css → dist/index.css} +183 -223
- package/packages/solidjs-css/dist/index.css.map +1 -0
- package/packages/solidjs-css/dist/index.d.ts +432 -0
- package/packages/solidjs-css/dist/index.js +4934 -0
- package/packages/solidjs-css/dist/index.js.map +1 -0
- package/.changeset/config.json +0 -11
- package/.github/CODEOWNERS +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -11
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -10
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/ci.yml +0 -23
- package/.github/workflows/release.yml +0 -29
- package/.nvmrc +0 -1
- package/.project/ACCOUNT.yaml +0 -4
- package/.project/IDEAS.yaml +0 -7
- package/.project/PROJECT.yaml +0 -11
- package/.project/ROADMAP.yaml +0 -15
- package/CODE_OF_CONDUCT.md +0 -16
- package/CONTRIBUTING.md +0 -26
- package/SECURITY.md +0 -15
- package/SUPPORT.md +0 -8
- package/packages/convex/README.md +0 -1
- package/packages/convex/package.json +0 -12
- package/packages/convex/src/convex.config.ts +0 -3
- package/packages/convex/src/index.ts +0 -3
- package/packages/convex/src/mutations.ts +0 -270
- package/packages/convex/src/queries.ts +0 -175
- package/packages/convex/src/schema.ts +0 -55
- package/packages/react/README.md +0 -1
- package/packages/react/package.json +0 -36
- package/packages/react/src/DocsLayout.tsx +0 -116
- package/packages/react/src/DocsProvider.tsx +0 -93
- package/packages/react/src/RouterDocsContent.tsx +0 -148
- package/packages/react/src/RouterDocsLayout.tsx +0 -161
- package/packages/react/src/components/Breadcrumbs.tsx +0 -34
- package/packages/react/src/components/DocPage.tsx +0 -191
- package/packages/react/src/components/DocSearch.tsx +0 -140
- package/packages/react/src/components/DocSidebar.tsx +0 -86
- package/packages/react/src/components/DocsLayout.tsx +0 -62
- package/packages/react/src/components/EditButton.tsx +0 -26
- package/packages/react/src/components/PageNavigation.tsx +0 -45
- package/packages/react/src/components/TableOfContents.tsx +0 -46
- package/packages/react/src/components/VersionSelector.tsx +0 -60
- package/packages/react/src/components/index.ts +0 -9
- package/packages/react/src/hooks/index.ts +0 -8
- package/packages/react/src/hooks/useDocSearch.ts +0 -55
- package/packages/react/src/hooks/useDocs.ts +0 -57
- package/packages/react/src/hooks/useDocsAdmin.ts +0 -151
- package/packages/react/src/hooks/useTableOfContents.ts +0 -66
- package/packages/react/src/index.ts +0 -38
- package/packages/react/src/pages/DocSearchPage.tsx +0 -129
- package/packages/react/src/pages/DocViewPage.tsx +0 -158
- package/packages/react/src/pages/DocsAdminPage.tsx +0 -330
- package/packages/react/src/pages/DocsIndexPage.tsx +0 -172
- package/packages/react/src/pages/index.ts +0 -4
- package/packages/react/src/useDocs.ts +0 -58
- package/packages/react/tsup.config.ts +0 -12
- package/packages/react-css/README.md +0 -1
- package/packages/react-css/package.json +0 -37
- package/packages/react-css/src/DocsLayout.tsx +0 -117
- package/packages/react-css/src/DocsProvider.tsx +0 -93
- package/packages/react-css/src/RouterDocsContent.tsx +0 -60
- package/packages/react-css/src/RouterDocsLayout.tsx +0 -101
- package/packages/react-css/src/components/DocPage.tsx +0 -21
- package/packages/react-css/src/components/DocSearch.tsx +0 -55
- package/packages/react-css/src/components/DocSidebar.tsx +0 -56
- package/packages/react-css/src/components/DocsLayout.tsx +0 -28
- package/packages/react-css/src/components/common.tsx +0 -93
- package/packages/react-css/src/components/index.ts +0 -5
- package/packages/react-css/src/hooks/index.ts +0 -2
- package/packages/react-css/src/index.ts +0 -6
- package/packages/react-css/src/index.tsx +0 -3
- package/packages/react-css/src/pages/DocViewPage.tsx +0 -78
- package/packages/react-css/src/pages/DocsAdminPage.tsx +0 -101
- package/packages/react-css/src/pages/DocsIndexPage.tsx +0 -68
- package/packages/react-css/src/pages/index.ts +0 -3
- package/packages/react-css/src/useDocs.ts +0 -58
- package/packages/react-css/tsconfig.json +0 -19
- package/packages/react-css/tsup.config.ts +0 -10
- package/packages/shared/README.md +0 -1
- package/packages/shared/package.json +0 -31
- package/packages/shared/src/__tests__/docs.test.ts +0 -69
- package/packages/shared/src/config.ts +0 -80
- package/packages/shared/src/index.ts +0 -179
- package/packages/shared/src/providers/astro.ts +0 -94
- package/packages/shared/src/providers/fumadocs.ts +0 -116
- package/packages/shared/src/providers/internal.ts +0 -80
- package/packages/shared/src/types.ts +0 -73
- package/packages/shared/tsconfig.json +0 -18
- package/packages/shared/tsup.config.ts +0 -12
- package/packages/shared/vitest.config.ts +0 -4
- package/packages/solidjs/README.md +0 -1
- package/packages/solidjs/package.json +0 -33
- package/packages/solidjs/src/DocsLayout.tsx +0 -87
- package/packages/solidjs/src/DocsProvider.tsx +0 -95
- package/packages/solidjs/src/RouterDocsContent.tsx +0 -147
- package/packages/solidjs/src/RouterDocsLayout.tsx +0 -161
- package/packages/solidjs/src/components/Breadcrumbs.tsx +0 -27
- package/packages/solidjs/src/components/DocPage.tsx +0 -110
- package/packages/solidjs/src/components/DocSearch.tsx +0 -81
- package/packages/solidjs/src/components/DocSidebar.tsx +0 -92
- package/packages/solidjs/src/components/DocsLayout.tsx +0 -38
- package/packages/solidjs/src/components/EditButton.tsx +0 -15
- package/packages/solidjs/src/components/PageNavigation.tsx +0 -31
- package/packages/solidjs/src/components/TableOfContents.tsx +0 -41
- package/packages/solidjs/src/components/VersionSelector.tsx +0 -30
- package/packages/solidjs/src/components/index.ts +0 -9
- package/packages/solidjs/src/createDocs.ts +0 -62
- package/packages/solidjs/src/index.ts +0 -28
- package/packages/solidjs/src/pages/DocSearchPage.tsx +0 -72
- package/packages/solidjs/src/pages/DocViewPage.tsx +0 -80
- package/packages/solidjs/src/pages/DocsAdminPage.tsx +0 -123
- package/packages/solidjs/src/pages/DocsIndexPage.tsx +0 -85
- package/packages/solidjs/src/pages/index.ts +0 -4
- package/packages/solidjs/src/primitives/createDocSearch.ts +0 -42
- package/packages/solidjs/src/primitives/createDocs.ts +0 -35
- package/packages/solidjs/src/primitives/createDocsAdmin.ts +0 -63
- package/packages/solidjs/src/primitives/createTableOfContents.ts +0 -51
- package/packages/solidjs/src/primitives/index.ts +0 -4
- package/packages/solidjs/tsup.config.ts +0 -12
- package/packages/solidjs-css/README.md +0 -1
- package/packages/solidjs-css/package.json +0 -36
- package/packages/solidjs-css/src/DocsLayout.tsx +0 -106
- package/packages/solidjs-css/src/DocsProvider.tsx +0 -95
- package/packages/solidjs-css/src/RouterDocsContent.tsx +0 -54
- package/packages/solidjs-css/src/RouterDocsLayout.tsx +0 -104
- package/packages/solidjs-css/src/createDocs.ts +0 -62
- package/packages/solidjs-css/src/index.ts +0 -7
- package/packages/solidjs-css/src/index.tsx +0 -17
- package/packages/solidjs-css/src/pages/DocViewPage.tsx +0 -111
- package/packages/solidjs-css/src/pages/DocsAdminPage.tsx +0 -332
- package/packages/solidjs-css/src/pages/DocsIndexPage.tsx +0 -116
- package/packages/solidjs-css/src/pages/index.ts +0 -3
- package/packages/solidjs-css/src/primitives/index.ts +0 -1
- package/packages/solidjs-css/tsconfig.json +0 -20
- package/packages/solidjs-css/tsup.config.ts +0 -10
- package/pnpm-workspace.yaml +0 -2
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// ─── Docs Types ──────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
export type DocAccess = 'public' | 'team' | 'admin'
|
|
4
|
-
export type DocStatus = 'draft' | 'published' | 'archived'
|
|
5
|
-
|
|
6
|
-
export interface DocPage {
|
|
7
|
-
id: string
|
|
8
|
-
title: string
|
|
9
|
-
slug: string
|
|
10
|
-
content: string // MDX
|
|
11
|
-
excerpt?: string
|
|
12
|
-
sectionId: string
|
|
13
|
-
order: number
|
|
14
|
-
author: { name: string; avatar?: string }
|
|
15
|
-
lastEditedBy?: { name: string; editedAt: string }
|
|
16
|
-
version?: string // e.g. "2.1.0"
|
|
17
|
-
access: DocAccess
|
|
18
|
-
tags: string[]
|
|
19
|
-
status: DocStatus
|
|
20
|
-
createdAt: string
|
|
21
|
-
updatedAt: string
|
|
22
|
-
wordCount: number
|
|
23
|
-
readingTime: number
|
|
24
|
-
viewCount: number
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface DocSection {
|
|
28
|
-
id: string
|
|
29
|
-
title: string
|
|
30
|
-
slug: string
|
|
31
|
-
parentId?: string // max 3 levels
|
|
32
|
-
order: number
|
|
33
|
-
icon?: string
|
|
34
|
-
description?: string
|
|
35
|
-
access: DocAccess
|
|
36
|
-
pageCount?: number
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface SearchResult {
|
|
40
|
-
pageId: string
|
|
41
|
-
pageTitle: string
|
|
42
|
-
sectionTitle: string
|
|
43
|
-
sectionSlug: string
|
|
44
|
-
slug: string
|
|
45
|
-
highlight: string
|
|
46
|
-
score: number
|
|
47
|
-
tags: string[]
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface TocItem {
|
|
51
|
-
id: string
|
|
52
|
-
text: string
|
|
53
|
-
level: 2 | 3 | 4
|
|
54
|
-
children: TocItem[]
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface BreadcrumbItem {
|
|
58
|
-
title: string
|
|
59
|
-
href: string
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface DocsConfig {
|
|
63
|
-
siteName?: string
|
|
64
|
-
baseUrl?: string
|
|
65
|
-
defaultAccess?: DocAccess
|
|
66
|
-
versionsEnabled?: boolean
|
|
67
|
-
cmdKEnabled?: boolean
|
|
68
|
-
editPageUrl?: string // e.g. 'https://github.com/org/repo/edit/main/docs'
|
|
69
|
-
showReadingTime?: boolean
|
|
70
|
-
showLastEdited?: boolean
|
|
71
|
-
showViewCount?: boolean
|
|
72
|
-
printModeEnabled?: boolean
|
|
73
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist",
|
|
5
|
-
"rootDir": "./src",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"resolveJsonModule": true,
|
|
10
|
-
"isolatedModules": true,
|
|
11
|
-
"target": "ES2022",
|
|
12
|
-
"module": "ESNext",
|
|
13
|
-
"moduleResolution": "bundler"
|
|
14
|
-
},
|
|
15
|
-
"include": [
|
|
16
|
-
"src"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# ✦ @geenius-docs/solidjs\n\n> A premium module for the Geenius Boilerplate Ecosystem.\n\n---\n\n## Overview\nBuilt with Steve Jobs-level minimalism and Jony Ive-level craftsmanship, this package is designed to deliver unparalleled developer experience (DX) and rock-solid performance.\n\n## Installation\n\n```bash\npnpm add @geenius-docs/solidjs\n```\n\n## Usage\n\n```typescript\nimport { init } from '@geenius-docs/solidjs';\n\n// Initialize the module with absolute precision\ninit({\n mode: 'premium',\n});\n```\n\n## Architecture\n- **Zero-config**: It just works.\n- **Strictly Typed**: Fully written in TypeScript for flawless IntelliSense.\n- **Framework Agnostic**: seamlessly integrates into the Geenius ecosystem.\n\n---\n\n*Designed by Antigravity HQ*\n
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@geenius-docs/solidjs",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "./src/index.ts",
|
|
6
|
-
"types": "./src/index.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./src/index.ts"
|
|
9
|
-
},
|
|
10
|
-
"peerDependencies": {
|
|
11
|
-
"solid-js": ">=1.8.0"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@geenius-docs/shared": "workspace:*",
|
|
15
|
-
"lucide-solid": "^0.577.0",
|
|
16
|
-
"remark-gfm": "^4.0.1",
|
|
17
|
-
"solid-markdown": "^2.1.1"
|
|
18
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"type-check": "tsc --noEmit"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@tanstack/solid-router": "^1.168.1"
|
|
24
|
-
},
|
|
25
|
-
"author": "Antigravity HQ",
|
|
26
|
-
"license": "MIT",
|
|
27
|
-
"engines": {
|
|
28
|
-
"node": ">=20.0.0"
|
|
29
|
-
},
|
|
30
|
-
"publishConfig": {
|
|
31
|
-
"access": "public"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// @geenius-docs/solidjs — src/DocsLayout.tsx
|
|
2
|
-
|
|
3
|
-
import { For, Show, type ParentComponent } from 'solid-js'
|
|
4
|
-
import { useDocs } from './DocsProvider'
|
|
5
|
-
|
|
6
|
-
export interface DocsLayoutProps {
|
|
7
|
-
currentPageId?: string
|
|
8
|
-
onSelectPage?: (id: string) => void
|
|
9
|
-
searchQuery?: string
|
|
10
|
-
onSearch?: (query: string) => void
|
|
11
|
-
searchResults?: unknown[]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* DocsLayout — SolidJS sidebar + content layout for documentation.
|
|
16
|
-
* Uses data-* attributes and ga-docs-* classes for CSS styling.
|
|
17
|
-
*/
|
|
18
|
-
export const DocsLayout: ParentComponent<DocsLayoutProps> = (props) => {
|
|
19
|
-
const docs = useDocs()
|
|
20
|
-
|
|
21
|
-
const q = () => props.searchQuery ?? docs.searchQuery()
|
|
22
|
-
const results = () => (props.searchResults ?? docs.searchResults()) as Array<{ id: string; title: string; description?: string }>
|
|
23
|
-
const onSelect = (id: string) => (props.onSelectPage ?? docs.selectPage)(id)
|
|
24
|
-
const onSearch = (query: string) => (props.onSearch ?? docs.setSearchQuery)(query)
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div class="ga-docs-layout">
|
|
28
|
-
{/* Sidebar */}
|
|
29
|
-
<aside class="ga-docs-sidebar">
|
|
30
|
-
<div class="ga-docs-search">
|
|
31
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><circle cx="11" cy="11" r="8" /><path d="m21 21-4.3-4.3" /></svg>
|
|
32
|
-
<input
|
|
33
|
-
type="text"
|
|
34
|
-
value={q()}
|
|
35
|
-
onInput={(e) => onSearch(e.currentTarget.value)}
|
|
36
|
-
placeholder="Search docs..."
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<nav>
|
|
41
|
-
<Show
|
|
42
|
-
when={!q() || results().length === 0}
|
|
43
|
-
fallback={
|
|
44
|
-
<div data-docs-search-results>
|
|
45
|
-
<p class="ga-docs-nav-group-title">Search Results ({results().length})</p>
|
|
46
|
-
<For each={results()}>
|
|
47
|
-
{(page) => (
|
|
48
|
-
<button
|
|
49
|
-
class="ga-docs-nav-item"
|
|
50
|
-
onClick={() => { onSelect(page.id); onSearch('') }}
|
|
51
|
-
>
|
|
52
|
-
{page.title}
|
|
53
|
-
</button>
|
|
54
|
-
)}
|
|
55
|
-
</For>
|
|
56
|
-
</div>
|
|
57
|
-
}
|
|
58
|
-
>
|
|
59
|
-
<For each={docs.tree}>
|
|
60
|
-
{(group) => (
|
|
61
|
-
<div class="ga-docs-nav-group">
|
|
62
|
-
<p class="ga-docs-nav-group-title">{group.title}</p>
|
|
63
|
-
<For each={group.children}>
|
|
64
|
-
{(page) => (
|
|
65
|
-
<button
|
|
66
|
-
class="ga-docs-nav-item"
|
|
67
|
-
data-active={page.id === props.currentPageId || undefined}
|
|
68
|
-
onClick={() => onSelect(page.id)}
|
|
69
|
-
>
|
|
70
|
-
{page.title}
|
|
71
|
-
</button>
|
|
72
|
-
)}
|
|
73
|
-
</For>
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
76
|
-
</For>
|
|
77
|
-
</Show>
|
|
78
|
-
</nav>
|
|
79
|
-
</aside>
|
|
80
|
-
|
|
81
|
-
{/* Content */}
|
|
82
|
-
<main class="ga-docs-content">
|
|
83
|
-
{props.children}
|
|
84
|
-
</main>
|
|
85
|
-
</div>
|
|
86
|
-
)
|
|
87
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// @geenius-docs/solidjs — src/DocsProvider.tsx
|
|
2
|
-
|
|
3
|
-
import { createContext, useContext, type ParentComponent } from 'solid-js'
|
|
4
|
-
import { createSignal, createMemo } from 'solid-js'
|
|
5
|
-
|
|
6
|
-
export interface DocsPage {
|
|
7
|
-
id: string
|
|
8
|
-
title: string
|
|
9
|
-
description?: string
|
|
10
|
-
content: unknown
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface DocsGroup {
|
|
14
|
-
id: string
|
|
15
|
-
title: string
|
|
16
|
-
children: DocsPage[]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type DocsTree = DocsGroup[]
|
|
20
|
-
|
|
21
|
-
export interface DocsContextValue {
|
|
22
|
-
tree: DocsTree
|
|
23
|
-
currentPage: () => DocsPage | null
|
|
24
|
-
selectPage: (id: string) => void
|
|
25
|
-
searchQuery: () => string
|
|
26
|
-
setSearchQuery: (query: string) => void
|
|
27
|
-
searchResults: () => DocsPage[]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const DocsContext = createContext<DocsContextValue>()
|
|
31
|
-
|
|
32
|
-
export interface DocsProviderProps {
|
|
33
|
-
tree: DocsTree
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* DocsProvider — SolidJS context managing docs state:
|
|
38
|
-
* current page, search, and tree navigation.
|
|
39
|
-
*/
|
|
40
|
-
export const DocsProvider: ParentComponent<DocsProviderProps> = (props) => {
|
|
41
|
-
const firstPageId = () => props.tree[0]?.children[0]?.id || null
|
|
42
|
-
const [currentPageId, setCurrentPageId] = createSignal<string | null>(firstPageId())
|
|
43
|
-
const [searchQuery, setSearchQuery] = createSignal('')
|
|
44
|
-
|
|
45
|
-
const currentPage = createMemo(() => {
|
|
46
|
-
const id = currentPageId()
|
|
47
|
-
if (!id) return null
|
|
48
|
-
for (const group of props.tree) {
|
|
49
|
-
const page = group.children.find(p => p.id === id)
|
|
50
|
-
if (page) return page
|
|
51
|
-
}
|
|
52
|
-
return null
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const selectPage = (id: string) => setCurrentPageId(id)
|
|
56
|
-
|
|
57
|
-
const searchResults = createMemo(() => {
|
|
58
|
-
const q = searchQuery().toLowerCase()
|
|
59
|
-
if (!q) return []
|
|
60
|
-
const results: DocsPage[] = []
|
|
61
|
-
for (const group of props.tree) {
|
|
62
|
-
for (const page of group.children) {
|
|
63
|
-
if (
|
|
64
|
-
page.title.toLowerCase().includes(q) ||
|
|
65
|
-
page.description?.toLowerCase().includes(q) ||
|
|
66
|
-
(typeof page.content === 'string' && page.content.toLowerCase().includes(q))
|
|
67
|
-
) {
|
|
68
|
-
results.push(page)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return results
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
const value: DocsContextValue = {
|
|
76
|
-
tree: props.tree,
|
|
77
|
-
currentPage,
|
|
78
|
-
selectPage,
|
|
79
|
-
searchQuery,
|
|
80
|
-
setSearchQuery,
|
|
81
|
-
searchResults,
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<DocsContext.Provider value={value}>
|
|
86
|
-
{props.children}
|
|
87
|
-
</DocsContext.Provider>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function useDocs(): DocsContextValue {
|
|
92
|
-
const ctx = useContext(DocsContext)
|
|
93
|
-
if (!ctx) throw new Error('useDocs must be used within a DocsProvider')
|
|
94
|
-
return ctx
|
|
95
|
-
}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
// src/components/docs/DocsContent.tsx
|
|
2
|
-
|
|
3
|
-
import { SolidMarkdown as ReactMarkdown } from 'solid-markdown'
|
|
4
|
-
import remarkGfm from 'remark-gfm'
|
|
5
|
-
import { Link } from '@tanstack/solid-router'
|
|
6
|
-
|
|
7
|
-
interface DocsContentProps {
|
|
8
|
-
content: string
|
|
9
|
-
title: string
|
|
10
|
-
description: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const DocsContent: Component<DocsContentProps> = ({
|
|
14
|
-
content,
|
|
15
|
-
title,
|
|
16
|
-
description,
|
|
17
|
-
}) => {
|
|
18
|
-
return (
|
|
19
|
-
<article class="prose prose-lg dark:prose-invert max-w-none">
|
|
20
|
-
{/* Header */}
|
|
21
|
-
<header class="mb-8 pb-8 border-b border-border not-prose">
|
|
22
|
-
<h1 class="text-4xl font-extrabold text-text-main mb-3">{title}</h1>
|
|
23
|
-
<p class="text-lg text-text-muted">{description}</p>
|
|
24
|
-
</header>
|
|
25
|
-
|
|
26
|
-
{/* Markdown Content */}
|
|
27
|
-
<ReactMarkdown
|
|
28
|
-
remarkPlugins={[remarkGfm]}
|
|
29
|
-
components={{
|
|
30
|
-
// Custom heading styles
|
|
31
|
-
h1: ({ children }) => (
|
|
32
|
-
<h1 class="text-3xl font-bold text-text-main mt-12 mb-6">
|
|
33
|
-
{children}
|
|
34
|
-
</h1>
|
|
35
|
-
),
|
|
36
|
-
h2: ({ children }) => (
|
|
37
|
-
<h2 class="text-2xl font-bold text-text-main mt-10 mb-4 pb-2 border-b border-border">
|
|
38
|
-
{children}
|
|
39
|
-
</h2>
|
|
40
|
-
),
|
|
41
|
-
h3: ({ children }) => (
|
|
42
|
-
<h3 class="text-xl font-bold text-text-main mt-8 mb-3">
|
|
43
|
-
{children}
|
|
44
|
-
</h3>
|
|
45
|
-
),
|
|
46
|
-
h4: ({ children }) => (
|
|
47
|
-
<h4 class="text-lg font-semibold text-text-main mt-6 mb-2">
|
|
48
|
-
{children}
|
|
49
|
-
</h4>
|
|
50
|
-
),
|
|
51
|
-
// Paragraph
|
|
52
|
-
p: ({ children }) => (
|
|
53
|
-
<p class="text-text-muted leading-relaxed mb-4">{children}</p>
|
|
54
|
-
),
|
|
55
|
-
// Links
|
|
56
|
-
a: ({ href, children }) => {
|
|
57
|
-
const isInternal = href?.startsWith('/')
|
|
58
|
-
if (isInternal) {
|
|
59
|
-
return (
|
|
60
|
-
<Link
|
|
61
|
-
to={href!}
|
|
62
|
-
class="text-primary hover:underline font-medium"
|
|
63
|
-
>
|
|
64
|
-
{children}
|
|
65
|
-
</Link>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
return (
|
|
69
|
-
<a
|
|
70
|
-
href={href}
|
|
71
|
-
target="_blank"
|
|
72
|
-
rel="noopener noreferrer"
|
|
73
|
-
class="text-primary hover:underline font-medium"
|
|
74
|
-
>
|
|
75
|
-
{children}
|
|
76
|
-
</a>
|
|
77
|
-
)
|
|
78
|
-
},
|
|
79
|
-
// Code blocks
|
|
80
|
-
code: ({ className, children, ...props }) => {
|
|
81
|
-
const isInline = !className
|
|
82
|
-
if (isInline) {
|
|
83
|
-
return (
|
|
84
|
-
<code class="bg-bg-muted px-1.5 py-0.5 rounded text-sm font-mono text-primary">
|
|
85
|
-
{children}
|
|
86
|
-
</code>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
return (
|
|
90
|
-
<code class={`${className} block`} {...props}>
|
|
91
|
-
{children}
|
|
92
|
-
</code>
|
|
93
|
-
)
|
|
94
|
-
},
|
|
95
|
-
pre: ({ children }) => (
|
|
96
|
-
<pre class="bg-[#1e1e2e] text-gray-100 p-4 rounded-xl overflow-x-auto text-sm my-6 border border-border">
|
|
97
|
-
{children}
|
|
98
|
-
</pre>
|
|
99
|
-
),
|
|
100
|
-
// Lists
|
|
101
|
-
ul: ({ children }) => (
|
|
102
|
-
<ul class="list-disc list-inside space-y-2 text-text-muted mb-4">
|
|
103
|
-
{children}
|
|
104
|
-
</ul>
|
|
105
|
-
),
|
|
106
|
-
ol: ({ children }) => (
|
|
107
|
-
<ol class="list-decimal list-inside space-y-2 text-text-muted mb-4">
|
|
108
|
-
{children}
|
|
109
|
-
</ol>
|
|
110
|
-
),
|
|
111
|
-
li: ({ children }) => <li class="text-text-muted">{children}</li>,
|
|
112
|
-
// Tables
|
|
113
|
-
table: ({ children }) => (
|
|
114
|
-
<div class="overflow-x-auto my-6">
|
|
115
|
-
<table class="min-w-full divide-y divide-border border border-border rounded-lg overflow-hidden">
|
|
116
|
-
{children}
|
|
117
|
-
</table>
|
|
118
|
-
</div>
|
|
119
|
-
),
|
|
120
|
-
thead: ({ children }) => (
|
|
121
|
-
<thead class="bg-bg-muted">{children}</thead>
|
|
122
|
-
),
|
|
123
|
-
th: ({ children }) => (
|
|
124
|
-
<th class="px-4 py-3 text-left text-sm font-bold text-text-main">
|
|
125
|
-
{children}
|
|
126
|
-
</th>
|
|
127
|
-
),
|
|
128
|
-
td: ({ children }) => (
|
|
129
|
-
<td class="px-4 py-3 text-sm text-text-muted border-t border-border">
|
|
130
|
-
{children}
|
|
131
|
-
</td>
|
|
132
|
-
),
|
|
133
|
-
// Blockquotes
|
|
134
|
-
blockquote: ({ children }) => (
|
|
135
|
-
<blockquote class="border-l-4 border-primary pl-4 py-2 my-6 bg-primary/5 rounded-r-lg">
|
|
136
|
-
{children}
|
|
137
|
-
</blockquote>
|
|
138
|
-
),
|
|
139
|
-
// Horizontal rules
|
|
140
|
-
hr: () => <hr class="border-border my-8" />,
|
|
141
|
-
}}
|
|
142
|
-
>
|
|
143
|
-
{content}
|
|
144
|
-
</ReactMarkdown>
|
|
145
|
-
</article>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
// src/components/docs/DocsLayout.tsx
|
|
2
|
-
|
|
3
|
-
import { createSignal, type JSX } from 'solid-js'
|
|
4
|
-
import { Link, useLocation } from '@tanstack/solid-router'
|
|
5
|
-
import { Book, Menu, X, Search, ChevronRight } from 'lucide-solid'
|
|
6
|
-
|
|
7
|
-
export interface DocItem {
|
|
8
|
-
slug: string
|
|
9
|
-
title: string
|
|
10
|
-
description: string
|
|
11
|
-
category: string
|
|
12
|
-
order: number
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface DocsLayoutProps {
|
|
16
|
-
children: JSX.Element
|
|
17
|
-
docs: DocItem[]
|
|
18
|
-
currentSlug?: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const DocsLayout: Component<DocsLayoutProps> = ({
|
|
22
|
-
children,
|
|
23
|
-
docs,
|
|
24
|
-
currentSlug,
|
|
25
|
-
}) => {
|
|
26
|
-
const [isSidebarOpen, setIsSidebarOpen] = createSignal(false)
|
|
27
|
-
const location = useLocation()
|
|
28
|
-
|
|
29
|
-
// Group docs by category
|
|
30
|
-
const groupedDocs = docs.reduce(
|
|
31
|
-
(acc, doc) => {
|
|
32
|
-
if (!acc[doc.category]) {
|
|
33
|
-
acc[doc.category] = []
|
|
34
|
-
}
|
|
35
|
-
acc[doc.category].push(doc)
|
|
36
|
-
return acc
|
|
37
|
-
},
|
|
38
|
-
{} as Record<string, DocItem[]>,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
// Sort categories and docs within each category
|
|
42
|
-
const sortedCategories = Object.entries(groupedDocs).sort(([a], [b]) => {
|
|
43
|
-
const categoryOrder = [
|
|
44
|
-
'Introduction',
|
|
45
|
-
'Getting Started',
|
|
46
|
-
'Guides',
|
|
47
|
-
'API',
|
|
48
|
-
'Advanced',
|
|
49
|
-
]
|
|
50
|
-
return categoryOrder.indexOf(a) - categoryOrder.indexOf(b)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div class="min-h-screen bg-bg">
|
|
55
|
-
{/* Mobile Header */}
|
|
56
|
-
<div class="lg:hidden sticky top-0 z-40 flex items-center justify-between px-4 py-3 bg-card border-b border-border">
|
|
57
|
-
<Link to="/" class="flex items-center gap-2 text-primary">
|
|
58
|
-
<Book class="w-5 h-5" />
|
|
59
|
-
<span class="font-bold">Documentation</span>
|
|
60
|
-
</Link>
|
|
61
|
-
<button
|
|
62
|
-
onClick={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
63
|
-
class="p-2 rounded-lg hover:bg-bg-muted transition-colors"
|
|
64
|
-
>
|
|
65
|
-
{isSidebarOpen ? (
|
|
66
|
-
<X class="w-5 h-5" />
|
|
67
|
-
) : (
|
|
68
|
-
<Menu class="w-5 h-5" />
|
|
69
|
-
)}
|
|
70
|
-
</button>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<div class="flex">
|
|
74
|
-
{/* Sidebar */}
|
|
75
|
-
<aside
|
|
76
|
-
class={`
|
|
77
|
-
fixed lg:sticky top-16 left-0 z-30 w-72 h-[calc(100vh-4rem)] overflow-y-auto
|
|
78
|
-
bg-card border-r border-border transition-transform duration-300
|
|
79
|
-
lg:translate-x-0
|
|
80
|
-
${isSidebarOpen ? 'translate-x-0' : '-translate-x-full'}
|
|
81
|
-
`}
|
|
82
|
-
>
|
|
83
|
-
<div class="p-6">
|
|
84
|
-
{/* Logo */}
|
|
85
|
-
<Link
|
|
86
|
-
to="/"
|
|
87
|
-
class="hidden lg:flex items-center gap-2 text-primary mb-8"
|
|
88
|
-
>
|
|
89
|
-
<Book class="w-6 h-6" />
|
|
90
|
-
<span class="font-bold text-lg">Documentation</span>
|
|
91
|
-
</Link>
|
|
92
|
-
|
|
93
|
-
{/* Search */}
|
|
94
|
-
<div class="relative mb-6">
|
|
95
|
-
<Search class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted" />
|
|
96
|
-
<input
|
|
97
|
-
type="text"
|
|
98
|
-
placeholder="Search docs..."
|
|
99
|
-
class="w-full pl-10 pr-4 py-2.5 bg-bg-muted border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all"
|
|
100
|
-
/>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
{/* Navigation */}
|
|
104
|
-
<nav class="space-y-6">
|
|
105
|
-
{sortedCategories.map(([category, categoryDocs]) => (
|
|
106
|
-
<div>
|
|
107
|
-
<h3 class="text-xs font-bold text-text-muted uppercase tracking-wider mb-3">
|
|
108
|
-
{category}
|
|
109
|
-
</h3>
|
|
110
|
-
<ul class="space-y-1">
|
|
111
|
-
{categoryDocs
|
|
112
|
-
.sort((a, b) => a.order - b.order)
|
|
113
|
-
.map((doc) => {
|
|
114
|
-
const isActive = currentSlug === doc.slug
|
|
115
|
-
return (
|
|
116
|
-
<li>
|
|
117
|
-
<Link
|
|
118
|
-
to="/docs/$slug"
|
|
119
|
-
params={{ slug: doc.slug }}
|
|
120
|
-
activeOptions={{ exact: true }}
|
|
121
|
-
onClick={() => setIsSidebarOpen(false)}
|
|
122
|
-
class={`
|
|
123
|
-
flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all
|
|
124
|
-
${
|
|
125
|
-
isActive
|
|
126
|
-
? 'bg-primary/10 text-primary'
|
|
127
|
-
: 'text-text-muted hover:bg-bg-muted hover:text-text-main'
|
|
128
|
-
}
|
|
129
|
-
`}
|
|
130
|
-
>
|
|
131
|
-
<ChevronRight
|
|
132
|
-
class={`w-4 h-4 transition-transform ${isActive ? 'rotate-90' : ''}`}
|
|
133
|
-
/>
|
|
134
|
-
{doc.title}
|
|
135
|
-
</Link>
|
|
136
|
-
</li>
|
|
137
|
-
)
|
|
138
|
-
})}
|
|
139
|
-
</ul>
|
|
140
|
-
</div>
|
|
141
|
-
))}
|
|
142
|
-
</nav>
|
|
143
|
-
</div>
|
|
144
|
-
</aside>
|
|
145
|
-
|
|
146
|
-
{/* Overlay for mobile */}
|
|
147
|
-
{isSidebarOpen && (
|
|
148
|
-
<div
|
|
149
|
-
class="fixed inset-0 bg-black/50 z-20 lg:hidden"
|
|
150
|
-
onClick={() => setIsSidebarOpen(false)}
|
|
151
|
-
/>
|
|
152
|
-
)}
|
|
153
|
-
|
|
154
|
-
{/* Main Content */}
|
|
155
|
-
<main class="flex-1 min-w-0">
|
|
156
|
-
<div class="max-w-4xl mx-auto px-6 py-12">{children}</div>
|
|
157
|
-
</main>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
)
|
|
161
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { For, Show } from 'solid-js'
|
|
2
|
-
import type { BreadcrumbItem } from '@geenius-docs/shared'
|
|
3
|
-
|
|
4
|
-
export function Breadcrumbs(props: { items: BreadcrumbItem[] }) {
|
|
5
|
-
return (
|
|
6
|
-
<Show when={props.items.length > 0}>
|
|
7
|
-
<nav class="flex items-center gap-1.5 text-sm" aria-label="Breadcrumb">
|
|
8
|
-
<For each={props.items}>
|
|
9
|
-
{(item, idx) => (
|
|
10
|
-
<>
|
|
11
|
-
<Show when={idx() > 0}>
|
|
12
|
-
<svg class="h-3.5 w-3.5 shrink-0 text-white/20" viewBox="0 0 16 16" fill="none">
|
|
13
|
-
<path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="1.5" />
|
|
14
|
-
</svg>
|
|
15
|
-
</Show>
|
|
16
|
-
<Show when={idx() === props.items.length - 1} fallback={
|
|
17
|
-
<a href={item.href} class="truncate text-white/40 transition-colors hover:text-white/70">{item.title}</a>
|
|
18
|
-
}>
|
|
19
|
-
<span class="truncate text-white/60">{item.title}</span>
|
|
20
|
-
</Show>
|
|
21
|
-
</>
|
|
22
|
-
)}
|
|
23
|
-
</For>
|
|
24
|
-
</nav>
|
|
25
|
-
</Show>
|
|
26
|
-
)
|
|
27
|
-
}
|