@clidey/dory 0.35.0 → 0.36.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/package.json +30 -31
- package/src/components/store.ts +3 -3
- package/src/mdx/api-playground.tsx +2 -1
- package/src/mdx/fence.tsx +2 -1
- package/src/mdx/latex.tsx +13 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clidey/dory",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.36.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A CLI tool for building and previewing documentation sites",
|
|
7
7
|
"keywords": [
|
|
@@ -45,47 +45,46 @@
|
|
|
45
45
|
"prepublishOnly": "echo 'Skipping prepublishOnly - build handled by publish script'"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@algolia/autocomplete-core": "1.19.
|
|
49
|
-
"@clidey/ux": "0.
|
|
50
|
-
"@fortawesome/fontawesome-svg-core": "
|
|
51
|
-
"@fortawesome/free-brands-svg-icons": "
|
|
52
|
-
"@fortawesome/free-regular-svg-icons": "
|
|
53
|
-
"@fortawesome/free-solid-svg-icons": "
|
|
54
|
-
"@fortawesome/react-fontawesome": "
|
|
48
|
+
"@algolia/autocomplete-core": "1.19.5",
|
|
49
|
+
"@clidey/ux": "0.39.0",
|
|
50
|
+
"@fortawesome/fontawesome-svg-core": "7.2.0",
|
|
51
|
+
"@fortawesome/free-brands-svg-icons": "7.2.0",
|
|
52
|
+
"@fortawesome/free-regular-svg-icons": "7.2.0",
|
|
53
|
+
"@fortawesome/free-solid-svg-icons": "7.2.0",
|
|
54
|
+
"@fortawesome/react-fontawesome": "3.2.0",
|
|
55
55
|
"@headlessui/react": "2.2.9",
|
|
56
56
|
"@heroicons/react": "2.2.0",
|
|
57
|
-
"@mdx-js/mdx": "3.1.
|
|
58
|
-
"@mdx-js/preact": "3.1.
|
|
59
|
-
"@mdx-js/rollup": "3.1.
|
|
60
|
-
"@preact/preset-vite": "2.10.
|
|
61
|
-
"@tailwindcss/vite": "4.1.
|
|
62
|
-
"@types/react-highlight-words": "0.20.
|
|
57
|
+
"@mdx-js/mdx": "3.1.1",
|
|
58
|
+
"@mdx-js/preact": "3.1.1",
|
|
59
|
+
"@mdx-js/rollup": "3.1.1",
|
|
60
|
+
"@preact/preset-vite": "2.10.3",
|
|
61
|
+
"@tailwindcss/vite": "4.1.18",
|
|
62
|
+
"@types/react-highlight-words": "0.20.1",
|
|
63
63
|
"classnames": "2.5.1",
|
|
64
|
-
"flexsearch": "0.8.
|
|
64
|
+
"flexsearch": "0.8.212",
|
|
65
65
|
"gray-matter": "4.0.3",
|
|
66
66
|
"gzip-size-cli": "5.1.0",
|
|
67
|
-
"katex": "0.16.
|
|
68
|
-
"lucide-react": "0.
|
|
69
|
-
"mermaid": "11.
|
|
70
|
-
"motion": "12.
|
|
71
|
-
"preact": "10.
|
|
67
|
+
"katex": "0.16.28",
|
|
68
|
+
"lucide-react": "0.563.0",
|
|
69
|
+
"mermaid": "11.12.2",
|
|
70
|
+
"motion": "12.34.0",
|
|
71
|
+
"preact": "10.28.3",
|
|
72
72
|
"prism-react-renderer": "2.4.1",
|
|
73
73
|
"react-highlight-words": "0.21.0",
|
|
74
74
|
"remark-gfm": "4.0.1",
|
|
75
75
|
"saas": "1.0.0",
|
|
76
|
-
"sass-embedded": "1.
|
|
77
|
-
"sirv": "3.0.
|
|
78
|
-
"tailwindcss": "4.1.
|
|
79
|
-
"tsx": "4.
|
|
80
|
-
"typescript": "
|
|
81
|
-
"unist-util-visit": "5.
|
|
82
|
-
"vite": "
|
|
83
|
-
"
|
|
84
|
-
"wouter-preact": "3.7.1"
|
|
76
|
+
"sass-embedded": "1.97.3",
|
|
77
|
+
"sirv": "3.0.2",
|
|
78
|
+
"tailwindcss": "4.1.18",
|
|
79
|
+
"tsx": "4.21.0",
|
|
80
|
+
"typescript": "5.9.3",
|
|
81
|
+
"unist-util-visit": "5.1.0",
|
|
82
|
+
"vite": "7.3.1",
|
|
83
|
+
"wouter-preact": "3.9.0"
|
|
85
84
|
},
|
|
86
85
|
"packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a",
|
|
87
86
|
"devDependencies": {
|
|
88
|
-
"@types/node": "
|
|
89
|
-
"terser": "5.
|
|
87
|
+
"@types/node": "25.2.3",
|
|
88
|
+
"terser": "5.46.0"
|
|
90
89
|
}
|
|
91
90
|
}
|
package/src/components/store.ts
CHANGED
|
@@ -109,7 +109,7 @@ export async function preloadFrontmatter() {
|
|
|
109
109
|
async function addPreloadedContentToSearch() {
|
|
110
110
|
if (!preloadedFrontMatter) return;
|
|
111
111
|
|
|
112
|
-
const mdxFiles = import.meta.glob<{ default: string }>('../../docs/**/*.mdx', { query: 'raw' });
|
|
112
|
+
const mdxFiles = import.meta.glob<{ default: string }>('../../docs/**/*.mdx', { query: '?raw' });
|
|
113
113
|
const fileEntries = Object.entries(mdxFiles);
|
|
114
114
|
|
|
115
115
|
await Promise.all(
|
|
@@ -141,7 +141,7 @@ export async function loadMDXFrontMatterForPath(pathname: string) {
|
|
|
141
141
|
if (completeFrontMatter.find(fm => fm.path === pathname)) return;
|
|
142
142
|
|
|
143
143
|
// Fallback to dynamic loading
|
|
144
|
-
const mdxFiles = import.meta.glob<{ default: string }>('../../docs/**/*.mdx', { query: 'raw' });
|
|
144
|
+
const mdxFiles = import.meta.glob<{ default: string }>('../../docs/**/*.mdx', { query: '?raw' });
|
|
145
145
|
const fileEntries = Object.entries(mdxFiles);
|
|
146
146
|
|
|
147
147
|
const fileEntry = fileEntries.find(([path]) => pathFromFilename(path) === pathname);
|
|
@@ -167,7 +167,7 @@ export async function loadAllMDXFrontMatter(pathname: string) {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
// Fallback to dynamic loading
|
|
170
|
-
const mdxFiles = import.meta.glob<{ default: string }>('../../docs/**/*.mdx', { query: 'raw' });
|
|
170
|
+
const mdxFiles = import.meta.glob<{ default: string }>('../../docs/**/*.mdx', { query: '?raw' });
|
|
171
171
|
const fileEntries = Object.entries(mdxFiles);
|
|
172
172
|
|
|
173
173
|
const remainingEntries = fileEntries.filter(([path]) => pathFromFilename(path) !== pathname);
|
|
@@ -327,7 +327,8 @@ export function APIPlayground({
|
|
|
327
327
|
const [isLoading, setIsLoading] = useState(false)
|
|
328
328
|
const [response, setResponse] = useState<ResponseData | null>(null)
|
|
329
329
|
const [error, setError] = useState<string | null>(null)
|
|
330
|
-
const
|
|
330
|
+
const { theme } = useTheme();
|
|
331
|
+
const isDark = theme === 'dark' || (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
331
332
|
const [selectedServer, setSelectedServer] = useState<Server | null>(servers?.[0] || null)
|
|
332
333
|
|
|
333
334
|
// Request configuration state
|
package/src/mdx/fence.tsx
CHANGED
|
@@ -14,7 +14,8 @@ export function Fence({
|
|
|
14
14
|
children: string
|
|
15
15
|
language: string
|
|
16
16
|
}) {
|
|
17
|
-
const
|
|
17
|
+
const { theme } = useTheme();
|
|
18
|
+
const isDark = theme === 'dark' || (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
18
19
|
|
|
19
20
|
if (language === 'mermaid') {
|
|
20
21
|
return (
|
package/src/mdx/latex.tsx
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { ExclamationTriangleIcon } from '@heroicons/react/24/outline'
|
|
2
2
|
import { useEffect, useRef, useState } from 'react'
|
|
3
3
|
|
|
4
|
+
function extractText(node: React.ReactNode): string {
|
|
5
|
+
if (typeof node === 'string') return node;
|
|
6
|
+
if (typeof node === 'number') return String(node);
|
|
7
|
+
if (!node) return '';
|
|
8
|
+
if (Array.isArray(node)) return node.map(extractText).join('');
|
|
9
|
+
if (typeof node === 'object' && 'props' in node) return extractText((node as any).props.children);
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
|
|
4
13
|
interface LatexProps {
|
|
5
|
-
children:
|
|
14
|
+
children: React.ReactNode
|
|
6
15
|
}
|
|
7
16
|
|
|
8
17
|
export function Latex({ children }: LatexProps) {
|
|
18
|
+
const expression = extractText(children).trim();
|
|
9
19
|
const containerRef = useRef<HTMLDivElement>(null)
|
|
10
20
|
const [error, setError] = useState<string | null>(null)
|
|
11
21
|
const [isLoading, setIsLoading] = useState(true)
|
|
@@ -26,7 +36,7 @@ export function Latex({ children }: LatexProps) {
|
|
|
26
36
|
|
|
27
37
|
if (!mounted || !containerRef.current) return
|
|
28
38
|
|
|
29
|
-
katex.render(
|
|
39
|
+
katex.render(expression, containerRef.current, {
|
|
30
40
|
displayMode: true,
|
|
31
41
|
throwOnError: false,
|
|
32
42
|
})
|
|
@@ -45,7 +55,7 @@ export function Latex({ children }: LatexProps) {
|
|
|
45
55
|
return () => {
|
|
46
56
|
mounted = false
|
|
47
57
|
}
|
|
48
|
-
}, [
|
|
58
|
+
}, [expression])
|
|
49
59
|
|
|
50
60
|
if (error) {
|
|
51
61
|
return (
|