svedocs 0.1.0-beta.10
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/LICENSE +5 -0
- package/README.md +85 -0
- package/dist/ai/openai-compatible.d.ts +13 -0
- package/dist/ai/openai-compatible.d.ts.map +1 -0
- package/dist/ai/openai-compatible.js +92 -0
- package/dist/ai/providers.d.ts +20 -0
- package/dist/ai/providers.d.ts.map +1 -0
- package/dist/ai/providers.js +185 -0
- package/dist/ai/rate-limit.d.ts +18 -0
- package/dist/ai/rate-limit.d.ts.map +1 -0
- package/dist/ai/rate-limit.js +52 -0
- package/dist/ai/response.d.ts +4 -0
- package/dist/ai/response.d.ts.map +1 -0
- package/dist/ai/response.js +151 -0
- package/dist/ai/runtime.d.ts +32 -0
- package/dist/ai/runtime.d.ts.map +1 -0
- package/dist/ai/runtime.js +111 -0
- package/dist/ai/types.d.ts +93 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +1 -0
- package/dist/ai.d.ts +7 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +6 -0
- package/dist/ambient.d.ts +5 -0
- package/dist/cloudflare.d.ts +29 -0
- package/dist/cloudflare.d.ts.map +1 -0
- package/dist/cloudflare.js +149 -0
- package/dist/config.d.ts +373 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +299 -0
- package/dist/core/checks.d.ts +4 -0
- package/dist/core/checks.d.ts.map +1 -0
- package/dist/core/checks.js +267 -0
- package/dist/core/config.d.ts +6 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +178 -0
- package/dist/core/content.d.ts +7 -0
- package/dist/core/content.d.ts.map +1 -0
- package/dist/core/content.js +340 -0
- package/dist/core/i18n.d.ts +5 -0
- package/dist/core/i18n.d.ts.map +1 -0
- package/dist/core/i18n.js +117 -0
- package/dist/core/links.d.ts +5 -0
- package/dist/core/links.d.ts.map +1 -0
- package/dist/core/links.js +60 -0
- package/dist/core/messages.d.ts +149 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +163 -0
- package/dist/core/navigation.d.ts +5 -0
- package/dist/core/navigation.d.ts.map +1 -0
- package/dist/core/navigation.js +144 -0
- package/dist/core/routes.d.ts +36 -0
- package/dist/core/routes.d.ts.map +1 -0
- package/dist/core/routes.js +152 -0
- package/dist/core/search.d.ts +5 -0
- package/dist/core/search.d.ts.map +1 -0
- package/dist/core/search.js +41 -0
- package/dist/core/types.d.ts +468 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +4 -0
- package/dist/core/utils.d.ts +13 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +60 -0
- package/dist/core.d.ts +9 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/mdx/ast.d.ts +32 -0
- package/dist/mdx/ast.d.ts.map +1 -0
- package/dist/mdx/ast.js +148 -0
- package/dist/mdx/code.d.ts +17 -0
- package/dist/mdx/code.d.ts.map +1 -0
- package/dist/mdx/code.js +327 -0
- package/dist/mdx/compile.d.ts +29 -0
- package/dist/mdx/compile.d.ts.map +1 -0
- package/dist/mdx/compile.js +59 -0
- package/dist/mdx/diff.d.ts +9 -0
- package/dist/mdx/diff.d.ts.map +1 -0
- package/dist/mdx/diff.js +171 -0
- package/dist/mdx/headings.d.ts +4 -0
- package/dist/mdx/headings.d.ts.map +1 -0
- package/dist/mdx/headings.js +42 -0
- package/dist/mdx/links.d.ts +4 -0
- package/dist/mdx/links.d.ts.map +1 -0
- package/dist/mdx/links.js +144 -0
- package/dist/mdx/utils.d.ts +10 -0
- package/dist/mdx/utils.d.ts.map +1 -0
- package/dist/mdx/utils.js +64 -0
- package/dist/og/image.d.ts +25 -0
- package/dist/og/image.d.ts.map +1 -0
- package/dist/og/image.js +224 -0
- package/dist/og/metadata.d.ts +7 -0
- package/dist/og/metadata.d.ts.map +1 -0
- package/dist/og/metadata.js +198 -0
- package/dist/og/response.d.ts +4 -0
- package/dist/og/response.d.ts.map +1 -0
- package/dist/og/response.js +49 -0
- package/dist/og/rss.d.ts +4 -0
- package/dist/og/rss.d.ts.map +1 -0
- package/dist/og/rss.js +96 -0
- package/dist/og/sitemap.d.ts +7 -0
- package/dist/og/sitemap.d.ts.map +1 -0
- package/dist/og/sitemap.js +90 -0
- package/dist/og/types.d.ts +65 -0
- package/dist/og/types.d.ts.map +1 -0
- package/dist/og/types.js +1 -0
- package/dist/og.d.ts +6 -0
- package/dist/og.d.ts.map +1 -0
- package/dist/og.js +5 -0
- package/dist/routes.d.ts +2 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +1 -0
- package/dist/search/algolia.d.ts +10 -0
- package/dist/search/algolia.d.ts.map +1 -0
- package/dist/search/algolia.js +82 -0
- package/dist/search/cloudflare-sync.d.ts +5 -0
- package/dist/search/cloudflare-sync.d.ts.map +1 -0
- package/dist/search/cloudflare-sync.js +169 -0
- package/dist/search/cloudflare.d.ts +11 -0
- package/dist/search/cloudflare.d.ts.map +1 -0
- package/dist/search/cloudflare.js +126 -0
- package/dist/search/local.d.ts +9 -0
- package/dist/search/local.d.ts.map +1 -0
- package/dist/search/local.js +165 -0
- package/dist/search/runtime.d.ts +41 -0
- package/dist/search/runtime.d.ts.map +1 -0
- package/dist/search/runtime.js +152 -0
- package/dist/search/types.d.ts +172 -0
- package/dist/search/types.d.ts.map +1 -0
- package/dist/search/types.js +1 -0
- package/dist/search/typesense.d.ts +11 -0
- package/dist/search/typesense.d.ts.map +1 -0
- package/dist/search/typesense.js +91 -0
- package/dist/search/utils.d.ts +11 -0
- package/dist/search/utils.d.ts.map +1 -0
- package/dist/search/utils.js +93 -0
- package/dist/search.d.ts +8 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +7 -0
- package/dist/svelte.d.ts +27 -0
- package/dist/svelte.d.ts.map +1 -0
- package/dist/svelte.js +45 -0
- package/dist/testing.d.ts +3 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +23 -0
- package/dist/theme/Article.svelte +145 -0
- package/dist/theme/Article.svelte.d.ts +36 -0
- package/dist/theme/Article.svelte.d.ts.map +1 -0
- package/dist/theme/AskAiPanel.svelte +241 -0
- package/dist/theme/AskAiPanel.svelte.d.ts +31 -0
- package/dist/theme/AskAiPanel.svelte.d.ts.map +1 -0
- package/dist/theme/Brand.svelte +19 -0
- package/dist/theme/Brand.svelte.d.ts +22 -0
- package/dist/theme/Brand.svelte.d.ts.map +1 -0
- package/dist/theme/Button.svelte +34 -0
- package/dist/theme/Button.svelte.d.ts +41 -0
- package/dist/theme/Button.svelte.d.ts.map +1 -0
- package/dist/theme/Checkbox.svelte +63 -0
- package/dist/theme/Checkbox.svelte.d.ts +45 -0
- package/dist/theme/Checkbox.svelte.d.ts.map +1 -0
- package/dist/theme/CodeBlock.svelte +6 -0
- package/dist/theme/CodeBlock.svelte.d.ts +22 -0
- package/dist/theme/CodeBlock.svelte.d.ts.map +1 -0
- package/dist/theme/DocPage.svelte +15 -0
- package/dist/theme/DocPage.svelte.d.ts +33 -0
- package/dist/theme/DocPage.svelte.d.ts.map +1 -0
- package/dist/theme/DocsApp.svelte +194 -0
- package/dist/theme/DocsApp.svelte.d.ts +60 -0
- package/dist/theme/DocsApp.svelte.d.ts.map +1 -0
- package/dist/theme/DocsLayout.svelte +99 -0
- package/dist/theme/DocsLayout.svelte.d.ts +39 -0
- package/dist/theme/DocsLayout.svelte.d.ts.map +1 -0
- package/dist/theme/DocsShell.svelte +91 -0
- package/dist/theme/DocsShell.svelte.d.ts +34 -0
- package/dist/theme/DocsShell.svelte.d.ts.map +1 -0
- package/dist/theme/ErrorPage.svelte +113 -0
- package/dist/theme/ErrorPage.svelte.d.ts +34 -0
- package/dist/theme/ErrorPage.svelte.d.ts.map +1 -0
- package/dist/theme/FloatingToolbar.svelte +8 -0
- package/dist/theme/FloatingToolbar.svelte.d.ts +22 -0
- package/dist/theme/FloatingToolbar.svelte.d.ts.map +1 -0
- package/dist/theme/Footer.svelte +18 -0
- package/dist/theme/Footer.svelte.d.ts +24 -0
- package/dist/theme/Footer.svelte.d.ts.map +1 -0
- package/dist/theme/FooterLinks.svelte +37 -0
- package/dist/theme/FooterLinks.svelte.d.ts +22 -0
- package/dist/theme/FooterLinks.svelte.d.ts.map +1 -0
- package/dist/theme/FormField.svelte +41 -0
- package/dist/theme/FormField.svelte.d.ts +35 -0
- package/dist/theme/FormField.svelte.d.ts.map +1 -0
- package/dist/theme/HomePage.svelte +284 -0
- package/dist/theme/HomePage.svelte.d.ts +65 -0
- package/dist/theme/HomePage.svelte.d.ts.map +1 -0
- package/dist/theme/Input.svelte +36 -0
- package/dist/theme/Input.svelte.d.ts +34 -0
- package/dist/theme/Input.svelte.d.ts.map +1 -0
- package/dist/theme/LayoutShell.svelte +120 -0
- package/dist/theme/LayoutShell.svelte.d.ts +43 -0
- package/dist/theme/LayoutShell.svelte.d.ts.map +1 -0
- package/dist/theme/LocalizedLink.svelte +21 -0
- package/dist/theme/LocalizedLink.svelte.d.ts +38 -0
- package/dist/theme/LocalizedLink.svelte.d.ts.map +1 -0
- package/dist/theme/MobileNav.svelte +20 -0
- package/dist/theme/MobileNav.svelte.d.ts +26 -0
- package/dist/theme/MobileNav.svelte.d.ts.map +1 -0
- package/dist/theme/Navbar.svelte +69 -0
- package/dist/theme/Navbar.svelte.d.ts +29 -0
- package/dist/theme/Navbar.svelte.d.ts.map +1 -0
- package/dist/theme/PageLayout.svelte +49 -0
- package/dist/theme/PageLayout.svelte.d.ts +34 -0
- package/dist/theme/PageLayout.svelte.d.ts.map +1 -0
- package/dist/theme/PageShell.svelte +98 -0
- package/dist/theme/PageShell.svelte.d.ts +35 -0
- package/dist/theme/PageShell.svelte.d.ts.map +1 -0
- package/dist/theme/PageTools.svelte +87 -0
- package/dist/theme/PageTools.svelte.d.ts +25 -0
- package/dist/theme/PageTools.svelte.d.ts.map +1 -0
- package/dist/theme/RenderError.svelte +62 -0
- package/dist/theme/RenderError.svelte.d.ts +31 -0
- package/dist/theme/RenderError.svelte.d.ts.map +1 -0
- package/dist/theme/RootLayout.svelte +274 -0
- package/dist/theme/RootLayout.svelte.d.ts +47 -0
- package/dist/theme/RootLayout.svelte.d.ts.map +1 -0
- package/dist/theme/RouteRenderError.svelte +53 -0
- package/dist/theme/RouteRenderError.svelte.d.ts +34 -0
- package/dist/theme/RouteRenderError.svelte.d.ts.map +1 -0
- package/dist/theme/SafeRenderError.svelte +49 -0
- package/dist/theme/SafeRenderError.svelte.d.ts +33 -0
- package/dist/theme/SafeRenderError.svelte.d.ts.map +1 -0
- package/dist/theme/ScopeSwitcher.svelte +107 -0
- package/dist/theme/ScopeSwitcher.svelte.d.ts +26 -0
- package/dist/theme/ScopeSwitcher.svelte.d.ts.map +1 -0
- package/dist/theme/SearchDialog.svelte +200 -0
- package/dist/theme/SearchDialog.svelte.d.ts +31 -0
- package/dist/theme/SearchDialog.svelte.d.ts.map +1 -0
- package/dist/theme/Select.svelte +37 -0
- package/dist/theme/Select.svelte.d.ts +42 -0
- package/dist/theme/Select.svelte.d.ts.map +1 -0
- package/dist/theme/SidebarTree.svelte +148 -0
- package/dist/theme/SidebarTree.svelte.d.ts +24 -0
- package/dist/theme/SidebarTree.svelte.d.ts.map +1 -0
- package/dist/theme/SocialNav.svelte +17 -0
- package/dist/theme/SocialNav.svelte.d.ts +22 -0
- package/dist/theme/SocialNav.svelte.d.ts.map +1 -0
- package/dist/theme/TableOfContents.svelte +73 -0
- package/dist/theme/TableOfContents.svelte.d.ts +25 -0
- package/dist/theme/TableOfContents.svelte.d.ts.map +1 -0
- package/dist/theme/Textarea.svelte +33 -0
- package/dist/theme/Textarea.svelte.d.ts +33 -0
- package/dist/theme/Textarea.svelte.d.ts.map +1 -0
- package/dist/theme/ThemeInit.svelte +16 -0
- package/dist/theme/ThemeInit.svelte.d.ts +23 -0
- package/dist/theme/ThemeInit.svelte.d.ts.map +1 -0
- package/dist/theme/ThemeToggle.svelte +37 -0
- package/dist/theme/ThemeToggle.svelte.d.ts +23 -0
- package/dist/theme/ThemeToggle.svelte.d.ts.map +1 -0
- package/dist/theme/TopNav.svelte +23 -0
- package/dist/theme/TopNav.svelte.d.ts +22 -0
- package/dist/theme/TopNav.svelte.d.ts.map +1 -0
- package/dist/theme/base.css +240 -0
- package/dist/theme/defaults.d.ts +4 -0
- package/dist/theme/defaults.d.ts.map +1 -0
- package/dist/theme/defaults.js +55 -0
- package/dist/theme/forms.d.ts +4 -0
- package/dist/theme/forms.d.ts.map +1 -0
- package/dist/theme/forms.js +3 -0
- package/dist/theme/headless.d.ts +62 -0
- package/dist/theme/headless.d.ts.map +1 -0
- package/dist/theme/headless.js +1064 -0
- package/dist/theme/index.d.ts +41 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +38 -0
- package/dist/theme/portal.d.ts +6 -0
- package/dist/theme/portal.d.ts.map +1 -0
- package/dist/theme/portal.js +59 -0
- package/dist/theme/styles.css +4232 -0
- package/dist/theme/types.d.ts +363 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +1 -0
- package/dist/virtual.d.ts +65 -0
- package/dist/vite.d.ts +16 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +386 -0
- package/package.json +132 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField.svelte.d.ts","sourceRoot":"","sources":["../../src/theme/FormField.svelte.ts"],"names":[],"mappings":"AAiDA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,SAAS;YAtDH,MAAM;kBACA,MAAM;YACZ,MAAM;UACR,MAAM;YACJ,MAAM;eACH,OAAO;;;;;;;cAiD8E,CAAC;AACnF,KAAK,SAAS,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
import type { SvedocsMessageKey, SvedocsPage, SvedocsResolvedConfig, SvedocsSearchRecord, SvedocsTreeItem } from '../core/types.js';
|
|
4
|
+
import { createThemeContext, resolveLocalizedHref, resolveLocalizedText } from './headless.js';
|
|
5
|
+
import SafeRenderError from './SafeRenderError.svelte';
|
|
6
|
+
import RootLayout from './RootLayout.svelte';
|
|
7
|
+
import ThemeInit from './ThemeInit.svelte';
|
|
8
|
+
import type { SvedocsThemeComponentMap } from './types.js';
|
|
9
|
+
|
|
10
|
+
export let page: SvedocsPage;
|
|
11
|
+
export let pages: SvedocsPage[] = [];
|
|
12
|
+
export let tree: SvedocsTreeItem[] = [];
|
|
13
|
+
export let search: SvedocsSearchRecord[] = [];
|
|
14
|
+
export let config: SvedocsResolvedConfig;
|
|
15
|
+
export let loadSearch: (() => Promise<SvedocsSearchRecord[]>) | undefined = undefined;
|
|
16
|
+
export let content: Component | undefined = undefined;
|
|
17
|
+
export let hasBackgroundSlot: boolean | undefined = undefined;
|
|
18
|
+
export let hasLandingSlot: boolean | undefined = undefined;
|
|
19
|
+
export let hasHomeHeroVisualSlot: boolean | undefined = undefined;
|
|
20
|
+
export let hasHomeFeaturesSlot: boolean | undefined = undefined;
|
|
21
|
+
export let themeComponents: Partial<SvedocsThemeComponentMap> = {};
|
|
22
|
+
|
|
23
|
+
interface PixelCell {
|
|
24
|
+
index: number;
|
|
25
|
+
hot: boolean;
|
|
26
|
+
accent: boolean;
|
|
27
|
+
style: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface HomeCard {
|
|
31
|
+
label: string;
|
|
32
|
+
title: string;
|
|
33
|
+
description: string;
|
|
34
|
+
href: string;
|
|
35
|
+
glyph: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type HomePillarKey = 'start' | 'install' | 'write' | 'integrate';
|
|
39
|
+
|
|
40
|
+
const homePillars = [
|
|
41
|
+
{
|
|
42
|
+
key: 'start',
|
|
43
|
+
glyph: '1011\n1101\n0110\n1011',
|
|
44
|
+
match: /quick\s*start|getting-started|index/i,
|
|
45
|
+
fallback: '/docs'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: 'install',
|
|
49
|
+
glyph: '0110\n1111\n1001\n0110',
|
|
50
|
+
match: /installation/i,
|
|
51
|
+
fallback: '/docs/installation'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: 'write',
|
|
55
|
+
glyph: '1010\n0101\n1010\n0101',
|
|
56
|
+
match: /writing|content|components/i,
|
|
57
|
+
fallback: '/docs/writing'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: 'integrate',
|
|
61
|
+
glyph: '1111\n1001\n1001\n1111',
|
|
62
|
+
match: /integrations|search|ai|cloudflare|seo|og/i,
|
|
63
|
+
fallback: '/docs/integrations'
|
|
64
|
+
}
|
|
65
|
+
] satisfies Array<{
|
|
66
|
+
key: HomePillarKey;
|
|
67
|
+
glyph: string;
|
|
68
|
+
match: RegExp;
|
|
69
|
+
fallback: string;
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
// Hand-tuned bitmap (14 cols × 9 rows) — pixel-art glyph forming a soft "S" mark
|
|
73
|
+
// with scattered ambient cells. 1 = on, 2 = accent-2 hot, 0 = ambient.
|
|
74
|
+
const heroBitmap = [
|
|
75
|
+
'00011112221100',
|
|
76
|
+
'00111111111110',
|
|
77
|
+
'01110000000110',
|
|
78
|
+
'01111000000000',
|
|
79
|
+
'00111122100000',
|
|
80
|
+
'00000022111100',
|
|
81
|
+
'00000000001110',
|
|
82
|
+
'01100000001110',
|
|
83
|
+
'01111122211100'
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
const cells: PixelCell[] = (() => {
|
|
87
|
+
const result: PixelCell[] = [];
|
|
88
|
+
heroBitmap.forEach((row, y) => {
|
|
89
|
+
const chars = row.split('');
|
|
90
|
+
chars.forEach((ch, x) => {
|
|
91
|
+
const lit = ch !== '0';
|
|
92
|
+
const accent = ch === '2';
|
|
93
|
+
const distance = Math.hypot(x - 6.5, y - 4) / 7;
|
|
94
|
+
const mix = lit ? 78 - Math.floor(distance * 32) : 14 + ((x + y) % 5) * 3;
|
|
95
|
+
const delay = ((x * 73 + y * 41) % 9) * -260;
|
|
96
|
+
result.push({
|
|
97
|
+
index: y * chars.length + x,
|
|
98
|
+
hot: lit,
|
|
99
|
+
accent,
|
|
100
|
+
style: `--mix:${mix}%; --wave-delay:${delay}ms;`
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
return result;
|
|
105
|
+
})();
|
|
106
|
+
$: context = createThemeContext({ config, page, pages, tree, search, ...(loadSearch ? { loadSearch } : {}) });
|
|
107
|
+
$: docPages = pages.filter((item) => item.kind === 'doc' && isCurrentLocalePage(item));
|
|
108
|
+
$: homeCards = createHomeCards(docPages);
|
|
109
|
+
$: primaryDoc = docPages[0];
|
|
110
|
+
$: secondaryDoc = docPages.find((doc) => /configuration|config/i.test(doc.routePath)) ?? docPages[1];
|
|
111
|
+
$: primaryAction = resolveHomeAction(config.theme.home.primaryAction ?? (
|
|
112
|
+
primaryDoc
|
|
113
|
+
? { label: context.t('home.primaryAction'), href: primaryDoc.routePath }
|
|
114
|
+
: { label: context.t('home.primaryAction'), href: page.routePath }
|
|
115
|
+
));
|
|
116
|
+
$: secondaryAction = resolveHomeAction(config.theme.home.secondaryAction ?? (
|
|
117
|
+
secondaryDoc ? { label: secondaryDoc.title, href: secondaryDoc.routePath } : undefined
|
|
118
|
+
));
|
|
119
|
+
$: kicker = resolveLocalizedText(
|
|
120
|
+
config.theme.home.kicker,
|
|
121
|
+
config.theme.home.kickerKey ?? (config.theme.home.kicker === 'SvelteKit-native docs' ? 'home.kicker' : undefined),
|
|
122
|
+
context
|
|
123
|
+
);
|
|
124
|
+
$: visualAlt = resolveLocalizedText(config.theme.home.visual.alt, config.theme.home.visual.altKey, context);
|
|
125
|
+
$: showBackgroundSlot = hasBackgroundSlot ?? Boolean($$slots.background);
|
|
126
|
+
$: showLandingSlot = hasLandingSlot ?? Boolean($$slots.landing);
|
|
127
|
+
$: showHomeHeroVisualSlot = hasHomeHeroVisualSlot ?? Boolean($$slots['home-hero-visual']);
|
|
128
|
+
$: showHomeFeaturesSlot = hasHomeFeaturesSlot ?? Boolean($$slots['home-features']);
|
|
129
|
+
$: Root = themeComponents.Root ?? RootLayout;
|
|
130
|
+
$: ErrorComponent = SafeRenderError;
|
|
131
|
+
|
|
132
|
+
function createHomeCards(docs: SvedocsPage[]): HomeCard[] {
|
|
133
|
+
const fallbackDoc = docs[0];
|
|
134
|
+
|
|
135
|
+
return homePillars.map((pillar) => {
|
|
136
|
+
const target = docs.find((candidate) => pillar.match.test(`${candidate.title} ${candidate.scopePath}`));
|
|
137
|
+
const fallbackTarget = docs.find((candidate) => candidate.scopePath === pillar.fallback);
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
label: context.t(homeMessageKey(pillar.key, 'label')),
|
|
141
|
+
title: context.t(homeMessageKey(pillar.key, 'title')),
|
|
142
|
+
description: context.t(homeMessageKey(pillar.key, 'description')),
|
|
143
|
+
glyph: pillar.glyph,
|
|
144
|
+
href: target?.routePath ?? fallbackTarget?.routePath ?? fallbackDoc?.routePath ?? page.routePath
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function homeMessageKey(key: HomePillarKey, field: 'label' | 'title' | 'description'): SvedocsMessageKey {
|
|
150
|
+
return `home.card.${key}.${field}` as SvedocsMessageKey;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function resolveHomeAction(action: { label: string; labelKey?: string; href: string } | undefined) {
|
|
154
|
+
if (!action) return undefined;
|
|
155
|
+
return {
|
|
156
|
+
label: resolveLocalizedText(action.label, action.labelKey, context),
|
|
157
|
+
href: resolveLocalizedHref(action.href, context)
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function isCurrentLocalePage(candidate: SvedocsPage): boolean {
|
|
162
|
+
const candidateLocale = candidate.locale ?? config.i18n.defaultLocale ?? 'en';
|
|
163
|
+
return candidateLocale === context.localeCode;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function glyphRows(glyph: string): string[][] {
|
|
167
|
+
return glyph.split('\n').map((row) => row.split(''));
|
|
168
|
+
}
|
|
169
|
+
</script>
|
|
170
|
+
|
|
171
|
+
{#if Root !== RootLayout}
|
|
172
|
+
<ThemeInit
|
|
173
|
+
defaultMode={config.theme.defaultMode}
|
|
174
|
+
languageTag={context.languageTag}
|
|
175
|
+
dir={context.locale?.dir ?? 'ltr'}
|
|
176
|
+
/>
|
|
177
|
+
{/if}
|
|
178
|
+
|
|
179
|
+
<svelte:component this={Root} {config} {page} {pages} {tree} {search} {loadSearch} hasBackgroundSlot={showBackgroundSlot} {themeComponents}>
|
|
180
|
+
<svelte:fragment slot="background">
|
|
181
|
+
<slot name="background" />
|
|
182
|
+
</svelte:fragment>
|
|
183
|
+
{#if showLandingSlot}
|
|
184
|
+
<main id="content" class="sd-home">
|
|
185
|
+
<slot name="landing" {page} {pages} {tree} {search} {config} {content} {context} />
|
|
186
|
+
</main>
|
|
187
|
+
{:else}
|
|
188
|
+
<main id="content" class="sd-home">
|
|
189
|
+
<section class="sd-home-hero">
|
|
190
|
+
<span class="sd-home-hero-tape" aria-hidden="true"></span>
|
|
191
|
+
<div class="sd-home-copy">
|
|
192
|
+
{#if kicker}
|
|
193
|
+
<p class="sd-kicker">
|
|
194
|
+
<span class="sd-kicker-mark" aria-hidden="true"></span>
|
|
195
|
+
{kicker}
|
|
196
|
+
</p>
|
|
197
|
+
{/if}
|
|
198
|
+
<h1>{page.title}</h1>
|
|
199
|
+
{#if page.description}
|
|
200
|
+
<p>{page.description}</p>
|
|
201
|
+
{/if}
|
|
202
|
+
<div class="sd-actions">
|
|
203
|
+
<a class="sd-button sd-button-primary" href={primaryAction.href}>
|
|
204
|
+
<span>{primaryAction.label}</span>
|
|
205
|
+
<span class="sd-button-arrow" aria-hidden="true"></span>
|
|
206
|
+
</a>
|
|
207
|
+
{#if secondaryAction}
|
|
208
|
+
<a class="sd-button" href={secondaryAction.href}>{secondaryAction.label}</a>
|
|
209
|
+
{/if}
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
{#if showHomeHeroVisualSlot}
|
|
213
|
+
<slot name="home-hero-visual" {page} {pages} {config} {context} />
|
|
214
|
+
{:else if config.theme.home.visual.type === 'image' && config.theme.home.visual.src}
|
|
215
|
+
<img class="sd-home-visual" src={config.theme.home.visual.src} alt={visualAlt} draggable="false" />
|
|
216
|
+
{:else}
|
|
217
|
+
<div class="sd-pixel-stage" aria-hidden="true">
|
|
218
|
+
<span class="sd-pixel-frame" data-corner="tl"></span>
|
|
219
|
+
<span class="sd-pixel-frame" data-corner="tr"></span>
|
|
220
|
+
<span class="sd-pixel-frame" data-corner="bl"></span>
|
|
221
|
+
<span class="sd-pixel-frame" data-corner="br"></span>
|
|
222
|
+
<div class="sd-pixel-grid">
|
|
223
|
+
{#each cells as cell}
|
|
224
|
+
<span
|
|
225
|
+
class:sd-pixel-hot={cell.hot}
|
|
226
|
+
class:sd-pixel-accent={cell.accent}
|
|
227
|
+
style={cell.style}
|
|
228
|
+
></span>
|
|
229
|
+
{/each}
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
{/if}
|
|
233
|
+
</section>
|
|
234
|
+
{#if showHomeFeaturesSlot}
|
|
235
|
+
<slot name="home-features" {page} {pages} {config} cards={homeCards} {context} />
|
|
236
|
+
{:else}
|
|
237
|
+
<section class="sd-home-grid" aria-label={context.t('home.features')}>
|
|
238
|
+
{#each homeCards as card, i}
|
|
239
|
+
<a href={card.href} style={`--card-index:${i};`}>
|
|
240
|
+
<span class="sd-home-card-tag">
|
|
241
|
+
<i aria-hidden="true"></i>
|
|
242
|
+
{card.label}
|
|
243
|
+
</span>
|
|
244
|
+
<div class="sd-home-card-glyph" aria-hidden="true">
|
|
245
|
+
{#each glyphRows(card.glyph) as row}
|
|
246
|
+
<div>
|
|
247
|
+
{#each row as cell}
|
|
248
|
+
<i data-on={cell === '1' ? 'true' : 'false'}></i>
|
|
249
|
+
{/each}
|
|
250
|
+
</div>
|
|
251
|
+
{/each}
|
|
252
|
+
</div>
|
|
253
|
+
<strong>{card.title}</strong>
|
|
254
|
+
<small>{card.description}</small>
|
|
255
|
+
<span class="sd-home-card-arrow" aria-hidden="true">→</span>
|
|
256
|
+
</a>
|
|
257
|
+
{/each}
|
|
258
|
+
</section>
|
|
259
|
+
{/if}
|
|
260
|
+
<section class="sd-prose sd-home-body">
|
|
261
|
+
<svelte:boundary>
|
|
262
|
+
{#if content}
|
|
263
|
+
<svelte:component this={content} />
|
|
264
|
+
{:else}
|
|
265
|
+
{@html page.html}
|
|
266
|
+
{/if}
|
|
267
|
+
{#snippet failed(error, reset)}
|
|
268
|
+
<svelte:component
|
|
269
|
+
this={ErrorComponent} component={themeComponents.RenderError}
|
|
270
|
+
{error}
|
|
271
|
+
{reset}
|
|
272
|
+
{page}
|
|
273
|
+
{context}
|
|
274
|
+
variant="content"
|
|
275
|
+
label={context.t('render.home.label')}
|
|
276
|
+
title={context.t('render.home.title')}
|
|
277
|
+
message={context.t('render.home.message')}
|
|
278
|
+
/>
|
|
279
|
+
{/snippet}
|
|
280
|
+
</svelte:boundary>
|
|
281
|
+
</section>
|
|
282
|
+
</main>
|
|
283
|
+
{/if}
|
|
284
|
+
</svelte:component>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
import type { SvedocsPage, SvedocsResolvedConfig, SvedocsSearchRecord, SvedocsTreeItem } from '../core/types.js';
|
|
3
|
+
import type { SvedocsThemeComponentMap } from './types.js';
|
|
4
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
+
$$bindings?: Bindings;
|
|
7
|
+
} & Exports;
|
|
8
|
+
(internal: unknown, props: Props & {
|
|
9
|
+
$$events?: Events;
|
|
10
|
+
$$slots?: Slots;
|
|
11
|
+
}): Exports & {
|
|
12
|
+
$set?: any;
|
|
13
|
+
$on?: any;
|
|
14
|
+
};
|
|
15
|
+
z_$$bindings?: Bindings;
|
|
16
|
+
}
|
|
17
|
+
declare const HomePage: $$__sveltets_2_IsomorphicComponent<{
|
|
18
|
+
page: SvedocsPage;
|
|
19
|
+
pages?: SvedocsPage[];
|
|
20
|
+
tree?: SvedocsTreeItem[];
|
|
21
|
+
search?: SvedocsSearchRecord[];
|
|
22
|
+
config: SvedocsResolvedConfig;
|
|
23
|
+
loadSearch?: (() => Promise<SvedocsSearchRecord[]>) | undefined;
|
|
24
|
+
content?: Component | undefined;
|
|
25
|
+
hasBackgroundSlot?: boolean | undefined;
|
|
26
|
+
hasLandingSlot?: boolean | undefined;
|
|
27
|
+
hasHomeHeroVisualSlot?: boolean | undefined;
|
|
28
|
+
hasHomeFeaturesSlot?: boolean | undefined;
|
|
29
|
+
themeComponents?: Partial<SvedocsThemeComponentMap>;
|
|
30
|
+
}, {
|
|
31
|
+
[evt: string]: CustomEvent<any>;
|
|
32
|
+
}, {
|
|
33
|
+
background: {};
|
|
34
|
+
landing: {
|
|
35
|
+
page: SvedocsPage;
|
|
36
|
+
pages: SvedocsPage[];
|
|
37
|
+
tree: SvedocsTreeItem[];
|
|
38
|
+
search: SvedocsSearchRecord[];
|
|
39
|
+
config: SvedocsResolvedConfig;
|
|
40
|
+
content: Component<{}, {}, string> | undefined;
|
|
41
|
+
context: import("./types.js").SvedocsThemeContext;
|
|
42
|
+
};
|
|
43
|
+
'home-hero-visual': {
|
|
44
|
+
page: SvedocsPage;
|
|
45
|
+
pages: SvedocsPage[];
|
|
46
|
+
config: SvedocsResolvedConfig;
|
|
47
|
+
context: import("./types.js").SvedocsThemeContext;
|
|
48
|
+
};
|
|
49
|
+
'home-features': {
|
|
50
|
+
page: SvedocsPage;
|
|
51
|
+
pages: SvedocsPage[];
|
|
52
|
+
config: SvedocsResolvedConfig;
|
|
53
|
+
cards: {
|
|
54
|
+
label: string;
|
|
55
|
+
title: string;
|
|
56
|
+
description: string;
|
|
57
|
+
href: string;
|
|
58
|
+
glyph: string;
|
|
59
|
+
}[];
|
|
60
|
+
context: import("./types.js").SvedocsThemeContext;
|
|
61
|
+
};
|
|
62
|
+
}, {}, string>;
|
|
63
|
+
type HomePage = InstanceType<typeof HomePage>;
|
|
64
|
+
export default HomePage;
|
|
65
|
+
//# sourceMappingURL=HomePage.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HomePage.svelte.d.ts","sourceRoot":"","sources":["../../src/theme/HomePage.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAqB,WAAW,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKpI,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AA8Q3D,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAUD,QAAA,MAAM,QAAQ;UAfwU,WAAW;YAAU,WAAW,EAAE;WAAS,eAAe,EAAE;aAAW,mBAAmB,EAAE;YAAU,qBAAqB;iBAAe,CAAC,MAAM,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,GAAG,SAAS;cAAY,SAAS,GAAG,SAAS;wBAAsB,OAAO,GAAG,SAAS;qBAAmB,OAAO,GAAG,SAAS;4BAA0B,OAAO,GAAG,SAAS;0BAAwB,OAAO,GAAG,SAAS;sBAAoB,OAAO,CAAC,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;mBA7OpwB,MAAM;mBACN,MAAM;yBACA,MAAM;kBACb,MAAM;mBACL,MAAM;;;;cAwPkF,CAAC;AAClF,KAAK,QAAQ,GAAG,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
+
import { classNames, type SvedocsControlDensity } from './forms.js';
|
|
4
|
+
|
|
5
|
+
interface $$Props extends Omit<HTMLInputAttributes, 'class' | 'type' | 'value'> {
|
|
6
|
+
class?: string;
|
|
7
|
+
density?: SvedocsControlDensity;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
type?: HTMLInputAttributes['type'];
|
|
10
|
+
value?: HTMLInputAttributes['value'];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export let value: HTMLInputAttributes['value'] = '';
|
|
14
|
+
export let type: HTMLInputAttributes['type'] = 'text';
|
|
15
|
+
export let invalid = false;
|
|
16
|
+
export let density: SvedocsControlDensity = 'md';
|
|
17
|
+
|
|
18
|
+
let className = '';
|
|
19
|
+
|
|
20
|
+
export { className as class };
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<input
|
|
24
|
+
{...$$restProps}
|
|
25
|
+
class={classNames('sd-input', className)}
|
|
26
|
+
data-density={density}
|
|
27
|
+
aria-invalid={invalid ? 'true' : undefined}
|
|
28
|
+
{type}
|
|
29
|
+
bind:value
|
|
30
|
+
on:blur
|
|
31
|
+
on:change
|
|
32
|
+
on:focus
|
|
33
|
+
on:input
|
|
34
|
+
on:keydown
|
|
35
|
+
on:keyup
|
|
36
|
+
/>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
|
+
import { type SvedocsControlDensity } from './forms.js';
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
declare const Input: $$__sveltets_2_IsomorphicComponent<Omit<HTMLInputAttributes, "type" | "value" | "class"> & {
|
|
17
|
+
class?: string;
|
|
18
|
+
density?: SvedocsControlDensity;
|
|
19
|
+
invalid?: boolean;
|
|
20
|
+
type?: HTMLInputAttributes["type"];
|
|
21
|
+
value?: HTMLInputAttributes["value"];
|
|
22
|
+
}, {
|
|
23
|
+
blur: FocusEvent;
|
|
24
|
+
change: Event;
|
|
25
|
+
focus: FocusEvent;
|
|
26
|
+
input: InputEvent;
|
|
27
|
+
keydown: KeyboardEvent;
|
|
28
|
+
keyup: KeyboardEvent;
|
|
29
|
+
} & {
|
|
30
|
+
[evt: string]: CustomEvent<any>;
|
|
31
|
+
}, {}, {}, string>;
|
|
32
|
+
type Input = InstanceType<typeof Input>;
|
|
33
|
+
export default Input;
|
|
34
|
+
//# sourceMappingURL=Input.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../src/theme/Input.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA4BpE,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,KAAK;YA9BC,MAAM;cACJ,qBAAqB;cACrB,OAAO;WACV,mBAAmB,CAAC,MAAM,CAAC;YAC1B,mBAAmB,CAAC,OAAO,CAAC;;;;;;;;;;kBA0BkD,CAAC;AACzE,KAAK,KAAK,GAAG,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC;AAC1C,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvedocsTreeItem } from '../core/types.js';
|
|
3
|
+
import AskAiPanel from './AskAiPanel.svelte';
|
|
4
|
+
import Footer from './Footer.svelte';
|
|
5
|
+
import Navbar from './Navbar.svelte';
|
|
6
|
+
import PageTools from './PageTools.svelte';
|
|
7
|
+
import SafeRenderError from './SafeRenderError.svelte';
|
|
8
|
+
import type { SvedocsThemeComponentMap, SvedocsThemeContext } from './types.js';
|
|
9
|
+
|
|
10
|
+
export let context: SvedocsThemeContext;
|
|
11
|
+
export let themeStyle = '';
|
|
12
|
+
export let mobileTree: SvedocsTreeItem[] = [];
|
|
13
|
+
export let mobileCurrentPath = '';
|
|
14
|
+
export let mobileMenuId = 'sd-mobile-menu-site';
|
|
15
|
+
export let mobileMenuOpen = false;
|
|
16
|
+
export let hasBackgroundSlot = false;
|
|
17
|
+
export let themeComponents: Partial<SvedocsThemeComponentMap> = {};
|
|
18
|
+
export let onToggleMobileMenu: () => void = () => undefined;
|
|
19
|
+
export let onCloseMobileMenu: () => void = () => undefined;
|
|
20
|
+
|
|
21
|
+
$: NavbarComponent = themeComponents.Header ?? themeComponents.Navbar ?? Navbar;
|
|
22
|
+
$: AskAiComponent = themeComponents.AskAi ?? AskAiPanel;
|
|
23
|
+
$: FooterComponent = themeComponents.Footer ?? Footer;
|
|
24
|
+
$: PageToolsComponent = themeComponents.PageTools ?? PageTools;
|
|
25
|
+
$: ErrorComponent = SafeRenderError;
|
|
26
|
+
$: fixedTheme = context.config.theme.defaultMode === 'system' ? undefined : context.config.theme.defaultMode;
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div class:sd-has-background-slot={hasBackgroundSlot} class="sd-root" data-surface={context.surface} data-theme={fixedTheme} style={themeStyle} data-theme-component="layout">
|
|
30
|
+
<a class="sd-skip" href="#content">{context.t('nav.skipToContent')}</a>
|
|
31
|
+
{#if hasBackgroundSlot}
|
|
32
|
+
<div class="sd-background-slot" aria-hidden="true">
|
|
33
|
+
<slot name="background" />
|
|
34
|
+
</div>
|
|
35
|
+
{/if}
|
|
36
|
+
<svelte:boundary>
|
|
37
|
+
<svelte:component
|
|
38
|
+
this={NavbarComponent}
|
|
39
|
+
{context}
|
|
40
|
+
{mobileTree}
|
|
41
|
+
mobileCurrentPath={mobileCurrentPath}
|
|
42
|
+
{mobileMenuId}
|
|
43
|
+
{mobileMenuOpen}
|
|
44
|
+
{themeComponents}
|
|
45
|
+
{onToggleMobileMenu}
|
|
46
|
+
{onCloseMobileMenu}
|
|
47
|
+
/>
|
|
48
|
+
{#snippet failed(error, reset)}
|
|
49
|
+
<svelte:component
|
|
50
|
+
this={ErrorComponent} component={themeComponents.RenderError}
|
|
51
|
+
{error}
|
|
52
|
+
{reset}
|
|
53
|
+
{context}
|
|
54
|
+
tree={context.tree}
|
|
55
|
+
variant="layout"
|
|
56
|
+
label={context.t('render.header.label')}
|
|
57
|
+
title={context.t('render.header.title')}
|
|
58
|
+
message={context.t('render.header.message')}
|
|
59
|
+
/>
|
|
60
|
+
{/snippet}
|
|
61
|
+
</svelte:boundary>
|
|
62
|
+
<slot />
|
|
63
|
+
{#if context.isDocsPage}
|
|
64
|
+
{#if context.config.ai.enabled}
|
|
65
|
+
<svelte:boundary>
|
|
66
|
+
<svelte:component
|
|
67
|
+
this={AskAiComponent}
|
|
68
|
+
config={context.config}
|
|
69
|
+
records={context.search}
|
|
70
|
+
loadRecords={context.loadSearch}
|
|
71
|
+
scope={context.aiScope}
|
|
72
|
+
buildMode={context.config.build.mode}
|
|
73
|
+
{context}
|
|
74
|
+
/>
|
|
75
|
+
{#snippet failed(error, reset)}
|
|
76
|
+
<svelte:component
|
|
77
|
+
this={ErrorComponent} component={themeComponents.RenderError}
|
|
78
|
+
{error}
|
|
79
|
+
{reset}
|
|
80
|
+
{context}
|
|
81
|
+
variant="tools"
|
|
82
|
+
label={context.t('render.ask.label')}
|
|
83
|
+
title={context.t('render.ask.title')}
|
|
84
|
+
message={context.t('render.ask.message')}
|
|
85
|
+
/>
|
|
86
|
+
{/snippet}
|
|
87
|
+
</svelte:boundary>
|
|
88
|
+
{/if}
|
|
89
|
+
<svelte:boundary>
|
|
90
|
+
<svelte:component this={PageToolsComponent} config={context.config} {context} />
|
|
91
|
+
{#snippet failed(error, reset)}
|
|
92
|
+
<svelte:component
|
|
93
|
+
this={ErrorComponent} component={themeComponents.RenderError}
|
|
94
|
+
{error}
|
|
95
|
+
{reset}
|
|
96
|
+
{context}
|
|
97
|
+
variant="tools"
|
|
98
|
+
label={context.t('render.tools.label')}
|
|
99
|
+
title={context.t('render.tools.title')}
|
|
100
|
+
message={context.t('render.tools.message')}
|
|
101
|
+
/>
|
|
102
|
+
{/snippet}
|
|
103
|
+
</svelte:boundary>
|
|
104
|
+
{/if}
|
|
105
|
+
<svelte:boundary>
|
|
106
|
+
<svelte:component this={FooterComponent} {context} {themeComponents} />
|
|
107
|
+
{#snippet failed(error, reset)}
|
|
108
|
+
<svelte:component
|
|
109
|
+
this={ErrorComponent} component={themeComponents.RenderError}
|
|
110
|
+
{error}
|
|
111
|
+
{reset}
|
|
112
|
+
{context}
|
|
113
|
+
variant="layout"
|
|
114
|
+
label={context.t('render.footer.label')}
|
|
115
|
+
title={context.t('render.footer.title')}
|
|
116
|
+
message={context.t('render.footer.message')}
|
|
117
|
+
/>
|
|
118
|
+
{/snippet}
|
|
119
|
+
</svelte:boundary>
|
|
120
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { SvedocsTreeItem } from '../core/types.js';
|
|
2
|
+
import type { SvedocsThemeComponentMap, SvedocsThemeContext } from './types.js';
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
17
|
+
default: any;
|
|
18
|
+
} ? Props extends Record<string, never> ? any : {
|
|
19
|
+
children?: any;
|
|
20
|
+
} : {});
|
|
21
|
+
declare const LayoutShell: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
22
|
+
context: SvedocsThemeContext;
|
|
23
|
+
themeStyle?: string;
|
|
24
|
+
mobileTree?: SvedocsTreeItem[];
|
|
25
|
+
mobileCurrentPath?: string;
|
|
26
|
+
mobileMenuId?: string;
|
|
27
|
+
mobileMenuOpen?: boolean;
|
|
28
|
+
hasBackgroundSlot?: boolean;
|
|
29
|
+
themeComponents?: Partial<SvedocsThemeComponentMap>;
|
|
30
|
+
onToggleMobileMenu?: () => void;
|
|
31
|
+
onCloseMobileMenu?: () => void;
|
|
32
|
+
}, {
|
|
33
|
+
background: {};
|
|
34
|
+
default: {};
|
|
35
|
+
}>, {
|
|
36
|
+
[evt: string]: CustomEvent<any>;
|
|
37
|
+
}, {
|
|
38
|
+
background: {};
|
|
39
|
+
default: {};
|
|
40
|
+
}, {}, string>;
|
|
41
|
+
type LayoutShell = InstanceType<typeof LayoutShell>;
|
|
42
|
+
export default LayoutShell;
|
|
43
|
+
//# sourceMappingURL=LayoutShell.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutShell.svelte.d.ts","sourceRoot":"","sources":["../../src/theme/LayoutShell.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAkEhF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,WAAW;aAfgV,mBAAmB;;iBAA+C,eAAe,EAAE;;;;;sBAA4L,OAAO,CAAC,wBAAwB,CAAC;yBAAuB,MAAM,IAAI;wBAAsB,MAAM,IAAI;;;;;;;;;cAe5mB,CAAC;AACrF,KAAK,WAAW,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
3
|
+
import { resolveLocalizedHref } from './headless.js';
|
|
4
|
+
import type { SvedocsThemeContext } from './types.js';
|
|
5
|
+
|
|
6
|
+
interface $$Props extends Omit<HTMLAnchorAttributes, 'href'> {
|
|
7
|
+
context: SvedocsThemeContext;
|
|
8
|
+
href: string;
|
|
9
|
+
external?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export let context: SvedocsThemeContext;
|
|
13
|
+
export let href: string;
|
|
14
|
+
export let external = false;
|
|
15
|
+
|
|
16
|
+
$: resolvedHref = external ? href : resolveLocalizedHref(href, context);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<a {...$$restProps} href={resolvedHref} on:click on:focus on:blur>
|
|
20
|
+
<slot />
|
|
21
|
+
</a>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
2
|
+
import type { SvedocsThemeContext } from './types.js';
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
17
|
+
default: any;
|
|
18
|
+
} ? Props extends Record<string, never> ? any : {
|
|
19
|
+
children?: any;
|
|
20
|
+
} : {});
|
|
21
|
+
declare const LocalizedLink: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Omit<HTMLAnchorAttributes, "href"> & {
|
|
22
|
+
context: SvedocsThemeContext;
|
|
23
|
+
href: string;
|
|
24
|
+
external?: boolean;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
}>, {
|
|
28
|
+
click: PointerEvent;
|
|
29
|
+
focus: FocusEvent;
|
|
30
|
+
blur: FocusEvent;
|
|
31
|
+
} & {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
}, {
|
|
34
|
+
default: {};
|
|
35
|
+
}, {}, string>;
|
|
36
|
+
type LocalizedLink = InstanceType<typeof LocalizedLink>;
|
|
37
|
+
export default LocalizedLink;
|
|
38
|
+
//# sourceMappingURL=LocalizedLink.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalizedLink.svelte.d.ts","sourceRoot":"","sources":["../../src/theme/LocalizedLink.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA0BtD,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,aAAa;aAhCN,mBAAmB;UACtB,MAAM;eACD,OAAO;;;;;;;;;;;cA8BkF,CAAC;AACvF,KAAK,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAe,aAAa,CAAC"}
|