@hanzo/docs-core 16.4.3 → 16.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/README.md +3 -3
  2. package/dist/{advanced-BRT5Ij43.js → advanced-BH0syJ-M.js} +3 -4
  3. package/dist/{algolia-CQPXCnjV.js → algolia-C7Crg8-5.js} +2 -3
  4. package/dist/breadcrumb.d.ts +2 -3
  5. package/dist/breadcrumb.js +3 -4
  6. package/dist/{chunk-B-ezknvj.js → chunk-CaR5F9JI.js} +3 -3
  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 -3
  16. package/dist/content/toc.js +4 -5
  17. package/dist/create-i18n-Cv3Cocbs.d.ts +51 -0
  18. package/dist/{definitions-DuxDer_c.d.ts → definitions-DSNTbAwC.d.ts} +1 -2
  19. package/dist/dynamic-link.d.ts +3 -4
  20. package/dist/dynamic-link.js +1 -3
  21. package/dist/{fetch-B5e9CFfN.js → fetch-HotVeLLF.js} +1 -2
  22. package/dist/framework/index.d.ts +5 -6
  23. package/dist/framework/index.js +18 -19
  24. package/dist/framework/next.d.ts +3 -4
  25. package/dist/framework/next.js +1 -2
  26. package/dist/framework/react-router.d.ts +1 -2
  27. package/dist/framework/react-router.js +1 -2
  28. package/dist/framework/tanstack.d.ts +4 -5
  29. package/dist/framework/tanstack.js +2 -3
  30. package/dist/framework/waku.d.ts +1 -2
  31. package/dist/framework/waku.js +1 -2
  32. package/dist/hast-utils-BmGqqmvo.js +15 -0
  33. package/dist/highlight/client.d.ts +2 -4
  34. package/dist/highlight/client.js +7 -13
  35. package/dist/highlight/config.d.ts +15 -0
  36. package/dist/highlight/config.js +18 -0
  37. package/dist/highlight/core/client.d.ts +31 -0
  38. package/dist/highlight/core/client.js +68 -0
  39. package/dist/highlight/core/index.d.ts +27 -0
  40. package/dist/highlight/core/index.js +69 -0
  41. package/dist/highlight/index.d.ts +34 -2
  42. package/dist/highlight/index.js +57 -2
  43. package/dist/i18n/index.d.ts +39 -1
  44. package/dist/i18n/index.js +1 -2
  45. package/dist/i18n/middleware.d.ts +2 -3
  46. package/dist/i18n/middleware.js +1 -2
  47. package/dist/{icon-BWwSDabM.js → icon-OtPFhyk1.js} +1 -2
  48. package/dist/link.d.ts +3 -4
  49. package/dist/link.js +1 -2
  50. package/dist/{mdast-utils-mc9-X-PK.js → mdast-utils-gJMY143g.js} +1 -2
  51. package/dist/mdx-plugins/codeblock-utils.d.ts +35 -1
  52. package/dist/mdx-plugins/codeblock-utils.js +2 -3
  53. package/dist/mdx-plugins/index.d.ts +18 -15
  54. package/dist/mdx-plugins/index.js +7 -5
  55. package/dist/mdx-plugins/rehype-code.core.d.ts +38 -0
  56. package/dist/mdx-plugins/rehype-code.core.js +104 -0
  57. package/dist/mdx-plugins/rehype-code.d.ts +18 -2
  58. package/dist/mdx-plugins/rehype-code.js +24 -3
  59. package/dist/mdx-plugins/rehype-toc.d.ts +16 -1
  60. package/dist/mdx-plugins/rehype-toc.js +127 -1
  61. package/dist/mdx-plugins/remark-admonition.d.ts +20 -1
  62. package/dist/mdx-plugins/remark-admonition.js +2 -3
  63. package/dist/mdx-plugins/remark-code-tab.d.ts +30 -1
  64. package/dist/mdx-plugins/remark-code-tab.js +4 -5
  65. package/dist/mdx-plugins/remark-directive-admonition.d.ts +34 -1
  66. package/dist/mdx-plugins/remark-directive-admonition.js +1 -2
  67. package/dist/mdx-plugins/remark-feedback-block.d.ts +51 -0
  68. package/dist/mdx-plugins/remark-feedback-block.js +47 -0
  69. package/dist/mdx-plugins/remark-gfm.d.ts +2 -2
  70. package/dist/mdx-plugins/remark-heading.d.ts +35 -1
  71. package/dist/mdx-plugins/remark-heading.js +2 -3
  72. package/dist/mdx-plugins/remark-image.d.ts +63 -1
  73. package/dist/mdx-plugins/remark-image.js +1 -2
  74. package/dist/mdx-plugins/remark-mdx-files.d.ts +55 -2
  75. package/dist/mdx-plugins/remark-mdx-files.js +103 -13
  76. package/dist/mdx-plugins/remark-mdx-mermaid.d.ts +15 -1
  77. package/dist/mdx-plugins/remark-mdx-mermaid.js +1 -2
  78. package/dist/mdx-plugins/remark-npm.d.ts +34 -1
  79. package/dist/mdx-plugins/remark-npm.js +1 -2
  80. package/dist/mdx-plugins/remark-steps.d.ts +26 -1
  81. package/dist/mdx-plugins/remark-steps.js +1 -2
  82. package/dist/mdx-plugins/remark-structure.d.ts +75 -1
  83. package/dist/mdx-plugins/remark-structure.js +7 -8
  84. package/dist/{mixedbread-DlByNYSd.js → mixedbread-Bx9drx9S.js} +6 -5
  85. package/dist/negotiation/index.d.ts +1 -2
  86. package/dist/negotiation/index.js +1 -2
  87. package/dist/{normalize-url-DP9-1I-S.js → normalize-url-DUHbcuVM.js} +2 -3
  88. package/dist/{orama-cloud-DH3g37zc.js → orama-cloud-ByznDyOk.js} +6 -7
  89. package/dist/orama-cloud-legacy-BbgJnf5f.js +81 -0
  90. package/dist/page-tree/index.d.ts +3 -45
  91. package/dist/page-tree/index.js +1 -1
  92. package/dist/{index-2U6Tl4--.d.ts → path-B77y3W0_.d.ts} +111 -98
  93. package/dist/{path-DHIjrDBP.js → path-D0Bwm6Fs.js} +2 -3
  94. package/dist/{remove-undefined-Cfs4o_mM.js → remove-undefined-CJm9cyrC.js} +1 -2
  95. package/dist/search/algolia.d.ts +66 -2
  96. package/dist/search/algolia.js +1 -2
  97. package/dist/search/client.d.ts +31 -8
  98. package/dist/search/client.js +27 -22
  99. package/dist/search/index.d.ts +1 -2
  100. package/dist/search/index.js +41 -1
  101. package/dist/search/orama-cloud-legacy.d.ts +77 -0
  102. package/dist/search/orama-cloud-legacy.js +49 -0
  103. package/dist/search/orama-cloud.d.ts +5 -9
  104. package/dist/search/orama-cloud.js +1 -2
  105. package/dist/search/server.d.ts +87 -4
  106. package/dist/search/server.js +7 -8
  107. package/dist/source/client/index.d.ts +13 -11
  108. package/dist/source/client/index.js +22 -13
  109. package/dist/source/index.d.ts +5 -3
  110. package/dist/source/index.js +428 -333
  111. package/dist/source/plugins/lucide-icons.d.ts +5 -4
  112. package/dist/source/plugins/lucide-icons.js +2 -3
  113. package/dist/source/plugins/slugs.d.ts +24 -2
  114. package/dist/source/plugins/slugs.js +2 -3
  115. package/dist/source/plugins/status-badges.d.ts +52 -0
  116. package/dist/source/plugins/status-badges.js +54 -0
  117. package/dist/source/schema.d.ts +1 -3
  118. package/dist/source/schema.js +1 -2
  119. package/dist/{static-Dq8pA8Ay.js → static-DTxK4eHk.js} +5 -6
  120. package/dist/toc.d.ts +5 -6
  121. package/dist/toc.js +1 -2
  122. package/dist/{rehype-code-CdiZ1Y6P.js → transformer-icon-BYedaeE8.js} +1 -96
  123. package/dist/transformer-icon-D7-6aFzt.d.ts +18 -0
  124. package/dist/types-BSnJn7kF.d.ts +6 -0
  125. package/dist/{util-CK2ykiif.d.ts → util-C60LmklF.d.ts} +1 -2
  126. package/dist/{util-s9piKHsk.js → util-De0ALHOx.js} +1 -2
  127. package/dist/utils/use-media-query.d.ts +1 -2
  128. package/dist/utils/use-media-query.js +1 -2
  129. package/dist/utils/use-on-change.d.ts +1 -2
  130. package/dist/utils/use-on-change.js +1 -2
  131. package/dist/{utils-DUvi2WkD.js → utils-Bc53B3CJ.js} +8 -7
  132. package/dist/utils-IgHyYnrz.d.ts +45 -0
  133. package/package.json +58 -28
  134. package/dist/advanced-BRT5Ij43.js.map +0 -1
  135. package/dist/algolia-CBBN8R6-.d.ts +0 -68
  136. package/dist/algolia-CBBN8R6-.d.ts.map +0 -1
  137. package/dist/algolia-CQPXCnjV.js.map +0 -1
  138. package/dist/breadcrumb.d.ts.map +0 -1
  139. package/dist/breadcrumb.js.map +0 -1
  140. package/dist/codeblock-utils-lld8UiQo.d.ts +0 -37
  141. package/dist/codeblock-utils-lld8UiQo.d.ts.map +0 -1
  142. package/dist/content/github.d.ts.map +0 -1
  143. package/dist/content/github.js.map +0 -1
  144. package/dist/content/index.d.ts.map +0 -1
  145. package/dist/content/index.js.map +0 -1
  146. package/dist/content/mdx/preset-bundler.d.ts.map +0 -1
  147. package/dist/content/mdx/preset-bundler.js.map +0 -1
  148. package/dist/content/mdx/preset-runtime.d.ts.map +0 -1
  149. package/dist/content/mdx/preset-runtime.js.map +0 -1
  150. package/dist/content/toc.d.ts.map +0 -1
  151. package/dist/content/toc.js.map +0 -1
  152. package/dist/definitions-DuxDer_c.d.ts.map +0 -1
  153. package/dist/dynamic-link.d.ts.map +0 -1
  154. package/dist/dynamic-link.js.map +0 -1
  155. package/dist/fetch-B5e9CFfN.js.map +0 -1
  156. package/dist/framework/index.d.ts.map +0 -1
  157. package/dist/framework/index.js.map +0 -1
  158. package/dist/framework/next.d.ts.map +0 -1
  159. package/dist/framework/next.js.map +0 -1
  160. package/dist/framework/react-router.d.ts.map +0 -1
  161. package/dist/framework/react-router.js.map +0 -1
  162. package/dist/framework/tanstack.d.ts.map +0 -1
  163. package/dist/framework/tanstack.js.map +0 -1
  164. package/dist/framework/waku.d.ts.map +0 -1
  165. package/dist/framework/waku.js.map +0 -1
  166. package/dist/highlight/client.d.ts.map +0 -1
  167. package/dist/highlight/client.js.map +0 -1
  168. package/dist/i18n/index.js.map +0 -1
  169. package/dist/i18n/middleware.d.ts.map +0 -1
  170. package/dist/i18n/middleware.js.map +0 -1
  171. package/dist/icon-BWwSDabM.js.map +0 -1
  172. package/dist/index-2U6Tl4--.d.ts.map +0 -1
  173. package/dist/index-Bw-DCOra.d.ts +0 -41
  174. package/dist/index-Bw-DCOra.d.ts.map +0 -1
  175. package/dist/link.d.ts.map +0 -1
  176. package/dist/link.js.map +0 -1
  177. package/dist/mdast-utils-mc9-X-PK.js.map +0 -1
  178. package/dist/mdx-plugins/codeblock-utils.js.map +0 -1
  179. package/dist/mdx-plugins/remark-admonition.js.map +0 -1
  180. package/dist/mdx-plugins/remark-code-tab.js.map +0 -1
  181. package/dist/mdx-plugins/remark-directive-admonition.js.map +0 -1
  182. package/dist/mdx-plugins/remark-heading.js.map +0 -1
  183. package/dist/mdx-plugins/remark-image.js.map +0 -1
  184. package/dist/mdx-plugins/remark-mdx-files.js.map +0 -1
  185. package/dist/mdx-plugins/remark-mdx-mermaid.js.map +0 -1
  186. package/dist/mdx-plugins/remark-npm.js.map +0 -1
  187. package/dist/mdx-plugins/remark-steps.js.map +0 -1
  188. package/dist/mdx-plugins/remark-structure.js.map +0 -1
  189. package/dist/mixedbread-DlByNYSd.js.map +0 -1
  190. package/dist/negotiation/index.d.ts.map +0 -1
  191. package/dist/negotiation/index.js.map +0 -1
  192. package/dist/normalize-url-DP9-1I-S.js.map +0 -1
  193. package/dist/orama-cloud-DH3g37zc.js.map +0 -1
  194. package/dist/page-tree/index.d.ts.map +0 -1
  195. package/dist/path-DHIjrDBP.js.map +0 -1
  196. package/dist/rehype-code-CdiZ1Y6P.js.map +0 -1
  197. package/dist/rehype-code-vVWG4-ej.d.ts +0 -58
  198. package/dist/rehype-code-vVWG4-ej.d.ts.map +0 -1
  199. package/dist/rehype-toc-DJvSyE0o.d.ts +0 -18
  200. package/dist/rehype-toc-DJvSyE0o.d.ts.map +0 -1
  201. package/dist/rehype-toc-DVwJcwvA.js +0 -143
  202. package/dist/rehype-toc-DVwJcwvA.js.map +0 -1
  203. package/dist/remark-admonition-DOwBWzsH.d.ts +0 -22
  204. package/dist/remark-admonition-DOwBWzsH.d.ts.map +0 -1
  205. package/dist/remark-code-tab-CXsYlims.d.ts +0 -32
  206. package/dist/remark-code-tab-CXsYlims.d.ts.map +0 -1
  207. package/dist/remark-directive-admonition-BCm_yiU9.d.ts +0 -36
  208. package/dist/remark-directive-admonition-BCm_yiU9.d.ts.map +0 -1
  209. package/dist/remark-gfm-CeWpMwyk.d.ts +0 -2
  210. package/dist/remark-heading-CXvCY0go.d.ts +0 -37
  211. package/dist/remark-heading-CXvCY0go.d.ts.map +0 -1
  212. package/dist/remark-image-CvUis4R1.d.ts +0 -65
  213. package/dist/remark-image-CvUis4R1.d.ts.map +0 -1
  214. package/dist/remark-mdx-files-DOYafA4x.d.ts +0 -42
  215. package/dist/remark-mdx-files-DOYafA4x.d.ts.map +0 -1
  216. package/dist/remark-mdx-mermaid-BdSUUiCG.d.ts +0 -17
  217. package/dist/remark-mdx-mermaid-BdSUUiCG.d.ts.map +0 -1
  218. package/dist/remark-npm-BIvIEKT2.d.ts +0 -36
  219. package/dist/remark-npm-BIvIEKT2.d.ts.map +0 -1
  220. package/dist/remark-steps-CHJN-rtm.d.ts +0 -28
  221. package/dist/remark-steps-CHJN-rtm.d.ts.map +0 -1
  222. package/dist/remark-structure-RZD2gGKp.d.ts +0 -77
  223. package/dist/remark-structure-RZD2gGKp.d.ts.map +0 -1
  224. package/dist/remove-undefined-Cfs4o_mM.js.map +0 -1
  225. package/dist/search/algolia.js.map +0 -1
  226. package/dist/search/client.d.ts.map +0 -1
  227. package/dist/search/client.js.map +0 -1
  228. package/dist/search/index.d.ts.map +0 -1
  229. package/dist/search/orama-cloud.d.ts.map +0 -1
  230. package/dist/search/orama-cloud.js.map +0 -1
  231. package/dist/search/server.js.map +0 -1
  232. package/dist/search-D6ChCLhY.js +0 -44
  233. package/dist/search-D6ChCLhY.js.map +0 -1
  234. package/dist/server-CPR_fgkH.d.ts +0 -133
  235. package/dist/server-CPR_fgkH.d.ts.map +0 -1
  236. package/dist/shiki-4oMYwHED.js +0 -80
  237. package/dist/shiki-4oMYwHED.js.map +0 -1
  238. package/dist/shiki-CIBQys54.d.ts +0 -33
  239. package/dist/shiki-CIBQys54.d.ts.map +0 -1
  240. package/dist/source/client/index.d.ts.map +0 -1
  241. package/dist/source/client/index.js.map +0 -1
  242. package/dist/source/index.js.map +0 -1
  243. package/dist/source/plugins/lucide-icons.d.ts.map +0 -1
  244. package/dist/source/plugins/lucide-icons.js.map +0 -1
  245. package/dist/source/plugins/slugs.js.map +0 -1
  246. package/dist/source/schema.d.ts.map +0 -1
  247. package/dist/source/schema.js.map +0 -1
  248. package/dist/static-Dq8pA8Ay.js.map +0 -1
  249. package/dist/toc.d.ts.map +0 -1
  250. package/dist/toc.js.map +0 -1
  251. package/dist/util-CK2ykiif.d.ts.map +0 -1
  252. package/dist/util-s9piKHsk.js.map +0 -1
  253. package/dist/utils/use-effect-event.d.ts +0 -11
  254. package/dist/utils/use-effect-event.d.ts.map +0 -1
  255. package/dist/utils/use-effect-event.js +0 -19
  256. package/dist/utils/use-effect-event.js.map +0 -1
  257. package/dist/utils/use-media-query.d.ts.map +0 -1
  258. package/dist/utils/use-media-query.js.map +0 -1
  259. package/dist/utils/use-on-change.d.ts.map +0 -1
  260. package/dist/utils/use-on-change.js.map +0 -1
  261. package/dist/utils-DUvi2WkD.js.map +0 -1
@@ -0,0 +1,18 @@
1
+ //#region src/highlight/config.ts
2
+ /** define shared configurations for Shiki */
3
+ function defineShikiConfig(config) {
4
+ let created;
5
+ return {
6
+ id: Symbol(),
7
+ defaultThemes: config.defaultThemes,
8
+ createHighlighter() {
9
+ if (created) return created;
10
+ created = config.createHighlighter();
11
+ if ("then" in created) created = created.then((v) => created = v);
12
+ return created;
13
+ }
14
+ };
15
+ }
16
+
17
+ //#endregion
18
+ export { defineShikiConfig };
@@ -0,0 +1,31 @@
1
+ import { r as MakeOptional } from "../../types-BSnJn7kF.js";
2
+ import { ResolvedShikiConfig } from "../config.js";
3
+ import { CoreHighlightOptions } from "./index.js";
4
+ import { DependencyList, ReactNode } from "react";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
+
7
+ //#region src/highlight/core/client.d.ts
8
+ declare function useShikiConfigOptional(): ResolvedShikiConfig | null;
9
+ declare function useShikiConfig(forced?: ResolvedShikiConfig): ResolvedShikiConfig;
10
+ declare function ShikiConfigProvider({
11
+ config,
12
+ children
13
+ }: {
14
+ config: ResolvedShikiConfig;
15
+ children: ReactNode;
16
+ }): react_jsx_runtime0.JSX.Element;
17
+ type UseShikiOptions = MakeOptional<CoreHighlightOptions, 'config'>;
18
+ /**
19
+ * get highlighted results (uncached), use `useEffect` instead of React 19 APIs.
20
+ */
21
+ declare function useShikiDynamic(code: string, options: UseShikiOptions & {
22
+ defaultValue?: ReactNode;
23
+ }, deps: DependencyList): ReactNode;
24
+ /**
25
+ * get highlighted results, should be used with React Suspense API.
26
+ *
27
+ * note: results are cached with (lang, code) as keys, if this is not the desired behaviour, pass a `deps` instead.
28
+ */
29
+ declare function useShiki(code: string, options: UseShikiOptions, deps?: DependencyList): ReactNode;
30
+ //#endregion
31
+ export { ShikiConfigProvider, UseShikiOptions, useShiki, useShikiConfig, useShikiConfigOptional, useShikiDynamic };
@@ -0,0 +1,68 @@
1
+ 'use client';
2
+
3
+ import { highlight } from "./index.js";
4
+ import { createContext, use, useEffect, useMemo, useRef, useState } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/highlight/core/client.tsx
8
+ const ShikiConfigContext = createContext(null);
9
+ function useShikiConfigOptional() {
10
+ return use(ShikiConfigContext);
11
+ }
12
+ function useShikiConfig(forced) {
13
+ if (forced) return forced;
14
+ const ctx = use(ShikiConfigContext);
15
+ if (!ctx) throw new Error(`missing <ShikiConfigProvider />`);
16
+ return ctx;
17
+ }
18
+ function ShikiConfigProvider({ config, children }) {
19
+ return /* @__PURE__ */ jsx(ShikiConfigContext, {
20
+ value: config,
21
+ children
22
+ });
23
+ }
24
+ const promises = {};
25
+ /**
26
+ * get highlighted results (uncached), use `useEffect` instead of React 19 APIs.
27
+ */
28
+ function useShikiDynamic(code, options, deps) {
29
+ const [node, setNode] = useState(options.defaultValue);
30
+ const config = useShikiConfig(options.config);
31
+ const lastTask = useRef(null);
32
+ useEffect(() => {
33
+ const promise = highlight(code, {
34
+ ...options,
35
+ config
36
+ });
37
+ lastTask.current = promise;
38
+ promise.then((res) => {
39
+ if (lastTask.current === promise) setNode(res);
40
+ });
41
+ return () => {
42
+ lastTask.current = null;
43
+ };
44
+ }, deps);
45
+ return node;
46
+ }
47
+ /**
48
+ * get highlighted results, should be used with React Suspense API.
49
+ *
50
+ * note: results are cached with (lang, code) as keys, if this is not the desired behaviour, pass a `deps` instead.
51
+ */
52
+ function useShiki(code, options, deps) {
53
+ const config = useShikiConfig(options.config);
54
+ const key = useMemo(() => {
55
+ return deps ? JSON.stringify(deps) : `${options.lang}:${code}`;
56
+ }, [
57
+ code,
58
+ deps,
59
+ options.lang
60
+ ]);
61
+ return use(promises[key] ??= highlight(code, {
62
+ ...options,
63
+ config
64
+ }));
65
+ }
66
+
67
+ //#endregion
68
+ export { ShikiConfigProvider, useShiki, useShikiConfig, useShikiConfigOptional, useShikiDynamic };
@@ -0,0 +1,27 @@
1
+ import { n as DistributiveOmit } from "../../types-BSnJn7kF.js";
2
+ import { ResolvedShikiConfig } from "../config.js";
3
+ import { ReactNode } from "react";
4
+ import { Components } from "hast-util-to-jsx-runtime";
5
+ import { BundledLanguage, BundledTheme, CodeOptionsMeta, CodeOptionsThemes, CodeToHastOptionsCommon, HighlighterCore, LanguageRegistration, ThemeRegistrationAny } from "shiki";
6
+ import { Root } from "hast";
7
+
8
+ //#region src/highlight/core/index.d.ts
9
+ type CoreHighlightOptions = CodeToHastOptionsCommon<BundledLanguage> & CodeOptionsMeta & {
10
+ config: ResolvedShikiConfig;
11
+ components?: Partial<Components>;
12
+ fallbackLanguage?: BundledLanguage;
13
+ } & (CodeOptionsThemes<BundledTheme> | Record<never, never>);
14
+ declare function highlightHast(code: string, options: DistributiveOmit<CoreHighlightOptions, 'components'>): Promise<Root>;
15
+ /**
16
+ * Get Shiki highlighter instance of Hanzo Docs (mostly for internal use, you should use Shiki directly over this).
17
+ *
18
+ * @param engineType - Shiki Regex engine to use.
19
+ * @param options - Shiki options.
20
+ */
21
+ declare function getHighlighter(config: ResolvedShikiConfig, options?: {
22
+ langs?: (BundledLanguage | LanguageRegistration)[];
23
+ themes?: (BundledTheme | ThemeRegistrationAny)[];
24
+ }): Promise<HighlighterCore>;
25
+ declare function highlight(code: string, options: CoreHighlightOptions): Promise<ReactNode>;
26
+ //#endregion
27
+ export { CoreHighlightOptions, getHighlighter, highlight, highlightHast };
@@ -0,0 +1,69 @@
1
+ import { Fragment } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { toJsxRuntime } from "hast-util-to-jsx-runtime";
4
+
5
+ //#region src/highlight/core/index.ts
6
+ async function highlightHast(code, options) {
7
+ const { fallbackLanguage = "text", config, ...resolved } = options;
8
+ let themesToLoad;
9
+ if (!("theme" in resolved) && !("themes" in resolved)) Object.assign(resolved, config.defaultThemes);
10
+ if ("theme" in resolved) themesToLoad = [resolved.theme];
11
+ else if ("themes" in resolved) {
12
+ themesToLoad = Object.values(resolved.themes).filter((v) => v !== void 0);
13
+ resolved.defaultColor ??= false;
14
+ } else throw new Error("impossible");
15
+ const { isSpecialLang } = await import("shiki/core");
16
+ const highlighter = await config.createHighlighter();
17
+ if (!isSpecialLang(resolved.lang) && !(resolved.lang in highlighter.getBundledLanguages()) && !highlighter.getLoadedLanguages().includes(resolved.lang)) resolved.lang = fallbackLanguage;
18
+ await Promise.all([loadMissingTheme(highlighter, ...themesToLoad), loadMissingLanguage(highlighter, resolved.lang)]);
19
+ return highlighter.codeToHast(code, resolved);
20
+ }
21
+ async function loadMissingTheme(highlighter, ...themes) {
22
+ const { isSpecialTheme } = await import("shiki/core");
23
+ const missingThemes = themes.filter((theme) => {
24
+ if (isSpecialTheme(theme)) return false;
25
+ try {
26
+ highlighter.getTheme(theme);
27
+ return false;
28
+ } catch {
29
+ return true;
30
+ }
31
+ });
32
+ if (missingThemes.length > 0) await highlighter.loadTheme(...missingThemes);
33
+ }
34
+ async function loadMissingLanguage(highlighter, ...langs) {
35
+ const { isSpecialLang } = await import("shiki/core");
36
+ const missingLangs = langs.filter((lang) => {
37
+ if (isSpecialLang(lang)) return false;
38
+ try {
39
+ highlighter.getLanguage(lang);
40
+ return false;
41
+ } catch {
42
+ return true;
43
+ }
44
+ });
45
+ if (missingLangs.length > 0) await highlighter.loadLanguage(...missingLangs);
46
+ }
47
+ /**
48
+ * Get Shiki highlighter instance of Hanzo Docs (mostly for internal use, you should use Shiki directly over this).
49
+ *
50
+ * @param engineType - Shiki Regex engine to use.
51
+ * @param options - Shiki options.
52
+ */
53
+ async function getHighlighter(config, options) {
54
+ const highlighter = await config.createHighlighter();
55
+ await Promise.all([options?.langs && loadMissingLanguage(highlighter, ...options.langs), options?.themes && loadMissingTheme(highlighter, ...options.themes)]);
56
+ return highlighter;
57
+ }
58
+ async function highlight(code, options) {
59
+ return toJsxRuntime(await highlightHast(code, options), {
60
+ jsx,
61
+ jsxs,
62
+ development: false,
63
+ Fragment,
64
+ components: options.components
65
+ });
66
+ }
67
+
68
+ //#endregion
69
+ export { getHighlighter, highlight, highlightHast };
@@ -1,2 +1,34 @@
1
- import { a as hastToJsx, i as getHighlighter, n as HighlightOptionsCommon, o as highlight, r as HighlightOptionsThemes, s as highlightHast, t as HighlightOptions } from "../shiki-CIBQys54.js";
2
- export { type HighlightOptions, type HighlightOptionsCommon, type HighlightOptionsThemes, getHighlighter, hastToJsx, highlight, highlightHast };
1
+ import { n as DistributiveOmit } from "../types-BSnJn7kF.js";
2
+ import { ResolvedShikiConfig } from "./config.js";
3
+ import { CoreHighlightOptions } from "./core/index.js";
4
+ import { ReactNode } from "react";
5
+ import * as shiki from "shiki";
6
+ import { BundledLanguage, BundledTheme, LanguageRegistration, ThemeRegistrationAny } from "shiki";
7
+ import { Root } from "hast";
8
+
9
+ //#region src/highlight/index.d.ts
10
+ type HighlightOptions = DistributiveOmit<CoreHighlightOptions, 'config'> & {
11
+ /**
12
+ * The Regex Engine for Shiki
13
+ *
14
+ * @defaultValue 'js'
15
+ */
16
+ engine?: 'js' | 'oniguruma';
17
+ };
18
+ declare function highlightHast(code: string, options: HighlightOptions): Promise<Root>;
19
+ /**
20
+ * Get Shiki highlighter instance of Hanzo Docs (mostly for internal use, you should use Shiki directly over this).
21
+ *
22
+ * @param engineType - Shiki Regex engine to use.
23
+ * @param options - Shiki options.
24
+ */
25
+ declare function getHighlighter(engineType: 'js' | 'oniguruma', options?: {
26
+ langs?: (BundledLanguage | LanguageRegistration)[];
27
+ themes?: (BundledTheme | ThemeRegistrationAny)[];
28
+ }): Promise<shiki.HighlighterCore>;
29
+ declare function highlight(code: string, options: HighlightOptions): Promise<ReactNode>;
30
+ declare const configDefault: ResolvedShikiConfig;
31
+ /** config using the WASM powered Regex engine */
32
+ declare const configWASM: ResolvedShikiConfig;
33
+ //#endregion
34
+ export { HighlightOptions, configDefault, configWASM, getHighlighter, highlight, highlightHast };
@@ -1,3 +1,58 @@
1
- import { a as highlightHast, i as highlight, n as getHighlighter, r as hastToJsx } from "../shiki-4oMYwHED.js";
1
+ import { getHighlighter as getHighlighter$1, highlight as highlight$1, highlightHast as highlightHast$1 } from "./core/index.js";
2
+ import { defineShikiConfig } from "./config.js";
2
3
 
3
- export { getHighlighter, hastToJsx, highlight, highlightHast };
4
+ //#region src/highlight/index.ts
5
+ async function highlightHast(code, options) {
6
+ const engine = options.engine ?? "js";
7
+ return highlightHast$1(code, {
8
+ ...options,
9
+ config: engine === "js" ? configDefault : configWASM
10
+ });
11
+ }
12
+ /**
13
+ * Get Shiki highlighter instance of Hanzo Docs (mostly for internal use, you should use Shiki directly over this).
14
+ *
15
+ * @param engineType - Shiki Regex engine to use.
16
+ * @param options - Shiki options.
17
+ */
18
+ async function getHighlighter(engineType, options) {
19
+ return getHighlighter$1(engineType === "js" ? configDefault : configWASM, options);
20
+ }
21
+ async function highlight(code, options) {
22
+ const engine = options.engine ?? "js";
23
+ return highlight$1(code, {
24
+ ...options,
25
+ config: engine === "js" ? configDefault : configWASM
26
+ });
27
+ }
28
+ const defaultThemes = { themes: {
29
+ light: "github-light",
30
+ dark: "github-dark"
31
+ } };
32
+ const configDefault = defineShikiConfig({
33
+ defaultThemes,
34
+ async createHighlighter() {
35
+ const { createHighlighter } = await import("shiki");
36
+ const { createJavaScriptRegexEngine } = await import("shiki/engine/javascript");
37
+ return createHighlighter({
38
+ langs: [],
39
+ themes: [],
40
+ engine: createJavaScriptRegexEngine()
41
+ });
42
+ }
43
+ });
44
+ /** config using the WASM powered Regex engine */
45
+ const configWASM = defineShikiConfig({
46
+ defaultThemes,
47
+ async createHighlighter() {
48
+ const { createHighlighter, createOnigurumaEngine } = await import("shiki");
49
+ return createHighlighter({
50
+ langs: [],
51
+ themes: [],
52
+ engine: createOnigurumaEngine(import("shiki/wasm"))
53
+ });
54
+ }
55
+ });
56
+
57
+ //#endregion
58
+ export { configDefault, configWASM, getHighlighter, highlight, highlightHast };
@@ -1,2 +1,40 @@
1
- import { n as defineI18n, t as I18nConfig } from "../index-Bw-DCOra.js";
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: 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?: Languages | null;
37
+ }
38
+ declare function defineI18n<Languages extends string>(config: I18nConfig<Languages>): I18nConfig<Languages>;
39
+ //#endregion
2
40
  export { I18nConfig, defineI18n };
@@ -4,5 +4,4 @@ function defineI18n(config) {
4
4
  }
5
5
 
6
6
  //#endregion
7
- export { defineI18n };
8
- //# sourceMappingURL=index.js.map
7
+ export { defineI18n };
@@ -1,4 +1,4 @@
1
- import { t as I18nConfig } from "../index-Bw-DCOra.js";
1
+ import { I18nConfig } from "./index.js";
2
2
  import { NextProxy } from "next/server";
3
3
  import { NextURL } from "next/dist/server/web/next-url";
4
4
 
@@ -38,5 +38,4 @@ declare function createI18nMiddleware({
38
38
  hideLocale
39
39
  }: MiddlewareOptions): NextProxy;
40
40
  //#endregion
41
- export { DefaultFormatter, URLFormatter, createI18nMiddleware };
42
- //# sourceMappingURL=middleware.d.ts.map
41
+ export { DefaultFormatter, URLFormatter, createI18nMiddleware };
@@ -54,5 +54,4 @@ function createI18nMiddleware({ languages, defaultLanguage, format = DefaultForm
54
54
  }
55
55
 
56
56
  //#endregion
57
- export { DefaultFormatter, createI18nMiddleware };
58
- //# sourceMappingURL=middleware.js.map
57
+ export { DefaultFormatter, createI18nMiddleware };
@@ -15,5 +15,4 @@ function iconPlugin(resolveIcon) {
15
15
  }
16
16
 
17
17
  //#endregion
18
- export { iconPlugin as t };
19
- //# sourceMappingURL=icon-BWwSDabM.js.map
18
+ export { iconPlugin as t };
package/dist/link.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react6 from "react";
1
+ import * as react from "react";
2
2
  import { AnchorHTMLAttributes } from "react";
3
3
 
4
4
  //#region src/link.d.ts
@@ -14,7 +14,6 @@ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
14
14
  */
15
15
  prefetch?: boolean;
16
16
  }
17
- declare const Link: react6.ForwardRefExoticComponent<LinkProps & react6.RefAttributes<HTMLAnchorElement>>;
17
+ declare const Link: react.ForwardRefExoticComponent<LinkProps & react.RefAttributes<HTMLAnchorElement>>;
18
18
  //#endregion
19
- export { LinkProps, Link as default };
20
- //# sourceMappingURL=link.d.ts.map
19
+ export { LinkProps, Link as default };
package/dist/link.js CHANGED
@@ -25,5 +25,4 @@ const Link = forwardRef(({ href = "#", external = href.match(/^\w+:/) || href.st
25
25
  Link.displayName = "Link";
26
26
 
27
27
  //#endregion
28
- export { Link as default };
29
- //# sourceMappingURL=link.js.map
28
+ export { Link as default };
@@ -36,5 +36,4 @@ function toMdxExport(name, value) {
36
36
  }
37
37
 
38
38
  //#endregion
39
- export { toMdxExport as n, flattenNode as t };
40
- //# sourceMappingURL=mdast-utils-mc9-X-PK.js.map
39
+ export { toMdxExport as n, flattenNode as t };
@@ -1,2 +1,36 @@
1
- import { i as parseCodeBlockAttributes, n as CodeBlockTabsOptions, r as generateCodeBlockTabs, t as CodeBlockAttributes } from "../codeblock-utils-lld8UiQo.js";
1
+ import { BlockContent, Text } from "mdast";
2
+ import { MdxJsxAttribute, MdxJsxFlowElement } from "mdast-util-mdx-jsx";
3
+
4
+ //#region src/mdx-plugins/codeblock-utils.d.ts
5
+ interface CodeBlockTabsOptions {
6
+ attributes?: MdxJsxAttribute[];
7
+ defaultValue?: string;
8
+ persist?: {
9
+ id: string;
10
+ } | false;
11
+ triggers: {
12
+ value: string;
13
+ children: (BlockContent | Text)[];
14
+ }[];
15
+ tabs: {
16
+ value: string;
17
+ children: BlockContent[];
18
+ }[];
19
+ }
20
+ declare function generateCodeBlockTabs({
21
+ persist,
22
+ defaultValue,
23
+ triggers,
24
+ tabs,
25
+ ...options
26
+ }: CodeBlockTabsOptions): MdxJsxFlowElement;
27
+ interface CodeBlockAttributes<Name extends string = string> {
28
+ attributes: Partial<Record<Name, string | null>>;
29
+ rest: string;
30
+ }
31
+ /**
32
+ * Parse Hanzo Docs-style code block attributes from meta string, like `title="hello world"`
33
+ */
34
+ declare function parseCodeBlockAttributes<Name extends string = string>(meta: string, allowedNames?: Name[]): CodeBlockAttributes<Name>;
35
+ //#endregion
2
36
  export { CodeBlockAttributes, CodeBlockTabsOptions, generateCodeBlockTabs, parseCodeBlockAttributes };
@@ -49,7 +49,7 @@ function generateCodeBlockTabs({ persist = false, defaultValue, triggers, tabs,
49
49
  };
50
50
  }
51
51
  /**
52
- * Parse Fumadocs-style code block attributes from meta string, like `title="hello world"`
52
+ * Parse Hanzo Docs-style code block attributes from meta string, like `title="hello world"`
53
53
  */
54
54
  function parseCodeBlockAttributes(meta, allowedNames) {
55
55
  let str = meta;
@@ -67,5 +67,4 @@ function parseCodeBlockAttributes(meta, allowedNames) {
67
67
  }
68
68
 
69
69
  //#endregion
70
- export { generateCodeBlockTabs, parseCodeBlockAttributes };
71
- //# sourceMappingURL=codeblock-utils.js.map
70
+ export { generateCodeBlockTabs, parseCodeBlockAttributes };
@@ -1,15 +1,18 @@
1
- import { n as remarkGfm, t as RemarkGfmOptions } from "../remark-gfm-CeWpMwyk.js";
2
- import { a as CodeBlockIcon, i as transformerTab, n as rehypeCode, o as transformerIcon, r as rehypeCodeDefaultOptions, t as RehypeCodeOptions } from "../rehype-code-vVWG4-ej.js";
3
- import { n as remarkImage, t as RemarkImageOptions } from "../remark-image-CvUis4R1.js";
4
- import { a as structure, i as remarkStructureDefaultOptions, n as StructuredData, r as remarkStructure, t as StructureOptions } from "../remark-structure-RZD2gGKp.js";
5
- import { n as remarkHeading, t as RemarkHeadingOptions } from "../remark-heading-CXvCY0go.js";
6
- import { n as remarkAdmonition, t as RemarkAdmonitionOptions } from "../remark-admonition-DOwBWzsH.js";
7
- import { n as remarkDirectiveAdmonition, t as RemarkDirectiveAdmonitionOptions } from "../remark-directive-admonition-BCm_yiU9.js";
8
- import { n as rehypeToc, t as RehypeTocOptions } from "../rehype-toc-DJvSyE0o.js";
9
- import { n as remarkCodeTab, t as RemarkCodeTabOptions } from "../remark-code-tab-CXsYlims.js";
10
- import { n as remarkSteps, t as RemarkStepsOptions } from "../remark-steps-CHJN-rtm.js";
11
- import { n as remarkNpm, t as RemarkNpmOptions } from "../remark-npm-BIvIEKT2.js";
12
- import { i as parseCodeBlockAttributes, n as CodeBlockTabsOptions, r as generateCodeBlockTabs, t as CodeBlockAttributes } from "../codeblock-utils-lld8UiQo.js";
13
- import { n as remarkMdxFiles, t as RemarkMdxFilesOptions } from "../remark-mdx-files-DOYafA4x.js";
14
- import { n as remarkMdxMermaid, t as RemarkMdxMermaidOptions } from "../remark-mdx-mermaid-BdSUUiCG.js";
15
- export { CodeBlockAttributes, CodeBlockIcon, CodeBlockTabsOptions, RehypeCodeOptions, RehypeTocOptions, RemarkAdmonitionOptions, RemarkCodeTabOptions, RemarkDirectiveAdmonitionOptions, RemarkGfmOptions, RemarkHeadingOptions, RemarkImageOptions, RemarkMdxFilesOptions, RemarkMdxMermaidOptions, RemarkNpmOptions, RemarkStepsOptions, StructureOptions, StructuredData, generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkCodeTab, remarkDirectiveAdmonition, remarkGfm, remarkHeading, remarkImage, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkSteps, remarkStructure, remarkStructureDefaultOptions, structure, transformerIcon, transformerTab };
1
+ import { RemarkGfmOptions, remarkGfm } from "./remark-gfm.js";
2
+ import { r as transformerIcon, t as CodeBlockIcon } from "../transformer-icon-D7-6aFzt.js";
3
+ import { transformerTab } from "./rehype-code.core.js";
4
+ import { RehypeCodeOptions, rehypeCode, rehypeCodeDefaultOptions } from "./rehype-code.js";
5
+ import { RemarkImageOptions, remarkImage } from "./remark-image.js";
6
+ import { StructureOptions, StructuredData, remarkStructure, remarkStructureDefaultOptions, structure } from "./remark-structure.js";
7
+ import { RemarkHeadingOptions, remarkHeading } from "./remark-heading.js";
8
+ import { RemarkAdmonitionOptions, remarkAdmonition } from "./remark-admonition.js";
9
+ import { RemarkDirectiveAdmonitionOptions, remarkDirectiveAdmonition } from "./remark-directive-admonition.js";
10
+ import { RehypeTocOptions, rehypeToc } from "./rehype-toc.js";
11
+ import { RemarkCodeTabOptions, remarkCodeTab } from "./remark-code-tab.js";
12
+ import { RemarkStepsOptions, remarkSteps } from "./remark-steps.js";
13
+ import { RemarkNpmOptions, remarkNpm } from "./remark-npm.js";
14
+ import { CodeBlockAttributes, CodeBlockTabsOptions, generateCodeBlockTabs, parseCodeBlockAttributes } from "./codeblock-utils.js";
15
+ import { RemarkMdxFilesOptions, remarkMdxFiles } from "./remark-mdx-files.js";
16
+ import { RemarkMdxMermaidOptions, remarkMdxMermaid } from "./remark-mdx-mermaid.js";
17
+ import { FeedbackBlockProps, RemarkFeedbackBlockOptions, remarkFeedbackBlock } from "./remark-feedback-block.js";
18
+ export { CodeBlockAttributes, CodeBlockIcon, CodeBlockTabsOptions, FeedbackBlockProps, RehypeCodeOptions, RehypeTocOptions, RemarkAdmonitionOptions, RemarkCodeTabOptions, RemarkDirectiveAdmonitionOptions, RemarkFeedbackBlockOptions, RemarkGfmOptions, RemarkHeadingOptions, RemarkImageOptions, type RemarkMdxFilesOptions, RemarkMdxMermaidOptions, RemarkNpmOptions, RemarkStepsOptions, StructureOptions, StructuredData, generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkCodeTab, remarkDirectiveAdmonition, remarkFeedbackBlock, remarkGfm, remarkHeading, remarkImage, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkSteps, remarkStructure, remarkStructureDefaultOptions, structure, transformerIcon, transformerTab };
@@ -1,18 +1,20 @@
1
- import "../mdast-utils-mc9-X-PK.js";
1
+ import "../mdast-utils-gJMY143g.js";
2
2
  import { remarkHeading } from "./remark-heading.js";
3
- import "../shiki-4oMYwHED.js";
4
3
  import { generateCodeBlockTabs, parseCodeBlockAttributes } from "./codeblock-utils.js";
5
4
  import { remarkGfm } from "./remark-gfm.js";
6
- import { i as transformerIcon, n as rehypeCodeDefaultOptions, r as transformerTab, t as rehypeCode } from "../rehype-code-CdiZ1Y6P.js";
5
+ import { t as transformerIcon } from "../transformer-icon-BYedaeE8.js";
6
+ import { transformerTab } from "./rehype-code.core.js";
7
+ import { rehypeCode, rehypeCodeDefaultOptions } from "./rehype-code.js";
7
8
  import { remarkImage } from "./remark-image.js";
8
9
  import { remarkStructure, remarkStructureDefaultOptions, structure } from "./remark-structure.js";
9
10
  import { remarkAdmonition } from "./remark-admonition.js";
10
11
  import { remarkDirectiveAdmonition } from "./remark-directive-admonition.js";
11
- import { t as rehypeToc } from "../rehype-toc-DVwJcwvA.js";
12
+ import { rehypeToc } from "./rehype-toc.js";
12
13
  import { remarkCodeTab } from "./remark-code-tab.js";
13
14
  import { remarkSteps } from "./remark-steps.js";
14
15
  import { remarkNpm } from "./remark-npm.js";
15
16
  import { remarkMdxFiles } from "./remark-mdx-files.js";
16
17
  import { remarkMdxMermaid } from "./remark-mdx-mermaid.js";
18
+ import { remarkFeedbackBlock } from "./remark-feedback-block.js";
17
19
 
18
- export { generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkCodeTab, remarkDirectiveAdmonition, remarkGfm, remarkHeading, remarkImage, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkSteps, remarkStructure, remarkStructureDefaultOptions, structure, transformerIcon, transformerTab };
20
+ export { generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkCodeTab, remarkDirectiveAdmonition, remarkFeedbackBlock, remarkGfm, remarkHeading, remarkImage, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkSteps, remarkStructure, remarkStructureDefaultOptions, structure, transformerIcon, transformerTab };
@@ -0,0 +1,38 @@
1
+ import { n as IconOptions, r as transformerIcon, t as CodeBlockIcon } from "../transformer-icon-D7-6aFzt.js";
2
+ import { n as DistributiveOmit } from "../types-BSnJn7kF.js";
3
+ import { ResolvedShikiConfig } from "../highlight/config.js";
4
+ import { ShikiTransformer } from "shiki";
5
+ import { Processor, Transformer } from "unified";
6
+ import { Root } from "hast";
7
+ import { RehypeShikiOptions } from "@shikijs/rehype";
8
+
9
+ //#region src/mdx-plugins/rehype-code.core.d.ts
10
+ declare function rehypeCodeDefaultOptions(config: ResolvedShikiConfig): RehypeCodeOptionsCommon;
11
+ type RehypeCodeOptionsCommon = DistributiveOmit<RehypeShikiOptions, 'lazy'> & {
12
+ /**
13
+ * Load languages and themes on-demand.
14
+ * @defaultValue true
15
+ */
16
+ lazy?: boolean;
17
+ /**
18
+ * Filter meta string before processing
19
+ */
20
+ filterMetaString?: (metaString: string) => string;
21
+ /**
22
+ * Add icon to code blocks
23
+ */
24
+ icon?: IconOptions | false;
25
+ /**
26
+ * Wrap code blocks in `<Tab>` component when "tab" meta string presents
27
+ *
28
+ * @defaultValue true
29
+ */
30
+ tab?: boolean;
31
+ };
32
+ declare function createRehypeCode<Options extends Partial<RehypeCodeOptionsCommon> = Partial<RehypeCodeOptionsCommon>>(configFactory: ResolvedShikiConfig | ((options?: Options) => {
33
+ config: ResolvedShikiConfig;
34
+ options: RehypeCodeOptionsCommon;
35
+ })): (this: Processor, _options: Options | undefined) => Transformer<Root, Root>;
36
+ declare function transformerTab(): ShikiTransformer;
37
+ //#endregion
38
+ export { type CodeBlockIcon, RehypeCodeOptionsCommon, createRehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };