react-docs-ui 0.8.0 → 0.9.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/README.md +1 -0
- package/dist/{AIChatDialog-C2mEAX2T.js → AIChatDialog-TeF0UMa0.js} +1 -1
- package/dist/{AISelectionTrigger-CWTJRvHo.js → AISelectionTrigger-DlIUBzEs.js} +1 -1
- package/dist/{AISettingsPanel-C9Bb_QtE.js → AISettingsPanel-DQeyU4eW.js} +26 -26
- package/dist/{DocsApp-CTh7Pa9A.js → DocsApp-DfK7TY-W.js} +5695 -3888
- package/dist/{GlobalContextMenu-DAIKsl1l.js → GlobalContextMenu-DmsqlfsV.js} +1 -1
- package/dist/{MdxContent-BAm4izu3.js → MdxContent-Bj-hsc_-.js} +120 -120
- package/dist/{MdxContent.lazy-vS9NrZj4.js → MdxContent.lazy-B_p0r_Lg.js} +1 -1
- package/dist/{SearchDialog-CLbtpf7I.js → SearchDialog-CSsOqT7K.js} +2 -2
- package/dist/{SearchRuntime--tjedqS6.js → SearchRuntime-_h-lNr-D.js} +1 -1
- package/dist/{context-menu-DwILPvwC.js → context-menu-CdhjBgD1.js} +1 -1
- package/dist/{dialog-D68sEJBe.js → dialog-DisDZkkN.js} +1 -1
- package/dist/docs-app.es.js +1 -1
- package/dist/{mdx-components-6beJPZgM.js → mdx-components-DoD1nZRa.js} +1 -1
- package/dist/react-docs-ui.css +1 -1
- package/dist/react-docs-ui.es.js +16 -16
- package/dist/types/components/BookmarkButton.d.ts +8 -0
- package/dist/types/components/BookmarkButton.d.ts.map +1 -0
- package/dist/types/components/DocsLayout.d.ts.map +1 -1
- package/dist/types/components/FontProvider.d.ts.map +1 -1
- package/dist/types/components/Footer.d.ts.map +1 -1
- package/dist/types/components/HeaderNav.d.ts.map +1 -1
- package/dist/types/components/PageFeedback.d.ts.map +1 -1
- package/dist/types/components/PageMetaActions.d.ts +1 -0
- package/dist/types/components/PageMetaActions.d.ts.map +1 -1
- package/dist/types/components/auth/LoginDialog.d.ts +8 -0
- package/dist/types/components/auth/LoginDialog.d.ts.map +1 -0
- package/dist/types/components/auth/ProfileDialog.d.ts +7 -0
- package/dist/types/components/auth/ProfileDialog.d.ts.map +1 -0
- package/dist/types/components/auth/RegisterDialog.d.ts +8 -0
- package/dist/types/components/auth/RegisterDialog.d.ts.map +1 -0
- package/dist/types/components/auth/UserMenu.d.ts +2 -0
- package/dist/types/components/auth/UserMenu.d.ts.map +1 -0
- package/dist/types/components/comments/CommentInput.d.ts +8 -0
- package/dist/types/components/comments/CommentInput.d.ts.map +1 -0
- package/dist/types/components/comments/CommentItem.d.ts +11 -0
- package/dist/types/components/comments/CommentItem.d.ts.map +1 -0
- package/dist/types/components/comments/CommentSection.d.ts +7 -0
- package/dist/types/components/comments/CommentSection.d.ts.map +1 -0
- package/dist/types/components/ui/button.d.ts +1 -1
- package/dist/types/hooks/useAnalytics.d.ts +9 -0
- package/dist/types/hooks/useAnalytics.d.ts.map +1 -0
- package/dist/types/hooks/useAuth.d.ts +24 -0
- package/dist/types/hooks/useAuth.d.ts.map +1 -0
- package/dist/types/lib/api/analytics.d.ts +4 -0
- package/dist/types/lib/api/analytics.d.ts.map +1 -0
- package/dist/types/lib/api/auth.d.ts +15 -0
- package/dist/types/lib/api/auth.d.ts.map +1 -0
- package/dist/types/lib/api/bookmarks.d.ts +9 -0
- package/dist/types/lib/api/bookmarks.d.ts.map +1 -0
- package/dist/types/lib/api/client.d.ts +14 -0
- package/dist/types/lib/api/client.d.ts.map +1 -0
- package/dist/types/lib/api/comments.d.ts +7 -0
- package/dist/types/lib/api/comments.d.ts.map +1 -0
- package/dist/types/lib/api/index.d.ts +7 -0
- package/dist/types/lib/api/index.d.ts.map +1 -0
- package/dist/types/lib/api/types.d.ts +102 -0
- package/dist/types/lib/api/types.d.ts.map +1 -0
- package/dist/types/lib/config.d.ts +33 -1
- package/dist/types/lib/config.d.ts.map +1 -1
- package/package.json +1 -1
- /package/dist/{use-toast-DK69oadB.js → use-toast-BnYFxs3T.js} +0 -0
- /package/dist/{utils-KFBtT4Mx.js → utils-C1xOyiTe.js} +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as e } from "./chunk-NBPlniwU.js";
|
|
2
|
-
import { n as t, t as n } from "./utils-
|
|
2
|
+
import { n as t, t as n } from "./utils-C1xOyiTe.js";
|
|
3
3
|
import { n as r } from "./AIProvider-niZNPSGi.js";
|
|
4
4
|
import i, { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
5
5
|
import { AlertCircle as l, AlertTriangle as u, Bot as d, Check as f, CheckCheck as p, CheckCircle as m, Copy as h, GripVertical as g, Loader2 as _, Pencil as v, RefreshCw as y, Send as b, Settings as x, Square as S, Trash2 as C, User as w, X as T } from "lucide-react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as e } from "./chunk-NBPlniwU.js";
|
|
2
|
-
import { t } from "./utils-
|
|
2
|
+
import { t } from "./utils-C1xOyiTe.js";
|
|
3
3
|
import { n } from "./AIProvider-niZNPSGi.js";
|
|
4
4
|
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
5
5
|
import { Bot as s } from "lucide-react";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { r as e } from "./chunk-NBPlniwU.js";
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { n } from "./
|
|
4
|
-
import { S as r, d as i, h as
|
|
2
|
+
import { n as t } from "./use-toast-BnYFxs3T.js";
|
|
3
|
+
import { t as n } from "./utils-C1xOyiTe.js";
|
|
4
|
+
import { S as r, d as i, h as a, l as ee, n as te, p as o, s, u as c, v as l } from "./AIProvider-niZNPSGi.js";
|
|
5
5
|
import { useEffect as u, useState as d } from "react";
|
|
6
|
-
import { Check as f, ExternalLink as p, Eye as m, EyeOff as
|
|
6
|
+
import { Check as f, ExternalLink as p, Eye as m, EyeOff as h, Info as g, Loader2 as _, Plus as v, Save as ne, Star as re, Trash2 as ie, X as ae } from "lucide-react";
|
|
7
7
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/ai/AISettingsPanel.tsx
|
|
9
9
|
var S = /* @__PURE__ */ e({ AISettingsPanel: () => C });
|
|
10
10
|
function C() {
|
|
11
|
-
let { isSettingsOpen: e, closeSettings: S, config: C, updateConfig: w } =
|
|
11
|
+
let { isSettingsOpen: e, closeSettings: S, config: C, updateConfig: w } = te(), { toast: T } = t(), [E, D] = d("openai"), [O, k] = d(l("openai")), [A, j] = d(""), [M, N] = d("providers"), [P, F] = d(!1), [I, L] = d(""), [R, z] = d({
|
|
12
12
|
modelId: "",
|
|
13
13
|
apiKey: "",
|
|
14
14
|
baseUrl: "",
|
|
@@ -31,7 +31,7 @@ function C() {
|
|
|
31
31
|
}
|
|
32
32
|
}, [C]);
|
|
33
33
|
let Y = async () => {
|
|
34
|
-
se(await
|
|
34
|
+
se(await a());
|
|
35
35
|
}, le = (e) => {
|
|
36
36
|
if (!e) return;
|
|
37
37
|
D(e);
|
|
@@ -181,14 +181,14 @@ function C() {
|
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
if (!e) return null;
|
|
184
|
-
let Q = i(E), $ =
|
|
184
|
+
let Q = i(E), $ = ee(E), me = J(E);
|
|
185
185
|
return /* @__PURE__ */ x("div", {
|
|
186
186
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
187
187
|
children: [/* @__PURE__ */ b("div", {
|
|
188
188
|
className: "absolute inset-0 bg-black/50",
|
|
189
189
|
onClick: S
|
|
190
190
|
}), /* @__PURE__ */ x("div", {
|
|
191
|
-
className:
|
|
191
|
+
className: n("relative bg-background border rounded-xl shadow-2xl", "w-full max-w-2xl mx-4 max-h-[90vh] overflow-hidden", "flex flex-col", "animate-in zoom-in-95 duration-200"),
|
|
192
192
|
children: [
|
|
193
193
|
/* @__PURE__ */ x("div", {
|
|
194
194
|
className: "flex items-center justify-between p-4 border-b",
|
|
@@ -198,18 +198,18 @@ function C() {
|
|
|
198
198
|
}), /* @__PURE__ */ b("button", {
|
|
199
199
|
onClick: S,
|
|
200
200
|
className: "p-1.5 rounded hover:bg-muted transition-colors",
|
|
201
|
-
children: /* @__PURE__ */ b(
|
|
201
|
+
children: /* @__PURE__ */ b(ae, { className: "w-4 h-4" })
|
|
202
202
|
})]
|
|
203
203
|
}),
|
|
204
204
|
/* @__PURE__ */ x("div", {
|
|
205
205
|
className: "flex border-b",
|
|
206
206
|
children: [/* @__PURE__ */ b("button", {
|
|
207
207
|
onClick: () => N("providers"),
|
|
208
|
-
className:
|
|
208
|
+
className: n("flex-1 px-4 py-3 text-sm font-medium transition-colors", M === "providers" ? "border-b-2 border-primary text-primary" : "text-muted-foreground hover:text-foreground"),
|
|
209
209
|
children: "Provider 配置"
|
|
210
210
|
}), /* @__PURE__ */ b("button", {
|
|
211
211
|
onClick: () => N("settings"),
|
|
212
|
-
className:
|
|
212
|
+
className: n("flex-1 px-4 py-3 text-sm font-medium transition-colors", M === "settings" ? "border-b-2 border-primary text-primary" : "text-muted-foreground hover:text-foreground"),
|
|
213
213
|
children: "系统设置"
|
|
214
214
|
})]
|
|
215
215
|
}),
|
|
@@ -228,12 +228,12 @@ function C() {
|
|
|
228
228
|
}), /* @__PURE__ */ x("button", {
|
|
229
229
|
onClick: () => F(!0),
|
|
230
230
|
className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
231
|
-
children: [/* @__PURE__ */ b(
|
|
231
|
+
children: [/* @__PURE__ */ b(v, { className: "w-4 h-4" }), "添加"]
|
|
232
232
|
})]
|
|
233
233
|
}), /* @__PURE__ */ b("div", {
|
|
234
234
|
className: "grid grid-cols-2 gap-2",
|
|
235
235
|
children: oe.map((e) => /* @__PURE__ */ x("div", {
|
|
236
|
-
className:
|
|
236
|
+
className: n("relative flex items-center justify-between p-3 rounded-lg border transition-colors", E === e ? "bg-primary/10 border-primary" : "bg-background hover:bg-muted border-border"),
|
|
237
237
|
children: [/* @__PURE__ */ x("button", {
|
|
238
238
|
onClick: () => le(e),
|
|
239
239
|
className: "flex-1 text-left",
|
|
@@ -242,13 +242,13 @@ function C() {
|
|
|
242
242
|
children: c(e)
|
|
243
243
|
}), C?.provider === e && /* @__PURE__ */ x("div", {
|
|
244
244
|
className: "text-xs text-primary flex items-center gap-1",
|
|
245
|
-
children: [/* @__PURE__ */ b(
|
|
245
|
+
children: [/* @__PURE__ */ b(re, { className: "w-3 h-3" }), "当前使用"]
|
|
246
246
|
})]
|
|
247
247
|
}), !me && /* @__PURE__ */ b("button", {
|
|
248
248
|
onClick: () => fe(e),
|
|
249
249
|
className: "p-1.5 rounded hover:bg-muted text-destructive",
|
|
250
250
|
title: "删除",
|
|
251
|
-
children: /* @__PURE__ */ b(
|
|
251
|
+
children: /* @__PURE__ */ b(ie, { className: "w-4 h-4" })
|
|
252
252
|
})]
|
|
253
253
|
}, e))
|
|
254
254
|
})]
|
|
@@ -286,7 +286,7 @@ function C() {
|
|
|
286
286
|
type: "button",
|
|
287
287
|
onClick: () => V(!B),
|
|
288
288
|
className: "absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground",
|
|
289
|
-
children: b(B ?
|
|
289
|
+
children: b(B ? h : m, { className: "w-4 h-4" })
|
|
290
290
|
})]
|
|
291
291
|
})]
|
|
292
292
|
}),
|
|
@@ -374,21 +374,21 @@ function C() {
|
|
|
374
374
|
})]
|
|
375
375
|
}),
|
|
376
376
|
W && /* @__PURE__ */ x("div", {
|
|
377
|
-
className:
|
|
378
|
-
children: [W.success ? /* @__PURE__ */ b(f, { className: "w-4 h-4 shrink-0" }) : /* @__PURE__ */ b(
|
|
377
|
+
className: n("flex items-center gap-2 p-3 rounded-lg text-sm", W.success ? "bg-green-500/10 text-green-600 dark:text-green-400" : "bg-destructive/10 text-destructive"),
|
|
378
|
+
children: [W.success ? /* @__PURE__ */ b(f, { className: "w-4 h-4 shrink-0" }) : /* @__PURE__ */ b(g, { className: "w-4 h-4 shrink-0" }), /* @__PURE__ */ b("span", { children: W.message })]
|
|
379
379
|
}),
|
|
380
380
|
/* @__PURE__ */ x("div", {
|
|
381
381
|
className: "flex items-center gap-2 pt-4 border-t",
|
|
382
382
|
children: [/* @__PURE__ */ b("button", {
|
|
383
383
|
onClick: ue,
|
|
384
384
|
disabled: !O.apiKey || !O.modelId || H,
|
|
385
|
-
className:
|
|
386
|
-
children: H ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(
|
|
385
|
+
className: n("flex items-center gap-2 px-4 py-2 rounded-lg text-sm", "border border-border hover:bg-muted transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
386
|
+
children: H ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_, { className: "w-4 h-4 animate-spin" }), "测试中..."] }) : "测试连接"
|
|
387
387
|
}), /* @__PURE__ */ b("button", {
|
|
388
388
|
onClick: de,
|
|
389
389
|
disabled: K,
|
|
390
|
-
className:
|
|
391
|
-
children: K ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(
|
|
390
|
+
className: n("flex items-center gap-2 px-4 py-2 rounded-lg text-sm ml-auto", "bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
391
|
+
children: K ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_, { className: "w-4 h-4 animate-spin" }), "保存中..."] }) : "保存设置"
|
|
392
392
|
})]
|
|
393
393
|
})
|
|
394
394
|
]
|
|
@@ -477,8 +477,8 @@ function C() {
|
|
|
477
477
|
}), /* @__PURE__ */ b("button", {
|
|
478
478
|
onClick: Z,
|
|
479
479
|
disabled: K,
|
|
480
|
-
className:
|
|
481
|
-
children: K ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(
|
|
480
|
+
className: n("flex items-center gap-2 px-4 py-2 rounded-lg text-sm ml-auto", "bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
481
|
+
children: K ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_, { className: "w-4 h-4 animate-spin" }), "添加中..."] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(v, { className: "w-4 h-4" }), "添加"] })
|
|
482
482
|
})]
|
|
483
483
|
})
|
|
484
484
|
]
|
|
@@ -510,8 +510,8 @@ function C() {
|
|
|
510
510
|
children: /* @__PURE__ */ b("button", {
|
|
511
511
|
onClick: pe,
|
|
512
512
|
disabled: K,
|
|
513
|
-
className:
|
|
514
|
-
children: K ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(
|
|
513
|
+
className: n("flex items-center gap-2 px-4 py-2 rounded-lg text-sm ml-auto", "bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
514
|
+
children: K ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_, { className: "w-4 h-4 animate-spin" }), "保存中..."] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(ne, { className: "w-4 h-4" }), "保存提示词"] })
|
|
515
515
|
})
|
|
516
516
|
})]
|
|
517
517
|
})]
|