fumadocs-core 15.5.0 → 15.5.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.
Files changed (43) hide show
  1. package/dist/{algolia-RQ5VQJAB.js → algolia-NXNLN7TR.js} +1 -3
  2. package/dist/breadcrumb.js +0 -2
  3. package/dist/{chunk-XMCPKVJQ.js → chunk-3JSIVMCJ.js} +3 -4
  4. package/dist/{chunk-NNKVN7WA.js → chunk-5SU2O5AS.js} +1 -1
  5. package/dist/chunk-7GNSIKII.js +47 -0
  6. package/dist/{chunk-FVY6EZ3N.js → chunk-BBP7MIO4.js} +12 -14
  7. package/dist/content/index.js +0 -2
  8. package/dist/dynamic-link.js +2 -3
  9. package/dist/{fetch-W5EHIBOE.js → fetch-ZSD7GUCX.js} +2 -4
  10. package/dist/framework/index.d.ts +1 -1
  11. package/dist/framework/index.js +1 -2
  12. package/dist/framework/next.js +1 -2
  13. package/dist/framework/react-router.js +1 -2
  14. package/dist/framework/tanstack.js +1 -2
  15. package/dist/hide-if-empty.d.ts +14 -0
  16. package/dist/hide-if-empty.js +63 -0
  17. package/dist/highlight/client.js +0 -1
  18. package/dist/highlight/index.js +0 -1
  19. package/dist/i18n/index.d.ts +32 -2
  20. package/dist/i18n/index.js +0 -2
  21. package/dist/link.js +2 -3
  22. package/dist/mdx-plugins/index.js +1 -2
  23. package/dist/{orama-cloud-USLSOSXS.js → orama-cloud-I4WBDIAI.js} +2 -3
  24. package/dist/search/algolia.js +0 -2
  25. package/dist/search/client.d.ts +70 -7
  26. package/dist/search/client.js +20 -13
  27. package/dist/search/orama-cloud.js +0 -2
  28. package/dist/search/server.d.ts +2 -1
  29. package/dist/search/server.js +5 -2
  30. package/dist/server/index.d.ts +2 -1
  31. package/dist/server/index.js +0 -1
  32. package/dist/sidebar.js +0 -1
  33. package/dist/source/index.d.ts +96 -96
  34. package/dist/source/index.js +214 -224
  35. package/dist/static-QTPM5MZT.js +60 -0
  36. package/dist/toc.js +0 -1
  37. package/dist/utils/use-effect-event.js +0 -1
  38. package/dist/utils/use-media-query.js +0 -1
  39. package/dist/utils/use-on-change.js +0 -1
  40. package/package.json +21 -13
  41. package/dist/chunk-MLKGABMK.js +0 -9
  42. package/dist/config-Cm58P4fz.d.ts +0 -32
  43. package/dist/static-VESU2S64.js +0 -61
@@ -1,5 +1,3 @@
1
- import "./chunk-MLKGABMK.js";
2
-
3
1
  // src/search/client/algolia.ts
4
2
  function groupResults(hits) {
5
3
  const grouped = [];
@@ -23,7 +21,7 @@ function groupResults(hits) {
23
21
  }
24
22
  return grouped;
25
23
  }
26
- async function searchDocs(query, tag, locale, { indexName, onSearch, client }) {
24
+ async function searchDocs(query, { indexName, onSearch, client, locale, tag }) {
27
25
  if (query.length > 0) {
28
26
  const result = onSearch ? await onSearch(query, tag, locale) : await client.searchForHits({
29
27
  requests: [
@@ -1,5 +1,3 @@
1
- import "./chunk-MLKGABMK.js";
2
-
3
1
  // src/breadcrumb.tsx
4
2
  import { useMemo } from "react";
5
3
  function useBreadcrumb(url, tree, options) {
@@ -5,17 +5,16 @@ function splitPath(path) {
5
5
  function joinPath(...paths) {
6
6
  const out = [];
7
7
  const parsed = paths.flatMap(splitPath);
8
- while (parsed.length > 0) {
9
- switch (parsed[0]) {
8
+ for (const seg of parsed) {
9
+ switch (seg) {
10
10
  case "..":
11
11
  out.pop();
12
12
  break;
13
13
  case ".":
14
14
  break;
15
15
  default:
16
- out.push(parsed[0]);
16
+ out.push(seg);
17
17
  }
18
- parsed.shift();
19
18
  }
20
19
  return out.join("/");
21
20
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Link
3
- } from "./chunk-FVY6EZ3N.js";
3
+ } from "./chunk-BBP7MIO4.js";
4
4
 
5
5
  // src/link.tsx
6
6
  import { forwardRef } from "react";
@@ -0,0 +1,47 @@
1
+ // src/source/path.ts
2
+ function basename(path, ext) {
3
+ const idx = path.lastIndexOf("/");
4
+ return path.substring(
5
+ idx === -1 ? 0 : idx + 1,
6
+ ext ? path.length - ext.length : path.length
7
+ );
8
+ }
9
+ function extname(path) {
10
+ const dotIdx = path.lastIndexOf(".");
11
+ if (dotIdx !== -1) {
12
+ return path.substring(dotIdx);
13
+ }
14
+ return "";
15
+ }
16
+ function dirname(path) {
17
+ return path.split("/").slice(0, -1).join("/");
18
+ }
19
+ function parseFilePath(path) {
20
+ const ext = extname(path);
21
+ const name = basename(path, ext);
22
+ const dir = dirname(path);
23
+ return {
24
+ dirname: dir,
25
+ name,
26
+ ext,
27
+ path,
28
+ get flattenedPath() {
29
+ return [dir, name].filter((p) => p.length > 0).join("/");
30
+ }
31
+ };
32
+ }
33
+ function parseFolderPath(path) {
34
+ return {
35
+ dirname: dirname(path),
36
+ name: basename(path),
37
+ path
38
+ };
39
+ }
40
+
41
+ export {
42
+ basename,
43
+ extname,
44
+ dirname,
45
+ parseFilePath,
46
+ parseFolderPath
47
+ };
@@ -12,24 +12,22 @@ var FrameworkContext = createContext("FrameworkContext", {
12
12
  usePathname: notImplemented
13
13
  });
14
14
  function FrameworkProvider({
15
- children,
16
- ...props
15
+ Link: Link2,
16
+ useRouter: useRouter2,
17
+ useParams: useParams2,
18
+ usePathname: usePathname2,
19
+ Image: Image2,
20
+ children
17
21
  }) {
18
22
  const framework = React.useMemo(
19
23
  () => ({
20
- usePathname: props.usePathname,
21
- useRouter: props.useRouter,
22
- Link: props.Link,
23
- Image: props.Image,
24
- useParams: props.useParams
24
+ usePathname: usePathname2,
25
+ useRouter: useRouter2,
26
+ Link: Link2,
27
+ Image: Image2,
28
+ useParams: useParams2
25
29
  }),
26
- [
27
- props.Link,
28
- props.usePathname,
29
- props.useRouter,
30
- props.useParams,
31
- props.Image
32
- ]
30
+ [Link2, usePathname2, useRouter2, useParams2, Image2]
33
31
  );
34
32
  return /* @__PURE__ */ jsx(FrameworkContext.Provider, { value: framework, children });
35
33
  }
@@ -1,5 +1,3 @@
1
- import "../chunk-MLKGABMK.js";
2
-
3
1
  // src/content/index.ts
4
2
  import { remark } from "remark";
5
3
  import remarkGfm from "remark-gfm";
@@ -1,11 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Link
4
- } from "./chunk-NNKVN7WA.js";
4
+ } from "./chunk-5SU2O5AS.js";
5
5
  import {
6
6
  useParams
7
- } from "./chunk-FVY6EZ3N.js";
8
- import "./chunk-MLKGABMK.js";
7
+ } from "./chunk-BBP7MIO4.js";
9
8
 
10
9
  // src/dynamic-link.tsx
11
10
  import { forwardRef, useMemo } from "react";
@@ -1,13 +1,11 @@
1
- import "./chunk-MLKGABMK.js";
2
-
3
1
  // src/search/client/fetch.ts
4
2
  var cache = /* @__PURE__ */ new Map();
5
- async function fetchDocs(query, locale, tag, options) {
3
+ async function fetchDocs(query, { api = "/api/search", locale, tag }) {
6
4
  const params = new URLSearchParams();
7
5
  params.set("query", query);
8
6
  if (locale) params.set("locale", locale);
9
7
  if (tag) params.set("tag", tag);
10
- const key = `${options.api ?? "/api/search"}?${params}`;
8
+ const key = `${api}?${params}`;
11
9
  const cached = cache.get(key);
12
10
  if (cached) return cached;
13
11
  const res = await fetch(key);
@@ -29,7 +29,7 @@ interface Framework {
29
29
  }>;
30
30
  Image?: FC<ImageProps>;
31
31
  }
32
- declare function FrameworkProvider({ children, ...props }: Framework & {
32
+ declare function FrameworkProvider({ Link, useRouter, useParams, usePathname, Image, children, }: Framework & {
33
33
  children: ReactNode;
34
34
  }): react_jsx_runtime.JSX.Element;
35
35
  declare function usePathname(): string;
@@ -7,8 +7,7 @@ import {
7
7
  useParams,
8
8
  usePathname,
9
9
  useRouter
10
- } from "../chunk-FVY6EZ3N.js";
11
- import "../chunk-MLKGABMK.js";
10
+ } from "../chunk-BBP7MIO4.js";
12
11
  export {
13
12
  FrameworkProvider,
14
13
  Image,
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  FrameworkProvider
4
- } from "../chunk-FVY6EZ3N.js";
5
- import "../chunk-MLKGABMK.js";
4
+ } from "../chunk-BBP7MIO4.js";
6
5
 
7
6
  // src/framework/next.tsx
8
7
  import { useParams, usePathname, useRouter } from "next/navigation";
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  FrameworkProvider
3
- } from "../chunk-FVY6EZ3N.js";
4
- import "../chunk-MLKGABMK.js";
3
+ } from "../chunk-BBP7MIO4.js";
5
4
 
6
5
  // src/framework/react-router.tsx
7
6
  import { useMemo } from "react";
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  FrameworkProvider
3
- } from "../chunk-FVY6EZ3N.js";
4
- import "../chunk-MLKGABMK.js";
3
+ } from "../chunk-BBP7MIO4.js";
5
4
 
6
5
  // src/framework/tanstack.tsx
7
6
  import { useMemo } from "react";
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ /**
5
+ * The built-in CSS `:empty` selector cannot detect if the children is hidden, classes such as `md:hidden` causes it to fail.
6
+ * This component is an enhancement to `empty:hidden` to fix the issue described above.
7
+ *
8
+ * This can be expensive, please avoid this whenever possible.
9
+ */
10
+ declare function HideIfEmpty({ children }: {
11
+ children: ReactNode;
12
+ }): react_jsx_runtime.JSX.Element;
13
+
14
+ export { HideIfEmpty };
@@ -0,0 +1,63 @@
1
+ "use client";
2
+
3
+ // src/hide-if-empty.tsx
4
+ import React from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ var isEmpty = (node) => {
7
+ for (let i = 0; i < node.childNodes.length; i++) {
8
+ const child = node.childNodes.item(i);
9
+ if (child.nodeType === Node.TEXT_NODE || child.nodeType === Node.ELEMENT_NODE && window.getComputedStyle(child).display !== "none") {
10
+ return false;
11
+ }
12
+ }
13
+ return true;
14
+ };
15
+ function HideIfEmpty({ children }) {
16
+ const id = React.useId();
17
+ const [empty, setEmpty] = React.useState();
18
+ React.useEffect(() => {
19
+ const element = document.querySelector(
20
+ `[data-fdid="${id}"]`
21
+ );
22
+ if (!element) return;
23
+ const onUpdate = () => {
24
+ setEmpty(isEmpty(element));
25
+ };
26
+ const observer = new ResizeObserver(onUpdate);
27
+ observer.observe(element);
28
+ onUpdate();
29
+ return () => {
30
+ observer.disconnect();
31
+ };
32
+ }, [id]);
33
+ let child;
34
+ if (React.isValidElement(children)) {
35
+ child = React.cloneElement(children, {
36
+ ...children.props,
37
+ "data-fdid": id,
38
+ "data-empty": empty,
39
+ suppressHydrationWarning: true
40
+ });
41
+ } else {
42
+ child = React.Children.count(children) > 1 ? React.Children.only(null) : null;
43
+ }
44
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
45
+ child,
46
+ empty === void 0 && /* @__PURE__ */ jsx(
47
+ "script",
48
+ {
49
+ suppressHydrationWarning: true,
50
+ dangerouslySetInnerHTML: {
51
+ __html: `{
52
+ const element = document.querySelector('[data-fdid="${id}"]')
53
+ if (element) {
54
+ element.setAttribute('data-empty', String((${isEmpty.toString()})(element)))
55
+ }}`
56
+ }
57
+ }
58
+ )
59
+ ] });
60
+ }
61
+ export {
62
+ HideIfEmpty
63
+ };
@@ -4,7 +4,6 @@ import {
4
4
  _renderHighlight,
5
5
  highlight
6
6
  } from "../chunk-KNWSJ4IF.js";
7
- import "../chunk-MLKGABMK.js";
8
7
 
9
8
  // src/highlight/client.tsx
10
9
  import {
@@ -2,7 +2,6 @@ import {
2
2
  getHighlighter,
3
3
  highlight
4
4
  } from "../chunk-KNWSJ4IF.js";
5
- import "../chunk-MLKGABMK.js";
6
5
  export {
7
6
  getHighlighter,
8
7
  highlight
@@ -1,4 +1,3 @@
1
- import { I as I18nConfig } from '../config-Cm58P4fz.js';
2
1
  import { NextMiddleware } from 'next/dist/server/web/types';
3
2
 
4
3
  interface MiddlewareOptions extends I18nConfig {
@@ -9,4 +8,35 @@ interface MiddlewareOptions extends I18nConfig {
9
8
  }
10
9
  declare function createI18nMiddleware({ languages, defaultLanguage, format, hideLocale, }: MiddlewareOptions): NextMiddleware;
11
10
 
12
- export { I18nConfig, createI18nMiddleware };
11
+ interface I18nConfig {
12
+ /**
13
+ * Supported locale codes.
14
+ *
15
+ * A page tree will be built for each language.
16
+ */
17
+ languages: string[];
18
+ /**
19
+ * Default locale if not specified
20
+ */
21
+ defaultLanguage: string;
22
+ /**
23
+ * Don't show the locale prefix on URL.
24
+ *
25
+ * - `always`: Always hide the prefix
26
+ * - `default-locale`: Only hide the default locale
27
+ * - `never`: Never hide the prefix
28
+ *
29
+ * This API uses `NextResponse.rewrite`.
30
+ *
31
+ * @defaultValue 'never'
32
+ */
33
+ hideLocale?: 'always' | 'default-locale' | 'never';
34
+ /**
35
+ * Used by `loader()`, specify the way to parse i18n file structure.
36
+ *
37
+ * @defaultValue 'dot'
38
+ */
39
+ parser?: 'dot' | 'dir';
40
+ }
41
+
42
+ export { type I18nConfig, createI18nMiddleware };
@@ -1,5 +1,3 @@
1
- import "../chunk-MLKGABMK.js";
2
-
3
1
  // src/i18n/middleware.ts
4
2
  import { match as matchLocale } from "@formatjs/intl-localematcher";
5
3
  import Negotiator from "negotiator";
package/dist/link.js CHANGED
@@ -1,9 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  Link
4
- } from "./chunk-NNKVN7WA.js";
5
- import "./chunk-FVY6EZ3N.js";
6
- import "./chunk-MLKGABMK.js";
4
+ } from "./chunk-5SU2O5AS.js";
5
+ import "./chunk-BBP7MIO4.js";
7
6
  export {
8
7
  Link as default
9
8
  };
@@ -5,12 +5,11 @@ import {
5
5
  import {
6
6
  joinPath,
7
7
  slash
8
- } from "../chunk-XMCPKVJQ.js";
8
+ } from "../chunk-3JSIVMCJ.js";
9
9
  import {
10
10
  defaultThemes,
11
11
  getHighlighter
12
12
  } from "../chunk-KNWSJ4IF.js";
13
- import "../chunk-MLKGABMK.js";
14
13
 
15
14
  // src/mdx-plugins/index.ts
16
15
  import {
@@ -1,12 +1,11 @@
1
1
  import {
2
2
  removeUndefined
3
3
  } from "./chunk-KAOEMCTI.js";
4
- import "./chunk-MLKGABMK.js";
5
4
 
6
5
  // src/search/client/orama-cloud.ts
7
- async function searchDocs(query, tag, options) {
6
+ async function searchDocs(query, options) {
8
7
  const list = [];
9
- const { index = "default", client, params: extraParams = {} } = options;
8
+ const { index = "default", client, params: extraParams = {}, tag } = options;
10
9
  if (index === "crawler") {
11
10
  const result2 = await client.search({
12
11
  ...extraParams,
@@ -1,5 +1,3 @@
1
- import "../chunk-MLKGABMK.js";
2
-
3
1
  // src/search/algolia.ts
4
2
  async function sync(client, options) {
5
3
  const { document = "document", indexName = document, documents } = options;
@@ -12,21 +12,46 @@ import 'mdast-util-mdx-jsx';
12
12
  interface FetchOptions {
13
13
  /**
14
14
  * API route for search endpoint
15
+ *
16
+ * @defaultValue '/api/search'
15
17
  */
16
18
  api?: string;
19
+ /**
20
+ * Filter results with specific tag.
21
+ */
22
+ tag?: string;
23
+ /**
24
+ * Filter by locale
25
+ */
26
+ locale?: string;
17
27
  }
18
28
 
19
29
  interface StaticOptions {
20
30
  /**
21
31
  * Where to download exported search indexes (URL)
32
+ *
33
+ * @defaultValue '/api/search'
22
34
  */
23
35
  from?: string;
24
36
  initOrama?: (locale?: string) => AnyOrama | Promise<AnyOrama>;
37
+ /**
38
+ * Filter results with specific tag.
39
+ */
40
+ tag?: string;
41
+ /**
42
+ * Filter by locale (unsupported at the moment)
43
+ */
44
+ locale?: string;
25
45
  }
26
46
 
27
47
  interface AlgoliaOptions {
28
48
  indexName: string;
29
49
  client: LiteClient;
50
+ /**
51
+ * Filter results with specific tag.
52
+ */
53
+ tag?: string;
54
+ locale?: string;
30
55
  onSearch?: (query: string, tag?: string, locale?: string) => Promise<{
31
56
  results: SearchResponse<BaseIndex>[];
32
57
  }>;
@@ -41,6 +66,14 @@ interface OramaCloudOptions {
41
66
  */
42
67
  index?: 'default' | 'crawler';
43
68
  params?: ClientSearchParams;
69
+ /**
70
+ * Filter results with specific tag.
71
+ */
72
+ tag?: string;
73
+ /**
74
+ * Filter by locale (unsupported at the moment)
75
+ */
76
+ locale?: string;
44
77
  }
45
78
 
46
79
  interface UseDocsSearch {
@@ -62,13 +95,43 @@ type Client = ({
62
95
  type: 'orama-cloud';
63
96
  } & OramaCloudOptions);
64
97
  /**
65
- * @param client - search client
66
- * @param locale - Filter with locale
67
- * @param tag - Filter with specific tag
68
- * @param delayMs - The debounced delay for performing a search.
69
- * @param allowEmpty - still perform search even if query is empty
70
- * @param key - cache key
98
+ * Provide a hook to query different official search clients.
99
+ *
100
+ * Note: it will re-query when its parameters changed, make sure to use `useCallback()` on functions passed to this hook.
101
+ */
102
+ declare function useDocsSearch(clientOptions: Client & {
103
+ /**
104
+ * The debounced delay for performing a search (in ms).
105
+ * .
106
+ * @defaultValue 100
107
+ */
108
+ delayMs?: number;
109
+ /**
110
+ * still perform search even if query is empty.
111
+ *
112
+ * @defaultValue false
113
+ */
114
+ allowEmpty?: boolean;
115
+ },
116
+ /**
117
+ * @deprecated pass to `client` object instead
118
+ */
119
+ _locale?: string,
120
+ /**
121
+ * @deprecated pass to `client` object instead
122
+ */
123
+ _tag?: string,
124
+ /**
125
+ * @deprecated pass to `client` object instead
126
+ */
127
+ _delayMs?: number,
128
+ /**
129
+ * @deprecated pass to `client` object instead
130
+ */
131
+ _allowEmpty?: boolean,
132
+ /**
133
+ * @deprecated No longer used
71
134
  */
72
- declare function useDocsSearch(client: Client, locale?: string, tag?: string, delayMs?: number, allowEmpty?: boolean, key?: string): UseDocsSearch;
135
+ _key?: string): UseDocsSearch;
73
136
 
74
137
  export { type AlgoliaOptions, type Client, type FetchOptions, type OramaCloudOptions, type StaticOptions, useDocsSearch };
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  useOnChange
3
3
  } from "../chunk-EMWGTXSW.js";
4
- import "../chunk-MLKGABMK.js";
5
4
 
6
5
  // src/search/client.ts
7
6
  import { useRef as useRef2, useState as useState2 } from "react";
@@ -23,7 +22,6 @@ function useDebounce(value, delayMs = 1e3) {
23
22
  }
24
23
 
25
24
  // src/search/client.ts
26
- var staticClient;
27
25
  function isDifferentDeep(a, b) {
28
26
  if (Array.isArray(a) && Array.isArray(b)) {
29
27
  return b.length !== a.length || a.some((v, i) => isDifferentDeep(v, b[i]));
@@ -37,7 +35,14 @@ function isDifferentDeep(a, b) {
37
35
  }
38
36
  return a !== b;
39
37
  }
40
- function useDocsSearch(client, locale, tag, delayMs = 100, allowEmpty = false, key) {
38
+ function useDocsSearch(clientOptions, _locale, _tag, _delayMs = 100, _allowEmpty = false, _key) {
39
+ const {
40
+ delayMs = _delayMs ?? 100,
41
+ allowEmpty = _allowEmpty ?? false,
42
+ ...client
43
+ } = clientOptions;
44
+ client.tag ??= _tag;
45
+ client.locale ??= _locale;
41
46
  const [search, setSearch] = useState2("");
42
47
  const [results, setResults] = useState2("empty");
43
48
  const [error, setError] = useState2();
@@ -45,7 +50,7 @@ function useDocsSearch(client, locale, tag, delayMs = 100, allowEmpty = false, k
45
50
  const debouncedValue = useDebounce(search, delayMs);
46
51
  const onStart = useRef2(void 0);
47
52
  useOnChange(
48
- key ?? [client, debouncedValue, locale, tag],
53
+ [client, debouncedValue],
49
54
  () => {
50
55
  if (onStart.current) {
51
56
  onStart.current();
@@ -59,20 +64,22 @@ function useDocsSearch(client, locale, tag, delayMs = 100, allowEmpty = false, k
59
64
  async function run() {
60
65
  if (debouncedValue.length === 0 && !allowEmpty) return "empty";
61
66
  if (client.type === "fetch") {
62
- const { fetchDocs } = await import("../fetch-W5EHIBOE.js");
63
- return fetchDocs(debouncedValue, locale, tag, client);
67
+ const { fetchDocs } = await import("../fetch-ZSD7GUCX.js");
68
+ return fetchDocs(debouncedValue, client);
64
69
  }
65
70
  if (client.type === "algolia") {
66
- const { searchDocs } = await import("../algolia-RQ5VQJAB.js");
67
- return searchDocs(debouncedValue, tag, locale, client);
71
+ const { searchDocs } = await import("../algolia-NXNLN7TR.js");
72
+ return searchDocs(debouncedValue, client);
68
73
  }
69
74
  if (client.type === "orama-cloud") {
70
- const { searchDocs } = await import("../orama-cloud-USLSOSXS.js");
71
- return searchDocs(debouncedValue, tag, client);
75
+ const { searchDocs } = await import("../orama-cloud-I4WBDIAI.js");
76
+ return searchDocs(debouncedValue, client);
72
77
  }
73
- const { createStaticClient } = await import("../static-VESU2S64.js");
74
- if (!staticClient) staticClient = createStaticClient(client);
75
- return staticClient.search(debouncedValue, locale, tag);
78
+ if (client.type === "static") {
79
+ const { search: search2 } = await import("../static-QTPM5MZT.js");
80
+ return search2(debouncedValue, client);
81
+ }
82
+ throw new Error("unknown search client");
76
83
  }
77
84
  void run().then((res) => {
78
85
  if (interrupt) return;
@@ -1,5 +1,3 @@
1
- import "../chunk-MLKGABMK.js";
2
-
3
1
  // src/search/orama-cloud.ts
4
2
  async function sync(cloudManager, options) {
5
3
  const { autoDeploy = true } = options;
@@ -1,11 +1,12 @@
1
1
  import { TypedDocument, Orama, Language, RawData, create, SearchParams } from '@orama/orama';
2
2
  import { S as StructuredData } from '../remark-structure-DVje0Sib.js';
3
3
  import { S as SortedResult } from '../types-Ch8gnVgO.js';
4
- import { I as I18nConfig } from '../config-Cm58P4fz.js';
4
+ import { I18nConfig } from '../i18n/index.js';
5
5
  import { LoaderOutput, LoaderConfig, InferPageType } from '../source/index.js';
6
6
  import 'mdast';
7
7
  import 'unified';
8
8
  import 'mdast-util-mdx-jsx';
9
+ import 'next/dist/server/web/types';
9
10
  import 'react';
10
11
  import '../page-tree-bSt6K__E.js';
11
12
 
@@ -3,7 +3,10 @@ import {
3
3
  searchSimple
4
4
  } from "../chunk-WFUH5VBX.js";
5
5
  import "../chunk-KAOEMCTI.js";
6
- import "../chunk-MLKGABMK.js";
6
+ import {
7
+ basename,
8
+ extname
9
+ } from "../chunk-7GNSIKII.js";
7
10
 
8
11
  // src/search/server.ts
9
12
  import {
@@ -150,7 +153,7 @@ function pageToIndex(page) {
150
153
  }
151
154
  const structuredData = page.data.structuredData;
152
155
  return {
153
- title: page.data.title ?? page.file.name,
156
+ title: page.data.title ?? basename(page.path, extname(page.path)),
154
157
  description: "description" in page.data ? page.data.description : void 0,
155
158
  url: page.url,
156
159
  id: page.url,
@@ -8,7 +8,8 @@ import { LoaderOutput, LoaderConfig, InferPageType } from '../source/index.js';
8
8
  import 'react';
9
9
  import 'unified';
10
10
  import 'vfile';
11
- import '../config-Cm58P4fz.js';
11
+ import '../i18n/index.js';
12
+ import 'next/dist/server/web/types';
12
13
 
13
14
  /**
14
15
  * Flatten tree to an array of page nodes