react-docs-ui 0.6.13 → 0.6.15
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/README.md +13 -0
- package/dist/AIChatDialog-W60DtiEW.js +418 -0
- package/dist/AIProvider-C1_b1iKH.js +1066 -0
- package/dist/AISelectionTrigger-MaBGhxTE.js +86 -0
- package/dist/AISettingsPanel-aiMnncnQ.js +524 -0
- package/dist/DocsApp-BBNDiw8A.js +23556 -0
- package/dist/GlobalContextMenu-DG6x5Y5w.js +278 -0
- package/dist/MdxContent-CMB8ZbXo.js +850 -0
- package/dist/MdxContent.lazy-C4rcCv4v.js +1768 -0
- package/dist/SearchDialog-tUSKKsxW.js +403 -0
- package/dist/SearchRuntime-5fXpxDsi.js +23 -0
- package/dist/context-menu-CB7erSoV.js +73 -0
- package/dist/dialog-DQ6nkP0y.js +97 -0
- package/dist/docs-app.es.d.ts +1 -0
- package/dist/docs-app.es.js +7 -9
- package/dist/react-docs-ui.css +2 -1
- package/dist/react-docs-ui.es.js +66 -195
- package/dist/shiki-highlighter-BmQSSJpS.js +7194 -0
- package/dist/theme-provider-fNhx9xK0.js +37 -0
- package/dist/types/components/DocsLayout.d.ts +1 -31
- package/dist/types/components/DocsLayout.d.ts.map +1 -1
- package/dist/types/components/Footer.d.ts +3 -28
- package/dist/types/components/Footer.d.ts.map +1 -1
- package/dist/types/components/HeaderNav.d.ts.map +1 -1
- package/dist/types/components/MdxContent.d.ts.map +1 -1
- package/dist/types/components/MobileSidebar.d.ts +1 -1
- package/dist/types/components/MobileSidebar.d.ts.map +1 -1
- package/dist/types/components/PageNavigation.d.ts +1 -1
- package/dist/types/components/PageNavigation.d.ts.map +1 -1
- package/dist/types/components/SidebarNav.d.ts +1 -1
- package/dist/types/components/SidebarNav.d.ts.map +1 -1
- package/dist/types/components/TableOfContents.d.ts +1 -1
- package/dist/types/components/TableOfContents.d.ts.map +1 -1
- package/dist/types/components/ai/AIChatDialog.d.ts +1 -1
- package/dist/types/components/ai/AIChatDialog.d.ts.map +1 -1
- package/dist/types/components/ai/AISelectionTrigger.d.ts +1 -1
- package/dist/types/components/ai/AISelectionTrigger.d.ts.map +1 -1
- package/dist/types/components/ai/AISettingsPanel.d.ts +1 -1
- package/dist/types/components/ai/AISettingsPanel.d.ts.map +1 -1
- package/dist/types/components/search/SearchItem.d.ts +1 -2
- package/dist/types/components/search/SearchItem.d.ts.map +1 -1
- package/dist/types/components/ui/button.d.ts +4 -4
- package/dist/types/components/ui/button.d.ts.map +1 -1
- package/dist/types/components/ui/toast.d.ts +3 -3
- package/dist/types/components/ui/toast.d.ts.map +1 -1
- package/dist/types/external-modules.d.ts +38 -0
- package/dist/types/generated/shiki-bundle.d.ts +1 -0
- package/dist/types/generated/shiki-bundle.d.ts.map +1 -1
- package/dist/types/lib/ai/crypto.d.ts.map +1 -1
- package/dist/types/lib/config.d.ts +0 -4
- package/dist/types/lib/config.d.ts.map +1 -1
- package/dist/types/lib/export-utils.d.ts.map +1 -1
- package/dist/types/lib/frontmatter.d.ts +6 -0
- package/dist/types/lib/frontmatter.d.ts.map +1 -0
- package/dist/types/lib/rehype-toc.d.ts.map +1 -1
- package/dist/types/lib/search/search-index-plugin.d.ts.map +1 -1
- package/dist/types/lib/shiki-highlighter.d.ts.map +1 -1
- package/dist/types/mdast.d.ts +53 -0
- package/dist/use-toast-d9VPBjMn.js +98 -0
- package/dist/utils-Ct96Mtjw.js +8 -0
- package/package.json +23 -24
- package/dist/AISettingsPanel-KzfonkeY.js +0 -1171
- package/dist/DocsApp-DTFpyBOl.js +0 -35170
- package/dist/GlobalContextMenu-hGNTKw3S.js +0 -210
- package/dist/MdxContent-B664V_Hk.js +0 -812
- package/dist/MdxContent.lazy-DsQt7MZQ.js +0 -1512
- package/dist/SearchDialog-Cfam5kUW.js +0 -406
- package/dist/SearchRuntime-Dk265vam.js +0 -31
- package/dist/context-menu-CBGG4zJl.js +0 -140
- package/dist/index-ByXnCzVt.js +0 -12
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { b as D, j as e } from "./DocsApp-DTFpyBOl.js";
|
|
2
|
-
import { useCallback as c } from "react";
|
|
3
|
-
import { useNavigate as A, useLocation as Q } from "react-router-dom";
|
|
4
|
-
import { C as W, a as _, b as J, c as k, d as C, e as t, f as y, g as w, h as f, i as v, j as P, k as d } from "./context-menu-CBGG4zJl.js";
|
|
5
|
-
const K = {
|
|
6
|
-
"zh-cn": {
|
|
7
|
-
page: "页面",
|
|
8
|
-
copyUrl: "复制当前链接",
|
|
9
|
-
copyTitle: "复制页面标题",
|
|
10
|
-
copyMarkdownLink: "复制 Markdown 链接",
|
|
11
|
-
copySelectedText: "复制",
|
|
12
|
-
openInNewTab: "在新标签页打开",
|
|
13
|
-
reload: "刷新",
|
|
14
|
-
printPage: "打印页面",
|
|
15
|
-
scrollToTop: "回到顶部",
|
|
16
|
-
scrollToBottom: "滚动到底部",
|
|
17
|
-
site: "站点",
|
|
18
|
-
goHome: "返回首页",
|
|
19
|
-
quickNav: "快速跳转",
|
|
20
|
-
docsIndex: "文档首页",
|
|
21
|
-
guide: "指南",
|
|
22
|
-
introduction: "简介",
|
|
23
|
-
installation: "安装",
|
|
24
|
-
quickStart: "快速开始",
|
|
25
|
-
configuration: "配置",
|
|
26
|
-
language: "语言",
|
|
27
|
-
appearance: "外观",
|
|
28
|
-
theme: "主题",
|
|
29
|
-
light: "浅色",
|
|
30
|
-
dark: "深色",
|
|
31
|
-
system: "跟随系统",
|
|
32
|
-
resetThemePref: "重置主题偏好"
|
|
33
|
-
},
|
|
34
|
-
en: {
|
|
35
|
-
page: "Page",
|
|
36
|
-
copyUrl: "Copy Current URL",
|
|
37
|
-
copyTitle: "Copy Page Title",
|
|
38
|
-
copyMarkdownLink: "Copy Markdown Link",
|
|
39
|
-
copySelectedText: "Copy",
|
|
40
|
-
openInNewTab: "Open in New Tab",
|
|
41
|
-
reload: "Reload",
|
|
42
|
-
printPage: "Print Page",
|
|
43
|
-
scrollToTop: "Scroll to Top",
|
|
44
|
-
scrollToBottom: "Scroll to Bottom",
|
|
45
|
-
site: "Site",
|
|
46
|
-
goHome: "Go Home",
|
|
47
|
-
quickNav: "Quick Navigation",
|
|
48
|
-
docsIndex: "Docs Index",
|
|
49
|
-
guide: "Guide",
|
|
50
|
-
introduction: "Introduction",
|
|
51
|
-
installation: "Installation",
|
|
52
|
-
quickStart: "Quick Start",
|
|
53
|
-
configuration: "Configuration",
|
|
54
|
-
language: "Language",
|
|
55
|
-
appearance: "Appearance",
|
|
56
|
-
theme: "Theme",
|
|
57
|
-
light: "Light",
|
|
58
|
-
dark: "Dark",
|
|
59
|
-
system: "System",
|
|
60
|
-
resetThemePref: "Reset Theme Preference"
|
|
61
|
-
}
|
|
62
|
-
}, x = {
|
|
63
|
-
enabled: !0,
|
|
64
|
-
page: {
|
|
65
|
-
copyUrl: !0,
|
|
66
|
-
copyTitle: !0,
|
|
67
|
-
copyMarkdownLink: !0,
|
|
68
|
-
copySelectedText: !0,
|
|
69
|
-
openInNewTab: !0,
|
|
70
|
-
reload: !0,
|
|
71
|
-
printPage: !0,
|
|
72
|
-
scrollToTop: !0,
|
|
73
|
-
scrollToBottom: !0
|
|
74
|
-
},
|
|
75
|
-
site: {
|
|
76
|
-
goHome: !0,
|
|
77
|
-
quickNav: !0,
|
|
78
|
-
language: !0
|
|
79
|
-
},
|
|
80
|
-
appearance: {
|
|
81
|
-
theme: !0,
|
|
82
|
-
resetThemePref: !0
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
function ee({
|
|
86
|
-
children: b,
|
|
87
|
-
config: S
|
|
88
|
-
}) {
|
|
89
|
-
const l = A(), m = Q(), { theme: N, setTheme: g } = D(), s = c(async (a) => {
|
|
90
|
-
if (navigator.clipboard && window.isSecureContext)
|
|
91
|
-
await navigator.clipboard.writeText(a);
|
|
92
|
-
else {
|
|
93
|
-
const n = document.createElement("textarea");
|
|
94
|
-
n.value = a, n.style.position = "fixed", n.style.left = "-9999px", n.style.top = "-9999px", document.body.appendChild(n), n.focus(), n.select();
|
|
95
|
-
try {
|
|
96
|
-
document.execCommand("copy");
|
|
97
|
-
} finally {
|
|
98
|
-
document.body.removeChild(n);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}, []), L = c(async () => {
|
|
102
|
-
try {
|
|
103
|
-
await s(window.location.href);
|
|
104
|
-
} catch {
|
|
105
|
-
}
|
|
106
|
-
}, [s]), B = c(async () => {
|
|
107
|
-
try {
|
|
108
|
-
await s(document.title || "");
|
|
109
|
-
} catch {
|
|
110
|
-
}
|
|
111
|
-
}, [s]), q = c(async () => {
|
|
112
|
-
try {
|
|
113
|
-
const a = document.title || "Docs", n = window.location.href;
|
|
114
|
-
await s(`[${a}](${n})`);
|
|
115
|
-
} catch {
|
|
116
|
-
}
|
|
117
|
-
}, [s]), H = c(async () => {
|
|
118
|
-
try {
|
|
119
|
-
const a = window.getSelection()?.toString() || "";
|
|
120
|
-
a && await s(a);
|
|
121
|
-
} catch {
|
|
122
|
-
}
|
|
123
|
-
}, [s]), U = c(() => {
|
|
124
|
-
window.open(window.location.href, "_blank");
|
|
125
|
-
}, []), R = c(() => {
|
|
126
|
-
window.location.reload();
|
|
127
|
-
}, []), z = c(() => l("/"), [l]), u = m.pathname.startsWith("/en") ? "en" : "zh-cn", o = K[u], M = c(
|
|
128
|
-
(a) => {
|
|
129
|
-
const n = m.pathname.split("/").filter(Boolean);
|
|
130
|
-
n.length > 0 && (n[0] === "en" || n[0] === "zh-cn") ? n[0] = a : n.unshift(a), l("/" + n.join("/"));
|
|
131
|
-
},
|
|
132
|
-
[m.pathname, l]
|
|
133
|
-
), G = c(() => window.scrollTo({ top: 0, behavior: "smooth" }), []), E = c(
|
|
134
|
-
() => window.scrollTo({ top: document.documentElement.scrollHeight, behavior: "smooth" }),
|
|
135
|
-
[]
|
|
136
|
-
), F = c(() => window.print(), []), r = c((a) => l(`/${u}/${a}`), [l, u]), O = c(() => {
|
|
137
|
-
try {
|
|
138
|
-
localStorage.removeItem("vite-ui-theme");
|
|
139
|
-
} catch {
|
|
140
|
-
}
|
|
141
|
-
}, []), p = S?.enabled === !1 ? null : { ...x, ...S };
|
|
142
|
-
if (!p)
|
|
143
|
-
return /* @__PURE__ */ e.jsx("div", { className: "min-h-screen", children: b });
|
|
144
|
-
const i = { ...x.page, ...p.page }, h = { ...x.site, ...p.site }, T = { ...x.appearance, ...p.appearance }, j = Object.values(i).some(Boolean), I = Object.values(h).some(Boolean), $ = Object.values(T).some(Boolean);
|
|
145
|
-
return /* @__PURE__ */ e.jsxs(W, { children: [
|
|
146
|
-
/* @__PURE__ */ e.jsx(_, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "min-h-screen", children: b }) }),
|
|
147
|
-
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
148
|
-
j && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
149
|
-
/* @__PURE__ */ e.jsx(k, { children: o.page }),
|
|
150
|
-
/* @__PURE__ */ e.jsxs(C, { children: [
|
|
151
|
-
i.copyUrl && /* @__PURE__ */ e.jsx(t, { onClick: L, children: o.copyUrl }),
|
|
152
|
-
i.copyTitle && /* @__PURE__ */ e.jsx(t, { onClick: B, children: o.copyTitle }),
|
|
153
|
-
i.copyMarkdownLink && /* @__PURE__ */ e.jsx(t, { onClick: q, children: o.copyMarkdownLink }),
|
|
154
|
-
i.copySelectedText && /* @__PURE__ */ e.jsx(t, { onClick: H, children: o.copySelectedText }),
|
|
155
|
-
i.openInNewTab && /* @__PURE__ */ e.jsx(t, { onClick: U, children: o.openInNewTab }),
|
|
156
|
-
i.reload && /* @__PURE__ */ e.jsx(t, { onClick: R, children: o.reload }),
|
|
157
|
-
i.printPage && /* @__PURE__ */ e.jsx(t, { onClick: F, children: o.printPage }),
|
|
158
|
-
(i.scrollToTop || i.scrollToBottom) && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
159
|
-
/* @__PURE__ */ e.jsx(y, {}),
|
|
160
|
-
i.scrollToTop && /* @__PURE__ */ e.jsx(t, { onClick: G, children: o.scrollToTop }),
|
|
161
|
-
i.scrollToBottom && /* @__PURE__ */ e.jsx(t, { onClick: E, children: o.scrollToBottom })
|
|
162
|
-
] })
|
|
163
|
-
] })
|
|
164
|
-
] }),
|
|
165
|
-
I && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
166
|
-
j && /* @__PURE__ */ e.jsx(y, {}),
|
|
167
|
-
/* @__PURE__ */ e.jsx(k, { children: o.site }),
|
|
168
|
-
/* @__PURE__ */ e.jsxs(C, { children: [
|
|
169
|
-
h.goHome && /* @__PURE__ */ e.jsx(t, { onClick: z, children: o.goHome }),
|
|
170
|
-
h.quickNav && /* @__PURE__ */ e.jsxs(w, { children: [
|
|
171
|
-
/* @__PURE__ */ e.jsx(f, { children: o.quickNav }),
|
|
172
|
-
/* @__PURE__ */ e.jsxs(v, { children: [
|
|
173
|
-
/* @__PURE__ */ e.jsx(t, { onClick: () => r("index"), children: o.docsIndex }),
|
|
174
|
-
/* @__PURE__ */ e.jsx(t, { onClick: () => r("guide"), children: o.guide }),
|
|
175
|
-
/* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/introduction"), children: o.introduction }),
|
|
176
|
-
/* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/installation"), children: o.installation }),
|
|
177
|
-
/* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/quick-start"), children: o.quickStart }),
|
|
178
|
-
/* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/configuration"), children: o.configuration })
|
|
179
|
-
] })
|
|
180
|
-
] }),
|
|
181
|
-
h.language && /* @__PURE__ */ e.jsxs(w, { children: [
|
|
182
|
-
/* @__PURE__ */ e.jsx(f, { children: o.language }),
|
|
183
|
-
/* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsxs(P, { value: u, children: [
|
|
184
|
-
/* @__PURE__ */ e.jsx(d, { value: "en", onClick: () => M("en"), children: "English" }),
|
|
185
|
-
/* @__PURE__ */ e.jsx(d, { value: "zh-cn", onClick: () => M("zh-cn"), children: "简体中文" })
|
|
186
|
-
] }) })
|
|
187
|
-
] })
|
|
188
|
-
] })
|
|
189
|
-
] }),
|
|
190
|
-
$ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
191
|
-
(j || I) && /* @__PURE__ */ e.jsx(y, {}),
|
|
192
|
-
/* @__PURE__ */ e.jsx(k, { children: o.appearance }),
|
|
193
|
-
/* @__PURE__ */ e.jsxs(C, { children: [
|
|
194
|
-
T.theme && /* @__PURE__ */ e.jsxs(w, { children: [
|
|
195
|
-
/* @__PURE__ */ e.jsx(f, { children: o.theme }),
|
|
196
|
-
/* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsxs(P, { value: N, children: [
|
|
197
|
-
/* @__PURE__ */ e.jsx(d, { value: "light", onClick: () => g("light"), children: o.light }),
|
|
198
|
-
/* @__PURE__ */ e.jsx(d, { value: "dark", onClick: () => g("dark"), children: o.dark }),
|
|
199
|
-
/* @__PURE__ */ e.jsx(d, { value: "system", onClick: () => g("system"), children: o.system })
|
|
200
|
-
] }) })
|
|
201
|
-
] }),
|
|
202
|
-
T.resetThemePref && /* @__PURE__ */ e.jsx(t, { onClick: O, children: o.resetThemePref })
|
|
203
|
-
] })
|
|
204
|
-
] })
|
|
205
|
-
] })
|
|
206
|
-
] });
|
|
207
|
-
}
|
|
208
|
-
export {
|
|
209
|
-
ee as GlobalContextMenu
|
|
210
|
-
};
|