@emberkit/core 0.3.5 → 0.3.6
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA8CtE,wBAAgB,kBAAkB,CAAC,WAAW,GAAE,qBAA0B,GAAG,MAAM,CA8IlF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA8CtE,wBAAgB,kBAAkB,CAAC,WAAW,GAAE,qBAA0B,GAAG,MAAM,CA8IlF;AA6hCD,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -282,10 +282,27 @@ async function transformMDX(code, _id) {
|
|
|
282
282
|
exportLines.push(`export const date = ${JSON.stringify(frontmatter.date)};`);
|
|
283
283
|
}
|
|
284
284
|
exportLines.push(`export const metadata = ${JSON.stringify(frontmatter)};`);
|
|
285
|
-
|
|
285
|
+
let body = typeof compiled === 'object' && compiled !== null && 'value' in compiled
|
|
286
286
|
? String(compiled.value)
|
|
287
287
|
: String(compiled);
|
|
288
|
-
|
|
288
|
+
// Rename the @mdx-js/mdx default export so we can wrap it with the
|
|
289
|
+
// md-doc / md-content styling containers that the docs CSS targets.
|
|
290
|
+
body = body.replace(/export default function MDXContent/, 'function _MDXContent');
|
|
291
|
+
// Wrapper re-exports the component with the styling containers.
|
|
292
|
+
// We reuse _jsx/_jsxs already imported by the compiled output.
|
|
293
|
+
const wrapper = `
|
|
294
|
+
export default function MDXComponent(props) {
|
|
295
|
+
var p = props ?? {};
|
|
296
|
+
return _jsx('article', {
|
|
297
|
+
className: 'md-doc',
|
|
298
|
+
children: _jsx('div', {
|
|
299
|
+
className: 'md-content',
|
|
300
|
+
children: _jsx(_MDXContent, p)
|
|
301
|
+
})
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
`;
|
|
305
|
+
return { code: insertAfterLeadingImports(body + wrapper, exportLines.join('\n')) };
|
|
289
306
|
}
|
|
290
307
|
function parseFrontmatter(content) {
|
|
291
308
|
const result = {};
|