fumadocs-core 15.2.8 → 16.0.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.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/dist/algolia-IZEDLPHE.js +58 -0
  3. package/dist/breadcrumb.d.ts +7 -5
  4. package/dist/breadcrumb.js +46 -52
  5. package/dist/builder-feW_xVjc.d.ts +296 -0
  6. package/dist/{chunk-FVY6EZ3N.js → chunk-BBP7MIO4.js} +12 -14
  7. package/dist/{chunk-ORHEEQVY.js → chunk-EMWGTXSW.js} +0 -7
  8. package/dist/chunk-FAEPKD7U.js +20 -0
  9. package/dist/{chunk-NNKVN7WA.js → chunk-H2GMUTQG.js} +4 -2
  10. package/dist/chunk-IZPLHEX4.js +113 -0
  11. package/dist/chunk-OTD7MV33.js +53 -0
  12. package/dist/chunk-PFNP6PEB.js +11 -0
  13. package/dist/{chunk-Y2774T3B.js → chunk-QMATWJ5F.js} +6 -7
  14. package/dist/chunk-U67V476Y.js +35 -0
  15. package/dist/{chunk-BUCUQ3WX.js → chunk-XN2LKXFZ.js} +39 -34
  16. package/dist/{chunk-WFUH5VBX.js → chunk-XOFXGHS4.js} +26 -10
  17. package/dist/chunk-XZSI7AHE.js +67 -0
  18. package/dist/chunk-YVVDKJ2H.js +34 -0
  19. package/dist/chunk-ZMWYLUDP.js +21 -0
  20. package/dist/content/github.d.ts +34 -0
  21. package/dist/content/github.js +43 -0
  22. package/dist/content/index.d.ts +16 -0
  23. package/dist/content/index.js +30 -0
  24. package/dist/{get-toc-Cr2URuiP.d.ts → content/toc.d.ts} +6 -10
  25. package/dist/content/toc.js +21 -0
  26. package/dist/{page-tree-BG3wP0gU.d.ts → definitions-BRsJlZ6m.d.ts} +10 -15
  27. package/dist/dynamic-link.js +3 -3
  28. package/dist/fetch-2XFMBLBA.js +22 -0
  29. package/dist/framework/index.d.ts +1 -1
  30. package/dist/framework/index.js +2 -2
  31. package/dist/framework/next.js +2 -2
  32. package/dist/framework/react-router.js +2 -2
  33. package/dist/framework/tanstack.js +2 -2
  34. package/dist/framework/waku.d.ts +8 -0
  35. package/dist/framework/waku.js +51 -0
  36. package/dist/hide-if-empty.d.ts +18 -0
  37. package/dist/hide-if-empty.js +83 -0
  38. package/dist/highlight/client.d.ts +8 -5
  39. package/dist/highlight/client.js +9 -93
  40. package/dist/highlight/index.d.ts +20 -5
  41. package/dist/highlight/index.js +10 -6
  42. package/dist/i18n/index.d.ts +35 -8
  43. package/dist/i18n/index.js +5 -69
  44. package/dist/i18n/middleware.d.ts +12 -0
  45. package/dist/i18n/middleware.js +63 -0
  46. package/dist/link.js +3 -3
  47. package/dist/mdx-plugins/index.d.ts +124 -18
  48. package/dist/mdx-plugins/index.js +605 -203
  49. package/dist/mixedbread-RAHDVXGJ.js +118 -0
  50. package/dist/negotiation/index.d.ts +19 -0
  51. package/dist/negotiation/index.js +11 -0
  52. package/dist/{orama-cloud-USLSOSXS.js → orama-cloud-WEGQE5A6.js} +37 -27
  53. package/dist/page-tree/index.d.ts +32 -0
  54. package/dist/page-tree/index.js +15 -0
  55. package/dist/remark-code-tab-DmyIyi6m.d.ts +57 -0
  56. package/dist/{remark-structure-FIjTA11P.d.ts → remark-structure-DkCXCzpD.d.ts} +13 -2
  57. package/dist/search/algolia.d.ts +9 -7
  58. package/dist/search/algolia.js +31 -17
  59. package/dist/search/client.d.ts +88 -17
  60. package/dist/search/client.js +71 -50
  61. package/dist/search/index.d.ts +26 -0
  62. package/dist/search/index.js +7 -0
  63. package/dist/search/orama-cloud.d.ts +7 -5
  64. package/dist/search/orama-cloud.js +18 -10
  65. package/dist/search/server.d.ts +33 -25
  66. package/dist/search/server.js +109 -47
  67. package/dist/source/index.d.ts +33 -254
  68. package/dist/source/index.js +532 -353
  69. package/dist/source/plugins/lucide-icons.d.ts +14 -0
  70. package/dist/source/plugins/lucide-icons.js +23 -0
  71. package/dist/static-A2YJ5TXV.js +62 -0
  72. package/dist/toc.d.ts +11 -7
  73. package/dist/toc.js +6 -5
  74. package/dist/utils/use-effect-event.d.ts +4 -3
  75. package/dist/utils/use-effect-event.js +9 -6
  76. package/dist/utils/use-media-query.d.ts +3 -0
  77. package/dist/utils/use-media-query.js +23 -0
  78. package/dist/utils/use-on-change.js +2 -2
  79. package/package.json +92 -40
  80. package/dist/algolia-NTWLS6J3.js +0 -49
  81. package/dist/chunk-KAOEMCTI.js +0 -17
  82. package/dist/chunk-MLKGABMK.js +0 -9
  83. package/dist/chunk-XMCPKVJQ.js +0 -34
  84. package/dist/config-inq6kP6y.d.ts +0 -26
  85. package/dist/fetch-W5EHIBOE.js +0 -21
  86. package/dist/remark-heading-BPCoYwjn.d.ts +0 -31
  87. package/dist/server/index.d.ts +0 -117
  88. package/dist/server/index.js +0 -202
  89. package/dist/sidebar.d.ts +0 -33
  90. package/dist/sidebar.js +0 -89
  91. package/dist/static-VESU2S64.js +0 -61
  92. package/dist/types-Ch8gnVgO.d.ts +0 -8
@@ -0,0 +1,14 @@
1
+ import { L as LoaderPlugin } from '../../builder-feW_xVjc.js';
2
+ import { icons } from 'lucide-react';
3
+ import '../../definitions-BRsJlZ6m.js';
4
+ import 'react';
5
+ import '../../i18n/index.js';
6
+
7
+ /**
8
+ * Convert icon names into Lucide Icons, requires `lucide-react` to be installed.
9
+ */
10
+ declare function lucideIconsPlugin(options?: {
11
+ defaultIcon?: keyof typeof icons;
12
+ }): LoaderPlugin;
13
+
14
+ export { lucideIconsPlugin };
@@ -0,0 +1,23 @@
1
+ import {
2
+ iconPlugin
3
+ } from "../../chunk-FAEPKD7U.js";
4
+ import "../../chunk-U67V476Y.js";
5
+
6
+ // src/source/plugins/lucide-icons.ts
7
+ import { icons } from "lucide-react";
8
+ import { createElement } from "react";
9
+ function lucideIconsPlugin(options = {}) {
10
+ const { defaultIcon } = options;
11
+ return iconPlugin((icon = defaultIcon) => {
12
+ if (icon === void 0) return;
13
+ const Icon = icons[icon];
14
+ if (!icon) {
15
+ console.warn(`[lucide-icons-plugin] Unknown icon detected: ${icon}.`);
16
+ return;
17
+ }
18
+ return createElement(Icon);
19
+ });
20
+ }
21
+ export {
22
+ lucideIconsPlugin
23
+ };
@@ -0,0 +1,62 @@
1
+ import {
2
+ searchAdvanced,
3
+ searchSimple
4
+ } from "./chunk-XOFXGHS4.js";
5
+ import "./chunk-ZMWYLUDP.js";
6
+ import "./chunk-OTD7MV33.js";
7
+ import "./chunk-U67V476Y.js";
8
+
9
+ // src/search/client/static.ts
10
+ import { create, load } from "@orama/orama";
11
+ var cache = /* @__PURE__ */ new Map();
12
+ async function loadDB({
13
+ from = "/api/search",
14
+ initOrama = (locale) => create({ schema: { _: "string" }, language: locale })
15
+ }) {
16
+ const cacheKey = from;
17
+ const cached = cache.get(cacheKey);
18
+ if (cached) return cached;
19
+ async function init() {
20
+ const res = await fetch(from);
21
+ if (!res.ok)
22
+ throw new Error(
23
+ `failed to fetch exported search indexes from ${from}, make sure the search database is exported and available for client.`
24
+ );
25
+ const data = await res.json();
26
+ const dbs = /* @__PURE__ */ new Map();
27
+ if (data.type === "i18n") {
28
+ await Promise.all(
29
+ Object.entries(data.data).map(async ([k, v]) => {
30
+ const db2 = await initOrama(k);
31
+ load(db2, v);
32
+ dbs.set(k, {
33
+ type: v.type,
34
+ db: db2
35
+ });
36
+ })
37
+ );
38
+ return dbs;
39
+ }
40
+ const db = await initOrama();
41
+ load(db, data);
42
+ dbs.set("", {
43
+ type: data.type,
44
+ db
45
+ });
46
+ return dbs;
47
+ }
48
+ const result = init();
49
+ cache.set(cacheKey, result);
50
+ return result;
51
+ }
52
+ async function search(query, options) {
53
+ const { tag, locale } = options;
54
+ const db = (await loadDB(options)).get(locale ?? "");
55
+ if (!db) return [];
56
+ if (db.type === "simple")
57
+ return searchSimple(db, query);
58
+ return searchAdvanced(db.db, query, tag);
59
+ }
60
+ export {
61
+ search
62
+ };
package/dist/toc.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, RefObject, AnchorHTMLAttributes } from 'react';
3
- import { T as TableOfContents } from './get-toc-Cr2URuiP.js';
4
- import 'unified';
5
- import 'vfile';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
4
 
5
+ interface TOCItemType {
6
+ title: ReactNode;
7
+ url: string;
8
+ depth: number;
9
+ }
10
+ type TableOfContents = TOCItemType[];
7
11
  /**
8
12
  * The estimated active heading ID
9
13
  */
@@ -17,7 +21,7 @@ interface AnchorProviderProps {
17
21
  /**
18
22
  * Only accept one active item at most
19
23
  *
20
- * @defaultValue true
24
+ * @defaultValue false
21
25
  */
22
26
  single?: boolean;
23
27
  children?: ReactNode;
@@ -29,12 +33,12 @@ interface ScrollProviderProps {
29
33
  containerRef: RefObject<HTMLElement | null>;
30
34
  children?: ReactNode;
31
35
  }
32
- declare function ScrollProvider({ containerRef, children, }: ScrollProviderProps): React.ReactElement;
33
- declare function AnchorProvider({ toc, single, children, }: AnchorProviderProps): React.ReactElement;
36
+ declare function ScrollProvider({ containerRef, children, }: ScrollProviderProps): react_jsx_runtime.JSX.Element;
37
+ declare function AnchorProvider({ toc, single, children, }: AnchorProviderProps): react_jsx_runtime.JSX.Element;
34
38
  interface TOCItemProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
35
39
  href: string;
36
40
  onActiveChange?: (v: boolean) => void;
37
41
  }
38
42
  declare const TOCItem: react.ForwardRefExoticComponent<TOCItemProps & react.RefAttributes<HTMLAnchorElement>>;
39
43
 
40
- export { AnchorProvider, type AnchorProviderProps, ScrollProvider, type ScrollProviderProps, TOCItem, type TOCItemProps, useActiveAnchor, useActiveAnchors };
44
+ export { AnchorProvider, type AnchorProviderProps, ScrollProvider, type ScrollProviderProps, TOCItem, type TOCItemProps, type TOCItemType, type TableOfContents, useActiveAnchor, useActiveAnchors };
package/dist/toc.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  useOnChange
4
- } from "./chunk-ORHEEQVY.js";
5
- import "./chunk-MLKGABMK.js";
4
+ } from "./chunk-EMWGTXSW.js";
5
+ import "./chunk-U67V476Y.js";
6
6
 
7
7
  // src/toc.tsx
8
8
  import { createContext, forwardRef, useContext, useMemo, useRef } from "react";
@@ -46,8 +46,9 @@ function useAnchorObserver(watch, single) {
46
46
  function onScroll() {
47
47
  const element = document.scrollingElement;
48
48
  if (!element) return;
49
- if (element.scrollTop === 0 && single) setActiveAnchor(watch.slice(0, 1));
50
- else if (element.scrollTop + element.clientHeight >= element.scrollHeight - 6) {
49
+ const top = element.scrollTop;
50
+ if (top <= 0 && single) setActiveAnchor(watch.slice(0, 1));
51
+ else if (top + element.clientHeight >= element.scrollHeight - 6) {
51
52
  setActiveAnchor((active) => {
52
53
  return active.length > 0 && !single ? watch.slice(watch.indexOf(active[0])) : watch.slice(-1);
53
54
  });
@@ -87,7 +88,7 @@ function ScrollProvider({
87
88
  }
88
89
  function AnchorProvider({
89
90
  toc,
90
- single = true,
91
+ single = false,
91
92
  children
92
93
  }) {
93
94
  const headings = useMemo(() => {
@@ -1,8 +1,9 @@
1
+ type UseEffectEvent = <F extends (...params: never[]) => unknown>(callback: F) => F;
1
2
  /**
2
- * Don't use this, could be deleted anytime.
3
+ * Polyfill for React.js 19.2 `useEffectEvent`.
3
4
  *
4
- * @internal
5
+ * @internal Don't use this, could be deleted anytime.
5
6
  */
6
- declare function useEffectEvent<F extends (...params: never[]) => unknown>(callback: F): F;
7
+ declare const useEffectEvent: UseEffectEvent;
7
8
 
8
9
  export { useEffectEvent };
@@ -1,13 +1,16 @@
1
1
  "use client";
2
- import "../chunk-MLKGABMK.js";
2
+ import "../chunk-U67V476Y.js";
3
3
 
4
4
  // src/utils/use-effect-event.ts
5
- import { useCallback, useRef } from "react";
6
- function useEffectEvent(callback) {
7
- const ref = useRef(callback);
5
+ import * as React from "react";
6
+ var useEffectEvent = "useEffectEvent" in React ? { ...React }.useEffectEvent : (callback) => {
7
+ const ref = React.useRef(callback);
8
8
  ref.current = callback;
9
- return useCallback((...params) => ref.current(...params), []);
10
- }
9
+ return React.useCallback(
10
+ ((...params) => ref.current(...params)),
11
+ []
12
+ );
13
+ };
11
14
  export {
12
15
  useEffectEvent
13
16
  };
@@ -0,0 +1,3 @@
1
+ declare function useMediaQuery(query: string, disabled?: boolean): boolean | null;
2
+
3
+ export { useMediaQuery };
@@ -0,0 +1,23 @@
1
+ import "../chunk-U67V476Y.js";
2
+
3
+ // src/utils/use-media-query.ts
4
+ import { useEffect, useState } from "react";
5
+ function useMediaQuery(query, disabled = false) {
6
+ const [isMatch, setMatch] = useState(null);
7
+ useEffect(() => {
8
+ if (disabled) return;
9
+ const mediaQueryList = window.matchMedia(query);
10
+ const handleChange = () => {
11
+ setMatch(mediaQueryList.matches);
12
+ };
13
+ handleChange();
14
+ mediaQueryList.addEventListener("change", handleChange);
15
+ return () => {
16
+ mediaQueryList.removeEventListener("change", handleChange);
17
+ };
18
+ }, [disabled, query]);
19
+ return isMatch;
20
+ }
21
+ export {
22
+ useMediaQuery
23
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  useOnChange
3
- } from "../chunk-ORHEEQVY.js";
4
- import "../chunk-MLKGABMK.js";
3
+ } from "../chunk-EMWGTXSW.js";
4
+ import "../chunk-U67V476Y.js";
5
5
  export {
6
6
  useOnChange
7
7
  };
package/package.json CHANGED
@@ -1,21 +1,17 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "15.2.8",
4
- "description": "The library for building a documentation website in Next.js",
3
+ "version": "16.0.3",
4
+ "description": "The library for building a documentation website in any React.js framework",
5
5
  "keywords": [
6
- "NextJs",
6
+ "Fumadocs",
7
7
  "Docs"
8
8
  ],
9
- "homepage": "https://fumadocs.vercel.app",
9
+ "homepage": "https://fumadocs.dev",
10
10
  "repository": "github:fuma-nama/fumadocs",
11
11
  "license": "MIT",
12
12
  "author": "Fuma Nama",
13
13
  "type": "module",
14
14
  "exports": {
15
- "./sidebar": {
16
- "import": "./dist/sidebar.js",
17
- "types": "./dist/sidebar.d.ts"
18
- },
19
15
  "./breadcrumb": {
20
16
  "import": "./dist/breadcrumb.js",
21
17
  "types": "./dist/breadcrumb.d.ts"
@@ -24,18 +20,42 @@
24
20
  "import": "./dist/toc.js",
25
21
  "types": "./dist/toc.d.ts"
26
22
  },
23
+ "./content": {
24
+ "import": "./dist/content/index.js",
25
+ "types": "./dist/content/index.d.ts"
26
+ },
27
+ "./content/*": {
28
+ "import": "./dist/content/*.js",
29
+ "types": "./dist/content/*.d.ts"
30
+ },
31
+ "./hide-if-empty": {
32
+ "import": "./dist/hide-if-empty.js",
33
+ "types": "./dist/hide-if-empty.d.ts"
34
+ },
35
+ "./negotiation": {
36
+ "import": "./dist/negotiation/index.js",
37
+ "types": "./dist/negotiation/index.d.ts"
38
+ },
39
+ "./page-tree": {
40
+ "import": "./dist/page-tree/index.js",
41
+ "types": "./dist/page-tree/index.d.ts"
42
+ },
43
+ "./search": {
44
+ "import": "./dist/search/index.js",
45
+ "types": "./dist/search/index.d.ts"
46
+ },
27
47
  "./search/*": {
28
48
  "import": "./dist/search/*.js",
29
49
  "types": "./dist/search/*.d.ts"
30
50
  },
31
- "./server": {
32
- "import": "./dist/server/index.js",
33
- "types": "./dist/server/index.d.ts"
34
- },
35
51
  "./source": {
36
52
  "import": "./dist/source/index.js",
37
53
  "types": "./dist/source/index.d.ts"
38
54
  },
55
+ "./source/*": {
56
+ "import": "./dist/source/plugins/*.js",
57
+ "types": "./dist/source/plugins/*.d.ts"
58
+ },
39
59
  "./utils/*": {
40
60
  "import": "./dist/utils/*.js",
41
61
  "types": "./dist/utils/*.d.ts"
@@ -56,6 +76,10 @@
56
76
  "import": "./dist/i18n/index.js",
57
77
  "types": "./dist/i18n/index.d.ts"
58
78
  },
79
+ "./i18n/middleware": {
80
+ "import": "./dist/i18n/middleware.js",
81
+ "types": "./dist/i18n/middleware.d.ts"
82
+ },
59
83
  "./highlight": {
60
84
  "import": "./dist/highlight/index.js",
61
85
  "types": "./dist/highlight/index.d.ts"
@@ -77,56 +101,72 @@
77
101
  "dist/*"
78
102
  ],
79
103
  "dependencies": {
80
- "@formatjs/intl-localematcher": "^0.6.1",
81
- "@orama/orama": "^3.1.6",
82
- "@shikijs/rehype": "^3.2.2",
83
- "@shikijs/transformers": "^3.2.2",
104
+ "@formatjs/intl-localematcher": "^0.6.2",
105
+ "@orama/orama": "^3.1.16",
106
+ "@shikijs/rehype": "^3.13.0",
107
+ "@shikijs/transformers": "^3.13.0",
84
108
  "github-slugger": "^2.0.0",
85
109
  "hast-util-to-estree": "^3.1.3",
86
110
  "hast-util-to-jsx-runtime": "^2.3.6",
87
111
  "image-size": "^2.0.2",
88
112
  "negotiator": "^1.0.0",
89
- "react-remove-scroll": "^2.6.3",
90
- "remark": "^15.0.0",
113
+ "npm-to-yarn": "^3.0.1",
114
+ "path-to-regexp": "^8.3.0",
115
+ "remark": "^15.0.1",
91
116
  "remark-gfm": "^4.0.1",
117
+ "remark-rehype": "^11.1.2",
92
118
  "scroll-into-view-if-needed": "^3.1.0",
93
- "shiki": "^3.2.2",
119
+ "shiki": "^3.13.0",
94
120
  "unist-util-visit": "^5.0.0"
95
121
  },
96
122
  "devDependencies": {
97
- "@algolia/client-search": "4.24.0",
98
- "@mdx-js/mdx": "^3.1.0",
99
- "@oramacloud/client": "^2.1.4",
100
- "@tanstack/react-router": "^1.116.0",
123
+ "@mdx-js/mdx": "^3.1.1",
124
+ "@mixedbread/sdk": "^0.35.1",
125
+ "@orama/core": "^1.2.13",
126
+ "@tanstack/react-router": "^1.133.21",
101
127
  "@types/estree-jsx": "^1.0.5",
102
128
  "@types/hast": "^3.0.4",
103
- "@types/mdast": "^4.0.3",
104
- "@types/negotiator": "^0.6.3",
105
- "@types/node": "22.14.1",
106
- "@types/react": "^19.1.2",
107
- "@types/react-dom": "^19.1.2",
108
- "algoliasearch": "4.24.0",
129
+ "@types/mdast": "^4.0.4",
130
+ "@types/negotiator": "^0.6.4",
131
+ "@types/node": "24.9.1",
132
+ "@types/react": "^19.2.2",
133
+ "@types/react-dom": "^19.2.2",
134
+ "algoliasearch": "5.40.1",
135
+ "lucide-react": "^0.546.0",
109
136
  "mdast-util-mdx-jsx": "^3.2.0",
110
137
  "mdast-util-mdxjs-esm": "^2.0.1",
111
- "next": "^15.3.1",
112
- "react-router": "^7.5.1",
113
- "remark-mdx": "^3.1.0",
114
- "remark-rehype": "^11.1.2",
115
- "typescript": "^5.8.3",
138
+ "next": "16.0.0",
139
+ "react-router": "^7.9.4",
140
+ "remark-mdx": "^3.1.1",
141
+ "remove-markdown": "^0.6.2",
142
+ "typescript": "^5.9.3",
116
143
  "unified": "^11.0.5",
117
144
  "vfile": "^6.0.3",
145
+ "waku": "^0.26.1",
118
146
  "eslint-config-custom": "0.0.0",
119
147
  "tsconfig": "0.0.0"
120
148
  },
121
149
  "peerDependencies": {
122
- "@oramacloud/client": "1.x.x || 2.x.x",
123
- "algoliasearch": "4.24.0",
124
- "next": "14.x.x || 15.x.x",
125
- "react": "18.x.x || 19.x.x",
126
- "react-dom": "18.x.x || 19.x.x"
150
+ "@mixedbread/sdk": "^0.19.0",
151
+ "@orama/core": "1.x.x",
152
+ "@tanstack/react-router": "1.x.x",
153
+ "@types/react": "*",
154
+ "algoliasearch": "5.x.x",
155
+ "lucide-react": "*",
156
+ "next": "16.x.x",
157
+ "react": "^19.2.0",
158
+ "react-dom": "^19.2.0",
159
+ "react-router": "7.x.x",
160
+ "waku": "^0.26.0"
127
161
  },
128
162
  "peerDependenciesMeta": {
129
- "@oramacloud/client": {
163
+ "@mixedbread/sdk": {
164
+ "optional": true
165
+ },
166
+ "@types/react": {
167
+ "optional": true
168
+ },
169
+ "@orama/core": {
130
170
  "optional": true
131
171
  },
132
172
  "algoliasearch": {
@@ -140,6 +180,18 @@
140
180
  },
141
181
  "react-dom": {
142
182
  "optional": true
183
+ },
184
+ "react-router": {
185
+ "optional": true
186
+ },
187
+ "waku": {
188
+ "optional": true
189
+ },
190
+ "@tanstack/react-router": {
191
+ "optional": true
192
+ },
193
+ "lucide-react": {
194
+ "optional": true
143
195
  }
144
196
  },
145
197
  "publishConfig": {
@@ -1,49 +0,0 @@
1
- import "./chunk-MLKGABMK.js";
2
-
3
- // src/search/client/algolia.ts
4
- function groupResults(hits) {
5
- const grouped = [];
6
- const scannedUrls = /* @__PURE__ */ new Set();
7
- for (const hit of hits) {
8
- if (!scannedUrls.has(hit.url)) {
9
- scannedUrls.add(hit.url);
10
- grouped.push({
11
- id: hit.url,
12
- type: "page",
13
- url: hit.url,
14
- content: hit.title
15
- });
16
- }
17
- grouped.push({
18
- id: hit.objectID,
19
- type: hit.content === hit.section ? "heading" : "text",
20
- url: hit.section_id ? `${hit.url}#${hit.section_id}` : hit.url,
21
- content: hit.content
22
- });
23
- }
24
- return grouped;
25
- }
26
- async function searchDocs(index, query, tag, options) {
27
- let filters = options?.filters;
28
- if (tag) filters = filters ? `tag:${tag} AND (${filters})` : `tag:${tag}`;
29
- if (query.length === 0) {
30
- const result2 = await index.search(query, {
31
- distinct: 1,
32
- hitsPerPage: 8,
33
- ...options,
34
- filters
35
- });
36
- return groupResults(result2.hits).filter((hit) => hit.type === "page");
37
- }
38
- const result = await index.search(query, {
39
- distinct: 5,
40
- hitsPerPage: 10,
41
- ...options,
42
- filters
43
- });
44
- return groupResults(result.hits);
45
- }
46
- export {
47
- groupResults,
48
- searchDocs
49
- };
@@ -1,17 +0,0 @@
1
- // src/utils/remove-undefined.ts
2
- function removeUndefined(value, deep = false) {
3
- const obj = value;
4
- for (const key of Object.keys(obj)) {
5
- if (obj[key] === void 0) delete obj[key];
6
- if (deep && typeof obj[key] === "object" && obj[key] !== null) {
7
- removeUndefined(obj[key], deep);
8
- } else if (deep && Array.isArray(obj[key])) {
9
- obj[key].forEach((v) => removeUndefined(v, deep));
10
- }
11
- }
12
- return value;
13
- }
14
-
15
- export {
16
- removeUndefined
17
- };
@@ -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
- };
@@ -1,34 +0,0 @@
1
- // src/utils/path.ts
2
- function splitPath(path) {
3
- return path.split("/").filter((p) => p.length > 0);
4
- }
5
- function joinPath(...paths) {
6
- const out = [];
7
- const parsed = paths.flatMap(splitPath);
8
- while (parsed.length > 0) {
9
- switch (parsed[0]) {
10
- case "..":
11
- out.pop();
12
- break;
13
- case ".":
14
- break;
15
- default:
16
- out.push(parsed[0]);
17
- }
18
- parsed.shift();
19
- }
20
- return out.join("/");
21
- }
22
- function slash(path) {
23
- const isExtendedLengthPath = path.startsWith("\\\\?\\");
24
- if (isExtendedLengthPath) {
25
- return path;
26
- }
27
- return path.replaceAll("\\", "/");
28
- }
29
-
30
- export {
31
- splitPath,
32
- joinPath,
33
- slash
34
- };
@@ -1,26 +0,0 @@
1
- interface I18nConfig {
2
- /**
3
- * Supported locale codes.
4
- *
5
- * A page tree will be built for each language.
6
- */
7
- languages: string[];
8
- /**
9
- * Default locale if not specified
10
- */
11
- defaultLanguage: string;
12
- /**
13
- * Don't show the locale prefix on URL.
14
- *
15
- * - `always`: Always hide the prefix
16
- * - `default-locale`: Only hide the default locale
17
- * - `never`: Never hide the prefix
18
- *
19
- * This API uses `NextResponse.rewrite`.
20
- *
21
- * @defaultValue 'never'
22
- */
23
- hideLocale?: 'always' | 'default-locale' | 'never';
24
- }
25
-
26
- export type { I18nConfig as I };
@@ -1,21 +0,0 @@
1
- import "./chunk-MLKGABMK.js";
2
-
3
- // src/search/client/fetch.ts
4
- var cache = /* @__PURE__ */ new Map();
5
- async function fetchDocs(query, locale, tag, options) {
6
- const params = new URLSearchParams();
7
- params.set("query", query);
8
- if (locale) params.set("locale", locale);
9
- if (tag) params.set("tag", tag);
10
- const key = `${options.api ?? "/api/search"}?${params}`;
11
- const cached = cache.get(key);
12
- if (cached) return cached;
13
- const res = await fetch(key);
14
- if (!res.ok) throw new Error(await res.text());
15
- const result = await res.json();
16
- cache.set(key, result);
17
- return result;
18
- }
19
- export {
20
- fetchDocs
21
- };
@@ -1,31 +0,0 @@
1
- import { Root, Heading } from 'mdast';
2
- import { Transformer } from 'unified';
3
-
4
- declare module 'mdast' {
5
- interface HeadingData extends Data {
6
- hProperties?: {
7
- id?: string;
8
- };
9
- }
10
- }
11
- interface RemarkHeadingOptions {
12
- slug?: (root: Root, heading: Heading, text: string) => string;
13
- /**
14
- * Allow custom headings ids
15
- *
16
- * @defaultValue true
17
- */
18
- customId?: boolean;
19
- /**
20
- * Attach an array of `TOCItemType` to `file.data.toc`
21
- *
22
- * @defaultValue true
23
- */
24
- generateToc?: boolean;
25
- }
26
- /**
27
- * Add heading ids and extract TOC
28
- */
29
- declare function remarkHeading({ slug: defaultSlug, customId, generateToc, }?: RemarkHeadingOptions): Transformer<Root, Root>;
30
-
31
- export { type RemarkHeadingOptions as R, remarkHeading as r };