@tinacms/mdx 0.0.0-20220718181631 → 0.60.3
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/index.cjs +887 -738
- package/dist/index.d.ts +21 -1
- package/dist/index.es.js +546 -406
- package/dist/{parse/plate-spec.d.ts → index.js} +4 -2
- package/dist/mdx.es.js +1092 -0
- package/dist/mdx.umd.js +1097 -0
- package/dist/parse/acorn.d.ts +2 -3
- package/dist/parse/acorn.js +201 -0
- package/dist/parse/index.d.ts +8 -2
- package/dist/parse/index.js +144 -0
- package/dist/parse/mdx.js +75 -0
- package/dist/parse/plate.d.ts +15 -2
- package/dist/parse/plate.js +1 -0
- package/dist/parse/remarkToPlate.d.ts +16 -1
- package/dist/parse/remarkToPlate.js +380 -0
- package/dist/stringify/acorn.d.ts +7 -2
- package/dist/stringify/acorn.js +241 -0
- package/dist/stringify/index.d.ts +15 -0
- package/dist/stringify/index.js +195 -0
- package/dist/stringify/marks.js +250 -0
- package/dist/tests/autotest/_config.d.ts +4 -0
- package/dist/tests/autotest/_config.js +159 -0
- package/dist/tests/autotest/_runner.test.d.ts +1 -0
- package/dist/tests/autotest/_runner.test.js +77 -0
- package/dist/tests/autotest/autoformat block elements in list items.test.d.ts +1 -0
- package/dist/tests/autotest/autoformat block elements in list items.test.js +33 -0
- package/dist/tests/autotest/autoformat blockquote.result.test.d.ts +1 -0
- package/dist/tests/autotest/autoformat blockquote.result.test.js +18 -0
- package/dist/tests/autotest/autoformat blockquote.test.d.ts +1 -0
- package/dist/tests/autotest/autoformat blockquote.test.js +18 -0
- package/dist/tests/autotest/autoformat list item.test.d.ts +1 -0
- package/dist/tests/autotest/autoformat list item.test.js +31 -0
- package/dist/tests/autotest/autoformat mdx with nested null children.test.d.ts +1 -0
- package/dist/tests/autotest/autoformat mdx with nested null children.test.js +23 -0
- package/dist/tests/autotest/autoformat syntax changes.test.d.ts +1 -0
- package/dist/tests/autotest/autoformat syntax changes.test.js +90 -0
- package/dist/tests/autotest/blockquote.test.d.ts +1 -0
- package/dist/tests/autotest/blockquote.test.js +17 -0
- package/dist/tests/autotest/break.test.d.ts +1 -0
- package/dist/tests/autotest/break.test.js +26 -0
- package/dist/tests/autotest/code block.test.d.ts +1 -0
- package/dist/tests/autotest/code block.test.js +27 -0
- package/dist/tests/autotest/image.test.d.ts +1 -0
- package/dist/tests/autotest/image.test.js +52 -0
- package/dist/tests/autotest/invalid mdx with a closing tag.test.d.ts +1 -0
- package/dist/tests/autotest/invalid mdx with a closing tag.test.js +27 -0
- package/dist/tests/autotest/invalid mdx with a const expression.test.d.ts +1 -0
- package/dist/tests/autotest/invalid mdx with a const expression.test.js +27 -0
- package/dist/tests/autotest/invalid mdx with an expression {{}}.test.d.ts +1 -0
- package/dist/tests/autotest/invalid mdx with an expression {{}}.test.js +27 -0
- package/dist/tests/autotest/invalid mdx with an expression.test.d.ts +1 -0
- package/dist/tests/autotest/invalid mdx with an expression.test.js +27 -0
- package/dist/tests/autotest/invalid mdx with an import statment.test.d.ts +1 -0
- package/dist/tests/autotest/invalid mdx with an import statment.test.js +27 -0
- package/dist/tests/autotest/kitchen sink.test.d.ts +1 -0
- package/dist/tests/autotest/kitchen sink.test.js +144 -0
- package/dist/tests/autotest/links.test.d.ts +1 -0
- package/dist/tests/autotest/links.test.js +29 -0
- package/dist/tests/autotest/lists.test.d.ts +1 -0
- package/dist/tests/autotest/lists.test.js +110 -0
- package/dist/tests/autotest/marks.test.d.ts +1 -0
- package/dist/tests/autotest/marks.test.js +102 -0
- package/dist/tests/autotest/mdx field with a scalar field as a list.test.d.ts +1 -0
- package/dist/tests/autotest/mdx field with a scalar field as a list.test.js +22 -0
- package/dist/tests/autotest/mdx which hasnt been registered returns html.test.d.ts +1 -0
- package/dist/tests/autotest/mdx which hasnt been registered returns html.test.js +26 -0
- package/dist/tests/autotest/mdx with a boolean field.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with a boolean field.test.js +22 -0
- package/dist/tests/autotest/mdx with a number field.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with a number field.test.js +22 -0
- package/dist/tests/autotest/mdx with a srtring field.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with a srtring field.test.js +28 -0
- package/dist/tests/autotest/mdx with multiple rich-text fields.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with multiple rich-text fields.test.js +53 -0
- package/dist/tests/autotest/mdx with nested children.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with nested children.test.js +35 -0
- package/dist/tests/autotest/mdx with nested null children.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with nested null children.test.js +23 -0
- package/dist/tests/autotest/mdx with number list field.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with number list field.test.js +22 -0
- package/dist/tests/autotest/mdx with object list field.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with object list field.test.js +25 -0
- package/dist/tests/autotest/mdx with object with templates.test.d.ts +1 -0
- package/dist/tests/autotest/mdx with object with templates.test.js +41 -0
- package/dist/tests/autotest/shortcodes.test.d.ts +1 -0
- package/dist/tests/autotest/shortcodes.test.js +51 -0
- package/dist/tests/setup.d.ts +14 -0
- package/dist/tests/setup.js +70 -0
- package/package.json +13 -14
- package/dist/stringify/mdx.d.ts +0 -38
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { field, output, parseMDX, stringifyMDX } from './_config';
|
|
3
|
+
import markdownString from './mdx with number list field.md?raw';
|
|
4
|
+
var out = output({
|
|
5
|
+
type: 'root',
|
|
6
|
+
children: [
|
|
7
|
+
{
|
|
8
|
+
type: 'mdxJsxFlowElement',
|
|
9
|
+
name: 'Tags',
|
|
10
|
+
children: [{ type: 'text', text: '' }],
|
|
11
|
+
props: { items: ['one', 'two'] }
|
|
12
|
+
},
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
describe('./mdx with number list field.md', function () {
|
|
16
|
+
it('parses the string in the expected AST', function () {
|
|
17
|
+
expect(parseMDX(markdownString, field, function (v) { return v; })).toMatchObject(out);
|
|
18
|
+
});
|
|
19
|
+
it('stringifies the AST into the expect string', function () {
|
|
20
|
+
expect(stringifyMDX(out, field, function (v) { return v; })).toEqual(markdownString);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { field, output, parseMDX, stringifyMDX } from './_config';
|
|
3
|
+
import markdownString from './mdx with object list field.md?raw';
|
|
4
|
+
var out = output({
|
|
5
|
+
type: 'root',
|
|
6
|
+
children: [
|
|
7
|
+
{
|
|
8
|
+
type: 'mdxJsxFlowElement',
|
|
9
|
+
name: 'Playground',
|
|
10
|
+
children: [{ type: 'text', text: '' }],
|
|
11
|
+
props: {
|
|
12
|
+
code: 'Some sample code',
|
|
13
|
+
config: [{ key: 'width', value: '100%' }]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
]
|
|
17
|
+
});
|
|
18
|
+
describe('./mdx with object list field.md', function () {
|
|
19
|
+
it('parses the string in the expected AST', function () {
|
|
20
|
+
expect(parseMDX(markdownString, field, function (v) { return v; })).toMatchObject(out);
|
|
21
|
+
});
|
|
22
|
+
it('stringifies the AST into the expect string', function () {
|
|
23
|
+
expect(stringifyMDX(out, field, function (v) { return v; })).toEqual(markdownString);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { field, output, parseMDX, stringifyMDX } from './_config';
|
|
3
|
+
import markdownString from './mdx with object with templates.md?raw';
|
|
4
|
+
var out = output({
|
|
5
|
+
type: 'root',
|
|
6
|
+
children: [
|
|
7
|
+
{
|
|
8
|
+
type: 'mdxJsxFlowElement',
|
|
9
|
+
name: 'Action',
|
|
10
|
+
children: [{ type: 'text', text: '' }],
|
|
11
|
+
props: {
|
|
12
|
+
action: {
|
|
13
|
+
_template: 'popup',
|
|
14
|
+
title: 'Say hello',
|
|
15
|
+
description: 'This is a description'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{ type: 'p', children: [{ type: 'text', text: 'And another template' }] },
|
|
20
|
+
{
|
|
21
|
+
type: 'mdxJsxFlowElement',
|
|
22
|
+
name: 'Action',
|
|
23
|
+
children: [{ type: 'text', text: '' }],
|
|
24
|
+
props: {
|
|
25
|
+
action: {
|
|
26
|
+
_template: 'link',
|
|
27
|
+
title: 'Say hello',
|
|
28
|
+
url: 'http://example.com'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
describe('./mdx with object with templates.md', function () {
|
|
35
|
+
it('parses the string in the expected AST', function () {
|
|
36
|
+
expect(parseMDX(markdownString, field, function (v) { return v; })).toMatchObject(out);
|
|
37
|
+
});
|
|
38
|
+
it('stringifies the AST into the expect string', function () {
|
|
39
|
+
expect(stringifyMDX(out, field, function (v) { return v; })).toEqual(markdownString);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { field, output, parseMDX, stringifyMDX } from './_config';
|
|
3
|
+
import markdownString from './shortcodes.md?raw';
|
|
4
|
+
var out = output({
|
|
5
|
+
type: 'root',
|
|
6
|
+
children: [
|
|
7
|
+
{
|
|
8
|
+
type: 'p',
|
|
9
|
+
children: [
|
|
10
|
+
{
|
|
11
|
+
type: 'mdxJsxTextElement',
|
|
12
|
+
name: 'Shortcode2',
|
|
13
|
+
children: [{ type: 'text', text: '' }],
|
|
14
|
+
props: { text: 'feature-panels' }
|
|
15
|
+
},
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: 'p',
|
|
20
|
+
children: [
|
|
21
|
+
{
|
|
22
|
+
type: 'mdxJsxTextElement',
|
|
23
|
+
name: 'Shortcode1',
|
|
24
|
+
children: [{ type: 'text', text: '' }],
|
|
25
|
+
props: {
|
|
26
|
+
text: 'rimg src="https://res.cloudinary.com/indysigner/image/upload/v1609336455/the-relevance-gap_kzwi6q.png" href="https://infrequently.org/2020/06/platform-adjacency-theory/" sizes="100vw" caption="Image credit: <a href=\'https://infrequently.org/2020/06/platform-adjacency-theory/\'>Alex Russell</a>" alt="The Relevance Gap"'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: 'p',
|
|
33
|
+
children: [
|
|
34
|
+
{
|
|
35
|
+
type: 'mdxJsxTextElement',
|
|
36
|
+
name: 'Shortcode2',
|
|
37
|
+
children: [{ type: 'text', text: '' }],
|
|
38
|
+
props: { text: 'ad-panel-leaderboard' }
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
describe('./shortcodes.md', function () {
|
|
45
|
+
it('parses the string in the expected AST', function () {
|
|
46
|
+
expect(parseMDX(markdownString, field, function (v) { return v; })).toMatchObject(out);
|
|
47
|
+
});
|
|
48
|
+
it('stringifies the AST into the expect string', function () {
|
|
49
|
+
expect(stringifyMDX(out, field, function (v) { return v; })).toEqual(markdownString);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RichTypeInner } from '@tinacms/schema-tools';
|
|
2
|
+
import type { BlockElement, RootElement } from '../parse/plate';
|
|
3
|
+
export type { BlockElement, RichTypeInner };
|
|
4
|
+
export declare const output: (object: RootElement) => RootElement;
|
|
5
|
+
export declare const print: (ast: object, name: string, autoformatted?: boolean | undefined) => string;
|
|
6
|
+
export declare const run: (dirname: string, content: any, outputString: any, field: RichTypeInner) => void;
|
|
7
|
+
declare type GlobFile = Record<string, () => Promise<string>>;
|
|
8
|
+
export declare const setupNewTests: (markdownContentFiles: GlobFile, testFiles: GlobFile, callback: (newTests: {
|
|
9
|
+
name: string;
|
|
10
|
+
markdownContent: () => Promise<string>;
|
|
11
|
+
}) => void) => void;
|
|
12
|
+
export declare const runInner: (name: string, dirname: string, content: string, outputString: Record<string, string>, field: RichTypeInner) => void;
|
|
13
|
+
export declare const writeTestFile: (dirname: string, name: string, astResult: object, autoformatted?: boolean | undefined) => void;
|
|
14
|
+
export declare const writeAutoformatFile: (dirname: string, name: string, stringResult: string) => void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { format } from 'prettier';
|
|
2
|
+
import { parseMDX } from '../parse/index';
|
|
3
|
+
import { writeFile } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
export var output = function (object) { return object; };
|
|
6
|
+
export var print = function (ast, name, autoformatted) {
|
|
7
|
+
return format("\nimport { describe, it, expect } from 'vitest'\nimport { field, output, parseMDX, stringifyMDX } from './_config'\nimport markdownString from '" + name + "?raw'\n" + (autoformatted &&
|
|
8
|
+
"import markdownStringFormatted from '" + name.replace('.md', '.result.md') + "?raw'") + "\n\nconst out = output(" + JSON.stringify(ast) + ")\n\ndescribe(\"" + name + "\", () => {\n it('parses the string in the expected AST', () => {\n expect(parseMDX(markdownString, field, (v) => v)).toMatchObject(out)\n })\n it('stringifies the AST into the expect string', () => {\n expect(stringifyMDX(out, field, (v) => v)).toEqual(" + (autoformatted ? 'markdownStringFormatted' : 'markdownString') + ")\n })\n})\n", {
|
|
9
|
+
parser: 'babel-ts',
|
|
10
|
+
singleQuote: true,
|
|
11
|
+
semi: false
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
export var run = function (dirname, content, outputString, field) {
|
|
15
|
+
Object.entries(content).forEach(function (_a) {
|
|
16
|
+
var name = _a[0], content = _a[1];
|
|
17
|
+
if (typeof content !== 'string') {
|
|
18
|
+
throw new Error('Expected glob import to be a string');
|
|
19
|
+
}
|
|
20
|
+
var tsFilename = name.replace('.md', '.test.ts');
|
|
21
|
+
if (!outputString[tsFilename]) {
|
|
22
|
+
var astResult = parseMDX(content, field, function (v) { return v; });
|
|
23
|
+
writeFile(join(dirname, tsFilename), print(astResult, name), function (err) {
|
|
24
|
+
if (err) {
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export var setupNewTests = function (markdownContentFiles, testFiles, callback) {
|
|
32
|
+
var newTests = [];
|
|
33
|
+
Object.entries(markdownContentFiles).forEach(function (_a) {
|
|
34
|
+
var name = _a[0], markdownContent = _a[1];
|
|
35
|
+
var testFilename = name.replace('.md', '.test.ts');
|
|
36
|
+
if (!testFiles[testFilename]) {
|
|
37
|
+
if (!name.includes('result.md')) {
|
|
38
|
+
newTests.push({ name: name, markdownContent: markdownContent });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
newTests.forEach(function (testInfo) { return callback(testInfo); });
|
|
43
|
+
};
|
|
44
|
+
export var runInner = function (name, dirname, content, outputString, field) {
|
|
45
|
+
var tsFilename = name.replace('.md', '.test.ts');
|
|
46
|
+
if (!outputString[tsFilename]) {
|
|
47
|
+
var astResult = parseMDX(content, field, function (v) { return v; });
|
|
48
|
+
writeFile(join(dirname, tsFilename), print(astResult, name), function (err) {
|
|
49
|
+
if (err) {
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
export var writeTestFile = function (dirname, name, astResult, autoformatted) {
|
|
56
|
+
var tsFilename = name.replace('.md', '.test.ts');
|
|
57
|
+
writeFile(join(dirname, tsFilename), print(astResult, name, autoformatted), function (err) {
|
|
58
|
+
if (err) {
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
export var writeAutoformatFile = function (dirname, name, stringResult) {
|
|
64
|
+
var filename = name.replace('.md', '.result.md');
|
|
65
|
+
writeFile(join(dirname, filename), stringResult, function (err) {
|
|
66
|
+
if (err) {
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/mdx",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"main": "dist/index.cjs",
|
|
3
|
+
"version": "0.60.3",
|
|
5
4
|
"typings": "dist/index.d.ts",
|
|
6
|
-
"
|
|
5
|
+
"main": "dist/index.cjs",
|
|
7
6
|
"type": "module",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
@@ -27,8 +26,9 @@
|
|
|
27
26
|
]
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
29
|
+
"@tinacms/schema-tools": "0.0.8",
|
|
30
30
|
"acorn": "^8.7.1",
|
|
31
|
-
"lodash
|
|
31
|
+
"lodash-es": "^4.17.21",
|
|
32
32
|
"mdast-util-mdx-jsx": "^2.0.1",
|
|
33
33
|
"mdast-util-to-markdown": "^1.3.0",
|
|
34
34
|
"prettier": "^2.7.1",
|
|
@@ -45,37 +45,36 @@
|
|
|
45
45
|
"directory": "packages/tina-graphql"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"mdast": "^3.0.0",
|
|
49
|
-
"vitest": "^0.18.0",
|
|
50
48
|
"@swc/core": "^1.2.210",
|
|
51
|
-
"@types/prettier": "^2.6.3",
|
|
52
49
|
"@swc/jest": "^0.2.21",
|
|
53
50
|
"@tinacms/datalayer": "0.2.1",
|
|
54
|
-
"@tinacms/schema-tools": "0.0.8",
|
|
55
51
|
"@tinacms/scripts": "0.50.9",
|
|
56
52
|
"@types/cors": "^2.8.7",
|
|
57
53
|
"@types/estree": "^0.0.50",
|
|
54
|
+
"@types/estree-jsx": "^1.0.0",
|
|
58
55
|
"@types/express": "^4.17.8",
|
|
59
56
|
"@types/fs-extra": "^9.0.2",
|
|
60
57
|
"@types/jest": "^26.0.4",
|
|
61
58
|
"@types/js-yaml": "^3.12.5",
|
|
62
|
-
"@types/lodash
|
|
59
|
+
"@types/lodash-es": "4.17.6",
|
|
63
60
|
"@types/mdast": "3.0.7",
|
|
64
|
-
"@types/node": "^14.
|
|
61
|
+
"@types/node": "^14.18.21",
|
|
65
62
|
"@types/normalize-path": "^3.0.0",
|
|
63
|
+
"@types/prettier": "^2.6.3",
|
|
66
64
|
"@types/ws": "^7.2.6",
|
|
67
65
|
"@types/yup": "^0.29.7",
|
|
68
66
|
"c8": "^7.11.3",
|
|
67
|
+
"estree-jsx": "^0.0.1",
|
|
69
68
|
"jest": "^28.1.2",
|
|
70
69
|
"jest-diff": "^28.1.1",
|
|
71
70
|
"jest-file-snapshot": "^0.5.0",
|
|
72
71
|
"jest-matcher-utils": "^28.1.1",
|
|
72
|
+
"mdast": "^3.0.0",
|
|
73
73
|
"nodemon": "^2.0.4",
|
|
74
74
|
"ts-node": "^10.8.2",
|
|
75
|
-
"typescript": "^4.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"@tinacms/schema-tools": "*"
|
|
75
|
+
"typescript": "^4.7.4",
|
|
76
|
+
"vite": "^3.0.2",
|
|
77
|
+
"vitest": "^0.18.0"
|
|
79
78
|
},
|
|
80
79
|
"scripts": {
|
|
81
80
|
"types": "yarn tsc",
|
package/dist/stringify/mdx.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
4
|
-
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
See the License for the specific language governing permissions and
|
|
15
|
-
limitations under the License.
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
import type { MdxJsxTextElement, MdxJsxFlowElement, MdxJsxAttribute } from 'mdast-util-mdx-jsx';
|
|
19
|
-
import type { RichTypeInner } from '@tinacms/schema-tools';
|
|
20
|
-
import type * as Plate from '../parse/plate';
|
|
21
|
-
import type * as Md from 'mdast';
|
|
22
|
-
declare module 'mdast' {
|
|
23
|
-
interface StaticPhrasingContentMap {
|
|
24
|
-
mdxJsxTextElement: MdxJsxTextElement;
|
|
25
|
-
}
|
|
26
|
-
interface PhrasingContentMap {
|
|
27
|
-
mdxJsxTextElement: MdxJsxTextElement;
|
|
28
|
-
}
|
|
29
|
-
interface BlockContentMap {
|
|
30
|
-
mdxJsxFlowElement: MdxJsxFlowElement;
|
|
31
|
-
}
|
|
32
|
-
interface ContentMap {
|
|
33
|
-
mdxJsxFlowElement: MdxJsxFlowElement;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export declare function mdxJsxInlineElement(node: Plate.MdxInlineElement, field: RichTypeInner): MdxJsxTextElement;
|
|
37
|
-
export declare function processAttributes(node: Plate.MdxInlineElement | Plate.MdxBlockElement, field: RichTypeInner): MdxJsxAttribute[];
|
|
38
|
-
export declare function processBlockChildren(node: Plate.MdxBlockElement, field: RichTypeInner): Md.BlockContent[];
|