fumadocs-core 16.0.7 → 16.0.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 (54) hide show
  1. package/dist/breadcrumb.js +3 -3
  2. package/dist/chunk-A4G5V4FQ.js +47 -0
  3. package/dist/chunk-ADBHPKXG.js +78 -0
  4. package/dist/chunk-CH7YHH7V.js +222 -0
  5. package/dist/chunk-EFVXL2PP.js +144 -0
  6. package/dist/chunk-FUUVPEA5.js +29 -0
  7. package/dist/chunk-GLRQBLGN.js +59 -0
  8. package/dist/{chunk-JD3M54YF.js → chunk-HNZEUF6C.js} +4 -47
  9. package/dist/chunk-JOXPHQ2R.js +73 -0
  10. package/dist/chunk-ONG4RVCR.js +8 -0
  11. package/dist/chunk-SLIKY7GW.js +111 -0
  12. package/dist/chunk-TWIDBWFG.js +84 -0
  13. package/dist/chunk-VW3XKOZZ.js +214 -0
  14. package/dist/chunk-X2HFD5QJ.js +275 -0
  15. package/dist/chunk-XJ6ZQNEX.js +91 -0
  16. package/dist/content/github.d.ts +7 -1
  17. package/dist/content/github.js +2 -1
  18. package/dist/content/toc.js +2 -1
  19. package/dist/mdx-plugins/codeblock-utils.d.ts +29 -0
  20. package/dist/mdx-plugins/codeblock-utils.js +9 -0
  21. package/dist/mdx-plugins/index.d.ts +18 -247
  22. package/dist/mdx-plugins/index.js +42 -1326
  23. package/dist/mdx-plugins/rehype-code.d.ts +55 -0
  24. package/dist/mdx-plugins/rehype-code.js +15 -0
  25. package/dist/mdx-plugins/rehype-toc.d.ts +14 -0
  26. package/dist/mdx-plugins/rehype-toc.js +7 -0
  27. package/dist/mdx-plugins/remark-admonition.d.ts +18 -0
  28. package/dist/mdx-plugins/remark-admonition.js +8 -0
  29. package/dist/mdx-plugins/remark-code-tab.d.ts +30 -0
  30. package/dist/mdx-plugins/remark-code-tab.js +8 -0
  31. package/dist/mdx-plugins/remark-gfm.d.ts +1 -0
  32. package/dist/mdx-plugins/remark-gfm.js +7 -0
  33. package/dist/mdx-plugins/remark-heading.d.ts +31 -0
  34. package/dist/mdx-plugins/remark-heading.js +8 -0
  35. package/dist/mdx-plugins/remark-image.d.ts +57 -0
  36. package/dist/mdx-plugins/remark-image.js +7 -0
  37. package/dist/mdx-plugins/remark-mdx-files.d.ts +40 -0
  38. package/dist/mdx-plugins/remark-mdx-files.js +7 -0
  39. package/dist/mdx-plugins/remark-mdx-mermaid.d.ts +15 -0
  40. package/dist/mdx-plugins/remark-mdx-mermaid.js +7 -0
  41. package/dist/mdx-plugins/remark-npm.d.ts +31 -0
  42. package/dist/mdx-plugins/remark-npm.js +8 -0
  43. package/dist/mdx-plugins/remark-steps.d.ts +23 -0
  44. package/dist/mdx-plugins/remark-steps.js +7 -0
  45. package/dist/{remark-structure-BJxaB5zZ.d.ts → mdx-plugins/remark-structure.d.ts} +1 -1
  46. package/dist/mdx-plugins/remark-structure.js +10 -0
  47. package/dist/search/algolia.d.ts +1 -1
  48. package/dist/search/client.d.ts +1 -1
  49. package/dist/search/orama-cloud.d.ts +3 -2
  50. package/dist/search/server.d.ts +1 -1
  51. package/dist/search/server.js +3 -3
  52. package/dist/source/index.js +3 -3
  53. package/package.json +11 -7
  54. package/dist/remark-code-tab-DmyIyi6m.d.ts +0 -57
@@ -1,248 +1,19 @@
1
1
  export { Options as RemarkGfmOptions, default as remarkGfm } from 'remark-gfm';
2
- import { Root } from 'hast';
3
- import { RehypeShikiOptions } from '@shikijs/rehype';
4
- import { Processor, Transformer } from 'unified';
5
- import { ShikiTransformer } from 'shiki';
6
- import { Root as Root$1, BlockContent, Text } from 'mdast';
7
- export { a as StructureOptions, S as StructuredData, r as remarkStructure, s as structure } from '../remark-structure-BJxaB5zZ.js';
8
- export { a as RemarkCodeTabOptions, R as RemarkHeadingOptions, b as remarkCodeTab, r as remarkHeading } from '../remark-code-tab-DmyIyi6m.js';
9
- import { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
10
-
11
- type CodeBlockIcon = {
12
- viewBox: string;
13
- fill: string;
14
- d: string;
15
- } | string;
16
- interface IconOptions {
17
- shortcuts?: Record<string, string>;
18
- extend?: Record<string, CodeBlockIcon>;
19
- }
20
- /**
21
- * Inject icons to `icon` property (as HTML)
22
- */
23
- declare function transformerIcon(options?: IconOptions): ShikiTransformer;
24
-
25
- declare const rehypeCodeDefaultOptions: RehypeCodeOptions;
26
- type RehypeCodeOptions = RehypeShikiOptions & {
27
- /**
28
- * The regex engine to use.
29
- *
30
- * @defaultValue 'js'
31
- */
32
- engine?: 'js' | 'oniguruma';
33
- /**
34
- * Filter meta string before processing
35
- */
36
- filterMetaString?: (metaString: string) => string;
37
- /**
38
- * Add icon to code blocks
39
- */
40
- icon?: IconOptions | false;
41
- /**
42
- * Wrap code blocks in `<Tab>` component when "tab" meta string presents
43
- *
44
- * @defaultValue true
45
- */
46
- tab?: boolean;
47
- };
48
- /**
49
- * Handle codeblocks
50
- */
51
- declare function rehypeCode(this: Processor, _options?: Partial<RehypeCodeOptions>): Transformer<Root, Root>;
52
- declare function transformerTab(): ShikiTransformer;
53
-
54
- type ExternalImageOptions = {
55
- /**
56
- * timeout for fetching remote images (in milliseconds)
57
- */
58
- timeout?: number;
59
- } | boolean;
60
- interface RemarkImageOptions {
61
- /**
62
- * Directory or base URL to resolve absolute image paths
63
- */
64
- publicDir?: string;
65
- /**
66
- * Preferred placeholder type, only available with `useImport` + local images.
67
- *
68
- * @defaultValue 'blur'
69
- */
70
- placeholder?: 'blur' | 'none';
71
- /**
72
- * Define how to handle errors when fetching image size.
73
- *
74
- * - `error` (default): throw an error.
75
- * - `ignore`: do absolutely nothing (Next.js Image component may complain).
76
- * - `hide`: remove that image element.
77
- *
78
- * @defaultValue 'error'
79
- */
80
- onError?: 'error' | 'hide' | 'ignore' | ((error: Error) => void);
81
- /**
82
- * Import images in the file, and let bundlers handle it.
83
- *
84
- * ```tsx
85
- * import MyImage from "./public/img.png";
86
- *
87
- * <img src={MyImage} />
88
- * ```
89
- *
90
- * When disabled, `placeholder` will be ignored.
91
- *
92
- * @defaultValue true
93
- */
94
- useImport?: boolean;
95
- /**
96
- * Fetch image size of external URLs
97
- *
98
- * @defaultValue true
99
- */
100
- external?: ExternalImageOptions;
101
- }
102
- /**
103
- * Turn images into Next.js Image compatible usage.
104
- */
105
- declare function remarkImage({ placeholder, external, useImport, onError, publicDir, }?: RemarkImageOptions): Transformer<Root$1, Root$1>;
106
-
107
- interface RemarkAdmonitionOptions {
108
- tag?: string;
109
- /**
110
- * Map type to another type
111
- */
112
- typeMap?: Record<string, string>;
113
- }
114
- /**
115
- * Remark Plugin to support Admonition syntax
116
- *
117
- * Useful when Migrating from Docusaurus
118
- */
119
- declare function remarkAdmonition(options?: RemarkAdmonitionOptions): Transformer<Root$1, Root$1>;
120
-
121
- interface RehypeTocOptions {
122
- /**
123
- * Export generated toc as a variable
124
- *
125
- * @defaultValue true
126
- */
127
- exportToc?: boolean;
128
- }
129
- declare function rehypeToc(this: Processor, { exportToc }?: RehypeTocOptions): Transformer<Root, Root>;
130
-
131
- interface RemarkStepsOptions {
132
- /**
133
- * Class name for steps container
134
- *
135
- * @defaultValue fd-steps
136
- */
137
- steps?: string;
138
- /**
139
- * Class name for step container
140
- *
141
- * @defaultValue fd-step
142
- */
143
- step?: string;
144
- }
145
- /**
146
- * Convert headings in the format of `1. Hello World` into steps.
147
- */
148
- declare function remarkSteps({ steps, step, }?: RemarkStepsOptions): Transformer<Root$1, Root$1>;
149
-
150
- interface PackageManager {
151
- name: string;
152
- /**
153
- * Default to `name`
154
- */
155
- value?: string;
156
- /**
157
- * Convert from npm to another package manager
158
- */
159
- command: (command: string) => string | undefined;
160
- }
161
- interface RemarkNpmOptions {
162
- /**
163
- * Persist Tab value (Fumadocs UI only)
164
- *
165
- * @defaultValue false
166
- */
167
- persist?: {
168
- id: string;
169
- } | false;
170
- packageManagers?: PackageManager[];
171
- }
172
- /**
173
- * It generates multiple tabs of codeblocks for different package managers from a npm command codeblock.
174
- */
175
- declare function remarkNpm({ persist, packageManagers, }?: RemarkNpmOptions): Transformer<Root$1, Root$1>;
176
-
177
- interface CodeBlockTabsOptions {
178
- attributes?: MdxJsxAttribute[];
179
- defaultValue?: string;
180
- persist?: {
181
- id: string;
182
- } | false;
183
- triggers: {
184
- value: string;
185
- children: (BlockContent | Text)[];
186
- }[];
187
- tabs: {
188
- value: string;
189
- children: BlockContent[];
190
- }[];
191
- }
192
- declare function generateCodeBlockTabs({ persist, defaultValue, triggers, tabs, ...options }: CodeBlockTabsOptions): MdxJsxFlowElement;
193
- interface CodeBlockAttributes<Name extends string = string> {
194
- attributes: Partial<Record<Name, string | null>>;
195
- rest: string;
196
- }
197
- /**
198
- * Parse Fumadocs-style code block attributes from meta string, like `title="hello world"`
199
- */
200
- declare function parseCodeBlockAttributes<Name extends string = string>(meta: string, allowedNames?: Name[]): CodeBlockAttributes<Name>;
201
-
202
- interface FileNode {
203
- depth: number;
204
- type: 'file';
205
- name: string;
206
- }
207
- interface FolderNode {
208
- depth: number;
209
- type: 'folder';
210
- name: string;
211
- children: Node[];
212
- }
213
- type Node = FileNode | FolderNode;
214
- interface RemarkMdxFilesOptions {
215
- /**
216
- * @defaultValue files
217
- */
218
- lang?: string;
219
- toMdx?: (node: Node) => MdxJsxFlowElement;
220
- }
221
- /**
222
- * Convert codeblocks with `files` as lang, like:
223
- *
224
- * ```files
225
- * project
226
- * ├── src
227
- * │ ├── index.js
228
- * │ └── utils
229
- * │ └── helper.js
230
- * ├── package.json
231
- * ```
232
- *
233
- * into MDX `<Files />` component
234
- */
235
- declare function remarkMdxFiles(options?: RemarkMdxFilesOptions): Transformer<Root$1, Root$1>;
236
-
237
- interface RemarkMdxMermaidOptions {
238
- /**
239
- * @defaultValue mermaid
240
- */
241
- lang?: string;
242
- }
243
- /**
244
- * Convert `mermaid` codeblocks into `<Mermaid />` MDX component
245
- */
246
- declare function remarkMdxMermaid(options?: RemarkMdxMermaidOptions): Transformer<Root$1, Root$1>;
247
-
248
- export { type CodeBlockAttributes, type CodeBlockIcon, type CodeBlockTabsOptions, type RehypeCodeOptions, type RehypeTocOptions, type RemarkAdmonitionOptions, type RemarkImageOptions, type RemarkMdxFilesOptions, type RemarkMdxMermaidOptions, type RemarkNpmOptions, type RemarkStepsOptions, generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeToc, remarkAdmonition, remarkImage, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkSteps, transformerIcon, transformerTab };
2
+ export { CodeBlockIcon, RehypeCodeOptions, rehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab } from './rehype-code.js';
3
+ export { RemarkImageOptions, remarkImage } from './remark-image.js';
4
+ export { StructureOptions, StructuredData, remarkStructure, structure } from './remark-structure.js';
5
+ export { RemarkHeadingOptions, remarkHeading } from './remark-heading.js';
6
+ export { RemarkAdmonitionOptions, remarkAdmonition } from './remark-admonition.js';
7
+ export { RehypeTocOptions, rehypeToc } from './rehype-toc.js';
8
+ export { RemarkCodeTabOptions, remarkCodeTab } from './remark-code-tab.js';
9
+ export { RemarkStepsOptions, remarkSteps } from './remark-steps.js';
10
+ export { RemarkNpmOptions, remarkNpm } from './remark-npm.js';
11
+ export { CodeBlockAttributes, CodeBlockTabsOptions, generateCodeBlockTabs, parseCodeBlockAttributes } from './codeblock-utils.js';
12
+ export { RemarkMdxFilesOptions, remarkMdxFiles } from './remark-mdx-files.js';
13
+ export { RemarkMdxMermaidOptions, remarkMdxMermaid } from './remark-mdx-mermaid.js';
14
+ import 'hast';
15
+ import '@shikijs/rehype';
16
+ import 'unified';
17
+ import 'shiki';
18
+ import 'mdast';
19
+ import 'mdast-util-mdx-jsx';