@mdxeditor/editor 1.14.3 → 2.0.0
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/MDXEditor.js +19 -25
- package/dist/RealmWithPlugins.js +36 -0
- package/dist/directive-editors/GenericDirectiveEditor.js +7 -4
- package/dist/index.d.ts +2590 -62
- package/dist/index.js +138 -66
- package/dist/jsx-editors/GenericJsxEditor.js +12 -9
- package/dist/plugins/codeblock/CodeBlockNode.js +5 -5
- package/dist/plugins/codeblock/index.js +37 -63
- package/dist/plugins/codemirror/CodeMirrorEditor.js +3 -2
- package/dist/plugins/codemirror/index.js +28 -45
- package/dist/plugins/core/GenericHTMLNode.js +9 -1
- package/dist/plugins/core/MdastHTMLNode.js +0 -1
- package/dist/plugins/core/NestedLexicalEditor.js +11 -10
- package/dist/plugins/core/PropertyPopover.js +3 -2
- package/dist/plugins/core/SharedHistoryPlugin.js +3 -3
- package/dist/plugins/core/index.js +426 -385
- package/dist/plugins/core/ui/DownshiftAutoComplete.js +3 -2
- package/dist/plugins/core/ui/PopoverUtils.js +3 -2
- package/dist/plugins/diff-source/DiffSourceWrapper.js +3 -4
- package/dist/plugins/diff-source/DiffViewer.js +7 -7
- package/dist/plugins/diff-source/SourceEditor.js +6 -6
- package/dist/plugins/diff-source/index.js +17 -52
- package/dist/plugins/directives/DirectiveNode.js +28 -5
- package/dist/plugins/directives/index.js +36 -43
- package/dist/plugins/frontmatter/FrontmatterEditor.js +20 -16
- package/dist/plugins/frontmatter/index.js +51 -62
- package/dist/plugins/headings/index.js +43 -49
- package/dist/plugins/image/ImageDialog.js +11 -7
- package/dist/plugins/image/ImageEditor.js +10 -7
- package/dist/plugins/image/ImageNode.js +27 -5
- package/dist/plugins/image/index.js +65 -72
- package/dist/plugins/jsx/LexicalJsxNode.js +3 -2
- package/dist/plugins/jsx/index.js +48 -60
- package/dist/plugins/link/index.js +15 -20
- package/dist/plugins/link-dialog/LinkDialog.js +17 -16
- package/dist/plugins/link-dialog/index.js +194 -216
- package/dist/plugins/lists/index.js +50 -65
- package/dist/plugins/markdown-shortcut/index.js +12 -15
- package/dist/plugins/quote/index.js +11 -19
- package/dist/plugins/sandpack/SandpackEditor.js +3 -2
- package/dist/plugins/sandpack/index.js +34 -50
- package/dist/plugins/sandpack/useCodeMirrorRef.js +7 -6
- package/dist/plugins/table/TableEditor.js +12 -13
- package/dist/plugins/table/TableNode.js +28 -0
- package/dist/plugins/table/index.js +32 -39
- package/dist/plugins/thematic-break/index.js +19 -32
- package/dist/plugins/toolbar/components/BlockTypeSelect.js +9 -8
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +4 -4
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +3 -2
- package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js +5 -5
- package/dist/plugins/toolbar/components/CodeToggle.js +4 -3
- package/dist/plugins/toolbar/components/CreateLink.js +6 -4
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +5 -5
- package/dist/plugins/toolbar/components/InsertAdmonition.js +5 -3
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +5 -3
- package/dist/plugins/toolbar/components/InsertFrontmatter.js +6 -5
- package/dist/plugins/toolbar/components/InsertImage.js +6 -5
- package/dist/plugins/toolbar/components/InsertSandpack.js +5 -4
- package/dist/plugins/toolbar/components/InsertTable.js +5 -3
- package/dist/plugins/toolbar/components/InsertThematicBreak.js +6 -4
- package/dist/plugins/toolbar/components/ListsToggle.js +5 -4
- package/dist/plugins/toolbar/components/ShowSandpackInfo.js +9 -4
- package/dist/plugins/toolbar/components/UndoRedo.js +3 -3
- package/dist/plugins/toolbar/index.js +15 -31
- package/dist/plugins/toolbar/primitives/DialogButton.js +23 -24
- package/dist/plugins/toolbar/primitives/TooltipWrap.js +3 -2
- package/dist/plugins/toolbar/primitives/select.js +5 -4
- package/dist/plugins/toolbar/primitives/toolbar.js +10 -4
- package/dist/style.css +935 -571
- package/dist/styles/globals.css.js +1 -4
- package/dist/styles/lexical-theme.module.css.js +25 -19
- package/dist/styles/ui.module.css.js +103 -103
- package/package.json +64 -317
- package/dist/FormatConstants.d.ts +0 -9
- package/dist/MDXEditor.d.ts +0 -103
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts +0 -17
- package/dist/directive-editors/GenericDirectiveEditor.d.ts +0 -8
- package/dist/exportMarkdownFromLexical.d.ts +0 -138
- package/dist/gurx/index.d.ts +0 -3
- package/dist/gurx/react.d.ts +0 -152
- package/dist/gurx/react.js +0 -206
- package/dist/gurx/realm.d.ts +0 -148
- package/dist/gurx/realm.js +0 -489
- package/dist/gurx/realmFactory.d.ts +0 -79
- package/dist/gurx/realmFactory.js +0 -32
- package/dist/importMarkdownToLexical.d.ts +0 -101
- package/dist/jsx-editors/GenericJsxEditor.d.ts +0 -8
- package/dist/plugins/codeblock/CodeBlockNode.d.ts +0 -100
- package/dist/plugins/codeblock/CodeBlockVisitor.d.ts +0 -4
- package/dist/plugins/codeblock/MdastCodeVisitor.d.ts +0 -3
- package/dist/plugins/codeblock/index.d.ts +0 -787
- package/dist/plugins/codemirror/CodeMirrorEditor.d.ts +0 -3
- package/dist/plugins/codemirror/index.d.ts +0 -1038
- package/dist/plugins/core/GenericHTMLNode.d.ts +0 -38
- package/dist/plugins/core/Icon.d.ts +0 -6
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.d.ts +0 -4
- package/dist/plugins/core/LexicalLinebreakVisitor.d.ts +0 -4
- package/dist/plugins/core/LexicalParagraphVisitor.d.ts +0 -4
- package/dist/plugins/core/LexicalRootVisitor.d.ts +0 -4
- package/dist/plugins/core/LexicalTextVisitor.d.ts +0 -5
- package/dist/plugins/core/MdastBreakVisitor.d.ts +0 -3
- package/dist/plugins/core/MdastFormattingVisitor.d.ts +0 -4
- package/dist/plugins/core/MdastHTMLNode.d.ts +0 -13
- package/dist/plugins/core/MdastHTMLVisitor.d.ts +0 -3
- package/dist/plugins/core/MdastInlineCodeVisitor.d.ts +0 -3
- package/dist/plugins/core/MdastParagraphVisitor.d.ts +0 -3
- package/dist/plugins/core/MdastRootVisitor.d.ts +0 -3
- package/dist/plugins/core/MdastTextVisitor.d.ts +0 -3
- package/dist/plugins/core/NestedLexicalEditor.d.ts +0 -92
- package/dist/plugins/core/PropertyPopover.d.ts +0 -23
- package/dist/plugins/core/SharedHistoryPlugin.d.ts +0 -2
- package/dist/plugins/core/index.d.ts +0 -583
- package/dist/plugins/core/ui/DownshiftAutoComplete.d.ts +0 -15
- package/dist/plugins/core/ui/PopoverUtils.d.ts +0 -4
- package/dist/plugins/diff-source/DiffSourceWrapper.d.ts +0 -4
- package/dist/plugins/diff-source/DiffViewer.d.ts +0 -2
- package/dist/plugins/diff-source/SourceEditor.d.ts +0 -4
- package/dist/plugins/diff-source/index.d.ts +0 -725
- package/dist/plugins/directives/DirectiveNode.d.ts +0 -51
- package/dist/plugins/directives/DirectiveVisitor.d.ts +0 -4
- package/dist/plugins/directives/MdastDirectiveVisitor.d.ts +0 -3
- package/dist/plugins/directives/index.d.ts +0 -773
- package/dist/plugins/frontmatter/FrontmatterEditor.d.ts +0 -6
- package/dist/plugins/frontmatter/FrontmatterNode.d.ts +0 -35
- package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.d.ts +0 -4
- package/dist/plugins/frontmatter/MdastFrontmatterVisitor.d.ts +0 -3
- package/dist/plugins/frontmatter/index.d.ts +0 -717
- package/dist/plugins/headings/LexicalHeadingVisitor.d.ts +0 -4
- package/dist/plugins/headings/MdastHeadingVisitor.d.ts +0 -3
- package/dist/plugins/headings/index.d.ts +0 -707
- package/dist/plugins/image/ImageDialog.d.ts +0 -2
- package/dist/plugins/image/ImageEditor.d.ts +0 -10
- package/dist/plugins/image/ImageNode.d.ts +0 -65
- package/dist/plugins/image/ImageResizer.d.ts +0 -18
- package/dist/plugins/image/LexicalImageVisitor.d.ts +0 -4
- package/dist/plugins/image/MdastImageVisitor.d.ts +0 -6
- package/dist/plugins/image/index.d.ts +0 -804
- package/dist/plugins/jsx/LexicalJsxNode.d.ts +0 -54
- package/dist/plugins/jsx/LexicalJsxVisitor.d.ts +0 -4
- package/dist/plugins/jsx/MdastMdxJsEsmVisitor.d.ts +0 -3
- package/dist/plugins/jsx/MdastMdxJsxElementVisitor.d.ts +0 -3
- package/dist/plugins/jsx/index.d.ts +0 -779
- package/dist/plugins/link/AutoLinkPlugin.d.ts +0 -9
- package/dist/plugins/link/LexicalLinkVisitor.d.ts +0 -4
- package/dist/plugins/link/MdastLinkVisitor.d.ts +0 -3
- package/dist/plugins/link/index.d.ts +0 -101
- package/dist/plugins/link-dialog/LinkDialog.d.ts +0 -16
- package/dist/plugins/link-dialog/index.d.ts +0 -670
- package/dist/plugins/lists/LexicalListItemVisitor.d.ts +0 -4
- package/dist/plugins/lists/LexicalListVisitor.d.ts +0 -4
- package/dist/plugins/lists/MdastListItemVisitor.d.ts +0 -3
- package/dist/plugins/lists/MdastListVisitor.d.ts +0 -3
- package/dist/plugins/lists/index.d.ts +0 -703
- package/dist/plugins/markdown-shortcut/index.d.ts +0 -80
- package/dist/plugins/quote/LexicalQuoteVisitor.d.ts +0 -4
- package/dist/plugins/quote/MdastBlockQuoteVisitor.d.ts +0 -3
- package/dist/plugins/quote/index.d.ts +0 -480
- package/dist/plugins/sandpack/SandpackEditor.d.ts +0 -7
- package/dist/plugins/sandpack/index.d.ts +0 -1077
- package/dist/plugins/sandpack/useCodeMirrorRef.d.ts +0 -4
- package/dist/plugins/table/LexicalTableVisitor.d.ts +0 -4
- package/dist/plugins/table/MdastTableVisitor.d.ts +0 -3
- package/dist/plugins/table/TableEditor.d.ts +0 -21
- package/dist/plugins/table/TableNode.d.ts +0 -52
- package/dist/plugins/table/index.d.ts +0 -704
- package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.d.ts +0 -4
- package/dist/plugins/thematic-break/MdastThematicBreakVisitor.d.ts +0 -3
- package/dist/plugins/thematic-break/index.d.ts +0 -693
- package/dist/plugins/toolbar/components/BlockTypeSelect.d.ts +0 -6
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts +0 -5
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.d.ts +0 -6
- package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.d.ts +0 -7
- package/dist/plugins/toolbar/components/CodeToggle.d.ts +0 -6
- package/dist/plugins/toolbar/components/CreateLink.d.ts +0 -6
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts +0 -18
- package/dist/plugins/toolbar/components/InsertAdmonition.d.ts +0 -6
- package/dist/plugins/toolbar/components/InsertCodeBlock.d.ts +0 -7
- package/dist/plugins/toolbar/components/InsertFrontmatter.d.ts +0 -6
- package/dist/plugins/toolbar/components/InsertImage.d.ts +0 -6
- package/dist/plugins/toolbar/components/InsertSandpack.d.ts +0 -6
- package/dist/plugins/toolbar/components/InsertTable.d.ts +0 -6
- package/dist/plugins/toolbar/components/InsertThematicBreak.d.ts +0 -6
- package/dist/plugins/toolbar/components/KitchenSinkToolbar.d.ts +0 -7
- package/dist/plugins/toolbar/components/ListsToggle.d.ts +0 -7
- package/dist/plugins/toolbar/components/ShowSandpackInfo.d.ts +0 -7
- package/dist/plugins/toolbar/components/UndoRedo.d.ts +0 -5
- package/dist/plugins/toolbar/index.d.ts +0 -564
- package/dist/plugins/toolbar/primitives/DialogButton.d.ts +0 -40
- package/dist/plugins/toolbar/primitives/TooltipWrap.d.ts +0 -8
- package/dist/plugins/toolbar/primitives/select.d.ts +0 -50
- package/dist/plugins/toolbar/primitives/toolbar.d.ts +0 -163
- package/dist/styles/lexicalTheme.d.ts +0 -2
- package/dist/utils/detectMac.d.ts +0 -3
- package/dist/utils/fp.d.ts +0 -47
- package/dist/utils/isPartOftheEditorUI.d.ts +0 -1
- package/dist/utils/lexicalHelpers.d.ts +0 -11
- package/dist/utils/makeHslTransparent.d.ts +0 -1
- package/dist/utils/mergeStyleAttributes.d.ts +0 -1
- package/dist/utils/uuid4.d.ts +0 -1
- package/dist/utils/voidEmitter.d.ts +0 -14
- package/dist/utils/whitespaceConversion.d.ts +0 -2
- package/dist/utils/whitespaceConversion.js +0 -9
package/dist/index.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import "./styles/globals.css.js";
|
|
2
|
+
export * from "@mdxeditor/gurx";
|
|
2
3
|
import { MDXEditor } from "./MDXEditor.js";
|
|
3
4
|
import { MarkdownParseError, UnrecognizedMarkdownConstructError, importMarkdownToLexical, importMdastTreeToLexical } from "./importMarkdownToLexical.js";
|
|
4
5
|
import { exportLexicalTreeToMdast, exportMarkdownFromLexical } from "./exportMarkdownFromLexical.js";
|
|
5
|
-
import { NESTED_EDITOR_UPDATED_COMMAND, corePlugin,
|
|
6
|
-
import {
|
|
7
|
-
import { thematicBreakPlugin
|
|
8
|
-
import {
|
|
9
|
-
import { tablePlugin
|
|
10
|
-
import { linkPlugin } from "./plugins/link/index.js";
|
|
11
|
-
import { INSERT_IMAGE_COMMAND, imagePlugin,
|
|
12
|
-
import { frontmatterPlugin,
|
|
13
|
-
import { quotePlugin
|
|
14
|
-
import { isMdastJsxNode, jsxPlugin
|
|
6
|
+
import { Appender, NESTED_EDITOR_UPDATED_COMMAND, activeEditor$, activeEditorSubscriptions$, activePlugins$, addActivePlugin$, addComposerChild$, addEditorWrapper$, addExportVisitor$, addImportVisitor$, addLexicalNode$, addMdastExtension$, addNestedEditorChild$, addSyntaxExtension$, addToMarkdownExtension$, addTopAreaChild$, applyBlockType$, applyFormat$, autoFocus$, composerChildren$, contentEditableClassName$, convertSelectionToNode$, corePlugin, createActiveEditorSubscription$, createRootEditorSubscription$, currentBlockType$, currentFormat$, currentSelection$, editorInFocus$, editorRootElementRef$, editorWrappers$, exportVisitors$, historyState$, iconComponentFor$, importVisitors$, inFocus$, initialMarkdown$, initialRootEditorState$, insertDecoratorNode$, jsxComponentDescriptors$, jsxIsAvailable$, markdown$, markdownErrorSignal$, markdownProcessingError$, markdownSourceEditorValue$, mdastExtensions$, nestedEditorChildren$, onBlur$, placeholder$, readOnly$, rootEditor$, rootEditorSubscriptions$, setMarkdown$, syntaxExtensions$, toMarkdownExtensions$, toMarkdownOptions$, topAreaChildren$, usedLexicalNodes$, viewMode$ } from "./plugins/core/index.js";
|
|
7
|
+
import { ALL_HEADING_LEVELS, allowedHeadingLevels$, headingsPlugin } from "./plugins/headings/index.js";
|
|
8
|
+
import { insertThematicBreak$, thematicBreakPlugin } from "./plugins/thematic-break/index.js";
|
|
9
|
+
import { applyListType$, currentListType$, listsPlugin } from "./plugins/lists/index.js";
|
|
10
|
+
import { insertTable$, tablePlugin } from "./plugins/table/index.js";
|
|
11
|
+
import { disableAutoLink$, linkPlugin } from "./plugins/link/index.js";
|
|
12
|
+
import { INSERT_IMAGE_COMMAND, closeImageDialog$, disableImageResize$, imageAutocompleteSuggestions$, imageDialogState$, imagePlugin, imagePreviewHandler$, imageUploadHandler$, insertImage$, openEditImageDialog$, openNewImageDialog$, saveImage$ } from "./plugins/image/index.js";
|
|
13
|
+
import { frontmatterDialogOpen$, frontmatterPlugin, hasFrontmatter$, insertFrontmatter$, removeFrontmatter$ } from "./plugins/frontmatter/index.js";
|
|
14
|
+
import { quotePlugin } from "./plugins/quote/index.js";
|
|
15
|
+
import { insertJsx$, isMdastJsxNode, jsxPlugin } from "./plugins/jsx/index.js";
|
|
15
16
|
import { GenericJsxEditor } from "./jsx-editors/GenericJsxEditor.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
17
|
+
import { insertSandpack$, sandpackConfig$, sandpackPlugin } from "./plugins/sandpack/index.js";
|
|
18
|
+
import { codeBlockLanguages$, codeMirrorPlugin, insertCodeMirror$ } from "./plugins/codemirror/index.js";
|
|
18
19
|
import { CodeMirrorEditor } from "./plugins/codemirror/CodeMirrorEditor.js";
|
|
19
|
-
import { codeBlockPlugin,
|
|
20
|
-
import { directivesPlugin,
|
|
20
|
+
import { appendCodeBlockEditorDescriptor$, codeBlockEditorDescriptors$, codeBlockPlugin, defaultCodeBlockLanguage$, insertCodeBlock$ } from "./plugins/codeblock/index.js";
|
|
21
|
+
import { directiveDescriptors$, directivesPlugin, insertDirective$ } from "./plugins/directives/index.js";
|
|
21
22
|
import { ADMONITION_TYPES, AdmonitionDirectiveDescriptor } from "./directive-editors/AdmonitionDirectiveDescriptor.js";
|
|
22
23
|
import { GenericDirectiveEditor } from "./directive-editors/GenericDirectiveEditor.js";
|
|
23
|
-
import { linkDialogPlugin,
|
|
24
|
-
import { toolbarPlugin
|
|
25
|
-
import {
|
|
24
|
+
import { applyLinkChanges$, cancelLinkEdit$, linkAutocompleteSuggestions$, linkDialogPlugin, linkDialogState$, onWindowChange$, openLinkEditDialog$, removeLink$, switchFromPreviewToLinkEdit$, updateLink$ } from "./plugins/link-dialog/index.js";
|
|
25
|
+
import { toolbarContents$, toolbarPlugin } from "./plugins/toolbar/index.js";
|
|
26
|
+
import { cmExtensions$, diffMarkdown$, diffSourcePlugin } from "./plugins/diff-source/index.js";
|
|
26
27
|
import { markdownShortcutPlugin } from "./plugins/markdown-shortcut/index.js";
|
|
27
28
|
import { BlockTypeSelect } from "./plugins/toolbar/components/BlockTypeSelect.js";
|
|
28
29
|
import { BoldItalicUnderlineToggles } from "./plugins/toolbar/components/BoldItalicUnderlineToggles.js";
|
|
@@ -55,20 +56,28 @@ import { fromWithinEditorRead, getSelectedNode, getSelectionRectangle, getStateA
|
|
|
55
56
|
import { makeHslTransparent } from "./utils/makeHslTransparent.js";
|
|
56
57
|
import { uuidv4 } from "./utils/uuid4.js";
|
|
57
58
|
import { voidEmitter } from "./utils/voidEmitter.js";
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
59
|
+
import { RealmWithPlugins, realmPlugin } from "./RealmWithPlugins.js";
|
|
60
|
+
import { htmlTags, isMdastHTMLNode } from "./plugins/core/MdastHTMLNode.js";
|
|
61
|
+
import { $createGenericHTMLNode, $isGenericHTMLNode, GenericHTMLNode, TYPE_NAME } from "./plugins/core/GenericHTMLNode.js";
|
|
62
|
+
import { $createTableNode, $isTableNode, TableNode } from "./plugins/table/TableNode.js";
|
|
60
63
|
import { $createImageNode, $isImageNode, ImageNode } from "./plugins/image/ImageNode.js";
|
|
61
|
-
import { useCodeBlockEditorContext } from "./plugins/codeblock/CodeBlockNode.js";
|
|
62
|
-
import {
|
|
63
|
-
import { RealmPluginInitializer, RequirePlugin, realmFactoryToComponent, realmPlugin, sysHooks, useHasPlugin } from "./gurx/react.js";
|
|
64
|
-
import { getRealmFactory, realmFactory, system } from "./gurx/realmFactory.js";
|
|
64
|
+
import { $createCodeBlockNode, $isCodeBlockNode, CodeBlockNode, useCodeBlockEditorContext } from "./plugins/codeblock/CodeBlockNode.js";
|
|
65
|
+
import { $createDirectiveNode, $isDirectiveNode, DirectiveNode } from "./plugins/directives/DirectiveNode.js";
|
|
65
66
|
export {
|
|
67
|
+
$createCodeBlockNode,
|
|
68
|
+
$createDirectiveNode,
|
|
66
69
|
$createGenericHTMLNode,
|
|
67
70
|
$createImageNode,
|
|
71
|
+
$createTableNode,
|
|
72
|
+
$isCodeBlockNode,
|
|
73
|
+
$isDirectiveNode,
|
|
68
74
|
$isGenericHTMLNode,
|
|
69
75
|
$isImageNode,
|
|
76
|
+
$isTableNode,
|
|
70
77
|
ADMONITION_TYPES,
|
|
78
|
+
ALL_HEADING_LEVELS,
|
|
71
79
|
AdmonitionDirectiveDescriptor,
|
|
80
|
+
Appender,
|
|
72
81
|
BlockTypeSelect,
|
|
73
82
|
BoldItalicUnderlineToggles,
|
|
74
83
|
Button,
|
|
@@ -77,12 +86,14 @@ export {
|
|
|
77
86
|
CAN_USE_DOM,
|
|
78
87
|
ChangeAdmonitionType,
|
|
79
88
|
ChangeCodeMirrorLanguage,
|
|
89
|
+
CodeBlockNode,
|
|
80
90
|
CodeMirrorEditor,
|
|
81
91
|
CodeToggle,
|
|
82
92
|
ConditionalContents,
|
|
83
93
|
CreateLink,
|
|
84
94
|
DialogButton,
|
|
85
95
|
DiffSourceToggleWrapper,
|
|
96
|
+
DirectiveNode,
|
|
86
97
|
GenericDirectiveEditor,
|
|
87
98
|
GenericHTMLNode,
|
|
88
99
|
GenericJsxEditor,
|
|
@@ -105,9 +116,7 @@ export {
|
|
|
105
116
|
NestedEditorsContext,
|
|
106
117
|
NestedLexicalEditor,
|
|
107
118
|
PropertyPopover,
|
|
108
|
-
|
|
109
|
-
RefCount,
|
|
110
|
-
RequirePlugin,
|
|
119
|
+
RealmWithPlugins,
|
|
111
120
|
Root,
|
|
112
121
|
Select,
|
|
113
122
|
SelectButtonTrigger,
|
|
@@ -118,96 +127,159 @@ export {
|
|
|
118
127
|
ShowSandpackInfo,
|
|
119
128
|
SingleChoiceToggleGroup,
|
|
120
129
|
SingleToggleGroup,
|
|
130
|
+
TYPE_NAME,
|
|
131
|
+
TableNode,
|
|
121
132
|
ToggleSingleGroupWithItem,
|
|
122
133
|
ToolbarToggleItem,
|
|
123
134
|
TooltipWrap,
|
|
124
135
|
UndoRedo,
|
|
125
136
|
UnrecognizedMarkdownConstructError,
|
|
126
|
-
|
|
137
|
+
activeEditor$,
|
|
138
|
+
activeEditorSubscriptions$,
|
|
139
|
+
activePlugins$,
|
|
140
|
+
addActivePlugin$,
|
|
141
|
+
addComposerChild$,
|
|
142
|
+
addEditorWrapper$,
|
|
143
|
+
addExportVisitor$,
|
|
144
|
+
addImportVisitor$,
|
|
145
|
+
addLexicalNode$,
|
|
146
|
+
addMdastExtension$,
|
|
147
|
+
addNestedEditorChild$,
|
|
148
|
+
addSyntaxExtension$,
|
|
149
|
+
addToMarkdownExtension$,
|
|
150
|
+
addTopAreaChild$,
|
|
151
|
+
allowedHeadingLevels$,
|
|
127
152
|
always,
|
|
153
|
+
appendCodeBlockEditorDescriptor$,
|
|
154
|
+
applyBlockType$,
|
|
155
|
+
applyFormat$,
|
|
156
|
+
applyLinkChanges$,
|
|
157
|
+
applyListType$,
|
|
158
|
+
autoFocus$,
|
|
128
159
|
call,
|
|
160
|
+
cancelLinkEdit$,
|
|
161
|
+
closeImageDialog$,
|
|
162
|
+
cmExtensions$,
|
|
163
|
+
codeBlockEditorDescriptors$,
|
|
164
|
+
codeBlockLanguages$,
|
|
129
165
|
codeBlockPlugin,
|
|
130
|
-
codeBlockPluginHooks,
|
|
131
|
-
codeBlockSystem,
|
|
132
|
-
codeMirrorHooks,
|
|
133
166
|
codeMirrorPlugin,
|
|
134
|
-
codeMirrorSystem,
|
|
135
167
|
compose,
|
|
168
|
+
composerChildren$,
|
|
169
|
+
contentEditableClassName$,
|
|
136
170
|
controlOrMeta,
|
|
171
|
+
convertSelectionToNode$,
|
|
137
172
|
corePlugin,
|
|
138
|
-
|
|
139
|
-
|
|
173
|
+
createActiveEditorSubscription$,
|
|
174
|
+
createRootEditorSubscription$,
|
|
175
|
+
currentBlockType$,
|
|
176
|
+
currentFormat$,
|
|
177
|
+
currentListType$,
|
|
178
|
+
currentSelection$,
|
|
140
179
|
curry1to0,
|
|
141
180
|
curry2to1,
|
|
142
|
-
|
|
181
|
+
defaultCodeBlockLanguage$,
|
|
182
|
+
diffMarkdown$,
|
|
143
183
|
diffSourcePlugin,
|
|
144
|
-
|
|
145
|
-
diffSourceSystem,
|
|
184
|
+
directiveDescriptors$,
|
|
146
185
|
directivesPlugin,
|
|
147
|
-
|
|
148
|
-
|
|
186
|
+
disableAutoLink$,
|
|
187
|
+
disableImageResize$,
|
|
188
|
+
editorInFocus$,
|
|
189
|
+
editorRootElementRef$,
|
|
190
|
+
editorWrappers$,
|
|
149
191
|
exportLexicalTreeToMdast,
|
|
150
192
|
exportMarkdownFromLexical,
|
|
193
|
+
exportVisitors$,
|
|
151
194
|
fromWithinEditorRead,
|
|
195
|
+
frontmatterDialogOpen$,
|
|
152
196
|
frontmatterPlugin,
|
|
153
|
-
frontmatterPluginHooks,
|
|
154
|
-
frontmatterSystem,
|
|
155
|
-
getRealmFactory,
|
|
156
197
|
getSelectedNode,
|
|
157
198
|
getSelectionRectangle,
|
|
158
199
|
getStateAsMarkdown,
|
|
200
|
+
hasFrontmatter$,
|
|
159
201
|
headingsPlugin,
|
|
160
|
-
|
|
161
|
-
|
|
202
|
+
historyState$,
|
|
203
|
+
htmlTags,
|
|
204
|
+
iconComponentFor$,
|
|
205
|
+
imageAutocompleteSuggestions$,
|
|
206
|
+
imageDialogState$,
|
|
162
207
|
imagePlugin,
|
|
163
|
-
|
|
164
|
-
|
|
208
|
+
imagePreviewHandler$,
|
|
209
|
+
imageUploadHandler$,
|
|
165
210
|
importMarkdownToLexical,
|
|
166
211
|
importMdastTreeToLexical,
|
|
212
|
+
importVisitors$,
|
|
213
|
+
inFocus$,
|
|
214
|
+
initialMarkdown$,
|
|
215
|
+
initialRootEditorState$,
|
|
216
|
+
insertCodeBlock$,
|
|
217
|
+
insertCodeMirror$,
|
|
218
|
+
insertDecoratorNode$,
|
|
219
|
+
insertDirective$,
|
|
220
|
+
insertFrontmatter$,
|
|
221
|
+
insertImage$,
|
|
222
|
+
insertJsx$,
|
|
223
|
+
insertSandpack$,
|
|
224
|
+
insertTable$,
|
|
225
|
+
insertThematicBreak$,
|
|
226
|
+
isMdastHTMLNode,
|
|
167
227
|
isMdastJsxNode,
|
|
168
228
|
isPartOftheEditorUI,
|
|
169
229
|
joinProc,
|
|
230
|
+
jsxComponentDescriptors$,
|
|
231
|
+
jsxIsAvailable$,
|
|
170
232
|
jsxPlugin,
|
|
171
|
-
|
|
172
|
-
jsxSystem,
|
|
233
|
+
linkAutocompleteSuggestions$,
|
|
173
234
|
linkDialogPlugin,
|
|
174
|
-
|
|
235
|
+
linkDialogState$,
|
|
175
236
|
linkPlugin,
|
|
176
237
|
listsPlugin,
|
|
177
|
-
listsPluginHooks,
|
|
178
|
-
listsSystem,
|
|
179
238
|
makeHslTransparent,
|
|
239
|
+
markdown$,
|
|
240
|
+
markdownErrorSignal$,
|
|
241
|
+
markdownProcessingError$,
|
|
180
242
|
markdownShortcutPlugin,
|
|
243
|
+
markdownSourceEditorValue$,
|
|
244
|
+
mdastExtensions$,
|
|
245
|
+
nestedEditorChildren$,
|
|
181
246
|
noop,
|
|
247
|
+
onBlur$,
|
|
248
|
+
onWindowChange$,
|
|
249
|
+
openEditImageDialog$,
|
|
250
|
+
openLinkEditDialog$,
|
|
251
|
+
openNewImageDialog$,
|
|
252
|
+
placeholder$,
|
|
182
253
|
prop,
|
|
183
254
|
quotePlugin,
|
|
184
|
-
|
|
185
|
-
realm,
|
|
186
|
-
realmFactory,
|
|
187
|
-
realmFactoryToComponent,
|
|
255
|
+
readOnly$,
|
|
188
256
|
realmPlugin,
|
|
189
|
-
|
|
257
|
+
removeFrontmatter$,
|
|
258
|
+
removeLink$,
|
|
259
|
+
rootEditor$,
|
|
260
|
+
rootEditorSubscriptions$,
|
|
261
|
+
sandpackConfig$,
|
|
190
262
|
sandpackPlugin,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
263
|
+
saveImage$,
|
|
264
|
+
setMarkdown$,
|
|
265
|
+
switchFromPreviewToLinkEdit$,
|
|
266
|
+
syntaxExtensions$,
|
|
195
267
|
tablePlugin,
|
|
196
|
-
tablePluginHooks,
|
|
197
|
-
tableSystem,
|
|
198
268
|
tap,
|
|
199
269
|
thematicBreakPlugin,
|
|
200
|
-
thematicBreakPluginHooks,
|
|
201
|
-
thematicBreakSystem,
|
|
202
270
|
thrush,
|
|
271
|
+
toMarkdownExtensions$,
|
|
272
|
+
toMarkdownOptions$,
|
|
273
|
+
toolbarContents$,
|
|
203
274
|
toolbarPlugin,
|
|
204
|
-
|
|
205
|
-
|
|
275
|
+
topAreaChildren$,
|
|
276
|
+
updateLink$,
|
|
206
277
|
useCodeBlockEditorContext,
|
|
207
|
-
useHasPlugin,
|
|
208
278
|
useLexicalNodeRemove,
|
|
209
279
|
useMdastNodeUpdater,
|
|
210
280
|
useNestedEditorContext,
|
|
281
|
+
usedLexicalNodes$,
|
|
211
282
|
uuidv4,
|
|
283
|
+
viewMode$,
|
|
212
284
|
voidEmitter
|
|
213
285
|
};
|
|
@@ -5,15 +5,18 @@ import styles from "../styles/ui.module.css.js";
|
|
|
5
5
|
const GenericJsxEditor = ({ mdastNode, descriptor }) => {
|
|
6
6
|
const updateMdastNode = useMdastNodeUpdater();
|
|
7
7
|
const properties = React__default.useMemo(() => {
|
|
8
|
-
return descriptor.props.reduce(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
return descriptor.props.reduce(
|
|
9
|
+
(acc, descriptor2) => {
|
|
10
|
+
const attribute = mdastNode.attributes.find((attr) => attr.name === descriptor2.name);
|
|
11
|
+
if (attribute) {
|
|
12
|
+
acc[descriptor2.name] = attribute.value;
|
|
13
|
+
} else {
|
|
14
|
+
acc[descriptor2.name] = "";
|
|
15
|
+
}
|
|
16
|
+
return acc;
|
|
17
|
+
},
|
|
18
|
+
{}
|
|
19
|
+
);
|
|
17
20
|
}, [mdastNode, descriptor]);
|
|
18
21
|
const onChange = React__default.useCallback(
|
|
19
22
|
(values) => {
|
|
@@ -6,9 +6,10 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
import React__default from "react";
|
|
8
8
|
import { DecoratorNode } from "lexical";
|
|
9
|
-
import {
|
|
9
|
+
import { codeBlockEditorDescriptors$ } from "./index.js";
|
|
10
10
|
import { voidEmitter } from "../../utils/voidEmitter.js";
|
|
11
11
|
import { NESTED_EDITOR_UPDATED_COMMAND } from "../core/index.js";
|
|
12
|
+
import { useCellValue } from "@mdxeditor/gurx";
|
|
12
13
|
class CodeBlockNode extends DecoratorNode {
|
|
13
14
|
constructor(code, language, meta, key) {
|
|
14
15
|
super(key);
|
|
@@ -132,8 +133,8 @@ function useCodeBlockEditorContext() {
|
|
|
132
133
|
}
|
|
133
134
|
return context;
|
|
134
135
|
}
|
|
135
|
-
|
|
136
|
-
const
|
|
136
|
+
const CodeBlockEditorContainer = (props) => {
|
|
137
|
+
const codeBlockEditorDescriptors = useCellValue(codeBlockEditorDescriptors$);
|
|
137
138
|
const descriptor = codeBlockEditorDescriptors.sort((a, b) => b.priority - a.priority).find((descriptor2) => descriptor2.match(props.language || "", props.meta || ""));
|
|
138
139
|
if (!descriptor) {
|
|
139
140
|
throw new Error(`No CodeBlockEditor registered for language=${props.language} meta=${props.meta}`);
|
|
@@ -141,7 +142,7 @@ function CodeBlockEditorContainer(props) {
|
|
|
141
142
|
const Editor = descriptor.Editor;
|
|
142
143
|
const { codeBlockNode: _, parentEditor: __, ...restProps } = props;
|
|
143
144
|
return /* @__PURE__ */ React__default.createElement(CodeBlockEditorContextProvider, { parentEditor: props.parentEditor, lexicalNode: props.codeBlockNode }, /* @__PURE__ */ React__default.createElement(Editor, { ...restProps }));
|
|
144
|
-
}
|
|
145
|
+
};
|
|
145
146
|
function $createCodeBlockNode(options) {
|
|
146
147
|
const { code = "", language = "", meta = "" } = options;
|
|
147
148
|
return new CodeBlockNode(code, language, meta);
|
|
@@ -152,7 +153,6 @@ function $isCodeBlockNode(node) {
|
|
|
152
153
|
export {
|
|
153
154
|
$createCodeBlockNode,
|
|
154
155
|
$isCodeBlockNode,
|
|
155
|
-
CodeBlockEditorContainer,
|
|
156
156
|
CodeBlockNode,
|
|
157
157
|
useCodeBlockEditorContext
|
|
158
158
|
};
|
|
@@ -1,73 +1,47 @@
|
|
|
1
1
|
import { CodeBlockVisitor } from "./CodeBlockVisitor.js";
|
|
2
2
|
import { MdastCodeVisitor } from "./MdastCodeVisitor.js";
|
|
3
|
-
import {
|
|
3
|
+
import { insertDecoratorNode$, Appender, addActivePlugin$, addImportVisitor$, addLexicalNode$, addExportVisitor$ } from "../core/index.js";
|
|
4
4
|
import { $createCodeBlockNode, CodeBlockNode } from "./CodeBlockNode.js";
|
|
5
|
-
import { useCodeBlockEditorContext } from "./CodeBlockNode.js";
|
|
6
|
-
import {
|
|
7
|
-
import { realmPlugin } from "../../
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
appendCodeBlockEditorDescriptor,
|
|
27
|
-
r.o.withLatestFrom(codeBlockEditorDescriptors),
|
|
28
|
-
r.o.map(([newValue, values]) => {
|
|
29
|
-
if (values.includes(newValue)) {
|
|
30
|
-
return values;
|
|
31
|
-
}
|
|
32
|
-
return [...values, newValue];
|
|
33
|
-
})
|
|
34
|
-
),
|
|
35
|
-
codeBlockEditorDescriptors
|
|
36
|
-
);
|
|
37
|
-
return {
|
|
38
|
-
codeBlockEditorDescriptors,
|
|
39
|
-
defaultCodeBlockLanguage,
|
|
40
|
-
appendCodeBlockEditorDescriptor,
|
|
41
|
-
insertCodeBlock
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
[coreSystem]
|
|
45
|
-
);
|
|
46
|
-
const [
|
|
47
|
-
/**
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
codeBlockPlugin,
|
|
51
|
-
/**
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
codeBlockPluginHooks
|
|
55
|
-
] = realmPlugin({
|
|
56
|
-
id: "codeblock",
|
|
57
|
-
systemSpec: codeBlockSystem,
|
|
58
|
-
applyParamsToSystem(realm, params) {
|
|
59
|
-
realm.pubKey("defaultCodeBlockLanguage", (params == null ? void 0 : params.defaultCodeBlockLanguage) || "");
|
|
5
|
+
import { $isCodeBlockNode, useCodeBlockEditorContext } from "./CodeBlockNode.js";
|
|
6
|
+
import { Cell, Signal, withLatestFrom, map } from "@mdxeditor/gurx";
|
|
7
|
+
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
8
|
+
const codeBlockEditorDescriptors$ = Cell([]);
|
|
9
|
+
const defaultCodeBlockLanguage$ = Cell("");
|
|
10
|
+
const insertCodeBlock$ = Signal((r) => {
|
|
11
|
+
r.link(
|
|
12
|
+
r.pipe(
|
|
13
|
+
insertCodeBlock$,
|
|
14
|
+
withLatestFrom(defaultCodeBlockLanguage$),
|
|
15
|
+
map(
|
|
16
|
+
([payload, defaultCodeBlockLanguage]) => () => $createCodeBlockNode({ language: defaultCodeBlockLanguage, ...payload })
|
|
17
|
+
)
|
|
18
|
+
),
|
|
19
|
+
insertDecoratorNode$
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
const appendCodeBlockEditorDescriptor$ = Appender(codeBlockEditorDescriptors$);
|
|
23
|
+
const codeBlockPlugin = realmPlugin({
|
|
24
|
+
update(realm, params) {
|
|
25
|
+
realm.pub(defaultCodeBlockLanguage$, (params == null ? void 0 : params.defaultCodeBlockLanguage) || "");
|
|
60
26
|
},
|
|
61
|
-
init
|
|
62
|
-
realm.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
27
|
+
init(realm, params) {
|
|
28
|
+
realm.pubIn({
|
|
29
|
+
[addActivePlugin$]: "codeblock",
|
|
30
|
+
[codeBlockEditorDescriptors$]: (params == null ? void 0 : params.codeBlockEditorDescriptors) || [],
|
|
31
|
+
[addImportVisitor$]: MdastCodeVisitor,
|
|
32
|
+
[addLexicalNode$]: CodeBlockNode,
|
|
33
|
+
[addExportVisitor$]: CodeBlockVisitor
|
|
34
|
+
});
|
|
66
35
|
}
|
|
67
36
|
});
|
|
68
37
|
export {
|
|
38
|
+
$createCodeBlockNode,
|
|
39
|
+
$isCodeBlockNode,
|
|
40
|
+
CodeBlockNode,
|
|
41
|
+
appendCodeBlockEditorDescriptor$,
|
|
42
|
+
codeBlockEditorDescriptors$,
|
|
69
43
|
codeBlockPlugin,
|
|
70
|
-
|
|
71
|
-
|
|
44
|
+
defaultCodeBlockLanguage$,
|
|
45
|
+
insertCodeBlock$,
|
|
72
46
|
useCodeBlockEditorContext
|
|
73
47
|
};
|
|
@@ -2,11 +2,12 @@ import { SandpackProvider, CodeEditor } from "@codesandbox/sandpack-react";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import styles from "../../styles/ui.module.css.js";
|
|
4
4
|
import { useCodeBlockEditorContext } from "../codeblock/CodeBlockNode.js";
|
|
5
|
-
import {
|
|
5
|
+
import { readOnly$ } from "../core/index.js";
|
|
6
6
|
import { useCodeMirrorRef } from "../sandpack/useCodeMirrorRef.js";
|
|
7
|
+
import { useCellValue } from "@mdxeditor/gurx";
|
|
7
8
|
const CodeMirrorEditor = ({ language, nodeKey, code, focusEmitter }) => {
|
|
8
9
|
const codeMirrorRef = useCodeMirrorRef(nodeKey, "codeblock", "jsx", focusEmitter);
|
|
9
|
-
const
|
|
10
|
+
const readOnly = useCellValue(readOnly$);
|
|
10
11
|
const { setCode } = useCodeBlockEditorContext();
|
|
11
12
|
React__default.useEffect(() => {
|
|
12
13
|
var _a, _b;
|
|
@@ -1,54 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
2
|
+
import { Cell, Signal, map } from "@mdxeditor/gurx";
|
|
3
|
+
import { insertCodeBlock$, appendCodeBlockEditorDescriptor$ } from "../codeblock/index.js";
|
|
3
4
|
import { CodeMirrorEditor } from "./CodeMirrorEditor.js";
|
|
4
|
-
|
|
5
|
-
import { realmPlugin } from "../../gurx/react.js";
|
|
6
|
-
const defaultCodeBlockLanguages = {
|
|
5
|
+
const codeBlockLanguages$ = Cell({
|
|
7
6
|
js: "JavaScript",
|
|
8
7
|
ts: "TypeScript",
|
|
9
8
|
tsx: "TypeScript (React)",
|
|
10
9
|
jsx: "JavaScript (React)",
|
|
11
10
|
css: "CSS"
|
|
12
|
-
};
|
|
13
|
-
const
|
|
14
|
-
(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
codeBlockLanguages,
|
|
32
|
-
insertCodeMirror
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
[coreSystem, codeBlockSystem]
|
|
36
|
-
);
|
|
37
|
-
const [
|
|
38
|
-
/** @internal */
|
|
39
|
-
codeMirrorPlugin,
|
|
40
|
-
/** @internal */
|
|
41
|
-
codeMirrorHooks
|
|
42
|
-
] = realmPlugin({
|
|
43
|
-
id: "codemirror",
|
|
44
|
-
systemSpec: codeMirrorSystem,
|
|
45
|
-
applyParamsToSystem(r, params) {
|
|
46
|
-
r.pubKey("codeBlockLanguages", params.codeBlockLanguages);
|
|
11
|
+
});
|
|
12
|
+
const insertCodeMirror$ = Signal((r) => {
|
|
13
|
+
r.link(
|
|
14
|
+
r.pipe(
|
|
15
|
+
insertCodeMirror$,
|
|
16
|
+
map(({ language, code }) => {
|
|
17
|
+
return {
|
|
18
|
+
code,
|
|
19
|
+
language,
|
|
20
|
+
meta: ""
|
|
21
|
+
};
|
|
22
|
+
})
|
|
23
|
+
),
|
|
24
|
+
insertCodeBlock$
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
const codeMirrorPlugin = realmPlugin({
|
|
28
|
+
update(r, params) {
|
|
29
|
+
r.pub(codeBlockLanguages$, params == null ? void 0 : params.codeBlockLanguages);
|
|
47
30
|
},
|
|
48
|
-
init(r,
|
|
49
|
-
r.
|
|
31
|
+
init(r, params) {
|
|
32
|
+
r.pub(appendCodeBlockEditorDescriptor$, {
|
|
50
33
|
match(language, meta) {
|
|
51
|
-
return codeBlockLanguages.hasOwnProperty(language) && meta === "";
|
|
34
|
+
return Boolean(params == null ? void 0 : params.codeBlockLanguages.hasOwnProperty(language)) && meta === "";
|
|
52
35
|
},
|
|
53
36
|
priority: 1,
|
|
54
37
|
Editor: CodeMirrorEditor
|
|
@@ -56,7 +39,7 @@ const [
|
|
|
56
39
|
}
|
|
57
40
|
});
|
|
58
41
|
export {
|
|
59
|
-
|
|
42
|
+
codeBlockLanguages$,
|
|
60
43
|
codeMirrorPlugin,
|
|
61
|
-
|
|
44
|
+
insertCodeMirror$
|
|
62
45
|
};
|
|
@@ -7,19 +7,26 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
import { ElementNode, $applyNodeReplacement } from "lexical";
|
|
8
8
|
const TYPE_NAME = "generic-html";
|
|
9
9
|
class GenericHTMLNode extends ElementNode {
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a new {@link GenericHTMLNode} with the specified MDAST HTML node as the object to edit.
|
|
12
|
+
*/
|
|
10
13
|
constructor(tag, type, attributes, key) {
|
|
11
14
|
super(key);
|
|
12
15
|
/** @internal */
|
|
13
16
|
__publicField(this, "__tag");
|
|
17
|
+
/** @internal */
|
|
14
18
|
__publicField(this, "__nodeType");
|
|
19
|
+
/** @internal */
|
|
15
20
|
__publicField(this, "__attributes");
|
|
16
21
|
this.__tag = tag;
|
|
17
22
|
this.__nodeType = type;
|
|
18
23
|
this.__attributes = attributes;
|
|
19
24
|
}
|
|
25
|
+
/** @internal */
|
|
20
26
|
static getType() {
|
|
21
27
|
return TYPE_NAME;
|
|
22
28
|
}
|
|
29
|
+
/** @internal */
|
|
23
30
|
static clone(node) {
|
|
24
31
|
return new GenericHTMLNode(node.__tag, node.__nodeType, node.__attributes, node.__key);
|
|
25
32
|
}
|
|
@@ -113,5 +120,6 @@ function $isGenericHTMLNode(node) {
|
|
|
113
120
|
export {
|
|
114
121
|
$createGenericHTMLNode,
|
|
115
122
|
$isGenericHTMLNode,
|
|
116
|
-
GenericHTMLNode
|
|
123
|
+
GenericHTMLNode,
|
|
124
|
+
TYPE_NAME
|
|
117
125
|
};
|