react-docs-ui 0.9.2 → 0.9.4
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/{DocsApp-CWJsQVqd.js → DocsApp-CYGJXsrK.js} +9 -5
- package/dist/{MdxContent-Bj-hsc_-.js → MdxContent-BjzTiShf.js} +28 -24
- package/dist/{MdxContent.lazy-B_p0r_Lg.js → MdxContent.lazy-DUWb89w0.js} +1 -1
- package/dist/docs-app.es.js +1 -1
- package/dist/{mdx-components-DoD1nZRa.js → mdx-components-C8B-hfnt.js} +1786 -1379
- package/dist/react-docs-ui.css +1 -1
- package/dist/react-docs-ui.es.js +3 -3
- package/dist/types/components/FontProvider.d.ts.map +1 -1
- package/dist/types/components/MdxContent.d.ts +3 -2
- package/dist/types/components/MdxContent.d.ts.map +1 -1
- package/dist/types/components/mdx-components/Mermaid.d.ts +4 -1
- package/dist/types/components/mdx-components/Mermaid.d.ts.map +1 -1
- package/dist/types/components/mdx-components/MermaidViewer.d.ts +11 -0
- package/dist/types/components/mdx-components/MermaidViewer.d.ts.map +1 -0
- package/dist/types/lib/config.d.ts +19 -0
- package/dist/types/lib/config.d.ts.map +1 -1
- package/dist/types/lib/mermaid-viewer.d.ts +3 -0
- package/dist/types/lib/mermaid-viewer.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { n as i, t as a } from "./theme-provider-fNhx9xK0.js";
|
|
|
3
3
|
import { n as o, t as s } from "./use-toast-BnYFxs3T.js";
|
|
4
4
|
import { t as c } from "./utils-C1xOyiTe.js";
|
|
5
5
|
import { a as l, i as u, o as d, r as f, s as p, t as m } from "./dialog-DisDZkkN.js";
|
|
6
|
-
import { C as h, S as g, _, a as v, b as y, f as b, g as x, h as S, i as C, m as w, n as T, o as E, r as D, t as O, u as k, v as A, x as j, y as M } from "./mdx-components-
|
|
6
|
+
import { C as h, S as g, _, a as v, b as y, f as b, g as x, h as S, i as C, m as w, n as T, o as E, r as D, t as O, u as k, v as A, x as j, y as M } from "./mdx-components-C8B-hfnt.js";
|
|
7
7
|
import { t as N } from "./AIProvider-niZNPSGi.js";
|
|
8
8
|
import * as P from "react";
|
|
9
9
|
import F, { Suspense as I, createContext as L, lazy as R, useCallback as z, useContext as B, useEffect as V, useMemo as H, useRef as U, useState as W } from "react";
|
|
@@ -24556,7 +24556,11 @@ var MS = {
|
|
|
24556
24556
|
}, NS = {
|
|
24557
24557
|
fontFamilyZhCn: "PingFang SC, Noto Sans SC, Microsoft YaHei, sans-serif",
|
|
24558
24558
|
fontFamilyEn: "system-ui, sans-serif"
|
|
24559
|
-
}, PS = "react-docs-ui-font-face-styles", FS = "react-docs-ui:content-ready", IS = new Set([
|
|
24559
|
+
}, PS = "react-docs-ui-font-face-styles", FS = "react-docs-ui:content-ready", IS = new Set([
|
|
24560
|
+
"Fragment Mono",
|
|
24561
|
+
"MiSans",
|
|
24562
|
+
"Noto Sans SC"
|
|
24563
|
+
]), LS = new Set([
|
|
24560
24564
|
"-apple-system",
|
|
24561
24565
|
"arial",
|
|
24562
24566
|
"blinkmacsystemfont",
|
|
@@ -24611,7 +24615,7 @@ var MS = {
|
|
|
24611
24615
|
style: "normal",
|
|
24612
24616
|
suffixes: ["700", "Bold"]
|
|
24613
24617
|
}
|
|
24614
|
-
], zS = ["woff2", "woff"], BS = "\n@font-face {\n font-family: 'Fragment Mono';\n src: url('/fonts/FragmentMono-Regular.woff2') format('woff2');\n font-weight: 400;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'Fragment Mono';\n src: url('/fonts/FragmentMono-Italic.woff2') format('woff2');\n font-weight: 400;\n font-style: italic;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'MiSans';\n src: url('/fonts/MiSans-Regular.woff2') format('woff2');\n font-weight: 400;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'MiSans';\n src: url('/fonts/MiSans-Medium.woff2') format('woff2');\n font-weight: 500;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'MiSans';\n src: url('/fonts/MiSans-Bold.woff2') format('woff2');\n font-weight: 700;\n font-style: normal;\n font-display: swap;\n}\n";
|
|
24618
|
+
], zS = ["woff2", "woff"], BS = "\n@font-face {\n font-family: 'Noto Sans SC';\n src: url('/fonts/NotoSansSC-400.woff2') format('woff2');\n font-weight: 400;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'Noto Sans SC';\n src: url('/fonts/NotoSansSC-500.woff2') format('woff2');\n font-weight: 500;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'Noto Sans SC';\n src: url('/fonts/NotoSansSC-600.woff2') format('woff2');\n font-weight: 600;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'Noto Sans SC';\n src: url('/fonts/NotoSansSC-700.woff2') format('woff2');\n font-weight: 700;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'Fragment Mono';\n src: url('/fonts/FragmentMono-Regular.woff2') format('woff2');\n font-weight: 400;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'Fragment Mono';\n src: url('/fonts/FragmentMono-Italic.woff2') format('woff2');\n font-weight: 400;\n font-style: italic;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'MiSans';\n src: url('/fonts/MiSans-Regular.woff2') format('woff2');\n font-weight: 400;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'MiSans';\n src: url('/fonts/MiSans-Medium.woff2') format('woff2');\n font-weight: 500;\n font-style: normal;\n font-display: swap;\n}\n\n@font-face {\n font-family: 'MiSans';\n src: url('/fonts/MiSans-Bold.woff2') format('woff2');\n font-weight: 700;\n font-style: normal;\n font-display: swap;\n}\n";
|
|
24615
24619
|
function VS(e) {
|
|
24616
24620
|
let t = [], n = "", r = null;
|
|
24617
24621
|
for (let i of e) {
|
|
@@ -25948,9 +25952,9 @@ function cT(e = {}) {
|
|
|
25948
25952
|
}
|
|
25949
25953
|
//#endregion
|
|
25950
25954
|
//#region src/app/DocsApp.tsx
|
|
25951
|
-
var lT = R(() => import("./GlobalContextMenu-DmsqlfsV.js").then((e) => ({ default: e.GlobalContextMenu }))), uT = R(() => import("./MdxContent.lazy-
|
|
25955
|
+
var lT = R(() => import("./GlobalContextMenu-DmsqlfsV.js").then((e) => ({ default: e.GlobalContextMenu }))), uT = R(() => import("./MdxContent.lazy-DUWb89w0.js"));
|
|
25952
25956
|
function dT() {
|
|
25953
|
-
import("./MdxContent.lazy-
|
|
25957
|
+
import("./MdxContent.lazy-DUWb89w0.js");
|
|
25954
25958
|
}
|
|
25955
25959
|
function fT() {
|
|
25956
25960
|
globalThis.dispatchEvent(new Event("react-docs-ui:content-ready"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./use-toast-BnYFxs3T.js";
|
|
2
2
|
import { n as t, r as n, t as r } from "./utils-C1xOyiTe.js";
|
|
3
3
|
import { l as i, r as a, t as o, u as s } from "./dialog-DisDZkkN.js";
|
|
4
|
-
import { S as c, b as l, c as u, d, h as f, l as p, p as m, s as h, t as g, v as _, x as v, y } from "./mdx-components-
|
|
4
|
+
import { S as c, b as l, c as u, d, h as f, l as p, p as m, s as h, t as g, v as _, x as v, y } from "./mdx-components-C8B-hfnt.js";
|
|
5
5
|
import * as b from "react";
|
|
6
6
|
import { Check as ee, Copy as x, Download as te, ExternalLink as S, Maximize as ne, Minimize as re, RefreshCw as ie, RotateCcw as ae, RotateCw as oe, Search as se, X as ce, ZoomIn as le, ZoomOut as ue } from "lucide-react";
|
|
7
7
|
import { Link as C, useParams as w } from "react-router-dom";
|
|
@@ -807,18 +807,18 @@ function Z({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
|
|
|
807
807
|
style: h
|
|
808
808
|
}) : null;
|
|
809
809
|
}
|
|
810
|
-
function Q({ source: e, skipFirstH1: t = !1, imageViewer: n,
|
|
811
|
-
let
|
|
810
|
+
function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, mermaidViewer: r, codeHighlight: i, shikiBundle: a }) {
|
|
811
|
+
let o = w(), s = o.lang || "zh-cn", c = o.version, l = m();
|
|
812
812
|
b.useEffect(() => {
|
|
813
|
-
u(
|
|
814
|
-
}, [
|
|
815
|
-
let
|
|
813
|
+
u(i, a);
|
|
814
|
+
}, [i, a]);
|
|
815
|
+
let d = b.useMemo(() => {
|
|
816
816
|
if (!t) return e;
|
|
817
817
|
let n = e.split("\n"), r = !1;
|
|
818
818
|
return n.filter((e) => !r && e.startsWith("# ") ? (r = !0, !1) : !0).join("\n");
|
|
819
|
-
}, [e, t]),
|
|
819
|
+
}, [e, t]), p = b.useMemo(() => K(d), [d]), h = b.useMemo(() => {
|
|
820
820
|
let e = /* @__PURE__ */ new Map();
|
|
821
|
-
return
|
|
821
|
+
return l && Object.entries(l).forEach(([t, n]) => {
|
|
822
822
|
let r = b.memo(({ children: e, ...t }) => {
|
|
823
823
|
let r = J(t);
|
|
824
824
|
return b.createElement(n, r, e);
|
|
@@ -828,7 +828,7 @@ function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, s
|
|
|
828
828
|
e.set(a, r);
|
|
829
829
|
}
|
|
830
830
|
}), e;
|
|
831
|
-
}, [
|
|
831
|
+
}, [l]), _ = b.useMemo(() => Object.fromEntries(h), [h]);
|
|
832
832
|
return /* @__PURE__ */ E("div", {
|
|
833
833
|
className: "prose dark:prose-invert max-w-none",
|
|
834
834
|
children: /* @__PURE__ */ E(de, {
|
|
@@ -836,7 +836,7 @@ function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, s
|
|
|
836
836
|
rehypePlugins: [
|
|
837
837
|
j,
|
|
838
838
|
M,
|
|
839
|
-
L(
|
|
839
|
+
L(_),
|
|
840
840
|
V,
|
|
841
841
|
[A, { behavior: "append" }],
|
|
842
842
|
[N, {
|
|
@@ -853,7 +853,7 @@ function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, s
|
|
|
853
853
|
}]
|
|
854
854
|
],
|
|
855
855
|
components: {
|
|
856
|
-
...
|
|
856
|
+
..._,
|
|
857
857
|
table({ children: e, ...t }) {
|
|
858
858
|
return /* @__PURE__ */ E("div", {
|
|
859
859
|
className: "overflow-x-auto",
|
|
@@ -866,15 +866,19 @@ function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, s
|
|
|
866
866
|
pre({ children: e, ...t }) {
|
|
867
867
|
let n = b.Children.toArray(e).find((e) => e?.type === "code" || e?.props?.node?.tagName === "code");
|
|
868
868
|
if (n) {
|
|
869
|
-
let e = n.props, t = e?.className || "",
|
|
870
|
-
|
|
871
|
-
let
|
|
872
|
-
return
|
|
869
|
+
let e = n.props, t = e?.className || "", o = /language-(\w+)/.exec(t), c = o ? o[1].toLowerCase() : "text", l = e?.node, u = e?.children, d = e?.["data-raw-value"];
|
|
870
|
+
d && (u = d);
|
|
871
|
+
let f = l?.data?.meta || "";
|
|
872
|
+
return c === "mermaid" ? /* @__PURE__ */ E(g, {
|
|
873
|
+
chart: typeof u == "string" ? u : String(u || ""),
|
|
874
|
+
lang: s,
|
|
875
|
+
viewerConfig: r
|
|
876
|
+
}) : /* @__PURE__ */ E(X, {
|
|
873
877
|
className: t,
|
|
874
|
-
meta:
|
|
875
|
-
codeHighlight:
|
|
876
|
-
shikiBundle:
|
|
877
|
-
children:
|
|
878
|
+
meta: f,
|
|
879
|
+
codeHighlight: i,
|
|
880
|
+
shikiBundle: a,
|
|
881
|
+
children: u
|
|
878
882
|
});
|
|
879
883
|
}
|
|
880
884
|
return /* @__PURE__ */ E("pre", {
|
|
@@ -894,7 +898,7 @@ function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, s
|
|
|
894
898
|
...n,
|
|
895
899
|
children: t
|
|
896
900
|
}) : /* @__PURE__ */ E(C, {
|
|
897
|
-
to: f(
|
|
901
|
+
to: f(s, e.startsWith("/") ? e : `/${e}`, c),
|
|
898
902
|
...n,
|
|
899
903
|
children: t
|
|
900
904
|
}) : /* @__PURE__ */ E("a", {
|
|
@@ -902,20 +906,20 @@ function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, s
|
|
|
902
906
|
children: t
|
|
903
907
|
});
|
|
904
908
|
},
|
|
905
|
-
img({ src: e, alt: t, title: r, className: i, node: a, ...
|
|
909
|
+
img({ src: e, alt: t, title: r, className: i, node: a, ...o }) {
|
|
906
910
|
return /* @__PURE__ */ E(Z, {
|
|
907
|
-
lang:
|
|
911
|
+
lang: s,
|
|
908
912
|
viewerConfig: n,
|
|
909
913
|
src: e,
|
|
910
914
|
alt: t,
|
|
911
915
|
title: r,
|
|
912
916
|
className: i,
|
|
913
917
|
node: a,
|
|
914
|
-
...
|
|
918
|
+
...o
|
|
915
919
|
});
|
|
916
920
|
}
|
|
917
921
|
},
|
|
918
|
-
children:
|
|
922
|
+
children: p
|
|
919
923
|
})
|
|
920
924
|
});
|
|
921
925
|
}
|
package/dist/docs-app.es.js
CHANGED