@windrun-huaiin/third-ui 5.6.1 → 5.7.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 +2 -2
- package/dist/fuma/mdx/index.d.ts +2 -2
- package/dist/fuma/mdx/index.js +14 -8
- package/dist/fuma/mdx/index.js.map +1 -1
- package/dist/fuma/mdx/index.mjs +14 -8
- package/dist/fuma/mdx/index.mjs.map +1 -1
- package/dist/fuma/server.d.mts +2 -2
- package/dist/fuma/server.d.ts +2 -2
- package/dist/fuma/server.js +4 -50
- package/dist/fuma/server.js.map +1 -1
- package/dist/fuma/server.mjs +4 -50
- package/dist/fuma/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/fuma/fuma-page-genarator.tsx +4 -4
- package/src/fuma/mdx/toc-base.tsx +15 -9
- package/src/fuma/mdx/toc-footer-wrapper.tsx +5 -4
package/dist/fuma/mdx/index.mjs
CHANGED
|
@@ -3080,22 +3080,28 @@ function LLMCopyButton({ llmApiUrl } = {}) {
|
|
|
3080
3080
|
const locale = params.locale;
|
|
3081
3081
|
const slug = params.slug;
|
|
3082
3082
|
const [checked, onClick] = useCopyButton(() => __async(null, null, function* () {
|
|
3083
|
-
var _a;
|
|
3084
3083
|
setLoading(true);
|
|
3085
3084
|
const path = slug && Array.isArray(slug) ? slug.join("/") : "";
|
|
3086
3085
|
const apiPrefix = llmApiUrl || "/api/llm-content";
|
|
3087
3086
|
const apiUrl = `${apiPrefix}?locale=${encodeURIComponent(locale)}&path=${encodeURIComponent(path)}`;
|
|
3088
3087
|
console.log("Fetching LLM content from:", apiUrl);
|
|
3088
|
+
let content;
|
|
3089
3089
|
try {
|
|
3090
|
-
|
|
3090
|
+
if (cache.has(apiUrl)) {
|
|
3091
|
+
content = cache.get(apiUrl);
|
|
3092
|
+
} else {
|
|
3093
|
+
const res = yield fetch(apiUrl);
|
|
3091
3094
|
if (!res.ok) {
|
|
3092
|
-
|
|
3095
|
+
content = `Error: Failed to fetch LLM content: ${res.status} ${res.statusText}`;
|
|
3096
|
+
} else {
|
|
3097
|
+
content = yield res.text();
|
|
3098
|
+
cache.set(apiUrl, content);
|
|
3093
3099
|
}
|
|
3094
|
-
|
|
3095
|
-
});
|
|
3096
|
-
cache.set(apiUrl, content);
|
|
3100
|
+
}
|
|
3097
3101
|
yield navigator.clipboard.writeText(content);
|
|
3098
3102
|
} catch (error) {
|
|
3103
|
+
const errMsg = `Error: ${error instanceof Error ? error.message : String(error)}`;
|
|
3104
|
+
yield navigator.clipboard.writeText(errMsg);
|
|
3099
3105
|
console.error("Error fetching or copying LLM content:", error);
|
|
3100
3106
|
} finally {
|
|
3101
3107
|
setLoading(false);
|
|
@@ -3408,11 +3414,11 @@ function ZiaFolder(_a) {
|
|
|
3408
3414
|
|
|
3409
3415
|
// src/fuma/mdx/toc-footer-wrapper.tsx
|
|
3410
3416
|
import { jsx as jsx46, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3411
|
-
function TocFooterWrapper({ lastModified, editPath, githubBaseUrl,
|
|
3417
|
+
function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
|
|
3412
3418
|
const showEdit = githubBaseUrl && editPath;
|
|
3413
3419
|
return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
|
|
3414
3420
|
/* @__PURE__ */ jsx46(LastUpdatedDate, { date: lastModified }),
|
|
3415
|
-
|
|
3421
|
+
copyButtonComponent,
|
|
3416
3422
|
showEdit && /* @__PURE__ */ jsx46(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
|
|
3417
3423
|
] });
|
|
3418
3424
|
}
|