@mintlify/common 1.0.440 → 1.0.442

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.
@@ -3,4 +3,6 @@ export declare const FOCUS_CLASS_NAME = "line-focus";
3
3
  export declare const HIGHLIGHT_CLASS_NAME = "line-highlight";
4
4
  declare function addCodeBlocks<T extends Parent>(tree: T): void;
5
5
  export declare function rehypeCodeBlocks(): typeof addCodeBlocks;
6
- export {};
6
+ export * from './parseMetaString.js';
7
+ export * from './metaOptions.js';
8
+ export * from './buildMetaAttributes.js';
@@ -122,3 +122,6 @@ function addClassToSpan(span, className) {
122
122
  export function rehypeCodeBlocks() {
123
123
  return addCodeBlocks;
124
124
  }
125
+ export * from './parseMetaString.js';
126
+ export * from './metaOptions.js';
127
+ export * from './buildMetaAttributes.js';
@@ -23,6 +23,7 @@ export const rehypeMdxExtractExamples = (mdxExtracts) => {
23
23
  request = request !== null && request !== void 0 ? request : {
24
24
  type: node.name,
25
25
  children: parseChildren(node),
26
+ attributes: getAttributes(node),
26
27
  };
27
28
  if (parent && i != null)
28
29
  parent.children.splice(i, 1);
@@ -31,6 +32,7 @@ export const rehypeMdxExtractExamples = (mdxExtracts) => {
31
32
  response = response !== null && response !== void 0 ? response : {
32
33
  type: node.name,
33
34
  children: parseChildren(node),
35
+ attributes: getAttributes(node),
34
36
  };
35
37
  if (parent && i != null)
36
38
  parent.children.splice(i, 1);
@@ -43,6 +45,21 @@ export const rehypeMdxExtractExamples = (mdxExtracts) => {
43
45
  return tree;
44
46
  };
45
47
  };
48
+ const getAttributes = (node) => {
49
+ return node.attributes
50
+ .map((attr) => {
51
+ var _a;
52
+ if (attr.type === 'mdxJsxAttribute') {
53
+ return {
54
+ type: attr.type,
55
+ name: attr.name,
56
+ value: typeof attr.value === 'string' ? attr.value : JSON.stringify((_a = attr.value) !== null && _a !== void 0 ? _a : ''),
57
+ };
58
+ }
59
+ return undefined;
60
+ })
61
+ .filter(Boolean);
62
+ };
46
63
  const parseChildren = (node) => {
47
64
  return node.children.filter(isMdxJsxFlowElementHast).flatMap((child) => {
48
65
  var _a;