@mintlify/common 1.0.384 → 1.0.386
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.
|
@@ -18,6 +18,7 @@ function addCodeBlocks(tree) {
|
|
|
18
18
|
let isExpandable = false;
|
|
19
19
|
const isFlowElement = isElement(parent, 'type', flowElementType);
|
|
20
20
|
const parentName = isFlowElement ? parent.name : undefined;
|
|
21
|
+
const properties = code.type === 'element' ? Object.entries(code.properties) : [];
|
|
21
22
|
if (parentName && exampleNames.includes(parentName)) {
|
|
22
23
|
const parentType = parentName.slice(0, -7);
|
|
23
24
|
filename = i === 0 ? parentType : `${parentType} ${i + 1}`;
|
|
@@ -38,6 +39,13 @@ function addCodeBlocks(tree) {
|
|
|
38
39
|
attributes: [
|
|
39
40
|
{ type: 'mdxJsxAttribute', name: 'filename', value: filename !== null && filename !== void 0 ? filename : '' },
|
|
40
41
|
{ type: 'mdxJsxAttribute', name: 'expandable', value: isExpandable.toString() },
|
|
42
|
+
...properties
|
|
43
|
+
.filter(([_key, val]) => val != null)
|
|
44
|
+
.map(([key, val]) => ({
|
|
45
|
+
type: 'mdxJsxAttribute',
|
|
46
|
+
name: key,
|
|
47
|
+
value: Array.isArray(val) ? val.join(' ') : val === null || val === void 0 ? void 0 : val.toString(),
|
|
48
|
+
})),
|
|
41
49
|
],
|
|
42
50
|
data: { _mdxExplicitJsx: true },
|
|
43
51
|
children: [],
|
|
@@ -44,6 +44,7 @@ export const remarkExtractTableOfContents = (mdxExtracts) => {
|
|
|
44
44
|
mdxJsxAttributes = [
|
|
45
45
|
createMdxJsxAttribute('level', level),
|
|
46
46
|
createMdxJsxAttribute('id', slug),
|
|
47
|
+
createMdxJsxAttribute('isAtRootLevel', true),
|
|
47
48
|
];
|
|
48
49
|
}
|
|
49
50
|
node.attributes = mdxJsxAttributes;
|