react-docs-ui 0.9.2 → 0.9.3

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.
@@ -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-DoD1nZRa.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-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";
@@ -25948,9 +25948,9 @@ function cT(e = {}) {
25948
25948
  }
25949
25949
  //#endregion
25950
25950
  //#region src/app/DocsApp.tsx
25951
- var lT = R(() => import("./GlobalContextMenu-DmsqlfsV.js").then((e) => ({ default: e.GlobalContextMenu }))), uT = R(() => import("./MdxContent.lazy-B_p0r_Lg.js"));
25951
+ var lT = R(() => import("./GlobalContextMenu-DmsqlfsV.js").then((e) => ({ default: e.GlobalContextMenu }))), uT = R(() => import("./MdxContent.lazy-DUWb89w0.js"));
25952
25952
  function dT() {
25953
- import("./MdxContent.lazy-B_p0r_Lg.js");
25953
+ import("./MdxContent.lazy-DUWb89w0.js");
25954
25954
  }
25955
25955
  function fT() {
25956
25956
  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-DoD1nZRa.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-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, codeHighlight: r, shikiBundle: i }) {
811
- let a = w(), o = a.lang || "zh-cn", s = a.version, c = m();
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(r, i);
814
- }, [r, i]);
815
- let l = b.useMemo(() => {
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]), d = b.useMemo(() => K(l), [l]), p = b.useMemo(() => {
819
+ }, [e, t]), p = b.useMemo(() => K(d), [d]), h = b.useMemo(() => {
820
820
  let e = /* @__PURE__ */ new Map();
821
- return c && Object.entries(c).forEach(([t, n]) => {
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
- }, [c]), h = b.useMemo(() => Object.fromEntries(p), [p]);
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(h),
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
- ...h,
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 || "", a = /language-(\w+)/.exec(t), o = a ? a[1].toLowerCase() : "text", s = e?.node, c = e?.children, l = e?.["data-raw-value"];
870
- l && (c = l);
871
- let u = s?.data?.meta || "";
872
- return o === "mermaid" ? /* @__PURE__ */ E(g, { chart: typeof c == "string" ? c : String(c || "") }) : /* @__PURE__ */ E(X, {
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: u,
875
- codeHighlight: r,
876
- shikiBundle: i,
877
- children: c
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(o, e.startsWith("/") ? e : `/${e}`, s),
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, ...s }) {
909
+ img({ src: e, alt: t, title: r, className: i, node: a, ...o }) {
906
910
  return /* @__PURE__ */ E(Z, {
907
- lang: o,
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
- ...s
918
+ ...o
915
919
  });
916
920
  }
917
921
  },
918
- children: d
922
+ children: p
919
923
  })
920
924
  });
921
925
  }
@@ -1,4 +1,4 @@
1
- import { t as e } from "./MdxContent-Bj-hsc_-.js";
1
+ import { t as e } from "./MdxContent-BjzTiShf.js";
2
2
  import t from "katex";
3
3
  t.__defineMacro("\\ce", function(e) {
4
4
  return n(e.consumeArgs(1)[0], "ce");
@@ -1,4 +1,4 @@
1
- import { c as e, n as t, t as n } from "./DocsApp-CWJsQVqd.js";
1
+ import { c as e, n as t, t as n } from "./DocsApp-C0WC8Drr.js";
2
2
  //#region src/docs-app.ts
3
3
  var r = !1;
4
4
  function i() {