@mdxeditor/editor 1.11.3 → 1.11.4
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.js
CHANGED
|
@@ -11,7 +11,7 @@ import { linkPlugin } from "./plugins/link/index.js";
|
|
|
11
11
|
import { INSERT_IMAGE_COMMAND, imagePlugin, imagePluginHooks, imageSystem } from "./plugins/image/index.js";
|
|
12
12
|
import { frontmatterPlugin, frontmatterPluginHooks, frontmatterSystem } from "./plugins/frontmatter/index.js";
|
|
13
13
|
import { quotePlugin, quotePluginHooks } from "./plugins/quote/index.js";
|
|
14
|
-
import { jsxPlugin, jsxPluginHooks, jsxSystem } from "./plugins/jsx/index.js";
|
|
14
|
+
import { isMdastJsxNode, jsxPlugin, jsxPluginHooks, jsxSystem } from "./plugins/jsx/index.js";
|
|
15
15
|
import { GenericJsxEditor } from "./jsx-editors/GenericJsxEditor.js";
|
|
16
16
|
import { sandpackPlugin, sandpackPluginHooks, sandpackSystem } from "./plugins/sandpack/index.js";
|
|
17
17
|
import { codeMirrorHooks, codeMirrorPlugin, codeMirrorSystem } from "./plugins/codemirror/index.js";
|
|
@@ -162,6 +162,7 @@ export {
|
|
|
162
162
|
imageSystem,
|
|
163
163
|
importMarkdownToLexical,
|
|
164
164
|
importMdastTreeToLexical,
|
|
165
|
+
isMdastJsxNode,
|
|
165
166
|
isPartOftheEditorUI,
|
|
166
167
|
joinProc,
|
|
167
168
|
jsxPlugin,
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { $isLexicalJsxNode } from "./LexicalJsxNode.js";
|
|
2
|
+
import { isMdastJsxNode } from "./index.js";
|
|
2
3
|
const LexicalJsxVisitor = {
|
|
3
4
|
testLexicalNode: $isLexicalJsxNode,
|
|
4
5
|
visitLexicalNode({ actions, mdastParent, lexicalNode }) {
|
|
6
|
+
function traverseNestedJsxNodes(node) {
|
|
7
|
+
if ("children" in node && node.children instanceof Array) {
|
|
8
|
+
node.children.forEach((child) => {
|
|
9
|
+
if (isMdastJsxNode(child)) {
|
|
10
|
+
actions.registerReferredComponent(child.name);
|
|
11
|
+
}
|
|
12
|
+
traverseNestedJsxNodes(child);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
5
16
|
const mdastNode = lexicalNode.getMdastNode();
|
|
6
17
|
actions.registerReferredComponent(mdastNode.name);
|
|
18
|
+
traverseNestedJsxNodes(mdastNode);
|
|
7
19
|
actions.appendToParent(mdastParent, mdastNode);
|
|
8
20
|
}
|
|
9
21
|
};
|
|
@@ -2,7 +2,6 @@ import type { IconKey } from '../core/Icon';
|
|
|
2
2
|
import type { Options } from 'mdast-util-to-markdown';
|
|
3
3
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
4
4
|
import type { Extension } from 'micromark-util-types';
|
|
5
|
-
import type { Content } from 'mdast';
|
|
6
5
|
import type { MdastImportVisitor, LexicalVisitor } from '../..';
|
|
7
6
|
import type { EditorSubscription, EditorInFocus, BlockType } from '../core';
|
|
8
7
|
import type { InitialEditorStateType } from '@lexical/react/LexicalComposer';
|
|
@@ -11,6 +10,7 @@ import type { LexicalEditor, RangeSelection, Klass, LexicalNode, TextFormatType,
|
|
|
11
10
|
import type { SystemSpec, Realm, RealmNode, PluginConstructor, TypedRealm, ValueForKey, SystemKeys, ValuesForKeys, SystemDict } from '../../gurx';
|
|
12
11
|
import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx-jsx';
|
|
13
12
|
import React from 'react';
|
|
13
|
+
import * as Mdast from 'mdast';
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -87,6 +87,7 @@ type JsxFlowPayload = {
|
|
|
87
87
|
children?: MdxJsxFlowElement['children'];
|
|
88
88
|
};
|
|
89
89
|
type InsertJsxPayload = JsxTextPayload | JsxFlowPayload;
|
|
90
|
+
export declare function isMdastJsxNode(node: Mdast.Content | Mdast.Parent | Mdast.Root): node is MdastJsx;
|
|
90
91
|
/** @internal */
|
|
91
92
|
export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
92
93
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -99,11 +100,11 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
99
100
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
100
101
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
101
102
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
102
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
103
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
103
104
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
104
105
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
105
106
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
106
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
107
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
107
108
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
108
109
|
addSyntaxExtension: RealmNode<Extension>;
|
|
109
110
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -120,6 +121,7 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
120
121
|
contentEditableClassName: RealmNode<string>;
|
|
121
122
|
placeholder: RealmNode<React.ReactNode>;
|
|
122
123
|
autoFocus: RealmNode<boolean | {
|
|
124
|
+
/** @internal */
|
|
123
125
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
124
126
|
preventScroll?: boolean | undefined;
|
|
125
127
|
}>;
|
|
@@ -156,11 +158,11 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
156
158
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
157
159
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
158
160
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
159
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
161
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
160
162
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
161
163
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
162
164
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
163
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
165
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
164
166
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
165
167
|
addSyntaxExtension: RealmNode<Extension>;
|
|
166
168
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -177,6 +179,7 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
177
179
|
contentEditableClassName: RealmNode<string>;
|
|
178
180
|
placeholder: RealmNode<React.ReactNode>;
|
|
179
181
|
autoFocus: RealmNode<boolean | {
|
|
182
|
+
/** @internal */
|
|
180
183
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
181
184
|
preventScroll?: boolean | undefined;
|
|
182
185
|
}>;
|
|
@@ -227,11 +230,11 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
227
230
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
228
231
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
229
232
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
230
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
233
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
231
234
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
232
235
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
233
236
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
234
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
237
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
235
238
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
236
239
|
addSyntaxExtension: RealmNode<Extension>;
|
|
237
240
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -248,6 +251,7 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
248
251
|
contentEditableClassName: RealmNode<string>;
|
|
249
252
|
placeholder: RealmNode<React.ReactNode>;
|
|
250
253
|
autoFocus: RealmNode<boolean | {
|
|
254
|
+
/** @internal */
|
|
251
255
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
252
256
|
preventScroll?: boolean | undefined;
|
|
253
257
|
}>;
|
|
@@ -284,11 +288,11 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
284
288
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
285
289
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
286
290
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
287
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
291
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
288
292
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
289
293
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
290
294
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
291
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
295
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
292
296
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
293
297
|
addSyntaxExtension: RealmNode<Extension>;
|
|
294
298
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -305,6 +309,7 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
305
309
|
contentEditableClassName: RealmNode<string>;
|
|
306
310
|
placeholder: RealmNode<React.ReactNode>;
|
|
307
311
|
autoFocus: RealmNode<boolean | {
|
|
312
|
+
/** @internal */
|
|
308
313
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
309
314
|
preventScroll?: boolean | undefined;
|
|
310
315
|
}>;
|
|
@@ -348,11 +353,11 @@ jsxPluginHooks: {
|
|
|
348
353
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
349
354
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
350
355
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
351
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
356
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
352
357
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
353
358
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
354
359
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
355
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
360
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
356
361
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
357
362
|
addSyntaxExtension: RealmNode<Extension>;
|
|
358
363
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -369,6 +374,7 @@ jsxPluginHooks: {
|
|
|
369
374
|
contentEditableClassName: RealmNode<string>;
|
|
370
375
|
placeholder: RealmNode<React.ReactNode>;
|
|
371
376
|
autoFocus: RealmNode<boolean | {
|
|
377
|
+
/** @internal */
|
|
372
378
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
373
379
|
preventScroll?: boolean | undefined;
|
|
374
380
|
}>;
|
|
@@ -408,11 +414,11 @@ jsxPluginHooks: {
|
|
|
408
414
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
409
415
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
410
416
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
411
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
417
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
412
418
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
413
419
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
414
420
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
415
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
421
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
416
422
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
417
423
|
addSyntaxExtension: RealmNode<Extension>;
|
|
418
424
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -429,6 +435,7 @@ jsxPluginHooks: {
|
|
|
429
435
|
contentEditableClassName: RealmNode<string>;
|
|
430
436
|
placeholder: RealmNode<React.ReactNode>;
|
|
431
437
|
autoFocus: RealmNode<boolean | {
|
|
438
|
+
/** @internal */
|
|
432
439
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
433
440
|
preventScroll?: boolean | undefined;
|
|
434
441
|
}>;
|
|
@@ -468,11 +475,11 @@ jsxPluginHooks: {
|
|
|
468
475
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
469
476
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
470
477
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
471
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
478
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
472
479
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
473
480
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
474
481
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
475
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
482
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
476
483
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
477
484
|
addSyntaxExtension: RealmNode<Extension>;
|
|
478
485
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -489,6 +496,7 @@ jsxPluginHooks: {
|
|
|
489
496
|
contentEditableClassName: RealmNode<string>;
|
|
490
497
|
placeholder: RealmNode<React.ReactNode>;
|
|
491
498
|
autoFocus: RealmNode<boolean | {
|
|
499
|
+
/** @internal */
|
|
492
500
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
493
501
|
preventScroll?: boolean | undefined;
|
|
494
502
|
}>;
|
|
@@ -527,11 +535,11 @@ jsxPluginHooks: {
|
|
|
527
535
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
528
536
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
529
537
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
530
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
538
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
531
539
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
532
540
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
533
541
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
534
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
542
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
535
543
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
536
544
|
addSyntaxExtension: RealmNode<Extension>;
|
|
537
545
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -548,6 +556,7 @@ jsxPluginHooks: {
|
|
|
548
556
|
contentEditableClassName: RealmNode<string>;
|
|
549
557
|
placeholder: RealmNode<React.ReactNode>;
|
|
550
558
|
autoFocus: RealmNode<boolean | {
|
|
559
|
+
/** @internal */
|
|
551
560
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
552
561
|
preventScroll?: boolean | undefined;
|
|
553
562
|
}>;
|
|
@@ -587,11 +596,11 @@ jsxPluginHooks: {
|
|
|
587
596
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
588
597
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
589
598
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
590
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
599
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
591
600
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
592
601
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
593
602
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
594
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
603
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
595
604
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
596
605
|
addSyntaxExtension: RealmNode<Extension>;
|
|
597
606
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -608,6 +617,7 @@ jsxPluginHooks: {
|
|
|
608
617
|
contentEditableClassName: RealmNode<string>;
|
|
609
618
|
placeholder: RealmNode<React.ReactNode>;
|
|
610
619
|
autoFocus: RealmNode<boolean | {
|
|
620
|
+
/** @internal */
|
|
611
621
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
612
622
|
preventScroll?: boolean | undefined;
|
|
613
623
|
}>;
|
|
@@ -647,11 +657,11 @@ jsxPluginHooks: {
|
|
|
647
657
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
648
658
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
649
659
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
650
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
660
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
651
661
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
652
662
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
653
663
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
654
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
664
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
655
665
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
656
666
|
addSyntaxExtension: RealmNode<Extension>;
|
|
657
667
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -668,6 +678,7 @@ jsxPluginHooks: {
|
|
|
668
678
|
contentEditableClassName: RealmNode<string>;
|
|
669
679
|
placeholder: RealmNode<React.ReactNode>;
|
|
670
680
|
autoFocus: RealmNode<boolean | {
|
|
681
|
+
/** @internal */
|
|
671
682
|
defaultSelection?: "rootStart" | "rootEnd" | undefined;
|
|
672
683
|
preventScroll?: boolean | undefined;
|
|
673
684
|
}>;
|
|
@@ -7,6 +7,9 @@ import { MdastMdxJsEsmVisitor } from "./MdastMdxJsEsmVisitor.js";
|
|
|
7
7
|
import { MdastMdxJsxElementVisitor } from "./MdastMdxJsxElementVisitor.js";
|
|
8
8
|
import { system } from "../../gurx/realmFactory.js";
|
|
9
9
|
import { realmPlugin } from "../../gurx/react.js";
|
|
10
|
+
function isMdastJsxNode(node) {
|
|
11
|
+
return node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement";
|
|
12
|
+
}
|
|
10
13
|
function toMdastJsxAttributes(attributes) {
|
|
11
14
|
return Object.entries(attributes).map(([name, value]) => ({
|
|
12
15
|
type: "mdxJsxAttribute",
|
|
@@ -72,6 +75,7 @@ const [
|
|
|
72
75
|
}
|
|
73
76
|
});
|
|
74
77
|
export {
|
|
78
|
+
isMdastJsxNode,
|
|
75
79
|
jsxPlugin,
|
|
76
80
|
jsxPluginHooks,
|
|
77
81
|
jsxSystem
|