react-docs-ui 0.7.5 → 0.8.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.
Files changed (78) hide show
  1. package/dist/AIChatDialog-C2mEAX2T.js +407 -0
  2. package/dist/{AISelectionTrigger-SLyb8Vep.js → AISelectionTrigger-CWTJRvHo.js} +1 -1
  3. package/dist/{AISettingsPanel-Bsd_wLP4.js → AISettingsPanel-C9Bb_QtE.js} +1 -1
  4. package/dist/{DocsApp-B-VaP4ms.js → DocsApp-CTh7Pa9A.js} +3867 -3616
  5. package/dist/{GlobalContextMenu-BtVjQk0v.js → GlobalContextMenu-DAIKsl1l.js} +1 -1
  6. package/dist/{MdxContent-CZLqZlNp.js → MdxContent-BAm4izu3.js} +305 -317
  7. package/dist/{MdxContent.lazy-i9phqEH3.js → MdxContent.lazy-vS9NrZj4.js} +1 -1
  8. package/dist/{SearchDialog-DWVre6R9.js → SearchDialog-CLbtpf7I.js} +172 -127
  9. package/dist/{SearchRuntime-D0rSMKV3.js → SearchRuntime--tjedqS6.js} +5 -4
  10. package/dist/{architectureDiagram-2XIMDMQ5-DmhcSwl7.js → architectureDiagram-2XIMDMQ5-D5B3Bc8w.js} +1 -1
  11. package/dist/{chunk-GLR3WWYH-ShSppUzV.js → chunk-GLR3WWYH-C7t8eN-i.js} +1 -1
  12. package/dist/{chunk-NQ4KR5QH-BWRGvKed.js → chunk-NQ4KR5QH-ygKrPhgw.js} +1 -1
  13. package/dist/{chunk-WL4C6EOR-DLbU3P3W.js → chunk-WL4C6EOR-BX4P121X.js} +1 -1
  14. package/dist/{classDiagram-VBA2DB6C-D4y64v83.js → classDiagram-VBA2DB6C-CWWKW2ZN.js} +2 -2
  15. package/dist/{classDiagram-v2-RAHNMMFH-DXkt0Wd4.js → classDiagram-v2-RAHNMMFH-9SKKaVzh.js} +2 -2
  16. package/dist/{context-menu-BIQsQup7.js → context-menu-DwILPvwC.js} +1 -1
  17. package/dist/{cose-bilkent-S5V4N54A-BX63fiTJ.js → cose-bilkent-S5V4N54A-DCXUWrka.js} +1 -1
  18. package/dist/{dialog-D8otbqQL.js → dialog-D68sEJBe.js} +1 -1
  19. package/dist/docs-app.es.js +1 -1
  20. package/dist/{erDiagram-INFDFZHY-DjNq2UqZ.js → erDiagram-INFDFZHY-DdivnAXH.js} +1 -1
  21. package/dist/{flowDiagram-PKNHOUZH-AUeVhXRc.js → flowDiagram-PKNHOUZH-CgCGjn11.js} +1 -1
  22. package/dist/{mdx-components-m1cGPhc8.js → mdx-components-6beJPZgM.js} +3 -3
  23. package/dist/{mermaid.core-CtkJeRVj.js → mermaid.core-Dg_svxvF.js} +12 -12
  24. package/dist/{mindmap-definition-YRQLILUH-Cnl-qPDR.js → mindmap-definition-YRQLILUH-3st_5tCe.js} +1 -1
  25. package/dist/react-docs-ui.css +1 -1
  26. package/dist/react-docs-ui.es.js +10 -10
  27. package/dist/{requirementDiagram-Z7DCOOCP-Bx6NAgqy.js → requirementDiagram-Z7DCOOCP-ClKKAQ0C.js} +1 -1
  28. package/dist/{stateDiagram-RAJIS63D-DFmbSHPX.js → stateDiagram-RAJIS63D-C8Ab__vp.js} +2 -2
  29. package/dist/{stateDiagram-v2-FVOUBMTO-TjYtTjLB.js → stateDiagram-v2-FVOUBMTO-BhQBkYI5.js} +2 -2
  30. package/dist/types/components/Breadcrumb.d.ts +14 -0
  31. package/dist/types/components/Breadcrumb.d.ts.map +1 -0
  32. package/dist/types/components/DocsLayout.d.ts.map +1 -1
  33. package/dist/types/components/ExportToolbar.d.ts +8 -1
  34. package/dist/types/components/ExportToolbar.d.ts.map +1 -1
  35. package/dist/types/components/HeaderNav.d.ts.map +1 -1
  36. package/dist/types/components/MdxContent.d.ts.map +1 -1
  37. package/dist/types/components/MobileSidebar.d.ts +2 -7
  38. package/dist/types/components/MobileSidebar.d.ts.map +1 -1
  39. package/dist/types/components/ReadingProgressBar.d.ts +4 -0
  40. package/dist/types/components/ReadingProgressBar.d.ts.map +1 -0
  41. package/dist/types/components/ReleaseMetaBar.d.ts +1 -1
  42. package/dist/types/components/ReleaseMetaBar.d.ts.map +1 -1
  43. package/dist/types/components/SearchLauncher.d.ts +2 -1
  44. package/dist/types/components/SearchLauncher.d.ts.map +1 -1
  45. package/dist/types/components/ai/AIChatMessage.d.ts.map +1 -1
  46. package/dist/types/components/search/SearchItem.d.ts.map +1 -1
  47. package/dist/types/components/search/SearchProvider.d.ts +2 -1
  48. package/dist/types/components/search/SearchProvider.d.ts.map +1 -1
  49. package/dist/types/components/search/SearchRuntime.d.ts +2 -1
  50. package/dist/types/components/search/SearchRuntime.d.ts.map +1 -1
  51. package/dist/types/hooks/useScrollPosition.d.ts.map +1 -1
  52. package/dist/types/lib/changelog.d.ts +1 -1
  53. package/dist/types/lib/changelog.d.ts.map +1 -1
  54. package/dist/types/lib/config.d.ts +21 -0
  55. package/dist/types/lib/config.d.ts.map +1 -1
  56. package/dist/types/lib/reading-time.d.ts +7 -0
  57. package/dist/types/lib/reading-time.d.ts.map +1 -0
  58. package/dist/types/lib/search/index.d.ts +2 -1
  59. package/dist/types/lib/search/index.d.ts.map +1 -1
  60. package/dist/types/lib/search/runtime/highlighter.d.ts +10 -0
  61. package/dist/types/lib/search/runtime/highlighter.d.ts.map +1 -1
  62. package/dist/types/lib/search/runtime/search-engine.d.ts.map +1 -1
  63. package/dist/types/lib/search/runtime/types.d.ts +1 -0
  64. package/dist/types/lib/search/runtime/types.d.ts.map +1 -1
  65. package/dist/types/lib/utils.d.ts +2 -0
  66. package/dist/types/lib/utils.d.ts.map +1 -1
  67. package/dist/utils-KFBtT4Mx.js +25 -0
  68. package/package.json +16 -5
  69. package/scripts/cli.mjs +20 -0
  70. package/scripts/generate-changelog-index.mjs +89 -0
  71. package/scripts/generate-doc-git-meta.mjs +63 -0
  72. package/scripts/generate-feed.mjs +122 -0
  73. package/scripts/generate-llms-files.mjs +34 -0
  74. package/scripts/generate-search-index.mjs +236 -0
  75. package/scripts/generate-shiki-bundle.mjs +80 -0
  76. package/scripts/generate-sitemap.mjs +186 -0
  77. package/dist/AIChatDialog-BnAX3dRn.js +0 -418
  78. package/dist/utils-Ct96Mtjw.js +0 -8
@@ -1,4 +1,4 @@
1
- import { t as e } from "./MdxContent-CZLqZlNp.js";
1
+ import { t as e } from "./MdxContent-BAm4izu3.js";
2
2
  import t from "katex";
3
3
  t.__defineMacro("\\ce", function(e) {
4
4
  return n(e.consumeArgs(1)[0], "ce");
@@ -1,17 +1,17 @@
1
- import { t as e } from "./utils-Ct96Mtjw.js";
2
- import { l as t, r as n, t as r, u as i } from "./dialog-D8otbqQL.js";
3
- import { createContext as a, forwardRef as o, useCallback as s, useContext as c, useEffect as l, useRef as u, useState as d } from "react";
4
- import { FileText as f, Loader2 as p, Search as m, X as h } from "lucide-react";
5
- import { useNavigate as g } from "react-router-dom";
6
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
7
- import y from "flexsearch";
1
+ import { t as e } from "./utils-KFBtT4Mx.js";
2
+ import { l as t, r as n, t as r, u as i } from "./dialog-D68sEJBe.js";
3
+ import { Fragment as a, createContext as o, forwardRef as s, useCallback as c, useContext as l, useEffect as u, useRef as d, useState as f } from "react";
4
+ import { FileText as p, Loader2 as m, Search as h, X as g } from "lucide-react";
5
+ import { useNavigate as _ } from "react-router-dom";
6
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
7
+ import x from "flexsearch";
8
8
  //#region src/lib/search/runtime/search-engine.ts
9
- var b = 20, x = class {
9
+ var S = 20, C = 150, w = class {
10
10
  index;
11
11
  sections = /* @__PURE__ */ new Map();
12
12
  initialized = !1;
13
13
  constructor() {
14
- this.index = new y.Index({
14
+ this.index = new x.Index({
15
15
  tokenize: "full",
16
16
  resolution: 9,
17
17
  cache: 100
@@ -23,7 +23,7 @@ var b = 20, x = class {
23
23
  this.initialized = !0;
24
24
  }
25
25
  clear() {
26
- this.sections.clear(), this.index = new y.Index({
26
+ this.sections.clear(), this.index = new x.Index({
27
27
  tokenize: "full",
28
28
  resolution: 9,
29
29
  cache: 100
@@ -31,10 +31,10 @@ var b = 20, x = class {
31
31
  }
32
32
  search(e) {
33
33
  if (!this.initialized) return [];
34
- let { query: t, version: n, limit: r = b } = e, i = t.toLowerCase().trim();
35
- if (!i) return [];
36
- let a = Math.max(r * 5, r);
37
- return this.index.search(i, { limit: a }).map((e) => {
34
+ let { query: t, version: n, limit: r = S, snippetLength: i = C } = e, a = t.toLowerCase().trim();
35
+ if (!a) return [];
36
+ let o = Math.max(r * 5, r);
37
+ return this.index.search(a, { limit: o }).map((e) => {
38
38
  let t = this.sections.get(e);
39
39
  if (!t) return null;
40
40
  if (n) {
@@ -44,24 +44,24 @@ var b = 20, x = class {
44
44
  id: t.id,
45
45
  pageTitle: t.pageTitle,
46
46
  sectionTitle: t.sectionTitle,
47
- snippet: this.generateSnippet(t.content, i),
47
+ snippet: this.generateSnippet(t.content, a, i),
48
48
  url: t.url,
49
49
  score: 1
50
50
  };
51
51
  }).filter((e) => e !== null).slice(0, r);
52
52
  }
53
- generateSnippet(e, t) {
53
+ generateSnippet(e, t, n) {
54
54
  if (!e) return "";
55
- let n = e.toLowerCase(), r = t.split(/\s+/).filter(Boolean), i = 0;
56
- for (let e of r) {
57
- let t = n.indexOf(e);
55
+ let r = e.toLowerCase(), i = t.split(/\s+/).filter(Boolean), a = 0;
56
+ for (let e of i) {
57
+ let t = r.indexOf(e);
58
58
  if (t !== -1) {
59
- i = t;
59
+ a = t;
60
60
  break;
61
61
  }
62
62
  }
63
- let a = Math.max(0, i - 30), o = Math.min(e.length, a + 150), s = e.slice(a, o);
64
- return a > 0 && (s = "..." + s), o < e.length && (s += "..."), s;
63
+ let o = Math.max(0, a - 30), s = Math.min(e.length, o + n), c = e.slice(o, s);
64
+ return o > 0 && (c = "..." + c), s < e.length && (c += "..."), c;
65
65
  }
66
66
  isInitialized() {
67
67
  return this.initialized;
@@ -69,10 +69,44 @@ var b = 20, x = class {
69
69
  getSectionCount() {
70
70
  return this.sections.size;
71
71
  }
72
- }, S = new x();
72
+ }, T = new w();
73
73
  //#endregion
74
74
  //#region src/lib/search/runtime/highlighter.ts
75
- function C(e, t, n = "mark") {
75
+ function E(e, t) {
76
+ if (!e || t.length === 0) return [{
77
+ text: e,
78
+ highlighted: !1
79
+ }];
80
+ let n = e.toLowerCase(), r = [];
81
+ for (let e of t) {
82
+ let t = e.toLowerCase(), i = 0;
83
+ for (;;) {
84
+ let a = n.indexOf(t, i);
85
+ if (a === -1) break;
86
+ r.push({
87
+ start: a,
88
+ end: a + e.length
89
+ }), i = a + 1;
90
+ }
91
+ }
92
+ if (r.length === 0) return [{
93
+ text: e,
94
+ highlighted: !1
95
+ }];
96
+ let i = O(r), a = [], o = 0;
97
+ for (let t of i) t.start > o && a.push({
98
+ text: e.slice(o, t.start),
99
+ highlighted: !1
100
+ }), a.push({
101
+ text: e.slice(t.start, t.end),
102
+ highlighted: !0
103
+ }), o = t.end;
104
+ return o < e.length && a.push({
105
+ text: e.slice(o),
106
+ highlighted: !1
107
+ }), a;
108
+ }
109
+ function D(e, t, n = "mark") {
76
110
  if (!e || t.length === 0) return e;
77
111
  let r = e.toLowerCase(), i = [];
78
112
  for (let e of t) {
@@ -87,11 +121,11 @@ function C(e, t, n = "mark") {
87
121
  }
88
122
  }
89
123
  if (i.length === 0) return e;
90
- let a = w(i), o = "", s = 0;
124
+ let a = O(i), o = "", s = 0;
91
125
  for (let t of a) o += e.slice(s, t.start), o += `<${n}>`, o += e.slice(t.start, t.end), o += `</${n}>`, s = t.end;
92
126
  return o += e.slice(s), o;
93
127
  }
94
- function w(e) {
128
+ function O(e) {
95
129
  if (e.length === 0) return [];
96
130
  let t = [...e].sort((e, t) => e.start - t.start), n = [t[0]];
97
131
  for (let e = 1; e < t.length; e++) {
@@ -100,7 +134,7 @@ function w(e) {
100
134
  }
101
135
  return n;
102
136
  }
103
- function T(e, t, n = {}) {
137
+ function k(e, t, n = {}) {
104
138
  let { maxLength: r = 120, contextBefore: i = 30, contextAfter: a = 80 } = n;
105
139
  if (!e) return "";
106
140
  if (t.length === 0) return e.slice(0, r) + (e.length > r ? "..." : "");
@@ -113,58 +147,62 @@ function T(e, t, n = {}) {
113
147
  let l = Math.max(0, s - i), u = Math.min(e.length, s + c.length + a), d = e.slice(l, u);
114
148
  return l > 0 && (d = "..." + d), u < e.length && (d += "..."), d;
115
149
  }
116
- function E(e, t, n = {}) {
117
- return C(T(e, t, n), t, n.tag || "mark");
150
+ function A(e, t, n = {}) {
151
+ return D(k(e, t, n), t, n.tag || "mark");
118
152
  }
119
- function D(e) {
153
+ function j(e, t, n = {}) {
154
+ return E(k(e, t, n), t);
155
+ }
156
+ function M(e) {
120
157
  return e.toLowerCase().split(/[\s\-_]+/).filter((e) => e.length > 0);
121
158
  }
122
159
  //#endregion
123
160
  //#region src/components/search/SearchProvider.tsx
124
- var O = a(null);
125
- function k() {
126
- let e = c(O);
161
+ var N = o(null);
162
+ function P() {
163
+ let e = l(N);
127
164
  if (!e) throw Error("useSearch must be used within a SearchProvider");
128
165
  return e;
129
166
  }
130
- function A({ children: e, lang: t = "zh-cn", version: n, enabled: r = !0, maxResults: i = 20, enableHotkeys: a = !0 }) {
131
- let [o, c] = d(!1), [f, p] = d(!1), [m, h] = d(null), [g, v] = d([]), [y, b] = d(""), [S, C] = d(!1), w = u(null), T = u(null), E = u(null), D = u(!1);
132
- l(() => (w.current = new x(), () => {
133
- w.current &&= (w.current.clear(), null);
134
- }), []), l(() => {
135
- E.current && E.current !== t && (c(!1), E.current = null, v([]), b(""), w.current && w.current.clear());
136
- }, [t]), l(() => {
167
+ function F({ children: e, lang: t = "zh-cn", version: n, enabled: r = !0, maxResults: i = 20, snippetLength: a, enableHotkeys: o = !0 }) {
168
+ let [s, l] = f(!1), [p, m] = f(!1), [h, g] = f(null), [_, v] = f([]), [b, x] = f(""), [S, C] = f(!1), T = d(null), E = d(null), D = d(null), O = d(!1);
169
+ u(() => (T.current = new w(), () => {
170
+ T.current &&= (T.current.clear(), null);
171
+ }), []), u(() => {
172
+ D.current && D.current !== t && (l(!1), D.current = null, v([]), x(""), T.current && T.current.clear());
173
+ }, [t]), u(() => {
137
174
  v([]);
138
175
  }, [n]);
139
- let k = s(async () => {
140
- if (!(o && E.current === t || D.current || !r)) {
141
- D.current = !0, p(!0), h(null);
176
+ let k = c(async () => {
177
+ if (!(s && D.current === t || O.current || !r)) {
178
+ O.current = !0, m(!0), g(null);
142
179
  try {
143
180
  let e = await fetch(`/search-index-${t}.json`);
144
181
  if (!e.ok) throw Error(`Failed to load search index: ${e.status}`);
145
182
  let n = await e.json();
146
- w.current && w.current.init(n), E.current = t, c(!0);
183
+ T.current && T.current.init(n), D.current = t, l(!0);
147
184
  } catch (e) {
148
- h(e instanceof Error ? e.message : "Failed to load search index");
185
+ g(e instanceof Error ? e.message : "Failed to load search index");
149
186
  } finally {
150
- p(!1), D.current = !1;
187
+ m(!1), O.current = !1;
151
188
  }
152
189
  }
153
190
  }, [
154
191
  t,
155
- o,
192
+ s,
156
193
  r
157
- ]), A = s(async (e) => {
194
+ ]), A = c(async (e) => {
158
195
  if (!e.trim()) return v([]), [];
159
- w.current?.isInitialized() || await k();
196
+ T.current?.isInitialized() || await k();
160
197
  let r = {
161
198
  query: e,
162
199
  lang: t,
163
200
  version: n,
164
- limit: i
201
+ limit: i,
202
+ snippetLength: a
165
203
  };
166
- if (w.current) {
167
- let e = w.current.search(r);
204
+ if (T.current) {
205
+ let e = T.current.search(r);
168
206
  return v(e), e;
169
207
  }
170
208
  return [];
@@ -172,55 +210,56 @@ function A({ children: e, lang: t = "zh-cn", version: n, enabled: r = !0, maxRes
172
210
  t,
173
211
  n,
174
212
  k,
175
- i
213
+ i,
214
+ a
176
215
  ]);
177
- l(() => {
178
- if (!y.trim()) {
216
+ u(() => {
217
+ if (!b.trim()) {
179
218
  v([]);
180
219
  return;
181
220
  }
182
- return T.current && clearTimeout(T.current), T.current = setTimeout(() => {
183
- A(y);
221
+ return E.current && clearTimeout(E.current), E.current = setTimeout(() => {
222
+ A(b);
184
223
  }, 150), () => {
185
- T.current && clearTimeout(T.current);
224
+ E.current && clearTimeout(E.current);
186
225
  };
187
- }, [y, A]), l(() => {
188
- S && !o && !D.current && k();
226
+ }, [b, A]), u(() => {
227
+ S && !s && !O.current && k();
189
228
  }, [
190
229
  S,
191
- o,
230
+ s,
192
231
  k
193
- ]), l(() => {
194
- if (!a) return;
232
+ ]), u(() => {
233
+ if (!o) return;
195
234
  let e = (e) => {
196
235
  (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), C((e) => !e)), e.key === "Escape" && S && C(!1);
197
236
  };
198
237
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
199
- }, [a, S]);
238
+ }, [o, S]);
200
239
  let j = {
201
- isLoaded: o,
202
- isLoading: f,
203
- error: m,
240
+ isLoaded: s,
241
+ isLoading: p,
242
+ error: h,
204
243
  search: A,
205
- results: g,
206
- query: y,
207
- setQuery: b,
244
+ results: _,
245
+ query: b,
246
+ setQuery: x,
208
247
  open: S,
209
248
  setOpen: C,
210
249
  loadIndex: k
211
250
  };
212
- return /* @__PURE__ */ _(O.Provider, {
251
+ return /* @__PURE__ */ y(N.Provider, {
213
252
  value: j,
214
253
  children: e
215
254
  });
216
255
  }
217
256
  //#endregion
218
257
  //#region src/components/search/SearchInput.tsx
219
- var j = o(({ value: t, onChange: n, onClear: r, className: i, placeholder: a, ...o }, s) => /* @__PURE__ */ v("div", {
258
+ var I = s(({ value: t, onChange: n, onClear: r, className: i, placeholder: a, ...o }, s) => /* @__PURE__ */ b("div", {
220
259
  className: "flex items-center gap-3 px-4 py-3 border-b",
221
260
  children: [
222
- /* @__PURE__ */ _(m, { className: "h-5 w-5 shrink-0 text-muted-foreground" }),
223
- /* @__PURE__ */ _("input", {
261
+ /* @__PURE__ */ y(h, { className: "h-5 w-5 shrink-0 text-muted-foreground" }),
262
+ /* @__PURE__ */ y("input", {
224
263
  ref: s,
225
264
  type: "text",
226
265
  value: t,
@@ -229,63 +268,69 @@ var j = o(({ value: t, onChange: n, onClear: r, className: i, placeholder: a, ..
229
268
  className: e("flex-1 bg-transparent text-base outline-none placeholder:text-muted-foreground", i),
230
269
  ...o
231
270
  }),
232
- t && r && /* @__PURE__ */ _("button", {
271
+ t && r && /* @__PURE__ */ y("button", {
233
272
  type: "button",
234
273
  onClick: r,
235
274
  className: "p-1 rounded hover:bg-muted transition-colors",
236
- children: /* @__PURE__ */ _(h, { className: "h-4 w-4 text-muted-foreground" })
275
+ children: /* @__PURE__ */ y(g, { className: "h-4 w-4 text-muted-foreground" })
237
276
  })
238
277
  ]
239
278
  }));
240
- j.displayName = "SearchInput";
279
+ I.displayName = "SearchInput";
241
280
  //#endregion
242
281
  //#region src/components/search/SearchItem.tsx
243
- var M = o(({ result: t, query: n, isSelected: r, onClick: i, onMouseEnter: a }, o) => {
244
- let s = D(n), c = E(t.sectionTitle, s, {
282
+ function L({ segments: e }) {
283
+ return /* @__PURE__ */ y(v, { children: e.map((e, t) => e.highlighted ? /* @__PURE__ */ y("mark", {
284
+ className: "bg-primary/20 text-foreground rounded-sm px-0.5",
285
+ children: e.text
286
+ }, t) : /* @__PURE__ */ y(a, { children: e.text }, t)) });
287
+ }
288
+ var R = s(({ result: t, query: n, isSelected: r, onClick: i, onMouseEnter: a }, o) => {
289
+ let s = M(n), c = j(t.sectionTitle, s, {
245
290
  maxLength: 100,
246
291
  contextBefore: 0,
247
292
  contextAfter: 0
248
- }), l = E(t.snippet, s, { maxLength: 150 });
249
- return /* @__PURE__ */ v("div", {
293
+ }), l = j(t.snippet, s, { maxLength: 150 });
294
+ return /* @__PURE__ */ b("div", {
250
295
  ref: o,
251
296
  onClick: i,
252
297
  onMouseEnter: a,
253
298
  className: e("flex items-start gap-3 px-4 py-3 cursor-pointer transition-all duration-200 border-l-2 rounded-r-md mx-2", "hover:shadow-sm hover:translate-x-0.5", r ? "bg-accent/80 border-l-primary shadow-md scale-[1.02] translate-x-1" : "hover:bg-muted/50 border-l-transparent"),
254
- children: [/* @__PURE__ */ _(f, { className: "h-4 w-4 mt-0.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ v("div", {
299
+ children: [/* @__PURE__ */ y(p, { className: "h-4 w-4 mt-0.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ b("div", {
255
300
  className: "flex-1 min-w-0",
256
301
  children: [
257
- /* @__PURE__ */ _("div", {
302
+ /* @__PURE__ */ y("div", {
258
303
  className: "flex items-center gap-2",
259
- children: /* @__PURE__ */ _("span", {
304
+ children: /* @__PURE__ */ y("span", {
260
305
  className: "font-medium text-sm truncate",
261
- dangerouslySetInnerHTML: { __html: c }
306
+ children: /* @__PURE__ */ y(L, { segments: c })
262
307
  })
263
308
  }),
264
- t.pageTitle !== t.sectionTitle && /* @__PURE__ */ _("div", {
309
+ t.pageTitle !== t.sectionTitle && /* @__PURE__ */ y("div", {
265
310
  className: "text-xs text-muted-foreground truncate mt-0.5",
266
311
  children: t.pageTitle
267
312
  }),
268
- l && /* @__PURE__ */ _("div", {
313
+ l.length > 0 && l.some((e) => e.text) && /* @__PURE__ */ y("div", {
269
314
  className: "text-xs text-muted-foreground mt-1 line-clamp-2",
270
- dangerouslySetInnerHTML: { __html: l }
315
+ children: /* @__PURE__ */ y(L, { segments: l })
271
316
  })
272
317
  ]
273
318
  })]
274
319
  });
275
320
  });
276
- M.displayName = "SearchItem";
321
+ R.displayName = "SearchItem";
277
322
  //#endregion
278
323
  //#region src/components/search/SearchResults.tsx
279
- function N({ results: e, query: t, onSelect: n }) {
280
- let [r, i] = d(0), a = u(null), o = u(null);
281
- l(() => {
324
+ function z({ results: e, query: t, onSelect: n }) {
325
+ let [r, i] = f(0), a = d(null), o = d(null);
326
+ u(() => {
282
327
  i(0);
283
- }, [e]), l(() => {
328
+ }, [e]), u(() => {
284
329
  if (o.current && a.current) {
285
330
  let e = a.current, t = o.current, n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
286
331
  (r.bottom > n.bottom || r.top < n.top) && t.scrollIntoView({ block: "nearest" });
287
332
  }
288
- }, [r]), l(() => {
333
+ }, [r]), u(() => {
289
334
  let t = (t) => {
290
335
  if (t.key === "ArrowDown") t.preventDefault(), i((t) => Math.min(t + 1, e.length - 1));
291
336
  else if (t.key === "ArrowUp") t.preventDefault(), i((e) => Math.max(e - 1, 0));
@@ -304,10 +349,10 @@ function N({ results: e, query: t, onSelect: n }) {
304
349
  let s = (e) => {
305
350
  n(e.url);
306
351
  };
307
- return /* @__PURE__ */ _("div", {
352
+ return /* @__PURE__ */ y("div", {
308
353
  ref: a,
309
354
  className: "py-2",
310
- children: e.map((e, n) => /* @__PURE__ */ _(M, {
355
+ children: e.map((e, n) => /* @__PURE__ */ y(R, {
311
356
  result: e,
312
357
  query: t,
313
358
  isSelected: n === r,
@@ -319,49 +364,49 @@ function N({ results: e, query: t, onSelect: n }) {
319
364
  }
320
365
  //#endregion
321
366
  //#region src/components/search/SearchDialog.tsx
322
- function P({ placeholder: e }) {
323
- let { open: a, setOpen: o, query: s, setQuery: c, results: d, isLoading: f, error: m, isLoaded: h } = k(), y = g(), b = u(null);
324
- return l(() => {
325
- a && b.current && setTimeout(() => b.current?.focus(), 0);
326
- }, [a]), l(() => {
367
+ function B({ placeholder: e }) {
368
+ let { open: a, setOpen: o, query: s, setQuery: c, results: l, isLoading: f, error: p, isLoaded: h } = P(), g = _(), v = d(null);
369
+ return u(() => {
370
+ a && v.current && setTimeout(() => v.current?.focus(), 0);
371
+ }, [a]), u(() => {
327
372
  a || c("");
328
- }, [a, c]), /* @__PURE__ */ _(r, {
373
+ }, [a, c]), /* @__PURE__ */ y(r, {
329
374
  open: a,
330
375
  onOpenChange: (e) => {
331
376
  o(e);
332
377
  },
333
- children: /* @__PURE__ */ v(n, {
378
+ children: /* @__PURE__ */ b(n, {
334
379
  className: "overflow-hidden p-0 shadow-lg max-w-xl top-[15%] translate-y-0",
335
380
  showCloseButton: !1,
336
381
  children: [
337
- /* @__PURE__ */ _(i, { children: "搜索文档" }),
338
- /* @__PURE__ */ _(t, { children: "搜索文档内容" }),
339
- /* @__PURE__ */ v("div", {
382
+ /* @__PURE__ */ y(i, { children: "搜索文档" }),
383
+ /* @__PURE__ */ y(t, { children: "搜索文档内容" }),
384
+ /* @__PURE__ */ b("div", {
340
385
  className: "flex flex-col",
341
386
  children: [
342
- /* @__PURE__ */ _(j, {
343
- ref: b,
387
+ /* @__PURE__ */ y(I, {
388
+ ref: v,
344
389
  value: s,
345
390
  onChange: c,
346
391
  placeholder: e,
347
392
  onClear: () => c("")
348
393
  }),
349
- /* @__PURE__ */ v("div", {
394
+ /* @__PURE__ */ b("div", {
350
395
  className: "max-h-[60vh] overflow-y-auto border-t",
351
396
  children: [
352
- f && !h && /* @__PURE__ */ _("div", {
397
+ f && !h && /* @__PURE__ */ y("div", {
353
398
  className: "flex items-center justify-center py-12",
354
- children: /* @__PURE__ */ _(p, { className: "h-6 w-6 animate-spin text-muted-foreground" })
399
+ children: /* @__PURE__ */ y(m, { className: "h-6 w-6 animate-spin text-muted-foreground" })
355
400
  }),
356
- m && /* @__PURE__ */ _("div", {
401
+ p && /* @__PURE__ */ y("div", {
357
402
  className: "px-4 py-8 text-center text-sm text-muted-foreground",
358
- children: m
403
+ children: p
359
404
  }),
360
- h && !f && !s && /* @__PURE__ */ _("div", {
405
+ h && !f && !s && /* @__PURE__ */ y("div", {
361
406
  className: "px-4 py-8 text-center text-sm text-muted-foreground",
362
407
  children: "输入关键词搜索文档"
363
408
  }),
364
- h && s && d.length === 0 && !f && /* @__PURE__ */ v("div", {
409
+ h && s && l.length === 0 && !f && /* @__PURE__ */ b("div", {
365
410
  className: "px-4 py-8 text-center text-sm text-muted-foreground",
366
411
  children: [
367
412
  "未找到 \"",
@@ -369,35 +414,35 @@ function P({ placeholder: e }) {
369
414
  "\" 相关结果"
370
415
  ]
371
416
  }),
372
- d.length > 0 && /* @__PURE__ */ _(N, {
373
- results: d,
417
+ l.length > 0 && /* @__PURE__ */ y(z, {
418
+ results: l,
374
419
  query: s,
375
420
  onSelect: (e) => {
376
- y(e), o(!1);
421
+ g(e), o(!1);
377
422
  }
378
423
  })
379
424
  ]
380
425
  }),
381
- /* @__PURE__ */ v("div", {
426
+ /* @__PURE__ */ b("div", {
382
427
  className: "flex items-center justify-between border-t px-4 py-2 text-xs text-muted-foreground bg-muted/30",
383
- children: [/* @__PURE__ */ v("div", {
428
+ children: [/* @__PURE__ */ b("div", {
384
429
  className: "flex items-center gap-4",
385
- children: [/* @__PURE__ */ v("span", {
430
+ children: [/* @__PURE__ */ b("span", {
386
431
  className: "flex items-center gap-1",
387
- children: [/* @__PURE__ */ _("kbd", {
432
+ children: [/* @__PURE__ */ y("kbd", {
388
433
  className: "px-1.5 py-0.5 rounded bg-muted border text-[10px]",
389
434
  children: "↵"
390
435
  }), "选择"]
391
- }), /* @__PURE__ */ v("span", {
436
+ }), /* @__PURE__ */ b("span", {
392
437
  className: "flex items-center gap-1",
393
- children: [/* @__PURE__ */ _("kbd", {
438
+ children: [/* @__PURE__ */ y("kbd", {
394
439
  className: "px-1.5 py-0.5 rounded bg-muted border text-[10px]",
395
440
  children: "↑↓"
396
441
  }), "导航"]
397
442
  })]
398
- }), /* @__PURE__ */ v("span", {
443
+ }), /* @__PURE__ */ b("span", {
399
444
  className: "flex items-center gap-1",
400
- children: [/* @__PURE__ */ _("kbd", {
445
+ children: [/* @__PURE__ */ y("kbd", {
401
446
  className: "px-1.5 py-0.5 rounded bg-muted border text-[10px]",
402
447
  children: "esc"
403
448
  }), "关闭"]
@@ -410,4 +455,4 @@ function P({ placeholder: e }) {
410
455
  });
411
456
  }
412
457
  //#endregion
413
- export { A as a, E as c, x as d, S as f, j as i, C as l, N as n, k as o, M as r, T as s, P as t, D as u };
458
+ export { F as a, A as c, w as d, T as f, I as i, D as l, z as n, P as o, R as r, k as s, B as t, M as u };
@@ -1,4 +1,4 @@
1
- import { a as e, o as t, t as n } from "./SearchDialog-DWVre6R9.js";
1
+ import { a as e, o as t, t as n } from "./SearchDialog-CLbtpf7I.js";
2
2
  import { useEffect as r } from "react";
3
3
  import { jsx as i } from "react/jsx-runtime";
4
4
  //#region src/components/search/SearchRuntime.tsx
@@ -8,15 +8,16 @@ function a({ openSignal: e, placeholder: a }) {
8
8
  e > 0 && o(!0);
9
9
  }, [e, o]), /* @__PURE__ */ i(n, { placeholder: a });
10
10
  }
11
- function o({ lang: t, version: n, maxResults: r, placeholder: o, openSignal: s }) {
11
+ function o({ lang: t, version: n, maxResults: r, snippetLength: o, placeholder: s, openSignal: c }) {
12
12
  return /* @__PURE__ */ i(e, {
13
13
  lang: t,
14
14
  version: n,
15
15
  maxResults: r,
16
+ snippetLength: o,
16
17
  enableHotkeys: !1,
17
18
  children: /* @__PURE__ */ i(a, {
18
- openSignal: s,
19
- placeholder: o
19
+ openSignal: c,
20
+ placeholder: s
20
21
  })
21
22
  });
22
23
  }
@@ -7,7 +7,7 @@ import { a as b, i as x, n as S, r as C } from "./chunk-PU5JKC2W-CeOPBYeP.js";
7
7
  import { t as w } from "./chunk-4BX2VUAB-D3p73nhw.js";
8
8
  import { t as T } from "./mermaid-parser.core-l4wHnGuN.js";
9
9
  import { t as E } from "./cytoscape.esm-D1tmL96B.js";
10
- //#region node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.js
10
+ //#region node_modules/layout-base/layout-base.js
11
11
  var D = /* @__PURE__ */ t(((e, t) => {
12
12
  (function(n, r) {
13
13
  typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define([], r) : typeof e == "object" ? e.layoutBase = r() : n.layoutBase = r();
@@ -25,7 +25,7 @@ var f = {
25
25
  loader: /* @__PURE__ */ n(async () => await import("./dagre-KLK3FWXG-BkGeaeJf.js"), "loader")
26
26
  }, ...[{
27
27
  name: "cose-bilkent",
28
- loader: /* @__PURE__ */ n(async () => await import("./cose-bilkent-S5V4N54A-BX63fiTJ.js"), "loader")
28
+ loader: /* @__PURE__ */ n(async () => await import("./cose-bilkent-S5V4N54A-DCXUWrka.js"), "loader")
29
29
  }]]);
30
30
  }, "registerDefaultLayoutLoaders"))();
31
31
  var h = /* @__PURE__ */ n(async (e, t) => {
@@ -3,7 +3,7 @@ import { g as n, h as r } from "./src-DI0MZP4m.js";
3
3
  import { B as i, C as a, V as o, W as s, _ as c, a as l, b as u, s as d, v as f } from "./chunk-7R4GIKGN-C19ZEV_b.js";
4
4
  import { t as p } from "./chunk-55IACEB6-CLgZJbYv.js";
5
5
  import { t as m } from "./chunk-KX2RTZJC-BDcxmH0D.js";
6
- import { r as h } from "./chunk-GLR3WWYH-ShSppUzV.js";
6
+ import { r as h } from "./chunk-GLR3WWYH-C7t8eN-i.js";
7
7
  //#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-NQ4KR5QH.mjs
8
8
  var g = (function() {
9
9
  var e = /* @__PURE__ */ r(function(e, t, n, r) {
@@ -5,7 +5,7 @@ import { t as _ } from "./chunk-FMBD7UC4-D-Ronn4l.js";
5
5
  import { t as v } from "./chunk-JSJVCQXG-D49UMhzO.js";
6
6
  import { t as y } from "./chunk-55IACEB6-CLgZJbYv.js";
7
7
  import { t as b } from "./chunk-KX2RTZJC-BDcxmH0D.js";
8
- import { r as x, t as S } from "./chunk-GLR3WWYH-ShSppUzV.js";
8
+ import { r as x, t as S } from "./chunk-GLR3WWYH-C7t8eN-i.js";
9
9
  //#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-WL4C6EOR.mjs
10
10
  var C = (function() {
11
11
  var e = /* @__PURE__ */ r(function(e, t, n, r) {
@@ -11,8 +11,8 @@ import "./chunk-KX2RTZJC-BDcxmH0D.js";
11
11
  import "./chunk-PQ6SQG4A-BggLWIDB.js";
12
12
  import "./chunk-KYZI473N-B9L8Kk83.js";
13
13
  import "./chunk-O4XLMI2P-BlC0d_Zr.js";
14
- import "./chunk-GLR3WWYH-ShSppUzV.js";
15
- import { i as t, n, r, t as i } from "./chunk-WL4C6EOR-DLbU3P3W.js";
14
+ import "./chunk-GLR3WWYH-C7t8eN-i.js";
15
+ import { i as t, n, r, t as i } from "./chunk-WL4C6EOR-BX4P121X.js";
16
16
  //#region node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-VBA2DB6C.mjs
17
17
  var a = {
18
18
  parser: n,
@@ -11,8 +11,8 @@ import "./chunk-KX2RTZJC-BDcxmH0D.js";
11
11
  import "./chunk-PQ6SQG4A-BggLWIDB.js";
12
12
  import "./chunk-KYZI473N-B9L8Kk83.js";
13
13
  import "./chunk-O4XLMI2P-BlC0d_Zr.js";
14
- import "./chunk-GLR3WWYH-ShSppUzV.js";
15
- import { i as t, n, r, t as i } from "./chunk-WL4C6EOR-DLbU3P3W.js";
14
+ import "./chunk-GLR3WWYH-C7t8eN-i.js";
15
+ import { i as t, n, r, t as i } from "./chunk-WL4C6EOR-BX4P121X.js";
16
16
  //#region node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-RAHNMMFH.mjs
17
17
  var a = {
18
18
  parser: n,
@@ -1,4 +1,4 @@
1
- import { t as e } from "./utils-Ct96Mtjw.js";
1
+ import { t as e } from "./utils-KFBtT4Mx.js";
2
2
  import * as t from "react";
3
3
  import { CheckIcon as n, ChevronRightIcon as r, CircleIcon as i } from "lucide-react";
4
4
  import { jsx as a, jsxs as o } from "react/jsx-runtime";