react-docs-ui 0.6.10 → 0.6.11

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.
Files changed (99) hide show
  1. package/README.md +7 -10
  2. package/dist/GlobalContextMenu-B8XZ1MXh.js +209 -0
  3. package/dist/MdxContent.lazy-B15Pt0p4.js +4 -0
  4. package/dist/fonts/02c687e7ed17b3df.woff2 +0 -0
  5. package/dist/fonts/09d4de25241bfe76.woff +0 -0
  6. package/dist/fonts/09dfac589fa421e8.woff2 +0 -0
  7. package/dist/fonts/0d29b2b1f8303138.ttf +0 -0
  8. package/dist/fonts/0e9f19247ab3bbab.ttf +0 -0
  9. package/dist/fonts/1969dbe1bc0fb3ba.woff +0 -0
  10. package/dist/fonts/1f89d2fedc85c386.woff +0 -0
  11. package/dist/fonts/20b388d1a51f5745.ttf +0 -0
  12. package/dist/fonts/21851da450182870.ttf +0 -0
  13. package/dist/fonts/22d5c4e6cd1e9474.woff2 +0 -0
  14. package/dist/fonts/22e83d374a2e6691.woff +0 -0
  15. package/dist/fonts/2f36d9db5ff365d4.woff +0 -0
  16. package/dist/fonts/314032aa9f107304.woff2 +0 -0
  17. package/dist/fonts/3533cc38c9cdc602.ttf +0 -0
  18. package/dist/fonts/3d0f44e32f2e74f2.ttf +0 -0
  19. package/dist/fonts/4124e542a1b58f9d.woff +0 -0
  20. package/dist/fonts/46d68807665c21f9.ttf +0 -0
  21. package/dist/fonts/4e1eaced156586d3.ttf +0 -0
  22. package/dist/fonts/4fc7ad74569941de.woff +0 -0
  23. package/dist/fonts/552292117efd3f42.ttf +0 -0
  24. package/dist/fonts/552f66ef43fc7522.woff +0 -0
  25. package/dist/fonts/5600e0919751e982.woff +0 -0
  26. package/dist/fonts/58d42913cac4cb53.woff2 +0 -0
  27. package/dist/fonts/5cff588fceb2856c.ttf +0 -0
  28. package/dist/fonts/5d09426707f9d063.ttf +0 -0
  29. package/dist/fonts/607b70ee0da7b15f.woff2 +0 -0
  30. package/dist/fonts/6652f5c5affcddc6.ttf +0 -0
  31. package/dist/fonts/69732d145fb77d46.ttf +0 -0
  32. package/dist/fonts/69ed18356e7517f2.woff2 +0 -0
  33. package/dist/fonts/705a1783b9c1d57b.ttf +0 -0
  34. package/dist/fonts/72bb9b68fd978fda.woff +0 -0
  35. package/dist/fonts/745939d4e3f4755f.woff2 +0 -0
  36. package/dist/fonts/7591411ae35bc580.woff +0 -0
  37. package/dist/fonts/786e88705bcced94.woff2 +0 -0
  38. package/dist/fonts/79d8b432f0a85a07.woff +0 -0
  39. package/dist/fonts/83b99a8c57312e6e.woff2 +0 -0
  40. package/dist/fonts/83fb1a9d8474dd56.woff2 +0 -0
  41. package/dist/fonts/8cfd3def12a3c5ef.ttf +0 -0
  42. package/dist/fonts/90b626c33ef816d4.ttf +0 -0
  43. package/dist/fonts/96bbd8e3dc776eb1.woff +0 -0
  44. package/dist/fonts/99d6d1362d7b9b12.woff2 +0 -0
  45. package/dist/fonts/a27661173f0a7433.woff2 +0 -0
  46. package/dist/fonts/abe35a8c78edf887.woff +0 -0
  47. package/dist/fonts/ad9576beef3f1d4e.woff2 +0 -0
  48. package/dist/fonts/adbfefebea65cf02.ttf +0 -0
  49. package/dist/fonts/b4aab29b79f992e3.woff2 +0 -0
  50. package/dist/fonts/b9b897e4301ad703.woff2 +0 -0
  51. package/dist/fonts/be03438595f83d0f.ttf +0 -0
  52. package/dist/fonts/c2b56591519e9293.woff2 +0 -0
  53. package/dist/fonts/c505bdad51c9abfa.ttf +0 -0
  54. package/dist/fonts/c811e89c187ceac5.woff +0 -0
  55. package/dist/fonts/ce2290c5c835ea00.woff +0 -0
  56. package/dist/fonts/ce4cb83d70539101.woff2 +0 -0
  57. package/dist/fonts/d601cb8345d82ba5.ttf +0 -0
  58. package/dist/fonts/d6f6ac428c874555.woff +0 -0
  59. package/dist/fonts/debedc918129c66f.woff2 +0 -0
  60. package/dist/fonts/e079035466b8f120.woff +0 -0
  61. package/dist/fonts/e618042c847fd3b9.woff2 +0 -0
  62. package/dist/fonts/e71ae6d3e7debcfd.woff +0 -0
  63. package/dist/fonts/f61879e5a60b36a0.woff +0 -0
  64. package/dist/index-DOSBzyKY.js +39104 -0
  65. package/dist/index-DQPDmZq9.js +11 -0
  66. package/dist/index-Dkm4IQwC.js +11 -0
  67. package/dist/react-docs-ui.css +1 -1
  68. package/dist/react-docs-ui.es.js +126 -30878
  69. package/dist/types/components/ExportAllDialog.d.ts.map +1 -1
  70. package/dist/types/components/ExportToolbar.d.ts.map +1 -1
  71. package/dist/types/components/FloatingActionBall.d.ts.map +1 -1
  72. package/dist/types/components/FontProvider.d.ts.map +1 -1
  73. package/dist/types/components/ImageViewer.d.ts.map +1 -1
  74. package/dist/types/components/MdxContent.d.ts +5 -2
  75. package/dist/types/components/MdxContent.d.ts.map +1 -1
  76. package/dist/types/components/MdxContent.lazy.d.ts +2 -0
  77. package/dist/types/components/MdxContent.lazy.d.ts.map +1 -0
  78. package/dist/types/components/TableOfContents.d.ts +1 -5
  79. package/dist/types/components/TableOfContents.d.ts.map +1 -1
  80. package/dist/types/components/ai/AISettingsPanel.d.ts.map +1 -1
  81. package/dist/types/components/ui/toast.d.ts +1 -1
  82. package/dist/types/components/ui/toast.d.ts.map +1 -1
  83. package/dist/types/components/ui/use-toast.d.ts.map +1 -1
  84. package/dist/types/generated/shiki-bundle.d.ts +17 -0
  85. package/dist/types/generated/shiki-bundle.d.ts.map +1 -0
  86. package/dist/types/index.d.ts +1 -0
  87. package/dist/types/index.d.ts.map +1 -1
  88. package/dist/types/lib/config.d.ts +6 -0
  89. package/dist/types/lib/config.d.ts.map +1 -1
  90. package/dist/types/lib/export-utils.d.ts +5 -1
  91. package/dist/types/lib/export-utils.d.ts.map +1 -1
  92. package/dist/types/lib/rehype-toc.d.ts +21 -0
  93. package/dist/types/lib/rehype-toc.d.ts.map +1 -1
  94. package/dist/types/lib/shiki-highlighter.d.ts +18 -4
  95. package/dist/types/lib/shiki-highlighter.d.ts.map +1 -1
  96. package/dist/types/lib/toc-render.d.ts +4 -0
  97. package/dist/types/lib/toc-render.d.ts.map +1 -0
  98. package/dist/types/shiki-modules.d.ts +9 -0
  99. package/package.json +1 -1
package/README.md CHANGED
@@ -7,20 +7,17 @@ React documentation site UI components. Build modern docs sites with a ready-to-
7
7
  ### Install
8
8
 
9
9
  ```bash
10
- npm install react-docs-ui
10
+ npx create-react-docs-ui@latest my-docs
11
11
  ```
12
12
 
13
13
  ### Quick Start
14
14
 
15
- Full app (reads `public/config/site(.lang).yaml` and `public/docs/<lang>/**/*.md`):
15
+ Use the official scaffolding tool. Manual integration is no longer recommended because configuration parsing and runtime behavior depend on the generated project structure.
16
16
 
17
- ```tsx
18
- import 'react-docs-ui/dist/style.css'
19
- import { DocsApp } from 'react-docs-ui'
20
-
21
- export default function App() {
22
- return <DocsApp />
23
- }
17
+ ```bash
18
+ cd my-docs
19
+ npm install
20
+ npm run dev
24
21
  ```
25
22
 
26
23
  ### Features
@@ -46,4 +43,4 @@ export default function App() {
46
43
 
47
44
  ### License
48
45
 
49
- MIT
46
+ MIT
@@ -0,0 +1,209 @@
1
+ import { l as D, m as e, C as A, n as Q, o as W, p as C, q as j, r as t, s as y, t as w, v as f, w as v, x as P, y as d } from "./index-DOSBzyKY.js";
2
+ import { useCallback as c } from "react";
3
+ import { useNavigate as _, useLocation as J } from "react-router-dom";
4
+ const K = {
5
+ "zh-cn": {
6
+ page: "页面",
7
+ copyUrl: "复制当前链接",
8
+ copyTitle: "复制页面标题",
9
+ copyMarkdownLink: "复制 Markdown 链接",
10
+ copySelectedText: "复制",
11
+ openInNewTab: "在新标签页打开",
12
+ reload: "刷新",
13
+ printPage: "打印页面",
14
+ scrollToTop: "回到顶部",
15
+ scrollToBottom: "滚动到底部",
16
+ site: "站点",
17
+ goHome: "返回首页",
18
+ quickNav: "快速跳转",
19
+ docsIndex: "文档首页",
20
+ guide: "指南",
21
+ introduction: "简介",
22
+ installation: "安装",
23
+ quickStart: "快速开始",
24
+ configuration: "配置",
25
+ language: "语言",
26
+ appearance: "外观",
27
+ theme: "主题",
28
+ light: "浅色",
29
+ dark: "深色",
30
+ system: "跟随系统",
31
+ resetThemePref: "重置主题偏好"
32
+ },
33
+ en: {
34
+ page: "Page",
35
+ copyUrl: "Copy Current URL",
36
+ copyTitle: "Copy Page Title",
37
+ copyMarkdownLink: "Copy Markdown Link",
38
+ copySelectedText: "Copy",
39
+ openInNewTab: "Open in New Tab",
40
+ reload: "Reload",
41
+ printPage: "Print Page",
42
+ scrollToTop: "Scroll to Top",
43
+ scrollToBottom: "Scroll to Bottom",
44
+ site: "Site",
45
+ goHome: "Go Home",
46
+ quickNav: "Quick Navigation",
47
+ docsIndex: "Docs Index",
48
+ guide: "Guide",
49
+ introduction: "Introduction",
50
+ installation: "Installation",
51
+ quickStart: "Quick Start",
52
+ configuration: "Configuration",
53
+ language: "Language",
54
+ appearance: "Appearance",
55
+ theme: "Theme",
56
+ light: "Light",
57
+ dark: "Dark",
58
+ system: "System",
59
+ resetThemePref: "Reset Theme Preference"
60
+ }
61
+ }, x = {
62
+ enabled: !0,
63
+ page: {
64
+ copyUrl: !0,
65
+ copyTitle: !0,
66
+ copyMarkdownLink: !0,
67
+ copySelectedText: !0,
68
+ openInNewTab: !0,
69
+ reload: !0,
70
+ printPage: !0,
71
+ scrollToTop: !0,
72
+ scrollToBottom: !0
73
+ },
74
+ site: {
75
+ goHome: !0,
76
+ quickNav: !0,
77
+ language: !0
78
+ },
79
+ appearance: {
80
+ theme: !0,
81
+ resetThemePref: !0
82
+ }
83
+ };
84
+ function Z({
85
+ children: b,
86
+ config: S
87
+ }) {
88
+ const l = _(), m = J(), { theme: N, setTheme: g } = D(), s = c(async (a) => {
89
+ if (navigator.clipboard && window.isSecureContext)
90
+ await navigator.clipboard.writeText(a);
91
+ else {
92
+ const n = document.createElement("textarea");
93
+ n.value = a, n.style.position = "fixed", n.style.left = "-9999px", n.style.top = "-9999px", document.body.appendChild(n), n.focus(), n.select();
94
+ try {
95
+ document.execCommand("copy");
96
+ } finally {
97
+ document.body.removeChild(n);
98
+ }
99
+ }
100
+ }, []), L = c(async () => {
101
+ try {
102
+ await s(window.location.href);
103
+ } catch {
104
+ }
105
+ }, [s]), B = c(async () => {
106
+ try {
107
+ await s(document.title || "");
108
+ } catch {
109
+ }
110
+ }, [s]), q = c(async () => {
111
+ try {
112
+ const a = document.title || "Docs", n = window.location.href;
113
+ await s(`[${a}](${n})`);
114
+ } catch {
115
+ }
116
+ }, [s]), H = c(async () => {
117
+ try {
118
+ const a = window.getSelection()?.toString() || "";
119
+ a && await s(a);
120
+ } catch {
121
+ }
122
+ }, [s]), U = c(() => {
123
+ window.open(window.location.href, "_blank");
124
+ }, []), R = c(() => {
125
+ window.location.reload();
126
+ }, []), z = c(() => l("/"), [l]), u = m.pathname.startsWith("/en") ? "en" : "zh-cn", o = K[u], M = c(
127
+ (a) => {
128
+ const n = m.pathname.split("/").filter(Boolean);
129
+ n.length > 0 && (n[0] === "en" || n[0] === "zh-cn") ? n[0] = a : n.unshift(a), l("/" + n.join("/"));
130
+ },
131
+ [m.pathname, l]
132
+ ), G = c(() => window.scrollTo({ top: 0, behavior: "smooth" }), []), E = c(
133
+ () => window.scrollTo({ top: document.documentElement.scrollHeight, behavior: "smooth" }),
134
+ []
135
+ ), F = c(() => window.print(), []), r = c((a) => l(`/${u}/${a}`), [l, u]), O = c(() => {
136
+ try {
137
+ localStorage.removeItem("vite-ui-theme");
138
+ } catch {
139
+ }
140
+ }, []), p = S?.enabled === !1 ? null : { ...x, ...S };
141
+ if (!p)
142
+ return /* @__PURE__ */ e.jsx("div", { className: "min-h-screen", children: b });
143
+ const i = { ...x.page, ...p.page }, h = { ...x.site, ...p.site }, T = { ...x.appearance, ...p.appearance }, k = Object.values(i).some(Boolean), I = Object.values(h).some(Boolean), $ = Object.values(T).some(Boolean);
144
+ return /* @__PURE__ */ e.jsxs(A, { children: [
145
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "min-h-screen", children: b }) }),
146
+ /* @__PURE__ */ e.jsxs(W, { children: [
147
+ k && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
148
+ /* @__PURE__ */ e.jsx(C, { children: o.page }),
149
+ /* @__PURE__ */ e.jsxs(j, { children: [
150
+ i.copyUrl && /* @__PURE__ */ e.jsx(t, { onClick: L, children: o.copyUrl }),
151
+ i.copyTitle && /* @__PURE__ */ e.jsx(t, { onClick: B, children: o.copyTitle }),
152
+ i.copyMarkdownLink && /* @__PURE__ */ e.jsx(t, { onClick: q, children: o.copyMarkdownLink }),
153
+ i.copySelectedText && /* @__PURE__ */ e.jsx(t, { onClick: H, children: o.copySelectedText }),
154
+ i.openInNewTab && /* @__PURE__ */ e.jsx(t, { onClick: U, children: o.openInNewTab }),
155
+ i.reload && /* @__PURE__ */ e.jsx(t, { onClick: R, children: o.reload }),
156
+ i.printPage && /* @__PURE__ */ e.jsx(t, { onClick: F, children: o.printPage }),
157
+ (i.scrollToTop || i.scrollToBottom) && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
158
+ /* @__PURE__ */ e.jsx(y, {}),
159
+ i.scrollToTop && /* @__PURE__ */ e.jsx(t, { onClick: G, children: o.scrollToTop }),
160
+ i.scrollToBottom && /* @__PURE__ */ e.jsx(t, { onClick: E, children: o.scrollToBottom })
161
+ ] })
162
+ ] })
163
+ ] }),
164
+ I && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
165
+ k && /* @__PURE__ */ e.jsx(y, {}),
166
+ /* @__PURE__ */ e.jsx(C, { children: o.site }),
167
+ /* @__PURE__ */ e.jsxs(j, { children: [
168
+ h.goHome && /* @__PURE__ */ e.jsx(t, { onClick: z, children: o.goHome }),
169
+ h.quickNav && /* @__PURE__ */ e.jsxs(w, { children: [
170
+ /* @__PURE__ */ e.jsx(f, { children: o.quickNav }),
171
+ /* @__PURE__ */ e.jsxs(v, { children: [
172
+ /* @__PURE__ */ e.jsx(t, { onClick: () => r("index"), children: o.docsIndex }),
173
+ /* @__PURE__ */ e.jsx(t, { onClick: () => r("guide"), children: o.guide }),
174
+ /* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/introduction"), children: o.introduction }),
175
+ /* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/installation"), children: o.installation }),
176
+ /* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/quick-start"), children: o.quickStart }),
177
+ /* @__PURE__ */ e.jsx(t, { onClick: () => r("guide/configuration"), children: o.configuration })
178
+ ] })
179
+ ] }),
180
+ h.language && /* @__PURE__ */ e.jsxs(w, { children: [
181
+ /* @__PURE__ */ e.jsx(f, { children: o.language }),
182
+ /* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsxs(P, { value: u, children: [
183
+ /* @__PURE__ */ e.jsx(d, { value: "en", onClick: () => M("en"), children: "English" }),
184
+ /* @__PURE__ */ e.jsx(d, { value: "zh-cn", onClick: () => M("zh-cn"), children: "简体中文" })
185
+ ] }) })
186
+ ] })
187
+ ] })
188
+ ] }),
189
+ $ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
190
+ (k || I) && /* @__PURE__ */ e.jsx(y, {}),
191
+ /* @__PURE__ */ e.jsx(C, { children: o.appearance }),
192
+ /* @__PURE__ */ e.jsxs(j, { children: [
193
+ T.theme && /* @__PURE__ */ e.jsxs(w, { children: [
194
+ /* @__PURE__ */ e.jsx(f, { children: o.theme }),
195
+ /* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsxs(P, { value: N, children: [
196
+ /* @__PURE__ */ e.jsx(d, { value: "light", onClick: () => g("light"), children: o.light }),
197
+ /* @__PURE__ */ e.jsx(d, { value: "dark", onClick: () => g("dark"), children: o.dark }),
198
+ /* @__PURE__ */ e.jsx(d, { value: "system", onClick: () => g("system"), children: o.system })
199
+ ] }) })
200
+ ] }),
201
+ T.resetThemePref && /* @__PURE__ */ e.jsx(t, { onClick: O, children: o.resetThemePref })
202
+ ] })
203
+ ] })
204
+ ] })
205
+ ] });
206
+ }
207
+ export {
208
+ Z as GlobalContextMenu
209
+ };
@@ -0,0 +1,4 @@
1
+ import { M as f } from "./index-DOSBzyKY.js";
2
+ export {
3
+ f as default
4
+ };
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file