@windrun-huaiin/diaomao 31.1.2 → 31.2.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/.env.local.txt CHANGED
@@ -13,7 +13,12 @@ NEXT_PUBLIC_BASE_URL=http://localhost:3000
13
13
 
14
14
  ## Github
15
15
  NEXT_PUBLIC_GITHUB=https://github.com/YOURS_/YOURS_/
16
- NEXT_PUBLIC_GITHUB_BASE_URL=https://github.com/YOURS_/YOURS_/main
16
+ NEXT_PUBLIC_GITHUB_BASE_URL=https://github.com/YOURS_/YOURS_/blob/main
17
+
18
+
19
+ ## Website Theme Switch Mode
20
+ ## light-only, dark-only, light-dark-system
21
+ NEXT_PUBLIC_STYLE_THEME_MODE=light-dark-system
17
22
 
18
23
  ## Website Theme Color config
19
24
  ## purple:#AC62FD , orange:#F97316, indigo:#6366F1, emerald:#48C892, rose:#F43F5E
package/next-env.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/types/routes.d.ts";
3
+ import "./.next/dev/types/routes.d.ts";
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windrun-huaiin/diaomao",
3
- "version": "31.1.2",
3
+ "version": "31.2.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -21,8 +21,8 @@
21
21
  "@windrun-huaiin/base-ui": "31.0.0",
22
22
  "@windrun-huaiin/contracts": "31.0.0",
23
23
  "@windrun-huaiin/fumadocs-local-md": "31.0.0",
24
- "@windrun-huaiin/lib": "31.0.0",
25
- "@windrun-huaiin/third-ui": "31.0.1",
24
+ "@windrun-huaiin/lib": "31.0.2",
25
+ "@windrun-huaiin/third-ui": "31.3.1",
26
26
  "clsx": "^2.1.1",
27
27
  "lucide-react": "^0.577.0",
28
28
  "next": "16.1.6",
@@ -44,7 +44,7 @@
44
44
  "@types/react": "^19.2.14",
45
45
  "@types/react-dom": "^19.2.3",
46
46
  "@typescript-eslint/parser": "^8.56.1",
47
- "@windrun-huaiin/dev-scripts": "^31.0.0",
47
+ "@windrun-huaiin/dev-scripts": "31.0.1",
48
48
  "baseline-browser-mapping": "^2.10.0",
49
49
  "dotenv": "^17.4.2",
50
50
  "eslint": "^9.39.1",
@@ -31,10 +31,6 @@ export default async function RootLayout({
31
31
  searchToggle: {
32
32
  enabled: false,
33
33
  },
34
- themeSwitch: {
35
- enabled: true,
36
- mode: 'light-dark-system',
37
- },
38
34
  };
39
35
  return (
40
36
  <FingerprintProvider config={fingerprintConfig}>
@@ -8,7 +8,6 @@ const { Page, generateStaticParams, generateMetadata } = createFumaPage({
8
8
  sourceKey: sourceKey,
9
9
  mdxContentSource: () => siteDocs.getContentSource(sourceKey),
10
10
  getMDXComponents: siteDocs.getMDXComponents,
11
- mdxSourceDir: appConfig.mdxSourceDir[sourceKey],
12
11
  githubBaseUrl: appConfig.githubBaseUrl,
13
12
  copyButtonComponent: <LLMCopyButton />,
14
13
  showBreadcrumb: false,
@@ -36,10 +36,6 @@ export default async function Layout({
36
36
  searchToggle: {
37
37
  enabled: false,
38
38
  },
39
- themeSwitch: {
40
- enabled: true,
41
- mode: 'light-dark-system',
42
- },
43
39
  };
44
40
 
45
41
  return (
@@ -7,7 +7,6 @@ const { Page, generateStaticParams, generateMetadata } = createFumaPage({
7
7
  sourceKey: sourceKey,
8
8
  mdxContentSource: () => siteDocs.getContentSource(sourceKey),
9
9
  getMDXComponents: siteDocs.getMDXComponents,
10
- mdxSourceDir: appConfig.mdxSourceDir[sourceKey],
11
10
  githubBaseUrl: appConfig.githubBaseUrl,
12
11
  supportedLocales: appConfig.i18n.locales as string[],
13
12
  showBreadcrumb: false,
@@ -34,10 +34,6 @@ export default async function Layout({
34
34
  searchToggle: {
35
35
  enabled: false,
36
36
  },
37
- themeSwitch: {
38
- enabled: true,
39
- mode: 'light-dark-system',
40
- },
41
37
  };
42
38
 
43
39
  return (
@@ -35,10 +35,6 @@ export default async function Layout({
35
35
  searchToggle: {
36
36
  enabled: false,
37
37
  },
38
- themeSwitch: {
39
- enabled: true,
40
- mode: 'light-dark-system',
41
- },
42
38
  };
43
39
 
44
40
  return (
@@ -1,4 +1,4 @@
1
- import { appConfig, generatedLocales, localePrefixAsNeeded, defaultLocale } from '@/lib/appConfig';
1
+ import { appConfig, generatedLocales, localePrefixAsNeeded, defaultLocale, themeMode } from '@/lib/appConfig';
2
2
  import { getFumaTranslations } from '@windrun-huaiin/third-ui/fuma/fuma-translate-util';
3
3
  import { createLocalizedSiteMetadata } from '@windrun-huaiin/third-ui/lib/seo-metadata';
4
4
  import { NProgressBar } from '@windrun-huaiin/third-ui/main';
@@ -47,6 +47,9 @@ export default async function RootLayout({
47
47
  <NProgressBar />
48
48
  <ClerkProviderClient locale={locale} localePrefixAsNeeded={localePrefixAsNeeded} defaultLocale={defaultLocale}>
49
49
  <DocsRootProvider
50
+ theme={{
51
+ mode: themeMode,
52
+ }}
50
53
  i18n={{
51
54
  locale: locale,
52
55
  locales: generatedLocales,
@@ -2,18 +2,21 @@
2
2
 
3
3
  import { type NextRequest, NextResponse } from 'next/server';
4
4
 
5
- import { siteDocs } from '@/lib/site-docs';
6
5
  import { appConfig } from '@/lib/appConfig';
6
+ import { resolveMdxSourceDir } from '@/lib/mdx-source';
7
+ import { siteDocs } from '@/lib/site-docs';
7
8
  import { LLMCopyHandler } from '@windrun-huaiin/third-ui/fuma/server/llm-copy-handler';
8
9
 
10
+ const sourceKey = 'blog';
11
+
9
12
  export async function GET(request: NextRequest) {
10
13
  const searchParams = request.nextUrl.searchParams;
11
14
  const locale = searchParams.get('locale') ?? appConfig.i18n.defaultLocale;
12
15
  const requestedPath = searchParams.get('path') || '';
13
- const blogSource = await siteDocs.getContentSource('blog');
16
+ const blogSource = await siteDocs.getContentSource(sourceKey);
14
17
 
15
18
  const result = await LLMCopyHandler({
16
- sourceDir: appConfig.mdxSourceDir.blog,
19
+ sourceDir: resolveMdxSourceDir(sourceKey),
17
20
  dataSource: blogSource,
18
21
  requestedPath,
19
22
  locale,
@@ -2,18 +2,20 @@
2
2
 
3
3
  import { type NextRequest, NextResponse } from 'next/server';
4
4
 
5
- import { siteDocs } from '@/lib/site-docs';
6
5
  import { appConfig } from '@/lib/appConfig';
6
+ import { resolveMdxSourceDir } from '@/lib/mdx-source';
7
+ import { siteDocs } from '@/lib/site-docs';
7
8
  import { LLMCopyHandler } from '@windrun-huaiin/third-ui/fuma/server/llm-copy-handler';
8
9
 
10
+ const sourceKey = 'legal';
9
11
  export async function GET(request: NextRequest) {
10
12
  const searchParams = request.nextUrl.searchParams;
11
13
  const locale = searchParams.get('locale') ?? appConfig.i18n.defaultLocale;
12
14
  const requestedPath = searchParams.get('path') || '';
13
- const legalSource = await siteDocs.getContentSource('legal');
15
+ const legalSource = await siteDocs.getContentSource(sourceKey);
14
16
 
15
17
  const result = await LLMCopyHandler({
16
- sourceDir: appConfig.mdxSourceDir.legal,
18
+ sourceDir: resolveMdxSourceDir(sourceKey),
17
19
  dataSource: legalSource,
18
20
  requestedPath,
19
21
  locale,
@@ -1,8 +1,9 @@
1
1
  import { appConfig } from '@/lib/appConfig';
2
+ import { resolveMdxSourceDir } from "@/lib/mdx-source";
2
3
  import { createSitemapHandler } from '@windrun-huaiin/third-ui/lib/server';
3
4
 
4
5
  export default createSitemapHandler(
5
6
  appConfig.baseUrl,
6
7
  appConfig.i18n.locales as string[],
7
- appConfig.mdxSourceDir.blog
8
+ resolveMdxSourceDir('blog'),
8
9
  );
@@ -12,4 +12,4 @@ export const { localePrefixAsNeeded, defaultLocale } = appConfig.i18n;
12
12
  export const github = appConfig.github;
13
13
 
14
14
  // export shortcuts
15
- export const { iconColor, watermark, showBanner, clerkPageBanner, clerkAuthInModal, placeHolderImage } = appConfig.shortcuts;
15
+ export const { iconColor, themeMode, watermark, showBanner, clerkPageBanner, clerkAuthInModal, placeHolderImage } = appConfig.shortcuts;
@@ -0,0 +1,3 @@
1
+ export function resolveMdxSourceDir(sourceKey: string) {
2
+ return `src/mdx/${sourceKey}`;
3
+ }