fumadocs-core 16.9.3 → 16.10.1

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 (54) hide show
  1. package/dist/{advanced-BJ-uurHJ.js → advanced-BnqbPavQ.js} +1 -1
  2. package/dist/content/md.d.ts +1 -2
  3. package/dist/content/mdx/preset-bundler.d.ts +2 -2
  4. package/dist/content/mdx/preset-runtime.d.ts +2 -2
  5. package/dist/content/toc.d.ts +1 -1
  6. package/dist/dynamic-link.d.ts +1 -2
  7. package/dist/framework/index.d.ts +3 -4
  8. package/dist/framework/next.d.ts +1 -2
  9. package/dist/framework/react-router.d.ts +1 -2
  10. package/dist/framework/tanstack.d.ts +1 -2
  11. package/dist/framework/waku.d.ts +1 -2
  12. package/dist/highlight/index.d.ts +1 -2
  13. package/dist/i18n/index.d.ts +2 -2
  14. package/dist/i18n/index.js +27 -47
  15. package/dist/i18n/middleware.d.ts +1 -1
  16. package/dist/i18n/middleware.js +2 -2
  17. package/dist/index-B799MJOL.d.ts +88 -0
  18. package/dist/{index-BPRluZaH2.d.ts → index-nPog1Bvz2.d.ts} +1 -1
  19. package/dist/link.d.ts +2 -3
  20. package/dist/{loader-CfOmE00t.js → loader-DrgsG18J.js} +1 -2
  21. package/dist/mdx-plugins/index.d.ts +3 -3
  22. package/dist/mdx-plugins/index.js +1 -1
  23. package/dist/mdx-plugins/rehype-code.core.d.ts +1 -1
  24. package/dist/mdx-plugins/rehype-code.core.js +1 -1
  25. package/dist/mdx-plugins/rehype-code.d.ts +2 -2
  26. package/dist/mdx-plugins/rehype-code.js +1 -1
  27. package/dist/mdx-plugins/remark-gfm.d.ts +1 -1
  28. package/dist/mdx-plugins/remark-heading.d.ts +1 -1
  29. package/dist/{rehype-code-BNJw67V5.d.ts → rehype-code-D3QFMPaV.d.ts} +1 -3
  30. package/dist/{rehype-code.core-BIWwPy31.js → rehype-code.core-Bayfuz65.js} +13 -1
  31. package/dist/{remark-heading-Z2FTpR_r.d.ts → remark-heading-DkG12uAs.d.ts} +1 -1
  32. package/dist/remove-undefined-CzMSKybq.js +24 -0
  33. package/dist/search/client/orama-cloud-legacy.js +1 -1
  34. package/dist/search/client/orama-cloud.js +1 -1
  35. package/dist/search/client/orama-static.js +1 -1
  36. package/dist/search/client.d.ts +1 -1
  37. package/dist/search/flexsearch.d.ts +3 -3
  38. package/dist/search/mixedbread.d.ts +1 -1
  39. package/dist/search/server.d.ts +1 -1
  40. package/dist/search/server.js +1 -1
  41. package/dist/{server-CqcelklO.d.ts → server-ClZ6JLxh.d.ts} +2 -2
  42. package/dist/source/dynamic.d.ts +1 -1
  43. package/dist/source/dynamic.js +1 -1
  44. package/dist/source/index.d.ts +2 -2
  45. package/dist/source/index.js +1 -1
  46. package/dist/source/llms.d.ts +1 -1
  47. package/dist/source/plugins/lucide-icons.d.ts +1 -1
  48. package/dist/source/plugins/slugs.d.ts +1 -1
  49. package/dist/source/plugins/status-badges.d.ts +1 -1
  50. package/dist/{toc-BISwwvZ_.d.ts → toc-HGr2QC6x.d.ts} +3 -4
  51. package/dist/toc.d.ts +1 -1
  52. package/package.json +22 -18
  53. package/dist/index-CyNuiwqp.d.ts +0 -87
  54. package/dist/remove-undefined-Cxnv4ZZs.js +0 -17
@@ -1,5 +1,5 @@
1
1
  import { createContentHighlighter } from "./search/index.js";
2
- import { t as removeUndefined } from "./remove-undefined-Cxnv4ZZs.js";
2
+ import { t as removeUndefined } from "./remove-undefined-CzMSKybq.js";
3
3
  import { getByID, search } from "@orama/orama";
4
4
  //#region src/search/orama/search/simple.ts
5
5
  async function searchSimple(db, query, params = {}) {
@@ -1,4 +1,3 @@
1
- import * as _$react from "react";
2
1
  import { FC } from "react";
3
2
  import { Options } from "remark-rehype";
4
3
  import { Compatible } from "vfile";
@@ -25,6 +24,6 @@ declare function createMarkdownRenderer({
25
24
  remarkPlugins,
26
25
  remarkRehypeOptions
27
26
  }?: MarkdownRendererOptions): MarkdownRenderer;
28
- declare function Markdown(props: MarkdownProps & MarkdownRendererOptions): _$react.ReactNode | Promise<_$react.ReactNode>;
27
+ declare function Markdown(props: MarkdownProps & MarkdownRendererOptions): import("react").ReactNode | Promise<import("react").ReactNode>;
29
28
  //#endregion
30
29
  export { Markdown, MarkdownProps, MarkdownRenderer, MarkdownRendererOptions, createMarkdownRenderer };
@@ -1,7 +1,7 @@
1
- import { t as RehypeCodeOptions } from "../../rehype-code-BNJw67V5.js";
1
+ import { t as RehypeCodeOptions } from "../../rehype-code-D3QFMPaV.js";
2
2
  import { t as RemarkImageOptions } from "../../remark-image-DGq11tUk.js";
3
3
  import { r as StructureOptions } from "../../remark-structure-DmVL5OkT.js";
4
- import { t as RemarkHeadingOptions } from "../../remark-heading-Z2FTpR_r.js";
4
+ import { t as RemarkHeadingOptions } from "../../remark-heading-DkG12uAs.js";
5
5
  import { t as RemarkCodeTabOptions } from "../../remark-code-tab-C_xwrYzr.js";
6
6
  import { t as RemarkNpmOptions } from "../../remark-npm-DWgfdohc.js";
7
7
  import { t as ResolvePlugins } from "../../util-BiDGK90k.js";
@@ -1,7 +1,7 @@
1
- import { t as RehypeCodeOptions } from "../../rehype-code-BNJw67V5.js";
1
+ import { t as RehypeCodeOptions } from "../../rehype-code-D3QFMPaV.js";
2
2
  import { t as RemarkImageOptions } from "../../remark-image-DGq11tUk.js";
3
3
  import { r as StructureOptions } from "../../remark-structure-DmVL5OkT.js";
4
- import { t as RemarkHeadingOptions } from "../../remark-heading-Z2FTpR_r.js";
4
+ import { t as RemarkHeadingOptions } from "../../remark-heading-DkG12uAs.js";
5
5
  import { t as RemarkCodeTabOptions } from "../../remark-code-tab-C_xwrYzr.js";
6
6
  import { t as RemarkNpmOptions } from "../../remark-npm-DWgfdohc.js";
7
7
  import { t as ResolvePlugins } from "../../util-BiDGK90k.js";
@@ -1,4 +1,4 @@
1
- import { c as TOCItemType } from "../toc-BISwwvZ_.js";
1
+ import { c as TOCItemType } from "../toc-HGr2QC6x.js";
2
2
  import { Compatible } from "vfile";
3
3
  import { PluggableList } from "unified";
4
4
 
@@ -1,5 +1,4 @@
1
1
  import { LinkProps } from "./link.js";
2
- import * as _$react from "react";
3
2
 
4
3
  //#region src/dynamic-link.d.ts
5
4
  type DynamicLinkProps = LinkProps;
@@ -8,7 +7,7 @@ type DynamicLinkProps = LinkProps;
8
7
  *
9
8
  * It supports dynamic hrefs, which means you can use `/[lang]/my-page` with `dynamicHrefs` enabled
10
9
  */
11
- declare const DynamicLink: _$react.ForwardRefExoticComponent<LinkProps & _$react.RefAttributes<HTMLAnchorElement>>;
10
+ declare const DynamicLink: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
12
11
  declare function updateHref(href: string, params: Record<string, string | string[]>): string;
13
12
  //#endregion
14
13
  export { DynamicLink, DynamicLink as default, DynamicLinkProps, updateHref };
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps, FC, ReactNode } from "react";
2
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
2
  import { StaticImport } from "next/dist/shared/lib/get-img-props.js";
4
3
 
5
4
  //#region src/framework/index.d.ts
@@ -39,11 +38,11 @@ declare function FrameworkProvider({
39
38
  children
40
39
  }: Framework & {
41
40
  children: ReactNode;
42
- }): _$react_jsx_runtime0.JSX.Element;
41
+ }): import("react").JSX.Element;
43
42
  declare function usePathname(): string;
44
43
  declare function useRouter(): Router;
45
44
  declare function useParams(): Record<string, string | string[]>;
46
- declare function Image(props: ImageProps): _$react_jsx_runtime0.JSX.Element;
47
- declare function Link(props: LinkProps): _$react_jsx_runtime0.JSX.Element;
45
+ declare function Image(props: ImageProps): import("react").JSX.Element;
46
+ declare function Link(props: LinkProps): import("react").JSX.Element;
48
47
  //#endregion
49
48
  export { Framework, FrameworkProvider, Image, ImageProps, Link, Router, useParams, usePathname, useRouter };
@@ -1,6 +1,5 @@
1
1
  import { Framework } from "./index.js";
2
2
  import { ReactNode } from "react";
3
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
3
 
5
4
  //#region src/framework/next.d.ts
6
5
  declare function NextProvider({
@@ -11,6 +10,6 @@ declare function NextProvider({
11
10
  children: ReactNode;
12
11
  Link?: Framework['Link'];
13
12
  Image?: Framework['Image'];
14
- }): _$react_jsx_runtime0.JSX.Element;
13
+ }): import("react").JSX.Element;
15
14
  //#endregion
16
15
  export { NextProvider };
@@ -1,6 +1,5 @@
1
1
  import { Framework } from "./index.js";
2
2
  import { ReactNode } from "react";
3
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
3
 
5
4
  //#region src/framework/react-router.d.ts
6
5
  declare function ReactRouterProvider({
@@ -11,6 +10,6 @@ declare function ReactRouterProvider({
11
10
  children: ReactNode;
12
11
  Link?: Framework['Link'];
13
12
  Image?: Framework['Image'];
14
- }): _$react_jsx_runtime0.JSX.Element;
13
+ }): import("react").JSX.Element;
15
14
  //#endregion
16
15
  export { ReactRouterProvider };
@@ -1,6 +1,5 @@
1
1
  import { Framework } from "./index.js";
2
2
  import { ReactNode } from "react";
3
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
3
 
5
4
  //#region src/framework/tanstack.d.ts
6
5
  /**
@@ -14,6 +13,6 @@ declare function TanstackProvider({
14
13
  children: ReactNode;
15
14
  Link?: Framework['Link'];
16
15
  Image?: Framework['Image'];
17
- }): _$react_jsx_runtime0.JSX.Element;
16
+ }): import("react").JSX.Element;
18
17
  //#endregion
19
18
  export { TanstackProvider };
@@ -1,6 +1,5 @@
1
1
  import { Framework } from "./index.js";
2
2
  import { ReactNode } from "react";
3
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
3
 
5
4
  //#region src/framework/waku.d.ts
6
5
  declare function WakuProvider({
@@ -11,6 +10,6 @@ declare function WakuProvider({
11
10
  children: ReactNode;
12
11
  Link?: Framework['Link'];
13
12
  Image?: Framework['Image'];
14
- }): _$react_jsx_runtime0.JSX.Element;
13
+ }): import("react").JSX.Element;
15
14
  //#endregion
16
15
  export { WakuProvider };
@@ -1,7 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { Components } from "hast-util-to-jsx-runtime";
3
3
  import { Root } from "hast";
4
- import * as _$shiki from "shiki";
5
4
  import { BundledLanguage, BundledTheme, CodeOptionsMeta, CodeOptionsThemes, CodeToHastOptionsCommon, LanguageRegistration, ThemeRegistrationAny } from "shiki";
6
5
 
7
6
  //#region src/highlight/index.d.ts
@@ -27,7 +26,7 @@ declare function highlightHast(code: string, options: HighlightHastOptions): Pro
27
26
  declare function getHighlighter(engineType: 'js' | 'oniguruma', options?: {
28
27
  langs?: (BundledLanguage | LanguageRegistration)[];
29
28
  themes?: (BundledTheme | ThemeRegistrationAny)[];
30
- }): Promise<_$shiki.HighlighterCore>;
29
+ }): Promise<import("shiki").HighlighterCore>;
31
30
  declare function highlight(code: string, options: HighlightOptions): Promise<ReactNode>;
32
31
  //#endregion
33
32
  export { HighlightHastOptions, HighlightOptions, getHighlighter, highlight, highlightHast };
@@ -1,2 +1,2 @@
1
- import { a as TranslationPreset, c as TranslationsAPIExtension, d as renderTranslation, i as TranslationObject, l as defineI18n, n as I18nConfig, o as TranslationValue, r as SingularTranslationsAPI, s as TranslationsAPI, t as I18nAPI, u as defineTranslations } from "../index-CyNuiwqp.js";
2
- export { I18nAPI, I18nConfig, SingularTranslationsAPI, TranslationObject, TranslationPreset, TranslationValue, TranslationsAPI, TranslationsAPIExtension, defineI18n, defineTranslations, renderTranslation };
1
+ import { a as TranslationPreset, c as defineTranslations, i as TranslationExtension, n as I18nConfig, o as TranslationsAPI, r as SingularTranslationsAPI, s as defineI18n, t as I18nAPI } from "../index-B799MJOL.js";
2
+ export { I18nAPI, I18nConfig, SingularTranslationsAPI, TranslationExtension, TranslationPreset, TranslationsAPI, defineI18n, defineTranslations };
@@ -1,42 +1,35 @@
1
1
  //#region src/i18n/index.ts
2
+ function pickTranslations(full, keys) {
3
+ const result = {};
4
+ for (const k in full) if (keys.has(k)) result[k] = full[k];
5
+ return result;
6
+ }
2
7
  function defineI18n(config) {
3
8
  return {
4
9
  ...config,
5
10
  translations() {
6
11
  const translations = {};
7
- const stagedTranslations = {};
8
- for (const lang of config.languages) {
9
- translations[lang] = {};
10
- stagedTranslations[lang] = {};
11
- }
12
+ const registeredKeys = /* @__PURE__ */ new Set();
13
+ for (const lang of config.languages) translations[lang] = {};
12
14
  return {
13
15
  config,
14
16
  $inferLanguages: void 0,
15
- $inferNamespaces: void 0,
17
+ $inferKeys: void 0,
16
18
  get(lang) {
17
- return translations[lang];
19
+ if (!translations[lang]) return void 0;
20
+ return pickTranslations(translations[lang], registeredKeys);
18
21
  },
19
- preset(lang, preset) {
20
- const t = translations[lang];
21
- const staged = stagedTranslations[lang];
22
- for (const [namespace, obj] of Object.entries(preset.value)) Object.assign(t[namespace] ?? (staged[namespace] ??= {}), obj);
22
+ extend(extension) {
23
+ for (const key of extension.keys) registeredKeys.add(key);
23
24
  return this;
24
25
  },
25
- add(namespace, overrides) {
26
- for (const [lang, values] of Object.entries(overrides)) Object.assign(translations[lang][namespace], values);
26
+ add(...args) {
27
+ const overrides = args.length === 2 ? args[1] : args[0];
28
+ for (const [lang, values] of Object.entries(overrides)) Object.assign(translations[lang] ??= {}, values);
27
29
  return this;
28
30
  },
29
- extend({ namespace, defaultValue }) {
30
- for (const lang of config.languages) {
31
- const t = translations[lang];
32
- const staged = stagedTranslations[lang];
33
- if (t[namespace]) continue;
34
- t[namespace] = {
35
- ...defaultValue,
36
- ...staged[namespace]
37
- };
38
- delete staged[namespace];
39
- }
31
+ preset(lang, preset) {
32
+ Object.assign(translations[lang], preset.value);
40
33
  return this;
41
34
  }
42
35
  };
@@ -46,38 +39,25 @@ function defineI18n(config) {
46
39
  /** create translations API without i18n */
47
40
  function defineTranslations() {
48
41
  const translations = {};
49
- const stagedTranslations = {};
42
+ const registeredKeys = /* @__PURE__ */ new Set();
50
43
  return {
51
- $inferNamespaces: void 0,
44
+ $inferKeys: void 0,
52
45
  get() {
53
- return translations;
46
+ return pickTranslations(translations, registeredKeys);
54
47
  },
55
- preset(preset) {
56
- for (const [namespace, obj] of Object.entries(preset.value)) {
57
- const t = translations[namespace] ?? (stagedTranslations[namespace] ??= {});
58
- Object.assign(t, obj);
59
- }
48
+ extend(extension) {
49
+ for (const key of extension.keys) registeredKeys.add(key);
60
50
  return this;
61
51
  },
62
- add(namespace, overrides) {
63
- Object.assign(translations[namespace], overrides);
52
+ add(...args) {
53
+ Object.assign(translations, args.length === 2 ? args[1] : args[0]);
64
54
  return this;
65
55
  },
66
- extend({ namespace, defaultValue }) {
67
- if (!translations[namespace]) {
68
- translations[namespace] = {
69
- ...defaultValue,
70
- ...stagedTranslations[namespace]
71
- };
72
- delete stagedTranslations[namespace];
73
- }
56
+ preset(preset) {
57
+ Object.assign(translations, preset.value);
74
58
  return this;
75
59
  }
76
60
  };
77
61
  }
78
- function renderTranslation(label, params) {
79
- if (params) for (const k in params) label = label.replaceAll(`{${k}}`, params[k]);
80
- return label;
81
- }
82
62
  //#endregion
83
- export { defineI18n, defineTranslations, renderTranslation };
63
+ export { defineI18n, defineTranslations };
@@ -1,4 +1,4 @@
1
- import { n as I18nConfig } from "../index-CyNuiwqp.js";
1
+ import { n as I18nConfig } from "../index-B799MJOL.js";
2
2
  import { NextProxy } from "next/server.js";
3
3
  import { NextURL } from "next/dist/server/web/next-url.js";
4
4
 
@@ -1,6 +1,6 @@
1
1
  import { t as getNegotiator } from "../negotiation-C6hn0LRz.js";
2
2
  import { NextResponse } from "next/server.js";
3
- //#region ../../node_modules/.pnpm/@formatjs+fast-memoize@3.1.5/node_modules/@formatjs/fast-memoize/index.js
3
+ //#region ../../node_modules/.pnpm/@formatjs+fast-memoize@3.1.6/node_modules/@formatjs/fast-memoize/index.js
4
4
  function memoize(fn, options) {
5
5
  const cache = options && options.cache ? options.cache : cacheDefault;
6
6
  const serializer = options && options.serializer ? options.serializer : serializerDefault;
@@ -56,7 +56,7 @@ const cacheDefault = { create: function create() {
56
56
  return new ObjectWithoutPrototypeCache();
57
57
  } };
58
58
  //#endregion
59
- //#region ../../node_modules/.pnpm/@formatjs+intl-localematcher@0.8.9/node_modules/@formatjs/intl-localematcher/index.js
59
+ //#region ../../node_modules/.pnpm/@formatjs+intl-localematcher@0.8.10/node_modules/@formatjs/intl-localematcher/index.js
60
60
  /**
61
61
  * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
62
62
  * @param locales
@@ -0,0 +1,88 @@
1
+ //#region src/i18n/index.d.ts
2
+ interface I18nConfig<Languages extends string = string> {
3
+ /**
4
+ * Supported locale codes.
5
+ *
6
+ * A page tree will be built for each language.
7
+ */
8
+ languages: Languages[];
9
+ /**
10
+ * Default locale if not specified
11
+ */
12
+ defaultLanguage: NoInfer<Languages>;
13
+ /**
14
+ * Don't show the locale prefix on URL.
15
+ *
16
+ * - `always`: Always hide the prefix
17
+ * - `default-locale`: Only hide the default locale
18
+ * - `never`: Never hide the prefix
19
+ *
20
+ * This API uses `NextResponse.rewrite`.
21
+ *
22
+ * @defaultValue 'never'
23
+ */
24
+ hideLocale?: 'always' | 'default-locale' | 'never';
25
+ /**
26
+ * Used by `loader()`, specify the way to parse i18n file structure.
27
+ *
28
+ * @defaultValue 'dot'
29
+ */
30
+ parser?: 'dot' | 'dir' | 'none';
31
+ /**
32
+ * the fallback language when the page has no translations available for a given locale.
33
+ *
34
+ * Default to `defaultLanguage`, no fallback when set to `null`.
35
+ */
36
+ fallbackLanguage?: NoInfer<Languages> | null;
37
+ }
38
+ interface TranslationExtension<Keys extends string = string> {
39
+ keys: readonly Keys[];
40
+ }
41
+ interface TranslationPreset<Keys extends string = string> {
42
+ name: string;
43
+ value: Partial<Record<Keys, string>>;
44
+ }
45
+ interface TranslationsAPI<Languages extends string = string, Keys extends string = string> {
46
+ /** for type inference only, always `undefined` in runtime */
47
+ $inferLanguages: Languages;
48
+ /** for type inference only, always `undefined` in runtime */
49
+ $inferKeys: Keys;
50
+ config: I18nConfig<Languages>;
51
+ get: {
52
+ (lang: Languages): Partial<Record<Keys, string>>;
53
+ (lang: string): Partial<Record<Keys, string>> | undefined;
54
+ };
55
+ /** register allowed translation keys */
56
+ extend<const NewKeys extends string>(extension: TranslationExtension<NewKeys>): TranslationsAPI<Languages, Keys | NewKeys>;
57
+ /** add translations */
58
+ add(overrides: { [Lang in Languages]?: Partial<Record<Keys, string>> }): TranslationsAPI<Languages, Keys>;
59
+ /** @deprecated the namespace parameter is now unnecessary */
60
+ add(unused: string, overrides: { [Lang in Languages]?: Partial<Record<Keys, string>> & {
61
+ /** @deprecated the label is no longer used */[key: string]: string;
62
+ } }): TranslationsAPI<Languages, Keys>;
63
+ /** add language pack */
64
+ preset: (lang: Languages, preset: TranslationPreset<Keys>) => TranslationsAPI<Languages, Keys>;
65
+ }
66
+ interface I18nAPI<Languages extends string = string> extends I18nConfig<Languages> {
67
+ translations: () => TranslationsAPI<Languages, never>;
68
+ }
69
+ interface SingularTranslationsAPI<Keys extends string = string> {
70
+ /** for type inference only, always `undefined` in runtime */
71
+ $inferKeys: Keys;
72
+ get: () => Partial<Record<Keys, string>>;
73
+ /** register allowed translation keys */
74
+ extend<const NewKeys extends string>(extension: TranslationExtension<NewKeys>): SingularTranslationsAPI<Keys | NewKeys>;
75
+ /** add translations */
76
+ add(overrides: Partial<Record<Keys, string>>): SingularTranslationsAPI<Keys>;
77
+ /** @deprecated the namespace parameter is now unnecessary */
78
+ add(unused: string, overrides: Partial<Record<Keys, string>> & {
79
+ /** @deprecated the label is no longer used */[key: string]: string;
80
+ }): SingularTranslationsAPI<Keys>;
81
+ /** add language pack */
82
+ preset: (preset: TranslationPreset<Keys>) => SingularTranslationsAPI<Keys>;
83
+ }
84
+ declare function defineI18n<const Languages extends string>(config: I18nConfig<Languages>): I18nAPI<Languages>;
85
+ /** create translations API without i18n */
86
+ declare function defineTranslations(): SingularTranslationsAPI<never>;
87
+ //#endregion
88
+ export { TranslationPreset as a, defineTranslations as c, TranslationExtension as i, I18nConfig as n, TranslationsAPI as o, SingularTranslationsAPI as r, defineI18n as s, I18nAPI as t };
@@ -1,7 +1,7 @@
1
1
  import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-DsPo5rZj.js";
2
2
  import { t as Awaitable } from "./types-D89QoQR-.js";
3
3
  import { i as StructuredData } from "./remark-structure-DmVL5OkT.js";
4
- import { n as I18nConfig } from "./index-CyNuiwqp.js";
4
+ import { n as I18nConfig } from "./index-B799MJOL.js";
5
5
  import { n as SerializedPageTree } from "./index-BLKQLw5Y.js";
6
6
  import { ReactNode } from "react";
7
7
 
package/dist/link.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import * as _$react from "react";
2
1
  import { AnchorHTMLAttributes } from "react";
3
2
 
4
3
  //#region src/link.d.ts
@@ -10,10 +9,10 @@ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
10
9
  */
11
10
  external?: boolean;
12
11
  /**
13
- * Prefetch links, supported on Next.js
12
+ * Prefetch links
14
13
  */
15
14
  prefetch?: boolean;
16
15
  }
17
- declare const Link: _$react.ForwardRefExoticComponent<LinkProps & _$react.RefAttributes<HTMLAnchorElement>>;
16
+ declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
18
17
  //#endregion
19
18
  export { LinkProps, Link as default };
@@ -3,7 +3,6 @@ import { c as visit } from "./utils-Dn9VIXRN.js";
3
3
  import { a as normalize, i as joinPath, n as dirname, r as extname, t as basename } from "./path-DOciLMb0.js";
4
4
  import { slugsPlugin } from "./source/plugins/slugs.js";
5
5
  import { t as iconPlugin } from "./icon-BILaoXeg.js";
6
- import path from "node:path";
7
6
  //#region src/source/storage/file-system.ts
8
7
  /**
9
8
  * In memory file system.
@@ -707,7 +706,7 @@ function loader(...args) {
707
706
  resolveHref(href, parent) {
708
707
  if (href.startsWith("./") || href.startsWith("../")) {
709
708
  const target = this.getPageByHref(href, {
710
- dir: path.dirname(parent.path),
709
+ dir: dirname(parent.path),
711
710
  language: parent.locale
712
711
  });
713
712
  if (target) return target.hash ? `${target.page.url}#${target.hash}` : target.page.url;
@@ -1,10 +1,10 @@
1
1
  import { n as remarkGfm, t as RemarkGfmOptions } from "../remark-gfm-DpVfAX1x.js";
2
2
  import { i as transformerTab } from "../rehype-code.core-DPdd_Lza.js";
3
3
  import { r as transformerIcon, t as CodeBlockIcon } from "../transformer-icon-6kKIDVYa.js";
4
- import { n as rehypeCode, r as rehypeCodeDefaultOptions, t as RehypeCodeOptions } from "../rehype-code-BNJw67V5.js";
4
+ import { n as rehypeCode, r as rehypeCodeDefaultOptions, t as RehypeCodeOptions } from "../rehype-code-D3QFMPaV.js";
5
5
  import { n as remarkImage, t as RemarkImageOptions } from "../remark-image-DGq11tUk.js";
6
6
  import { a as defaultStringifier, c as structure, i as StructuredData, n as StringifyOptions, o as remarkStructure, r as StructureOptions, s as remarkStructureDefaultOptions, t as Stringifier } from "../remark-structure-DmVL5OkT.js";
7
- import { n as remarkHeading, t as RemarkHeadingOptions } from "../remark-heading-Z2FTpR_r.js";
7
+ import { n as remarkHeading, t as RemarkHeadingOptions } from "../remark-heading-DkG12uAs.js";
8
8
  import { n as remarkAdmonition, t as RemarkAdmonitionOptions } from "../remark-admonition-B6b741tI.js";
9
9
  import { n as remarkDirectiveAdmonition, t as RemarkDirectiveAdmonitionOptions } from "../remark-directive-admonition-D6bcy8ye.js";
10
10
  import { n as RehypeTocOptions, r as rehypeToc, t as RehypeTOCItemType } from "../rehype-toc-Buwh9Bkg.js";
@@ -16,4 +16,4 @@ import { a as remarkMdxFiles, r as RemarkMdxFilesOptions } from "../remark-mdx-f
16
16
  import { n as remarkMdxMermaid, t as RemarkMdxMermaidOptions } from "../remark-mdx-mermaid-B-Vm8iOc.js";
17
17
  import { n as RemarkFeedbackBlockOptions, r as remarkFeedbackBlock, t as FeedbackBlockProps } from "../remark-feedback-block-DlbKlNCS.js";
18
18
  import { t as LLMsOptions } from "../remark-llms-CDadKewV.js";
19
- export { CodeBlockAttributes, CodeBlockIcon, CodeBlockTabsOptions, FeedbackBlockProps, LLMsOptions, RehypeCodeOptions, RehypeTOCItemType, RehypeTocOptions, RemarkAdmonitionOptions, RemarkCodeTabOptions, RemarkDirectiveAdmonitionOptions, RemarkFeedbackBlockOptions, RemarkGfmOptions, RemarkHeadingOptions, RemarkImageOptions, RemarkMdxFilesOptions, RemarkMdxMermaidOptions, RemarkNpmOptions, RemarkStepsOptions, Stringifier, StringifyOptions, StructureOptions, StructuredData, defaultStringifier, generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkCodeTab, remarkDirectiveAdmonition, remarkFeedbackBlock, remarkGfm, remarkHeading, remarkImage, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkSteps, remarkStructure, remarkStructureDefaultOptions, structure, transformerIcon, transformerTab };
19
+ export { CodeBlockAttributes, type CodeBlockIcon, CodeBlockTabsOptions, FeedbackBlockProps, type LLMsOptions, RehypeCodeOptions, RehypeTOCItemType, RehypeTocOptions, RemarkAdmonitionOptions, RemarkCodeTabOptions, RemarkDirectiveAdmonitionOptions, RemarkFeedbackBlockOptions, type RemarkGfmOptions, RemarkHeadingOptions, RemarkImageOptions, type RemarkMdxFilesOptions, RemarkMdxMermaidOptions, RemarkNpmOptions, RemarkStepsOptions, Stringifier, StringifyOptions, StructureOptions, StructuredData, defaultStringifier, generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkCodeTab, remarkDirectiveAdmonition, remarkFeedbackBlock, remarkGfm, remarkHeading, remarkImage, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkSteps, remarkStructure, remarkStructureDefaultOptions, structure, transformerIcon, transformerTab };
@@ -1,7 +1,7 @@
1
1
  import { remarkHeading } from "./remark-heading.js";
2
2
  import { generateCodeBlockTabs, parseCodeBlockAttributes } from "./codeblock-utils.js";
3
3
  import { remarkGfm } from "./remark-gfm.js";
4
- import { r as transformerTab } from "../rehype-code.core-BIWwPy31.js";
4
+ import { r as transformerTab } from "../rehype-code.core-Bayfuz65.js";
5
5
  import { transformerIcon } from "./transformer-icon.js";
6
6
  import { rehypeCode, rehypeCodeDefaultOptions } from "./rehype-code.js";
7
7
  import { remarkImage } from "./remark-image.js";
@@ -1,3 +1,3 @@
1
1
  import { i as transformerTab, n as createRehypeCode, r as rehypeCodeDefaultOptions, t as RehypeCodeOptionsCommon } from "../rehype-code.core-DPdd_Lza.js";
2
2
  import { r as transformerIcon, t as CodeBlockIcon } from "../transformer-icon-6kKIDVYa.js";
3
- export { CodeBlockIcon, RehypeCodeOptionsCommon, createRehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
3
+ export { type CodeBlockIcon, RehypeCodeOptionsCommon, createRehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
@@ -1,3 +1,3 @@
1
- import { n as rehypeCodeDefaultOptions, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-BIWwPy31.js";
1
+ import { n as rehypeCodeDefaultOptions, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-Bayfuz65.js";
2
2
  import { transformerIcon } from "./transformer-icon.js";
3
3
  export { createRehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
@@ -1,4 +1,4 @@
1
1
  import { i as transformerTab } from "../rehype-code.core-DPdd_Lza.js";
2
2
  import { r as transformerIcon, t as CodeBlockIcon } from "../transformer-icon-6kKIDVYa.js";
3
- import { n as rehypeCode, r as rehypeCodeDefaultOptions, t as RehypeCodeOptions } from "../rehype-code-BNJw67V5.js";
4
- export { CodeBlockIcon, RehypeCodeOptions, rehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
3
+ import { n as rehypeCode, r as rehypeCodeDefaultOptions, t as RehypeCodeOptions } from "../rehype-code-D3QFMPaV.js";
4
+ export { type CodeBlockIcon, RehypeCodeOptions, rehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
@@ -1,5 +1,5 @@
1
1
  import { defaultShikiFactory, wasmShikiFactory } from "../highlight/shiki/full.js";
2
- import { n as rehypeCodeDefaultOptions$1, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-BIWwPy31.js";
2
+ import { n as rehypeCodeDefaultOptions$1, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-Bayfuz65.js";
3
3
  import { transformerIcon } from "./transformer-icon.js";
4
4
  //#region src/mdx-plugins/rehype-code.ts
5
5
  const rehypeCodeDefaultOptions = {
@@ -1,2 +1,2 @@
1
1
  import { n as remarkGfm, t as RemarkGfmOptions } from "../remark-gfm-DpVfAX1x.js";
2
- export { RemarkGfmOptions, remarkGfm };
2
+ export { type RemarkGfmOptions, remarkGfm };
@@ -1,2 +1,2 @@
1
- import { n as remarkHeading, t as RemarkHeadingOptions } from "../remark-heading-Z2FTpR_r.js";
1
+ import { n as remarkHeading, t as RemarkHeadingOptions } from "../remark-heading-DkG12uAs.js";
2
2
  export { RemarkHeadingOptions, remarkHeading };
@@ -1,6 +1,4 @@
1
1
  import { t as RehypeCodeOptionsCommon } from "./rehype-code.core-DPdd_Lza.js";
2
- import * as _$unified from "unified";
3
- import * as _$hast from "hast";
4
2
 
5
3
  //#region src/mdx-plugins/rehype-code.d.ts
6
4
  type RehypeCodeOptions = RehypeCodeOptionsCommon & {
@@ -12,6 +10,6 @@ type RehypeCodeOptions = RehypeCodeOptionsCommon & {
12
10
  engine?: 'js' | 'oniguruma';
13
11
  };
14
12
  declare const rehypeCodeDefaultOptions: RehypeCodeOptions;
15
- declare const rehypeCode: (this: _$unified.Processor, _options?: Partial<RehypeCodeOptions> | undefined) => _$unified.Transformer<_$hast.Root, _$hast.Root>;
13
+ declare const rehypeCode: (this: import("unified").Processor, _options?: Partial<RehypeCodeOptions> | undefined) => import("unified").Transformer<import("hast").Root, import("hast").Root>;
16
14
  //#endregion
17
15
  export { rehypeCode as n, rehypeCodeDefaultOptions as r, RehypeCodeOptions as t };
@@ -115,9 +115,10 @@ function transformerAddLanguage(lang) {
115
115
  };
116
116
  }
117
117
  //#endregion
118
- //#region ../../node_modules/.pnpm/@shikijs+transformers@4.1.0/node_modules/@shikijs/transformers/dist/index.mjs
118
+ //#region ../../node_modules/.pnpm/@shikijs+transformers@4.2.0/node_modules/@shikijs/transformers/dist/index.mjs
119
119
  const RE_SPLIT_COMMENT = /(\s+\/\/)/;
120
120
  const RE_V1_END_COMMENT_PREFIX = /(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/;
121
+ const RE_V3_END_COMMENT_PREFIX = /(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/;
121
122
  /**
122
123
  * some comment formats have to be located at the end of line
123
124
  * hence we can skip matching them for other tokens
@@ -253,6 +254,16 @@ function v1ClearEndCommentPrefix(text) {
253
254
  if (match && match[1].trim().length === 0) return text.slice(0, match.index);
254
255
  return text;
255
256
  }
257
+ /**
258
+ * Remove empty comment prefixes at line end, e.g. `// `
259
+ *
260
+ * For matchAlgorithm v3
261
+ */
262
+ function v3ClearEndCommentPrefix(text) {
263
+ const match = text.match(RE_V3_END_COMMENT_PREFIX);
264
+ if (match && match[1].trim().length === 0) return text.slice(0, match.index).trimEnd();
265
+ return text;
266
+ }
256
267
  function createCommentNotationTransformer(name, regex, onMatch, matchAlgorithm) {
257
268
  matchAlgorithm ??= "v3";
258
269
  return {
@@ -278,6 +289,7 @@ function createCommentNotationTransformer(name, regex, onMatch, matchAlgorithm)
278
289
  });
279
290
  if (!replaced) continue;
280
291
  if (matchAlgorithm === "v1") comment.info[1] = v1ClearEndCommentPrefix(comment.info[1]);
292
+ else if (matchAlgorithm === "v3") comment.info[1] = v3ClearEndCommentPrefix(comment.info[1]);
281
293
  const isEmpty = comment.info[1].trim().length === 0;
282
294
  if (isEmpty) comment.info[1] = "";
283
295
  if (isEmpty && comment.isLineCommentOnly) linesToRemove.push(comment.line);
@@ -1,4 +1,4 @@
1
- import { c as TOCItemType } from "./toc-BISwwvZ_.js";
1
+ import { c as TOCItemType } from "./toc-HGr2QC6x.js";
2
2
  import { Transformer } from "unified";
3
3
  import { Heading, Root } from "mdast";
4
4
 
@@ -0,0 +1,24 @@
1
+ //#region 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 (isPlainObject(entry)) {
9
+ removeUndefined(entry, deep);
10
+ continue;
11
+ }
12
+ if (Array.isArray(entry)) {
13
+ for (const item of entry) if (isPlainObject(item)) removeUndefined(item, deep);
14
+ }
15
+ }
16
+ return value;
17
+ }
18
+ function isPlainObject(value) {
19
+ if (typeof value !== "object" || value === null) return false;
20
+ const prototype = Object.getPrototypeOf(value);
21
+ return prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;
22
+ }
23
+ //#endregion
24
+ export { removeUndefined as t };
@@ -1,5 +1,5 @@
1
1
  import { createContentHighlighter } from "../index.js";
2
- import { t as removeUndefined } from "../../remove-undefined-Cxnv4ZZs.js";
2
+ import { t as removeUndefined } from "../../remove-undefined-CzMSKybq.js";
3
3
  //#region src/search/client/orama-cloud-legacy.ts
4
4
  function oramaCloudLegacyClient(options) {
5
5
  const { index = "default", client, params: extraParams = {}, tag } = options;
@@ -1,5 +1,5 @@
1
1
  import { createContentHighlighter } from "../index.js";
2
- import { t as removeUndefined } from "../../remove-undefined-Cxnv4ZZs.js";
2
+ import { t as removeUndefined } from "../../remove-undefined-CzMSKybq.js";
3
3
  //#region src/search/client/orama-cloud.ts
4
4
  function oramaCloudClient(options) {
5
5
  const { index = "default", client, params: extraParams, tag } = options;
@@ -1,4 +1,4 @@
1
- import { n as searchSimple, t as searchAdvanced } from "../../advanced-BJ-uurHJ.js";
1
+ import { n as searchSimple, t as searchAdvanced } from "../../advanced-BnqbPavQ.js";
2
2
  import { create, load } from "@orama/orama";
3
3
  //#region src/search/client/orama-static.ts
4
4
  const cache = /* @__PURE__ */ new Map();
@@ -1,2 +1,2 @@
1
1
  import { _ as FetchOptions, d as OramaCloudOptions, h as StaticOptions, n as SearchClient, p as AlgoliaOptions, r as useDocsSearch, t as ClientPreset } from "../client-CIcYfa2I.js";
2
- export { AlgoliaOptions, ClientPreset, FetchOptions, OramaCloudOptions, SearchClient, StaticOptions, useDocsSearch };
2
+ export { type AlgoliaOptions, ClientPreset, type FetchOptions, type OramaCloudOptions, SearchClient, type StaticOptions, useDocsSearch };
@@ -1,7 +1,7 @@
1
1
  import { t as Awaitable } from "../types-D89QoQR-.js";
2
- import { n as I18nConfig } from "../index-CyNuiwqp.js";
3
- import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-CqcelklO.js";
4
- import { x as LoaderOutput, y as LoaderConfig } from "../index-BPRluZaH2.js";
2
+ import { n as I18nConfig } from "../index-B799MJOL.js";
3
+ import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-ClZ6JLxh.js";
4
+ import { x as LoaderOutput, y as LoaderConfig } from "../index-nPog1Bvz2.js";
5
5
  import { DocumentData, DocumentOptions } from "flexsearch";
6
6
 
7
7
  //#region src/search/server/build-doc.d.ts
@@ -1,5 +1,5 @@
1
1
  import { r as SortedResult } from "../index-CS7BaeTa.js";
2
- import { n as SearchAPI } from "../server-CqcelklO.js";
2
+ import { n as SearchAPI } from "../server-ClZ6JLxh.js";
3
3
  import Mixedbread from "@mixedbread/sdk";
4
4
  import { StoreSearchResponse } from "@mixedbread/sdk/resources/stores";
5
5
 
@@ -1,2 +1,2 @@
1
- import { a as AdvancedOptions, c as SimpleOptions, d as createSearchAPI, f as initAdvancedSearch, i as AdvancedIndex, l as createFromSource, n as SearchAPI, o as ExportedData, p as initSimpleSearch, r as SearchServer, s as Index, t as QueryOptions, u as createI18nSearchAPI } from "../server-CqcelklO.js";
1
+ import { a as AdvancedOptions, c as SimpleOptions, d as createSearchAPI, f as initAdvancedSearch, i as AdvancedIndex, l as createFromSource, n as SearchAPI, o as ExportedData, p as initSimpleSearch, r as SearchServer, s as Index, t as QueryOptions, u as createI18nSearchAPI } from "../server-ClZ6JLxh.js";
2
2
  export { AdvancedIndex, AdvancedOptions, ExportedData, Index, QueryOptions, SearchAPI, SearchServer, SimpleOptions, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
@@ -1,6 +1,6 @@
1
1
  import { n as defaultReadOptions, t as createEndpoint } from "../endpoint-MyoBU5IC.js";
2
2
  import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-DHR7rjs9.js";
3
- import { n as searchSimple, t as searchAdvanced } from "../advanced-BJ-uurHJ.js";
3
+ import { n as searchSimple, t as searchAdvanced } from "../advanced-BnqbPavQ.js";
4
4
  import { create, insertMultiple, save } from "@orama/orama";
5
5
  //#region src/search/orama/_stemmers.ts
6
6
  const STEMMERS = {
@@ -1,8 +1,8 @@
1
1
  import { t as Awaitable } from "./types-D89QoQR-.js";
2
2
  import { i as StructuredData } from "./remark-structure-DmVL5OkT.js";
3
- import { n as I18nConfig } from "./index-CyNuiwqp.js";
3
+ import { n as I18nConfig } from "./index-B799MJOL.js";
4
4
  import { r as SortedResult } from "./index-CS7BaeTa.js";
5
- import { x as LoaderOutput, y as LoaderConfig } from "./index-BPRluZaH2.js";
5
+ import { x as LoaderOutput, y as LoaderConfig } from "./index-nPog1Bvz2.js";
6
6
  import { Language, Orama, RawData, SearchParams, TypedDocument, create } from "@orama/orama";
7
7
 
8
8
  //#region src/search/orama/create-db.d.ts
@@ -1,2 +1,2 @@
1
- import { g as dynamicLoader, h as DynamicLoaderConfig, m as DynamicLoader } from "../index-BPRluZaH2.js";
1
+ import { g as dynamicLoader, h as DynamicLoaderConfig, m as DynamicLoader } from "../index-nPog1Bvz2.js";
2
2
  export { DynamicLoader, DynamicLoaderConfig, dynamicLoader };
@@ -1,4 +1,4 @@
1
- import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-CfOmE00t.js";
1
+ import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-DrgsG18J.js";
2
2
  import { cache } from "react";
3
3
  //#region src/source/dynamic.ts
4
4
  function dynamicLoader(input, options) {
@@ -1,2 +1,2 @@
1
- import { B as ContentStoragePageFile, C as LoaderPluginOption, D as createGetUrl, E as ResolvedLoaderConfig, F as PageTreeBuilderContext, I as PageTreeOptions, L as PageTreeTransformer, O as loader, P as PageTreeBuilder, R as ContentStorage, S as LoaderPlugin, T as Page, V as FileSystem, _ as InferMetaType, a as MetaData, b as LoaderOptions, c as SourceUnion, d as multiple, f as source, i as DynamicSource, j as getSlugs, k as types_d_exports, l as StaticSource, n as llms, o as PageData, p as update, r as path_d_exports, s as Source, t as LLMsConfig, u as VirtualFile, v as InferPageType, w as Meta, x as LoaderOutput, y as LoaderConfig, z as ContentStorageMetaFile } from "../index-BPRluZaH2.js";
2
- export { ContentStorage, ContentStorageMetaFile, ContentStoragePageFile, DynamicSource, FileSystem, InferMetaType, InferPageType, LLMsConfig, LoaderConfig, LoaderOptions, LoaderOutput, LoaderPlugin, LoaderPluginOption, Meta, MetaData, Page, PageData, PageTreeBuilder, PageTreeBuilderContext, PageTreeOptions, PageTreeTransformer, path_d_exports as PathUtils, ResolvedLoaderConfig, Source, SourceUnion, StaticSource, VirtualFile, types_d_exports as _Internal, createGetUrl, getSlugs, llms, loader, multiple, source, update };
1
+ import { B as ContentStoragePageFile, C as LoaderPluginOption, D as createGetUrl, E as ResolvedLoaderConfig, F as PageTreeBuilderContext, I as PageTreeOptions, L as PageTreeTransformer, O as loader, P as PageTreeBuilder, R as ContentStorage, S as LoaderPlugin, T as Page, V as FileSystem, _ as InferMetaType, a as MetaData, b as LoaderOptions, c as SourceUnion, d as multiple, f as source, i as DynamicSource, j as getSlugs, k as types_d_exports, l as StaticSource, n as llms, o as PageData, p as update, r as path_d_exports, s as Source, t as LLMsConfig, u as VirtualFile, v as InferPageType, w as Meta, x as LoaderOutput, y as LoaderConfig, z as ContentStorageMetaFile } from "../index-nPog1Bvz2.js";
2
+ export { type ContentStorage, type ContentStorageMetaFile, type ContentStoragePageFile, type DynamicSource, FileSystem, InferMetaType, InferPageType, LLMsConfig, LoaderConfig, LoaderOptions, LoaderOutput, LoaderPlugin, LoaderPluginOption, Meta, type MetaData, Page, type PageData, type PageTreeBuilder, type PageTreeBuilderContext, type PageTreeOptions, type PageTreeTransformer, path_d_exports as PathUtils, ResolvedLoaderConfig, type Source, type SourceUnion, type StaticSource, type VirtualFile, type types_d_exports as _Internal, createGetUrl, getSlugs, llms, loader, multiple, source, update };
@@ -1,5 +1,5 @@
1
1
  import { o as path_exports } from "../path-DOciLMb0.js";
2
- import { a as multiple, c as FileSystem, n as loader, o as source, s as update, t as createGetUrl } from "../loader-CfOmE00t.js";
2
+ import { a as multiple, c as FileSystem, n as loader, o as source, s as update, t as createGetUrl } from "../loader-DrgsG18J.js";
3
3
  import { getSlugs } from "./plugins/slugs.js";
4
4
  import { llms } from "./llms.js";
5
5
  export { FileSystem, path_exports as PathUtils, createGetUrl, getSlugs, llms, loader, multiple, source, update };
@@ -1,2 +1,2 @@
1
- import { n as llms, t as LLMsConfig } from "../index-BPRluZaH2.js";
1
+ import { n as llms, t as LLMsConfig } from "../index-nPog1Bvz2.js";
2
2
  export { LLMsConfig, llms };
@@ -1,4 +1,4 @@
1
- import { S as LoaderPlugin } from "../../index-BPRluZaH2.js";
1
+ import { S as LoaderPlugin } from "../../index-nPog1Bvz2.js";
2
2
  import { icons } from "lucide-react";
3
3
 
4
4
  //#region src/source/plugins/lucide-icons.d.ts
@@ -1,2 +1,2 @@
1
- import { A as SlugFn, M as slugsFromData, N as slugsPlugin, j as getSlugs } from "../../index-BPRluZaH2.js";
1
+ import { A as SlugFn, M as slugsFromData, N as slugsPlugin, j as getSlugs } from "../../index-nPog1Bvz2.js";
2
2
  export { SlugFn, getSlugs, slugsFromData, slugsPlugin };
@@ -1,5 +1,5 @@
1
1
  import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-DsPo5rZj.js";
2
- import { S as LoaderPlugin } from "../../index-BPRluZaH2.js";
2
+ import { S as LoaderPlugin } from "../../index-nPog1Bvz2.js";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/source/plugins/status-badges.d.ts
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps, ReactNode, RefObject } from "react";
2
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
2
 
4
3
  //#region src/toc.d.ts
5
4
  interface TOCItemType {
@@ -40,12 +39,12 @@ interface ScrollProviderProps {
40
39
  declare function ScrollProvider({
41
40
  containerRef,
42
41
  children
43
- }: ScrollProviderProps): _$react_jsx_runtime0.JSX.Element;
42
+ }: ScrollProviderProps): import("react").JSX.Element;
44
43
  declare function AnchorProvider({
45
44
  toc,
46
45
  single,
47
46
  children
48
- }: AnchorProviderProps): _$react_jsx_runtime0.JSX.Element;
47
+ }: AnchorProviderProps): import("react").JSX.Element;
49
48
  interface TOCItemProps extends ComponentProps<'a'> {
50
49
  onActiveChange?: (v: boolean) => void;
51
50
  }
@@ -53,7 +52,7 @@ declare function TOCItem({
53
52
  ref,
54
53
  onActiveChange,
55
54
  ...props
56
- }: TOCItemProps): _$react_jsx_runtime0.JSX.Element;
55
+ }: TOCItemProps): import("react").JSX.Element;
57
56
  /** @returns static info object, useful for custom rendering logic */
58
57
  declare function useTOC(): {
59
58
  get(): TOCItemInfo[];
package/dist/toc.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as TOCItem, c as TOCItemType, d as useActiveAnchors, f as useItems, h as useTOCSelector, i as ScrollProviderProps, l as TableOfContents, m as useTOCListener, n as AnchorProviderProps, o as TOCItemInfo, p as useTOC, r as ScrollProvider, s as TOCItemProps, t as AnchorProvider, u as useActiveAnchor } from "./toc-BISwwvZ_.js";
1
+ import { a as TOCItem, c as TOCItemType, d as useActiveAnchors, f as useItems, h as useTOCSelector, i as ScrollProviderProps, l as TableOfContents, m as useTOCListener, n as AnchorProviderProps, o as TOCItemInfo, p as useTOC, r as ScrollProvider, s as TOCItemProps, t as AnchorProvider, u as useActiveAnchor } from "./toc-HGr2QC6x.js";
2
2
  export { AnchorProvider, AnchorProviderProps, ScrollProvider, ScrollProviderProps, TOCItem, TOCItemInfo, TOCItemProps, TOCItemType, TableOfContents, useActiveAnchor, useActiveAnchors, useItems, useTOC, useTOCListener, useTOCSelector };
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.9.3",
3
+ "version": "16.10.1",
4
4
  "description": "The React.js library for building a documentation website",
5
5
  "keywords": [
6
6
  "Docs",
7
7
  "Fumadocs"
8
8
  ],
9
9
  "homepage": "https://fumadocs.dev",
10
+ "bugs": {
11
+ "url": "https://github.com/fuma-nama/fumadocs/issues"
12
+ },
10
13
  "license": "MIT",
11
14
  "author": "Fuma Nama",
12
15
  "repository": "github:fuma-nama/fumadocs",
@@ -96,55 +99,56 @@
96
99
  "access": "public"
97
100
  },
98
101
  "dependencies": {
102
+ "@fuma-translate/react": "^1.0.1",
99
103
  "@orama/orama": "^3.1.18",
100
104
  "estree-util-value-to-estree": "^3.5.0",
101
105
  "github-slugger": "^2.0.0",
102
106
  "hast-util-to-estree": "^3.1.3",
103
107
  "hast-util-to-jsx-runtime": "^2.3.6",
104
- "js-yaml": "^4.1.1",
108
+ "js-yaml": "^4.2.0",
105
109
  "mdast-util-mdx": "^3.0.0",
106
110
  "mdast-util-to-markdown": "^2.1.2",
107
111
  "remark": "^15.0.1",
108
112
  "remark-gfm": "^4.0.1",
109
113
  "remark-rehype": "^11.1.2",
110
114
  "scroll-into-view-if-needed": "^3.1.0",
111
- "shiki": "^4.1.0",
112
- "tinyglobby": "^0.2.16",
115
+ "shiki": "^4.2.0",
116
+ "tinyglobby": "^0.2.17",
113
117
  "unified": "^11.0.5",
114
118
  "unist-util-visit": "^5.1.0",
115
119
  "vfile": "^6.0.3"
116
120
  },
117
121
  "devDependencies": {
118
- "@formatjs/intl-localematcher": "^0.8.9",
122
+ "@formatjs/intl-localematcher": "^0.8.10",
119
123
  "@mdx-js/mdx": "^3.1.1",
120
- "@mixedbread/sdk": "0.72.0",
124
+ "@mixedbread/sdk": "0.73.1",
121
125
  "@orama/core": "^1.2.19",
122
126
  "@oramacloud/client": "^2.1.4",
123
- "@shikijs/transformers": "^4.1.0",
124
- "@tanstack/react-router": "1.170.8",
127
+ "@shikijs/transformers": "^4.2.0",
128
+ "@tanstack/react-router": "1.170.15",
125
129
  "@types/estree-jsx": "^1.0.5",
126
130
  "@types/hast": "^3.0.4",
127
131
  "@types/js-yaml": "^4.0.9",
128
132
  "@types/mdast": "^4.0.4",
129
133
  "@types/negotiator": "^0.6.4",
130
- "@types/node": "25.9.1",
131
- "@types/react": "^19.2.15",
134
+ "@types/node": "25.9.2",
135
+ "@types/react": "^19.2.17",
132
136
  "@types/react-dom": "^19.2.3",
133
- "algoliasearch": "5.52.1",
137
+ "algoliasearch": "5.53.0",
134
138
  "flexsearch": "^0.8.212",
135
139
  "image-size": "^2.0.2",
136
140
  "lucide-react": "^1.17.0",
137
141
  "negotiator": "^1.0.0",
138
- "next": "16.2.6",
142
+ "next": "16.2.9",
139
143
  "npm-to-yarn": "^3.0.1",
140
144
  "path-to-regexp": "^8.4.2",
141
- "react-router": "7.15.1",
145
+ "react-router": "7.17.0",
142
146
  "remark-directive": "^4.0.0",
143
147
  "remark-mdx": "^3.1.1",
144
148
  "remove-markdown": "^0.6.4",
145
- "tsdown": "0.22.0",
149
+ "tsdown": "0.22.2",
146
150
  "typescript": "^6.0.3",
147
- "waku": "1.0.0-beta.1",
151
+ "waku": "1.0.0-beta.2",
148
152
  "zod": "4.4.3",
149
153
  "tsconfig": "0.0.0"
150
154
  },
@@ -225,9 +229,9 @@
225
229
  }
226
230
  },
227
231
  "inlinedDependencies": {
228
- "@formatjs/fast-memoize": "3.1.5",
229
- "@formatjs/intl-localematcher": "0.8.9",
230
- "@shikijs/transformers": "4.1.0",
232
+ "@formatjs/fast-memoize": "3.1.6",
233
+ "@formatjs/intl-localematcher": "0.8.10",
234
+ "@shikijs/transformers": "4.2.0",
231
235
  "image-size": "2.0.2",
232
236
  "negotiator": "1.0.0",
233
237
  "npm-to-yarn": "3.0.1",
@@ -1,87 +0,0 @@
1
- //#region src/i18n/index.d.ts
2
- interface I18nConfig<Languages extends string = string> {
3
- /**
4
- * Supported locale codes.
5
- *
6
- * A page tree will be built for each language.
7
- */
8
- languages: Languages[];
9
- /**
10
- * Default locale if not specified
11
- */
12
- defaultLanguage: NoInfer<Languages>;
13
- /**
14
- * Don't show the locale prefix on URL.
15
- *
16
- * - `always`: Always hide the prefix
17
- * - `default-locale`: Only hide the default locale
18
- * - `never`: Never hide the prefix
19
- *
20
- * This API uses `NextResponse.rewrite`.
21
- *
22
- * @defaultValue 'never'
23
- */
24
- hideLocale?: 'always' | 'default-locale' | 'never';
25
- /**
26
- * Used by `loader()`, specify the way to parse i18n file structure.
27
- *
28
- * @defaultValue 'dot'
29
- */
30
- parser?: 'dot' | 'dir' | 'none';
31
- /**
32
- * the fallback language when the page has no translations available for a given locale.
33
- *
34
- * Default to `defaultLanguage`, no fallback when set to `null`.
35
- */
36
- fallbackLanguage?: NoInfer<Languages> | null;
37
- }
38
- interface I18nAPI<Languages extends string = string> extends I18nConfig<Languages> {
39
- translations: () => TranslationsAPI<Languages, Record<never, TranslationObject>>;
40
- }
41
- declare function defineI18n<const Languages extends string>(config: I18nConfig<Languages>): I18nAPI<Languages>;
42
- type TranslationObject = Record<string, TranslationValue>;
43
- type TranslationValue<Params extends string = string> = string & {
44
- _params?: Params;
45
- };
46
- type TranslationPreset<Namespaces extends Record<string, TranslationObject> = Record<string, TranslationObject>> = {
47
- name: string;
48
- value: Partial<Namespaces>;
49
- };
50
- interface TranslationsAPIExtension<Namespace extends string = string, Obj extends TranslationObject = TranslationObject> {
51
- namespace: Namespace;
52
- defaultValue: Obj;
53
- }
54
- interface TranslationsAPI<Languages extends string = string, Namespaces extends Record<string, TranslationObject> = Record<string, TranslationObject>> {
55
- /** for type inference only, always `undefined` in runtime */
56
- $inferLanguages: Languages;
57
- /** for type inference only, always `undefined` in runtime */
58
- $inferNamespaces: Namespaces;
59
- config: I18nConfig<Languages>;
60
- get: {
61
- (lang: Languages): Namespaces;
62
- (lang: string): Namespaces | undefined;
63
- };
64
- /** add extension, will be ignored if the same extension (namespace) has been registered */
65
- extend: <N extends string, Obj extends TranslationObject>(extension: TranslationsAPIExtension<N, Obj>) => TranslationsAPI<Languages, Namespaces & { [K in N]: Obj }>;
66
- /** add translations */
67
- add: <N extends keyof Namespaces>(namespace: N, overrides: { [Lang in Languages]?: Partial<Namespaces[N]> }) => TranslationsAPI<Languages, Namespaces>;
68
- /** add language pack */
69
- preset: (lang: Languages, preset: TranslationPreset<Namespaces>) => TranslationsAPI<Languages, Namespaces>;
70
- }
71
- interface SingularTranslationsAPI<Namespaces extends Record<string, TranslationObject> = Record<string, TranslationObject>> {
72
- /** for type inference only, always `undefined` in runtime */
73
- $inferNamespaces: Namespaces;
74
- get: () => Namespaces;
75
- /** add extension, will be ignored if the same extension (namespace) has been registered */
76
- extend: <N extends string, Obj extends TranslationObject>(extension: TranslationsAPIExtension<N, Obj>) => SingularTranslationsAPI<Namespaces & { [K in N]: Obj }>;
77
- /** add translations */
78
- add: <N extends keyof Namespaces>(namespace: N, overrides: Partial<Namespaces[N]>) => SingularTranslationsAPI<Namespaces>;
79
- /** add language pack */
80
- preset: (preset: TranslationPreset<Namespaces>) => SingularTranslationsAPI<Namespaces>;
81
- }
82
- /** create translations API without i18n */
83
- declare function defineTranslations(): SingularTranslationsAPI<Record<never, TranslationObject>>;
84
- declare function renderTranslation(v: TranslationValue<never>): string;
85
- declare function renderTranslation<Params extends string>(v: TranslationValue<Params>, params: Record<Params, string>): string;
86
- //#endregion
87
- export { TranslationPreset as a, TranslationsAPIExtension as c, renderTranslation as d, TranslationObject as i, defineI18n as l, I18nConfig as n, TranslationValue as o, SingularTranslationsAPI as r, TranslationsAPI as s, I18nAPI as t, defineTranslations as u };
@@ -1,17 +0,0 @@
1
- //#region 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)) for (const item of entry) removeUndefined(item, deep);
13
- }
14
- return value;
15
- }
16
- //#endregion
17
- export { removeUndefined as t };