@astrojs/mdx 3.1.4 → 3.1.5

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.
@@ -17,24 +17,25 @@ function rehypeApplyFrontmatterExport() {
17
17
  if (frontmatter.layout) {
18
18
  exportNodes.unshift(
19
19
  jsToTreeNode(
20
+ // NOTE: Use `__astro_*` import names to prevent conflicts with user code
20
21
  /** @see 'vite-plugin-markdown' for layout props reference */
21
- `import { jsx as layoutJsx } from 'astro/jsx-runtime';
22
+ `import { jsx as __astro_layout_jsx__ } from 'astro/jsx-runtime';
23
+ import __astro_layout_component__ from ${JSON.stringify(frontmatter.layout)};
22
24
 
23
- export default async function ({ children }) {
24
- const Layout = (await import(${JSON.stringify(frontmatter.layout)})).default;
25
- const { layout, ...content } = frontmatter;
26
- content.file = file;
27
- content.url = url;
28
- return layoutJsx(Layout, {
29
- file,
30
- url,
31
- content,
32
- frontmatter: content,
33
- headings: getHeadings(),
34
- 'server:root': true,
35
- children,
36
- });
37
- };`
25
+ export default function ({ children }) {
26
+ const { layout, ...content } = frontmatter;
27
+ content.file = file;
28
+ content.url = url;
29
+ return __astro_layout_jsx__(__astro_layout_component__, {
30
+ file,
31
+ url,
32
+ content,
33
+ frontmatter: content,
34
+ headings: getHeadings(),
35
+ 'server:root': true,
36
+ children,
37
+ });
38
+ };`
38
39
  )
39
40
  );
40
41
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/mdx",
3
3
  "description": "Add support for MDX pages in your Astro site",
4
- "version": "3.1.4",
4
+ "version": "3.1.5",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -32,14 +32,14 @@
32
32
  "es-module-lexer": "^1.5.4",
33
33
  "estree-util-visit": "^2.0.0",
34
34
  "gray-matter": "^4.0.3",
35
- "hast-util-to-html": "^9.0.1",
35
+ "hast-util-to-html": "^9.0.2",
36
36
  "kleur": "^4.1.5",
37
37
  "rehype-raw": "^7.0.0",
38
38
  "remark-gfm": "^4.0.0",
39
39
  "remark-smartypants": "^3.0.2",
40
40
  "source-map": "^0.7.4",
41
41
  "unist-util-visit": "^5.0.0",
42
- "vfile": "^6.0.2",
42
+ "vfile": "^6.0.3",
43
43
  "@astrojs/markdown-remark": "5.2.0"
44
44
  },
45
45
  "peerDependencies": {
@@ -52,7 +52,7 @@
52
52
  "cheerio": "1.0.0",
53
53
  "linkedom": "^0.18.4",
54
54
  "mdast-util-mdx": "^3.0.0",
55
- "mdast-util-mdx-jsx": "^3.1.2",
55
+ "mdast-util-mdx-jsx": "^3.1.3",
56
56
  "mdast-util-to-string": "^4.0.0",
57
57
  "rehype-mathjax": "^6.0.0",
58
58
  "rehype-pretty-code": "^0.13.2",
@@ -62,8 +62,8 @@
62
62
  "remark-toc": "^9.0.0",
63
63
  "shiki": "^1.14.1",
64
64
  "unified": "^11.0.5",
65
- "vite": "^5.4.1",
66
- "astro": "4.14.3",
65
+ "vite": "^5.4.2",
66
+ "astro": "4.14.6",
67
67
  "astro-scripts": "0.0.14"
68
68
  },
69
69
  "engines": {