fumadocs-core 16.0.6 → 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-QMATWJ5F.js → chunk-HNZEUF6C.js} +4 -11
  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 -241
  22. package/dist/mdx-plugins/index.js +42 -1313
  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-DkCXCzpD.d.ts → mdx-plugins/remark-structure.d.ts} +10 -5
  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 +12 -7
  54. package/dist/remark-code-tab-DmyIyi6m.d.ts +0 -57
@@ -1,242 +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-DkCXCzpD.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
- interface RemarkImageOptions {
55
- /**
56
- * Directory or base URL to resolve absolute image paths
57
- */
58
- publicDir?: string;
59
- /**
60
- * Preferred placeholder type, only available with `useImport` + local images.
61
- *
62
- * @defaultValue 'blur'
63
- */
64
- placeholder?: 'blur' | 'none';
65
- /**
66
- * Define how to handle errors when fetching image size.
67
- *
68
- * - `error` (default): throw an error.
69
- * - `ignore`: do absolutely nothing (Next.js Image component may complain).
70
- * - `hide`: remove that image element.
71
- *
72
- * @defaultValue 'error'
73
- */
74
- onError?: 'error' | 'hide' | 'ignore' | ((error: Error) => void);
75
- /**
76
- * Import images in the file, and let bundlers handle it.
77
- *
78
- * ```tsx
79
- * import MyImage from "./public/img.png";
80
- *
81
- * <img src={MyImage} />
82
- * ```
83
- *
84
- * When disabled, `placeholder` will be ignored.
85
- *
86
- * @defaultValue true
87
- */
88
- useImport?: boolean;
89
- /**
90
- * Fetch image size of external URLs
91
- *
92
- * @defaultValue true
93
- */
94
- external?: boolean;
95
- }
96
- /**
97
- * Turn images into Next.js Image compatible usage.
98
- */
99
- declare function remarkImage({ placeholder, external, useImport, onError, publicDir, }?: RemarkImageOptions): Transformer<Root$1, Root$1>;
100
-
101
- interface RemarkAdmonitionOptions {
102
- tag?: string;
103
- /**
104
- * Map type to another type
105
- */
106
- typeMap?: Record<string, string>;
107
- }
108
- /**
109
- * Remark Plugin to support Admonition syntax
110
- *
111
- * Useful when Migrating from Docusaurus
112
- */
113
- declare function remarkAdmonition(options?: RemarkAdmonitionOptions): Transformer<Root$1, Root$1>;
114
-
115
- interface RehypeTocOptions {
116
- /**
117
- * Export generated toc as a variable
118
- *
119
- * @defaultValue true
120
- */
121
- exportToc?: boolean;
122
- }
123
- declare function rehypeToc(this: Processor, { exportToc }?: RehypeTocOptions): Transformer<Root, Root>;
124
-
125
- interface RemarkStepsOptions {
126
- /**
127
- * Class name for steps container
128
- *
129
- * @defaultValue fd-steps
130
- */
131
- steps?: string;
132
- /**
133
- * Class name for step container
134
- *
135
- * @defaultValue fd-step
136
- */
137
- step?: string;
138
- }
139
- /**
140
- * Convert headings in the format of `1. Hello World` into steps.
141
- */
142
- declare function remarkSteps({ steps, step, }?: RemarkStepsOptions): Transformer<Root$1, Root$1>;
143
-
144
- interface PackageManager {
145
- name: string;
146
- /**
147
- * Default to `name`
148
- */
149
- value?: string;
150
- /**
151
- * Convert from npm to another package manager
152
- */
153
- command: (command: string) => string | undefined;
154
- }
155
- interface RemarkNpmOptions {
156
- /**
157
- * Persist Tab value (Fumadocs UI only)
158
- *
159
- * @defaultValue false
160
- */
161
- persist?: {
162
- id: string;
163
- } | false;
164
- packageManagers?: PackageManager[];
165
- }
166
- /**
167
- * It generates multiple tabs of codeblocks for different package managers from a npm command codeblock.
168
- */
169
- declare function remarkNpm({ persist, packageManagers, }?: RemarkNpmOptions): Transformer<Root$1, Root$1>;
170
-
171
- interface CodeBlockTabsOptions {
172
- attributes?: MdxJsxAttribute[];
173
- defaultValue?: string;
174
- persist?: {
175
- id: string;
176
- } | false;
177
- triggers: {
178
- value: string;
179
- children: (BlockContent | Text)[];
180
- }[];
181
- tabs: {
182
- value: string;
183
- children: BlockContent[];
184
- }[];
185
- }
186
- declare function generateCodeBlockTabs({ persist, defaultValue, triggers, tabs, ...options }: CodeBlockTabsOptions): MdxJsxFlowElement;
187
- interface CodeBlockAttributes<Name extends string = string> {
188
- attributes: Partial<Record<Name, string | null>>;
189
- rest: string;
190
- }
191
- /**
192
- * Parse Fumadocs-style code block attributes from meta string, like `title="hello world"`
193
- */
194
- declare function parseCodeBlockAttributes<Name extends string = string>(meta: string, allowedNames?: Name[]): CodeBlockAttributes<Name>;
195
-
196
- interface FileNode {
197
- depth: number;
198
- type: 'file';
199
- name: string;
200
- }
201
- interface FolderNode {
202
- depth: number;
203
- type: 'folder';
204
- name: string;
205
- children: Node[];
206
- }
207
- type Node = FileNode | FolderNode;
208
- interface RemarkMdxFilesOptions {
209
- /**
210
- * @defaultValue files
211
- */
212
- lang?: string;
213
- toMdx?: (node: Node) => MdxJsxFlowElement;
214
- }
215
- /**
216
- * Convert codeblocks with `files` as lang, like:
217
- *
218
- * ```files
219
- * project
220
- * ├── src
221
- * │ ├── index.js
222
- * │ └── utils
223
- * │ └── helper.js
224
- * ├── package.json
225
- * ```
226
- *
227
- * into MDX `<Files />` component
228
- */
229
- declare function remarkMdxFiles(options?: RemarkMdxFilesOptions): Transformer<Root$1, Root$1>;
230
-
231
- interface RemarkMdxMermaidOptions {
232
- /**
233
- * @defaultValue mermaid
234
- */
235
- lang?: string;
236
- }
237
- /**
238
- * Convert `mermaid` codeblocks into `<Mermaid />` MDX component
239
- */
240
- declare function remarkMdxMermaid(options?: RemarkMdxMermaidOptions): Transformer<Root$1, Root$1>;
241
-
242
- 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';