fumadocs-mdx 11.8.0 → 11.8.2

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getConfigHash,
3
3
  loadConfig
4
- } from "./chunk-XZR5QXVY.js";
4
+ } from "./chunk-BWRDVK5L.js";
5
5
  import {
6
6
  countLines
7
7
  } from "./chunk-UCY7OBZG.js";
@@ -12,9 +12,9 @@ import {
12
12
  } from "./chunk-GX3THK2Q.js";
13
13
  import {
14
14
  buildMDX
15
- } from "./chunk-7JFPDRW7.js";
16
- import "./chunk-IGXZS2W6.js";
17
- import "./chunk-XVL4ZQFK.js";
15
+ } from "./chunk-QQWCBFFE.js";
16
+ import "./chunk-SVTXMVLQ.js";
17
+ import "./chunk-QVZ7JH4H.js";
18
18
  import {
19
19
  fumaMatter
20
20
  } from "./chunk-VWJKRQZR.js";
@@ -38,13 +38,13 @@ async function loader(source, callback) {
38
38
  if (collection && collection.type !== "doc") {
39
39
  collection = void 0;
40
40
  }
41
- let data = matter.data;
41
+ let frontmatter = matter.data;
42
42
  const mdxOptions = collection?.mdxOptions ?? await config.getDefaultMDXOptions();
43
43
  if (collection?.schema) {
44
44
  try {
45
- data = await validate(
45
+ frontmatter = await validate(
46
46
  collection.schema,
47
- matter.data,
47
+ frontmatter,
48
48
  {
49
49
  source,
50
50
  path: filePath
@@ -73,7 +73,7 @@ async function loader(source, callback) {
73
73
  development: this.mode === "development",
74
74
  ...mdxOptions,
75
75
  filePath,
76
- frontmatter: data,
76
+ frontmatter,
77
77
  data: {
78
78
  lastModified: timestamp
79
79
  },
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDefaultMDXOptions
3
- } from "./chunk-GYWPPGFD.js";
3
+ } from "./chunk-SMSNZ6N5.js";
4
4
  export {
5
5
  getDefaultMDXOptions
6
6
  };
@@ -30,15 +30,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // src/mdx-plugins/remark-exports.ts
34
- function remarkMdxExport({ values }) {
35
- return (tree, vfile) => {
36
- for (const name of values) {
37
- if (!(name in vfile.data)) return;
38
- tree.children.unshift(getMdastExport(name, vfile.data[name]));
33
+ // src/mdx-plugins/remark-postprocess.ts
34
+ function remarkPostprocess({
35
+ injectExports
36
+ }) {
37
+ return (tree, file) => {
38
+ let title;
39
+ const urls = [];
40
+ (0, import_unist_util_visit.visit)(tree, ["heading", "link"], (node) => {
41
+ if (node.type === "heading" && node.depth === 1) {
42
+ title = flattenNode(node);
43
+ }
44
+ if (node.type !== "link") return;
45
+ urls.push({
46
+ href: node.url
47
+ });
48
+ return "skip";
49
+ });
50
+ if (title) {
51
+ file.data.frontmatter ??= {};
52
+ if (!file.data.frontmatter.title) file.data.frontmatter.title = title;
53
+ }
54
+ file.data.extractedReferences = urls;
55
+ for (const name of injectExports) {
56
+ if (!(name in file.data)) continue;
57
+ tree.children.unshift(getMdastExport(name, file.data[name]));
39
58
  }
40
59
  };
41
60
  }
61
+ function flattenNode(node) {
62
+ if ("children" in node)
63
+ return node.children.map((child) => flattenNode(child)).join("");
64
+ if ("value" in node) return node.value;
65
+ return "";
66
+ }
42
67
  function getMdastExport(name, value) {
43
68
  return {
44
69
  type: "mdxjsEsm",
@@ -50,6 +75,7 @@ function getMdastExport(name, value) {
50
75
  body: [
51
76
  {
52
77
  type: "ExportNamedDeclaration",
78
+ attributes: [],
53
79
  specifiers: [],
54
80
  source: null,
55
81
  declaration: {
@@ -72,10 +98,11 @@ function getMdastExport(name, value) {
72
98
  }
73
99
  };
74
100
  }
75
- var import_estree_util_value_to_estree;
76
- var init_remark_exports = __esm({
77
- "src/mdx-plugins/remark-exports.ts"() {
101
+ var import_unist_util_visit, import_estree_util_value_to_estree;
102
+ var init_remark_postprocess = __esm({
103
+ "src/mdx-plugins/remark-postprocess.ts"() {
78
104
  "use strict";
105
+ import_unist_util_visit = require("unist-util-visit");
79
106
  import_estree_util_value_to_estree = require("estree-util-value-to-estree");
80
107
  }
81
108
  });
@@ -107,6 +134,7 @@ function getDefaultMDXOptions({
107
134
  }) {
108
135
  const mdxExports = [
109
136
  "structuredData",
137
+ "extractedReferences",
110
138
  "frontmatter",
111
139
  "lastModified",
112
140
  ...valueToExport
@@ -138,7 +166,10 @@ function getDefaultMDXOptions({
138
166
  plugins.remarkStructure,
139
167
  remarkStructureOptions
140
168
  ],
141
- [remarkMdxExport, { values: mdxExports }]
169
+ [
170
+ remarkPostprocess,
171
+ { injectExports: mdxExports }
172
+ ]
142
173
  ],
143
174
  mdxOptions.remarkPlugins
144
175
  );
@@ -162,7 +193,7 @@ var init_mdx_options = __esm({
162
193
  "src/utils/mdx-options.ts"() {
163
194
  "use strict";
164
195
  plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
165
- init_remark_exports();
196
+ init_remark_postprocess();
166
197
  }
167
198
  });
168
199
 
@@ -2,7 +2,7 @@ import {
2
2
  findConfigFile,
3
3
  getConfigHash,
4
4
  loadConfig
5
- } from "../chunk-XZR5QXVY.js";
5
+ } from "../chunk-BWRDVK5L.js";
6
6
  import {
7
7
  getGlobPatterns,
8
8
  getImportCode,
@@ -14,7 +14,7 @@ import {
14
14
  getGitTimestamp,
15
15
  validate
16
16
  } from "../chunk-GX3THK2Q.js";
17
- import "../chunk-XVL4ZQFK.js";
17
+ import "../chunk-QVZ7JH4H.js";
18
18
  import {
19
19
  fumaMatter
20
20
  } from "../chunk-VWJKRQZR.js";
@@ -30,15 +30,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // src/mdx-plugins/remark-exports.ts
34
- function remarkMdxExport({ values }) {
35
- return (tree, vfile) => {
36
- for (const name of values) {
37
- if (!(name in vfile.data)) return;
38
- tree.children.unshift(getMdastExport(name, vfile.data[name]));
33
+ // src/mdx-plugins/remark-postprocess.ts
34
+ function remarkPostprocess({
35
+ injectExports
36
+ }) {
37
+ return (tree, file) => {
38
+ let title;
39
+ const urls = [];
40
+ (0, import_unist_util_visit2.visit)(tree, ["heading", "link"], (node) => {
41
+ if (node.type === "heading" && node.depth === 1) {
42
+ title = flattenNode2(node);
43
+ }
44
+ if (node.type !== "link") return;
45
+ urls.push({
46
+ href: node.url
47
+ });
48
+ return "skip";
49
+ });
50
+ if (title) {
51
+ file.data.frontmatter ??= {};
52
+ if (!file.data.frontmatter.title) file.data.frontmatter.title = title;
53
+ }
54
+ file.data.extractedReferences = urls;
55
+ for (const name of injectExports) {
56
+ if (!(name in file.data)) continue;
57
+ tree.children.unshift(getMdastExport(name, file.data[name]));
39
58
  }
40
59
  };
41
60
  }
61
+ function flattenNode2(node) {
62
+ if ("children" in node)
63
+ return node.children.map((child) => flattenNode2(child)).join("");
64
+ if ("value" in node) return node.value;
65
+ return "";
66
+ }
42
67
  function getMdastExport(name, value) {
43
68
  return {
44
69
  type: "mdxjsEsm",
@@ -50,6 +75,7 @@ function getMdastExport(name, value) {
50
75
  body: [
51
76
  {
52
77
  type: "ExportNamedDeclaration",
78
+ attributes: [],
53
79
  specifiers: [],
54
80
  source: null,
55
81
  declaration: {
@@ -72,10 +98,11 @@ function getMdastExport(name, value) {
72
98
  }
73
99
  };
74
100
  }
75
- var import_estree_util_value_to_estree;
76
- var init_remark_exports = __esm({
77
- "src/mdx-plugins/remark-exports.ts"() {
101
+ var import_unist_util_visit2, import_estree_util_value_to_estree;
102
+ var init_remark_postprocess = __esm({
103
+ "src/mdx-plugins/remark-postprocess.ts"() {
78
104
  "use strict";
105
+ import_unist_util_visit2 = require("unist-util-visit");
79
106
  import_estree_util_value_to_estree = require("estree-util-value-to-estree");
80
107
  }
81
108
  });
@@ -107,6 +134,7 @@ function getDefaultMDXOptions({
107
134
  }) {
108
135
  const mdxExports = [
109
136
  "structuredData",
137
+ "extractedReferences",
110
138
  "frontmatter",
111
139
  "lastModified",
112
140
  ...valueToExport
@@ -138,7 +166,10 @@ function getDefaultMDXOptions({
138
166
  plugins.remarkStructure,
139
167
  remarkStructureOptions
140
168
  ],
141
- [remarkMdxExport, { values: mdxExports }]
169
+ [
170
+ remarkPostprocess,
171
+ { injectExports: mdxExports }
172
+ ]
142
173
  ],
143
174
  mdxOptions.remarkPlugins
144
175
  );
@@ -162,7 +193,7 @@ var init_mdx_options = __esm({
162
193
  "src/utils/mdx-options.ts"() {
163
194
  "use strict";
164
195
  plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
165
- init_remark_exports();
196
+ init_remark_postprocess();
166
197
  }
167
198
  });
168
199
 
@@ -251,6 +282,7 @@ function resolveFiles({ docs, meta }) {
251
282
  var import_mdx = require("@mdx-js/mdx");
252
283
 
253
284
  // src/mdx-plugins/remark-include.ts
285
+ var import_unified = require("unified");
254
286
  var import_unist_util_visit = require("unist-util-visit");
255
287
  var path = __toESM(require("path"), 1);
256
288
  var fs2 = __toESM(require("fs/promises"), 1);
@@ -272,6 +304,10 @@ function fumaMatter(input) {
272
304
  }
273
305
 
274
306
  // src/mdx-plugins/remark-include.ts
307
+ var import_remark_parse = __toESM(require("remark-parse"), 1);
308
+ var import_remark_mdx = __toESM(require("remark-mdx"), 1);
309
+ var import_mdx_plugins = require("fumadocs-core/mdx-plugins");
310
+ var baseProcessor = (0, import_unified.unified)().use(import_mdx_plugins.remarkHeading);
275
311
  function flattenNode(node) {
276
312
  if ("children" in node)
277
313
  return node.children.map((child) => flattenNode(child)).join("");
@@ -287,86 +323,96 @@ function parseSpecifier(specifier) {
287
323
  };
288
324
  }
289
325
  function extractSection(root, section) {
326
+ let nodes;
290
327
  for (const node of root.children) {
291
328
  if (node.type === "mdxJsxFlowElement" && node.name === "section" && node.attributes.some(
292
329
  (attr) => attr.type === "mdxJsxAttribute" && attr.name === "id" && attr.value === section
293
330
  )) {
294
- return {
295
- type: "root",
296
- children: node.children
297
- };
331
+ nodes = node.children;
332
+ break;
333
+ }
334
+ if (node.type === "heading" && node.data?.hProperties?.id === section) {
335
+ nodes = [node];
336
+ continue;
298
337
  }
338
+ if (!nodes) continue;
339
+ if (node.type === "heading") break;
340
+ nodes.push(node);
299
341
  }
342
+ if (nodes)
343
+ return {
344
+ type: "root",
345
+ children: nodes
346
+ };
300
347
  }
301
348
  function remarkInclude() {
302
349
  const TagName = "include";
350
+ async function embedContent(file, heading, params, data) {
351
+ let content;
352
+ try {
353
+ content = (await fs2.readFile(file)).toString();
354
+ } catch (e) {
355
+ throw new Error(
356
+ `failed to read file ${file}
357
+ ${e instanceof Error ? e.message : String(e)}`,
358
+ { cause: e }
359
+ );
360
+ }
361
+ const ext = path.extname(file);
362
+ data._compiler?.addDependency(file);
363
+ if (params.lang || ext !== ".md" && ext !== ".mdx") {
364
+ const lang = params.lang ?? ext.slice(1);
365
+ return {
366
+ type: "code",
367
+ lang,
368
+ meta: params.meta,
369
+ value: content,
370
+ data: {}
371
+ };
372
+ }
373
+ const processor = (data._getProcessor ?? getDefaultProcessor)(
374
+ ext === ".mdx" ? "mdx" : "md"
375
+ );
376
+ let parsed = await baseProcessor.run(
377
+ processor.parse(fumaMatter(content).content)
378
+ );
379
+ if (heading) {
380
+ const extracted = extractSection(parsed, heading);
381
+ if (!extracted)
382
+ throw new Error(
383
+ `Cannot find section ${heading} in ${file}, make sure you have encapsulated the section in a <section id="${heading}"> tag.`
384
+ );
385
+ parsed = extracted;
386
+ }
387
+ await update(parsed, path.dirname(file), data);
388
+ return parsed;
389
+ }
303
390
  async function update(tree, directory, data) {
304
391
  const queue = [];
305
392
  (0, import_unist_util_visit.visit)(
306
393
  tree,
307
394
  ["mdxJsxFlowElement", "mdxJsxTextElement"],
308
- (node, _, parent) => {
309
- let specifier;
395
+ (_node, _, parent) => {
396
+ const node = _node;
397
+ if (node.name !== TagName) return;
310
398
  const params = {};
311
- if ((node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") && node.name === TagName) {
312
- const value = flattenNode(node);
313
- if (value.length > 0) {
314
- for (const attr of node.attributes) {
315
- if (attr.type === "mdxJsxAttribute" && (typeof attr.value === "string" || attr.value === null)) {
316
- params[attr.name] = attr.value;
317
- }
318
- }
319
- specifier = value;
399
+ const specifier = flattenNode(node);
400
+ if (specifier.length === 0) return "skip";
401
+ for (const attr of node.attributes) {
402
+ if (attr.type === "mdxJsxAttribute" && (typeof attr.value === "string" || attr.value === null)) {
403
+ params[attr.name] = attr.value;
320
404
  }
321
405
  }
322
- if (!specifier) return;
323
- const { file, section } = parseSpecifier(specifier);
324
- const targetPath = path.resolve(
406
+ const { file: relativePath, section } = parseSpecifier(specifier);
407
+ const file = path.resolve(
325
408
  "cwd" in params ? process.cwd() : directory,
326
- file
409
+ relativePath
327
410
  );
328
- const asCode = params.lang || !file.endsWith(".md") && !file.endsWith(".mdx");
329
411
  queue.push(
330
- fs2.readFile(targetPath).then((buffer) => buffer.toString()).then(async (content) => {
331
- data._compiler?.addDependency(targetPath);
332
- if (asCode) {
333
- const lang = params.lang ?? path.extname(file).slice(1);
334
- Object.assign(node, {
335
- type: "code",
336
- lang,
337
- meta: params.meta,
338
- value: content,
339
- data: {}
340
- });
341
- return;
342
- }
343
- const processor = data._processor ? data._processor.getProcessor(
344
- targetPath.endsWith(".md") ? "md" : "mdx"
345
- ) : this;
346
- let parsed = processor.parse(fumaMatter(content).content);
347
- if (section) {
348
- const extracted = extractSection(parsed, section);
349
- if (!extracted)
350
- throw new Error(
351
- `Cannot find section ${section} in ${file}, make sure you have encapsulated the section in a <section id="${section}"> tag`
352
- );
353
- parsed = extracted;
354
- }
355
- await update.call(
356
- processor,
357
- parsed,
358
- path.dirname(targetPath),
359
- data
360
- );
412
+ embedContent(file, section, params, data).then((replace) => {
361
413
  Object.assign(
362
414
  parent && parent.type === "paragraph" ? parent : node,
363
- parsed
364
- );
365
- }).catch((e) => {
366
- throw new Error(
367
- `failed to read file ${targetPath}
368
- ${e instanceof Error ? e.message : String(e)}`,
369
- { cause: e }
415
+ replace
370
416
  );
371
417
  })
372
418
  );
@@ -376,9 +422,14 @@ ${e instanceof Error ? e.message : String(e)}`,
376
422
  await Promise.all(queue);
377
423
  }
378
424
  return async (tree, file) => {
379
- await update.call(this, tree, path.dirname(file.path), file.data);
425
+ await update(tree, path.dirname(file.path), file.data);
380
426
  };
381
427
  }
428
+ function getDefaultProcessor(format) {
429
+ const mdProcessor = (0, import_unified.unified)().use(import_remark_parse.default);
430
+ if (format === "md") return mdProcessor;
431
+ return mdProcessor.use(import_remark_mdx.default);
432
+ }
382
433
 
383
434
  // src/utils/build-mdx.ts
384
435
  var cache2 = /* @__PURE__ */ new Map();
@@ -407,9 +458,7 @@ async function buildMDX(cacheKey, source, options) {
407
458
  ...data,
408
459
  frontmatter,
409
460
  _compiler,
410
- _processor: {
411
- getProcessor
412
- }
461
+ _getProcessor: getProcessor
413
462
  }
414
463
  });
415
464
  }
@@ -1,4 +1,4 @@
1
- import { L as LoadedConfig, a as RuntimeAsync } from '../types-BukvTPdG.cjs';
1
+ import { L as LoadedConfig, a as RuntimeAsync } from '../types-BmVgoqsr.cjs';
2
2
  import '@standard-schema/spec';
3
3
  import 'fumadocs-core/source';
4
4
  import '../define-DnJzAZrj.cjs';
@@ -6,9 +6,10 @@ import 'fumadocs-core/mdx-plugins';
6
6
  import '@mdx-js/mdx';
7
7
  import 'unified';
8
8
  import 'zod';
9
+ import '../build-mdx-DnC1jKvn.cjs';
10
+ import 'fumadocs-core/server';
9
11
  import 'react';
10
12
  import 'mdx/types';
11
- import 'fumadocs-core/server';
12
13
 
13
14
  declare function buildConfig(config: Record<string, unknown>): LoadedConfig;
14
15
 
@@ -1,4 +1,4 @@
1
- import { L as LoadedConfig, a as RuntimeAsync } from '../types-B2ozVm_9.js';
1
+ import { L as LoadedConfig, a as RuntimeAsync } from '../types-WSHJKA8L.js';
2
2
  import '@standard-schema/spec';
3
3
  import 'fumadocs-core/source';
4
4
  import '../define-DnJzAZrj.js';
@@ -6,9 +6,10 @@ import 'fumadocs-core/mdx-plugins';
6
6
  import '@mdx-js/mdx';
7
7
  import 'unified';
8
8
  import 'zod';
9
+ import '../build-mdx-DnC1jKvn.js';
10
+ import 'fumadocs-core/server';
9
11
  import 'react';
10
12
  import 'mdx/types';
11
- import 'fumadocs-core/server';
12
13
 
13
14
  declare function buildConfig(config: Record<string, unknown>): LoadedConfig;
14
15
 
@@ -4,11 +4,11 @@ import {
4
4
  } from "../chunk-NUDEC6C5.js";
5
5
  import {
6
6
  buildMDX
7
- } from "../chunk-7JFPDRW7.js";
8
- import "../chunk-IGXZS2W6.js";
7
+ } from "../chunk-QQWCBFFE.js";
8
+ import "../chunk-SVTXMVLQ.js";
9
9
  import {
10
10
  buildConfig
11
- } from "../chunk-XVL4ZQFK.js";
11
+ } from "../chunk-QVZ7JH4H.js";
12
12
  import "../chunk-VWJKRQZR.js";
13
13
 
14
14
  // src/runtime/async.ts
@@ -1,24 +1,15 @@
1
- import { TableOfContents } from 'fumadocs-core/server';
2
1
  import { FC, ReactNode } from 'react';
3
2
  import { MDXProps } from 'mdx/types';
4
- import { StructuredData } from 'fumadocs-core/mdx-plugins';
5
3
  import { a as DocCollection, b as DocsCollection, M as MetaCollection } from '../define-DnJzAZrj.cjs';
6
4
  import { StandardSchemaV1 } from '@standard-schema/spec';
7
5
  import { PageData, MetaData, Source } from 'fumadocs-core/source';
6
+ import { C as CompiledMDXProperties } from '../build-mdx-DnC1jKvn.cjs';
7
+ import 'fumadocs-core/mdx-plugins';
8
8
  import '@mdx-js/mdx';
9
9
  import 'unified';
10
10
  import 'zod';
11
+ import 'fumadocs-core/server';
11
12
 
12
- interface CompiledMDXProperties<Frontmatter> {
13
- frontmatter: Frontmatter;
14
- structuredData: StructuredData;
15
- toc: TableOfContents;
16
- default: FC<MDXProps>;
17
- /**
18
- * Only available when `lastModifiedTime` is enabled on MDX loader
19
- */
20
- lastModified?: Date;
21
- }
22
13
  type CompiledMDXFile<Frontmatter> = CompiledMDXProperties<Frontmatter> & Record<string, unknown>;
23
14
  type Override<A, B> = Omit<A, keyof B> & B;
24
15
  type MDXFileToPageData<Frontmatter> = Override<Omit<CompiledMDXProperties<Frontmatter>, 'frontmatter' | 'default'>, Frontmatter & {
@@ -1,24 +1,15 @@
1
- import { TableOfContents } from 'fumadocs-core/server';
2
1
  import { FC, ReactNode } from 'react';
3
2
  import { MDXProps } from 'mdx/types';
4
- import { StructuredData } from 'fumadocs-core/mdx-plugins';
5
3
  import { a as DocCollection, b as DocsCollection, M as MetaCollection } from '../define-DnJzAZrj.js';
6
4
  import { StandardSchemaV1 } from '@standard-schema/spec';
7
5
  import { PageData, MetaData, Source } from 'fumadocs-core/source';
6
+ import { C as CompiledMDXProperties } from '../build-mdx-DnC1jKvn.js';
7
+ import 'fumadocs-core/mdx-plugins';
8
8
  import '@mdx-js/mdx';
9
9
  import 'unified';
10
10
  import 'zod';
11
+ import 'fumadocs-core/server';
11
12
 
12
- interface CompiledMDXProperties<Frontmatter> {
13
- frontmatter: Frontmatter;
14
- structuredData: StructuredData;
15
- toc: TableOfContents;
16
- default: FC<MDXProps>;
17
- /**
18
- * Only available when `lastModifiedTime` is enabled on MDX loader
19
- */
20
- lastModified?: Date;
21
- }
22
13
  type CompiledMDXFile<Frontmatter> = CompiledMDXProperties<Frontmatter> & Record<string, unknown>;
23
14
  type Override<A, B> = Omit<A, keyof B> & B;
24
15
  type MDXFileToPageData<Frontmatter> = Override<Omit<CompiledMDXProperties<Frontmatter>, 'frontmatter' | 'default'>, Frontmatter & {
@@ -2,10 +2,7 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
2
2
  import { Source, PageData, MetaData } from 'fumadocs-core/source';
3
3
  import { a as DocCollection, M as MetaCollection, b as DocsCollection, G as GlobalConfig } from './define-DnJzAZrj.cjs';
4
4
  import { ProcessorOptions } from '@mdx-js/mdx';
5
- import { FC } from 'react';
6
- import { MDXProps } from 'mdx/types';
7
- import { StructuredData } from 'fumadocs-core/mdx-plugins';
8
- import { TableOfContents } from 'fumadocs-core/server';
5
+ import { C as CompiledMDXProperties } from './build-mdx-DnC1jKvn.cjs';
9
6
 
10
7
  interface LoadedConfig {
11
8
  collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
@@ -23,14 +20,8 @@ interface FileInfo {
23
20
  path: string;
24
21
  absolutePath: string;
25
22
  }
26
- interface MarkdownProps {
27
- body: FC<MDXProps>;
28
- structuredData: StructuredData;
29
- toc: TableOfContents;
30
- /**
31
- * Only available when `lastModifiedTime` is enabled on MDX loader
32
- */
33
- lastModified?: Date;
23
+ interface MarkdownProps extends Omit<CompiledMDXProperties, 'frontmatter' | 'default'> {
24
+ body: CompiledMDXProperties['default'];
34
25
  }
35
26
  interface RuntimeFile {
36
27
  info: FileInfo;
@@ -2,10 +2,7 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
2
2
  import { Source, PageData, MetaData } from 'fumadocs-core/source';
3
3
  import { a as DocCollection, M as MetaCollection, b as DocsCollection, G as GlobalConfig } from './define-DnJzAZrj.js';
4
4
  import { ProcessorOptions } from '@mdx-js/mdx';
5
- import { FC } from 'react';
6
- import { MDXProps } from 'mdx/types';
7
- import { StructuredData } from 'fumadocs-core/mdx-plugins';
8
- import { TableOfContents } from 'fumadocs-core/server';
5
+ import { C as CompiledMDXProperties } from './build-mdx-DnC1jKvn.js';
9
6
 
10
7
  interface LoadedConfig {
11
8
  collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
@@ -23,14 +20,8 @@ interface FileInfo {
23
20
  path: string;
24
21
  absolutePath: string;
25
22
  }
26
- interface MarkdownProps {
27
- body: FC<MDXProps>;
28
- structuredData: StructuredData;
29
- toc: TableOfContents;
30
- /**
31
- * Only available when `lastModifiedTime` is enabled on MDX loader
32
- */
33
- lastModified?: Date;
23
+ interface MarkdownProps extends Omit<CompiledMDXProperties, 'frontmatter' | 'default'> {
24
+ body: CompiledMDXProperties['default'];
34
25
  }
35
26
  interface RuntimeFile {
36
27
  info: FileInfo;