@windrun-huaiin/third-ui 26.0.0 → 28.0.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.
Files changed (210) hide show
  1. package/dist/ai/ai-prompt-textarea.d.ts +72 -0
  2. package/dist/ai/ai-prompt-textarea.js +114 -0
  3. package/dist/ai/ai-prompt-textarea.mjs +112 -0
  4. package/dist/ai/index.d.ts +1 -0
  5. package/dist/ai/index.js +2 -0
  6. package/dist/ai/index.mjs +1 -0
  7. package/dist/clerk/clerk-provider-client.js +0 -1
  8. package/dist/clerk/clerk-provider-client.mjs +0 -1
  9. package/dist/clerk/fingerprint/fingerprint-client.js +0 -4
  10. package/dist/clerk/fingerprint/fingerprint-client.mjs +0 -4
  11. package/dist/clerk/fingerprint/use-fingerprint.js +0 -6
  12. package/dist/clerk/fingerprint/use-fingerprint.mjs +0 -6
  13. package/dist/clerk/signin-with-fingerprint-client.js +0 -9
  14. package/dist/clerk/signin-with-fingerprint-client.mjs +0 -9
  15. package/dist/clerk/signup-button-with-fingerprint-client.js +0 -16
  16. package/dist/clerk/signup-button-with-fingerprint-client.mjs +0 -16
  17. package/dist/clerk/signup-with-fingerprint-client.js +0 -9
  18. package/dist/clerk/signup-with-fingerprint-client.mjs +0 -9
  19. package/dist/fuma/base/custom-header.js +10 -8
  20. package/dist/fuma/base/custom-header.mjs +10 -8
  21. package/dist/fuma/base/custom-home-layout.d.ts +0 -4
  22. package/dist/fuma/base/docs-root-provider.d.ts +19 -0
  23. package/dist/fuma/base/docs-root-provider.js +17 -0
  24. package/dist/fuma/base/docs-root-provider.mjs +15 -0
  25. package/dist/fuma/base/index.d.ts +5 -0
  26. package/dist/fuma/base/index.js +16 -7
  27. package/dist/fuma/base/index.mjs +5 -1
  28. package/dist/fuma/base/nav-config.d.ts +10 -0
  29. package/dist/fuma/base/nav-config.js +32 -0
  30. package/dist/fuma/base/nav-config.mjs +28 -0
  31. package/dist/fuma/base/site-docs-layout.d.ts +11 -0
  32. package/dist/fuma/base/site-docs-layout.js +15 -0
  33. package/dist/fuma/base/site-docs-layout.mjs +13 -0
  34. package/dist/fuma/base/site-home-layout.d.ts +24 -0
  35. package/dist/fuma/base/site-home-layout.js +16 -0
  36. package/dist/fuma/base/site-home-layout.mjs +14 -0
  37. package/dist/fuma/base/site-layout-shared.d.ts +89 -0
  38. package/dist/fuma/base/site-layout-shared.js +48 -0
  39. package/dist/fuma/base/site-layout-shared.mjs +42 -0
  40. package/dist/fuma/base/site-layout.d.ts +4 -116
  41. package/dist/fuma/base/site-layout.js +2 -2
  42. package/dist/fuma/base/site-layout.mjs +2 -2
  43. package/dist/fuma/fuma-page-genarator.d.ts +1 -1
  44. package/dist/fuma/fuma-page-genarator.js +65 -10
  45. package/dist/fuma/fuma-page-genarator.mjs +61 -6
  46. package/dist/fuma/llm-copy-handler.js +0 -9
  47. package/dist/fuma/llm-copy-handler.mjs +0 -9
  48. package/dist/fuma/mdx/index.d.ts +0 -1
  49. package/dist/fuma/mdx/index.js +0 -2
  50. package/dist/fuma/mdx/index.mjs +0 -1
  51. package/dist/fuma/mdx/suno-embed.js +3 -1
  52. package/dist/fuma/mdx/suno-embed.mjs +3 -1
  53. package/dist/fuma/mdx/toc-base.js +0 -1
  54. package/dist/fuma/mdx/toc-base.mjs +0 -1
  55. package/dist/fuma/server/features/widgets.js +5 -1
  56. package/dist/fuma/server/features/widgets.mjs +5 -1
  57. package/dist/fuma/server/llm-copy-handler.d.ts +2 -0
  58. package/dist/fuma/server/llm-copy-handler.js +7 -0
  59. package/dist/fuma/server/llm-copy-handler.mjs +1 -0
  60. package/dist/fuma/server/page-generator.d.ts +2 -0
  61. package/dist/fuma/server/page-generator.js +7 -0
  62. package/dist/fuma/server/page-generator.mjs +1 -0
  63. package/dist/lib/seo-metadata.js +3 -3
  64. package/dist/lib/seo-metadata.mjs +1 -1
  65. package/dist/lib/seo-util.js +4 -4
  66. package/dist/lib/seo-util.mjs +1 -1
  67. package/dist/lib/site-docs-helper.d.ts +51 -0
  68. package/dist/lib/site-docs-helper.js +68 -0
  69. package/dist/lib/site-docs-helper.mjs +66 -0
  70. package/dist/main/alert-dialog/index.js +14 -0
  71. package/dist/main/alert-dialog/index.mjs +5 -0
  72. package/dist/main/buttons/gradient-button.d.ts +20 -0
  73. package/dist/main/buttons/gradient-button.js +88 -0
  74. package/dist/main/buttons/gradient-button.mjs +86 -0
  75. package/dist/main/buttons/index.d.ts +3 -0
  76. package/dist/main/buttons/index.js +12 -0
  77. package/dist/main/buttons/index.mjs +4 -0
  78. package/dist/main/buttons/x-button.d.ts +39 -0
  79. package/dist/main/buttons/x-button.js +92 -0
  80. package/dist/main/buttons/x-button.mjs +90 -0
  81. package/dist/main/buttons/x-toggle-button.d.ts +32 -0
  82. package/dist/main/buttons/x-toggle-button.js +95 -0
  83. package/dist/main/buttons/x-toggle-button.mjs +74 -0
  84. package/dist/main/credit/credit-nav-button.js +25 -1
  85. package/dist/main/credit/credit-nav-button.mjs +25 -1
  86. package/dist/main/credit/credit-overview-client.js +3 -2
  87. package/dist/main/credit/credit-overview-client.mjs +3 -2
  88. package/dist/main/credit/index.d.ts +4 -0
  89. package/dist/main/credit/index.js +10 -0
  90. package/dist/main/credit/index.mjs +3 -0
  91. package/dist/main/credit/server.d.ts +2 -0
  92. package/dist/main/credit/server.js +7 -0
  93. package/dist/main/credit/server.mjs +1 -0
  94. package/dist/main/cta.js +4 -2
  95. package/dist/main/cta.mjs +4 -2
  96. package/dist/main/footer.js +3 -3
  97. package/dist/main/footer.mjs +1 -1
  98. package/dist/main/hero/index.d.ts +2 -0
  99. package/dist/main/hero/index.js +10 -0
  100. package/dist/main/hero/index.mjs +3 -0
  101. package/dist/main/home/server.d.ts +7 -0
  102. package/dist/main/home/server.js +19 -0
  103. package/dist/main/home/server.mjs +7 -0
  104. package/dist/main/index.d.ts +0 -15
  105. package/dist/main/index.js +0 -43
  106. package/dist/main/index.mjs +0 -21
  107. package/dist/main/loading/index.d.ts +1 -0
  108. package/dist/main/loading/index.js +9 -0
  109. package/dist/main/loading/index.mjs +2 -0
  110. package/dist/main/loading-frame/index.d.ts +1 -0
  111. package/dist/main/loading-frame/index.js +9 -0
  112. package/dist/main/loading-frame/index.mjs +2 -0
  113. package/dist/main/money-price/index.d.ts +4 -0
  114. package/dist/main/money-price/index.js +15 -0
  115. package/dist/main/money-price/index.mjs +4 -0
  116. package/dist/main/money-price/money-price-button.d.ts +1 -1
  117. package/dist/main/money-price/money-price-button.js +12 -9
  118. package/dist/main/money-price/money-price-button.mjs +12 -9
  119. package/dist/main/money-price/money-price-interactive.d.ts +1 -1
  120. package/dist/main/money-price/money-price-interactive.js +22 -25
  121. package/dist/main/money-price/money-price-interactive.mjs +22 -25
  122. package/dist/main/money-price/money-price-types.d.ts +2 -0
  123. package/dist/main/money-price/server.d.ts +5 -0
  124. package/dist/main/money-price/server.js +18 -0
  125. package/dist/main/money-price/server.mjs +4 -0
  126. package/package.json +94 -4
  127. package/src/ai/index.ts +1 -0
  128. package/src/clerk/clerk-provider-client.tsx +1 -3
  129. package/src/clerk/fingerprint/fingerprint-client.ts +0 -4
  130. package/src/clerk/fingerprint/use-fingerprint.ts +0 -6
  131. package/src/clerk/signin-with-fingerprint-client.tsx +0 -10
  132. package/src/clerk/signup-button-with-fingerprint-client.tsx +0 -17
  133. package/src/clerk/signup-with-fingerprint-client.tsx +0 -10
  134. package/src/fuma/base/custom-header.tsx +12 -8
  135. package/src/fuma/base/custom-home-layout.tsx +3 -6
  136. package/src/fuma/base/docs-root-provider.tsx +58 -0
  137. package/src/fuma/base/index.ts +5 -0
  138. package/src/fuma/base/nav-config.ts +81 -0
  139. package/src/fuma/base/site-docs-layout.tsx +35 -0
  140. package/src/fuma/base/site-home-layout.tsx +78 -0
  141. package/src/fuma/base/site-layout-shared.tsx +190 -0
  142. package/src/fuma/base/site-layout.tsx +4 -289
  143. package/src/fuma/fuma-banner-suit.tsx +1 -1
  144. package/src/fuma/fuma-page-genarator.tsx +61 -8
  145. package/src/fuma/llm-copy-handler.ts +0 -11
  146. package/src/fuma/mdx/index.ts +0 -1
  147. package/src/fuma/mdx/suno-embed.tsx +1 -1
  148. package/src/fuma/mdx/toc-base.tsx +0 -1
  149. package/src/fuma/mdx/toc-footer-wrapper.tsx +2 -2
  150. package/src/fuma/server/features/widgets.tsx +1 -1
  151. package/src/fuma/server/llm-copy-handler.ts +2 -0
  152. package/src/fuma/server/page-generator.ts +2 -0
  153. package/src/lib/seo-metadata.ts +1 -1
  154. package/src/lib/seo-util.ts +2 -2
  155. package/src/lib/server.ts +1 -1
  156. package/src/{fuma/mdx → main/buttons}/gradient-button.tsx +10 -21
  157. package/src/main/buttons/index.ts +5 -0
  158. package/src/main/{x-button.tsx → buttons/x-button.tsx} +28 -42
  159. package/src/main/credit/credit-nav-button.tsx +36 -3
  160. package/src/main/credit/credit-overview-client.tsx +1 -1
  161. package/src/main/credit/index.ts +11 -0
  162. package/src/main/credit/server.ts +7 -0
  163. package/src/main/cta.tsx +1 -1
  164. package/src/main/footer.tsx +1 -2
  165. package/src/main/hero/index.ts +4 -0
  166. package/src/main/home/server.ts +7 -0
  167. package/src/main/index.ts +1 -20
  168. package/src/main/language-detector.tsx +0 -1
  169. package/src/main/loading/index.ts +3 -0
  170. package/src/main/loading-frame/index.ts +3 -0
  171. package/src/main/money-price/index.ts +18 -0
  172. package/src/main/money-price/money-price-button.tsx +17 -9
  173. package/src/main/money-price/money-price-interactive.tsx +30 -25
  174. package/src/main/money-price/money-price-types.ts +2 -0
  175. package/src/main/money-price/server.ts +22 -0
  176. package/dist/fuma/mdx/features.d.ts +0 -8
  177. package/dist/fuma/mdx/features.js +0 -92
  178. package/dist/fuma/mdx/features.mjs +0 -85
  179. package/dist/fuma/mdx/image-grid.d.ts +0 -6
  180. package/dist/fuma/mdx/image-grid.js +0 -17
  181. package/dist/fuma/mdx/image-grid.mjs +0 -15
  182. package/dist/fuma/mdx/image-zoom.d.ts +0 -22
  183. package/dist/fuma/mdx/image-zoom.js +0 -39
  184. package/dist/fuma/mdx/image-zoom.mjs +0 -37
  185. package/dist/fuma/mdx/markdown-component-map.d.ts +0 -3
  186. package/dist/fuma/mdx/markdown-component-map.js +0 -79
  187. package/dist/fuma/mdx/markdown-component-map.mjs +0 -77
  188. package/dist/fuma/mdx/math.d.ts +0 -17
  189. package/dist/fuma/mdx/math.js +0 -60
  190. package/dist/fuma/mdx/math.mjs +0 -57
  191. package/dist/fuma/mdx/mermaid.d.ts +0 -13
  192. package/dist/fuma/mdx/mermaid.js +0 -360
  193. package/dist/fuma/mdx/mermaid.mjs +0 -358
  194. package/dist/fuma/mdx/site-mdx-components.d.ts +0 -13
  195. package/dist/fuma/mdx/site-mdx-components.js +0 -19
  196. package/dist/fuma/mdx/site-mdx-components.mjs +0 -17
  197. package/dist/fuma/mdx/site-mdx-presets.d.ts +0 -13
  198. package/dist/fuma/mdx/site-mdx-presets.js +0 -49
  199. package/dist/fuma/mdx/site-mdx-presets.mjs +0 -45
  200. package/dist/fuma/server/optional-features.d.ts +0 -6
  201. package/dist/fuma/server/optional-features.js +0 -17
  202. package/dist/fuma/server/optional-features.mjs +0 -6
  203. package/dist/fuma/server/site-mdx-components.d.ts +0 -13
  204. package/dist/fuma/server/site-mdx-components.js +0 -18
  205. package/dist/fuma/server/site-mdx-components.mjs +0 -16
  206. package/dist/fuma/server/site-mdx-presets.d.ts +0 -195
  207. package/dist/fuma/server/site-mdx-presets.js +0 -55
  208. package/dist/fuma/server/site-mdx-presets.mjs +0 -52
  209. /package/src/{main → ai}/ai-prompt-textarea.tsx +0 -0
  210. /package/src/main/{x-toggle-button.tsx → buttons/x-toggle-button.tsx} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windrun-huaiin/third-ui",
3
- "version": "26.0.0",
3
+ "version": "28.0.0",
4
4
  "description": "Third-party integrated UI components for windrun-huaiin projects",
5
5
  "exports": {
6
6
  "./clerk": {
@@ -28,6 +28,56 @@
28
28
  "import": "./dist/main/index.mjs",
29
29
  "require": "./dist/main/index.js"
30
30
  },
31
+ "./main/alert-dialog": {
32
+ "types": "./dist/main/alert-dialog/index.d.ts",
33
+ "import": "./dist/main/alert-dialog/index.mjs",
34
+ "require": "./dist/main/alert-dialog/index.js"
35
+ },
36
+ "./main/buttons": {
37
+ "types": "./dist/main/buttons/index.d.ts",
38
+ "import": "./dist/main/buttons/index.mjs",
39
+ "require": "./dist/main/buttons/index.js"
40
+ },
41
+ "./main/credit": {
42
+ "types": "./dist/main/credit/index.d.ts",
43
+ "import": "./dist/main/credit/index.mjs",
44
+ "require": "./dist/main/credit/index.js"
45
+ },
46
+ "./main/credit/server": {
47
+ "types": "./dist/main/credit/server.d.ts",
48
+ "import": "./dist/main/credit/server.mjs",
49
+ "require": "./dist/main/credit/server.js"
50
+ },
51
+ "./main/hero": {
52
+ "types": "./dist/main/hero/index.d.ts",
53
+ "import": "./dist/main/hero/index.mjs",
54
+ "require": "./dist/main/hero/index.js"
55
+ },
56
+ "./main/home/server": {
57
+ "types": "./dist/main/home/server.d.ts",
58
+ "import": "./dist/main/home/server.mjs",
59
+ "require": "./dist/main/home/server.js"
60
+ },
61
+ "./main/loading": {
62
+ "types": "./dist/main/loading/index.d.ts",
63
+ "import": "./dist/main/loading/index.mjs",
64
+ "require": "./dist/main/loading/index.js"
65
+ },
66
+ "./main/loading-frame": {
67
+ "types": "./dist/main/loading-frame/index.d.ts",
68
+ "import": "./dist/main/loading-frame/index.mjs",
69
+ "require": "./dist/main/loading-frame/index.js"
70
+ },
71
+ "./main/money-price": {
72
+ "types": "./dist/main/money-price/index.d.ts",
73
+ "import": "./dist/main/money-price/index.mjs",
74
+ "require": "./dist/main/money-price/index.js"
75
+ },
76
+ "./main/money-price/server": {
77
+ "types": "./dist/main/money-price/server.d.ts",
78
+ "import": "./dist/main/money-price/server.mjs",
79
+ "require": "./dist/main/money-price/server.js"
80
+ },
31
81
  "./main/pill-select": {
32
82
  "types": "./dist/main/pill-select/index.d.ts",
33
83
  "import": "./dist/main/pill-select/index.mjs",
@@ -48,6 +98,21 @@
48
98
  "import": "./dist/fuma/server.mjs",
49
99
  "require": "./dist/fuma/server.js"
50
100
  },
101
+ "./fuma/server/page-generator": {
102
+ "types": "./dist/fuma/server/page-generator.d.ts",
103
+ "import": "./dist/fuma/server/page-generator.mjs",
104
+ "require": "./dist/fuma/server/page-generator.js"
105
+ },
106
+ "./fuma/server/llm-copy-handler": {
107
+ "types": "./dist/fuma/server/llm-copy-handler.d.ts",
108
+ "import": "./dist/fuma/server/llm-copy-handler.mjs",
109
+ "require": "./dist/fuma/server/llm-copy-handler.js"
110
+ },
111
+ "./fuma/fuma-translate-util": {
112
+ "types": "./dist/fuma/fuma-translate-util.d.ts",
113
+ "import": "./dist/fuma/fuma-translate-util.mjs",
114
+ "require": "./dist/fuma/fuma-translate-util.js"
115
+ },
51
116
  "./fuma/server/site-mdx/base": {
52
117
  "types": "./dist/fuma/server/site-mdx-base.d.ts",
53
118
  "import": "./dist/fuma/server/site-mdx-base.mjs",
@@ -93,6 +158,31 @@
93
158
  "import": "./dist/fuma/base/index.mjs",
94
159
  "require": "./dist/fuma/base/index.js"
95
160
  },
161
+ "./fuma/base/docs-root-provider": {
162
+ "types": "./dist/fuma/base/docs-root-provider.d.ts",
163
+ "import": "./dist/fuma/base/docs-root-provider.mjs",
164
+ "require": "./dist/fuma/base/docs-root-provider.js"
165
+ },
166
+ "./fuma/base/nav-config": {
167
+ "types": "./dist/fuma/base/nav-config.d.ts",
168
+ "import": "./dist/fuma/base/nav-config.mjs",
169
+ "require": "./dist/fuma/base/nav-config.js"
170
+ },
171
+ "./fuma/base/site-docs-layout": {
172
+ "types": "./dist/fuma/base/site-docs-layout.d.ts",
173
+ "import": "./dist/fuma/base/site-docs-layout.mjs",
174
+ "require": "./dist/fuma/base/site-docs-layout.js"
175
+ },
176
+ "./fuma/base/site-home-layout": {
177
+ "types": "./dist/fuma/base/site-home-layout.d.ts",
178
+ "import": "./dist/fuma/base/site-home-layout.mjs",
179
+ "require": "./dist/fuma/base/site-home-layout.js"
180
+ },
181
+ "./fuma/base/site-layout-shared": {
182
+ "types": "./dist/fuma/base/site-layout-shared.d.ts",
183
+ "import": "./dist/fuma/base/site-layout-shared.mjs",
184
+ "require": "./dist/fuma/base/site-layout-shared.js"
185
+ },
96
186
  "./lib/server": {
97
187
  "types": "./dist/lib/server.d.ts",
98
188
  "import": "./dist/lib/server.mjs",
@@ -137,9 +227,9 @@
137
227
  "tslib": "^2.8.1",
138
228
  "unified": "^11.0.5",
139
229
  "zod": "^4.3.6",
140
- "@windrun-huaiin/base-ui": "^26.0.0",
141
- "@windrun-huaiin/contracts": "^26.0.0",
142
- "@windrun-huaiin/lib": "^26.0.0"
230
+ "@windrun-huaiin/base-ui": "^28.0.0",
231
+ "@windrun-huaiin/lib": "^28.0.0",
232
+ "@windrun-huaiin/contracts": "^28.0.0"
143
233
  },
144
234
  "peerDependencies": {
145
235
  "clsx": "^2.1.1",
package/src/ai/index.ts CHANGED
@@ -11,3 +11,4 @@ export * from './ai-message-content';
11
11
  export * from './ai-message-meta';
12
12
  export * from './ai-message-actions';
13
13
  export * from './ai-status-indicator';
14
+ export * from './ai-prompt-textarea';
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { clerkIntl } from '@third-ui/lib/clerk-intl';
3
+ import { clerkIntl } from '../lib/clerk-intl';
4
4
  import { ClerkProvider } from '@clerk/nextjs';
5
5
  import React from 'react';
6
6
 
@@ -72,8 +72,6 @@ export function ClerkProviderClient({
72
72
  clerkProviderProps.waitlistUrl = waitlistWithLocale;
73
73
  }
74
74
 
75
- // console.log('ClerkProviderClient props:', clerkProviderProps);
76
-
77
75
  return (
78
76
  <ClerkProvider {...clerkProviderProps}>
79
77
  {children}
@@ -214,7 +214,6 @@ export async function generateFingerprintId(): Promise<string> {
214
214
  // 检查现有 ID
215
215
  const existingId = checkStoredFingerprintId();
216
216
  if (existingId) {
217
- console.log('Using existing fingerprint ID:', existingId);
218
217
  return existingId;
219
218
  }
220
219
 
@@ -228,7 +227,6 @@ export async function generateFingerprintId(): Promise<string> {
228
227
  setLocalStorageValue(FINGERPRINT_STORAGE_KEY, fingerprintId);
229
228
  setCookie(FINGERPRINT_COOKIE_NAME, fingerprintId, 365);
230
229
 
231
- console.log('Generated new fingerprint ID:', fingerprintId);
232
230
  return fingerprintId;
233
231
  } catch (error) {
234
232
  console.warn('Failed to generate fingerprint with FingerprintJS:', error);
@@ -237,7 +235,6 @@ export async function generateFingerprintId(): Promise<string> {
237
235
  setLocalStorageValue(FINGERPRINT_STORAGE_KEY, fallbackId);
238
236
  setCookie(FINGERPRINT_COOKIE_NAME, fallbackId, 365);
239
237
 
240
- console.log('Generated fallback fingerprint ID:', fallbackId);
241
238
  return fallbackId;
242
239
  }
243
240
  }
@@ -284,7 +281,6 @@ export function clearFingerprintId(): void {
284
281
  export async function getOrGenerateFingerprintId(): Promise<string> {
285
282
  const existingId = checkStoredFingerprintId();
286
283
  if (existingId) {
287
- console.log('Retrieved existing fingerprint ID:', existingId);
288
284
  return existingId;
289
285
  }
290
286
 
@@ -58,7 +58,6 @@ export function useFingerprint(config: FingerprintConfig): UseFingerprintResult
58
58
  // Capture first-touch as early as possible before any in-site navigation can overwrite context.
59
59
  getOrCreateFirstTouchData();
60
60
  const currentFingerprintId = await getOrGenerateFingerprintId();
61
- console.log('Initialized fingerprintId:', currentFingerprintId);
62
61
  setFingerprintIdState(currentFingerprintId);
63
62
  return currentFingerprintId;
64
63
  } catch (error) {
@@ -79,12 +78,10 @@ export function useFingerprint(config: FingerprintConfig): UseFingerprintResult
79
78
  }
80
79
 
81
80
  if (isInitializingAnonymousUserRef.current) {
82
- console.log('Skipping anonymous user initialization because a request is already in flight:', fingerprintId);
83
81
  return;
84
82
  }
85
83
 
86
84
  if (requestedAnonymousFingerprintRef.current === fingerprintId && isInitialized) {
87
- console.log('Skipping anonymous user initialization because fingerprint is already initialized:', fingerprintId);
88
85
  return;
89
86
  }
90
87
 
@@ -94,7 +91,6 @@ export function useFingerprint(config: FingerprintConfig): UseFingerprintResult
94
91
  setIsLoading(true);
95
92
  setError(null);
96
93
 
97
- console.log('Initializing anonymous user with fingerprintId:', fingerprintId);
98
94
  const fingerprintHeaders = await createFingerprintHeaders();
99
95
  const response = await fetch(config.apiEndpoint, {
100
96
  method: 'POST',
@@ -112,11 +108,9 @@ export function useFingerprint(config: FingerprintConfig): UseFingerprintResult
112
108
  }
113
109
 
114
110
  const data = await response.json();
115
- console.log('API response in initializeAnonymousUser:', data);
116
111
 
117
112
  if (data.success) {
118
113
  const updatedXUser = data.xUser || { userId: '', fingerprintId, clerkUserId: '', email: '', status: '', createdAt: '' };
119
- console.log('Setting xUser:', updatedXUser);
120
114
  setXUser(updatedXUser);
121
115
  setXCredit(data.xCredit || null);
122
116
  setXSubscription(data.xSubscription || null);
@@ -33,16 +33,6 @@ export function SignInWithFingerprint() {
33
33
  }
34
34
  }, [fingerprintId, isInitialized, initializeAnonymousUser]);
35
35
 
36
- // 调试日志和处理登录逻辑
37
- useEffect(() => {
38
- console.log('SignInWithFingerprint on [redirect] DEBUG:', {
39
- fingerprintProvider: fingerprintContext ? 'Available' : 'Not found',
40
- fingerprintId: fingerprintId || 'Not generated',
41
- xUser: xUser ? 'Initialized' : 'Not initialized',
42
- clerkMetadata: unsafeMetadata
43
- });
44
- }, [xUser, fingerprintId, fingerprintContext, unsafeMetadata]);
45
-
46
36
  return <SignIn unsafeMetadata={unsafeMetadata} />;
47
37
  }
48
38
 
@@ -50,15 +50,6 @@ export function SignUpButtonWithFingerprint({
50
50
  }
51
51
  }, [fingerprintId, isInitialized, initializeAnonymousUser]);
52
52
 
53
- // 调试日志和处理注册逻辑
54
- useEffect(() => {
55
- console.log('SignUpWithFingerprint on [modal] DEBUG:', {
56
- fingerprintProvider: fingerprintContext ? 'Available' : 'Not found',
57
- fingerprintId: fingerprintId || 'Not generated',
58
- xUser: xUser ? 'Initialized' : 'Not initialized',
59
- clerkMetadata: unsafeMetadata
60
- });
61
- }, [xUser, fingerprintId, fingerprintContext, unsafeMetadata]);
62
53
  const { openSignUp } = useClerk();
63
54
 
64
55
 
@@ -66,14 +57,6 @@ export function SignUpButtonWithFingerprint({
66
57
  openSignUp({
67
58
  unsafeMetadata,
68
59
  });
69
-
70
- // 记录日志
71
- console.log('SignUpButton on [modal] clicked', {
72
- timestamp: new Date().toISOString(),
73
- mode,
74
- userId,
75
- fingerprintId
76
- });
77
60
  };
78
61
 
79
62
  return (
@@ -33,16 +33,6 @@ export function SignUpWithFingerprint() {
33
33
  }
34
34
  }, [fingerprintId, isInitialized, initializeAnonymousUser]);
35
35
 
36
- // 调试日志和处理注册逻辑
37
- useEffect(() => {
38
- console.log('SignUpWithFingerprint on [redirect] DEBUG:', {
39
- fingerprintProvider: fingerprintContext ? 'Available' : 'Not found',
40
- fingerprintId: fingerprintId || 'Not generated',
41
- xUser: xUser ? 'Initialized' : 'Not initialized',
42
- clerkMetadata: unsafeMetadata
43
- });
44
- }, [xUser, fingerprintId, fingerprintContext, unsafeMetadata]);
45
-
46
36
  return <SignUp unsafeMetadata={unsafeMetadata} />;
47
37
  }
48
38
 
@@ -16,7 +16,6 @@ import Link from 'fumadocs-core/link';
16
16
  import { HomeLayoutProps } from 'fumadocs-ui/layouts/home';
17
17
  import {
18
18
  LinkItem,
19
- type LinkItemType,
20
19
  resolveLinkItems,
21
20
  } from 'fumadocs-ui/layouts/shared';
22
21
  import {
@@ -36,6 +35,7 @@ import { Popover, PopoverContent, PopoverTrigger } from 'fumadocs-ui/components/
36
35
  import { buttonVariants } from 'fumadocs-ui/components/ui/button';
37
36
  import { useI18n } from 'fumadocs-ui/contexts/i18n';
38
37
  import { HeaderThemeSwitch } from './header-theme-switch';
38
+ import type { ExtendedLinkItem } from './site-layout-shared';
39
39
 
40
40
  export type NavbarCSSVars = CSSProperties & {
41
41
  '--fd-banner-height'?: string;
@@ -316,6 +316,7 @@ export function CustomHomeHeader({
316
316
  >
317
317
  <Link
318
318
  href={nav.url ?? '/'}
319
+ prefetch={false}
319
320
  className="inline-flex items-center gap-2.5 font-semibold"
320
321
  >
321
322
  {renderNavTitle(nav.title)}
@@ -454,7 +455,7 @@ function NavbarLinkItem({
454
455
  item,
455
456
  ...props
456
457
  }: {
457
- item: LinkItemType;
458
+ item: ExtendedLinkItem;
458
459
  className?: string;
459
460
  }) {
460
461
  if (item.type === 'custom') return <div {...props}>{item.children}</div>;
@@ -465,6 +466,8 @@ function NavbarLinkItem({
465
466
  return <Fragment key={j}>{child.children}</Fragment>;
466
467
  }
467
468
 
469
+ const extendedChild = child as ExtendedLinkItem;
470
+
468
471
  const {
469
472
  banner = child.icon ? (
470
473
  <div className="w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4">
@@ -478,6 +481,7 @@ function NavbarLinkItem({
478
481
  <NavigationMenuLink key={`${j}-${child.url}`} asChild>
479
482
  <Link
480
483
  href={child.url}
484
+ prefetch={extendedChild.prefetch ?? false}
481
485
  external={child.external}
482
486
  {...rest}
483
487
  className={cn(
@@ -506,7 +510,7 @@ function NavbarLinkItem({
506
510
  className={cn(navItemVariants(), 'rounded-md', props.className)}
507
511
  >
508
512
  {item.url ? (
509
- <Link href={item.url} external={item.external}>
513
+ <Link href={item.url} prefetch={item.prefetch ?? false} external={item.external}>
510
514
  {item.text}
511
515
  </Link>
512
516
  ) : (
@@ -545,7 +549,7 @@ function MenuLinkItem({
545
549
  item,
546
550
  ...props
547
551
  }: {
548
- item: LinkItemType;
552
+ item: ExtendedLinkItem;
549
553
  className?: string;
550
554
  }) {
551
555
  if (item.type === 'custom')
@@ -564,7 +568,7 @@ function MenuLinkItem({
564
568
  <p className="mb-1 text-sm text-fd-muted-foreground">
565
569
  {item.url ? (
566
570
  <NavigationMenuLink asChild>
567
- <Link href={item.url} external={item.external}>
571
+ <Link href={item.url} prefetch={item.prefetch ?? false} external={item.external}>
568
572
  {header}
569
573
  </Link>
570
574
  </NavigationMenuLink>
@@ -692,19 +696,19 @@ function CompactLanguageToggle({
692
696
  );
693
697
  }
694
698
 
695
- function isGithubItem(item: LinkItemType, githubUrl?: string): boolean {
699
+ function isGithubItem(item: ExtendedLinkItem, githubUrl?: string): boolean {
696
700
  return Boolean(
697
701
  githubUrl && item.type === 'icon' && item.url === githubUrl,
698
702
  );
699
703
  }
700
704
 
701
- function isSecondary(item: LinkItemType): boolean {
705
+ function isSecondary(item: ExtendedLinkItem): boolean {
702
706
  if ('secondary' in item && item.secondary != null) return item.secondary;
703
707
 
704
708
  return item.type === 'icon';
705
709
  }
706
710
 
707
- function isMobilePinned(item: LinkItemType): boolean {
711
+ function isMobilePinned(item: ExtendedLinkItem): boolean {
708
712
  return Boolean((item as { mobilePinned?: boolean }).mobilePinned);
709
713
  }
710
714
 
@@ -1,9 +1,8 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
2
  import { HomeLayout, type HomeLayoutProps } from 'fumadocs-ui/layouts/home';
3
- import { type LinkItemType } from 'fumadocs-ui/layouts/shared';
4
- import { FumaBannerSuit } from '@third-ui/fuma/fuma-banner-suit';
5
- import { Footer } from '@third-ui/main/footer';
6
- import { GoToTop } from '@third-ui/main/go-to-top';
3
+ import { FumaBannerSuit } from '../fuma-banner-suit';
4
+ import { Footer } from '../../main/footer';
5
+ import { GoToTop } from '../../main/go-to-top';
7
6
  import {
8
7
  NavbarCSSVars,
9
8
  CustomHomeHeader,
@@ -12,8 +11,6 @@ import {
12
11
  type MobileMenuAction,
13
12
  } from './custom-header';
14
13
 
15
- export type ExtendedLinkItem = LinkItemType & { mobilePinned?: boolean };
16
-
17
14
  // - bannerHeight/headerHeight 换成你项目期望的 rem 值即可(如果没有 Banner 就把 bannerHeight 设成 0)。
18
15
  // - layoutStyle 同时把变量传给 HomeLayout 的 main 元素,这样内容整体会往下错开,不需要 has-banner/no-banner class。
19
16
  // - CustomHomeHeader 直接接受 HomeLayout 的各类 props(links、nav、searchToggle、themeSwitch、i18n 等),内部会复用 Fumadocs 原本的导航功能。
@@ -0,0 +1,58 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import { NextProvider } from 'fumadocs-core/framework/next';
3
+ import { I18nProvider, type I18nProviderProps } from 'fumadocs-ui/contexts/i18n';
4
+ import { ThemeProvider, type ThemeProviderProps } from 'next-themes';
5
+
6
+ type NextProviderComponents = {
7
+ Link?: ComponentProps<typeof NextProvider>['Link'];
8
+ Image?: ComponentProps<typeof NextProvider>['Image'];
9
+ };
10
+
11
+ type ThemeOptions = ThemeProviderProps & {
12
+ enabled?: boolean;
13
+ };
14
+
15
+ export interface DocsRootProviderProps {
16
+ i18n: Omit<I18nProviderProps, 'children'>;
17
+ theme?: ThemeOptions;
18
+ components?: NextProviderComponents;
19
+ children: ReactNode;
20
+ }
21
+
22
+ export function DocsRootProvider({
23
+ i18n,
24
+ theme = {},
25
+ components,
26
+ children,
27
+ }: DocsRootProviderProps) {
28
+ let body = children;
29
+
30
+ if (theme.enabled !== false) {
31
+ body = (
32
+ <ThemeProvider
33
+ attribute="class"
34
+ defaultTheme="system"
35
+ enableSystem
36
+ disableTransitionOnChange
37
+ {...theme}
38
+ >
39
+ {body}
40
+ </ThemeProvider>
41
+ );
42
+ }
43
+
44
+ body = (
45
+ <I18nProvider {...i18n}>
46
+ {body}
47
+ </I18nProvider>
48
+ );
49
+
50
+ return (
51
+ <NextProvider
52
+ Link={components?.Link}
53
+ Image={components?.Image}
54
+ >
55
+ {body}
56
+ </NextProvider>
57
+ );
58
+ }
@@ -1,3 +1,8 @@
1
1
  export * from './custom-header';
2
2
  export * from './custom-home-layout';
3
+ export * from './docs-root-provider';
4
+ export * from './nav-config';
5
+ export * from './site-docs-layout';
6
+ export * from './site-home-layout';
3
7
  export * from './site-layout';
8
+ export * from './site-layout-shared';
@@ -0,0 +1,81 @@
1
+ import type {
2
+ CreateSiteNavGroupOptions,
3
+ CreateSiteNavItemContext,
4
+ SiteMenuGroupConfig,
5
+ SiteMenuLeafConfig,
6
+ SiteNavItemConfig,
7
+ SiteNavLinkItemConfig,
8
+ } from './site-layout';
9
+
10
+ export interface LocalizedNavContextOptions {
11
+ locale: string;
12
+ localePrefixAsNeeded?: boolean;
13
+ defaultLocale?: string;
14
+ localizeHref: (locale: string, path: string, localePrefixAsNeeded: boolean, defaultLocale: string) => string;
15
+ }
16
+
17
+ export function createLocalizedNavContext(
18
+ options: LocalizedNavContextOptions,
19
+ ): CreateSiteNavItemContext {
20
+ const {
21
+ locale,
22
+ localePrefixAsNeeded = true,
23
+ defaultLocale = 'en',
24
+ localizeHref,
25
+ } = options;
26
+
27
+ return {
28
+ resolveUrl(path: string) {
29
+ return localizeHref(locale, path, localePrefixAsNeeded, defaultLocale);
30
+ },
31
+ };
32
+ }
33
+
34
+ export function createLocalizedNavLink(
35
+ item: SiteMenuLeafConfig,
36
+ context: CreateSiteNavItemContext,
37
+ ): SiteNavItemConfig {
38
+ return {
39
+ type: 'main',
40
+ text: item.text,
41
+ ...(item.description ? { description: item.description } : {}),
42
+ url: context.resolveUrl(item.path),
43
+ ...(item.external ? { external: item.external } : {}),
44
+ ...(item.prefetch !== undefined ? { prefetch: item.prefetch } : {}),
45
+ ...(item.icon || item.className
46
+ ? {
47
+ menu: {
48
+ ...(item.icon ? { banner: item.icon } : {}),
49
+ ...(item.className ? { className: item.className } : {}),
50
+ },
51
+ }
52
+ : {}),
53
+ };
54
+ }
55
+
56
+ export function createLocalizedNavGroup(
57
+ item: SiteMenuGroupConfig,
58
+ context: CreateSiteNavItemContext,
59
+ options?: CreateSiteNavGroupOptions,
60
+ ): SiteNavItemConfig {
61
+ return {
62
+ type: 'menu',
63
+ text: item.text,
64
+ ...(item.path ? { url: context.resolveUrl(item.path) } : {}),
65
+ ...(item.prefetch !== undefined ? { prefetch: item.prefetch } : {}),
66
+ items: [
67
+ ...(item.landing
68
+ ? [
69
+ {
70
+ ...createLocalizedNavLink(item.landing, context),
71
+ menu: {
72
+ ...(options?.featuredBanner ? { banner: options.featuredBanner } : {}),
73
+ className: options?.featuredClassName ?? 'md:row-span-2',
74
+ },
75
+ } as SiteNavLinkItemConfig,
76
+ ]
77
+ : []),
78
+ ...item.items.map((child) => createLocalizedNavLink(child, context)),
79
+ ],
80
+ };
81
+ }
@@ -0,0 +1,35 @@
1
+ import type { ReactNode } from 'react';
2
+ import { DocsLayout, type DocsLayoutProps } from 'fumadocs-ui/layouts/docs';
3
+ import {
4
+ normalizeNavItems,
5
+ type SiteBaseLayoutConfig,
6
+ } from './site-layout-shared';
7
+
8
+ export interface SiteDocsLayoutConfig extends SiteBaseLayoutConfig {
9
+ tree: DocsLayoutProps['tree'];
10
+ sidebar?: DocsLayoutProps['sidebar'];
11
+ }
12
+
13
+ function toDocsLayoutOptions(config: SiteDocsLayoutConfig): DocsLayoutProps {
14
+ return {
15
+ ...(config.nav ? { nav: config.nav } : {}),
16
+ ...(config.i18n ? { i18n: config.i18n } : {}),
17
+ ...(config.githubUrl ? { githubUrl: config.githubUrl } : {}),
18
+ ...(config.links ? { links: normalizeNavItems(config.links) } : {}),
19
+ ...(config.searchToggle ? { searchToggle: config.searchToggle } : {}),
20
+ ...(config.themeSwitch ? { themeSwitch: config.themeSwitch } : {}),
21
+ ...(config.sidebar ? { sidebar: config.sidebar } : {}),
22
+ tree: config.tree,
23
+ };
24
+ }
25
+
26
+ export function SiteDocsLayout({
27
+ config,
28
+ children,
29
+ }: {
30
+ config: SiteDocsLayoutConfig;
31
+ children: ReactNode;
32
+ }) {
33
+ const options = toDocsLayoutOptions(config);
34
+ return <DocsLayout {...options}>{children}</DocsLayout>;
35
+ }
@@ -0,0 +1,78 @@
1
+ import type { ReactNode } from 'react';
2
+ import {
3
+ CustomHomeLayout,
4
+ type CustomHomeLayoutProps,
5
+ type HeaderActionOrders,
6
+ } from './custom-home-layout';
7
+ import {
8
+ toHomeLayoutOptions,
9
+ type SiteBaseLayoutConfig,
10
+ } from './site-layout-shared';
11
+
12
+ export interface SiteHomeLayoutConfig extends SiteBaseLayoutConfig {
13
+ showBanner?: boolean;
14
+ bannerHeight?: number;
15
+ headerHeight?: number;
16
+ headerPaddingTop?: number;
17
+ navbarClassName?: string;
18
+ floatingNav?: boolean;
19
+ banner?: ReactNode;
20
+ footer?: ReactNode;
21
+ goToTop?: ReactNode;
22
+ showFooter?: boolean;
23
+ showGoToTop?: boolean;
24
+ actionOrders?: HeaderActionOrders;
25
+ localePrefixAsNeeded?: boolean;
26
+ defaultLocale?: string;
27
+ }
28
+
29
+ export function SiteHomeLayout({
30
+ locale,
31
+ config,
32
+ children,
33
+ }: {
34
+ locale: string;
35
+ config: SiteHomeLayoutConfig;
36
+ children: ReactNode;
37
+ }) {
38
+ const {
39
+ actionOrders,
40
+ banner,
41
+ bannerHeight,
42
+ defaultLocale,
43
+ floatingNav,
44
+ footer,
45
+ goToTop,
46
+ headerHeight,
47
+ headerPaddingTop,
48
+ localePrefixAsNeeded,
49
+ navbarClassName,
50
+ showBanner,
51
+ showFooter,
52
+ showGoToTop,
53
+ ...baseConfig
54
+ } = config;
55
+
56
+ const options = toHomeLayoutOptions(baseConfig);
57
+
58
+ const layoutProps: CustomHomeLayoutProps = {
59
+ locale,
60
+ options,
61
+ ...(actionOrders ? { actionOrders } : {}),
62
+ ...(banner ? { banner } : {}),
63
+ ...(bannerHeight != null ? { bannerHeight } : {}),
64
+ ...(defaultLocale ? { defaultLocale } : {}),
65
+ ...(floatingNav != null ? { floatingNav } : {}),
66
+ ...(footer ? { footer } : {}),
67
+ ...(goToTop ? { goToTop } : {}),
68
+ ...(headerHeight != null ? { headerHeight } : {}),
69
+ ...(headerPaddingTop != null ? { headerPaddingTop } : {}),
70
+ ...(localePrefixAsNeeded != null ? { localePrefixAsNeeded } : {}),
71
+ ...(navbarClassName ? { navbarClassName } : {}),
72
+ ...(showBanner != null ? { showBanner } : {}),
73
+ ...(showFooter != null ? { showFooter } : {}),
74
+ ...(showGoToTop != null ? { showGoToTop } : {}),
75
+ };
76
+
77
+ return <CustomHomeLayout {...layoutProps}>{children}</CustomHomeLayout>;
78
+ }