mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Chore: bump deps & migrate to React 19.2
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
---
|
||||
'@fumadocs/content-collections': patch
|
||||
'create-fumadocs-app': patch
|
||||
'@fumadocs/mdx-remote': patch
|
||||
'fumadocs-typescript': patch
|
||||
'fumadocs-obsidian': patch
|
||||
'fumadocs-twoslash': patch
|
||||
'fumadocs-docgen': patch
|
||||
'fumadocs-openapi': patch
|
||||
'fumadocs-python': patch
|
||||
'fumadocs-core': patch
|
||||
'@fumadocs/cli': patch
|
||||
'fumadocs-mdx': patch
|
||||
'fumadocs-ui': patch
|
||||
---
|
||||
|
||||
Bump deps
|
||||
+12
-12
@@ -13,9 +13,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/openai-compatible": "^1.0.19",
|
||||
"@ai-sdk/react": "^2.0.56",
|
||||
"@ai-sdk/react": "^2.0.59",
|
||||
"@fumadocs/mdx-remote": "workspace:*",
|
||||
"@mixedbread/sdk": "^0.29.0",
|
||||
"@mixedbread/sdk": "^0.31.1",
|
||||
"@orama/orama": "^3.1.14",
|
||||
"@oramacloud/client": "^2.1.4",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
@@ -27,7 +27,7 @@
|
||||
"@takumi-rs/core": "^0.32.2",
|
||||
"@takumi-rs/helpers": "^0.32.2",
|
||||
"@takumi-rs/image-response": "^0.32.2",
|
||||
"ai": "^5.0.56",
|
||||
"ai": "^5.0.59",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"d3-force": "^3.0.0",
|
||||
"feed": "^5.1.0",
|
||||
@@ -45,9 +45,9 @@
|
||||
"next": "15.5.4",
|
||||
"next-themes": "^0.4.6",
|
||||
"octokit": "^5.0.3",
|
||||
"oxc-transform": "^0.92.0",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"oxc-transform": "^0.93.0",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-force-graph-2d": "^1.29.0",
|
||||
"react-remove-scroll": "^2.7.1",
|
||||
"rehype-katex": "^7.0.1",
|
||||
@@ -68,14 +68,14 @@
|
||||
"@next/bundle-analyzer": "15.5.4",
|
||||
"@next/env": "15.5.4",
|
||||
"@next/eslint-plugin-next": "15.5.4",
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@types/d3-force": "^3.0.10",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"algoliasearch": "5.39.0",
|
||||
"browserslist-config-baseline": "^0.5.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
@@ -83,13 +83,13 @@
|
||||
"next-validate-link": "^1.6.3",
|
||||
"postcss": "^8.5.6",
|
||||
"shadcn": "3.3.1",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"tinyexec": "^1.0.1",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-morph": "^27.0.0",
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.9.2"
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"browserslist": [
|
||||
"extends browserslist-config-baseline/2024"
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"next": "^15.5.4",
|
||||
"react": "19.1.1",
|
||||
"react-dom": "19.1.1"
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@content-collections/core": "^0.11.1",
|
||||
"@content-collections/mdx": "^0.2.2",
|
||||
"@content-collections/next": "^0.2.7",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"typescript": "^5.9.2"
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,22 +14,22 @@
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"fumapress": "workspace:*",
|
||||
"isbot": "^5.1.31",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router": "^7.9.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@remix-run/node-fetch-server": "^0.9.0",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"express": "^5.1.0",
|
||||
"react-router-devtools": "^5.1.3",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "^7.1.7",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.1.8",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"next": "15.5.4",
|
||||
"react": "19.1.1",
|
||||
"react-dom": "19.1.1"
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"typescript": "^5.9.2"
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
"github-slugger": "^2.0.0",
|
||||
"html-react-parser": "^5.2.6",
|
||||
"next": "15.5.4",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"shiki": "^3.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2"
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"next": "15.5.4",
|
||||
"react": "19.1.1",
|
||||
"react-dom": "19.1.1"
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2"
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,16 +13,16 @@
|
||||
"fumadocs-obsidian": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"next": "15.5.4",
|
||||
"react": "19.1.1",
|
||||
"react-dom": "19.1.1"
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2"
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
"fumadocs-openapi": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"next": "15.5.4",
|
||||
"react": "19.1.1",
|
||||
"react-dom": "19.1.1",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0",
|
||||
"shiki": "^3.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"postcss": "^8.5.6",
|
||||
"rimraf": "^6.0.1",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2"
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
"fumadocs-python": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"next": "15.5.4",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1"
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2"
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,21 +16,21 @@
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"isbot": "^5.1.31",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router": "^7.9.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-router/dev": "^7.9.3",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"react-router-devtools": "^5.1.3",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "^7.1.7",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.1.8",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,22 +15,22 @@
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"isbot": "^5.1.31",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router": "^7.9.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-router/dev": "^7.9.3",
|
||||
"@vitejs/plugin-rsc": "^0.4.32",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"@vitejs/plugin-rsc": "^0.4.32",
|
||||
"react-router-devtools": "^5.1.3",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "^7.1.7",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.1.8",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"next": "15.5.4",
|
||||
"react": "19.1.1",
|
||||
"react-dom": "19.1.1",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0",
|
||||
"tinyglobby": "^0.2.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"typescript": "^5.9.2"
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,27 +10,27 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@orama/tokenizers": "^3.1.14",
|
||||
"@tanstack/react-router": "^1.132.7",
|
||||
"@tanstack/react-router-devtools": "^1.132.11",
|
||||
"@tanstack/react-start": "^1.132.13",
|
||||
"@tanstack/react-router": "^1.132.31",
|
||||
"@tanstack/react-router-devtools": "^1.132.31",
|
||||
"@tanstack/react-start": "^1.132.31",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"lucide-static": "^0.544.0",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"tailwind-merge": "^3.3.1",
|
||||
"vite": "^7.1.7"
|
||||
"vite": "^7.1.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@vitejs/plugin-react": "^5.0.3",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,27 +9,27 @@
|
||||
"start": "node .output/server/index.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-router": "^1.132.7",
|
||||
"@tanstack/react-router-devtools": "^1.132.11",
|
||||
"@tanstack/react-start": "^1.132.13",
|
||||
"@tanstack/react-router": "^1.132.31",
|
||||
"@tanstack/react-router-devtools": "^1.132.31",
|
||||
"@tanstack/react-start": "^1.132.31",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"lucide-static": "^0.544.0",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"tailwind-merge": "^3.3.1",
|
||||
"vite": "^7.1.7"
|
||||
"vite": "^7.1.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@vitejs/plugin-react": "^5.0.3",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,20 +13,20 @@
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-server-dom-webpack": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-server-dom-webpack": "^19.2.0",
|
||||
"waku": "^0.26.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "^7.1.7",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.1.8",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,21 +14,21 @@
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-openapi": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-server-dom-webpack": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-server-dom-webpack": "^19.2.0",
|
||||
"waku": "^0.26.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "7.1.7",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "7.1.8",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -12,20 +12,20 @@
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-server-dom-webpack": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-server-dom-webpack": "^19.2.0",
|
||||
"waku": "^0.26.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "^7.1.7",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.1.8",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -19,19 +19,19 @@
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.29.7",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"bun": "^1.2.22",
|
||||
"bun": "^1.2.23",
|
||||
"concurrently": "^9.2.1",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "5.2.0",
|
||||
"eslint-plugin-react-hooks": "6.1.0",
|
||||
"eslint-plugin-tailwindcss": "^3.18.2",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-astro": "^0.14.1",
|
||||
"rimraf": "^6.0.1",
|
||||
"tsup": "8.5.0",
|
||||
"turbo": "2.5.8",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript-eslint": "^8.44.1",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.45.0",
|
||||
"vitest": "^3.2.4"
|
||||
},
|
||||
"packageManager": "[email protected]",
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"zod": "^4.1.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "24.5.2",
|
||||
"@types/node": "24.6.2",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"shadcn": "3.3.1",
|
||||
"tsconfig": "workspace:*"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"devDependencies": {
|
||||
"@content-collections/core": "^0.11.1",
|
||||
"@content-collections/mdx": "^0.2.2",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/node": "24.6.2",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"tsconfig": "workspace:*",
|
||||
|
||||
@@ -138,16 +138,16 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdx-js/mdx": "^3.1.1",
|
||||
"@mixedbread/sdk": "^0.29.0",
|
||||
"@mixedbread/sdk": "^0.31.1",
|
||||
"@oramacloud/client": "^2.1.4",
|
||||
"@tanstack/react-router": "^1.132.7",
|
||||
"@tanstack/react-router": "^1.132.31",
|
||||
"@types/estree-jsx": "^1.0.5",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/negotiator": "^0.6.4",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"algoliasearch": "5.39.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"lucide-react": "^0.544.0",
|
||||
@@ -158,7 +158,7 @@
|
||||
"remark-mdx": "^3.1.1",
|
||||
"remove-markdown": "^0.6.2",
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"unified": "^11.0.5",
|
||||
"vfile": "^6.0.3",
|
||||
"waku": "^0.26.1"
|
||||
@@ -169,12 +169,12 @@
|
||||
"@tanstack/react-router": "1.x.x",
|
||||
"@types/react": "*",
|
||||
"algoliasearch": "5.x.x",
|
||||
"lucide-react": "*",
|
||||
"next": "14.x.x || 15.x.x",
|
||||
"react": "18.x.x || 19.x.x",
|
||||
"react-dom": "18.x.x || 19.x.x",
|
||||
"react-router": "7.x.x",
|
||||
"waku": "^0.26.0",
|
||||
"lucide-react": "*"
|
||||
"waku": "^0.26.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@mixedbread/sdk": {
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
'use client';
|
||||
import { useCallback, useRef } from 'react';
|
||||
import * as React from 'react';
|
||||
|
||||
type UseEffectEvent = <F extends (...params: never[]) => unknown>(
|
||||
callback: F,
|
||||
) => F;
|
||||
|
||||
/**
|
||||
* Don't use this, could be deleted anytime.
|
||||
* Polyfill for React.js 19.2 `useEffectEvent`.
|
||||
*
|
||||
* @internal
|
||||
* @internal Don't use this, could be deleted anytime.
|
||||
*/
|
||||
export function useEffectEvent<F extends (...params: never[]) => unknown>(
|
||||
callback: F,
|
||||
): F {
|
||||
const ref = useRef(callback);
|
||||
ref.current = callback;
|
||||
export const useEffectEvent: UseEffectEvent =
|
||||
React.useEffectEvent ??
|
||||
(<F extends (...params: never[]) => unknown>(callback: F) => {
|
||||
const ref = React.useRef(callback);
|
||||
ref.current = callback;
|
||||
|
||||
return useCallback(((...params) => ref.current(...params)) as F, []);
|
||||
}
|
||||
return React.useCallback(((...params) => ref.current(...params)) as F, []);
|
||||
});
|
||||
|
||||
@@ -4,37 +4,37 @@
|
||||
"private": true,
|
||||
"description": "Used to track dependency versions in create-fumadocs-app",
|
||||
"dependencies": {
|
||||
"@biomejs/biome": "^2.2.4",
|
||||
"@biomejs/biome": "^2.2.5",
|
||||
"@content-collections/core": "^0.11.1",
|
||||
"@content-collections/mdx": "^0.2.2",
|
||||
"@content-collections/next": "^0.2.7",
|
||||
"@react-router/dev": "^7.9.3",
|
||||
"@react-router/node": "^7.9.3",
|
||||
"@react-router/serve": "^7.9.3",
|
||||
"@tailwindcss/postcss": "^4.1.13",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@tanstack/react-router": "^1.132.7",
|
||||
"@tanstack/react-start": "^1.132.13",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@tanstack/react-router": "^1.132.31",
|
||||
"@tanstack/react-start": "^1.132.31",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@vitejs/plugin-react": "^5.0.3",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"gray-matter": "^4.0.3",
|
||||
"isbot": "^5.1.31",
|
||||
"lucide-react": "^0.544.0",
|
||||
"next": "15.5.4",
|
||||
"postcss": "^8.5.6",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router": "^7.9.3",
|
||||
"react-router-devtools": "^5.1.3",
|
||||
"shiki": "^3.13.0",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vinxi": "^0.5.8",
|
||||
"vite": "^7.1.7",
|
||||
"vite": "^7.1.8",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cross-spawn": "^6.0.6",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/node": "24.6.2",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.9.2"
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.17.0"
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"estree-util-to-js": "^2.0.0",
|
||||
"estree-util-value-to-estree": "^3.4.0",
|
||||
"npm-to-yarn": "^3.0.1",
|
||||
"oxc-transform": "^0.92.0",
|
||||
"oxc-transform": "^0.93.0",
|
||||
"unist-util-visit": "^5.0.0",
|
||||
"zod": "^4.1.11"
|
||||
},
|
||||
@@ -52,13 +52,13 @@
|
||||
"@types/estree": "^1.0.8",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/node": "24.6.2",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"mdast-util-mdx-jsx": "^3.2.0",
|
||||
"remark": "^15.0.0",
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"unified": "^11.0.5",
|
||||
"vfile": "^6.0.3"
|
||||
},
|
||||
|
||||
@@ -42,11 +42,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"react": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"tsconfig": "workspace:*",
|
||||
"unified": "^11.0.5",
|
||||
|
||||
@@ -88,26 +88,26 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fumadocs/mdx-remote": "workspace:*",
|
||||
"@types/bun": "^1.2.22",
|
||||
"@types/bun": "^1.2.23",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"mdast-util-directive": "^3.1.0",
|
||||
"mdast-util-mdx-jsx": "^3.2.0",
|
||||
"next": "^15.5.4",
|
||||
"react": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"remark": "^15.0.1",
|
||||
"remark-directive": "^4.0.0",
|
||||
"remark-stringify": "^11.0.0",
|
||||
"rollup": "^4.52.2",
|
||||
"rollup": "^4.52.3",
|
||||
"tsconfig": "workspace:*",
|
||||
"vfile": "^6.0.3",
|
||||
"vite": "^7.1.7",
|
||||
"webpack": "^5.101.3"
|
||||
"vite": "^7.1.8",
|
||||
"webpack": "^5.102.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@fumadocs/mdx-remote": "^1.4.0",
|
||||
|
||||
@@ -52,14 +52,14 @@
|
||||
"@types/estree": "^1.0.8",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"mdast-util-mdx-jsx": "^3.2.0",
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vfile": "^6.0.3"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
|
||||
@@ -76,15 +76,15 @@
|
||||
"xml-js": "^1.6.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@scalar/api-client-react": "^1.3.41",
|
||||
"@scalar/api-client-react": "^1.3.42",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/openapi-sampler": "^1.0.3",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"json-schema-typed": "^8.0.1",
|
||||
"openapi-types": "^12.1.3",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tsc-alias": "^1.8.16",
|
||||
"tsconfig": "workspace:*"
|
||||
},
|
||||
|
||||
@@ -722,7 +722,7 @@ function useAuthInputs(securities?: SecurityEntry[]) {
|
||||
return result;
|
||||
}, [securities]);
|
||||
|
||||
const mapInputs = useEffectEvent((values: FormValues) => {
|
||||
const mapInputs = (values: FormValues) => {
|
||||
for (const item of inputs) {
|
||||
if (!item.mapOutput) continue;
|
||||
|
||||
@@ -730,7 +730,7 @@ function useAuthInputs(securities?: SecurityEntry[]) {
|
||||
}
|
||||
|
||||
return values;
|
||||
});
|
||||
};
|
||||
|
||||
return { inputs, mapInputs };
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/ui/components/select';
|
||||
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
||||
import {
|
||||
joinURL,
|
||||
resolveRequestData,
|
||||
@@ -33,11 +32,9 @@ type UpdateListener = (data: RawRequestData, encoded: RequestData) => void;
|
||||
|
||||
const CodeExampleContext = createContext<{
|
||||
route: string;
|
||||
examples: {
|
||||
key: string;
|
||||
data: RawRequestData;
|
||||
encoded: RequestData;
|
||||
}[];
|
||||
getExample: (
|
||||
key: string,
|
||||
) => { data: RawRequestData; encoded: RequestData } | undefined;
|
||||
|
||||
key: string;
|
||||
setKey: (key: string) => void;
|
||||
@@ -65,45 +62,8 @@ export function CodeExampleProvider({
|
||||
}) {
|
||||
const [key, setKey] = useState(initialKey ?? examples[0].key);
|
||||
const listeners = useRef<UpdateListener[]>([]);
|
||||
|
||||
const setData = useEffectEvent(
|
||||
(data: RawRequestData, encoded: RequestData) => {
|
||||
for (const example of examples) {
|
||||
if (example.key === key) {
|
||||
// persistent changes
|
||||
example.data = data;
|
||||
example.encoded = encoded;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (const listener of listeners.current) {
|
||||
listener(data, encoded);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const updateKey = useEffectEvent((newKey: string) => {
|
||||
const example = examples.find((example) => example.key === newKey);
|
||||
if (!example) return;
|
||||
|
||||
setKey(newKey);
|
||||
for (const listener of listeners.current) {
|
||||
listener(example.data, example.encoded);
|
||||
}
|
||||
});
|
||||
|
||||
const addListener = useEffectEvent((listener: UpdateListener) => {
|
||||
// initial call to listeners to ensure their data is the latest
|
||||
// this is necessary to avoid race conditions between `useEffect()`
|
||||
const example = examples.find((example) => example.key === key)!;
|
||||
listener(example.data, example.encoded);
|
||||
listeners.current.push(listener);
|
||||
});
|
||||
|
||||
const removeListener = useEffectEvent((listener: UpdateListener) => {
|
||||
listeners.current = listeners.current.filter((item) => item !== listener);
|
||||
});
|
||||
const examplesRef = useRef(examples);
|
||||
examplesRef.current = examples;
|
||||
|
||||
return (
|
||||
<CodeExampleContext
|
||||
@@ -111,13 +71,50 @@ export function CodeExampleProvider({
|
||||
() => ({
|
||||
key,
|
||||
route,
|
||||
setKey: updateKey,
|
||||
examples,
|
||||
setData,
|
||||
removeListener,
|
||||
addListener,
|
||||
setKey: (newKey: string) => {
|
||||
const example = examplesRef.current.find(
|
||||
(example) => example.key === newKey,
|
||||
);
|
||||
if (!example) return;
|
||||
|
||||
setKey(newKey);
|
||||
for (const listener of listeners.current) {
|
||||
listener(example.data, example.encoded);
|
||||
}
|
||||
},
|
||||
getExample: (key) => {
|
||||
return examplesRef.current.find((example) => example.key === key);
|
||||
},
|
||||
setData: (data, encoded) => {
|
||||
for (const example of examplesRef.current) {
|
||||
if (example.key === key) {
|
||||
// persistent changes
|
||||
example.data = data;
|
||||
example.encoded = encoded;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (const listener of listeners.current) {
|
||||
listener(data, encoded);
|
||||
}
|
||||
},
|
||||
removeListener: (listener) => {
|
||||
listeners.current = listeners.current.filter(
|
||||
(item) => item !== listener,
|
||||
);
|
||||
},
|
||||
addListener: (listener) => {
|
||||
// initial call to listeners to ensure their data is the latest
|
||||
// this is necessary to avoid race conditions between `useEffect()`
|
||||
const example = examplesRef.current.find(
|
||||
(example) => example.key === key,
|
||||
)!;
|
||||
listener(example.data, example.encoded);
|
||||
listeners.current.push(listener);
|
||||
},
|
||||
}),
|
||||
[addListener, examples, key, removeListener, route, setData, updateKey],
|
||||
[key, route],
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
@@ -127,12 +124,10 @@ export function CodeExampleProvider({
|
||||
|
||||
export function CodeExample(sample: CodeSample) {
|
||||
const { shikiOptions, mediaAdapters } = useApiContext();
|
||||
const { examples, key, route, addListener, removeListener } =
|
||||
const { getExample, key, route, addListener, removeListener } =
|
||||
useContext(CodeExampleContext)!;
|
||||
const { server } = useServerSelectContext();
|
||||
const [data, setData] = useState(() => {
|
||||
return examples.find((example) => example.key === key)!.encoded;
|
||||
});
|
||||
const [data, setData] = useState(() => getExample(key)!.encoded);
|
||||
|
||||
useEffect(() => {
|
||||
const listener: UpdateListener = (_, encoded) => setData(encoded);
|
||||
@@ -209,12 +204,9 @@ function SelectDisplay({
|
||||
}
|
||||
|
||||
export function useRequestInitialData() {
|
||||
const { examples, key } = useContext(CodeExampleContext)!;
|
||||
const { getExample, key } = useContext(CodeExampleContext)!;
|
||||
|
||||
return useMemo(
|
||||
() => examples.find((example) => example.key === key)!.data,
|
||||
[examples, key],
|
||||
);
|
||||
return getExample(key)!.data;
|
||||
}
|
||||
|
||||
export function useRequestDataUpdater() {
|
||||
|
||||
@@ -26,27 +26,27 @@
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"dependencies": {
|
||||
"@vitejs/plugin-react": "^5.0.3",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"@vitejs/plugin-rsc": "^0.4.32",
|
||||
"commander": "^14.0.1",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-mdx": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"picocolors": "^1.1.1",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router": "^7.9.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"vite": "^7.1.7"
|
||||
"vite": "^7.1.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.9.2"
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*"
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/node": "^24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
"devDependencies": {
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"tsconfig": "workspace:*"
|
||||
|
||||
@@ -49,14 +49,14 @@
|
||||
"@types/estree": "^1.0.8",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/node": "24.5.2",
|
||||
"@types/react": "19.1.14",
|
||||
"@types/react-dom": "19.1.9",
|
||||
"@types/node": "24.6.2",
|
||||
"@types/react": "19.2.0",
|
||||
"@types/react-dom": "19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"fumadocs-ui": "workspace:*",
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"unified": "^11.0.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -136,14 +136,14 @@
|
||||
"devDependencies": {
|
||||
"@fumadocs/cli": "workspace:*",
|
||||
"@next/eslint-plugin-next": "^15.5.4",
|
||||
"@tailwindcss/cli": "^4.1.13",
|
||||
"@tailwindcss/cli": "^4.1.14",
|
||||
"@types/lodash.merge": "^4.6.9",
|
||||
"@types/react": "^19.1.14",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@types/react": "^19.2.0",
|
||||
"@types/react-dom": "^19.2.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"fumadocs-core": "workspace:*",
|
||||
"next": "15.5.4",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tsc-alias": "^1.8.16",
|
||||
"tsconfig": "workspace:*"
|
||||
},
|
||||
|
||||
@@ -283,7 +283,7 @@ export function SearchDialogList({
|
||||
observer.disconnect();
|
||||
window.removeEventListener('keydown', onKey);
|
||||
};
|
||||
}, [onKey]);
|
||||
}, []);
|
||||
|
||||
useOnChange(items, () => {
|
||||
if (items && items.length > 0) {
|
||||
|
||||
@@ -61,7 +61,7 @@ export function TocThumb({
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
};
|
||||
}, [containerRef, onResize]);
|
||||
}, [containerRef]);
|
||||
|
||||
useOnChange(active, () => {
|
||||
if (!containerRef.current || !thumbRef.current) return;
|
||||
|
||||
@@ -95,7 +95,7 @@ export function Tabs({
|
||||
return () => {
|
||||
removeChangeListener(groupId, onChange);
|
||||
};
|
||||
}, [groupId, onChange, persist]);
|
||||
}, [groupId, persist]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const hash = window.location.hash.slice(1);
|
||||
@@ -108,7 +108,7 @@ export function Tabs({
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, [onChange, valueToIdMap]);
|
||||
}, [valueToIdMap]);
|
||||
|
||||
return (
|
||||
<Primitive.Tabs
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// TODO: remove next major
|
||||
import type { I18nProviderProps } from '@/provider/base';
|
||||
import { usePathname, useRouter } from 'fumadocs-core/framework';
|
||||
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
||||
import { useMemo } from 'react';
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { defaultTranslations, I18nContext } from '@/contexts/i18n';
|
||||
|
||||
/**
|
||||
@@ -23,22 +22,23 @@ export function I18nProvider({
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const onChange = useEffectEvent((value: string) => {
|
||||
if (onLocaleChange) {
|
||||
return onLocaleChange(value);
|
||||
}
|
||||
const segments = pathname.split('/').filter((v) => v.length > 0);
|
||||
const onChange =
|
||||
onLocaleChange ??
|
||||
((value: string) => {
|
||||
const segments = pathname.split('/').filter((v) => v.length > 0);
|
||||
|
||||
// If locale prefix hidden
|
||||
if (segments[0] !== locale) {
|
||||
segments.unshift(value);
|
||||
} else {
|
||||
segments[0] = value;
|
||||
}
|
||||
// If locale prefix hidden
|
||||
if (segments[0] !== locale) {
|
||||
segments.unshift(value);
|
||||
} else {
|
||||
segments[0] = value;
|
||||
}
|
||||
|
||||
router.push(`/${segments.join('/')}`);
|
||||
router.refresh();
|
||||
});
|
||||
router.push(`/${segments.join('/')}`);
|
||||
router.refresh();
|
||||
});
|
||||
const onChangeRef = useRef(onChange);
|
||||
onChangeRef.current = onChange;
|
||||
|
||||
return (
|
||||
<I18nContext.Provider
|
||||
@@ -50,9 +50,9 @@ export function I18nProvider({
|
||||
...defaultTranslations,
|
||||
...props.translations,
|
||||
},
|
||||
onChange,
|
||||
onChange: (v) => onChangeRef.current(v),
|
||||
}),
|
||||
[locale, locales, onChange, props.translations],
|
||||
[locale, locales, props.translations],
|
||||
)}
|
||||
>
|
||||
{props.children}
|
||||
|
||||
@@ -179,7 +179,7 @@ export function PageTOCPopover(props: ComponentProps<'div'>) {
|
||||
return () => {
|
||||
window.removeEventListener('click', onClick);
|
||||
};
|
||||
}, [onClick]);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<TocPopoverContext.Provider
|
||||
|
||||
@@ -6,12 +6,12 @@ import {
|
||||
lazy,
|
||||
type ReactNode,
|
||||
useMemo,
|
||||
useRef,
|
||||
} from 'react';
|
||||
import { DirectionProvider } from '@radix-ui/react-direction';
|
||||
import type { DefaultSearchDialogProps } from '@/components/dialog/search-default';
|
||||
import { SidebarProvider } from '@/contexts/sidebar';
|
||||
import { SearchProvider, type SearchProviderProps } from '@/contexts/search';
|
||||
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
||||
import {
|
||||
defaultTranslations,
|
||||
I18nContext,
|
||||
@@ -132,11 +132,12 @@ function I18nProvider({
|
||||
locales = [],
|
||||
locale,
|
||||
onLocaleChange,
|
||||
...props
|
||||
children,
|
||||
translations,
|
||||
}: I18nProviderProps) {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const onChange = useEffectEvent((value: string) => {
|
||||
const onChange = (value: string) => {
|
||||
if (onLocaleChange) {
|
||||
return onLocaleChange(value);
|
||||
}
|
||||
@@ -150,7 +151,9 @@ function I18nProvider({
|
||||
}
|
||||
|
||||
router.push(`/${segments.join('/')}`);
|
||||
});
|
||||
};
|
||||
const onChangeRef = useRef(onChange);
|
||||
onChangeRef.current = onChange;
|
||||
|
||||
return (
|
||||
<I18nContext.Provider
|
||||
@@ -160,14 +163,14 @@ function I18nProvider({
|
||||
locales,
|
||||
text: {
|
||||
...defaultTranslations,
|
||||
...props.translations,
|
||||
...translations,
|
||||
},
|
||||
onChange,
|
||||
onChange: (v) => onChangeRef.current(v),
|
||||
}),
|
||||
[locale, locales, onChange, props.translations],
|
||||
[locale, locales, translations],
|
||||
)}
|
||||
>
|
||||
{props.children}
|
||||
{children}
|
||||
</I18nContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
'use client';
|
||||
import { type MouseEventHandler, useEffect, useRef, useState } from 'react';
|
||||
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
||||
import {
|
||||
type MouseEventHandler,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
export function useCopyButton(
|
||||
onCopy: () => void | Promise<void>,
|
||||
): [checked: boolean, onClick: MouseEventHandler] {
|
||||
const [checked, setChecked] = useState(false);
|
||||
const callbackRef = useRef(onCopy);
|
||||
const timeoutRef = useRef<number | null>(null);
|
||||
|
||||
const onClick: MouseEventHandler = useEffectEvent(() => {
|
||||
callbackRef.current = onCopy;
|
||||
|
||||
const onClick: MouseEventHandler = useCallback(() => {
|
||||
if (timeoutRef.current) window.clearTimeout(timeoutRef.current);
|
||||
const res = Promise.resolve(onCopy());
|
||||
const res = Promise.resolve(callbackRef.current());
|
||||
|
||||
void res.then(() => {
|
||||
setChecked(true);
|
||||
@@ -18,7 +26,7 @@ export function useCopyButton(
|
||||
setChecked(false);
|
||||
}, 1500);
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
|
||||
// Avoid updates after being unmounted
|
||||
useEffect(() => {
|
||||
|
||||
Generated
+4135
-3941
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user