@hanzo/docs-core 16.2.5 → 16.4.2
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/dist/advanced-CEwMef7q.js +80 -0
- package/dist/advanced-CEwMef7q.js.map +1 -0
- package/dist/algolia-BrWPzYE_.js +49 -0
- package/dist/algolia-BrWPzYE_.js.map +1 -0
- package/dist/algolia-CBBN8R6-.d.ts +68 -0
- package/dist/algolia-CBBN8R6-.d.ts.map +1 -0
- package/dist/breadcrumb.d.ts +29 -27
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb.js +55 -72
- package/dist/breadcrumb.js.map +1 -0
- package/dist/chunk-B-ezknvj.js +42 -0
- package/dist/codeblock-utils-lld8UiQo.d.ts +37 -0
- package/dist/codeblock-utils-lld8UiQo.d.ts.map +1 -0
- package/dist/content/github.d.ts +43 -32
- package/dist/content/github.d.ts.map +1 -0
- package/dist/content/github.js +29 -43
- package/dist/content/github.js.map +1 -0
- package/dist/content/index.d.ts +20 -13
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +17 -23
- package/dist/content/index.js.map +1 -0
- package/dist/content/mdx/preset-bundler.d.ts +22 -24
- package/dist/content/mdx/preset-bundler.d.ts.map +1 -0
- package/dist/content/mdx/preset-bundler.js +38 -69
- package/dist/content/mdx/preset-bundler.js.map +1 -0
- package/dist/content/mdx/preset-runtime.d.ts +22 -24
- package/dist/content/mdx/preset-runtime.d.ts.map +1 -0
- package/dist/content/mdx/preset-runtime.js +36 -68
- package/dist/content/mdx/preset-runtime.js.map +1 -0
- package/dist/content/toc.d.ts +7 -6
- package/dist/content/toc.d.ts.map +1 -0
- package/dist/content/toc.js +15 -19
- package/dist/content/toc.js.map +1 -0
- package/dist/definitions-DuxDer_c.d.ts +62 -0
- package/dist/definitions-DuxDer_c.d.ts.map +1 -0
- package/dist/dynamic-link.d.ts +7 -5
- package/dist/dynamic-link.d.ts.map +1 -0
- package/dist/dynamic-link.js +29 -27
- package/dist/dynamic-link.js.map +1 -0
- package/dist/fetch-B5e9CFfN.js +20 -0
- package/dist/fetch-B5e9CFfN.js.map +1 -0
- package/dist/framework/index.d.ts +38 -29
- package/dist/framework/index.d.ts.map +1 -0
- package/dist/framework/index.js +68 -17
- package/dist/framework/index.js.map +1 -0
- package/dist/framework/next.d.ts +15 -10
- package/dist/framework/next.d.ts.map +1 -0
- package/dist/framework/next.js +18 -26
- package/dist/framework/next.js.map +1 -0
- package/dist/framework/react-router.d.ts +15 -10
- package/dist/framework/react-router.d.ts.map +1 -0
- package/dist/framework/react-router.js +42 -55
- package/dist/framework/react-router.js.map +1 -0
- package/dist/framework/tanstack.d.ts +15 -10
- package/dist/framework/tanstack.d.ts.map +1 -0
- package/dist/framework/tanstack.js +54 -69
- package/dist/framework/tanstack.js.map +1 -0
- package/dist/framework/waku.d.ts +15 -10
- package/dist/framework/waku.d.ts.map +1 -0
- package/dist/framework/waku.js +47 -58
- package/dist/framework/waku.js.map +1 -0
- package/dist/highlight/client.d.ts +6 -7
- package/dist/highlight/client.d.ts.map +1 -0
- package/dist/highlight/client.js +22 -14
- package/dist/highlight/client.js.map +1 -0
- package/dist/highlight/index.d.ts +2 -30
- package/dist/highlight/index.js +3 -13
- package/dist/i18n/index.d.ts +2 -39
- package/dist/i18n/index.js +6 -7
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/middleware.d.ts +36 -28
- package/dist/i18n/middleware.d.ts.map +1 -0
- package/dist/i18n/middleware.js +55 -73
- package/dist/i18n/middleware.js.map +1 -0
- package/dist/icon-Ds1OCIhh.js +19 -0
- package/dist/icon-Ds1OCIhh.js.map +1 -0
- package/dist/index-2U6Tl4--.d.ts +379 -0
- package/dist/index-2U6Tl4--.d.ts.map +1 -0
- package/dist/index-Bw-DCOra.d.ts +41 -0
- package/dist/index-Bw-DCOra.d.ts.map +1 -0
- package/dist/link.d.ts +17 -15
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +29 -9
- package/dist/link.js.map +1 -0
- package/dist/mdast-utils-mc9-X-PK.js +40 -0
- package/dist/mdast-utils-mc9-X-PK.js.map +1 -0
- package/dist/mdx-plugins/codeblock-utils.d.ts +2 -29
- package/dist/mdx-plugins/codeblock-utils.js +71 -9
- package/dist/mdx-plugins/codeblock-utils.js.map +1 -0
- package/dist/mdx-plugins/index.d.ts +15 -20
- package/dist/mdx-plugins/index.js +18 -73
- package/dist/mdx-plugins/rehype-code.d.ts +2 -55
- package/dist/mdx-plugins/rehype-code.js +5 -15
- package/dist/mdx-plugins/rehype-toc.d.ts +2 -14
- package/dist/mdx-plugins/rehype-toc.js +3 -7
- package/dist/mdx-plugins/remark-admonition.d.ts +2 -20
- package/dist/mdx-plugins/remark-admonition.js +74 -8
- package/dist/mdx-plugins/remark-admonition.js.map +1 -0
- package/dist/mdx-plugins/remark-code-tab.d.ts +2 -30
- package/dist/mdx-plugins/remark-code-tab.js +183 -7
- package/dist/mdx-plugins/remark-code-tab.js.map +1 -0
- package/dist/mdx-plugins/remark-directive-admonition.d.ts +2 -27
- package/dist/mdx-plugins/remark-directive-admonition.js +60 -7
- package/dist/mdx-plugins/remark-directive-admonition.js.map +1 -0
- package/dist/mdx-plugins/remark-gfm.d.ts +2 -1
- package/dist/mdx-plugins/remark-gfm.js +3 -7
- package/dist/mdx-plugins/remark-heading.d.ts +2 -31
- package/dist/mdx-plugins/remark-heading.js +45 -8
- package/dist/mdx-plugins/remark-heading.js.map +1 -0
- package/dist/mdx-plugins/remark-image.d.ts +2 -57
- package/dist/mdx-plugins/remark-image.js +192 -7
- package/dist/mdx-plugins/remark-image.js.map +1 -0
- package/dist/mdx-plugins/remark-mdx-files.d.ts +2 -40
- package/dist/mdx-plugins/remark-mdx-files.js +96 -7
- package/dist/mdx-plugins/remark-mdx-files.js.map +1 -0
- package/dist/mdx-plugins/remark-mdx-mermaid.d.ts +2 -15
- package/dist/mdx-plugins/remark-mdx-mermaid.js +31 -7
- package/dist/mdx-plugins/remark-mdx-mermaid.js.map +1 -0
- package/dist/mdx-plugins/remark-npm.d.ts +2 -31
- package/dist/mdx-plugins/remark-npm.js +68 -8
- package/dist/mdx-plugins/remark-npm.js.map +1 -0
- package/dist/mdx-plugins/remark-steps.d.ts +2 -23
- package/dist/mdx-plugins/remark-steps.js +77 -7
- package/dist/mdx-plugins/remark-steps.js.map +1 -0
- package/dist/mdx-plugins/remark-structure.d.ts +2 -71
- package/dist/mdx-plugins/remark-structure.js +105 -11
- package/dist/mdx-plugins/remark-structure.js.map +1 -0
- package/dist/mixedbread-DlByNYSd.js +88 -0
- package/dist/mixedbread-DlByNYSd.js.map +1 -0
- package/dist/negotiation/index.d.ts +6 -4
- package/dist/negotiation/index.d.ts.map +1 -0
- package/dist/negotiation/index.js +41 -11
- package/dist/negotiation/index.js.map +1 -0
- package/dist/normalize-url-DP9-1I-S.js +16 -0
- package/dist/normalize-url-DP9-1I-S.js.map +1 -0
- package/dist/orama-cloud-MyA-JBt1.js +84 -0
- package/dist/orama-cloud-MyA-JBt1.js.map +1 -0
- package/dist/page-tree/index.d.ts +23 -11
- package/dist/page-tree/index.d.ts.map +1 -0
- package/dist/page-tree/index.js +3 -17
- package/dist/path-DPJpqaLb.js +60 -0
- package/dist/path-DPJpqaLb.js.map +1 -0
- package/dist/rehype-code-CQDbiG8_.js +241 -0
- package/dist/rehype-code-CQDbiG8_.js.map +1 -0
- package/dist/rehype-code-vVWG4-ej.d.ts +58 -0
- package/dist/rehype-code-vVWG4-ej.d.ts.map +1 -0
- package/dist/rehype-toc-D-eLj90w.js +143 -0
- package/dist/rehype-toc-D-eLj90w.js.map +1 -0
- package/dist/rehype-toc-DJvSyE0o.d.ts +18 -0
- package/dist/rehype-toc-DJvSyE0o.d.ts.map +1 -0
- package/dist/remark-admonition-DOwBWzsH.d.ts +22 -0
- package/dist/remark-admonition-DOwBWzsH.d.ts.map +1 -0
- package/dist/remark-code-tab-CXsYlims.d.ts +32 -0
- package/dist/remark-code-tab-CXsYlims.d.ts.map +1 -0
- package/dist/remark-directive-admonition-BCm_yiU9.d.ts +36 -0
- package/dist/remark-directive-admonition-BCm_yiU9.d.ts.map +1 -0
- package/dist/remark-gfm-CeWpMwyk.d.ts +2 -0
- package/dist/remark-heading-CXvCY0go.d.ts +37 -0
- package/dist/remark-heading-CXvCY0go.d.ts.map +1 -0
- package/dist/remark-image-CvUis4R1.d.ts +65 -0
- package/dist/remark-image-CvUis4R1.d.ts.map +1 -0
- package/dist/remark-mdx-files-DOYafA4x.d.ts +42 -0
- package/dist/remark-mdx-files-DOYafA4x.d.ts.map +1 -0
- package/dist/remark-mdx-mermaid-BdSUUiCG.d.ts +17 -0
- package/dist/remark-mdx-mermaid-BdSUUiCG.d.ts.map +1 -0
- package/dist/remark-npm-BIvIEKT2.d.ts +36 -0
- package/dist/remark-npm-BIvIEKT2.d.ts.map +1 -0
- package/dist/remark-steps-CHJN-rtm.d.ts +28 -0
- package/dist/remark-steps-CHJN-rtm.d.ts.map +1 -0
- package/dist/remark-structure-RZD2gGKp.d.ts +77 -0
- package/dist/remark-structure-RZD2gGKp.d.ts.map +1 -0
- package/dist/remove-undefined-DgDIJk1A.js +19 -0
- package/dist/remove-undefined-DgDIJk1A.js.map +1 -0
- package/dist/search/algolia.d.ts +3 -69
- package/dist/search/algolia.js +69 -63
- package/dist/search/algolia.js.map +1 -0
- package/dist/search/client.d.ts +120 -114
- package/dist/search/client.d.ts.map +1 -0
- package/dist/search/client.js +92 -91
- package/dist/search/client.js.map +1 -0
- package/dist/search/index.d.ts +20 -18
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +3 -7
- package/dist/search/orama-cloud.d.ts +70 -68
- package/dist/search/orama-cloud.d.ts.map +1 -0
- package/dist/search/orama-cloud.js +46 -54
- package/dist/search/orama-cloud.js.map +1 -0
- package/dist/search/server.d.ts +6 -136
- package/dist/search/server.js +292 -369
- package/dist/search/server.js.map +1 -0
- package/dist/search-GCBSTRxD.js +44 -0
- package/dist/search-GCBSTRxD.js.map +1 -0
- package/dist/server-CPR_fgkH.d.ts +133 -0
- package/dist/server-CPR_fgkH.d.ts.map +1 -0
- package/dist/shiki-4oMYwHED.js +80 -0
- package/dist/shiki-4oMYwHED.js.map +1 -0
- package/dist/shiki-CIBQys54.d.ts +33 -0
- package/dist/shiki-CIBQys54.d.ts.map +1 -0
- package/dist/source/client/index.d.ts +7 -5
- package/dist/source/client/index.d.ts.map +1 -0
- package/dist/source/client/index.js +24 -35
- package/dist/source/client/index.js.map +1 -0
- package/dist/source/index.d.ts +3 -42
- package/dist/source/index.js +599 -739
- package/dist/source/index.js.map +1 -0
- package/dist/source/plugins/lucide-icons.d.ts +7 -7
- package/dist/source/plugins/lucide-icons.d.ts.map +1 -0
- package/dist/source/plugins/lucide-icons.js +21 -20
- package/dist/source/plugins/lucide-icons.js.map +1 -0
- package/dist/source/plugins/slugs.d.ts +3 -0
- package/dist/source/plugins/slugs.js +65 -0
- package/dist/source/plugins/slugs.js.map +1 -0
- package/dist/source/schema.d.ts +17 -14
- package/dist/source/schema.d.ts.map +1 -0
- package/dist/source/schema.js +26 -22
- package/dist/source/schema.js.map +1 -0
- package/dist/static-vTmR4-T2.js +51 -0
- package/dist/static-vTmR4-T2.js.map +1 -0
- package/dist/toc.d.ts +38 -25
- package/dist/toc.d.ts.map +1 -0
- package/dist/toc.js +123 -136
- package/dist/toc.js.map +1 -0
- package/dist/util-CK2ykiif.d.ts +8 -0
- package/dist/util-CK2ykiif.d.ts.map +1 -0
- package/dist/util-s9piKHsk.js +10 -0
- package/dist/util-s9piKHsk.js.map +1 -0
- package/dist/utils/use-effect-event.d.ts +3 -1
- package/dist/utils/use-effect-event.d.ts.map +1 -0
- package/dist/utils/use-effect-event.js +16 -13
- package/dist/utils/use-effect-event.js.map +1 -0
- package/dist/utils/use-media-query.d.ts +3 -1
- package/dist/utils/use-media-query.d.ts.map +1 -0
- package/dist/utils/use-media-query.js +20 -20
- package/dist/utils/use-media-query.js.map +1 -0
- package/dist/utils/use-on-change.d.ts +3 -1
- package/dist/utils/use-on-change.d.ts.map +1 -0
- package/dist/utils/use-on-change.js +23 -7
- package/dist/utils/use-on-change.js.map +1 -0
- package/dist/utils-DUvi2WkD.js +134 -0
- package/dist/utils-DUvi2WkD.js.map +1 -0
- package/package.json +72 -71
- package/dist/algolia-IZEDLPHE.js +0 -58
- package/dist/chunk-5PMI7QDD.js +0 -220
- package/dist/chunk-ADBHPKXG.js +0 -78
- package/dist/chunk-APKPSBSB.js +0 -74
- package/dist/chunk-CH7YHH7V.js +0 -222
- package/dist/chunk-EFVXL2PP.js +0 -144
- package/dist/chunk-EMWGTXSW.js +0 -19
- package/dist/chunk-FAEPKD7U.js +0 -20
- package/dist/chunk-FUUVPEA5.js +0 -29
- package/dist/chunk-GINBKBVQ.js +0 -12
- package/dist/chunk-GLRQBLGN.js +0 -59
- package/dist/chunk-JUF4WZ6G.js +0 -117
- package/dist/chunk-K4WNLOVQ.js +0 -75
- package/dist/chunk-L4JKQWCM.js +0 -131
- package/dist/chunk-MA6O2UUE.js +0 -50
- package/dist/chunk-ONG4RVCR.js +0 -8
- package/dist/chunk-OTD7MV33.js +0 -53
- package/dist/chunk-PFNP6PEB.js +0 -11
- package/dist/chunk-QJRXMG4S.js +0 -275
- package/dist/chunk-SH7BNTG7.js +0 -38
- package/dist/chunk-TWIDBWFG.js +0 -84
- package/dist/chunk-U67V476Y.js +0 -35
- package/dist/chunk-VLSDGCJE.js +0 -47
- package/dist/chunk-W6WTLKRA.js +0 -73
- package/dist/chunk-X2HFD5QJ.js +0 -275
- package/dist/chunk-XJ6ZQNEX.js +0 -91
- package/dist/chunk-XN2LKXFZ.js +0 -101
- package/dist/chunk-XOFXGHS4.js +0 -93
- package/dist/chunk-XZSI7AHE.js +0 -67
- package/dist/chunk-YVVDKJ2H.js +0 -34
- package/dist/chunk-ZMWYLUDP.js +0 -21
- package/dist/definitions-pJ7PybYY.d.ts +0 -60
- package/dist/fetch-IBTWQCJR.js +0 -22
- package/dist/loader-BvlPPJX0.d.ts +0 -321
- package/dist/mixedbread-RAHDVXGJ.js +0 -118
- package/dist/orama-cloud-UZAPMPFV.js +0 -93
- package/dist/static-A2YJ5TXV.js +0 -62
- package/dist/util-bZU2QeJ2.d.ts +0 -6
package/dist/chunk-XN2LKXFZ.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// src/highlight/shiki.ts
|
|
2
|
-
import {
|
|
3
|
-
toJsxRuntime
|
|
4
|
-
} from "hast-util-to-jsx-runtime";
|
|
5
|
-
import { Fragment } from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
var defaultThemes = {
|
|
8
|
-
light: "github-light",
|
|
9
|
-
dark: "github-dark"
|
|
10
|
-
};
|
|
11
|
-
var highlighters = /* @__PURE__ */ new Map();
|
|
12
|
-
async function highlightHast(code, options) {
|
|
13
|
-
const {
|
|
14
|
-
lang: initialLang,
|
|
15
|
-
fallbackLanguage,
|
|
16
|
-
components: _,
|
|
17
|
-
engine = "js",
|
|
18
|
-
...rest
|
|
19
|
-
} = options;
|
|
20
|
-
let lang = initialLang;
|
|
21
|
-
let themes;
|
|
22
|
-
let themesToLoad;
|
|
23
|
-
if ("theme" in options && options.theme) {
|
|
24
|
-
themes = { theme: options.theme };
|
|
25
|
-
themesToLoad = [themes.theme];
|
|
26
|
-
} else {
|
|
27
|
-
themes = {
|
|
28
|
-
themes: "themes" in options && options.themes ? options.themes : defaultThemes
|
|
29
|
-
};
|
|
30
|
-
themesToLoad = Object.values(themes.themes).filter((v) => v !== void 0);
|
|
31
|
-
}
|
|
32
|
-
const highlighter = await getHighlighter(engine, {
|
|
33
|
-
langs: [],
|
|
34
|
-
themes: themesToLoad
|
|
35
|
-
});
|
|
36
|
-
try {
|
|
37
|
-
await highlighter.loadLanguage(lang);
|
|
38
|
-
} catch {
|
|
39
|
-
lang = fallbackLanguage ?? "text";
|
|
40
|
-
await highlighter.loadLanguage(lang);
|
|
41
|
-
}
|
|
42
|
-
return highlighter.codeToHast(code, {
|
|
43
|
-
lang,
|
|
44
|
-
...rest,
|
|
45
|
-
...themes,
|
|
46
|
-
defaultColor: "themes" in themes ? false : void 0
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function hastToJsx(hast, options) {
|
|
50
|
-
return toJsxRuntime(hast, {
|
|
51
|
-
jsx,
|
|
52
|
-
jsxs,
|
|
53
|
-
development: false,
|
|
54
|
-
Fragment,
|
|
55
|
-
...options
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
async function getHighlighter(engineType, options) {
|
|
59
|
-
const { createHighlighter } = await import("shiki");
|
|
60
|
-
let highlighter = highlighters.get(engineType);
|
|
61
|
-
if (!highlighter) {
|
|
62
|
-
let engine;
|
|
63
|
-
if (engineType === "js") {
|
|
64
|
-
engine = import("shiki/engine/javascript").then(
|
|
65
|
-
(res) => res.createJavaScriptRegexEngine()
|
|
66
|
-
);
|
|
67
|
-
} else {
|
|
68
|
-
engine = import("shiki/engine/oniguruma").then(
|
|
69
|
-
(res) => res.createOnigurumaEngine(import("shiki/wasm"))
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
highlighter = createHighlighter({
|
|
73
|
-
...options,
|
|
74
|
-
engine
|
|
75
|
-
});
|
|
76
|
-
highlighters.set(engineType, highlighter);
|
|
77
|
-
return highlighter;
|
|
78
|
-
}
|
|
79
|
-
return highlighter.then(async (instance) => {
|
|
80
|
-
await Promise.all([
|
|
81
|
-
// @ts-expect-error unknown
|
|
82
|
-
instance.loadLanguage(...options.langs),
|
|
83
|
-
// @ts-expect-error unknown
|
|
84
|
-
instance.loadTheme(...options.themes)
|
|
85
|
-
]);
|
|
86
|
-
return instance;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
async function highlight(code, options) {
|
|
90
|
-
return hastToJsx(await highlightHast(code, options), {
|
|
91
|
-
components: options.components
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export {
|
|
96
|
-
defaultThemes,
|
|
97
|
-
highlightHast,
|
|
98
|
-
hastToJsx,
|
|
99
|
-
getHighlighter,
|
|
100
|
-
highlight
|
|
101
|
-
};
|
package/dist/chunk-XOFXGHS4.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
removeUndefined
|
|
3
|
-
} from "./chunk-ZMWYLUDP.js";
|
|
4
|
-
import {
|
|
5
|
-
createContentHighlighter
|
|
6
|
-
} from "./chunk-OTD7MV33.js";
|
|
7
|
-
|
|
8
|
-
// src/search/orama/search/simple.ts
|
|
9
|
-
import { search } from "@orama/orama";
|
|
10
|
-
async function searchSimple(db, query, params = {}) {
|
|
11
|
-
const highlighter = createContentHighlighter(query);
|
|
12
|
-
const result = await search(db, {
|
|
13
|
-
term: query,
|
|
14
|
-
tolerance: 1,
|
|
15
|
-
...params,
|
|
16
|
-
boost: {
|
|
17
|
-
title: 2,
|
|
18
|
-
..."boost" in params ? params.boost : void 0
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return result.hits.map((hit) => ({
|
|
22
|
-
type: "page",
|
|
23
|
-
content: hit.document.title,
|
|
24
|
-
breadcrumbs: hit.document.breadcrumbs,
|
|
25
|
-
contentWithHighlights: highlighter.highlight(hit.document.title),
|
|
26
|
-
id: hit.document.url,
|
|
27
|
-
url: hit.document.url
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// src/search/orama/search/advanced.ts
|
|
32
|
-
import { getByID, search as search2 } from "@orama/orama";
|
|
33
|
-
async function searchAdvanced(db, query, tag = [], {
|
|
34
|
-
mode = "fulltext",
|
|
35
|
-
...override
|
|
36
|
-
} = {}) {
|
|
37
|
-
if (typeof tag === "string") tag = [tag];
|
|
38
|
-
let params = {
|
|
39
|
-
...override,
|
|
40
|
-
mode,
|
|
41
|
-
where: removeUndefined({
|
|
42
|
-
tags: tag.length > 0 ? {
|
|
43
|
-
containsAll: tag
|
|
44
|
-
} : void 0,
|
|
45
|
-
...override.where
|
|
46
|
-
}),
|
|
47
|
-
groupBy: {
|
|
48
|
-
properties: ["page_id"],
|
|
49
|
-
maxResult: 8,
|
|
50
|
-
...override.groupBy
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
if (query.length > 0) {
|
|
54
|
-
params = {
|
|
55
|
-
...params,
|
|
56
|
-
term: query,
|
|
57
|
-
properties: mode === "fulltext" ? ["content"] : ["content", "embeddings"]
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const highlighter = createContentHighlighter(query);
|
|
61
|
-
const result = await search2(db, params);
|
|
62
|
-
const list = [];
|
|
63
|
-
for (const item of result.groups ?? []) {
|
|
64
|
-
const pageId = item.values[0];
|
|
65
|
-
const page = getByID(db, pageId);
|
|
66
|
-
if (!page) continue;
|
|
67
|
-
list.push({
|
|
68
|
-
id: pageId,
|
|
69
|
-
type: "page",
|
|
70
|
-
content: page.content,
|
|
71
|
-
breadcrumbs: page.breadcrumbs,
|
|
72
|
-
contentWithHighlights: highlighter.highlight(page.content),
|
|
73
|
-
url: page.url
|
|
74
|
-
});
|
|
75
|
-
for (const hit of item.result) {
|
|
76
|
-
if (hit.document.type === "page") continue;
|
|
77
|
-
list.push({
|
|
78
|
-
id: hit.document.id.toString(),
|
|
79
|
-
content: hit.document.content,
|
|
80
|
-
breadcrumbs: hit.document.breadcrumbs,
|
|
81
|
-
contentWithHighlights: highlighter.highlight(hit.document.content),
|
|
82
|
-
type: hit.document.type,
|
|
83
|
-
url: hit.document.url
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return list;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export {
|
|
91
|
-
searchSimple,
|
|
92
|
-
searchAdvanced
|
|
93
|
-
};
|
package/dist/chunk-XZSI7AHE.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__export
|
|
3
|
-
} from "./chunk-U67V476Y.js";
|
|
4
|
-
|
|
5
|
-
// src/source/path.ts
|
|
6
|
-
var path_exports = {};
|
|
7
|
-
__export(path_exports, {
|
|
8
|
-
basename: () => basename,
|
|
9
|
-
dirname: () => dirname,
|
|
10
|
-
extname: () => extname,
|
|
11
|
-
joinPath: () => joinPath,
|
|
12
|
-
slash: () => slash,
|
|
13
|
-
splitPath: () => splitPath
|
|
14
|
-
});
|
|
15
|
-
function basename(path, ext) {
|
|
16
|
-
const idx = path.lastIndexOf("/");
|
|
17
|
-
return path.substring(
|
|
18
|
-
idx === -1 ? 0 : idx + 1,
|
|
19
|
-
ext ? path.length - ext.length : path.length
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
function extname(path) {
|
|
23
|
-
const dotIdx = path.lastIndexOf(".");
|
|
24
|
-
if (dotIdx !== -1) {
|
|
25
|
-
return path.substring(dotIdx);
|
|
26
|
-
}
|
|
27
|
-
return "";
|
|
28
|
-
}
|
|
29
|
-
function dirname(path) {
|
|
30
|
-
return path.split("/").slice(0, -1).join("/");
|
|
31
|
-
}
|
|
32
|
-
function splitPath(path) {
|
|
33
|
-
return path.split("/").filter((p) => p.length > 0);
|
|
34
|
-
}
|
|
35
|
-
function joinPath(...paths) {
|
|
36
|
-
const out = [];
|
|
37
|
-
const parsed = paths.flatMap(splitPath);
|
|
38
|
-
for (const seg of parsed) {
|
|
39
|
-
switch (seg) {
|
|
40
|
-
case "..":
|
|
41
|
-
out.pop();
|
|
42
|
-
break;
|
|
43
|
-
case ".":
|
|
44
|
-
break;
|
|
45
|
-
default:
|
|
46
|
-
out.push(seg);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return out.join("/");
|
|
50
|
-
}
|
|
51
|
-
function slash(path) {
|
|
52
|
-
const isExtendedLengthPath = path.startsWith("\\\\?\\");
|
|
53
|
-
if (isExtendedLengthPath) {
|
|
54
|
-
return path;
|
|
55
|
-
}
|
|
56
|
-
return path.replaceAll("\\", "/");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
basename,
|
|
61
|
-
extname,
|
|
62
|
-
dirname,
|
|
63
|
-
splitPath,
|
|
64
|
-
joinPath,
|
|
65
|
-
slash,
|
|
66
|
-
path_exports
|
|
67
|
-
};
|
package/dist/chunk-YVVDKJ2H.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// src/negotiation/index.ts
|
|
2
|
-
import Negotiator from "negotiator";
|
|
3
|
-
import { compile, match } from "path-to-regexp";
|
|
4
|
-
function getNegotiator(request) {
|
|
5
|
-
const headers = {};
|
|
6
|
-
request.headers.forEach((value, key) => {
|
|
7
|
-
headers[key] = value;
|
|
8
|
-
});
|
|
9
|
-
return new Negotiator({ headers });
|
|
10
|
-
}
|
|
11
|
-
function rewritePath(source, destination) {
|
|
12
|
-
const matcher = match(source, { decode: false });
|
|
13
|
-
const compiler = compile(destination, { encode: false });
|
|
14
|
-
return {
|
|
15
|
-
rewrite(pathname) {
|
|
16
|
-
const result = matcher(pathname);
|
|
17
|
-
if (!result) return false;
|
|
18
|
-
return compiler(result.params);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function isMarkdownPreferred(request, options) {
|
|
23
|
-
const {
|
|
24
|
-
markdownMediaTypes = ["text/plain", "text/markdown", "text/x-markdown"]
|
|
25
|
-
} = options ?? {};
|
|
26
|
-
const mediaTypes = getNegotiator(request).mediaTypes();
|
|
27
|
-
return markdownMediaTypes.some((type) => mediaTypes.includes(type));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
getNegotiator,
|
|
32
|
-
rewritePath,
|
|
33
|
-
isMarkdownPreferred
|
|
34
|
-
};
|
package/dist/chunk-ZMWYLUDP.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/utils/remove-undefined.ts
|
|
2
|
-
function removeUndefined(value, deep = false) {
|
|
3
|
-
const obj = value;
|
|
4
|
-
for (const key in obj) {
|
|
5
|
-
if (obj[key] === void 0) delete obj[key];
|
|
6
|
-
if (!deep) continue;
|
|
7
|
-
const entry = obj[key];
|
|
8
|
-
if (typeof entry === "object" && entry !== null) {
|
|
9
|
-
removeUndefined(entry, deep);
|
|
10
|
-
continue;
|
|
11
|
-
}
|
|
12
|
-
if (Array.isArray(entry)) {
|
|
13
|
-
for (const item of entry) removeUndefined(item, deep);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return value;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
removeUndefined
|
|
21
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
interface ID {
|
|
4
|
-
/**
|
|
5
|
-
* ID for the node, unique in all page trees (even across different locales)
|
|
6
|
-
*/
|
|
7
|
-
$id?: string;
|
|
8
|
-
}
|
|
9
|
-
interface Root extends ID {
|
|
10
|
-
name: ReactNode;
|
|
11
|
-
children: Node[];
|
|
12
|
-
/**
|
|
13
|
-
* Another page tree that won't be displayed unless being opened.
|
|
14
|
-
*/
|
|
15
|
-
fallback?: Root;
|
|
16
|
-
}
|
|
17
|
-
type Node = Item | Separator | Folder;
|
|
18
|
-
interface Item extends ID {
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
$ref?: {
|
|
23
|
-
file: string;
|
|
24
|
-
};
|
|
25
|
-
type: 'page';
|
|
26
|
-
name: ReactNode;
|
|
27
|
-
url: string;
|
|
28
|
-
/**
|
|
29
|
-
* Whether the link should be treated as external (e.g. use HTML <a> tag).
|
|
30
|
-
*
|
|
31
|
-
* When unspecified, it depends on the value of `url`.
|
|
32
|
-
*/
|
|
33
|
-
external?: boolean;
|
|
34
|
-
description?: ReactNode;
|
|
35
|
-
icon?: ReactNode;
|
|
36
|
-
}
|
|
37
|
-
interface Separator extends ID {
|
|
38
|
-
type: 'separator';
|
|
39
|
-
name?: ReactNode;
|
|
40
|
-
icon?: ReactNode;
|
|
41
|
-
}
|
|
42
|
-
interface Folder extends ID {
|
|
43
|
-
/**
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
$ref?: {
|
|
47
|
-
metaFile?: string;
|
|
48
|
-
};
|
|
49
|
-
type: 'folder';
|
|
50
|
-
name: ReactNode;
|
|
51
|
-
description?: ReactNode;
|
|
52
|
-
root?: boolean;
|
|
53
|
-
defaultOpen?: boolean;
|
|
54
|
-
collapsible?: boolean;
|
|
55
|
-
index?: Item;
|
|
56
|
-
icon?: ReactNode;
|
|
57
|
-
children: Node[];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type { Folder as F, Item as I, Node as N, Root as R, Separator as S };
|
package/dist/fetch-IBTWQCJR.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import "./chunk-U67V476Y.js";
|
|
2
|
-
|
|
3
|
-
// src/search/client/fetch.ts
|
|
4
|
-
var cache = /* @__PURE__ */ new Map();
|
|
5
|
-
async function fetchDocs(query, { api = "/api/search", locale, tag }) {
|
|
6
|
-
const url = new URL(api, window.location.origin);
|
|
7
|
-
url.searchParams.set("query", query);
|
|
8
|
-
if (locale) url.searchParams.set("locale", locale);
|
|
9
|
-
if (tag)
|
|
10
|
-
url.searchParams.set("tag", Array.isArray(tag) ? tag.join(",") : tag);
|
|
11
|
-
const key = url.toString();
|
|
12
|
-
const cached = cache.get(key);
|
|
13
|
-
if (cached) return cached;
|
|
14
|
-
const res = await fetch(url);
|
|
15
|
-
if (!res.ok) throw new Error(await res.text());
|
|
16
|
-
const result = await res.json();
|
|
17
|
-
cache.set(key, result);
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
fetchDocs
|
|
22
|
-
};
|