@mintlify/common 1.0.1192 → 1.0.1194
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.
- package/dist/graphql/parseGraphqlSelector.d.ts +0 -1
- package/dist/graphql/parseGraphqlSelector.js +4 -6
- package/dist/mdx/lib/jsxParser.d.ts +2 -0
- package/dist/mdx/lib/jsxParser.js +3 -0
- package/dist/mdx/plugins/remark/remarkMdxExpandExpressions.js +1 -3
- package/dist/mdx/plugins/remark/remarkTitleMarkdown.js +1 -3
- package/dist/mdx/snippets/getJsxEsmTree.js +1 -3
- package/dist/mdx/snippets/resolveImport/resolveComponentWithContent.js +1 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
const GRAPHQL_NAME = /^[_A-Za-z][_0-9A-Za-z]*$/;
|
|
2
2
|
const SELECTOR_KINDS = ['query', 'mutation', 'type'];
|
|
3
|
-
const toSelectorKind = (value) => SELECTOR_KINDS.find((kind) => kind === value.toLowerCase());
|
|
4
3
|
export const parseGraphqlSelector = (str) => {
|
|
5
|
-
const [
|
|
6
|
-
if (!
|
|
4
|
+
const [rawKind, name, ...extra] = str.trim().split(/\s+/);
|
|
5
|
+
if (!rawKind || !name || extra.length > 0)
|
|
7
6
|
return undefined;
|
|
8
|
-
const
|
|
9
|
-
const kind = toSelectorKind(rawKind);
|
|
7
|
+
const kind = SELECTOR_KINDS.find((kind) => kind.toUpperCase() === rawKind);
|
|
10
8
|
if (!kind)
|
|
11
9
|
return undefined;
|
|
12
10
|
if (kind === 'type' && name.includes('.'))
|
|
13
11
|
return undefined;
|
|
14
12
|
if (!name.split('.').every((segment) => GRAPHQL_NAME.test(segment)))
|
|
15
13
|
return undefined;
|
|
16
|
-
return { kind, name
|
|
14
|
+
return { kind, name };
|
|
17
15
|
};
|
|
@@ -7,8 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Parser } from 'acorn';
|
|
11
|
-
import jsx from 'acorn-jsx';
|
|
12
10
|
import { jsx as jsxHandlers, toJs } from 'estree-util-to-js';
|
|
13
11
|
import { walk } from 'estree-walker';
|
|
14
12
|
import { toEstree } from 'hast-util-to-estree';
|
|
@@ -16,6 +14,7 @@ import remarkRehype from 'remark-rehype';
|
|
|
16
14
|
import { unified } from 'unified';
|
|
17
15
|
import { visit } from 'unist-util-visit';
|
|
18
16
|
import { visitParents } from 'unist-util-visit-parents';
|
|
17
|
+
import { JSXParser } from '../../lib/jsxParser.js';
|
|
19
18
|
import { decodeMdxFragmentCode } from '../../preprocessMdxFragmentCode.js';
|
|
20
19
|
import { getAST } from '../../remark.js';
|
|
21
20
|
import { getExportedFunctionNames } from './remarkMdxClientComponentBoundaries.js';
|
|
@@ -29,7 +28,6 @@ const REMARK_REHYPE_OPTIONS = {
|
|
|
29
28
|
'mdxjsEsm',
|
|
30
29
|
],
|
|
31
30
|
};
|
|
32
|
-
const JSXParser = Parser.extend(jsx());
|
|
33
31
|
/**
|
|
34
32
|
* Bounds on the work a single page compile may spend expanding `<MDX>` fragments. Every fragment
|
|
35
33
|
* re-runs the remark/rehype pipeline on its source and text nested `d` levels deep is compiled
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Parser } from 'acorn';
|
|
2
|
-
import jsx from 'acorn-jsx';
|
|
3
1
|
import { visit } from 'unist-util-visit';
|
|
2
|
+
import { JSXParser } from '../../lib/jsxParser.js';
|
|
4
3
|
import { parseTitleMarkdown, titleMarkdownToText } from '../../titleMarkdown.js';
|
|
5
|
-
const JSXParser = Parser.extend(jsx());
|
|
6
4
|
export const TITLE_COMPONENTS = new Set([
|
|
7
5
|
'Accordion',
|
|
8
6
|
'Card',
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import jsx from 'acorn-jsx';
|
|
1
|
+
import { JSXParser } from '../lib/jsxParser.js';
|
|
3
2
|
import { isTsxFile } from './isJsxOrTsx.js';
|
|
4
3
|
import { stripTsxTypes } from './stripTsxTypes.js';
|
|
5
|
-
const JSXParser = Parser.extend(jsx());
|
|
6
4
|
/**
|
|
7
5
|
* Get the AST for a JSX/TSX snippet
|
|
8
6
|
* @param jsxContent the content of the JSX/TSX snippet
|
|
@@ -7,12 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Parser } from 'acorn';
|
|
11
|
-
import acornJsx from 'acorn-jsx';
|
|
12
10
|
import { jsx, toJs } from 'estree-util-to-js';
|
|
13
11
|
import { walk } from 'estree-walker';
|
|
14
12
|
import { visit } from 'unist-util-visit';
|
|
15
13
|
import { removeFrontmatterFromAST } from '../../astUtils.js';
|
|
14
|
+
import { JSXParser } from '../../lib/jsxParser.js';
|
|
16
15
|
import { getAST } from '../../remark.js';
|
|
17
16
|
import { createUniqueVariableName, isMdxJsxFlowElement } from '../../utils.js';
|
|
18
17
|
import { findAndRemoveExports } from '../findAndRemoveExports.js';
|
|
@@ -207,7 +206,6 @@ const replaceVariablesWithProps = (node, treeToInject, exportMap, snippetExportM
|
|
|
207
206
|
};
|
|
208
207
|
};
|
|
209
208
|
const generate = (estree) => toJs(estree, { handlers: jsx }).value.replace(/;\s*$/, '');
|
|
210
|
-
const JSXParser = Parser.extend(acornJsx());
|
|
211
209
|
/**
|
|
212
210
|
* Parse `text` as a single expression; undefined when it is not one on its own. `preserveParens`
|
|
213
211
|
* so `( … )` around the whole expression — common when a snippet wraps a ternary in `{( … )}` —
|