fumadocs-core 16.4.7 → 16.4.8

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 (255) hide show
  1. package/dist/{advanced-tbtFDsHU.js → advanced-BiZjLx5X.js} +3 -4
  2. package/dist/{algolia-BFVpYDZ_.d.ts → algolia-DWUn4vqa.d.ts} +2 -3
  3. package/dist/{algolia-Dbt0kj8j.js → algolia-IT2aRQE6.js} +2 -3
  4. package/dist/breadcrumb.d.ts +2 -3
  5. package/dist/breadcrumb.js +3 -4
  6. package/dist/{codeblock-utils-CdA7nXLP.d.ts → codeblock-utils-DA5Ql7wp.d.ts} +1 -2
  7. package/dist/content/github.d.ts +1 -2
  8. package/dist/content/github.js +1 -2
  9. package/dist/content/index.d.ts +3 -4
  10. package/dist/content/index.js +1 -2
  11. package/dist/content/mdx/preset-bundler.d.ts +9 -10
  12. package/dist/content/mdx/preset-bundler.js +2 -3
  13. package/dist/content/mdx/preset-runtime.d.ts +9 -10
  14. package/dist/content/mdx/preset-runtime.js +2 -3
  15. package/dist/content/toc.d.ts +1 -2
  16. package/dist/content/toc.js +2 -3
  17. package/dist/{definitions-Ca2P2viV.d.ts → definitions-fBNEDML4.d.ts} +1 -2
  18. package/dist/dynamic-link.d.ts +1 -2
  19. package/dist/dynamic-link.js +1 -2
  20. package/dist/{fetch-CiphcAUR.js → fetch-B9AxBORJ.js} +1 -2
  21. package/dist/framework/index.d.ts +1 -2
  22. package/dist/framework/index.js +1 -2
  23. package/dist/framework/next.d.ts +1 -2
  24. package/dist/framework/next.js +1 -2
  25. package/dist/framework/react-router.d.ts +1 -2
  26. package/dist/framework/react-router.js +1 -2
  27. package/dist/framework/tanstack.d.ts +3 -4
  28. package/dist/framework/tanstack.js +1 -2
  29. package/dist/framework/waku.d.ts +3 -4
  30. package/dist/framework/waku.js +1 -2
  31. package/dist/highlight/client.d.ts +2 -3
  32. package/dist/highlight/client.js +2 -3
  33. package/dist/highlight/index.d.ts +1 -1
  34. package/dist/highlight/index.js +1 -1
  35. package/dist/i18n/index.d.ts +1 -1
  36. package/dist/i18n/index.js +1 -2
  37. package/dist/i18n/middleware.d.ts +2 -3
  38. package/dist/i18n/middleware.js +1 -2
  39. package/dist/{icon-CL3r1pNG.js → icon-D9W4ODUt.js} +1 -2
  40. package/dist/{index-aE27-b16.d.ts → index-Bn_dIR1t.d.ts} +5 -6
  41. package/dist/{index-DxhhLscI.d.ts → index-CNd0mkPr.d.ts} +1 -2
  42. package/dist/{index-BaMZ8PEK.d.ts → index-DbVQNAN8.d.ts} +2 -3
  43. package/dist/{index-CmGSoB4T.d.ts → index-Skpc1DNd.d.ts} +4 -4
  44. package/dist/link.d.ts +3 -4
  45. package/dist/link.js +1 -2
  46. package/dist/{mdast-utils-B8O-41y4.js → mdast-utils-BqE5966y.js} +1 -2
  47. package/dist/mdx-plugins/codeblock-utils.d.ts +1 -1
  48. package/dist/mdx-plugins/codeblock-utils.js +1 -2
  49. package/dist/mdx-plugins/index.d.ts +15 -15
  50. package/dist/mdx-plugins/index.js +4 -4
  51. package/dist/mdx-plugins/rehype-code.d.ts +1 -1
  52. package/dist/mdx-plugins/rehype-code.js +2 -2
  53. package/dist/mdx-plugins/rehype-toc.d.ts +1 -1
  54. package/dist/mdx-plugins/rehype-toc.js +1 -1
  55. package/dist/mdx-plugins/remark-admonition.d.ts +1 -1
  56. package/dist/mdx-plugins/remark-admonition.js +2 -3
  57. package/dist/mdx-plugins/remark-code-tab.d.ts +1 -1
  58. package/dist/mdx-plugins/remark-code-tab.js +1 -2
  59. package/dist/mdx-plugins/remark-directive-admonition.d.ts +1 -1
  60. package/dist/mdx-plugins/remark-directive-admonition.js +1 -2
  61. package/dist/mdx-plugins/remark-feedback-block.d.ts +1 -1
  62. package/dist/mdx-plugins/remark-feedback-block.js +2 -3
  63. package/dist/mdx-plugins/remark-gfm.d.ts +1 -1
  64. package/dist/mdx-plugins/remark-heading.d.ts +1 -1
  65. package/dist/mdx-plugins/remark-heading.js +2 -3
  66. package/dist/mdx-plugins/remark-image.d.ts +1 -1
  67. package/dist/mdx-plugins/remark-image.js +1 -2
  68. package/dist/mdx-plugins/remark-mdx-files.d.ts +1 -1
  69. package/dist/mdx-plugins/remark-mdx-files.js +1 -2
  70. package/dist/mdx-plugins/remark-mdx-mermaid.d.ts +1 -1
  71. package/dist/mdx-plugins/remark-mdx-mermaid.js +1 -2
  72. package/dist/mdx-plugins/remark-npm.d.ts +1 -1
  73. package/dist/mdx-plugins/remark-npm.js +1 -2
  74. package/dist/mdx-plugins/remark-steps.d.ts +1 -1
  75. package/dist/mdx-plugins/remark-steps.js +1 -2
  76. package/dist/mdx-plugins/remark-structure.d.ts +1 -1
  77. package/dist/mdx-plugins/remark-structure.js +2 -3
  78. package/dist/{mixedbread-CPGJEgwq.js → mixedbread-B4x0e8AJ.js} +5 -4
  79. package/dist/negotiation/index.d.ts +1 -2
  80. package/dist/negotiation/index.js +1 -2
  81. package/dist/{normalize-url-CEfNKxaE.js → normalize-url-D88zV54r.js} +1 -2
  82. package/dist/{orama-cloud-yicpgD0c.js → orama-cloud-CiI54EU9.js} +3 -4
  83. package/dist/{orama-cloud-legacy-NJTbB19B.js → orama-cloud-legacy-DG0asrcn.js} +3 -4
  84. package/dist/page-tree/index.d.ts +2 -2
  85. package/dist/page-tree/index.js +1 -1
  86. package/dist/{path-CECfI3nn.js → path-B48ZWv8k.js} +2 -3
  87. package/dist/{rehype-code-Ct5Pb6BZ.js → rehype-code-8Te7jiPm.js} +2 -3
  88. package/dist/{rehype-code-BUrju-yF.d.ts → rehype-code-9wJ_hsjl.d.ts} +1 -2
  89. package/dist/{rehype-toc-Dcgzd_Vy.d.ts → rehype-toc-Bt9Ng_4w.d.ts} +1 -2
  90. package/dist/{rehype-toc-CTG0x7La.js → rehype-toc-CRXB92Tc.js} +1 -2
  91. package/dist/{remark-admonition-BvgS4oU1.d.ts → remark-admonition-DVevS9Wn.d.ts} +1 -2
  92. package/dist/{remark-code-tab-Ds_BdYXz.d.ts → remark-code-tab-DwGhoHpj.d.ts} +1 -2
  93. package/dist/{remark-directive-admonition-02cR5K1L.d.ts → remark-directive-admonition-DA7-ewEx.d.ts} +1 -2
  94. package/dist/{remark-feedback-block-fAyt4LdQ.d.ts → remark-feedback-block-PpERWDdJ.d.ts} +1 -2
  95. package/dist/{remark-heading-CSButCYt.d.ts → remark-heading-B02bkQ09.d.ts} +1 -2
  96. package/dist/{remark-image-C3MnP-3r.d.ts → remark-image-k8SDn3Hf.d.ts} +1 -2
  97. package/dist/{remark-mdx-files-BXUiiX3M.d.ts → remark-mdx-files-DXQKQsPS.d.ts} +1 -2
  98. package/dist/{remark-mdx-mermaid-C5ZBxx8x.d.ts → remark-mdx-mermaid-CzeZXfYX.d.ts} +1 -2
  99. package/dist/{remark-npm-DADZg0pf.d.ts → remark-npm-DS3cHDxB.d.ts} +1 -2
  100. package/dist/{remark-steps-CWEE34cT.d.ts → remark-steps-Bz-6C0tE.d.ts} +1 -2
  101. package/dist/{remark-structure-ChKxMXnK.d.ts → remark-structure-dZprfvCG.d.ts} +1 -2
  102. package/dist/{remove-undefined-Buxsprgu.js → remove-undefined-CiwokjLP.js} +1 -2
  103. package/dist/search/algolia.d.ts +2 -2
  104. package/dist/search/algolia.js +1 -2
  105. package/dist/search/client.d.ts +8 -9
  106. package/dist/search/client.js +7 -8
  107. package/dist/search/index.d.ts +1 -2
  108. package/dist/search/index.js +1 -1
  109. package/dist/search/orama-cloud-legacy.d.ts +6 -7
  110. package/dist/search/orama-cloud-legacy.js +1 -2
  111. package/dist/search/orama-cloud.d.ts +6 -7
  112. package/dist/search/orama-cloud.js +1 -2
  113. package/dist/search/server.d.ts +6 -6
  114. package/dist/search/server.js +5 -6
  115. package/dist/{search-DzqmOjzV.js → search-CBAFoCmV.js} +1 -2
  116. package/dist/{server-CLPpotS9.d.ts → server-BqqfVZaS.d.ts} +4 -5
  117. package/dist/{shiki-B4NO99XD.js → shiki-BMakKE6A.js} +1 -2
  118. package/dist/{shiki-vKy7H_iw.d.ts → shiki-BjMLCq9L.d.ts} +1 -2
  119. package/dist/source/client/index.d.ts +4 -4
  120. package/dist/source/client/index.js +6 -4
  121. package/dist/source/index.d.ts +4 -4
  122. package/dist/source/index.js +108 -59
  123. package/dist/source/plugins/lucide-icons.d.ts +5 -6
  124. package/dist/source/plugins/lucide-icons.js +2 -3
  125. package/dist/source/plugins/slugs.d.ts +4 -4
  126. package/dist/source/plugins/slugs.js +2 -3
  127. package/dist/source/plugins/status-badges.d.ts +53 -0
  128. package/dist/source/plugins/status-badges.js +54 -0
  129. package/dist/source/schema.d.ts +1 -2
  130. package/dist/source/schema.js +1 -2
  131. package/dist/{static-C_WBOzek.js → static-Dg4_dKaf.js} +2 -3
  132. package/dist/toc.d.ts +1 -2
  133. package/dist/toc.js +1 -2
  134. package/dist/{util-d5FlPx1Z.d.ts → util-C1pcIt82.d.ts} +1 -2
  135. package/dist/{util-Dn-wseQ5.js → util-E8U2ttCR.js} +1 -2
  136. package/dist/utils/use-effect-event.d.ts +1 -2
  137. package/dist/utils/use-effect-event.js +1 -2
  138. package/dist/utils/use-media-query.d.ts +1 -2
  139. package/dist/utils/use-media-query.js +1 -2
  140. package/dist/utils/use-on-change.d.ts +1 -2
  141. package/dist/utils/use-on-change.js +1 -2
  142. package/dist/{utils-D10VxgVc.js → utils-BllAiz19.js} +1 -2
  143. package/package.json +13 -13
  144. package/dist/advanced-tbtFDsHU.js.map +0 -1
  145. package/dist/algolia-BFVpYDZ_.d.ts.map +0 -1
  146. package/dist/algolia-Dbt0kj8j.js.map +0 -1
  147. package/dist/breadcrumb.d.ts.map +0 -1
  148. package/dist/breadcrumb.js.map +0 -1
  149. package/dist/codeblock-utils-CdA7nXLP.d.ts.map +0 -1
  150. package/dist/content/github.d.ts.map +0 -1
  151. package/dist/content/github.js.map +0 -1
  152. package/dist/content/index.d.ts.map +0 -1
  153. package/dist/content/index.js.map +0 -1
  154. package/dist/content/mdx/preset-bundler.d.ts.map +0 -1
  155. package/dist/content/mdx/preset-bundler.js.map +0 -1
  156. package/dist/content/mdx/preset-runtime.d.ts.map +0 -1
  157. package/dist/content/mdx/preset-runtime.js.map +0 -1
  158. package/dist/content/toc.d.ts.map +0 -1
  159. package/dist/content/toc.js.map +0 -1
  160. package/dist/definitions-Ca2P2viV.d.ts.map +0 -1
  161. package/dist/dynamic-link.d.ts.map +0 -1
  162. package/dist/dynamic-link.js.map +0 -1
  163. package/dist/fetch-CiphcAUR.js.map +0 -1
  164. package/dist/framework/index.d.ts.map +0 -1
  165. package/dist/framework/index.js.map +0 -1
  166. package/dist/framework/next.d.ts.map +0 -1
  167. package/dist/framework/next.js.map +0 -1
  168. package/dist/framework/react-router.d.ts.map +0 -1
  169. package/dist/framework/react-router.js.map +0 -1
  170. package/dist/framework/tanstack.d.ts.map +0 -1
  171. package/dist/framework/tanstack.js.map +0 -1
  172. package/dist/framework/waku.d.ts.map +0 -1
  173. package/dist/framework/waku.js.map +0 -1
  174. package/dist/highlight/client.d.ts.map +0 -1
  175. package/dist/highlight/client.js.map +0 -1
  176. package/dist/i18n/index.js.map +0 -1
  177. package/dist/i18n/middleware.d.ts.map +0 -1
  178. package/dist/i18n/middleware.js.map +0 -1
  179. package/dist/icon-CL3r1pNG.js.map +0 -1
  180. package/dist/index-BaMZ8PEK.d.ts.map +0 -1
  181. package/dist/index-CmGSoB4T.d.ts.map +0 -1
  182. package/dist/index-DxhhLscI.d.ts.map +0 -1
  183. package/dist/index-aE27-b16.d.ts.map +0 -1
  184. package/dist/link.d.ts.map +0 -1
  185. package/dist/link.js.map +0 -1
  186. package/dist/mdast-utils-B8O-41y4.js.map +0 -1
  187. package/dist/mdx-plugins/codeblock-utils.js.map +0 -1
  188. package/dist/mdx-plugins/remark-admonition.js.map +0 -1
  189. package/dist/mdx-plugins/remark-code-tab.js.map +0 -1
  190. package/dist/mdx-plugins/remark-directive-admonition.js.map +0 -1
  191. package/dist/mdx-plugins/remark-feedback-block.js.map +0 -1
  192. package/dist/mdx-plugins/remark-heading.js.map +0 -1
  193. package/dist/mdx-plugins/remark-image.js.map +0 -1
  194. package/dist/mdx-plugins/remark-mdx-files.js.map +0 -1
  195. package/dist/mdx-plugins/remark-mdx-mermaid.js.map +0 -1
  196. package/dist/mdx-plugins/remark-npm.js.map +0 -1
  197. package/dist/mdx-plugins/remark-steps.js.map +0 -1
  198. package/dist/mdx-plugins/remark-structure.js.map +0 -1
  199. package/dist/mixedbread-CPGJEgwq.js.map +0 -1
  200. package/dist/negotiation/index.d.ts.map +0 -1
  201. package/dist/negotiation/index.js.map +0 -1
  202. package/dist/normalize-url-CEfNKxaE.js.map +0 -1
  203. package/dist/orama-cloud-legacy-NJTbB19B.js.map +0 -1
  204. package/dist/orama-cloud-yicpgD0c.js.map +0 -1
  205. package/dist/path-CECfI3nn.js.map +0 -1
  206. package/dist/rehype-code-BUrju-yF.d.ts.map +0 -1
  207. package/dist/rehype-code-Ct5Pb6BZ.js.map +0 -1
  208. package/dist/rehype-toc-CTG0x7La.js.map +0 -1
  209. package/dist/rehype-toc-Dcgzd_Vy.d.ts.map +0 -1
  210. package/dist/remark-admonition-BvgS4oU1.d.ts.map +0 -1
  211. package/dist/remark-code-tab-Ds_BdYXz.d.ts.map +0 -1
  212. package/dist/remark-directive-admonition-02cR5K1L.d.ts.map +0 -1
  213. package/dist/remark-feedback-block-fAyt4LdQ.d.ts.map +0 -1
  214. package/dist/remark-heading-CSButCYt.d.ts.map +0 -1
  215. package/dist/remark-image-C3MnP-3r.d.ts.map +0 -1
  216. package/dist/remark-mdx-files-BXUiiX3M.d.ts.map +0 -1
  217. package/dist/remark-mdx-mermaid-C5ZBxx8x.d.ts.map +0 -1
  218. package/dist/remark-npm-DADZg0pf.d.ts.map +0 -1
  219. package/dist/remark-steps-CWEE34cT.d.ts.map +0 -1
  220. package/dist/remark-structure-ChKxMXnK.d.ts.map +0 -1
  221. package/dist/remove-undefined-Buxsprgu.js.map +0 -1
  222. package/dist/search/algolia.js.map +0 -1
  223. package/dist/search/client.d.ts.map +0 -1
  224. package/dist/search/client.js.map +0 -1
  225. package/dist/search/index.d.ts.map +0 -1
  226. package/dist/search/orama-cloud-legacy.d.ts.map +0 -1
  227. package/dist/search/orama-cloud-legacy.js.map +0 -1
  228. package/dist/search/orama-cloud.d.ts.map +0 -1
  229. package/dist/search/orama-cloud.js.map +0 -1
  230. package/dist/search/server.js.map +0 -1
  231. package/dist/search-DzqmOjzV.js.map +0 -1
  232. package/dist/server-CLPpotS9.d.ts.map +0 -1
  233. package/dist/shiki-B4NO99XD.js.map +0 -1
  234. package/dist/shiki-vKy7H_iw.d.ts.map +0 -1
  235. package/dist/source/client/index.js.map +0 -1
  236. package/dist/source/index.js.map +0 -1
  237. package/dist/source/plugins/lucide-icons.d.ts.map +0 -1
  238. package/dist/source/plugins/lucide-icons.js.map +0 -1
  239. package/dist/source/plugins/slugs.js.map +0 -1
  240. package/dist/source/schema.d.ts.map +0 -1
  241. package/dist/source/schema.js.map +0 -1
  242. package/dist/static-C_WBOzek.js.map +0 -1
  243. package/dist/toc.d.ts.map +0 -1
  244. package/dist/toc.js.map +0 -1
  245. package/dist/util-Dn-wseQ5.js.map +0 -1
  246. package/dist/util-d5FlPx1Z.d.ts.map +0 -1
  247. package/dist/utils/use-effect-event.d.ts.map +0 -1
  248. package/dist/utils/use-effect-event.js.map +0 -1
  249. package/dist/utils/use-media-query.d.ts.map +0 -1
  250. package/dist/utils/use-media-query.js.map +0 -1
  251. package/dist/utils/use-on-change.d.ts.map +0 -1
  252. package/dist/utils/use-on-change.js.map +0 -1
  253. package/dist/utils-D10VxgVc.js.map +0 -1
  254. /package/dist/{chunk-C9UIFEcR.js → chunk-CQNP8FC4.js} +0 -0
  255. /package/dist/{remark-gfm-jrvaEZw5.d.ts → remark-gfm-Cvcfjik1.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
- import "../remark-gfm-jrvaEZw5.js";
2
- import "../rehype-code-BUrju-yF.js";
3
- import { n as StructuredData } from "../remark-structure-ChKxMXnK.js";
4
- import "../remark-heading-CSButCYt.js";
5
- import "../remark-code-tab-Ds_BdYXz.js";
1
+ import "../remark-gfm-Cvcfjik1.js";
2
+ import "../rehype-code-9wJ_hsjl.js";
3
+ import { n as StructuredData } from "../remark-structure-dZprfvCG.js";
4
+ import "../remark-heading-B02bkQ09.js";
5
+ import "../remark-code-tab-DwGhoHpj.js";
6
6
  import "../mdx-plugins/index.js";
7
7
  import { OramaCloud } from "@orama/core";
8
8
 
@@ -77,5 +77,4 @@ interface OramaIndex {
77
77
  declare function sync(orama: OramaCloud, options: SyncOptions): Promise<void>;
78
78
  declare function syncI18n(orama: OramaCloud, options: I18nSyncOptions): Promise<void>;
79
79
  //#endregion
80
- export { I18nSyncOptions, OramaDocument, OramaIndex, SyncOptions, sync, syncI18n };
81
- //# sourceMappingURL=orama-cloud.d.ts.map
80
+ export { I18nSyncOptions, OramaDocument, OramaIndex, SyncOptions, sync, syncI18n };
@@ -48,5 +48,4 @@ function toIndex(page) {
48
48
  }
49
49
 
50
50
  //#endregion
51
- export { sync, syncI18n };
52
- //# sourceMappingURL=orama-cloud.js.map
51
+ export { sync, syncI18n };
@@ -1,8 +1,8 @@
1
- import "../definitions-Ca2P2viV.js";
2
- import "../remark-structure-ChKxMXnK.js";
3
- import "../index-BaMZ8PEK.js";
1
+ import "../definitions-fBNEDML4.js";
2
+ import "../remark-structure-dZprfvCG.js";
3
+ import "../index-DbVQNAN8.js";
4
4
  import { HighlightedText, ReactSortedResult, SortedResult, createContentHighlighter } from "./index.js";
5
- import { a as Index, c as SimpleOptions, d as initSimpleSearch, f as createI18nSearchAPI, i as ExportedData, l as createSearchAPI, n as AdvancedOptions, o as SearchAPI, p as createFromSource, r as Dynamic, s as SearchServer, t as AdvancedIndex, u as initAdvancedSearch } from "../server-CLPpotS9.js";
6
- import "../index-aE27-b16.js";
7
- import "../index-CmGSoB4T.js";
5
+ import { a as Index, c as SimpleOptions, d as initSimpleSearch, f as createI18nSearchAPI, i as ExportedData, l as createSearchAPI, n as AdvancedOptions, o as SearchAPI, p as createFromSource, r as Dynamic, s as SearchServer, t as AdvancedIndex, u as initAdvancedSearch } from "../server-BqqfVZaS.js";
6
+ import "../index-Bn_dIR1t.js";
7
+ import "../index-Skpc1DNd.js";
8
8
  export { AdvancedIndex, AdvancedOptions, Dynamic, ExportedData, HighlightedText, Index, ReactSortedResult, SearchAPI, SearchServer, SimpleOptions, SortedResult, createContentHighlighter, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
@@ -1,7 +1,7 @@
1
- import { r as findPath } from "../utils-D10VxgVc.js";
2
- import { t as createContentHighlighter } from "../search-DzqmOjzV.js";
3
- import { n as searchSimple, t as searchAdvanced } from "../advanced-tbtFDsHU.js";
4
- import { r as extname, t as basename } from "../path-CECfI3nn.js";
1
+ import { r as findPath } from "../utils-BllAiz19.js";
2
+ import { t as createContentHighlighter } from "../search-CBAFoCmV.js";
3
+ import { n as searchSimple, t as searchAdvanced } from "../advanced-BiZjLx5X.js";
4
+ import { r as extname, t as basename } from "../path-B48ZWv8k.js";
5
5
  import { create, insertMultiple, save } from "@orama/orama";
6
6
 
7
7
  //#region src/search/orama/create-endpoint.ts
@@ -319,5 +319,4 @@ function initAdvancedSearch(options) {
319
319
  }
320
320
 
321
321
  //#endregion
322
- export { createContentHighlighter, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
323
- //# sourceMappingURL=server.js.map
322
+ export { createContentHighlighter, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
@@ -40,5 +40,4 @@ function createContentHighlighter(query) {
40
40
  }
41
41
 
42
42
  //#endregion
43
- export { createContentHighlighter as t };
44
- //# sourceMappingURL=search-DzqmOjzV.js.map
43
+ export { createContentHighlighter as t };
@@ -1,7 +1,7 @@
1
- import { n as StructuredData } from "./remark-structure-ChKxMXnK.js";
2
- import { t as I18nConfig } from "./index-DxhhLscI.js";
1
+ import { n as StructuredData } from "./remark-structure-dZprfvCG.js";
2
+ import { t as I18nConfig } from "./index-CNd0mkPr.js";
3
3
  import { SortedResult } from "./search/index.js";
4
- import { i as LoaderConfig, o as LoaderOutput, u as Page } from "./index-aE27-b16.js";
4
+ import { i as LoaderConfig, o as LoaderOutput, u as Page } from "./index-Bn_dIR1t.js";
5
5
  import { Language, Orama, RawData, SearchParams, TypedDocument, create } from "@orama/orama";
6
6
 
7
7
  //#region src/search/orama/create-db.d.ts
@@ -129,5 +129,4 @@ interface AdvancedIndex {
129
129
  }
130
130
  declare function initAdvancedSearch(options: AdvancedOptions): SearchServer;
131
131
  //#endregion
132
- export { Index as a, SimpleOptions as c, initSimpleSearch as d, createI18nSearchAPI as f, ExportedData as i, createSearchAPI as l, AdvancedOptions as n, SearchAPI as o, createFromSource as p, Dynamic as r, SearchServer as s, AdvancedIndex as t, initAdvancedSearch as u };
133
- //# sourceMappingURL=server-CLPpotS9.d.ts.map
132
+ export { Index as a, SimpleOptions as c, initSimpleSearch as d, createI18nSearchAPI as f, ExportedData as i, createSearchAPI as l, AdvancedOptions as n, SearchAPI as o, createFromSource as p, Dynamic as r, SearchServer as s, AdvancedIndex as t, initAdvancedSearch as u };
@@ -76,5 +76,4 @@ async function highlight(code, options) {
76
76
  }
77
77
 
78
78
  //#endregion
79
- export { highlightHast as a, highlight as i, getHighlighter as n, hastToJsx as r, defaultThemes as t };
80
- //# sourceMappingURL=shiki-B4NO99XD.js.map
79
+ export { highlightHast as a, highlight as i, getHighlighter as n, hastToJsx as r, defaultThemes as t };
@@ -29,5 +29,4 @@ declare function hastToJsx(hast: Root, options?: Partial<Options>): JSX.Element;
29
29
  declare function getHighlighter(engineType: 'js' | 'oniguruma', options: Omit<BundledHighlighterOptions<BundledLanguage, BundledTheme>, 'engine'>): Promise<Highlighter>;
30
30
  declare function highlight(code: string, options: HighlightOptions): Promise<ReactNode>;
31
31
  //#endregion
32
- export { hastToJsx as a, getHighlighter as i, HighlightOptionsCommon as n, highlight as o, HighlightOptionsThemes as r, highlightHast as s, HighlightOptions as t };
33
- //# sourceMappingURL=shiki-vKy7H_iw.d.ts.map
32
+ export { hastToJsx as a, getHighlighter as i, HighlightOptionsCommon as n, highlight as o, HighlightOptionsThemes as r, highlightHast as s, HighlightOptions as t };
@@ -1,4 +1,4 @@
1
- import "../../definitions-Ca2P2viV.js";
2
- import "../../index-BaMZ8PEK.js";
3
- import { n as deserializePageTree, r as useFumadocsLoader, t as SerializedPageTree } from "../../index-CmGSoB4T.js";
4
- export { SerializedPageTree, deserializePageTree, useFumadocsLoader };
1
+ import "../../definitions-fBNEDML4.js";
2
+ import "../../index-DbVQNAN8.js";
3
+ import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-Skpc1DNd.js";
4
+ export { Serialized, SerializedPageTree, deserializePageTree, useFumadocsLoader };
@@ -1,4 +1,4 @@
1
- import { c as visit } from "../../utils-D10VxgVc.js";
1
+ import { c as visit } from "../../utils-BllAiz19.js";
2
2
  import { useMemo } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
@@ -25,13 +25,15 @@ function useFumadocsLoader(serialized) {
25
25
  const out = {};
26
26
  for (const k in serialized) {
27
27
  const v = serialized[k];
28
- if (typeof v === "object" && v !== null && "$fumadocs_loader" in v && v.$fumadocs_loader === "page-tree" && "data" in v && typeof v.data === "object") out[k] = deserializePageTree(v);
28
+ if (isSerializedPageTree(v)) out[k] = deserializePageTree(v);
29
29
  else out[k] = v;
30
30
  }
31
31
  return out;
32
32
  }, [serialized]);
33
33
  }
34
+ function isSerializedPageTree(v) {
35
+ return typeof v === "object" && v !== null && "$fumadocs_loader" in v && v.$fumadocs_loader === "page-tree";
36
+ }
34
37
 
35
38
  //#endregion
36
- export { deserializePageTree, useFumadocsLoader };
37
- //# sourceMappingURL=index.js.map
39
+ export { deserializePageTree, useFumadocsLoader };
@@ -1,5 +1,5 @@
1
- import "../definitions-Ca2P2viV.js";
2
- import "../index-BaMZ8PEK.js";
3
- import { A as PageData, C as ContentStorage, D as buildContentStorage, E as ContentStoragePageFile, F as _SourceUpdate_, I as multiple, L as source, M as SourceConfig, N as VirtualFile, O as FileSystem, P as _ConfigUnion_, R as update, S as createPageTreeBuilder, T as ContentStorageMetaFile, a as LoaderOptions, b as PageTreeOptions, c as LoaderPluginOption, d as ResolvedLoaderConfig, f as createGetUrl, h as getSlugs, i as LoaderConfig, j as Source, k as MetaData, l as Meta, n as InferMetaType, o as LoaderOutput, p as loader, r as InferPageType, s as LoaderPlugin, t as path_d_exports, u as Page, v as PageTreeBuilder, w as ContentStorageFile, x as PageTreeTransformer, y as PageTreeBuilderContext } from "../index-aE27-b16.js";
4
- import "../index-CmGSoB4T.js";
1
+ import "../definitions-fBNEDML4.js";
2
+ import "../index-DbVQNAN8.js";
3
+ import { A as PageData, C as ContentStorage, D as buildContentStorage, E as ContentStoragePageFile, F as _SourceUpdate_, I as multiple, L as source, M as SourceConfig, N as VirtualFile, O as FileSystem, P as _ConfigUnion_, R as update, S as createPageTreeBuilder, T as ContentStorageMetaFile, a as LoaderOptions, b as PageTreeOptions, c as LoaderPluginOption, d as ResolvedLoaderConfig, f as createGetUrl, h as getSlugs, i as LoaderConfig, j as Source, k as MetaData, l as Meta, n as InferMetaType, o as LoaderOutput, p as loader, r as InferPageType, s as LoaderPlugin, t as path_d_exports, u as Page, v as PageTreeBuilder, w as ContentStorageFile, x as PageTreeTransformer, y as PageTreeBuilderContext } from "../index-Bn_dIR1t.js";
4
+ import "../index-Skpc1DNd.js";
5
5
  export { ContentStorage, ContentStorageFile, ContentStorageMetaFile, ContentStoragePageFile, FileSystem, InferMetaType, InferPageType, LoaderConfig, LoaderOptions, LoaderOutput, LoaderPlugin, LoaderPluginOption, Meta, MetaData, Page, PageData, PageTreeBuilder, PageTreeBuilderContext, PageTreeOptions, PageTreeTransformer, path_d_exports as PathUtils, ResolvedLoaderConfig, Source, SourceConfig, VirtualFile, _ConfigUnion_, _SourceUpdate_, buildContentStorage, createGetUrl, createPageTreeBuilder, getSlugs, loader, multiple, source, update };
@@ -1,8 +1,8 @@
1
- import { t as normalizeUrl } from "../normalize-url-CEfNKxaE.js";
2
- import { c as visit } from "../utils-D10VxgVc.js";
3
- import { a as path_exports, i as joinPath, n as dirname, o as slash, r as extname, s as splitPath, t as basename } from "../path-CECfI3nn.js";
1
+ import { t as normalizeUrl } from "../normalize-url-D88zV54r.js";
2
+ import { c as visit } from "../utils-BllAiz19.js";
3
+ import { a as path_exports, i as joinPath, n as dirname, o as slash, r as extname, s as splitPath, t as basename } from "../path-B48ZWv8k.js";
4
4
  import { getSlugs, slugsPlugin } from "./plugins/slugs.js";
5
- import { t as iconPlugin } from "../icon-CL3r1pNG.js";
5
+ import { t as iconPlugin } from "../icon-D9W4ODUt.js";
6
6
  import path from "node:path";
7
7
 
8
8
  //#region src/source/source.ts
@@ -213,7 +213,8 @@ function transformerFallback() {
213
213
  }
214
214
  if (isolatedStorage.getFiles().length === 0) return root;
215
215
  root.fallback = this.builder.build(isolatedStorage, {
216
- ...this.options,
216
+ noRef: this.noRef,
217
+ transformers: this.transformers,
217
218
  id: `fallback-${root.$id ?? ""}`,
218
219
  generateFallback: false
219
220
  });
@@ -261,7 +262,7 @@ function createPageTreeBuilder(loaderConfig) {
261
262
  rootId,
262
263
  transformers,
263
264
  builder: this,
264
- options,
265
+ noRef: options.noRef ?? false,
265
266
  getUrl: url,
266
267
  locale,
267
268
  storage,
@@ -289,7 +290,39 @@ function createFlattenPathResolver(storage) {
289
290
  }
290
291
  function createPageTreeBuilderUtils(ctx) {
291
292
  const resolveFlattenPath = createFlattenPathResolver(ctx.storage);
292
- const visitedPaths = /* @__PURE__ */ new Set();
293
+ /** virtual file path -> output page tree node (if built) */
294
+ const pathToNode = /* @__PURE__ */ new Map();
295
+ const nodeOwner = /* @__PURE__ */ new Map();
296
+ /**
297
+ * when a node is referenced by multiple folders via `...`, this determines which owner they should belong to.
298
+ *
299
+ * @returns whether the owner owns the node.
300
+ */
301
+ function registerOwner(ownerPath, node, priority) {
302
+ const existing = nodeOwner.get(node);
303
+ if (!existing) {
304
+ nodeOwner.set(node, {
305
+ owner: ownerPath,
306
+ priority
307
+ });
308
+ return true;
309
+ }
310
+ if (existing.owner === ownerPath) {
311
+ existing.priority = Math.max(existing.priority, priority);
312
+ return true;
313
+ }
314
+ if (existing.priority >= priority) return false;
315
+ const folder = pathToNode.get(existing.owner);
316
+ if (folder && folder.type === "folder") if (folder.index === node) delete folder.index;
317
+ else folder.children = folder.children.filter((child) => child !== node);
318
+ existing.owner = ownerPath;
319
+ existing.priority = priority;
320
+ return true;
321
+ }
322
+ function transferOwner(ownerPath, node) {
323
+ const existing = nodeOwner.get(node);
324
+ if (existing) existing.owner = ownerPath;
325
+ }
293
326
  function nextNodeId(localId = ctx.generateNodeId()) {
294
327
  return `${ctx.rootId}:${localId}`;
295
328
  }
@@ -311,11 +344,14 @@ function createPageTreeBuilderUtils(ctx) {
311
344
  items.push(...folders);
312
345
  return items;
313
346
  },
314
- resolveFolderItem(folderPath, item) {
315
- if (item === rest || item === restReversed) return item;
347
+ resolveFolderItem(folderPath, item, outputArray, excludedPaths) {
348
+ if (item === rest || item === restReversed) {
349
+ outputArray.push(item);
350
+ return;
351
+ }
316
352
  let match = separator.exec(item);
317
353
  if (match?.groups) {
318
- let node = {
354
+ let node$1 = {
319
355
  $id: nextNodeId(),
320
356
  type: "separator",
321
357
  icon: match.groups.icon,
@@ -323,14 +359,15 @@ function createPageTreeBuilderUtils(ctx) {
323
359
  };
324
360
  for (const transformer of ctx.transformers) {
325
361
  if (!transformer.separator) continue;
326
- node = transformer.separator.call(ctx, node);
362
+ node$1 = transformer.separator.call(ctx, node$1);
327
363
  }
328
- return [node];
364
+ outputArray.push(node$1);
365
+ return;
329
366
  }
330
367
  match = link.exec(item);
331
368
  if (match?.groups) {
332
369
  const { icon, url, name, external } = match.groups;
333
- let node = {
370
+ let node$1 = {
334
371
  $id: nextNodeId(),
335
372
  type: "page",
336
373
  icon,
@@ -340,52 +377,64 @@ function createPageTreeBuilderUtils(ctx) {
340
377
  };
341
378
  for (const transformer of ctx.transformers) {
342
379
  if (!transformer.file) continue;
343
- node = transformer.file.call(ctx, node);
380
+ node$1 = transformer.file.call(ctx, node$1);
344
381
  }
345
- return [node];
382
+ outputArray.push(node$1);
383
+ return;
384
+ }
385
+ if (item.startsWith(excludePrefix)) {
386
+ excludedPaths.add(resolveFlattenPath(joinPath(folderPath, item.slice(1)), "page"));
387
+ return;
346
388
  }
347
- const isExcept = item.startsWith(excludePrefix);
348
- const isExtract = !isExcept && item.startsWith(extractPrefix);
349
- let filename = item;
350
- if (isExcept) filename = item.slice(1);
351
- else if (isExtract) filename = item.slice(3);
352
- const path$1 = resolveFlattenPath(joinPath(folderPath, filename), "page");
353
- if (isExcept) {
354
- visitedPaths.add(path$1);
355
- return [];
389
+ if (item.startsWith(extractPrefix)) {
390
+ const path$2 = joinPath(folderPath, item.slice(3));
391
+ const node$1 = this.folder(path$2, false);
392
+ if (!node$1) return;
393
+ excludedPaths.add(path$2);
394
+ if (registerOwner(folderPath, node$1, 2)) for (const child of node$1.children) {
395
+ transferOwner(folderPath, node$1);
396
+ outputArray.push(child);
397
+ }
398
+ else for (const child of node$1.children) if (registerOwner(folderPath, child, 2)) outputArray.push(child);
399
+ return;
400
+ }
401
+ const path$1 = resolveFlattenPath(joinPath(folderPath, item), "page");
402
+ const node = this.folder(path$1, false) ?? this.file(path$1);
403
+ if (node) {
404
+ if (registerOwner(folderPath, node, 2)) outputArray.push(node);
405
+ excludedPaths.add(path$1);
356
406
  }
357
- const dirNode = this.folder(path$1, false);
358
- if (dirNode) return isExtract ? dirNode.children : [dirNode];
359
- const fileNode = this.file(path$1);
360
- return fileNode ? [fileNode] : [];
361
407
  },
362
408
  folder(folderPath, isGlobalRoot) {
363
- const { storage, options, transformers } = ctx;
364
- const files = storage.readDir(folderPath);
409
+ const cached = pathToNode.get(folderPath);
410
+ if (cached) return cached;
411
+ const files = ctx.storage.readDir(folderPath);
365
412
  if (!files) return;
366
413
  const metaPath = resolveFlattenPath(joinPath(folderPath, "meta"), "meta");
367
414
  const indexPath = resolveFlattenPath(joinPath(folderPath, "index"), "page");
368
- let meta = storage.read(metaPath);
415
+ let meta = ctx.storage.read(metaPath);
369
416
  if (meta && meta.format !== "meta") meta = void 0;
370
417
  const metadata = meta?.data ?? {};
371
- const { root = isGlobalRoot, pages } = metadata;
372
418
  let index;
373
- let children;
374
- if (pages) {
375
- const resolved = pages.flatMap((item) => this.resolveFolderItem(folderPath, item));
376
- if (!root && !visitedPaths.has(indexPath)) index = this.file(indexPath);
377
- for (let i = 0; i < resolved.length; i++) {
378
- const item = resolved[i];
379
- if (item !== rest && item !== restReversed) continue;
380
- const items = this.buildPaths(files.filter((file) => !visitedPaths.has(file)), item === restReversed);
381
- resolved.splice(i, 1, ...items);
382
- break;
383
- }
384
- children = resolved;
385
- } else {
386
- if (!root && !visitedPaths.has(indexPath)) index = this.file(indexPath);
387
- children = this.buildPaths(files.filter((file) => !visitedPaths.has(file)));
419
+ const children = [];
420
+ if (!(metadata.root ?? isGlobalRoot)) {
421
+ const file = this.file(indexPath);
422
+ if (file && registerOwner(folderPath, file, 0)) index = file;
388
423
  }
424
+ if (metadata.pages) {
425
+ const outputArray = [];
426
+ const excludedPaths = /* @__PURE__ */ new Set();
427
+ for (const item of metadata.pages) this.resolveFolderItem(folderPath, item, outputArray, excludedPaths);
428
+ for (const item of outputArray) {
429
+ if (item !== rest && item !== restReversed) {
430
+ if (item === index) index = void 0;
431
+ children.push(item);
432
+ continue;
433
+ }
434
+ const resolvedItem = this.buildPaths(files.filter((file) => !excludedPaths.has(file)), item === restReversed);
435
+ for (const child of resolvedItem) if (registerOwner(folderPath, child, 0)) children.push(child);
436
+ }
437
+ } else for (const item of this.buildPaths(files)) if (item !== index && registerOwner(folderPath, item, 0)) children.push(item);
389
438
  let node = {
390
439
  type: "folder",
391
440
  name: metadata.title ?? index?.name ?? (() => {
@@ -400,19 +449,20 @@ function createPageTreeBuilderUtils(ctx) {
400
449
  index,
401
450
  children,
402
451
  $id: nextNodeId(folderPath),
403
- $ref: !options.noRef && meta ? { metaFile: metaPath } : void 0
452
+ $ref: !ctx.noRef && meta ? { metaFile: metaPath } : void 0
404
453
  };
405
- visitedPaths.add(folderPath);
406
- for (const transformer of transformers) {
454
+ for (const transformer of ctx.transformers) {
407
455
  if (!transformer.folder) continue;
408
456
  node = transformer.folder.call(ctx, node, folderPath, metaPath);
409
457
  }
458
+ pathToNode.set(folderPath, node);
410
459
  return node;
411
460
  },
412
461
  file(path$1) {
413
- const { options, getUrl, storage, locale, transformers } = ctx;
414
- const page = storage.read(path$1);
415
- if (page?.format !== "page") return;
462
+ const cached = pathToNode.get(path$1);
463
+ if (cached) return cached;
464
+ const page = ctx.storage.read(path$1);
465
+ if (!page || page.format !== "page") return;
416
466
  const { title, description, icon } = page.data;
417
467
  let item = {
418
468
  $id: nextNodeId(path$1),
@@ -420,14 +470,14 @@ function createPageTreeBuilderUtils(ctx) {
420
470
  name: title ?? pathToName(basename(path$1, extname(path$1))),
421
471
  description,
422
472
  icon,
423
- url: getUrl(page.slugs, locale),
424
- $ref: !options.noRef ? { file: path$1 } : void 0
473
+ url: ctx.getUrl(page.slugs, ctx.locale),
474
+ $ref: !ctx.noRef ? { file: path$1 } : void 0
425
475
  };
426
- visitedPaths.add(path$1);
427
- for (const transformer of transformers) {
476
+ for (const transformer of ctx.transformers) {
428
477
  if (!transformer.file) continue;
429
478
  item = transformer.file.call(ctx, item, path$1);
430
479
  }
480
+ pathToNode.set(path$1, item);
431
481
  return item;
432
482
  },
433
483
  root() {
@@ -635,5 +685,4 @@ function buildPlugins(plugins, sort = true) {
635
685
  }
636
686
 
637
687
  //#endregion
638
- export { FileSystem, path_exports as PathUtils, createGetUrl, getSlugs, loader, multiple, source, update };
639
- //# sourceMappingURL=index.js.map
688
+ export { FileSystem, path_exports as PathUtils, createGetUrl, getSlugs, loader, multiple, source, update };
@@ -1,7 +1,7 @@
1
- import "../../definitions-Ca2P2viV.js";
2
- import "../../index-BaMZ8PEK.js";
3
- import { s as LoaderPlugin } from "../../index-aE27-b16.js";
4
- import "../../index-CmGSoB4T.js";
1
+ import "../../definitions-fBNEDML4.js";
2
+ import "../../index-DbVQNAN8.js";
3
+ import { s as LoaderPlugin } from "../../index-Bn_dIR1t.js";
4
+ import "../../index-Skpc1DNd.js";
5
5
  import { icons } from "lucide-react";
6
6
 
7
7
  //#region src/source/plugins/lucide-icons.d.ts
@@ -12,5 +12,4 @@ declare function lucideIconsPlugin(options?: {
12
12
  defaultIcon?: keyof typeof icons;
13
13
  }): LoaderPlugin;
14
14
  //#endregion
15
- export { lucideIconsPlugin };
16
- //# sourceMappingURL=lucide-icons.d.ts.map
15
+ export { lucideIconsPlugin };
@@ -1,4 +1,4 @@
1
- import { t as iconPlugin } from "../../icon-CL3r1pNG.js";
1
+ import { t as iconPlugin } from "../../icon-D9W4ODUt.js";
2
2
  import { createElement } from "react";
3
3
  import { icons } from "lucide-react";
4
4
 
@@ -20,5 +20,4 @@ function lucideIconsPlugin(options = {}) {
20
20
  }
21
21
 
22
22
  //#endregion
23
- export { lucideIconsPlugin };
24
- //# sourceMappingURL=lucide-icons.js.map
23
+ export { lucideIconsPlugin };
@@ -1,5 +1,5 @@
1
- import "../../definitions-Ca2P2viV.js";
2
- import "../../index-BaMZ8PEK.js";
3
- import { _ as slugsPlugin, g as slugsFromData, h as getSlugs, m as SlugFn } from "../../index-aE27-b16.js";
4
- import "../../index-CmGSoB4T.js";
1
+ import "../../definitions-fBNEDML4.js";
2
+ import "../../index-DbVQNAN8.js";
3
+ import { _ as slugsPlugin, g as slugsFromData, h as getSlugs, m as SlugFn } from "../../index-Bn_dIR1t.js";
4
+ import "../../index-Skpc1DNd.js";
5
5
  export { SlugFn, getSlugs, slugsFromData, slugsPlugin };
@@ -1,4 +1,4 @@
1
- import { n as dirname, r as extname, t as basename } from "../../path-CECfI3nn.js";
1
+ import { n as dirname, r as extname, t as basename } from "../../path-B48ZWv8k.js";
2
2
 
3
3
  //#region src/source/plugins/slugs.ts
4
4
  /**
@@ -61,5 +61,4 @@ function getSlugs(file) {
61
61
  }
62
62
 
63
63
  //#endregion
64
- export { getSlugs, slugsFromData, slugsPlugin };
65
- //# sourceMappingURL=slugs.js.map
64
+ export { getSlugs, slugsFromData, slugsPlugin };
@@ -0,0 +1,53 @@
1
+ import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-fBNEDML4.js";
2
+ import "../../index-DbVQNAN8.js";
3
+ import { s as LoaderPlugin } from "../../index-Bn_dIR1t.js";
4
+ import "../../index-Skpc1DNd.js";
5
+ import { ReactNode } from "react";
6
+
7
+ //#region src/source/plugins/status-badges.d.ts
8
+ interface Item extends Item$1 {
9
+ /**
10
+ * Status badge to display in the sidebar (e.g., "new", "beta", "deprecated", "experimental").
11
+ */
12
+ status?: string;
13
+ }
14
+ interface Folder extends Omit<Folder$1, 'children' | 'index'> {
15
+ index?: Item;
16
+ children: Node[];
17
+ }
18
+ type Separator = Separator$1;
19
+ type Node = Item | Folder | Separator;
20
+ /**
21
+ * Plugin to add status badges to pages in the sidebar.
22
+ *
23
+ * This reads the `status` field from page frontmatter and adds it to the page tree item.
24
+ * Define the `renderBadge` option to render it.
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * import { loader } from 'fumadocs-core/source';
29
+ * import { statusBadgesPlugin } from 'fumadocs-core/source/status-badges';
30
+ *
31
+ * export const source = loader({
32
+ * plugins: [
33
+ * statusBadgesPlugin({
34
+ * renderBadge: (status) => <span>{status}</span>,
35
+ * }),
36
+ * ],
37
+ * // ...
38
+ * });
39
+ * ```
40
+ *
41
+ * Then in your frontmatter:
42
+ * ```yaml
43
+ * ---
44
+ * title: My Page
45
+ * status: new
46
+ * ---
47
+ * ```
48
+ */
49
+ declare function statusBadgesPlugin(options?: {
50
+ renderBadge?: (status: string) => ReactNode;
51
+ }): LoaderPlugin;
52
+ //#endregion
53
+ export { Folder, Item, Node, Separator, statusBadgesPlugin };
@@ -0,0 +1,54 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+
3
+ //#region src/source/plugins/status-badges.tsx
4
+ /**
5
+ * Plugin to add status badges to pages in the sidebar.
6
+ *
7
+ * This reads the `status` field from page frontmatter and adds it to the page tree item.
8
+ * Define the `renderBadge` option to render it.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { loader } from 'fumadocs-core/source';
13
+ * import { statusBadgesPlugin } from 'fumadocs-core/source/status-badges';
14
+ *
15
+ * export const source = loader({
16
+ * plugins: [
17
+ * statusBadgesPlugin({
18
+ * renderBadge: (status) => <span>{status}</span>,
19
+ * }),
20
+ * ],
21
+ * // ...
22
+ * });
23
+ * ```
24
+ *
25
+ * Then in your frontmatter:
26
+ * ```yaml
27
+ * ---
28
+ * title: My Page
29
+ * status: new
30
+ * ---
31
+ * ```
32
+ */
33
+ function statusBadgesPlugin(options = {}) {
34
+ const { renderBadge = (status) => /* @__PURE__ */ jsx("span", {
35
+ "data-status": status,
36
+ children: status
37
+ }) } = options;
38
+ return {
39
+ name: "fumadocs:status-badges",
40
+ transformPageTree: { file(node, filePath) {
41
+ if (!filePath) return node;
42
+ const file = this.storage.read(filePath);
43
+ if (file?.format === "page" && "status" in file.data && typeof file.data.status === "string") {
44
+ const status = file.data.status;
45
+ node.name = /* @__PURE__ */ jsxs(Fragment, { children: [node.name, renderBadge(status)] });
46
+ node.status = status;
47
+ }
48
+ return node;
49
+ } }
50
+ };
51
+ }
52
+
53
+ //#endregion
54
+ export { statusBadgesPlugin };
@@ -25,5 +25,4 @@ declare const pageSchema: z.ZodObject<{
25
25
  _openapi: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
26
26
  }, z.core.$strip>;
27
27
  //#endregion
28
- export { metaSchema, pageSchema };
29
- //# sourceMappingURL=schema.d.ts.map
28
+ export { metaSchema, pageSchema };
@@ -25,5 +25,4 @@ const pageSchema = z.object({
25
25
  });
26
26
 
27
27
  //#endregion
28
- export { metaSchema, pageSchema };
29
- //# sourceMappingURL=schema.js.map
28
+ export { metaSchema, pageSchema };
@@ -1,4 +1,4 @@
1
- import { n as searchSimple, t as searchAdvanced } from "./advanced-tbtFDsHU.js";
1
+ import { n as searchSimple, t as searchAdvanced } from "./advanced-BiZjLx5X.js";
2
2
  import { create, load } from "@orama/orama";
3
3
 
4
4
  //#region src/search/client/static.ts
@@ -47,5 +47,4 @@ async function search(query, options) {
47
47
  }
48
48
 
49
49
  //#endregion
50
- export { search };
51
- //# sourceMappingURL=static-C_WBOzek.js.map
50
+ export { search };
package/dist/toc.d.ts CHANGED
@@ -52,5 +52,4 @@ declare function TOCItem({
52
52
  ...props
53
53
  }: TOCItemProps): react_jsx_runtime0.JSX.Element;
54
54
  //#endregion
55
- export { AnchorProvider, AnchorProviderProps, ScrollProvider, ScrollProviderProps, TOCItem, TOCItemProps, TOCItemType, TableOfContents, useActiveAnchor, useActiveAnchors };
56
- //# sourceMappingURL=toc.d.ts.map
55
+ export { AnchorProvider, AnchorProviderProps, ScrollProvider, ScrollProviderProps, TOCItem, TOCItemProps, TOCItemType, TableOfContents, useActiveAnchor, useActiveAnchors };
package/dist/toc.js CHANGED
@@ -134,5 +134,4 @@ function useAnchorObserver(watch, single) {
134
134
  }
135
135
 
136
136
  //#endregion
137
- export { AnchorProvider, ScrollProvider, TOCItem, useActiveAnchor, useActiveAnchors };
138
- //# sourceMappingURL=toc.js.map
137
+ export { AnchorProvider, ScrollProvider, TOCItem, useActiveAnchor, useActiveAnchors };
@@ -4,5 +4,4 @@ import { Pluggable } from "unified";
4
4
  type Thenable<T> = T | PromiseLike<T>;
5
5
  type ResolvePlugins = Thenable<Pluggable>[] | ((v: Pluggable[]) => Thenable<Pluggable>[]);
6
6
  //#endregion
7
- export { ResolvePlugins as t };
8
- //# sourceMappingURL=util-d5FlPx1Z.d.ts.map
7
+ export { ResolvePlugins as t };
@@ -6,5 +6,4 @@ async function resolvePlugins(def, options = []) {
6
6
  }
7
7
 
8
8
  //#endregion
9
- export { resolvePlugins as t };
10
- //# sourceMappingURL=util-Dn-wseQ5.js.map
9
+ export { resolvePlugins as t };