svelte-docsmith 0.13.1 → 0.14.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/README.md +30 -26
- package/dist/buildtime/archive.d.ts +4 -3
- package/dist/buildtime/archive.js +4 -3
- package/dist/buildtime/markdown-layout.svelte.d.ts +2 -2
- package/dist/buildtime/vite/frontmatter.js +5 -3
- package/dist/components/chrome/search-trigger.svelte +1 -0
- package/dist/components/docs/badge.svelte +1 -7
- package/dist/components/layouts/copy-page-menu.svelte +2 -2
- package/dist/components/shadcn/badge/badge.svelte.d.ts +2 -20
- package/dist/components/shadcn/button/button.svelte.d.ts +2 -40
- package/dist/components/shadcn/input-group/input-group-addon.svelte.d.ts +2 -16
- package/dist/components/shadcn/input-group/input-group-button.svelte.d.ts +2 -16
- package/dist/components/shadcn/input-group/input-group-input.svelte.d.ts +1 -1
- package/dist/components/shadcn/tabs/tabs-list.svelte.d.ts +2 -12
- package/dist/components/shadcn/textarea/textarea.svelte +1 -2
- package/dist/core/version.js +1 -1
- package/dist/toc/toc.svelte.js +2 -0
- package/package.json +41 -38
package/README.md
CHANGED
|
@@ -42,50 +42,54 @@ To add DocSmith to an existing SvelteKit app, install the package instead:
|
|
|
42
42
|
npm install svelte-docsmith
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Peer dependencies: Svelte 5, SvelteKit 2, and Tailwind v4, set up the
|
|
46
|
-
way in your app.
|
|
45
|
+
Peer dependencies: Svelte 5, SvelteKit 2 or 3, and Tailwind v4, set up the
|
|
46
|
+
standard way in your app.
|
|
47
47
|
|
|
48
48
|
## Setup
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Two small pieces, once.
|
|
51
51
|
|
|
52
|
-
**1.
|
|
53
|
-
|
|
54
|
-
fallback for unknown languages), heading anchors, and the packaged page layout:
|
|
52
|
+
**1. Vite.** Everything goes in `vite.config.ts`. DocSmith has two halves, both
|
|
53
|
+
called `docsmith()`:
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
extensions: ['.svelte', '.md'],
|
|
64
|
-
preprocess: [vitePreprocess(), docsmith()],
|
|
65
|
-
kit: { adapter: adapter() }
|
|
66
|
-
};
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**2. The Vite plugin.** In `vite.config.ts`, it scans your doc pages' frontmatter
|
|
70
|
-
into the `svelte-docsmith/content` module (so the sidebar is derived from
|
|
71
|
-
content, never hand-written), builds the search index, and powers `LiveExample`:
|
|
55
|
+
- The **Vite plugin** (`svelte-docsmith/vite`) scans your doc pages' frontmatter
|
|
56
|
+
into the `svelte-docsmith/content` module (so the sidebar is derived from
|
|
57
|
+
content, never hand-written), builds the search index, and powers
|
|
58
|
+
`LiveExample`. It goes before `sveltekit()`.
|
|
59
|
+
- The **markdown pipeline** (`svelte-docsmith/preprocess`) bundles mdsvex, Shiki
|
|
60
|
+
highlighting (dual light/dark themes, a generous language set, plain-text
|
|
61
|
+
fallback for unknown languages), heading anchors, and the packaged page layout.
|
|
72
62
|
|
|
73
63
|
```ts
|
|
74
64
|
// vite.config.ts
|
|
65
|
+
import adapter from '@sveltejs/adapter-auto';
|
|
75
66
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
67
|
+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
76
68
|
import tailwindcss from '@tailwindcss/vite';
|
|
77
69
|
import { docsmith } from 'svelte-docsmith/vite';
|
|
70
|
+
import { docsmith as markdown } from 'svelte-docsmith/preprocess';
|
|
78
71
|
import { defineConfig } from 'vite';
|
|
79
72
|
|
|
80
73
|
export default defineConfig({
|
|
81
|
-
plugins: [
|
|
74
|
+
plugins: [
|
|
75
|
+
docsmith(),
|
|
76
|
+
tailwindcss(),
|
|
77
|
+
sveltekit({
|
|
78
|
+
extensions: ['.svelte', '.md'],
|
|
79
|
+
preprocess: [vitePreprocess(), markdown()],
|
|
80
|
+
adapter: adapter()
|
|
81
|
+
})
|
|
82
|
+
]
|
|
82
83
|
});
|
|
83
84
|
```
|
|
84
85
|
|
|
86
|
+
On SvelteKit 2, `extensions` and `preprocess` go in `svelte.config.js` instead,
|
|
87
|
+
and `sveltekit()` takes no options.
|
|
88
|
+
|
|
85
89
|
By default it scans `src/routes/docs`; pass `docsmith({ content: 'src/routes/guide' })`
|
|
86
90
|
to point elsewhere.
|
|
87
91
|
|
|
88
|
-
**
|
|
92
|
+
**2. The stylesheet.** In your root `app.css`, once Tailwind v4 is set up the
|
|
89
93
|
standard way (`tailwindcss` + the `@tailwindcss/vite` plugin, stylesheet imported
|
|
90
94
|
in the root layout), the whole style contract is one import:
|
|
91
95
|
|
|
@@ -157,8 +161,8 @@ plugin you already added:
|
|
|
157
161
|
```svelte
|
|
158
162
|
<script>
|
|
159
163
|
import { LiveExample } from 'svelte-docsmith';
|
|
160
|
-
import Counter from '
|
|
161
|
-
import counterSource from '
|
|
164
|
+
import Counter from '#lib/examples/counter.svelte';
|
|
165
|
+
import counterSource from '#lib/examples/counter.svelte?source';
|
|
162
166
|
</script>
|
|
163
167
|
|
|
164
168
|
<LiveExample source={counterSource}>
|
|
@@ -37,9 +37,10 @@ export declare function freezeLastUpdated(text: string, date: string | undefined
|
|
|
37
37
|
* Archiving copies the docs root and nothing else, so anything reached from
|
|
38
38
|
* outside it keeps resolving to current code: a live example on an archived
|
|
39
39
|
* page demonstrates the current library rather than the version the page
|
|
40
|
-
* documents, with a green build and nothing said. Hence `$lib
|
|
41
|
-
* specifiers and relative paths that climb out all count,
|
|
42
|
-
* import landing inside the docs root is frozen along with
|
|
40
|
+
* documents, with a green build and nothing said. Hence `$lib` (Kit 2), `#lib`
|
|
41
|
+
* (Kit 3), bare npm specifiers and relative paths that climb out all count,
|
|
42
|
+
* while a relative import landing inside the docs root is frozen along with
|
|
43
|
+
* the page.
|
|
43
44
|
*
|
|
44
45
|
* `svelte-docsmith` itself is never reported. An archived page importing the
|
|
45
46
|
* authoring components is the expected shape, and those are covered by the
|
|
@@ -85,9 +85,10 @@ function escapesRoot(specifier, depth) {
|
|
|
85
85
|
* Archiving copies the docs root and nothing else, so anything reached from
|
|
86
86
|
* outside it keeps resolving to current code: a live example on an archived
|
|
87
87
|
* page demonstrates the current library rather than the version the page
|
|
88
|
-
* documents, with a green build and nothing said. Hence `$lib
|
|
89
|
-
* specifiers and relative paths that climb out all count,
|
|
90
|
-
* import landing inside the docs root is frozen along with
|
|
88
|
+
* documents, with a green build and nothing said. Hence `$lib` (Kit 2), `#lib`
|
|
89
|
+
* (Kit 3), bare npm specifiers and relative paths that climb out all count,
|
|
90
|
+
* while a relative import landing inside the docs root is frozen along with
|
|
91
|
+
* the page.
|
|
91
92
|
*
|
|
92
93
|
* `svelte-docsmith` itself is never reported. An archived page importing the
|
|
93
94
|
* authoring components is the expected shape, and those are covered by the
|
|
@@ -7,8 +7,8 @@ export declare const pre: import("svelte").Component<{
|
|
|
7
7
|
export declare const code: import("svelte").Component<{
|
|
8
8
|
children: Snippet;
|
|
9
9
|
}, {}, "">;
|
|
10
|
-
export declare const h2: import("svelte").Component<import("../components/markdown/types.
|
|
11
|
-
export declare const h3: import("svelte").Component<import("../components/markdown/types.
|
|
10
|
+
export declare const h2: import("svelte").Component<import("../components/markdown/types.ts").HeadingProps, {}, "">;
|
|
11
|
+
export declare const h3: import("svelte").Component<import("../components/markdown/types.ts").HeadingProps, {}, "">;
|
|
12
12
|
export declare const table: import("svelte").Component<{
|
|
13
13
|
children: Snippet;
|
|
14
14
|
}, {}, "">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { load as loadYaml } from 'js-yaml';
|
|
2
2
|
import { splitFrontmatter } from '../markdown-source.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parse a page's leading YAML frontmatter block into a plain object. Returns an
|
|
@@ -11,11 +11,13 @@ export function parseFrontmatter(source, file) {
|
|
|
11
11
|
return {};
|
|
12
12
|
let data;
|
|
13
13
|
try {
|
|
14
|
-
data =
|
|
14
|
+
data = loadYaml(frontmatter);
|
|
15
15
|
}
|
|
16
16
|
catch (err) {
|
|
17
17
|
const reason = err instanceof Error ? err.message : String(err);
|
|
18
|
-
throw new Error(`[svelte-docsmith] invalid YAML frontmatter in ${file}\n${reason}
|
|
18
|
+
throw new Error(`[svelte-docsmith] invalid YAML frontmatter in ${file}\n${reason}`, {
|
|
19
|
+
cause: err
|
|
20
|
+
});
|
|
19
21
|
}
|
|
20
22
|
return data && typeof data === 'object' ? data : {};
|
|
21
23
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
const search = useSearch();
|
|
8
8
|
|
|
9
9
|
// Resolve the modifier label client-side so SSR stays platform-neutral.
|
|
10
|
+
// eslint-disable-next-line svelte/prefer-writable-derived
|
|
10
11
|
let isMac = $state(false);
|
|
11
12
|
$effect(() => {
|
|
12
13
|
isMac = navigator.platform.toLowerCase().includes('mac');
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
export type BadgeVariant =
|
|
3
|
-
| '
|
|
4
|
-
| 'primary'
|
|
5
|
-
| 'secondary'
|
|
6
|
-
| 'success'
|
|
7
|
-
| 'warning'
|
|
8
|
-
| 'danger'
|
|
9
|
-
| 'outline';
|
|
3
|
+
'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'outline';
|
|
10
4
|
</script>
|
|
11
5
|
|
|
12
6
|
<script lang="ts">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { BROWSER } from 'esm-env';
|
|
3
3
|
import { Button } from '../shadcn/button/index.js';
|
|
4
4
|
import * as DropdownMenu from '../shadcn/dropdown-menu/index.js';
|
|
5
5
|
import Check from '@lucide/svelte/icons/check';
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
const mdHref = $derived(`${path}.md`);
|
|
25
25
|
// Before hydration with no configured origin there is nothing to prefix, and
|
|
26
26
|
// `join` leaves the link site-relative rather than mangling it.
|
|
27
|
-
const absoluteMd = $derived(join(origin || (
|
|
27
|
+
const absoluteMd = $derived(join(origin || (BROWSER ? location.origin : ''), mdHref));
|
|
28
28
|
const prompt = $derived(`Read ${absoluteMd} so I can ask questions about this page.`);
|
|
29
29
|
const chatgptHref = $derived(`https://chatgpt.com/?hints=search&q=${encodeURIComponent(prompt)}`);
|
|
30
30
|
const claudeHref = $derived(`https://claude.ai/new?q=${encodeURIComponent(prompt)}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
export declare const badgeVariants: import("tailwind-variants").
|
|
2
|
+
export declare const badgeVariants: import("tailwind-variants/dist/types-BNulpdf_.cjs").s<{
|
|
3
3
|
variant: {
|
|
4
4
|
default: string;
|
|
5
5
|
secondary: string;
|
|
@@ -8,25 +8,7 @@ export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
8
8
|
ghost: string;
|
|
9
9
|
link: string;
|
|
10
10
|
};
|
|
11
|
-
}, undefined, "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none",
|
|
12
|
-
variant: {
|
|
13
|
-
default: string;
|
|
14
|
-
secondary: string;
|
|
15
|
-
destructive: string;
|
|
16
|
-
outline: string;
|
|
17
|
-
ghost: string;
|
|
18
|
-
link: string;
|
|
19
|
-
};
|
|
20
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
21
|
-
variant: {
|
|
22
|
-
default: string;
|
|
23
|
-
secondary: string;
|
|
24
|
-
destructive: string;
|
|
25
|
-
outline: string;
|
|
26
|
-
ghost: string;
|
|
27
|
-
link: string;
|
|
28
|
-
};
|
|
29
|
-
}, undefined, "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none", unknown, unknown, undefined>>;
|
|
11
|
+
}, undefined, "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none", undefined, undefined, undefined>;
|
|
30
12
|
export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
|
|
31
13
|
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
32
14
|
import { type WithElementRef } from '../../../utils/cn.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type WithElementRef } from '../../../utils/cn.js';
|
|
2
2
|
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
3
3
|
import { type VariantProps } from 'tailwind-variants';
|
|
4
|
-
export declare const buttonVariants: import("tailwind-variants").
|
|
4
|
+
export declare const buttonVariants: import("tailwind-variants/dist/types-BNulpdf_.cjs").s<{
|
|
5
5
|
variant: {
|
|
6
6
|
default: string;
|
|
7
7
|
outline: string;
|
|
@@ -20,45 +20,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
20
20
|
'icon-sm': string;
|
|
21
21
|
'icon-lg': string;
|
|
22
22
|
};
|
|
23
|
-
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
24
|
-
variant: {
|
|
25
|
-
default: string;
|
|
26
|
-
outline: string;
|
|
27
|
-
secondary: string;
|
|
28
|
-
ghost: string;
|
|
29
|
-
destructive: string;
|
|
30
|
-
link: string;
|
|
31
|
-
};
|
|
32
|
-
size: {
|
|
33
|
-
default: string;
|
|
34
|
-
xs: string;
|
|
35
|
-
sm: string;
|
|
36
|
-
lg: string;
|
|
37
|
-
icon: string;
|
|
38
|
-
'icon-xs': string;
|
|
39
|
-
'icon-sm': string;
|
|
40
|
-
'icon-lg': string;
|
|
41
|
-
};
|
|
42
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
43
|
-
variant: {
|
|
44
|
-
default: string;
|
|
45
|
-
outline: string;
|
|
46
|
-
secondary: string;
|
|
47
|
-
ghost: string;
|
|
48
|
-
destructive: string;
|
|
49
|
-
link: string;
|
|
50
|
-
};
|
|
51
|
-
size: {
|
|
52
|
-
default: string;
|
|
53
|
-
xs: string;
|
|
54
|
-
sm: string;
|
|
55
|
-
lg: string;
|
|
56
|
-
icon: string;
|
|
57
|
-
'icon-xs': string;
|
|
58
|
-
'icon-sm': string;
|
|
59
|
-
'icon-lg': string;
|
|
60
|
-
};
|
|
61
|
-
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
|
|
23
|
+
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", undefined, undefined, undefined>;
|
|
62
24
|
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
63
25
|
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
|
|
64
26
|
export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
export declare const inputGroupAddonVariants: import("tailwind-variants").
|
|
2
|
+
export declare const inputGroupAddonVariants: import("tailwind-variants/dist/types-BNulpdf_.cjs").s<{
|
|
3
3
|
align: {
|
|
4
4
|
'inline-start': string;
|
|
5
5
|
'inline-end': string;
|
|
6
6
|
'block-start': string;
|
|
7
7
|
'block-end': string;
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none",
|
|
10
|
-
align: {
|
|
11
|
-
'inline-start': string;
|
|
12
|
-
'inline-end': string;
|
|
13
|
-
'block-start': string;
|
|
14
|
-
'block-end': string;
|
|
15
|
-
};
|
|
16
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
17
|
-
align: {
|
|
18
|
-
'inline-start': string;
|
|
19
|
-
'inline-end': string;
|
|
20
|
-
'block-start': string;
|
|
21
|
-
'block-end': string;
|
|
22
|
-
};
|
|
23
|
-
}, undefined, "text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none", unknown, unknown, undefined>>;
|
|
9
|
+
}, undefined, "text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none", undefined, undefined, undefined>;
|
|
24
10
|
export type InputGroupAddonAlign = VariantProps<typeof inputGroupAddonVariants>['align'];
|
|
25
11
|
import { type WithElementRef } from '../../../utils/cn.js';
|
|
26
12
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
declare const inputGroupButtonVariants: import("tailwind-variants").
|
|
2
|
+
declare const inputGroupButtonVariants: import("tailwind-variants/dist/types-BNulpdf_.cjs").s<{
|
|
3
3
|
size: {
|
|
4
4
|
xs: string;
|
|
5
5
|
sm: string;
|
|
6
6
|
'icon-xs': string;
|
|
7
7
|
'icon-sm': string;
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "gap-2 text-sm flex items-center shadow-none",
|
|
10
|
-
size: {
|
|
11
|
-
xs: string;
|
|
12
|
-
sm: string;
|
|
13
|
-
'icon-xs': string;
|
|
14
|
-
'icon-sm': string;
|
|
15
|
-
};
|
|
16
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
17
|
-
size: {
|
|
18
|
-
xs: string;
|
|
19
|
-
sm: string;
|
|
20
|
-
'icon-xs': string;
|
|
21
|
-
'icon-sm': string;
|
|
22
|
-
};
|
|
23
|
-
}, undefined, "gap-2 text-sm flex items-center shadow-none", unknown, unknown, undefined>>;
|
|
9
|
+
}, undefined, "gap-2 text-sm flex items-center shadow-none", undefined, undefined, undefined>;
|
|
24
10
|
export type InputGroupButtonSize = VariantProps<typeof inputGroupButtonVariants>['size'];
|
|
25
11
|
import type { ComponentProps } from 'svelte';
|
|
26
12
|
import { Button } from '../button/index.js';
|
|
@@ -2,7 +2,7 @@ declare const InputGroupInput: import("svelte").Component<(Omit<import("svelte/e
|
|
|
2
2
|
type: "file";
|
|
3
3
|
files?: FileList;
|
|
4
4
|
} | {
|
|
5
|
-
type?: "number" | "
|
|
5
|
+
type?: "number" | "hidden" | "color" | "submit" | "reset" | "button" | "search" | "checkbox" | "radio" | (string & {}) | "text" | "tel" | "url" | "email" | "date" | "datetime-local" | "image" | "month" | "password" | "range" | "time" | "week";
|
|
6
6
|
files?: undefined;
|
|
7
7
|
})) & {
|
|
8
8
|
ref?: HTMLElement | null | undefined;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
export declare const tabsListVariants: import("tailwind-variants").
|
|
2
|
+
export declare const tabsListVariants: import("tailwind-variants/dist/types-BNulpdf_.cjs").s<{
|
|
3
3
|
variant: {
|
|
4
4
|
default: string;
|
|
5
5
|
line: string;
|
|
6
6
|
};
|
|
7
|
-
}, undefined, "rounded-lg p-[3px] group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
8
|
-
variant: {
|
|
9
|
-
default: string;
|
|
10
|
-
line: string;
|
|
11
|
-
};
|
|
12
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
13
|
-
variant: {
|
|
14
|
-
default: string;
|
|
15
|
-
line: string;
|
|
16
|
-
};
|
|
17
|
-
}, undefined, "rounded-lg p-[3px] group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col", unknown, unknown, undefined>>;
|
|
7
|
+
}, undefined, "rounded-lg p-[3px] group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col", undefined, undefined, undefined>;
|
|
18
8
|
export type TabsListVariant = VariantProps<typeof tabsListVariants>['variant'];
|
|
19
9
|
import { Tabs as TabsPrimitive } from 'bits-ui';
|
|
20
10
|
type $$ComponentProps = TabsPrimitive.ListProps & {
|
package/dist/core/version.js
CHANGED
|
@@ -63,7 +63,7 @@ export function checkVersions(versions, disk, markerName) {
|
|
|
63
63
|
assertValidVersionId(version?.id);
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
66
|
-
throw new Error(`[svelte-docsmith] ${error.message}
|
|
66
|
+
throw new Error(`[svelte-docsmith] ${error.message}`, { cause: error });
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
const seen = new Set();
|
package/dist/toc/toc.svelte.js
CHANGED
|
@@ -34,6 +34,8 @@ export function createToc(contentFn) {
|
|
|
34
34
|
const headings = headingItems
|
|
35
35
|
.map((item) => el.querySelector(`#${CSS.escape(item.id)}`))
|
|
36
36
|
.filter((node) => node !== null);
|
|
37
|
+
// Plain Set on purpose: it's scratch state read only inside recompute(), never rendered.
|
|
38
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
37
39
|
const visible = new Set();
|
|
38
40
|
function recompute() {
|
|
39
41
|
// The first heading (in document order) inside the active band wins.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-docsmith",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "A framework for building beautiful documentation sites with Svelte.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "George Daskalakis",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT",
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@sveltejs/kit": "^2.16.0",
|
|
74
|
-
"mermaid": "^10.0.0 || ^11.0.0",
|
|
73
|
+
"@sveltejs/kit": "^2.16.0 || ^3.0.0",
|
|
74
|
+
"mermaid": "^10.0.0 || ^11.0.0 || ^12.0.0",
|
|
75
75
|
"svelte": "^5.0.0",
|
|
76
76
|
"tailwindcss": "^4.0.0"
|
|
77
77
|
},
|
|
@@ -81,51 +81,50 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@internationalized/date": "^3.12.
|
|
85
|
-
"@shikijs/twoslash": "
|
|
86
|
-
"@sveltejs/adapter-auto": "^
|
|
87
|
-
"@sveltejs/adapter-vercel": "^
|
|
88
|
-
"@sveltejs/kit": "^
|
|
89
|
-
"@sveltejs/package": "^
|
|
90
|
-
"@sveltejs/vite-plugin-svelte": "^7.1
|
|
91
|
-
"@testing-library/jest-dom": "^
|
|
92
|
-
"@testing-library/svelte": "^5.2
|
|
93
|
-
"@types/
|
|
94
|
-
"@
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"svelte": "^
|
|
101
|
-
"
|
|
102
|
-
"tailwindcss": "^4.3.2",
|
|
84
|
+
"@internationalized/date": "^3.12.4",
|
|
85
|
+
"@shikijs/twoslash": "4.6.0",
|
|
86
|
+
"@sveltejs/adapter-auto": "^8.0.0",
|
|
87
|
+
"@sveltejs/adapter-vercel": "^7.0.0",
|
|
88
|
+
"@sveltejs/kit": "^3.0.0",
|
|
89
|
+
"@sveltejs/package": "^3.0.0",
|
|
90
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
91
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
92
|
+
"@testing-library/svelte": "^5.4.2",
|
|
93
|
+
"@types/node": "^22.20.5",
|
|
94
|
+
"@vitest/coverage-v8": "5.1.0",
|
|
95
|
+
"jsdom": "^31.0.0",
|
|
96
|
+
"mermaid": "^12.3.0",
|
|
97
|
+
"publint": "^0.3.25",
|
|
98
|
+
"shadcn-svelte": "^1.8.0",
|
|
99
|
+
"svelte": "^5.57.3",
|
|
100
|
+
"svelte-check": "^4.7.8",
|
|
101
|
+
"tailwindcss": "^4.3.4",
|
|
103
102
|
"twoslash-svelte": "0.3.9",
|
|
104
|
-
"typescript": "^
|
|
105
|
-
"vite": "^8.
|
|
106
|
-
"vitest": "^
|
|
103
|
+
"typescript": "^6.0.3",
|
|
104
|
+
"vite": "^8.3.6",
|
|
105
|
+
"vitest": "^5.1.0"
|
|
107
106
|
},
|
|
108
107
|
"dependencies": {
|
|
109
|
-
"@fontsource-variable/inter": "^5.
|
|
110
|
-
"@fontsource-variable/source-serif-4": "^5.3.
|
|
108
|
+
"@fontsource-variable/inter": "^5.3.0",
|
|
109
|
+
"@fontsource-variable/source-serif-4": "^5.3.1",
|
|
111
110
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
112
111
|
"@hbsnow/rehype-sectionize": "^1.0.7",
|
|
113
|
-
"@lucide/svelte": "^1.
|
|
114
|
-
"@shikijs/transformers": "^
|
|
115
|
-
"@tailwindcss/typography": "^0.5.
|
|
116
|
-
"bits-ui": "^2.
|
|
112
|
+
"@lucide/svelte": "^1.70.0",
|
|
113
|
+
"@shikijs/transformers": "^4.6.0",
|
|
114
|
+
"@tailwindcss/typography": "^0.5.20",
|
|
115
|
+
"bits-ui": "^2.20.6",
|
|
117
116
|
"clsx": "^2.1.1",
|
|
118
117
|
"esm-env": "^1.2.2",
|
|
119
118
|
"flexsearch": "^0.8.212",
|
|
120
119
|
"github-slugger": "^2.0.0",
|
|
121
|
-
"js-yaml": "^
|
|
122
|
-
"marked": "^18.
|
|
123
|
-
"mdsvex": "^0.12.
|
|
124
|
-
"mode-watcher": "^1.0
|
|
120
|
+
"js-yaml": "^5.5.0",
|
|
121
|
+
"marked": "^18.1.3",
|
|
122
|
+
"mdsvex": "^0.12.8",
|
|
123
|
+
"mode-watcher": "^1.1.0",
|
|
125
124
|
"rehype-slug": "^6.0.0",
|
|
126
|
-
"shiki": "^
|
|
127
|
-
"tailwind-merge": "^3.
|
|
128
|
-
"tailwind-variants": "^
|
|
125
|
+
"shiki": "^4.6.0",
|
|
126
|
+
"tailwind-merge": "^3.7.0",
|
|
127
|
+
"tailwind-variants": "^4.0.1",
|
|
129
128
|
"tw-animate-css": "^1.4.0"
|
|
130
129
|
},
|
|
131
130
|
"keywords": [
|
|
@@ -142,6 +141,10 @@
|
|
|
142
141
|
"ui",
|
|
143
142
|
"components"
|
|
144
143
|
],
|
|
144
|
+
"imports": {
|
|
145
|
+
"#lib": "./src/lib/index.js",
|
|
146
|
+
"#lib/*": "./src/lib/*"
|
|
147
|
+
},
|
|
145
148
|
"scripts": {
|
|
146
149
|
"dev": "vite dev",
|
|
147
150
|
"build": "vite build && npm run prepack",
|