fumadocs-core 15.5.1 → 15.5.3

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.
@@ -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 = [];
@@ -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) {
@@ -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
+ };
@@ -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";
@@ -5,7 +5,6 @@ import {
5
5
  import {
6
6
  useParams
7
7
  } from "./chunk-BBP7MIO4.js";
8
- import "./chunk-MLKGABMK.js";
9
8
 
10
9
  // src/dynamic-link.tsx
11
10
  import { forwardRef, useMemo } from "react";
@@ -1,5 +1,3 @@
1
- import "./chunk-MLKGABMK.js";
2
-
3
1
  // src/search/client/fetch.ts
4
2
  var cache = /* @__PURE__ */ new Map();
5
3
  async function fetchDocs(query, { api = "/api/search", locale, tag }) {
@@ -8,7 +8,6 @@ import {
8
8
  usePathname,
9
9
  useRouter
10
10
  } from "../chunk-BBP7MIO4.js";
11
- import "../chunk-MLKGABMK.js";
12
11
  export {
13
12
  FrameworkProvider,
14
13
  Image,
@@ -2,7 +2,6 @@
2
2
  import {
3
3
  FrameworkProvider
4
4
  } from "../chunk-BBP7MIO4.js";
5
- import "../chunk-MLKGABMK.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
3
  } from "../chunk-BBP7MIO4.js";
4
- import "../chunk-MLKGABMK.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
3
  } from "../chunk-BBP7MIO4.js";
4
- import "../chunk-MLKGABMK.js";
5
4
 
6
5
  // src/framework/tanstack.tsx
7
6
  import { useMemo } from "react";
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import react__default from 'react';
2
+ import { ReactNode } from 'react';
3
3
 
4
4
  /**
5
5
  * The built-in CSS `:empty` selector cannot detect if the children is hidden, classes such as `md:hidden` causes it to fail.
@@ -8,7 +8,7 @@ import react__default from 'react';
8
8
  * This can be expensive, please avoid this whenever possible.
9
9
  */
10
10
  declare function HideIfEmpty({ children }: {
11
- children: react__default.ReactNode;
11
+ children: ReactNode;
12
12
  }): react_jsx_runtime.JSX.Element;
13
13
 
14
14
  export { HideIfEmpty };
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import "./chunk-MLKGABMK.js";
3
2
 
4
3
  // src/hide-if-empty.tsx
5
4
  import React from "react";
@@ -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,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
@@ -3,7 +3,6 @@ import {
3
3
  Link
4
4
  } from "./chunk-5SU2O5AS.js";
5
5
  import "./chunk-BBP7MIO4.js";
6
- import "./chunk-MLKGABMK.js";
7
6
  export {
8
7
  Link as default
9
8
  };
@@ -10,7 +10,6 @@ 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,7 +1,6 @@
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
6
  async function searchDocs(query, options) {
@@ -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;
@@ -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";
@@ -65,19 +64,19 @@ function useDocsSearch(clientOptions, _locale, _tag, _delayMs = 100, _allowEmpty
65
64
  async function run() {
66
65
  if (debouncedValue.length === 0 && !allowEmpty) return "empty";
67
66
  if (client.type === "fetch") {
68
- const { fetchDocs } = await import("../fetch-M245YYDD.js");
67
+ const { fetchDocs } = await import("../fetch-ZSD7GUCX.js");
69
68
  return fetchDocs(debouncedValue, client);
70
69
  }
71
70
  if (client.type === "algolia") {
72
- const { searchDocs } = await import("../algolia-KJKVXZ5Q.js");
71
+ const { searchDocs } = await import("../algolia-NXNLN7TR.js");
73
72
  return searchDocs(debouncedValue, client);
74
73
  }
75
74
  if (client.type === "orama-cloud") {
76
- const { searchDocs } = await import("../orama-cloud-SBXZAVQC.js");
75
+ const { searchDocs } = await import("../orama-cloud-I4WBDIAI.js");
77
76
  return searchDocs(debouncedValue, client);
78
77
  }
79
78
  if (client.type === "static") {
80
- const { search: search2 } = await import("../static-IM4OAJFY.js");
79
+ const { search: search2 } = await import("../static-QTPM5MZT.js");
81
80
  return search2(debouncedValue, client);
82
81
  }
83
82
  throw new Error("unknown search client");
@@ -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;
@@ -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,
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  remarkHeading
3
3
  } from "../chunk-Y2774T3B.js";
4
- import "../chunk-MLKGABMK.js";
5
4
 
6
5
  // src/server/get-toc.ts
7
6
  import { remark } from "remark";
package/dist/sidebar.js CHANGED
@@ -2,7 +2,6 @@
2
2
  import {
3
3
  useMediaQuery
4
4
  } from "./chunk-EP5LHGDZ.js";
5
- import "./chunk-MLKGABMK.js";
6
5
 
7
6
  // src/sidebar.tsx
8
7
  import {
@@ -1,8 +1,48 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { I18nConfig } from '../i18n/index.js';
3
- import { R as Root, I as Item, F as Folder$1, S as Separator } from '../page-tree-bSt6K__E.js';
3
+ import { R as Root, I as Item, F as Folder, S as Separator } from '../page-tree-bSt6K__E.js';
4
4
  import 'next/dist/server/web/types';
5
5
 
6
+ /**
7
+ * In memory file system.
8
+ */
9
+ declare class FileSystem<File> {
10
+ files: Map<string, File>;
11
+ folders: Map<string, string[]>;
12
+ constructor();
13
+ read(path: string): File | undefined;
14
+ /**
15
+ * get the direct children of folder (in virtual file path)
16
+ */
17
+ readDir(path: string): string[] | undefined;
18
+ write(path: string, file: File): void;
19
+ getFiles(): string[];
20
+ makeDir(path: string): void;
21
+ }
22
+
23
+ interface LoadOptions {
24
+ transformers?: Transformer[];
25
+ }
26
+ type ContentStorage = FileSystem<MetaFile | PageFile>;
27
+ interface MetaFile<Data extends MetaData = MetaData> {
28
+ path: string;
29
+ absolutePath: string;
30
+ format: 'meta';
31
+ data: Data;
32
+ }
33
+ interface PageFile<Data extends PageData = PageData> {
34
+ path: string;
35
+ absolutePath: string;
36
+ format: 'page';
37
+ slugs: string[];
38
+ data: Data;
39
+ }
40
+ type Transformer = (context: {
41
+ storage: ContentStorage;
42
+ options: LoadOptions;
43
+ }) => void;
44
+ declare function loadFiles(files: VirtualFile[], buildFile: (file: VirtualFile) => MetaFile | PageFile, options: LoadOptions): ContentStorage;
45
+
6
46
  interface FileInfo {
7
47
  /**
8
48
  * File path without extension
@@ -38,32 +78,11 @@ interface FolderInfo {
38
78
  dirname: string;
39
79
  }
40
80
  declare function parseFilePath(path: string): FileInfo;
81
+ /**
82
+ * @deprecated use `dirname` and `basename` directly.
83
+ */
41
84
  declare function parseFolderPath(path: string): FolderInfo;
42
85
 
43
- interface LoadOptions {
44
- transformers?: Transformer[];
45
- getSlugs: (info: FileInfo) => string[];
46
- }
47
- interface VirtualFile {
48
- /**
49
- * Relative path
50
- *
51
- * @example `docs/page.mdx`
52
- */
53
- path: string;
54
- type: 'page' | 'meta';
55
- /**
56
- * Specified Slugs for page
57
- */
58
- slugs?: string[];
59
- data: unknown;
60
- }
61
- type Transformer = (context: {
62
- storage: Storage;
63
- options: LoadOptions;
64
- }) => void;
65
- declare function loadFiles<O extends LoadOptions>(files: VirtualFile[], options: O): Storage;
66
-
67
86
  interface LoaderConfig {
68
87
  source: SourceConfig;
69
88
  i18n: boolean;
@@ -74,15 +93,15 @@ interface SourceConfig {
74
93
  }
75
94
  interface LoaderOptions<T extends SourceConfig = SourceConfig, I18n extends I18nConfig | undefined = I18nConfig | undefined> {
76
95
  baseUrl: string;
77
- icon?: NonNullable<BaseOptions['resolveIcon']>;
78
- slugs?: LoadOptions['getSlugs'];
96
+ icon?: NonNullable<BuildPageTreeOptions['resolveIcon']>;
97
+ slugs?: (info: FileInfo) => string[];
79
98
  url?: UrlFn;
80
99
  source: Source<T>;
81
100
  transformers?: Transformer[];
82
101
  /**
83
102
  * Additional options for page tree builder
84
103
  */
85
- pageTree?: Partial<BaseOptions<T['pageData'], T['metaData']>>;
104
+ pageTree?: Partial<Omit<BuildPageTreeOptions<T['pageData'], T['metaData']>, 'storage'>>;
86
105
  /**
87
106
  * Configure i18n
88
107
  */
@@ -95,21 +114,49 @@ interface Source<Config extends SourceConfig> {
95
114
  _config?: Config;
96
115
  files: VirtualFile[] | (() => VirtualFile[]);
97
116
  }
98
- interface Page<Data = PageData> {
117
+ interface SharedFileInfo {
99
118
  /**
100
- * Virtualized file path
119
+ * Virtualized file path (parsed)
120
+ *
121
+ * @deprecated Use `path` instead.
101
122
  */
102
123
  file: FileInfo;
124
+ /**
125
+ * Virtualized file path (relative to content directory)
126
+ *
127
+ * @example `docs/page.mdx`
128
+ */
129
+ path: string;
130
+ /**
131
+ * Absolute path of the file
132
+ */
133
+ absolutePath: string;
134
+ }
135
+ interface VirtualFile {
136
+ /**
137
+ * Virtualized path (relative to content directory)
138
+ *
139
+ * @example `docs/page.mdx`
140
+ */
141
+ path: string;
142
+ /**
143
+ * Absolute path of the file
144
+ */
145
+ absolutePath?: string;
146
+ type: 'page' | 'meta';
147
+ /**
148
+ * Specified Slugs for page
149
+ */
150
+ slugs?: string[];
151
+ data: unknown;
152
+ }
153
+ interface Page<Data = PageData> extends SharedFileInfo {
103
154
  slugs: string[];
104
155
  url: string;
105
156
  data: Data;
106
157
  locale?: string | undefined;
107
158
  }
108
- interface Meta<Data = MetaData> {
109
- /**
110
- * Virtualized file path
111
- */
112
- file: FileInfo;
159
+ interface Meta<Data = MetaData> extends SharedFileInfo {
113
160
  data: Data;
114
161
  }
115
162
  interface LanguageEntry<Data = PageData> {
@@ -144,7 +191,7 @@ interface LoaderOutput<Config extends LoaderConfig> {
144
191
  */
145
192
  getPage: (slugs: string[] | undefined, language?: string) => Page<Config['source']['pageData']> | undefined;
146
193
  getNodePage: (node: Item, language?: string) => Page<Config['source']['pageData']> | undefined;
147
- getNodeMeta: (node: Folder$1, language?: string) => Meta<Config['source']['metaData']> | undefined;
194
+ getNodeMeta: (node: Folder, language?: string) => Meta<Config['source']['metaData']> | undefined;
148
195
  /**
149
196
  * generate static params for Next.js SSG
150
197
  *
@@ -183,59 +230,6 @@ type InferMetaType<Utils extends LoaderOutput<any>> = Utils extends LoaderOutput
183
230
  */
184
231
  type UrlFn = (slugs: string[], locale?: string) => string;
185
232
 
186
- interface MetaFile<Data extends MetaData = MetaData> {
187
- file: FileInfo;
188
- format: 'meta';
189
- data: Data;
190
- }
191
- interface PageFile<Data extends PageData = PageData> {
192
- file: FileInfo;
193
- format: 'page';
194
- data: {
195
- slugs: string[];
196
- data: Data;
197
- };
198
- }
199
- type File = MetaFile | PageFile;
200
- interface Folder<Page extends PageData = PageData, Meta extends MetaData = MetaData> {
201
- file: FolderInfo;
202
- children: (MetaFile<Meta> | PageFile<Page> | Folder<Page, Meta>)[];
203
- }
204
- /**
205
- * A virtual file system that solves inconsistent behaviours
206
- *
207
- * Some source providers may not provide the full file structure, this will cause inconsistent outputs for page builder and other transformers
208
- */
209
- declare class Storage {
210
- files: Map<string, File>;
211
- folders: Map<string, Folder<PageData, MetaData>>;
212
- private rootFolder;
213
- constructor();
214
- /**
215
- * @param path - flattened path
216
- * @param format - file format
217
- */
218
- read<F extends File['format']>(path: string, format: F): Extract<File, {
219
- format: F;
220
- }> | undefined;
221
- readDir(path: string): Folder | undefined;
222
- root(): Folder;
223
- write<F extends File['format']>(path: string, format: F, data: Extract<File, {
224
- format: F;
225
- }>['data']): void;
226
- list(): File[];
227
- makeDir(path: string): void;
228
- }
229
-
230
- type fileSystem_Folder<Page extends PageData = PageData, Meta extends MetaData = MetaData> = Folder<Page, Meta>;
231
- type fileSystem_MetaFile<Data extends MetaData = MetaData> = MetaFile<Data>;
232
- type fileSystem_PageFile<Data extends PageData = PageData> = PageFile<Data>;
233
- type fileSystem_Storage = Storage;
234
- declare const fileSystem_Storage: typeof Storage;
235
- declare namespace fileSystem {
236
- export { type fileSystem_Folder as Folder, type fileSystem_MetaFile as MetaFile, type fileSystem_PageFile as PageFile, fileSystem_Storage as Storage };
237
- }
238
-
239
233
  interface BaseOptions<Page extends PageData = PageData, Meta extends MetaData = MetaData> {
240
234
  /**
241
235
  * Remove references to the file path of original nodes (`$ref`)
@@ -244,15 +238,17 @@ interface BaseOptions<Page extends PageData = PageData, Meta extends MetaData =
244
238
  */
245
239
  noRef?: boolean;
246
240
  attachFile?: (node: Item, file?: PageFile<Page>) => Item;
247
- attachFolder?: (node: Folder$1, folder: Folder<Page, Meta>, meta?: MetaFile<Meta>) => Folder$1;
241
+ attachFolder?: (node: Folder, folder: {
242
+ children: (PageFile<Page> | MetaFile<Meta>)[];
243
+ }, meta?: MetaFile<Meta>) => Folder;
248
244
  attachSeparator?: (node: Separator) => Separator;
249
245
  resolveIcon?: (icon: string | undefined) => ReactElement | undefined;
250
246
  }
251
- interface BuildPageTreeOptions extends BaseOptions {
252
- storage: Storage;
247
+ interface BuildPageTreeOptions<Page extends PageData = PageData, Meta extends MetaData = MetaData> extends BaseOptions<Page, Meta> {
248
+ storage: ContentStorage;
253
249
  }
254
- interface BuildPageTreeOptionsWithI18n extends BaseOptions {
255
- storages: Record<string, Storage>;
250
+ interface BuildPageTreeOptionsWithI18n<Page extends PageData = PageData, Meta extends MetaData = MetaData> extends BaseOptions<Page, Meta> {
251
+ storages: Record<string, ContentStorage>;
256
252
  i18n: I18nConfig;
257
253
  }
258
254
  interface PageTreeBuilder {
@@ -264,4 +260,4 @@ interface PageTreeBuilder {
264
260
  }
265
261
  declare function createPageTreeBuilder(getUrl: UrlFn): PageTreeBuilder;
266
262
 
267
- export { type BaseOptions, type BuildPageTreeOptions, type BuildPageTreeOptionsWithI18n, type FileInfo, fileSystem as FileSystem, type FolderInfo, type InferMetaType, type InferPageType, type LanguageEntry, type LoadOptions, type LoaderConfig, type LoaderOptions, type LoaderOutput, type Meta, type MetaData, type Page, type PageData, type PageTreeBuilder, type Source, type SourceConfig, type Transformer, type UrlFn, type VirtualFile, createGetUrl, createPageTreeBuilder, getSlugs, loadFiles, loader, parseFilePath, parseFolderPath };
263
+ export { type BuildPageTreeOptions, type BuildPageTreeOptionsWithI18n, type ContentStorage, type FileInfo, FileSystem, type FolderInfo, type InferMetaType, type InferPageType, type LanguageEntry, type LoadOptions, type LoaderConfig, type LoaderOptions, type LoaderOutput, type Meta, type MetaData, type MetaFile, type Page, type PageData, type PageFile, type PageTreeBuilder, type Source, type SourceConfig, type Transformer, type UrlFn, type VirtualFile, createGetUrl, createPageTreeBuilder, getSlugs, loadFiles, loader, parseFilePath, parseFolderPath };
@@ -1,11 +1,15 @@
1
+ import {
2
+ basename,
3
+ dirname,
4
+ extname,
5
+ parseFilePath,
6
+ parseFolderPath
7
+ } from "../chunk-7GNSIKII.js";
1
8
  import {
2
9
  joinPath,
3
10
  slash,
4
11
  splitPath
5
12
  } from "../chunk-3JSIVMCJ.js";
6
- import {
7
- __export
8
- } from "../chunk-MLKGABMK.js";
9
13
 
10
14
  // src/source/page-tree-builder.ts
11
15
  var group = /^\((?<name>.+)\)$/;
@@ -15,44 +19,30 @@ var rest = "...";
15
19
  var restReversed = "z...a";
16
20
  var extractPrefix = "...";
17
21
  var excludePrefix = "!";
18
- function isPageFile(node) {
19
- return "data" in node && node.format === "page";
20
- }
21
- function buildAll(nodes, ctx, filter, reversed = false) {
22
- const { localeStorage } = ctx;
22
+ function buildAll(paths, ctx, filter, reversed = false) {
23
23
  const output = [];
24
- for (const node of [...nodes].sort((a, b) => {
25
- let result;
26
- if (isPageFile(a) && "children" in b) result = -1;
27
- else if ("children" in a && isPageFile(b)) result = 1;
28
- else result = a.file.name.localeCompare(b.file.name);
29
- return reversed ? result * -1 : result;
30
- })) {
31
- if (filter && !filter(node)) continue;
32
- if (isPageFile(node)) {
33
- const localized = localeStorage?.read(
34
- joinPath(node.file.dirname, node.file.name),
35
- "page"
36
- );
37
- const treeNode = buildFileNode(localized ?? node, ctx);
38
- if (node.file.name === "index") {
39
- output.unshift(treeNode);
40
- continue;
41
- }
42
- output.push(treeNode);
43
- } else if ("children" in node) {
44
- output.push(buildFolderNode(node, false, ctx));
45
- }
24
+ const sortedPaths = (filter ? paths.filter(filter) : [...paths]).sort(
25
+ (a, b) => a.localeCompare(b) * (reversed ? -1 : 1)
26
+ );
27
+ for (const path of sortedPaths) {
28
+ const fileNode = buildFileNode(path, ctx);
29
+ if (!fileNode) continue;
30
+ if (basename(path, extname(path)) === "index") output.unshift(fileNode);
31
+ else output.push(fileNode);
32
+ }
33
+ for (const dir of sortedPaths) {
34
+ const dirNode = buildFolderNode(dir, false, ctx);
35
+ if (dirNode) output.push(dirNode);
46
36
  }
47
37
  return output;
48
38
  }
49
- function resolveFolderItem(folder, item, ctx, idx, addedNodePaths) {
39
+ function resolveFolderItem(folderPath, item, ctx, idx, restNodePaths) {
50
40
  if (item === rest || item === restReversed) return item;
51
- const { options, storage, localeStorage } = ctx;
41
+ const { options, resolveName } = ctx;
52
42
  let match = separator.exec(item);
53
43
  if (match?.groups) {
54
44
  const node = {
55
- $id: `${folder.file.path}#${idx}`,
45
+ $id: `${folderPath}#${idx}`,
56
46
  type: "separator",
57
47
  icon: options.resolveIcon?.(match.groups.icon),
58
48
  name: match.groups.name
@@ -80,93 +70,101 @@ function resolveFolderItem(folder, item, ctx, idx, addedNodePaths) {
80
70
  } else if (isExtract) {
81
71
  filename = item.slice(extractPrefix.length);
82
72
  }
83
- const path = joinPath(folder.file.path, filename);
84
- const itemNode = storage.readDir(path) ?? localeStorage?.read(path, "page") ?? storage.read(path, "page");
85
- if (!itemNode) return [];
86
- addedNodePaths.add(itemNode.file.path);
73
+ const path = resolveName(joinPath(folderPath, filename), "page");
74
+ restNodePaths.delete(path);
87
75
  if (isExcept) return [];
88
- if ("children" in itemNode) {
89
- const node = buildFolderNode(itemNode, false, ctx);
90
- return isExtract ? node.children : [node];
76
+ const dirNode = buildFolderNode(path, false, ctx);
77
+ if (dirNode) {
78
+ return isExtract ? dirNode.children : [dirNode];
91
79
  }
92
- return [buildFileNode(itemNode, ctx)];
80
+ const fileNode = buildFileNode(path, ctx);
81
+ return fileNode ? [fileNode] : [];
93
82
  }
94
- function buildFolderNode(folder, isGlobalRoot, ctx) {
95
- const { storage, localeStorage, options } = ctx;
96
- const metaPath = joinPath(folder.file.path, "meta");
97
- const meta = localeStorage?.read(metaPath, "meta") ?? storage.read(metaPath, "meta");
98
- const indexPath = joinPath(folder.file.path, "index");
99
- const indexFile = localeStorage?.read(indexPath, "page") ?? storage.read(indexPath, "page");
83
+ function buildFolderNode(folderPath, isGlobalRoot, ctx) {
84
+ const { storage, localeStorage, options, resolveName } = ctx;
85
+ const files = storage.readDir(folderPath);
86
+ if (!files) return;
87
+ const metaPath = resolveName(joinPath(folderPath, "meta"), "meta");
88
+ const indexPath = resolveName(joinPath(folderPath, "index"), "page");
89
+ let meta = localeStorage?.read(metaPath) ?? storage.read(metaPath);
90
+ if (meta?.format !== "meta") {
91
+ meta = void 0;
92
+ }
100
93
  const isRoot = meta?.data.root ?? isGlobalRoot;
101
- let index;
94
+ let indexDisabled = false;
102
95
  let children;
103
96
  if (!meta?.data.pages) {
104
- if (indexFile) index = buildFileNode(indexFile, ctx);
105
- children = buildAll(folder.children, ctx, (node2) => {
106
- return node2.file.name !== "index" || isRoot;
107
- });
97
+ children = buildAll(files, ctx, (file) => isRoot || file !== indexPath);
108
98
  } else {
109
- const addedNodePaths = /* @__PURE__ */ new Set();
110
- const resolved = meta.data.pages.flatMap((item, i) => resolveFolderItem(folder, item, ctx, i, addedNodePaths));
111
- if (indexFile && (isRoot || !addedNodePaths.has(indexFile.file.path))) {
112
- index = buildFileNode(indexFile, ctx);
99
+ const restItems = new Set(files);
100
+ const resolved = meta.data.pages.flatMap((item, i) => resolveFolderItem(folderPath, item, ctx, i, restItems));
101
+ if (!isRoot && !restItems.has(indexPath)) {
102
+ indexDisabled = true;
113
103
  }
114
104
  for (let i = 0; i < resolved.length; i++) {
115
- if (resolved[i] === rest || resolved[i] === restReversed) {
116
- resolved.splice(
117
- i,
118
- 1,
119
- ...buildAll(
120
- folder.children,
121
- ctx,
122
- (node2) => {
123
- if (node2.file.name === "index" && !isRoot) return false;
124
- return !addedNodePaths.has(node2.file.path);
125
- },
126
- resolved[i] === restReversed
127
- )
128
- );
129
- break;
130
- }
105
+ const item = resolved[i];
106
+ if (item !== rest && item !== restReversed) continue;
107
+ const items = buildAll(
108
+ files,
109
+ ctx,
110
+ // index files are not included in ... unless it's a root folder
111
+ (file) => (file !== indexPath || isRoot) && restItems.has(file),
112
+ item === restReversed
113
+ );
114
+ resolved.splice(i, 1, ...items);
115
+ break;
131
116
  }
132
117
  children = resolved;
133
118
  }
119
+ const index = !indexDisabled ? buildFileNode(indexPath, ctx) : void 0;
120
+ let name = meta?.data.title ?? index?.name;
121
+ if (!name) {
122
+ const folderName = basename(folderPath);
123
+ name = pathToName(group.exec(folderName)?.[1] ?? folderName);
124
+ }
134
125
  const node = {
135
126
  type: "folder",
136
- name: meta?.data.title ?? index?.name ?? // resolve folder groups like (group_name)
137
- pathToName(group.exec(folder.file.name)?.[1] ?? folder.file.name),
127
+ name,
138
128
  icon: options.resolveIcon?.(meta?.data.icon) ?? index?.icon,
139
129
  root: meta?.data.root,
140
130
  defaultOpen: meta?.data.defaultOpen,
141
131
  description: meta?.data.description,
142
132
  index,
143
133
  children,
144
- $id: folder.file.path,
134
+ $id: folderPath,
145
135
  $ref: !options.noRef && meta ? {
146
136
  metaFile: metaPath
147
137
  } : void 0
148
138
  };
149
- return options.attachFolder?.(node, folder, meta) ?? node;
139
+ return options.attachFolder?.(
140
+ node,
141
+ {
142
+ get children() {
143
+ return files.flatMap((file) => storage.read(file) ?? []);
144
+ }
145
+ },
146
+ meta
147
+ ) ?? node;
150
148
  }
151
- function buildFileNode(page, { options, getUrl, locale }) {
152
- const file = page.file;
153
- const { slugs, data } = page.data;
149
+ function buildFileNode(path, { options, getUrl, storage, localeStorage, locale }) {
150
+ const page = localeStorage?.read(path) ?? storage.read(path);
151
+ if (page?.format !== "page") return;
152
+ const { title, description, icon } = page.data;
154
153
  const item = {
155
- $id: file.path,
154
+ $id: path,
156
155
  type: "page",
157
- name: data.title ?? pathToName(file.name),
158
- description: data.description,
159
- icon: options.resolveIcon?.(data.icon),
160
- url: getUrl(slugs, locale),
156
+ name: title ?? pathToName(basename(path, extname(path))),
157
+ description,
158
+ icon: options.resolveIcon?.(icon),
159
+ url: getUrl(page.slugs, locale),
161
160
  $ref: !options.noRef ? {
162
- file: joinPath(file.dirname, file.name)
161
+ file: path
163
162
  } : void 0
164
163
  };
165
164
  return options.attachFile?.(item, page) ?? item;
166
165
  }
167
166
  function build(ctx) {
168
- const root = ctx.storage.root();
169
- const folder = buildFolderNode(root, true, ctx);
167
+ const folder = buildFolderNode("", true, ctx);
170
168
  return {
171
169
  $id: ctx.locale ?? "root",
172
170
  name: folder.name,
@@ -174,24 +172,45 @@ function build(ctx) {
174
172
  };
175
173
  }
176
174
  function createPageTreeBuilder(getUrl) {
175
+ function createFlattenPathResolver(storage) {
176
+ const map = /* @__PURE__ */ new Map();
177
+ const files = storage.getFiles();
178
+ for (const file of files) {
179
+ const content = storage.read(file);
180
+ const flattenPath = file.substring(0, file.length - extname(file).length);
181
+ map.set(flattenPath + "." + content.format, file);
182
+ }
183
+ return (name, format) => {
184
+ return map.get(name + "." + format);
185
+ };
186
+ }
177
187
  return {
178
188
  build(options) {
189
+ const resolve = createFlattenPathResolver(options.storage);
179
190
  return build({
180
191
  options,
181
192
  builder: this,
182
193
  storage: options.storage,
183
- getUrl
194
+ getUrl,
195
+ resolveName(name, format) {
196
+ return resolve(name, format) ?? name;
197
+ }
184
198
  });
185
199
  },
186
200
  buildI18n({ i18n, ...options }) {
201
+ const storage = options.storages[i18n.defaultLanguage];
202
+ const resolve = createFlattenPathResolver(storage);
187
203
  const entries = i18n.languages.map((lang) => {
188
204
  const tree = build({
189
205
  options,
190
206
  getUrl,
191
207
  builder: this,
192
208
  locale: lang,
193
- storage: options.storages[i18n.defaultLanguage],
194
- localeStorage: options.storages[lang]
209
+ storage,
210
+ localeStorage: options.storages[lang],
211
+ resolveName(name, format) {
212
+ return resolve(name, format) ?? name;
213
+ }
195
214
  });
196
215
  return [lang, tree];
197
216
  });
@@ -209,118 +228,55 @@ function pathToName(name) {
209
228
  return result.join("");
210
229
  }
211
230
 
212
- // src/source/path.ts
213
- function parseFilePath(path) {
214
- const segments = splitPath(slash(path));
215
- const dirname = segments.slice(0, -1).join("/");
216
- let name = segments.at(-1) ?? "";
217
- let ext = "";
218
- const dotIdx = name.lastIndexOf(".");
219
- if (dotIdx !== -1) {
220
- ext = name.substring(dotIdx);
221
- name = name.substring(0, dotIdx);
222
- }
223
- return {
224
- dirname,
225
- name,
226
- path: segments.join("/"),
227
- ext,
228
- get flattenedPath() {
229
- return [dirname, name].filter((p) => p.length > 0).join("/");
230
- }
231
- };
232
- }
233
- function parseFolderPath(path) {
234
- const segments = splitPath(slash(path));
235
- const base = segments.at(-1) ?? "";
236
- return {
237
- dirname: segments.slice(0, -1).join("/"),
238
- name: base,
239
- path: segments.join("/")
240
- };
241
- }
242
- function normalizePath(path) {
243
- const segments = splitPath(slash(path));
244
- if (segments[0] === "." || segments[0] === "..")
245
- throw new Error("It must not start with './' or '../'");
246
- return segments.join("/");
247
- }
248
-
249
231
  // src/source/file-system.ts
250
- var file_system_exports = {};
251
- __export(file_system_exports, {
252
- Storage: () => Storage
253
- });
254
- var Storage = class {
232
+ var FileSystem = class {
255
233
  constructor() {
256
234
  this.files = /* @__PURE__ */ new Map();
257
235
  this.folders = /* @__PURE__ */ new Map();
258
- this.rootFolder = {
259
- file: parseFolderPath(""),
260
- children: []
261
- };
262
- this.folders.set("", this.rootFolder);
236
+ this.folders.set("", []);
237
+ }
238
+ read(path) {
239
+ return this.files.get(path);
263
240
  }
264
241
  /**
265
- * @param path - flattened path
266
- * @param format - file format
242
+ * get the direct children of folder (in virtual file path)
267
243
  */
268
- read(path, format) {
269
- return this.files.get(`${path}.${format}`);
270
- }
271
244
  readDir(path) {
272
245
  return this.folders.get(path);
273
246
  }
274
- root() {
275
- return this.rootFolder;
276
- }
277
- write(path, format, data) {
278
- const node = {
279
- format,
280
- file: parseFilePath(path),
281
- data
282
- };
283
- this.makeDir(node.file.dirname);
284
- this.readDir(node.file.dirname)?.children.push(node);
285
- this.files.set(
286
- joinPath(node.file.dirname, `${node.file.name}.${node.format}`),
287
- node
288
- );
247
+ write(path, file) {
248
+ const dir = dirname(path);
249
+ this.makeDir(dir);
250
+ this.readDir(dir)?.push(path);
251
+ this.files.set(path, file);
289
252
  }
290
- list() {
291
- return Array.from(this.files.values());
253
+ getFiles() {
254
+ return Array.from(this.files.keys());
292
255
  }
293
256
  makeDir(path) {
294
257
  const segments = splitPath(path);
295
258
  for (let i = 0; i < segments.length; i++) {
296
259
  const segment = segments.slice(0, i + 1).join("/");
297
260
  if (this.folders.has(segment)) continue;
298
- const folder = {
299
- file: parseFolderPath(segment),
300
- children: []
301
- };
302
- this.folders.set(folder.file.path, folder);
303
- this.readDir(folder.file.dirname)?.children.push(folder);
261
+ this.folders.set(segment, []);
262
+ this.readDir(dirname(segment))?.push(path);
304
263
  }
305
264
  }
306
265
  };
307
266
 
308
267
  // src/source/load-files.ts
309
- function loadFiles(files, options) {
268
+ function loadFiles(files, buildFile, options) {
310
269
  const { transformers = [] } = options;
311
- const storage = new Storage();
270
+ const storage = new FileSystem();
312
271
  for (const file of files) {
313
272
  const parsedPath = normalizePath(file.path);
314
- if (file.type === "page") {
315
- const slugs = file.slugs ?? options.getSlugs(parseFilePath(parsedPath));
316
- storage.write(parsedPath, file.type, {
317
- slugs,
318
- data: file.data
319
- });
320
- }
321
- if (file.type === "meta") {
322
- storage.write(parsedPath, file.type, file.data);
323
- }
273
+ storage.write(
274
+ parsedPath,
275
+ buildFile({
276
+ ...file,
277
+ path: parsedPath
278
+ })
279
+ );
324
280
  }
325
281
  for (const transformer of transformers) {
326
282
  transformer({
@@ -330,7 +286,7 @@ function loadFiles(files, options) {
330
286
  }
331
287
  return storage;
332
288
  }
333
- function loadFilesI18n(files, options) {
289
+ function loadFilesI18n(files, buildFile, options) {
334
290
  const parser = options.i18n.parser === "dir" ? dirParser : dotParser;
335
291
  const storages = {};
336
292
  for (const lang of options.i18n.languages) {
@@ -345,6 +301,7 @@ function loadFilesI18n(files, options) {
345
301
  }
346
302
  return [];
347
303
  }),
304
+ buildFile,
348
305
  options
349
306
  );
350
307
  }
@@ -368,39 +325,56 @@ function dotParser(path) {
368
325
  }
369
326
  return [path];
370
327
  }
328
+ function normalizePath(path) {
329
+ const segments = splitPath(slash(path));
330
+ if (segments[0] === "." || segments[0] === "..")
331
+ throw new Error("It must not start with './' or '../'");
332
+ return segments.join("/");
333
+ }
371
334
 
372
335
  // src/source/loader.ts
373
336
  function indexPages(storages, getUrl, i18n) {
337
+ const result = {
338
+ // (locale.slugs -> page)
339
+ pages: /* @__PURE__ */ new Map(),
340
+ // (locale.path -> page)
341
+ pathToMeta: /* @__PURE__ */ new Map(),
342
+ // (locale.path -> meta)
343
+ pathToPage: /* @__PURE__ */ new Map()
344
+ };
374
345
  const defaultLanguage = i18n?.defaultLanguage ?? "";
375
- const map = /* @__PURE__ */ new Map();
376
- const fileMapped = /* @__PURE__ */ new WeakMap();
377
- for (const item of storages[defaultLanguage].list()) {
346
+ for (const filePath of storages[defaultLanguage].getFiles()) {
347
+ const item = storages[defaultLanguage].read(filePath);
378
348
  if (item.format === "meta") {
379
- fileMapped.set(item, fileToMeta(item));
349
+ result.pathToMeta.set(
350
+ `${defaultLanguage}.${item.path}`,
351
+ fileToMeta(item)
352
+ );
380
353
  }
381
354
  if (item.format === "page") {
382
355
  const page = fileToPage(item, getUrl, defaultLanguage);
383
- fileMapped.set(item, page);
384
- map.set(`${defaultLanguage}.${page.slugs.join("/")}`, page);
356
+ result.pathToPage.set(`${defaultLanguage}.${item.path}`, page);
357
+ result.pages.set(`${defaultLanguage}.${page.slugs.join("/")}`, page);
385
358
  if (!i18n) continue;
386
- const path = joinPath(item.file.dirname, item.file.name);
387
359
  for (const lang of i18n.languages) {
388
360
  if (lang === defaultLanguage) continue;
389
- const localizedItem = storages[lang].read(path, "page");
390
- const localizedPage = fileToPage(localizedItem ?? item, getUrl, lang);
361
+ const localizedItem = storages[lang].read(filePath);
362
+ const localizedPage = fileToPage(
363
+ localizedItem?.format === "page" ? localizedItem : item,
364
+ getUrl,
365
+ lang
366
+ );
391
367
  if (localizedItem) {
392
- fileMapped.set(localizedItem, localizedPage);
368
+ result.pathToPage.set(`${lang}.${item.path}`, localizedPage);
393
369
  }
394
- map.set(`${lang}.${localizedPage.slugs.join("/")}`, localizedPage);
370
+ result.pages.set(
371
+ `${lang}.${localizedPage.slugs.join("/")}`,
372
+ localizedPage
373
+ );
395
374
  }
396
375
  }
397
376
  }
398
- return {
399
- pages: map,
400
- getResultFromFile(file) {
401
- return fileMapped.get(file);
402
- }
403
- };
377
+ return result;
404
378
  }
405
379
  function createGetUrl(baseUrl, i18n) {
406
380
  const baseSlugs = baseUrl.split("/");
@@ -438,18 +412,31 @@ function createOutput(options) {
438
412
  const defaultLanguage = i18n?.defaultLanguage ?? "";
439
413
  const getUrl = options.url ?? createGetUrl(options.baseUrl ?? "/", options.i18n);
440
414
  const files = typeof source.files === "function" ? source.files() : source.files;
441
- const storages = i18n ? loadFilesI18n(files, {
415
+ function buildFile(file) {
416
+ if (file.type === "page") {
417
+ return {
418
+ format: "page",
419
+ path: file.path,
420
+ slugs: file.slugs ?? slugsFn(parseFilePath(file.path)),
421
+ data: file.data,
422
+ absolutePath: file.absolutePath ?? ""
423
+ };
424
+ }
425
+ return {
426
+ format: "meta",
427
+ path: file.path,
428
+ absolutePath: file.absolutePath ?? "",
429
+ data: file.data
430
+ };
431
+ }
432
+ const storages = i18n ? loadFilesI18n(files, buildFile, {
433
+ ...options,
442
434
  i18n: {
443
435
  ...i18n,
444
436
  parser: i18n.parser ?? "dot"
445
- },
446
- transformers: options.transformers,
447
- getSlugs: slugsFn
437
+ }
448
438
  }) : {
449
- "": loadFiles(files, {
450
- transformers: options.transformers,
451
- getSlugs: slugsFn
452
- })
439
+ "": loadFiles(files, buildFile, options)
453
440
  };
454
441
  const walker = indexPages(storages, getUrl, i18n);
455
442
  const builder = createPageTreeBuilder(getUrl);
@@ -516,14 +503,12 @@ function createOutput(options) {
516
503
  getNodeMeta(node, language = defaultLanguage) {
517
504
  const ref = node.$ref?.metaFile;
518
505
  if (!ref) return;
519
- const file = storages[language].read(ref, "meta");
520
- if (file) return walker.getResultFromFile(file);
506
+ return walker.pathToMeta.get(`${language}.${ref}`);
521
507
  },
522
508
  getNodePage(node, language = defaultLanguage) {
523
509
  const ref = node.$ref?.file;
524
510
  if (!ref) return;
525
- const file = storages[language].read(ref, "page");
526
- if (file) return walker.getResultFromFile(file);
511
+ return walker.pathToPage.get(`${language}.${ref}`);
527
512
  },
528
513
  getPageTree(locale) {
529
514
  if (options.i18n) {
@@ -549,21 +534,29 @@ function createOutput(options) {
549
534
  }
550
535
  function fileToMeta(file) {
551
536
  return {
552
- file: file.file,
537
+ path: file.path,
538
+ absolutePath: file.absolutePath,
539
+ get file() {
540
+ return parseFilePath(this.path);
541
+ },
553
542
  data: file.data
554
543
  };
555
544
  }
556
545
  function fileToPage(file, getUrl, locale) {
557
546
  return {
558
- file: file.file,
559
- url: getUrl(file.data.slugs, locale),
560
- slugs: file.data.slugs,
561
- data: file.data.data,
547
+ get file() {
548
+ return parseFilePath(this.path);
549
+ },
550
+ absolutePath: file.absolutePath,
551
+ path: file.path,
552
+ url: getUrl(file.slugs, locale),
553
+ slugs: file.slugs,
554
+ data: file.data,
562
555
  locale
563
556
  };
564
557
  }
565
558
  export {
566
- file_system_exports as FileSystem,
559
+ FileSystem,
567
560
  createGetUrl,
568
561
  createPageTreeBuilder,
569
562
  getSlugs,
@@ -3,7 +3,6 @@ import {
3
3
  searchSimple
4
4
  } from "./chunk-WFUH5VBX.js";
5
5
  import "./chunk-KAOEMCTI.js";
6
- import "./chunk-MLKGABMK.js";
7
6
 
8
7
  // src/search/client/static.ts
9
8
  import { create, load } from "@orama/orama";
package/dist/toc.js CHANGED
@@ -2,7 +2,6 @@
2
2
  import {
3
3
  useOnChange
4
4
  } from "./chunk-EMWGTXSW.js";
5
- import "./chunk-MLKGABMK.js";
6
5
 
7
6
  // src/toc.tsx
8
7
  import { createContext, forwardRef, useContext, useMemo, useRef } from "react";
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import "../chunk-MLKGABMK.js";
3
2
 
4
3
  // src/utils/use-effect-event.ts
5
4
  import { useCallback, useRef } from "react";
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  useMediaQuery
3
3
  } from "../chunk-EP5LHGDZ.js";
4
- import "../chunk-MLKGABMK.js";
5
4
  export {
6
5
  useMediaQuery
7
6
  };
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  useOnChange
3
3
  } from "../chunk-EMWGTXSW.js";
4
- import "../chunk-MLKGABMK.js";
5
4
  export {
6
5
  useOnChange
7
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "15.5.1",
3
+ "version": "15.5.3",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -87,37 +87,37 @@
87
87
  "dependencies": {
88
88
  "@formatjs/intl-localematcher": "^0.6.1",
89
89
  "@orama/orama": "^3.1.6",
90
- "@shikijs/rehype": "^3.4.2",
91
- "@shikijs/transformers": "^3.4.2",
90
+ "@shikijs/rehype": "^3.6.0",
91
+ "@shikijs/transformers": "^3.6.0",
92
92
  "github-slugger": "^2.0.0",
93
93
  "hast-util-to-estree": "^3.1.3",
94
94
  "hast-util-to-jsx-runtime": "^2.3.6",
95
95
  "image-size": "^2.0.2",
96
96
  "negotiator": "^1.0.0",
97
- "react-remove-scroll": "^2.6.3",
97
+ "react-remove-scroll": "^2.7.1",
98
98
  "remark": "^15.0.0",
99
99
  "remark-gfm": "^4.0.1",
100
100
  "remark-rehype": "^11.1.2",
101
101
  "scroll-into-view-if-needed": "^3.1.0",
102
- "shiki": "^3.4.2",
102
+ "shiki": "^3.6.0",
103
103
  "unist-util-visit": "^5.0.0"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@mdx-js/mdx": "^3.1.0",
107
107
  "@oramacloud/client": "^2.1.4",
108
- "@tanstack/react-router": "^1.120.12",
108
+ "@tanstack/react-router": "^1.121.2",
109
109
  "@types/estree-jsx": "^1.0.5",
110
110
  "@types/hast": "^3.0.4",
111
111
  "@types/mdast": "^4.0.3",
112
- "@types/negotiator": "^0.6.3",
113
- "@types/node": "22.15.28",
114
- "@types/react": "^19.1.6",
115
- "@types/react-dom": "^19.1.5",
116
- "algoliasearch": "5.25.0",
112
+ "@types/negotiator": "^0.6.4",
113
+ "@types/node": "24.0.1",
114
+ "@types/react": "^19.1.8",
115
+ "@types/react-dom": "^19.1.6",
116
+ "algoliasearch": "5.27.0",
117
117
  "mdast-util-mdx-jsx": "^3.2.0",
118
118
  "mdast-util-mdxjs-esm": "^2.0.1",
119
119
  "next": "^15.3.3",
120
- "react-router": "^7.6.1",
120
+ "react-router": "^7.6.2",
121
121
  "remark-mdx": "^3.1.0",
122
122
  "typescript": "^5.8.3",
123
123
  "unified": "^11.0.5",
@@ -130,9 +130,13 @@
130
130
  "algoliasearch": "5.x.x",
131
131
  "next": "14.x.x || 15.x.x",
132
132
  "react": "18.x.x || 19.x.x",
133
- "react-dom": "18.x.x || 19.x.x"
133
+ "react-dom": "18.x.x || 19.x.x",
134
+ "@types/react": "*"
134
135
  },
135
136
  "peerDependenciesMeta": {
137
+ "@types/react": {
138
+ "optional": true
139
+ },
136
140
  "@oramacloud/client": {
137
141
  "optional": true
138
142
  },
@@ -1,9 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- export {
8
- __export
9
- };