@alliance-droid/svelte-docs-system 0.0.2 → 0.1.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 +155 -23
- package/dist/components/APITable.svelte.d.ts +21 -0
- package/dist/components/Breadcrumbs.svelte.d.ts +14 -0
- package/dist/components/Callout.svelte.d.ts +15 -0
- package/dist/components/CodeBlock.svelte.d.ts +12 -0
- package/{src/lib → dist}/components/DocLayout.svelte +18 -6
- package/dist/components/DocLayout.svelte.d.ts +18 -0
- package/dist/components/DocsPage.svelte +39 -0
- package/dist/components/DocsPage.svelte.d.ts +8 -0
- package/dist/components/Documentation.svelte +639 -0
- package/dist/components/Footer.svelte.d.ts +10 -0
- package/dist/components/Image.svelte.d.ts +15 -0
- package/{src/lib → dist}/components/Navbar.svelte +4 -4
- package/dist/components/Navbar.svelte.d.ts +10 -0
- package/{src/lib → dist}/components/Search.svelte +2 -2
- package/dist/components/Search.svelte.d.ts +6 -0
- package/{template-starter/src/lib → dist}/components/Sidebar.svelte +2 -2
- package/dist/components/Sidebar.svelte.d.ts +9 -0
- package/dist/components/Tabs.svelte.d.ts +16 -0
- package/dist/config.d.ts +93 -0
- package/dist/config.js +89 -0
- package/dist/configLoader.d.ts +48 -0
- package/dist/configLoader.js +187 -0
- package/dist/configParser.d.ts +27 -0
- package/dist/configParser.js +208 -0
- package/{template-starter/src/lib/index.ts → dist/index.d.ts} +6 -7
- package/dist/index.js +18 -0
- package/dist/navigationBuilder.d.ts +64 -0
- package/dist/navigationBuilder.js +225 -0
- package/dist/plugin.d.ts +30 -0
- package/dist/plugin.js +172 -0
- package/dist/routing.d.ts +48 -0
- package/dist/routing.js +92 -0
- package/dist/stores/i18n.d.ts +20 -0
- package/dist/stores/i18n.js +119 -0
- package/dist/stores/nav.d.ts +20 -0
- package/dist/stores/nav.js +15 -0
- package/dist/stores/search.d.ts +49 -0
- package/dist/stores/search.js +127 -0
- package/dist/stores/theme.d.ts +7 -0
- package/dist/stores/theme.js +152 -0
- package/dist/stores/version.d.ts +18 -0
- package/dist/stores/version.js +93 -0
- package/dist/themeCustomization.d.ts +46 -0
- package/dist/themeCustomization.js +188 -0
- package/dist/utils/highlight.d.ts +13 -0
- package/dist/utils/highlight.js +83 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/markdown.d.ts +40 -0
- package/dist/utils/markdown.js +165 -0
- package/package.json +45 -23
- package/COMPONENTS.md +0 -365
- package/COVERAGE_REPORT.md +0 -663
- package/SEARCH_VERIFICATION.md +0 -229
- package/TEST_SUMMARY.md +0 -344
- package/bin/init.js +0 -821
- package/docs/COMPONENT_LIBRARY_INTEGRATION_REPORT.md +0 -153
- package/docs/DARK_MODE_AUDIT_REPORT.md +0 -403
- package/docs/E2E_TESTS.md +0 -354
- package/docs/TESTING.md +0 -754
- package/docs/THEME_INHERITANCE.md +0 -192
- package/docs/de/index.md +0 -41
- package/docs/en/COMPONENTS.md +0 -443
- package/docs/en/api/examples.md +0 -100
- package/docs/en/api/overview.md +0 -69
- package/docs/en/components/index.md +0 -622
- package/docs/en/config/navigation.md +0 -505
- package/docs/en/config/theme-and-colors.md +0 -395
- package/docs/en/getting-started/integration.md +0 -406
- package/docs/en/guides/common-setups.md +0 -651
- package/docs/en/index.md +0 -243
- package/docs/en/markdown.md +0 -102
- package/docs/en/routing.md +0 -64
- package/docs/en/setup.md +0 -52
- package/docs/en/troubleshooting.md +0 -704
- package/docs/es/index.md +0 -41
- package/docs/fr/index.md +0 -41
- package/docs/ja/index.md +0 -41
- package/pagefind.toml +0 -8
- package/postcss.config.js +0 -5
- package/src/app.css +0 -119
- package/src/app.d.ts +0 -13
- package/src/app.html +0 -11
- package/src/lib/components/APITable.test.ts +0 -153
- package/src/lib/components/Breadcrumbs.test.ts +0 -148
- package/src/lib/components/Callout.test.ts +0 -100
- package/src/lib/components/CodeBlock.test.ts +0 -133
- package/src/lib/components/Image.test.ts +0 -163
- package/src/lib/components/Sidebar.svelte +0 -110
- package/src/lib/components/Tabs.test.ts +0 -102
- package/src/lib/config.test.ts +0 -140
- package/src/lib/config.ts +0 -179
- package/src/lib/configIntegration.test.ts +0 -272
- package/src/lib/configLoader.ts +0 -231
- package/src/lib/configParser.test.ts +0 -217
- package/src/lib/configParser.ts +0 -234
- package/src/lib/index.ts +0 -37
- package/src/lib/integration.test.ts +0 -426
- package/src/lib/navigationBuilder.test.ts +0 -338
- package/src/lib/navigationBuilder.ts +0 -268
- package/src/lib/performance.test.ts +0 -369
- package/src/lib/routing.test.ts +0 -202
- package/src/lib/routing.ts +0 -127
- package/src/lib/search-functionality.test.ts +0 -493
- package/src/lib/stores/i18n.test.ts +0 -180
- package/src/lib/stores/i18n.ts +0 -143
- package/src/lib/stores/nav.ts +0 -36
- package/src/lib/stores/search.test.ts +0 -140
- package/src/lib/stores/search.ts +0 -162
- package/src/lib/stores/theme.test.ts +0 -117
- package/src/lib/stores/theme.ts +0 -167
- package/src/lib/stores/version.test.ts +0 -139
- package/src/lib/stores/version.ts +0 -111
- package/src/lib/themeCustomization.test.ts +0 -223
- package/src/lib/themeCustomization.ts +0 -212
- package/src/lib/utils/highlight.test.ts +0 -136
- package/src/lib/utils/highlight.ts +0 -100
- package/src/lib/utils/index.ts +0 -7
- package/src/lib/utils/markdown.test.ts +0 -357
- package/src/lib/utils/markdown.ts +0 -77
- package/src/routes/+layout.server.ts +0 -1
- package/src/routes/+layout.svelte +0 -29
- package/src/routes/+page.svelte +0 -165
- package/src/routes/quote-demo/+page.svelte +0 -141
- package/static/robots.txt +0 -3
- package/svelte.config.js +0 -15
- package/tailwind.config.ts +0 -55
- package/template-starter/.github/workflows/build.yml +0 -40
- package/template-starter/.github/workflows/deploy-github-pages.yml +0 -47
- package/template-starter/.github/workflows/deploy-netlify.yml +0 -41
- package/template-starter/.github/workflows/deploy-vercel.yml +0 -64
- package/template-starter/NPM-PACKAGE-SETUP.md +0 -233
- package/template-starter/README.md +0 -320
- package/template-starter/docs/_config.json +0 -39
- package/template-starter/docs/api/components.md +0 -257
- package/template-starter/docs/api/overview.md +0 -169
- package/template-starter/docs/guides/configuration.md +0 -145
- package/template-starter/docs/guides/github-pages-deployment.md +0 -254
- package/template-starter/docs/guides/netlify-deployment.md +0 -159
- package/template-starter/docs/guides/vercel-deployment.md +0 -131
- package/template-starter/docs/index.md +0 -49
- package/template-starter/docs/setup.md +0 -149
- package/template-starter/package.json +0 -31
- package/template-starter/pagefind.toml +0 -3
- package/template-starter/postcss.config.js +0 -5
- package/template-starter/src/app.css +0 -34
- package/template-starter/src/app.d.ts +0 -13
- package/template-starter/src/app.html +0 -11
- package/template-starter/src/lib/components/APITable.svelte +0 -120
- package/template-starter/src/lib/components/APITable.test.ts +0 -96
- package/template-starter/src/lib/components/Breadcrumbs.svelte +0 -85
- package/template-starter/src/lib/components/Breadcrumbs.test.ts +0 -82
- package/template-starter/src/lib/components/Callout.svelte +0 -60
- package/template-starter/src/lib/components/Callout.test.ts +0 -91
- package/template-starter/src/lib/components/CodeBlock.svelte +0 -68
- package/template-starter/src/lib/components/CodeBlock.test.ts +0 -62
- package/template-starter/src/lib/components/DocLayout.svelte +0 -84
- package/template-starter/src/lib/components/Footer.svelte +0 -78
- package/template-starter/src/lib/components/Image.svelte +0 -100
- package/template-starter/src/lib/components/Image.test.ts +0 -81
- package/template-starter/src/lib/components/Navbar.svelte +0 -141
- package/template-starter/src/lib/components/Search.svelte +0 -248
- package/template-starter/src/lib/components/Tabs.svelte +0 -48
- package/template-starter/src/lib/components/Tabs.test.ts +0 -89
- package/template-starter/src/routes/+layout.svelte +0 -28
- package/template-starter/src/routes/+page.svelte +0 -92
- package/template-starter/svelte.config.js +0 -17
- package/template-starter/tailwind.config.ts +0 -17
- package/template-starter/tsconfig.json +0 -13
- package/template-starter/vite.config.ts +0 -6
- package/tests/e2e/example.spec.ts +0 -345
- package/tsconfig.json +0 -20
- package/vite.config.ts +0 -6
- package/vitest.config.ts +0 -33
- package/vitest.setup.ts +0 -21
- /package/{src/lib → dist}/assets/favicon.svg +0 -0
- /package/{src/lib → dist}/components/APITable.svelte +0 -0
- /package/{src/lib → dist}/components/Breadcrumbs.svelte +0 -0
- /package/{src/lib → dist}/components/Callout.svelte +0 -0
- /package/{src/lib → dist}/components/CodeBlock.svelte +0 -0
- /package/{src/lib → dist}/components/Footer.svelte +0 -0
- /package/{src/lib → dist}/components/Image.svelte +0 -0
- /package/{src/lib → dist}/components/Tabs.svelte +0 -0
- /package/{src/lib → dist}/svelte-component-library.d.ts +0 -0
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { page } from '$app/stores';
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import { renderMarkdown } from '../utils/markdown.js';
|
|
5
|
+
|
|
6
|
+
interface DocFile {
|
|
7
|
+
slug: string;
|
|
8
|
+
path: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
order?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface DocFolder {
|
|
15
|
+
name: string;
|
|
16
|
+
slug: string;
|
|
17
|
+
files: DocFile[];
|
|
18
|
+
folders: DocFolder[];
|
|
19
|
+
order?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Props {
|
|
23
|
+
structure: DocFolder;
|
|
24
|
+
baseRoute?: string;
|
|
25
|
+
currentSlug?: string;
|
|
26
|
+
class?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
structure,
|
|
31
|
+
baseRoute = '/documentation',
|
|
32
|
+
currentSlug = '',
|
|
33
|
+
class: className = ''
|
|
34
|
+
}: Props = $props();
|
|
35
|
+
|
|
36
|
+
let content = $state('');
|
|
37
|
+
let metadata = $state<Record<string, any>>({});
|
|
38
|
+
let loading = $state(true);
|
|
39
|
+
let error = $state<string | null>(null);
|
|
40
|
+
let sidebarOpen = $state(false);
|
|
41
|
+
let searchQuery = $state('');
|
|
42
|
+
|
|
43
|
+
function getAllDocs(folder: DocFolder): DocFile[] {
|
|
44
|
+
let docs: DocFile[] = [...folder.files];
|
|
45
|
+
for (const subFolder of folder.folders) {
|
|
46
|
+
docs = docs.concat(getAllDocs(subFolder));
|
|
47
|
+
}
|
|
48
|
+
return docs;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const filteredStructure = $derived(() => {
|
|
52
|
+
if (!searchQuery.trim()) return structure;
|
|
53
|
+
|
|
54
|
+
const query = searchQuery.toLowerCase();
|
|
55
|
+
|
|
56
|
+
function filterFolder(folder: DocFolder): DocFolder {
|
|
57
|
+
const filteredFiles = folder.files.filter(f =>
|
|
58
|
+
f.title.toLowerCase().includes(query) ||
|
|
59
|
+
f.slug.toLowerCase().includes(query)
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const filteredFolders = folder.folders
|
|
63
|
+
.map(filterFolder)
|
|
64
|
+
.filter(f => f.files.length > 0 || f.folders.length > 0);
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
...folder,
|
|
68
|
+
files: filteredFiles,
|
|
69
|
+
folders: filteredFolders
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return filterFolder(structure);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
function findDoc(folder: DocFolder, slug: string): DocFile | null {
|
|
77
|
+
for (const file of folder.files) {
|
|
78
|
+
if (file.slug === slug) return file;
|
|
79
|
+
}
|
|
80
|
+
for (const subFolder of folder.folders) {
|
|
81
|
+
const found = findDoc(subFolder, slug);
|
|
82
|
+
if (found) return found;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getFirstDoc(folder: DocFolder): DocFile | null {
|
|
88
|
+
if (folder.files.length > 0) return folder.files[0];
|
|
89
|
+
for (const subFolder of folder.folders) {
|
|
90
|
+
const found = getFirstDoc(subFolder);
|
|
91
|
+
if (found) return found;
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function loadContent(slug: string) {
|
|
97
|
+
loading = true;
|
|
98
|
+
error = null;
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
const targetSlug = slug || getFirstDoc(structure)?.slug || '';
|
|
102
|
+
const doc = findDoc(structure, targetSlug);
|
|
103
|
+
|
|
104
|
+
if (!doc) {
|
|
105
|
+
error = 'Document not found';
|
|
106
|
+
loading = false;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const response = await fetch(`/docs/${targetSlug}.md`);
|
|
111
|
+
if (!response.ok) {
|
|
112
|
+
throw new Error('Failed to load document');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const markdown = await response.text();
|
|
116
|
+
const result = renderMarkdown(markdown);
|
|
117
|
+
|
|
118
|
+
content = result.html;
|
|
119
|
+
metadata = result.metadata;
|
|
120
|
+
} catch (e) {
|
|
121
|
+
error = e instanceof Error ? e.message : 'Failed to load document';
|
|
122
|
+
} finally {
|
|
123
|
+
loading = false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
$effect(() => {
|
|
128
|
+
loadContent(currentSlug);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
function isActive(slug: string): boolean {
|
|
132
|
+
return currentSlug === slug;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function toggleSidebar() {
|
|
136
|
+
sidebarOpen = !sidebarOpen;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function closeSidebar() {
|
|
140
|
+
sidebarOpen = false;
|
|
141
|
+
}
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<div class="docs-wrapper {className}">
|
|
145
|
+
<!-- Mobile toggle button - moves with sidebar -->
|
|
146
|
+
<button
|
|
147
|
+
class="docs-toggle"
|
|
148
|
+
class:sidebar-open={sidebarOpen}
|
|
149
|
+
onclick={toggleSidebar}
|
|
150
|
+
aria-label="Toggle navigation"
|
|
151
|
+
>
|
|
152
|
+
{#if sidebarOpen}
|
|
153
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
154
|
+
<path d="M18 6 6 18"></path>
|
|
155
|
+
<path d="m6 6 12 12"></path>
|
|
156
|
+
</svg>
|
|
157
|
+
{:else}
|
|
158
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
159
|
+
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
160
|
+
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
161
|
+
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
162
|
+
</svg>
|
|
163
|
+
{/if}
|
|
164
|
+
</button>
|
|
165
|
+
|
|
166
|
+
<!-- Overlay -->
|
|
167
|
+
{#if sidebarOpen}
|
|
168
|
+
<button
|
|
169
|
+
class="docs-overlay"
|
|
170
|
+
onclick={closeSidebar}
|
|
171
|
+
aria-label="Close navigation"
|
|
172
|
+
></button>
|
|
173
|
+
{/if}
|
|
174
|
+
|
|
175
|
+
<!-- Sidebar -->
|
|
176
|
+
<aside class="docs-sidebar" class:open={sidebarOpen}>
|
|
177
|
+
<div class="docs-sidebar-inner">
|
|
178
|
+
<!-- Search -->
|
|
179
|
+
<div class="docs-search">
|
|
180
|
+
<div class="docs-search-wrapper">
|
|
181
|
+
<svg class="docs-search-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
182
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
183
|
+
<path d="m21 21-4.3-4.3"></path>
|
|
184
|
+
</svg>
|
|
185
|
+
<input
|
|
186
|
+
type="text"
|
|
187
|
+
placeholder="Search docs..."
|
|
188
|
+
bind:value={searchQuery}
|
|
189
|
+
class="docs-search-input"
|
|
190
|
+
/>
|
|
191
|
+
{#if searchQuery}
|
|
192
|
+
<button
|
|
193
|
+
class="docs-search-clear"
|
|
194
|
+
onclick={() => searchQuery = ''}
|
|
195
|
+
aria-label="Clear search"
|
|
196
|
+
>
|
|
197
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
198
|
+
<path d="M18 6 6 18"></path>
|
|
199
|
+
<path d="m6 6 12 12"></path>
|
|
200
|
+
</svg>
|
|
201
|
+
</button>
|
|
202
|
+
{/if}
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
<!-- Navigation -->
|
|
207
|
+
<nav class="docs-nav">
|
|
208
|
+
{#snippet renderFolder(folder: DocFolder, depth: number = 0)}
|
|
209
|
+
{#if folder.files.length > 0 || folder.folders.length > 0}
|
|
210
|
+
{#if depth > 0}
|
|
211
|
+
<div class="docs-nav-section">
|
|
212
|
+
<h3 class="docs-nav-heading">{folder.name}</h3>
|
|
213
|
+
</div>
|
|
214
|
+
{/if}
|
|
215
|
+
|
|
216
|
+
<ul class="docs-nav-list">
|
|
217
|
+
{#each folder.files as file}
|
|
218
|
+
<li>
|
|
219
|
+
<a
|
|
220
|
+
href="{baseRoute}/{file.slug}"
|
|
221
|
+
class="docs-nav-link"
|
|
222
|
+
class:active={isActive(file.slug)}
|
|
223
|
+
onclick={closeSidebar}
|
|
224
|
+
>
|
|
225
|
+
{file.title}
|
|
226
|
+
</a>
|
|
227
|
+
</li>
|
|
228
|
+
{/each}
|
|
229
|
+
</ul>
|
|
230
|
+
|
|
231
|
+
{#each folder.folders as subFolder}
|
|
232
|
+
{@render renderFolder(subFolder, depth + 1)}
|
|
233
|
+
{/each}
|
|
234
|
+
{/if}
|
|
235
|
+
{/snippet}
|
|
236
|
+
|
|
237
|
+
{@render renderFolder(filteredStructure(), 0)}
|
|
238
|
+
|
|
239
|
+
{#if searchQuery && filteredStructure().files.length === 0 && filteredStructure().folders.length === 0}
|
|
240
|
+
<p class="docs-no-results">No results found</p>
|
|
241
|
+
{/if}
|
|
242
|
+
</nav>
|
|
243
|
+
</div>
|
|
244
|
+
</aside>
|
|
245
|
+
|
|
246
|
+
<!-- Main content -->
|
|
247
|
+
<main class="docs-content">
|
|
248
|
+
{#if loading}
|
|
249
|
+
<div class="docs-loading">
|
|
250
|
+
<div class="docs-spinner"></div>
|
|
251
|
+
<p>Loading...</p>
|
|
252
|
+
</div>
|
|
253
|
+
{:else if error}
|
|
254
|
+
<div class="docs-error">
|
|
255
|
+
<h2>Error</h2>
|
|
256
|
+
<p>{error}</p>
|
|
257
|
+
</div>
|
|
258
|
+
{:else}
|
|
259
|
+
<article class="docs-article">
|
|
260
|
+
{@html content}
|
|
261
|
+
</article>
|
|
262
|
+
{/if}
|
|
263
|
+
</main>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
<style>
|
|
267
|
+
.docs-wrapper {
|
|
268
|
+
display: flex;
|
|
269
|
+
min-height: 100vh;
|
|
270
|
+
position: relative;
|
|
271
|
+
background: var(--color-background, #0a0a0f);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* Toggle button - moves with sidebar */
|
|
275
|
+
.docs-toggle {
|
|
276
|
+
display: none;
|
|
277
|
+
position: fixed;
|
|
278
|
+
top: 3.5rem;
|
|
279
|
+
left: 1rem;
|
|
280
|
+
z-index: 50;
|
|
281
|
+
width: 2.5rem;
|
|
282
|
+
height: 2.5rem;
|
|
283
|
+
align-items: center;
|
|
284
|
+
justify-content: center;
|
|
285
|
+
background: transparent;
|
|
286
|
+
border: none;
|
|
287
|
+
color: var(--color-foreground-secondary, #a1a1aa);
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
transition: left 0.2s ease, color 0.15s;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.docs-toggle.sidebar-open {
|
|
293
|
+
left: calc(280px + 0.5rem);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.docs-toggle:hover {
|
|
297
|
+
color: var(--color-foreground, #e5e5e5);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Overlay */
|
|
301
|
+
.docs-overlay {
|
|
302
|
+
display: none;
|
|
303
|
+
position: fixed;
|
|
304
|
+
inset: 0;
|
|
305
|
+
background: rgba(0, 0, 0, 0.6);
|
|
306
|
+
z-index: 30;
|
|
307
|
+
border: none;
|
|
308
|
+
cursor: pointer;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Sidebar */
|
|
312
|
+
.docs-sidebar {
|
|
313
|
+
width: 280px;
|
|
314
|
+
flex-shrink: 0;
|
|
315
|
+
background: var(--color-surface, #1a1a2e);
|
|
316
|
+
border-right: 1px solid var(--color-border, #2a2a3e);
|
|
317
|
+
position: sticky;
|
|
318
|
+
top: 0;
|
|
319
|
+
height: 100vh;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.docs-sidebar-inner {
|
|
323
|
+
display: flex;
|
|
324
|
+
flex-direction: column;
|
|
325
|
+
height: 100%;
|
|
326
|
+
overflow: hidden;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* Search */
|
|
330
|
+
.docs-search {
|
|
331
|
+
padding: 1rem;
|
|
332
|
+
border-bottom: 1px solid var(--color-border, #2a2a3e);
|
|
333
|
+
flex-shrink: 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.docs-search-wrapper {
|
|
337
|
+
position: relative;
|
|
338
|
+
display: flex;
|
|
339
|
+
align-items: center;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.docs-search-icon {
|
|
343
|
+
position: absolute;
|
|
344
|
+
left: 0.75rem;
|
|
345
|
+
color: var(--color-foreground-tertiary, #6b7280);
|
|
346
|
+
pointer-events: none;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.docs-search-input {
|
|
350
|
+
width: 100%;
|
|
351
|
+
padding: 0.5rem 2rem 0.5rem 2.25rem;
|
|
352
|
+
border: 1px solid var(--color-border, #2a2a3e);
|
|
353
|
+
border-radius: 0.5rem;
|
|
354
|
+
background: var(--color-background, #0a0a0f);
|
|
355
|
+
color: var(--color-foreground, #e5e5e5);
|
|
356
|
+
font-size: 0.875rem;
|
|
357
|
+
outline: none;
|
|
358
|
+
transition: border-color 0.15s;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.docs-search-input:focus {
|
|
362
|
+
border-color: var(--color-primary, #60a5fa);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.docs-search-input::placeholder {
|
|
366
|
+
color: var(--color-foreground-tertiary, #6b7280);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.docs-search-clear {
|
|
370
|
+
position: absolute;
|
|
371
|
+
right: 0.5rem;
|
|
372
|
+
padding: 0.25rem;
|
|
373
|
+
background: transparent;
|
|
374
|
+
border: none;
|
|
375
|
+
cursor: pointer;
|
|
376
|
+
color: var(--color-foreground-tertiary, #6b7280);
|
|
377
|
+
border-radius: 0.25rem;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.docs-search-clear:hover {
|
|
381
|
+
color: var(--color-foreground, #e5e5e5);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/* Navigation */
|
|
385
|
+
.docs-nav {
|
|
386
|
+
flex: 1;
|
|
387
|
+
overflow-y: auto;
|
|
388
|
+
padding: 1rem;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.docs-nav-section {
|
|
392
|
+
margin-top: 1.5rem;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.docs-nav-section:first-child {
|
|
396
|
+
margin-top: 0;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.docs-nav-heading {
|
|
400
|
+
font-size: 0.75rem;
|
|
401
|
+
font-weight: 600;
|
|
402
|
+
text-transform: uppercase;
|
|
403
|
+
letter-spacing: 0.05em;
|
|
404
|
+
color: var(--color-foreground-tertiary, #6b7280);
|
|
405
|
+
margin-bottom: 0.5rem;
|
|
406
|
+
padding: 0 0.75rem;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.docs-nav-list {
|
|
410
|
+
list-style: none;
|
|
411
|
+
padding: 0;
|
|
412
|
+
margin: 0;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.docs-nav-link {
|
|
416
|
+
display: block;
|
|
417
|
+
padding: 0.5rem 0.75rem;
|
|
418
|
+
border-radius: 0.375rem;
|
|
419
|
+
font-size: 0.875rem;
|
|
420
|
+
color: var(--color-foreground-secondary, #a1a1aa);
|
|
421
|
+
text-decoration: none;
|
|
422
|
+
transition: all 0.15s;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.docs-nav-link:hover {
|
|
426
|
+
background: var(--color-surface-hover, #252538);
|
|
427
|
+
color: var(--color-foreground, #e5e5e5);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.docs-nav-link.active {
|
|
431
|
+
background: var(--color-primary, #60a5fa);
|
|
432
|
+
color: white;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.docs-no-results {
|
|
436
|
+
padding: 1rem;
|
|
437
|
+
text-align: center;
|
|
438
|
+
color: var(--color-foreground-tertiary, #6b7280);
|
|
439
|
+
font-size: 0.875rem;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* Content */
|
|
443
|
+
.docs-content {
|
|
444
|
+
flex: 1;
|
|
445
|
+
min-width: 0;
|
|
446
|
+
padding: 2rem 3rem;
|
|
447
|
+
max-width: 900px;
|
|
448
|
+
overflow-y: auto;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.docs-loading,
|
|
452
|
+
.docs-error {
|
|
453
|
+
display: flex;
|
|
454
|
+
flex-direction: column;
|
|
455
|
+
align-items: center;
|
|
456
|
+
justify-content: center;
|
|
457
|
+
padding: 4rem;
|
|
458
|
+
color: var(--color-foreground-tertiary, #6b7280);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.docs-spinner {
|
|
462
|
+
width: 2rem;
|
|
463
|
+
height: 2rem;
|
|
464
|
+
border: 2px solid var(--color-border, #2a2a3e);
|
|
465
|
+
border-top-color: var(--color-primary, #60a5fa);
|
|
466
|
+
border-radius: 50%;
|
|
467
|
+
animation: spin 0.8s linear infinite;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
@keyframes spin {
|
|
471
|
+
to { transform: rotate(360deg); }
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.docs-error h2 {
|
|
475
|
+
color: var(--color-danger, #ef4444);
|
|
476
|
+
margin-bottom: 0.5rem;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* Article styles */
|
|
480
|
+
.docs-article {
|
|
481
|
+
color: var(--color-foreground, #e5e5e5);
|
|
482
|
+
line-height: 1.75;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.docs-article :global(h1) {
|
|
486
|
+
font-size: 2rem;
|
|
487
|
+
font-weight: 700;
|
|
488
|
+
margin-bottom: 1rem;
|
|
489
|
+
color: var(--color-foreground, #f5f5f5);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.docs-article :global(h2) {
|
|
493
|
+
font-size: 1.5rem;
|
|
494
|
+
font-weight: 600;
|
|
495
|
+
margin-top: 2.5rem;
|
|
496
|
+
margin-bottom: 1rem;
|
|
497
|
+
padding-bottom: 0.5rem;
|
|
498
|
+
border-bottom: 1px solid var(--color-border, #2a2a3e);
|
|
499
|
+
color: var(--color-foreground, #f5f5f5);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.docs-article :global(h3) {
|
|
503
|
+
font-size: 1.25rem;
|
|
504
|
+
font-weight: 600;
|
|
505
|
+
margin-top: 2rem;
|
|
506
|
+
margin-bottom: 0.75rem;
|
|
507
|
+
color: var(--color-foreground, #f5f5f5);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.docs-article :global(p) {
|
|
511
|
+
margin-bottom: 1.25rem;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.docs-article :global(a) {
|
|
515
|
+
color: var(--color-primary, #60a5fa);
|
|
516
|
+
text-decoration: none;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.docs-article :global(a:hover) {
|
|
520
|
+
text-decoration: underline;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.docs-article :global(code) {
|
|
524
|
+
font-family: ui-monospace, monospace;
|
|
525
|
+
font-size: 0.875em;
|
|
526
|
+
background: var(--color-surface, #1a1a2e);
|
|
527
|
+
padding: 0.125rem 0.375rem;
|
|
528
|
+
border-radius: 0.25rem;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.docs-article :global(pre) {
|
|
532
|
+
background: var(--color-surface, #1a1a2e);
|
|
533
|
+
color: #e2e8f0;
|
|
534
|
+
padding: 1rem;
|
|
535
|
+
border-radius: 0.5rem;
|
|
536
|
+
overflow-x: auto;
|
|
537
|
+
margin: 1.5rem 0;
|
|
538
|
+
border: 1px solid var(--color-border, #2a2a3e);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.docs-article :global(pre code) {
|
|
542
|
+
background: transparent;
|
|
543
|
+
padding: 0;
|
|
544
|
+
font-size: 0.875rem;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.docs-article :global(ul),
|
|
548
|
+
.docs-article :global(ol) {
|
|
549
|
+
margin-bottom: 1.25rem;
|
|
550
|
+
padding-left: 1.5rem;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.docs-article :global(li) {
|
|
554
|
+
margin-bottom: 0.5rem;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.docs-article :global(blockquote) {
|
|
558
|
+
border-left: 4px solid var(--color-primary, #60a5fa);
|
|
559
|
+
padding-left: 1rem;
|
|
560
|
+
margin: 1.5rem 0;
|
|
561
|
+
color: var(--color-foreground-secondary, #a1a1aa);
|
|
562
|
+
font-style: italic;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.docs-article :global(table) {
|
|
566
|
+
width: 100%;
|
|
567
|
+
border-collapse: collapse;
|
|
568
|
+
margin: 1.5rem 0;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.docs-article :global(th),
|
|
572
|
+
.docs-article :global(td) {
|
|
573
|
+
padding: 0.75rem;
|
|
574
|
+
border: 1px solid var(--color-border, #2a2a3e);
|
|
575
|
+
text-align: left;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.docs-article :global(th) {
|
|
579
|
+
background: var(--color-surface, #1a1a2e);
|
|
580
|
+
font-weight: 600;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/* Mobile responsive */
|
|
584
|
+
@media (max-width: 768px) {
|
|
585
|
+
.docs-toggle {
|
|
586
|
+
display: flex;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.docs-overlay {
|
|
590
|
+
display: block;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.docs-sidebar {
|
|
594
|
+
position: fixed;
|
|
595
|
+
left: 0;
|
|
596
|
+
top: 0;
|
|
597
|
+
bottom: 0;
|
|
598
|
+
z-index: 40;
|
|
599
|
+
transform: translateX(-100%);
|
|
600
|
+
transition: transform 0.2s ease;
|
|
601
|
+
padding-top: var(--docs-header-height, 2.5rem);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.docs-sidebar.open {
|
|
605
|
+
transform: translateX(0);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.docs-content {
|
|
609
|
+
padding: 1rem;
|
|
610
|
+
padding-top: 4rem;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.docs-article :global(h1) {
|
|
614
|
+
font-size: 1.5rem;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.docs-article :global(h2) {
|
|
618
|
+
font-size: 1.25rem;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.docs-article :global(h3) {
|
|
622
|
+
font-size: 1.1rem;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.docs-article :global(pre) {
|
|
626
|
+
font-size: 0.8rem;
|
|
627
|
+
padding: 0.75rem;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.docs-article :global(table) {
|
|
631
|
+
font-size: 0.875rem;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.docs-article :global(th),
|
|
635
|
+
.docs-article :global(td) {
|
|
636
|
+
padding: 0.5rem;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image component with caption support
|
|
3
|
+
* Provides responsive images with optional captions and alt text
|
|
4
|
+
*/
|
|
5
|
+
interface Props {
|
|
6
|
+
src: string;
|
|
7
|
+
alt: string;
|
|
8
|
+
caption?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
zoomable?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const Image: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type Image = ReturnType<typeof Image>;
|
|
15
|
+
export default Image;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { theme } from '
|
|
3
|
-
import { sidebarOpen } from '
|
|
4
|
-
import { version } from '
|
|
5
|
-
import { i18n } from '
|
|
2
|
+
import { theme } from '../stores/theme';
|
|
3
|
+
import { sidebarOpen } from '../stores/nav';
|
|
4
|
+
import { version } from '../stores/version';
|
|
5
|
+
import { i18n } from '../stores/i18n';
|
|
6
6
|
import { onMount } from 'svelte';
|
|
7
7
|
|
|
8
8
|
let {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
title?: string;
|
|
3
|
+
logo?: string | null;
|
|
4
|
+
onLogoClick?: () => void;
|
|
5
|
+
onVersionChange?: (version: string) => void;
|
|
6
|
+
onLanguageChange?: (language: string) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const Navbar: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type Navbar = ReturnType<typeof Navbar>;
|
|
10
|
+
export default Navbar;
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
initPagefind,
|
|
9
9
|
updateSearch,
|
|
10
10
|
clearSearch
|
|
11
|
-
} from '
|
|
12
|
-
import { highlightSearchTerms, extractExcerpt } from '
|
|
11
|
+
} from '../stores/search';
|
|
12
|
+
import { highlightSearchTerms, extractExcerpt } from '../utils/highlight';
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
15
|
showResults?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { NavSection, NavItem } from '
|
|
3
|
-
import { sidebarOpen } from '
|
|
2
|
+
import type { NavSection, NavItem } from '../stores/nav';
|
|
3
|
+
import { sidebarOpen } from '../stores/nav';
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
sections = [] as NavSection[],
|