@windrun-huaiin/third-ui 5.6.1 → 5.8.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/dist/fuma/mdx/index.d.mts +4 -13
- package/dist/fuma/mdx/index.d.ts +4 -13
- package/dist/fuma/mdx/index.js +19 -10
- package/dist/fuma/mdx/index.js.map +1 -1
- package/dist/fuma/mdx/index.mjs +19 -10
- package/dist/fuma/mdx/index.mjs.map +1 -1
- package/dist/fuma/server.d.mts +5 -3
- package/dist/fuma/server.d.ts +5 -3
- package/dist/fuma/server.js +6 -50
- package/dist/fuma/server.js.map +1 -1
- package/dist/fuma/server.mjs +6 -50
- package/dist/fuma/server.mjs.map +1 -1
- package/dist/toc-base-BC7kXpDU.d.mts +15 -0
- package/dist/toc-base-BC7kXpDU.d.ts +15 -0
- package/package.json +1 -1
- package/src/fuma/fuma-page-genarator.tsx +16 -6
- package/src/fuma/mdx/toc-base.tsx +25 -11
- package/src/fuma/mdx/toc-footer-wrapper.tsx +5 -4
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ImageProps } from 'fumadocs-core/framework';
|
|
3
3
|
import React, { ImgHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
4
4
|
import { UncontrolledProps } from 'react-medium-image-zoom';
|
|
5
|
+
export { E as EditOnGitHub, a as LLMCopyButton, L as LLMCopyButtonProps, b as LastUpdatedDate } from '../../toc-base-BC7kXpDU.mjs';
|
|
5
6
|
|
|
6
7
|
interface MermaidProps {
|
|
7
8
|
chart: string;
|
|
@@ -60,16 +61,6 @@ declare function GradientButton({ title, icon, href, align, }: {
|
|
|
60
61
|
align?: 'left' | 'center' | 'right';
|
|
61
62
|
}): react_jsx_runtime.JSX.Element;
|
|
62
63
|
|
|
63
|
-
declare function LLMCopyButton({ llmApiUrl }?: {
|
|
64
|
-
llmApiUrl?: string;
|
|
65
|
-
}): react_jsx_runtime.JSX.Element;
|
|
66
|
-
declare function EditOnGitHub({ url }: {
|
|
67
|
-
url: string;
|
|
68
|
-
}): react_jsx_runtime.JSX.Element;
|
|
69
|
-
declare function LastUpdatedDate({ date }: {
|
|
70
|
-
date: string | undefined;
|
|
71
|
-
}): react_jsx_runtime.JSX.Element;
|
|
72
|
-
|
|
73
64
|
declare function FumaBannerSuit({ showText }: {
|
|
74
65
|
showText: boolean;
|
|
75
66
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -118,8 +109,8 @@ interface TocFooterProps {
|
|
|
118
109
|
lastModified: string | undefined;
|
|
119
110
|
editPath?: string;
|
|
120
111
|
githubBaseUrl?: string;
|
|
121
|
-
|
|
112
|
+
copyButtonComponent?: React.ReactNode;
|
|
122
113
|
}
|
|
123
|
-
declare function TocFooterWrapper({ lastModified, editPath, githubBaseUrl,
|
|
114
|
+
declare function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }: TocFooterProps): react_jsx_runtime.JSX.Element;
|
|
124
115
|
|
|
125
|
-
export {
|
|
116
|
+
export { FumaBannerSuit, FumaGithubInfo, GradientButton, ImageGrid, ImageZoom, type ImageZoomProps, Mermaid, SiteX, type SiteXProps, TocFooterWrapper, TrophyCard, ZiaCard, type ZiaCardProps, ZiaFile, type ZiaFileProps, ZiaFolder, type ZiaFolderProps };
|
package/dist/fuma/mdx/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ImageProps } from 'fumadocs-core/framework';
|
|
3
3
|
import React, { ImgHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
4
4
|
import { UncontrolledProps } from 'react-medium-image-zoom';
|
|
5
|
+
export { E as EditOnGitHub, a as LLMCopyButton, L as LLMCopyButtonProps, b as LastUpdatedDate } from '../../toc-base-BC7kXpDU.js';
|
|
5
6
|
|
|
6
7
|
interface MermaidProps {
|
|
7
8
|
chart: string;
|
|
@@ -60,16 +61,6 @@ declare function GradientButton({ title, icon, href, align, }: {
|
|
|
60
61
|
align?: 'left' | 'center' | 'right';
|
|
61
62
|
}): react_jsx_runtime.JSX.Element;
|
|
62
63
|
|
|
63
|
-
declare function LLMCopyButton({ llmApiUrl }?: {
|
|
64
|
-
llmApiUrl?: string;
|
|
65
|
-
}): react_jsx_runtime.JSX.Element;
|
|
66
|
-
declare function EditOnGitHub({ url }: {
|
|
67
|
-
url: string;
|
|
68
|
-
}): react_jsx_runtime.JSX.Element;
|
|
69
|
-
declare function LastUpdatedDate({ date }: {
|
|
70
|
-
date: string | undefined;
|
|
71
|
-
}): react_jsx_runtime.JSX.Element;
|
|
72
|
-
|
|
73
64
|
declare function FumaBannerSuit({ showText }: {
|
|
74
65
|
showText: boolean;
|
|
75
66
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -118,8 +109,8 @@ interface TocFooterProps {
|
|
|
118
109
|
lastModified: string | undefined;
|
|
119
110
|
editPath?: string;
|
|
120
111
|
githubBaseUrl?: string;
|
|
121
|
-
|
|
112
|
+
copyButtonComponent?: React.ReactNode;
|
|
122
113
|
}
|
|
123
|
-
declare function TocFooterWrapper({ lastModified, editPath, githubBaseUrl,
|
|
114
|
+
declare function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }: TocFooterProps): react_jsx_runtime.JSX.Element;
|
|
124
115
|
|
|
125
|
-
export {
|
|
116
|
+
export { FumaBannerSuit, FumaGithubInfo, GradientButton, ImageGrid, ImageZoom, type ImageZoomProps, Mermaid, SiteX, type SiteXProps, TocFooterWrapper, TrophyCard, ZiaCard, type ZiaCardProps, ZiaFile, type ZiaFileProps, ZiaFolder, type ZiaFolderProps };
|
package/dist/fuma/mdx/index.js
CHANGED
|
@@ -3117,28 +3117,37 @@ var import_use_copy_button = require("fumadocs-ui/utils/use-copy-button");
|
|
|
3117
3117
|
var import_link4 = __toESM(require("fumadocs-core/link"));
|
|
3118
3118
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3119
3119
|
var cache = /* @__PURE__ */ new Map();
|
|
3120
|
-
function LLMCopyButton({ llmApiUrl } = {}) {
|
|
3120
|
+
function LLMCopyButton({ llmApiUrl, sourceKey } = {}) {
|
|
3121
3121
|
const [isLoading, setLoading] = (0, import_react38.useState)(false);
|
|
3122
3122
|
const params = (0, import_navigation.useParams)();
|
|
3123
3123
|
const locale = params.locale;
|
|
3124
3124
|
const slug = params.slug;
|
|
3125
3125
|
const [checked, onClick] = (0, import_use_copy_button.useCopyButton)(() => __async(null, null, function* () {
|
|
3126
|
-
var _a;
|
|
3127
3126
|
setLoading(true);
|
|
3128
3127
|
const path = slug && Array.isArray(slug) ? slug.join("/") : "";
|
|
3129
3128
|
const apiPrefix = llmApiUrl || "/api/llm-content";
|
|
3130
|
-
|
|
3129
|
+
let apiUrl = `${apiPrefix}?locale=${encodeURIComponent(locale)}&path=${encodeURIComponent(path)}`;
|
|
3130
|
+
if (sourceKey) {
|
|
3131
|
+
apiUrl += `&sourceKey=${encodeURIComponent(sourceKey)}`;
|
|
3132
|
+
}
|
|
3131
3133
|
console.log("Fetching LLM content from:", apiUrl);
|
|
3134
|
+
let content;
|
|
3132
3135
|
try {
|
|
3133
|
-
|
|
3136
|
+
if (cache.has(apiUrl)) {
|
|
3137
|
+
content = cache.get(apiUrl);
|
|
3138
|
+
} else {
|
|
3139
|
+
const res = yield fetch(apiUrl);
|
|
3134
3140
|
if (!res.ok) {
|
|
3135
|
-
|
|
3141
|
+
content = `Error: Failed to fetch LLM content: ${res.status} ${res.statusText}`;
|
|
3142
|
+
} else {
|
|
3143
|
+
content = yield res.text();
|
|
3144
|
+
cache.set(apiUrl, content);
|
|
3136
3145
|
}
|
|
3137
|
-
|
|
3138
|
-
});
|
|
3139
|
-
cache.set(apiUrl, content);
|
|
3146
|
+
}
|
|
3140
3147
|
yield navigator.clipboard.writeText(content);
|
|
3141
3148
|
} catch (error) {
|
|
3149
|
+
const errMsg = `Error: ${error instanceof Error ? error.message : String(error)}`;
|
|
3150
|
+
yield navigator.clipboard.writeText(errMsg);
|
|
3142
3151
|
console.error("Error fetching or copying LLM content:", error);
|
|
3143
3152
|
} finally {
|
|
3144
3153
|
setLoading(false);
|
|
@@ -3447,11 +3456,11 @@ function ZiaFolder(_a) {
|
|
|
3447
3456
|
|
|
3448
3457
|
// src/fuma/mdx/toc-footer-wrapper.tsx
|
|
3449
3458
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3450
|
-
function TocFooterWrapper({ lastModified, editPath, githubBaseUrl,
|
|
3459
|
+
function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
|
|
3451
3460
|
const showEdit = githubBaseUrl && editPath;
|
|
3452
3461
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
|
|
3453
3462
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LastUpdatedDate, { date: lastModified }),
|
|
3454
|
-
|
|
3463
|
+
copyButtonComponent,
|
|
3455
3464
|
showEdit && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
|
|
3456
3465
|
] });
|
|
3457
3466
|
}
|