@mdxeditor/editor 0.0.1 → 0.0.4-development
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/LICENSE +2 -2
- package/README.md +15 -75
- package/dist/FormatConstants.d.ts +9 -0
- package/dist/FormatConstants.js +10 -0
- package/dist/MDXEditor.d.ts +103 -0
- package/dist/MDXEditor.js +144 -0
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts +17 -0
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.js +28 -0
- package/dist/directive-editors/GenericDirectiveEditor.d.ts +8 -0
- package/dist/directive-editors/GenericDirectiveEditor.js +32 -0
- package/dist/exportMarkdownFromLexical.d.ts +138 -0
- package/dist/exportMarkdownFromLexical.js +239 -0
- package/dist/gurx/index.d.ts +3 -0
- package/dist/gurx/react.d.ts +152 -0
- package/dist/gurx/react.js +206 -0
- package/dist/gurx/realm.d.ts +148 -0
- package/dist/gurx/realm.js +489 -0
- package/dist/gurx/realmFactory.d.ts +79 -0
- package/dist/gurx/realmFactory.js +32 -0
- package/dist/icons/add_column.svg.js +5 -0
- package/dist/icons/add_photo.svg.js +5 -0
- package/dist/icons/add_row.svg.js +5 -0
- package/dist/icons/admonition.svg.js +5 -0
- package/dist/icons/arrow_drop_down.svg.js +5 -0
- package/dist/icons/check.svg.js +5 -0
- package/dist/icons/close.svg.js +5 -0
- package/dist/icons/code.svg.js +5 -0
- package/dist/icons/content_copy.svg.js +5 -0
- package/dist/icons/delete_big.svg.js +5 -0
- package/dist/icons/delete_small.svg.js +5 -0
- package/dist/icons/difference.svg.js +5 -0
- package/dist/icons/edit.svg.js +5 -0
- package/dist/icons/format_align_center.svg.js +5 -0
- package/dist/icons/format_align_left.svg.js +5 -0
- package/dist/icons/format_align_right.svg.js +5 -0
- package/dist/icons/format_bold.svg.js +5 -0
- package/dist/icons/format_italic.svg.js +5 -0
- package/dist/icons/format_list_bulleted.svg.js +5 -0
- package/dist/icons/format_list_checked.svg.js +5 -0
- package/dist/icons/format_list_numbered.svg.js +5 -0
- package/dist/icons/format_underlined.svg.js +5 -0
- package/dist/icons/frame_source.svg.js +5 -0
- package/dist/icons/frontmatter.svg.js +5 -0
- package/dist/icons/horizontal_rule.svg.js +5 -0
- package/dist/icons/insert_col_left.svg.js +5 -0
- package/dist/icons/insert_col_right.svg.js +5 -0
- package/dist/icons/insert_row_above.svg.js +5 -0
- package/dist/icons/insert_row_below.svg.js +5 -0
- package/dist/icons/link.svg.js +5 -0
- package/dist/icons/link_off.svg.js +5 -0
- package/dist/icons/markdown.svg.js +5 -0
- package/dist/icons/more_horiz.svg.js +5 -0
- package/dist/icons/more_vert.svg.js +5 -0
- package/dist/icons/open_in_new.svg.js +5 -0
- package/dist/icons/redo.svg.js +5 -0
- package/dist/icons/rich_text.svg.js +5 -0
- package/dist/icons/sandpack.svg.js +5 -0
- package/dist/icons/settings.svg.js +5 -0
- package/dist/icons/table.svg.js +5 -0
- package/dist/icons/undo.svg.js +5 -0
- package/dist/importMarkdownToLexical.d.ts +101 -0
- package/dist/importMarkdownToLexical.js +93 -0
- package/dist/index.d.ts +62 -726
- package/dist/index.js +207 -4501
- package/dist/jsx-editors/GenericJsxEditor.d.ts +8 -0
- package/dist/jsx-editors/GenericJsxEditor.js +56 -0
- package/dist/plugins/codeblock/CodeBlockNode.d.ts +100 -0
- package/dist/plugins/codeblock/CodeBlockNode.js +158 -0
- package/dist/plugins/codeblock/CodeBlockVisitor.d.ts +4 -0
- package/dist/plugins/codeblock/CodeBlockVisitor.js +14 -0
- package/dist/plugins/codeblock/MdastCodeVisitor.d.ts +3 -0
- package/dist/plugins/codeblock/MdastCodeVisitor.js +16 -0
- package/dist/plugins/codeblock/index.d.ts +787 -0
- package/dist/plugins/codeblock/index.js +73 -0
- package/dist/plugins/codemirror/CodeMirrorEditor.d.ts +3 -0
- package/dist/plugins/codemirror/CodeMirrorEditor.js +42 -0
- package/dist/plugins/codemirror/index.d.ts +1038 -0
- package/dist/plugins/codemirror/index.js +62 -0
- package/dist/plugins/core/GenericHTMLNode.d.ts +38 -0
- package/dist/plugins/core/GenericHTMLNode.js +117 -0
- package/dist/plugins/core/Icon.d.ts +6 -0
- package/dist/plugins/core/Icon.js +92 -0
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.d.ts +4 -0
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.js +15 -0
- package/dist/plugins/core/LexicalLinebreakVisitor.d.ts +4 -0
- package/dist/plugins/core/LexicalLinebreakVisitor.js +10 -0
- package/dist/plugins/core/LexicalParagraphVisitor.d.ts +4 -0
- package/dist/plugins/core/LexicalParagraphVisitor.js +10 -0
- package/dist/plugins/core/LexicalRootVisitor.d.ts +4 -0
- package/dist/plugins/core/LexicalRootVisitor.js +10 -0
- package/dist/plugins/core/LexicalTextVisitor.d.ts +5 -0
- package/dist/plugins/core/LexicalTextVisitor.js +102 -0
- package/dist/plugins/core/MdastBreakVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastBreakVisitor.js +10 -0
- package/dist/plugins/core/MdastFormattingVisitor.d.ts +4 -0
- package/dist/plugins/core/MdastFormattingVisitor.js +36 -0
- package/dist/plugins/core/MdastHTMLNode.d.ts +13 -0
- package/dist/plugins/core/MdastHTMLNode.js +122 -0
- package/dist/plugins/core/MdastHTMLVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastHTMLVisitor.js +12 -0
- package/dist/plugins/core/MdastInlineCodeVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastInlineCodeVisitor.js +27 -0
- package/dist/plugins/core/MdastParagraphVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastParagraphVisitor.js +15 -0
- package/dist/plugins/core/MdastRootVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastRootVisitor.js +9 -0
- package/dist/plugins/core/MdastTextVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastTextVisitor.js +10 -0
- package/dist/plugins/core/NestedLexicalEditor.d.ts +92 -0
- package/dist/plugins/core/NestedLexicalEditor.js +185 -0
- package/dist/plugins/core/PropertyPopover.d.ts +23 -0
- package/dist/plugins/core/PropertyPopover.js +39 -0
- package/dist/plugins/core/SharedHistoryPlugin.d.ts +2 -0
- package/dist/plugins/core/SharedHistoryPlugin.js +10 -0
- package/dist/plugins/core/index.d.ts +583 -0
- package/dist/plugins/core/index.js +490 -0
- package/dist/plugins/core/ui/DownshiftAutoComplete.d.ts +15 -0
- package/dist/plugins/core/ui/DownshiftAutoComplete.js +83 -0
- package/dist/plugins/core/ui/PopoverUtils.d.ts +4 -0
- package/dist/plugins/core/ui/PopoverUtils.js +17 -0
- package/dist/plugins/diff-source/DiffSourceWrapper.d.ts +4 -0
- package/dist/plugins/diff-source/DiffSourceWrapper.js +14 -0
- package/dist/plugins/diff-source/DiffViewer.d.ts +2 -0
- package/dist/plugins/diff-source/DiffViewer.js +59 -0
- package/dist/plugins/diff-source/SourceEditor.d.ts +4 -0
- package/dist/plugins/diff-source/SourceEditor.js +53 -0
- package/dist/plugins/diff-source/index.d.ts +725 -0
- package/dist/plugins/diff-source/index.js +56 -0
- package/dist/plugins/directives/DirectiveNode.d.ts +51 -0
- package/dist/plugins/directives/DirectiveNode.js +92 -0
- package/dist/plugins/directives/DirectiveVisitor.d.ts +4 -0
- package/dist/plugins/directives/DirectiveVisitor.js +10 -0
- package/dist/plugins/directives/MdastDirectiveVisitor.d.ts +3 -0
- package/dist/plugins/directives/MdastDirectiveVisitor.js +13 -0
- package/dist/plugins/directives/index.d.ts +773 -0
- package/dist/plugins/directives/index.js +53 -0
- package/dist/plugins/frontmatter/FrontmatterEditor.d.ts +6 -0
- package/dist/plugins/frontmatter/FrontmatterEditor.js +85 -0
- package/dist/plugins/frontmatter/FrontmatterNode.d.ts +35 -0
- package/dist/plugins/frontmatter/FrontmatterNode.js +71 -0
- package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.d.ts +4 -0
- package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.js +10 -0
- package/dist/plugins/frontmatter/MdastFrontmatterVisitor.d.ts +3 -0
- package/dist/plugins/frontmatter/MdastFrontmatterVisitor.js +10 -0
- package/dist/plugins/frontmatter/index.d.ts +717 -0
- package/dist/plugins/frontmatter/index.js +76 -0
- package/dist/plugins/headings/LexicalHeadingVisitor.d.ts +4 -0
- package/dist/plugins/headings/LexicalHeadingVisitor.js +11 -0
- package/dist/plugins/headings/MdastHeadingVisitor.d.ts +3 -0
- package/dist/plugins/headings/MdastHeadingVisitor.js +10 -0
- package/dist/plugins/headings/index.d.ts +707 -0
- package/dist/plugins/headings/index.js +69 -0
- package/dist/plugins/image/ImageDialog.d.ts +2 -0
- package/dist/plugins/image/ImageDialog.js +70 -0
- package/dist/plugins/image/ImageEditor.d.ts +10 -0
- package/dist/plugins/image/ImageEditor.js +227 -0
- package/dist/plugins/image/ImageNode.d.ts +65 -0
- package/dist/plugins/image/ImageNode.js +152 -0
- package/dist/plugins/image/ImageResizer.d.ts +18 -0
- package/dist/plugins/image/ImageResizer.js +214 -0
- package/dist/plugins/image/LexicalImageVisitor.d.ts +4 -0
- package/dist/plugins/image/LexicalImageVisitor.js +35 -0
- package/dist/plugins/image/MdastImageVisitor.d.ts +6 -0
- package/dist/plugins/image/MdastImageVisitor.js +87 -0
- package/dist/plugins/image/index.d.ts +804 -0
- package/dist/plugins/image/index.js +300 -0
- package/dist/plugins/jsx/LexicalJsxNode.d.ts +54 -0
- package/dist/plugins/jsx/LexicalJsxNode.js +102 -0
- package/dist/plugins/jsx/LexicalJsxVisitor.d.ts +4 -0
- package/dist/plugins/jsx/LexicalJsxVisitor.js +24 -0
- package/dist/plugins/jsx/MdastMdxJsEsmVisitor.d.ts +3 -0
- package/dist/plugins/jsx/MdastMdxJsEsmVisitor.js +8 -0
- package/dist/plugins/jsx/MdastMdxJsxElementVisitor.d.ts +3 -0
- package/dist/plugins/jsx/MdastMdxJsxElementVisitor.js +12 -0
- package/dist/plugins/jsx/index.d.ts +779 -0
- package/dist/plugins/jsx/index.js +82 -0
- package/dist/plugins/link/AutoLinkPlugin.d.ts +9 -0
- package/dist/plugins/link/AutoLinkPlugin.js +18 -0
- package/dist/plugins/link/LexicalLinkVisitor.d.ts +4 -0
- package/dist/plugins/link/LexicalLinkVisitor.js +10 -0
- package/dist/plugins/link/MdastLinkVisitor.d.ts +3 -0
- package/dist/plugins/link/MdastLinkVisitor.js +14 -0
- package/dist/plugins/link/index.d.ts +101 -0
- package/dist/plugins/link/index.js +33 -0
- package/dist/plugins/link-dialog/LinkDialog.d.ts +16 -0
- package/dist/plugins/link-dialog/LinkDialog.js +148 -0
- package/dist/plugins/link-dialog/index.d.ts +669 -0
- package/dist/plugins/link-dialog/index.js +254 -0
- package/dist/plugins/lists/LexicalListItemVisitor.d.ts +4 -0
- package/dist/plugins/lists/LexicalListItemVisitor.js +23 -0
- package/dist/plugins/lists/LexicalListVisitor.d.ts +4 -0
- package/dist/plugins/lists/LexicalListVisitor.js +13 -0
- package/dist/plugins/lists/MdastListItemVisitor.d.ts +3 -0
- package/dist/plugins/lists/MdastListItemVisitor.js +10 -0
- package/dist/plugins/lists/MdastListVisitor.d.ts +3 -0
- package/dist/plugins/lists/MdastListVisitor.js +20 -0
- package/dist/plugins/lists/index.d.ts +703 -0
- package/dist/plugins/lists/index.js +122 -0
- package/dist/plugins/markdown-shortcut/index.d.ts +80 -0
- package/dist/plugins/markdown-shortcut/index.js +90 -0
- package/dist/plugins/quote/LexicalQuoteVisitor.d.ts +4 -0
- package/dist/plugins/quote/LexicalQuoteVisitor.js +12 -0
- package/dist/plugins/quote/MdastBlockQuoteVisitor.d.ts +3 -0
- package/dist/plugins/quote/MdastBlockQuoteVisitor.js +10 -0
- package/dist/plugins/quote/index.d.ts +480 -0
- package/dist/plugins/quote/index.js +26 -0
- package/dist/plugins/sandpack/SandpackEditor.d.ts +7 -0
- package/dist/plugins/sandpack/SandpackEditor.js +37 -0
- package/dist/plugins/sandpack/index.d.ts +1077 -0
- package/dist/plugins/sandpack/index.js +93 -0
- package/dist/plugins/sandpack/useCodeMirrorRef.d.ts +4 -0
- package/dist/plugins/sandpack/useCodeMirrorRef.js +96 -0
- package/dist/plugins/table/LexicalTableVisitor.d.ts +4 -0
- package/dist/plugins/table/LexicalTableVisitor.js +10 -0
- package/dist/plugins/table/MdastTableVisitor.d.ts +3 -0
- package/dist/plugins/table/MdastTableVisitor.js +10 -0
- package/dist/plugins/table/TableEditor.d.ts +21 -0
- package/dist/plugins/table/TableEditor.js +388 -0
- package/dist/plugins/table/TableNode.d.ts +52 -0
- package/dist/plugins/table/TableNode.js +152 -0
- package/dist/plugins/table/index.d.ts +704 -0
- package/dist/plugins/table/index.js +69 -0
- package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.d.ts +4 -0
- package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.js +10 -0
- package/dist/plugins/thematic-break/MdastThematicBreakVisitor.d.ts +3 -0
- package/dist/plugins/thematic-break/MdastThematicBreakVisitor.js +10 -0
- package/dist/plugins/thematic-break/index.d.ts +693 -0
- package/dist/plugins/thematic-break/index.js +39 -0
- package/dist/plugins/toolbar/components/BlockTypeSelect.d.ts +6 -0
- package/dist/plugins/toolbar/components/BlockTypeSelect.js +54 -0
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts +5 -0
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +33 -0
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.d.ts +6 -0
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +30 -0
- package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.d.ts +7 -0
- package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js +32 -0
- package/dist/plugins/toolbar/components/CodeToggle.d.ts +6 -0
- package/dist/plugins/toolbar/components/CodeToggle.js +19 -0
- package/dist/plugins/toolbar/components/CreateLink.d.ts +6 -0
- package/dist/plugins/toolbar/components/CreateLink.js +20 -0
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts +18 -0
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +25 -0
- package/dist/plugins/toolbar/components/InsertAdmonition.d.ts +6 -0
- package/dist/plugins/toolbar/components/InsertAdmonition.js +29 -0
- package/dist/plugins/toolbar/components/InsertCodeBlock.d.ts +7 -0
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +20 -0
- package/dist/plugins/toolbar/components/InsertFrontmatter.d.ts +6 -0
- package/dist/plugins/toolbar/components/InsertFrontmatter.js +24 -0
- package/dist/plugins/toolbar/components/InsertImage.d.ts +6 -0
- package/dist/plugins/toolbar/components/InsertImage.js +14 -0
- package/dist/plugins/toolbar/components/InsertSandpack.d.ts +6 -0
- package/dist/plugins/toolbar/components/InsertSandpack.js +13 -0
- package/dist/plugins/toolbar/components/InsertTable.d.ts +6 -0
- package/dist/plugins/toolbar/components/InsertTable.js +20 -0
- package/dist/plugins/toolbar/components/InsertThematicBreak.d.ts +6 -0
- package/dist/plugins/toolbar/components/InsertThematicBreak.js +11 -0
- package/dist/plugins/toolbar/components/KitchenSinkToolbar.d.ts +7 -0
- package/dist/plugins/toolbar/components/KitchenSinkToolbar.js +58 -0
- package/dist/plugins/toolbar/components/ListsToggle.d.ts +7 -0
- package/dist/plugins/toolbar/components/ListsToggle.js +23 -0
- package/dist/plugins/toolbar/components/ShowSandpackInfo.d.ts +7 -0
- package/dist/plugins/toolbar/components/ShowSandpackInfo.js +31 -0
- package/dist/plugins/toolbar/components/UndoRedo.d.ts +5 -0
- package/dist/plugins/toolbar/components/UndoRedo.js +58 -0
- package/dist/plugins/toolbar/index.d.ts +564 -0
- package/dist/plugins/toolbar/index.js +40 -0
- package/dist/plugins/toolbar/primitives/DialogButton.d.ts +40 -0
- package/dist/plugins/toolbar/primitives/DialogButton.js +114 -0
- package/dist/plugins/toolbar/primitives/TooltipWrap.d.ts +8 -0
- package/dist/plugins/toolbar/primitives/TooltipWrap.js +12 -0
- package/dist/plugins/toolbar/primitives/select.d.ts +50 -0
- package/dist/plugins/toolbar/primitives/select.js +55 -0
- package/dist/plugins/toolbar/primitives/toolbar.d.ts +163 -0
- package/dist/plugins/toolbar/primitives/toolbar.js +115 -0
- package/dist/style.css +1093 -288
- package/dist/styles/globals.css.js +4 -0
- package/dist/styles/lexical-theme.module.css.js +62 -0
- package/dist/styles/lexicalTheme.d.ts +2 -0
- package/dist/styles/lexicalTheme.js +31 -0
- package/dist/styles/ui.module.css.js +311 -0
- package/dist/utils/detectMac.d.ts +3 -0
- package/dist/utils/detectMac.js +13 -0
- package/dist/utils/fp.d.ts +47 -0
- package/dist/utils/fp.js +44 -0
- package/dist/utils/isPartOftheEditorUI.d.ts +1 -0
- package/dist/utils/isPartOftheEditorUI.js +12 -0
- package/dist/utils/lexicalHelpers.d.ts +11 -0
- package/dist/utils/lexicalHelpers.js +80 -0
- package/dist/utils/makeHslTransparent.d.ts +1 -0
- package/dist/utils/makeHslTransparent.js +6 -0
- package/dist/utils/mergeStyleAttributes.d.ts +1 -0
- package/dist/utils/mergeStyleAttributes.js +22 -0
- package/dist/utils/uuid4.d.ts +1 -0
- package/dist/utils/uuid4.js +10 -0
- package/dist/utils/voidEmitter.d.ts +14 -0
- package/dist/utils/voidEmitter.js +15 -0
- package/dist/utils/whitespaceConversion.d.ts +2 -0
- package/dist/utils/whitespaceConversion.js +9 -0
- package/package.json +326 -39
- package/dist/index.cjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,726 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
export
|
|
51
|
-
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
export
|
|
61
|
-
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
export declare function $isJsxNode(node: LexicalNode | null | undefined): node is JsxNode;
|
|
65
|
-
|
|
66
|
-
export declare function $isSandpackNode(node: LexicalNode | null | undefined): node is SandpackNode;
|
|
67
|
-
|
|
68
|
-
export declare function $isTableNode(node: LexicalNode | null | undefined): node is TableNode;
|
|
69
|
-
|
|
70
|
-
export declare type ActiveEditorType = LexicalEditorType | CodeBlockEditorType | SandpackEditorType;
|
|
71
|
-
|
|
72
|
-
export { AdmonitionKind }
|
|
73
|
-
|
|
74
|
-
/** @noInheritDoc */
|
|
75
|
-
export declare class AdmonitionNode extends ElementNode {
|
|
76
|
-
__kind: AdmonitionKind;
|
|
77
|
-
static getType(): string;
|
|
78
|
-
getKind(): AdmonitionKind;
|
|
79
|
-
setKind(kind: AdmonitionKind): void;
|
|
80
|
-
static clone(node: AdmonitionNode): AdmonitionNode;
|
|
81
|
-
constructor(kind?: AdmonitionKind, key?: NodeKey);
|
|
82
|
-
createDOM(config: EditorConfig): HTMLElement;
|
|
83
|
-
updateDOM(_prevNode: AdmonitionNode, _dom: HTMLElement): boolean;
|
|
84
|
-
static importJSON(serializedNode: SerializedAdmonitionNode): AdmonitionNode;
|
|
85
|
-
exportJSON(): SerializedElementNode;
|
|
86
|
-
insertNewAfter(_: RangeSelection, restoreSelection?: boolean): AdmonitionNode;
|
|
87
|
-
collapseAtStart(): true;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export declare interface CodeBlockEditorProps extends SandpackEditorProps {
|
|
91
|
-
language: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export declare type CodeBlockEditorType = {
|
|
95
|
-
type: 'codeblock';
|
|
96
|
-
nodeKey: string;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @noInheritDoc
|
|
101
|
-
*/
|
|
102
|
-
export declare class CodeBlockNode extends DecoratorNode<JSX.Element> {
|
|
103
|
-
__code: string;
|
|
104
|
-
__meta: string;
|
|
105
|
-
__language: string;
|
|
106
|
-
__focusEmitter: {
|
|
107
|
-
publish: () => void;
|
|
108
|
-
subscribe: (cb: () => void) => void;
|
|
109
|
-
};
|
|
110
|
-
static getType(): string;
|
|
111
|
-
static clone(node: CodeBlockNode): CodeBlockNode;
|
|
112
|
-
static importJSON(serializedNode: SerializedCodeBlockNode): CodeBlockNode;
|
|
113
|
-
constructor(code: string, language: string, meta: string, key?: NodeKey);
|
|
114
|
-
exportJSON(): SerializedCodeBlockNode;
|
|
115
|
-
createDOM(_config: EditorConfig): HTMLDivElement;
|
|
116
|
-
updateDOM(): false;
|
|
117
|
-
getCode(): string;
|
|
118
|
-
getMeta(): string;
|
|
119
|
-
getLanguage(): string;
|
|
120
|
-
setCode(code: string): void;
|
|
121
|
-
setMeta(meta: string): void;
|
|
122
|
-
setLanguage(language: string): void;
|
|
123
|
-
select(): void;
|
|
124
|
-
decorate(_editor: LexicalEditor, { theme: { nodeDecoratorComponents: { CodeBlockEditor }, }, }: ExtendedEditorConfig): JSX.Element;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export declare interface CodeBlockPayload {
|
|
128
|
-
code: string;
|
|
129
|
-
meta: string;
|
|
130
|
-
language: string;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export declare type CoordinatesSubscription = (coords: [colIndex: number, rowIndex: number]) => void;
|
|
134
|
-
|
|
135
|
-
export declare const defaultExtensions: {
|
|
136
|
-
mdxToMarkdown: ToMarkdownOptions;
|
|
137
|
-
frontmatterToMarkdown: ToMarkdownOptions;
|
|
138
|
-
directiveToMarkdown: ToMarkdownOptions;
|
|
139
|
-
gfmTableToMarkdown: ToMarkdownOptions;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export declare const defaultLexicalNodes: Record<string, Klass<LexicalNode>>;
|
|
143
|
-
|
|
144
|
-
export declare const defaultLexicalVisitors: {
|
|
145
|
-
LexicalRootVisitor: LexicalExportVisitor<RootNode, Mdast.Content>;
|
|
146
|
-
LexicalParagraphVisitor: LexicalExportVisitor<ParagraphNode, Mdast.Paragraph>;
|
|
147
|
-
LexicalFrontmatterVisitor: LexicalExportVisitor<FrontmatterNode, Mdast.YAML>;
|
|
148
|
-
LexicalTextVisitor: LexicalExportVisitor<TextNode, Mdast.Text>;
|
|
149
|
-
LexicalLinebreakVisitor: LexicalExportVisitor<LineBreakNode, Mdast.Text>;
|
|
150
|
-
LexicalLinkVisitor: LexicalExportVisitor<LinkNode, Mdast.Link>;
|
|
151
|
-
LexicalHeadingVisitor: LexicalExportVisitor<HeadingNode, Mdast.Heading>;
|
|
152
|
-
LexicalListVisitor: LexicalExportVisitor<ListNode, Mdast.List>;
|
|
153
|
-
LexicalListItemVisitor: LexicalExportVisitor<ListItemNode, Mdast.ListItem>;
|
|
154
|
-
LexicalQuoteVisitor: LexicalExportVisitor<QuoteNode, Mdast.Blockquote>;
|
|
155
|
-
SandpackNodeVisitor: LexicalExportVisitor<SandpackNode, Mdast.Code>;
|
|
156
|
-
CodeBlockVisitor: LexicalExportVisitor<CodeBlockNode, Mdast.Code>;
|
|
157
|
-
LexicalThematicBreakVisitor: LexicalExportVisitor<HorizontalRuleNode, Mdast.ThematicBreak>;
|
|
158
|
-
AdmonitionVisitor: LexicalExportVisitor<AdmonitionNode, ContainerDirective>;
|
|
159
|
-
LexicalImageVisitor: LexicalExportVisitor<ImageNode, Mdast.Image>;
|
|
160
|
-
JsxVisitor: LexicalExportVisitor<JsxNode, MdxJsxFlowElement | MdxJsxTextElement>;
|
|
161
|
-
LexicalTableVisitor: LexicalExportVisitor<TableNode, Mdast.Table>;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export declare const defaultMdastExtensions: Record<string, MarkdownParseOptions['mdastExtensions'][number]>;
|
|
165
|
-
|
|
166
|
-
export declare const defaultMdastVisitors: Record<string, MdastImportVisitor<Mdast.Content>>;
|
|
167
|
-
|
|
168
|
-
export declare interface DefaultMdxOptionValues {
|
|
169
|
-
markdownParse: {
|
|
170
|
-
defaultVisitors: typeof defaultMdastVisitors;
|
|
171
|
-
defaultSyntaxExtensions: typeof defaultSyntaxExtensions;
|
|
172
|
-
defaultMdastExtensions: typeof defaultMdastExtensions;
|
|
173
|
-
};
|
|
174
|
-
lexicalConvert: {
|
|
175
|
-
defaultVisitors: typeof defaultLexicalVisitors;
|
|
176
|
-
defaultExtensions: typeof defaultExtensions;
|
|
177
|
-
defaultMarkdownOptions: typeof defaultToMarkdownOptions;
|
|
178
|
-
};
|
|
179
|
-
defaultLexicalNodes: typeof defaultLexicalNodes;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export declare const defaultMdxOptionValues: DefaultMdxOptionValues;
|
|
183
|
-
|
|
184
|
-
export declare const defaultSyntaxExtensions: Record<string, MarkdownParseOptions['syntaxExtensions'][number]>;
|
|
185
|
-
|
|
186
|
-
export declare const defaultToMarkdownOptions: ToMarkdownOptions;
|
|
187
|
-
|
|
188
|
-
export declare interface ExportLexicalTreeOptions {
|
|
189
|
-
root: RootNode;
|
|
190
|
-
visitors: LexicalVisitor[];
|
|
191
|
-
jsxComponentDescriptors: JsxComponentDescriptors;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export declare function exportLexicalTreeToMdast({ root, visitors, jsxComponentDescriptors }: ExportLexicalTreeOptions): Mdast.Root;
|
|
195
|
-
|
|
196
|
-
export declare function exportMarkdownFromLexical({ root, toMarkdownOptions, toMarkdownExtensions, visitors, jsxComponentDescriptors, }: ExportMarkdownFromLexicalOptions): string;
|
|
197
|
-
|
|
198
|
-
export declare interface ExportMarkdownFromLexicalOptions extends ExportLexicalTreeOptions {
|
|
199
|
-
toMarkdownExtensions: ToMarkdownOptions['extensions'];
|
|
200
|
-
toMarkdownOptions: ToMarkdownOptions;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
declare type ExtendedEditorConfig = EditorConfig & {
|
|
204
|
-
theme: EditorConfig['theme'] & {
|
|
205
|
-
nodeDecoratorComponents: NodeDecoratorComponents;
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
declare type FromMarkdownArgs = NonNullable<Parameters<typeof fromMarkdown>[1]>;
|
|
210
|
-
|
|
211
|
-
export declare interface FrontmatterEditorProps {
|
|
212
|
-
yaml: string;
|
|
213
|
-
onChange: (yaml: string) => void;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* @noInheritDoc
|
|
218
|
-
*/
|
|
219
|
-
export declare class FrontmatterNode extends DecoratorNode<JSX.Element> {
|
|
220
|
-
__yaml: string;
|
|
221
|
-
static getType(): string;
|
|
222
|
-
static clone(node: FrontmatterNode): FrontmatterNode;
|
|
223
|
-
static importJSON(serializedNode: SerializedFrontmatterNode): FrontmatterNode;
|
|
224
|
-
constructor(code: string, key?: NodeKey);
|
|
225
|
-
exportJSON(): SerializedFrontmatterNode;
|
|
226
|
-
createDOM(_config: EditorConfig): HTMLDivElement;
|
|
227
|
-
updateDOM(): false;
|
|
228
|
-
getYaml(): string;
|
|
229
|
-
setYaml(yaml: string): void;
|
|
230
|
-
decorate(editor: LexicalEditor, { theme: { nodeDecoratorComponents: { FrontmatterEditor }, }, }: ExtendedEditorConfig): JSX.Element;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export declare interface FrontmatterPayload {
|
|
234
|
-
yaml: string;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* @noInheritDoc
|
|
239
|
-
*/
|
|
240
|
-
export declare class ImageNode extends DecoratorNode<JSX.Element> {
|
|
241
|
-
__src: string;
|
|
242
|
-
__altText: string;
|
|
243
|
-
__title: string | undefined;
|
|
244
|
-
static getType(): string;
|
|
245
|
-
static clone(node: ImageNode): ImageNode;
|
|
246
|
-
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
247
|
-
exportDOM(): DOMExportOutput;
|
|
248
|
-
static importDOM(): DOMConversionMap | null;
|
|
249
|
-
constructor(src: string, altText: string, title: string | undefined, key?: NodeKey);
|
|
250
|
-
exportJSON(): SerializedImageNode;
|
|
251
|
-
createDOM(config: EditorConfig): HTMLElement;
|
|
252
|
-
updateDOM(): false;
|
|
253
|
-
getSrc(): string;
|
|
254
|
-
getAltText(): string;
|
|
255
|
-
getTitle(): string | undefined;
|
|
256
|
-
setTitle(title: string | undefined): void;
|
|
257
|
-
decorate(): JSX.Element;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
export declare interface ImagePayload {
|
|
261
|
-
altText: string;
|
|
262
|
-
title?: string;
|
|
263
|
-
key?: NodeKey;
|
|
264
|
-
src: string;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export declare function importMarkdownToLexical({ root, markdown, visitors, syntaxExtensions, mdastExtensions }: MarkdownParseOptions): void;
|
|
268
|
-
|
|
269
|
-
export declare function importMdastTreeToLexical({ root, mdastRoot, visitors }: MdastTreeImportOptions): void;
|
|
270
|
-
|
|
271
|
-
export declare type ImportVisitors = Array<MdastImportVisitor<Mdast.Content>>;
|
|
272
|
-
|
|
273
|
-
declare const IS_BOLD: 1;
|
|
274
|
-
|
|
275
|
-
declare const IS_ITALIC: 2;
|
|
276
|
-
|
|
277
|
-
declare const IS_UNDERLINE: 8;
|
|
278
|
-
|
|
279
|
-
export declare interface JsxComponentDescriptor {
|
|
280
|
-
name: string;
|
|
281
|
-
kind: 'flow' | 'text';
|
|
282
|
-
source: string;
|
|
283
|
-
defaultExport?: boolean;
|
|
284
|
-
props: Array<JsxPropertyDescriptor>;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export declare type JsxComponentDescriptors = Array<JsxComponentDescriptor>;
|
|
288
|
-
|
|
289
|
-
export declare interface JsxEditorProps {
|
|
290
|
-
kind: JsxKind;
|
|
291
|
-
attributes: MdxJsxAttribute[];
|
|
292
|
-
componentName: string;
|
|
293
|
-
onSubmit: (values: Record<string, string>) => void;
|
|
294
|
-
theme: EditorThemeClasses;
|
|
295
|
-
editor: LexicalEditor;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export declare type JsxKind = 'text' | 'flow';
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* @noInheritDoc
|
|
302
|
-
*/
|
|
303
|
-
export declare class JsxNode extends DecoratorNode<JSX.Element> {
|
|
304
|
-
__kind: JsxKind;
|
|
305
|
-
__name: string;
|
|
306
|
-
__attributes: Array<MdxJsxAttribute>;
|
|
307
|
-
__editor: LexicalEditor;
|
|
308
|
-
static getType(): string;
|
|
309
|
-
static clone(node: JsxNode): JsxNode;
|
|
310
|
-
static importJSON(serializedNode: SerializedJsxNode): JsxNode;
|
|
311
|
-
constructor({ name, kind, attributes, state, updateFn, key }: JsxNodeConstructorParams);
|
|
312
|
-
exportJSON(): SerializedJsxNode;
|
|
313
|
-
inNestedEditor(callback: () => void): void;
|
|
314
|
-
getChildren(): Array<LexicalNode>;
|
|
315
|
-
createDOM(): HTMLElement;
|
|
316
|
-
updateDOM(): false;
|
|
317
|
-
getName(): string;
|
|
318
|
-
getKind(): JsxKind;
|
|
319
|
-
getAttributes(): MdxJsxAttribute[];
|
|
320
|
-
updateAttributes(attributeValues: Record<string, string>): void;
|
|
321
|
-
decorate(_parentEditor: LexicalEditor, { theme: { nodeDecoratorComponents: { JsxEditor }, }, }: ExtendedEditorConfig): JSX.Element;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export declare interface JsxNodeConstructorParams extends JsxPayload {
|
|
325
|
-
key?: NodeKey;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export declare interface JsxPayload {
|
|
329
|
-
name: string;
|
|
330
|
-
kind: JsxKind;
|
|
331
|
-
attributes: Array<MdxJsxAttribute>;
|
|
332
|
-
state?: SerializedEditorState;
|
|
333
|
-
updateFn?: updateFn;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export declare interface JsxPropertyDescriptor {
|
|
337
|
-
name: string;
|
|
338
|
-
type: 'string' | 'number';
|
|
339
|
-
required?: boolean;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
export declare type LexicalEditorType = {
|
|
343
|
-
type: 'lexical';
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
export declare interface LexicalExportVisitor<LN extends LexicalNode, UN extends Mdast.Content> {
|
|
347
|
-
testLexicalNode?(lexicalNode: LexicalNode): lexicalNode is LN;
|
|
348
|
-
visitLexicalNode?(params: LexicalNodeVisitParams<LN>): void;
|
|
349
|
-
shouldJoin?(prevNode: Mdast.Content, currentNode: UN): boolean;
|
|
350
|
-
join?<T extends Mdast.Content>(prevNode: T, currentNode: T): T;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
export declare interface LexicalNodeVisitParams<T extends LexicalNode> {
|
|
354
|
-
lexicalNode: T;
|
|
355
|
-
mdastParent: Mdast.Parent;
|
|
356
|
-
actions: LexicalVisitActions<T>;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export declare interface LexicalVisitActions<T extends LexicalNode> {
|
|
360
|
-
visitChildren(node: T, mdastParent: Mdast.Parent): void;
|
|
361
|
-
addAndStepInto(type: string, props?: Record<string, unknown>, hasChildren?: boolean): void;
|
|
362
|
-
appendToParent<T extends Mdast.Parent>(parentNode: T, node: T['children'][number]): T['children'][number] | Mdast.Root;
|
|
363
|
-
registerReferredComponent(componentName: string): void;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
export declare type LexicalVisitor = LexicalExportVisitor<LexicalNode, Mdast.Content>;
|
|
367
|
-
|
|
368
|
-
export declare interface MarkdownParseOptions extends Omit<MdastTreeImportOptions, 'mdastRoot'> {
|
|
369
|
-
markdown: string;
|
|
370
|
-
syntaxExtensions: NonNullable<FromMarkdownArgs['extensions']>;
|
|
371
|
-
mdastExtensions: NonNullable<FromMarkdownArgs['mdastExtensions']>;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
export declare const MdastAdmonitionVisitor: MdastImportVisitor<ContainerDirective>;
|
|
375
|
-
|
|
376
|
-
export declare const MdastBlockQuoteVisitor: MdastImportVisitor<Mdast.Blockquote>;
|
|
377
|
-
|
|
378
|
-
export declare const MdastCodeVisitor: MdastImportVisitor<Mdast.Code>;
|
|
379
|
-
|
|
380
|
-
export declare const MdastFormattingVisitor: MdastImportVisitor<Mdast.Emphasis | Mdast.Strong | MdxJsxTextElement_2>;
|
|
381
|
-
|
|
382
|
-
export declare const MdastFrontmatterVisitor: MdastImportVisitor<Mdast.YAML>;
|
|
383
|
-
|
|
384
|
-
export declare const MdastHeadingVisitor: MdastImportVisitor<Mdast.Heading>;
|
|
385
|
-
|
|
386
|
-
export declare const MdastImageVisitor: MdastImportVisitor<Mdast.Image>;
|
|
387
|
-
|
|
388
|
-
export declare interface MdastImportVisitor<UN extends Mdast.Content> {
|
|
389
|
-
testNode: ((mdastNode: Mdast.Content | Mdast.Root) => boolean) | string;
|
|
390
|
-
visitNode(params: MdastVisitParams<UN>): void;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
export declare const MdastInlineCodeVisitor: MdastImportVisitor<Mdast.InlineCode>;
|
|
394
|
-
|
|
395
|
-
export declare const MdastLinkVisitor: MdastImportVisitor<Mdast.Link>;
|
|
396
|
-
|
|
397
|
-
export declare const MdastListItemVisitor: MdastImportVisitor<Mdast.ListItem>;
|
|
398
|
-
|
|
399
|
-
export declare const MdastListVisitor: MdastImportVisitor<Mdast.List>;
|
|
400
|
-
|
|
401
|
-
export declare const MdastMdxJsEsmVisitor: MdastImportVisitor<MdxjsEsm>;
|
|
402
|
-
|
|
403
|
-
export declare const MdastMdxJsxElementVisitor: MdastImportVisitor<MdxJsxTextElement_2>;
|
|
404
|
-
|
|
405
|
-
export declare const MdastParagraphVisitor: MdastImportVisitor<Mdast.Paragraph>;
|
|
406
|
-
|
|
407
|
-
export declare const MdastRootVisitor: MdastImportVisitor<Mdast.Content>;
|
|
408
|
-
|
|
409
|
-
export declare const MdastTableVisitor: MdastImportVisitor<Mdast.Table>;
|
|
410
|
-
|
|
411
|
-
export declare const MdastTextVisitor: MdastImportVisitor<Mdast.Text>;
|
|
412
|
-
|
|
413
|
-
export declare const MdastThematicBreakVisitor: MdastImportVisitor<Mdast.ThematicBreak>;
|
|
414
|
-
|
|
415
|
-
export declare interface MdastTreeImportOptions {
|
|
416
|
-
root: RootNode;
|
|
417
|
-
visitors: Array<MdastImportVisitor<Mdast.Content>>;
|
|
418
|
-
mdastRoot: Mdast.Root;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
export declare interface MdastVisitActions {
|
|
422
|
-
visitChildren(node: Mdast.Parent, lexicalParent: LexicalNode): void;
|
|
423
|
-
addAndStepInto(lexicalNode: LexicalNode): void;
|
|
424
|
-
addFormatting(format: typeof IS_BOLD | typeof IS_ITALIC | typeof IS_UNDERLINE): void;
|
|
425
|
-
getParentFormatting(): number;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
export declare interface MdastVisitParams<T extends Mdast.Content> {
|
|
429
|
-
mdastNode: T;
|
|
430
|
-
lexicalParent: LexicalNode;
|
|
431
|
-
actions: MdastVisitActions;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
export declare const MDXEditor: React_2.FC<MDXEditorProps>;
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* MDXEditor is a rich text editor React Component for editing markdown.
|
|
438
|
-
*/
|
|
439
|
-
export declare interface MDXEditorProps {
|
|
440
|
-
/**
|
|
441
|
-
* The markdown content to be edited.
|
|
442
|
-
*/
|
|
443
|
-
markdown: string;
|
|
444
|
-
/**
|
|
445
|
-
* The configuration for the sandpack editor that's used for the fenced code blocks.
|
|
446
|
-
* @see the {@link SandpackConfig} interface for more details.
|
|
447
|
-
*/
|
|
448
|
-
sandpackConfig?: SandpackConfig;
|
|
449
|
-
/**
|
|
450
|
-
* The markdown content to use for the diff view mode. If not provided, the contents of the `markdown` prop will be used.
|
|
451
|
-
*/
|
|
452
|
-
headMarkdown?: string;
|
|
453
|
-
/**
|
|
454
|
-
* The configuration for the JSX components used in the markdown content.
|
|
455
|
-
* @see the {@link JsxComponentDescriptors} interface for more details.
|
|
456
|
-
*/
|
|
457
|
-
jsxComponentDescriptors?: JsxComponentDescriptors;
|
|
458
|
-
/**
|
|
459
|
-
* The list of suggestions to be shown in the link autocomplete dialog dropdown.
|
|
460
|
-
*/
|
|
461
|
-
linkAutocompleteSuggestions?: string[];
|
|
462
|
-
/**
|
|
463
|
-
* The list of suggestions to be shown in the image autocomplete dialog dropdown.
|
|
464
|
-
*/
|
|
465
|
-
imageAutoCompleteSuggestions?: string[];
|
|
466
|
-
/**
|
|
467
|
-
* The set of components to be rendered in the toolbar.
|
|
468
|
-
*/
|
|
469
|
-
toolbarComponents?: React_2.ComponentType[];
|
|
470
|
-
/**
|
|
471
|
-
* The initial view mode for the editor. Defaults to `ViewMode.editor`.
|
|
472
|
-
*/
|
|
473
|
-
viewMode?: ViewMode;
|
|
474
|
-
onChange?: (markdown: string) => void;
|
|
475
|
-
className?: string;
|
|
476
|
-
contentEditableClassName?: string;
|
|
477
|
-
markdownParseOptions?: {
|
|
478
|
-
syntaxExtensions?: MarkdownParseOptions['syntaxExtensions'];
|
|
479
|
-
mdastExtensions?: MarkdownParseOptions['mdastExtensions'];
|
|
480
|
-
visitors?: MarkdownParseOptions['visitors'];
|
|
481
|
-
};
|
|
482
|
-
lexicalNodes?: Klass<LexicalNode>[];
|
|
483
|
-
lexicalConvertOptions?: {
|
|
484
|
-
extensions?: ExportMarkdownFromLexicalOptions['toMarkdownExtensions'];
|
|
485
|
-
markdownOptions?: ExportMarkdownFromLexicalOptions['toMarkdownOptions'];
|
|
486
|
-
visitors?: ExportMarkdownFromLexicalOptions['visitors'];
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
declare interface NodeDecoratorComponents {
|
|
491
|
-
FrontmatterEditor: React.FC<FrontmatterEditorProps>;
|
|
492
|
-
JsxEditor: React.FC<JsxEditorProps>;
|
|
493
|
-
SandpackEditor: React.FC<SandpackEditorProps>;
|
|
494
|
-
CodeBlockEditor: React.FC<CodeBlockEditorProps>;
|
|
495
|
-
TableEditor: React.FC<TableEditorProps>;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* The configuration for the available sandpack presets
|
|
500
|
-
*/
|
|
501
|
-
export declare interface SandpackConfig {
|
|
502
|
-
/**
|
|
503
|
-
* The name of the default preset that will be used if no meta (other than live) is set
|
|
504
|
-
*/
|
|
505
|
-
defaultPreset: string;
|
|
506
|
-
/**
|
|
507
|
-
* The list of sandpack presets that can be used
|
|
508
|
-
*/
|
|
509
|
-
presets: Array<SandpackPreset>;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
export declare interface SandpackEditorProps {
|
|
513
|
-
code: string;
|
|
514
|
-
nodeKey: string;
|
|
515
|
-
meta: string;
|
|
516
|
-
onChange: (code: string) => void;
|
|
517
|
-
focusEmitter: VoidEmitter;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
export declare type SandpackEditorType = {
|
|
521
|
-
type: 'sandpack';
|
|
522
|
-
nodeKey: string;
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* @noInheritDoc
|
|
527
|
-
*/
|
|
528
|
-
export declare class SandpackNode extends DecoratorNode<JSX.Element> {
|
|
529
|
-
__code: string;
|
|
530
|
-
__meta: string;
|
|
531
|
-
__language: string;
|
|
532
|
-
__focusEmitter: {
|
|
533
|
-
publish: () => void;
|
|
534
|
-
subscribe: (cb: () => void) => void;
|
|
535
|
-
};
|
|
536
|
-
static getType(): string;
|
|
537
|
-
static clone(node: SandpackNode): SandpackNode;
|
|
538
|
-
static importJSON(serializedNode: SerializedSandpackNode): SandpackNode;
|
|
539
|
-
constructor(code: string, language: string, meta: string, key?: NodeKey);
|
|
540
|
-
exportJSON(): SerializedSandpackNode;
|
|
541
|
-
createDOM(_config: EditorConfig): HTMLDivElement;
|
|
542
|
-
updateDOM(): false;
|
|
543
|
-
getCode(): string;
|
|
544
|
-
getMeta(): string;
|
|
545
|
-
getLanguage(): string;
|
|
546
|
-
setCode(code: string): void;
|
|
547
|
-
setMeta(meta: string): void;
|
|
548
|
-
setLanguage(language: string): void;
|
|
549
|
-
select(): void;
|
|
550
|
-
decorate(_parentEditor: LexicalEditor, { theme: { nodeDecoratorComponents: { SandpackEditor }, }, }: ExtendedEditorConfig): JSX.Element;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
export declare interface SandpackPayload {
|
|
554
|
-
code: string;
|
|
555
|
-
meta: string;
|
|
556
|
-
language: string;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Defines a single preset that can be used to create a sandbox.
|
|
561
|
-
*/
|
|
562
|
-
export declare interface SandpackPreset {
|
|
563
|
-
/**
|
|
564
|
-
* The name of the preset - use this to reference the preset from the defaultPreset field
|
|
565
|
-
*/
|
|
566
|
-
name: string;
|
|
567
|
-
/**
|
|
568
|
-
* The label of th preset, displayed in the sandpack button dropdown
|
|
569
|
-
*/
|
|
570
|
-
label: string;
|
|
571
|
-
/**
|
|
572
|
-
* The meta string that will be used to identify the preset from the fenced code block. e.g. "live react"
|
|
573
|
-
*/
|
|
574
|
-
meta: string;
|
|
575
|
-
/**
|
|
576
|
-
* The sandpack template that will be used to create the sandbox. e.g. "react", "react-ts", "vanilla".
|
|
577
|
-
*/
|
|
578
|
-
sandpackTemplate: SandpackProviderProps['template'];
|
|
579
|
-
/**
|
|
580
|
-
* The sandpack theme that will be used to create the sandbox. e.g. "light", "dark".
|
|
581
|
-
*/
|
|
582
|
-
sandpackTheme: SandpackProviderProps['theme'];
|
|
583
|
-
/**
|
|
584
|
-
* The name of the file that will be created in the sandbox. e.g. "/App.js"
|
|
585
|
-
*/
|
|
586
|
-
snippetFileName: string;
|
|
587
|
-
/**
|
|
588
|
-
* The dependencies that will be added to the sandbox, just like in package.json
|
|
589
|
-
*/
|
|
590
|
-
dependencies?: Record<string, string>;
|
|
591
|
-
/**
|
|
592
|
-
* The files that will be added to the sandbox (read-only).
|
|
593
|
-
* The key is the name of the file, and the value is the contents of the file.
|
|
594
|
-
*/
|
|
595
|
-
files?: Record<string, string>;
|
|
596
|
-
/**
|
|
597
|
-
* The language used in the editable snippet. e.g. "jsx", "tsx", etc
|
|
598
|
-
*/
|
|
599
|
-
snippetLanguage?: string;
|
|
600
|
-
/**
|
|
601
|
-
* The initial content of the editable snippet.
|
|
602
|
-
*/
|
|
603
|
-
initialSnippetContent?: string;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
declare type SandpackProviderProps = React_2.ComponentProps<typeof SandpackProvider>;
|
|
607
|
-
|
|
608
|
-
export declare type SerializedAdmonitionNode = Spread<{
|
|
609
|
-
type: 'admonition';
|
|
610
|
-
kind: AdmonitionKind;
|
|
611
|
-
version: 1;
|
|
612
|
-
}, SerializedElementNode>;
|
|
613
|
-
|
|
614
|
-
export declare type SerializedCodeBlockNode = Spread<CodeBlockPayload & {
|
|
615
|
-
type: 'codeblock';
|
|
616
|
-
version: 1;
|
|
617
|
-
}, SerializedLexicalNode>;
|
|
618
|
-
|
|
619
|
-
export declare type SerializedFrontmatterNode = Spread<{
|
|
620
|
-
yaml: string;
|
|
621
|
-
version: 1;
|
|
622
|
-
}, SerializedLexicalNode>;
|
|
623
|
-
|
|
624
|
-
export declare type SerializedImageNode = Spread<{
|
|
625
|
-
altText: string;
|
|
626
|
-
title?: string;
|
|
627
|
-
src: string;
|
|
628
|
-
type: 'image';
|
|
629
|
-
version: 1;
|
|
630
|
-
}, SerializedLexicalNode>;
|
|
631
|
-
|
|
632
|
-
export declare type SerializedJsxNode = Spread<Omit<JsxPayload, 'updateFn'> & {
|
|
633
|
-
version: 1;
|
|
634
|
-
type: 'jsx';
|
|
635
|
-
}, SerializedLexicalNode>;
|
|
636
|
-
|
|
637
|
-
export declare type SerializedSandpackNode = Spread<SandpackPayload & {
|
|
638
|
-
type: 'sandpack';
|
|
639
|
-
version: 1;
|
|
640
|
-
}, SerializedLexicalNode>;
|
|
641
|
-
|
|
642
|
-
export declare type SerializedTableNode = Spread<{
|
|
643
|
-
mdastNode: Mdast.Table;
|
|
644
|
-
}, SerializedLexicalNode>;
|
|
645
|
-
|
|
646
|
-
export declare interface TableEditorProps {
|
|
647
|
-
parentEditor: LexicalEditor;
|
|
648
|
-
lexicalTable: TableNode;
|
|
649
|
-
mdastNode: Mdast.Table;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* @noInheritDoc
|
|
654
|
-
*/
|
|
655
|
-
export declare class TableNode extends DecoratorNode<JSX.Element> {
|
|
656
|
-
__mdastNode: Mdast.Table;
|
|
657
|
-
focusEmitter: {
|
|
658
|
-
publish: (coords: [colIndex: number, rowIndex: number]) => void;
|
|
659
|
-
subscribe: (cb: CoordinatesSubscription) => void;
|
|
660
|
-
};
|
|
661
|
-
static getType(): string;
|
|
662
|
-
static clone(node: TableNode): TableNode;
|
|
663
|
-
static importJSON(serializedNode: SerializedTableNode): TableNode;
|
|
664
|
-
exportJSON(): SerializedTableNode;
|
|
665
|
-
getMdastNode(): Mdast.Table;
|
|
666
|
-
getRowCount(): number;
|
|
667
|
-
getColCount(): number;
|
|
668
|
-
constructor(mdastNode?: Mdast.Table, key?: NodeKey);
|
|
669
|
-
createDOM(): HTMLElement;
|
|
670
|
-
updateDOM(): false;
|
|
671
|
-
updateCellContents(colIndex: number, rowIndex: number, children: Mdast.PhrasingContent[]): void;
|
|
672
|
-
insertColumnAt(colIndex: number): void;
|
|
673
|
-
deleteColumnAt(colIndex: number): void;
|
|
674
|
-
insertRowAt(y: number): void;
|
|
675
|
-
deleteRowAt(rowIndex: number): void;
|
|
676
|
-
addRowToBottom(): void;
|
|
677
|
-
addColumnToRight(): void;
|
|
678
|
-
setColumnAlign(colIndex: number, align: Mdast.AlignType): void;
|
|
679
|
-
decorate(parentEditor: LexicalEditor, { theme: { nodeDecoratorComponents: { TableEditor }, }, }: ExtendedEditorConfig): JSX.Element;
|
|
680
|
-
select(coords: [colIndex: number, rowIndex: number]): void;
|
|
681
|
-
isInline(): false;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
export { ToMarkdownOptions }
|
|
685
|
-
|
|
686
|
-
export declare const ToolbarComponents: {
|
|
687
|
-
BlockTypeSelect: () => React_2.JSX.Element;
|
|
688
|
-
BoldItalicUnderlineButtons: React_2.FC<{}>;
|
|
689
|
-
CodeBlockButton: React_2.FC<{}>;
|
|
690
|
-
FrontmatterButton: React_2.FC<{}>;
|
|
691
|
-
GroupGroup: React_2.FC<{
|
|
692
|
-
children: React_2.ReactNode;
|
|
693
|
-
}>;
|
|
694
|
-
HorizontalRuleIcon: React_2.FC<React_2.SVGProps<SVGSVGElement> & {
|
|
695
|
-
title?: string | undefined;
|
|
696
|
-
}>;
|
|
697
|
-
LinkButton: React_2.FC<{}>;
|
|
698
|
-
ListButtons: React_2.FC<{}>;
|
|
699
|
-
SandpackButton: React_2.FC<{}>;
|
|
700
|
-
TableButton: React_2.FC<{}>;
|
|
701
|
-
ToggleItem: React_2.ForwardRefExoticComponent<RadixToolbar.ToolbarToggleItemProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
702
|
-
ToggleSingleGroup: React_2.ForwardRefExoticComponent<Omit<RadixToolbar.ToolbarToggleGroupSingleProps, "type"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
703
|
-
ToggleSingleGroupWithItem: React_2.ForwardRefExoticComponent<Omit<RadixToolbar.ToolbarToggleGroupSingleProps, "type"> & {
|
|
704
|
-
on: boolean;
|
|
705
|
-
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
706
|
-
ToolbarButton: React_2.ForwardRefExoticComponent<RadixToolbar.ToolbarButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
707
|
-
ToolbarSeparator: React_2.ForwardRefExoticComponent<RadixToolbar.ToolbarSeparatorProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
708
|
-
ImageButton: React_2.ForwardRefExoticComponent<RadixToolbar.ToolbarButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
export declare type updateFn = (node: LexicalNode) => void;
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* The editor view mode.
|
|
715
|
-
* editor - The default rich text view mode.
|
|
716
|
-
* markdown - plain text markdown edit mode.
|
|
717
|
-
* diff - side by side comparison with the original markdown (passed as `headMarkdown`).
|
|
718
|
-
*/
|
|
719
|
-
export declare type ViewMode = 'editor' | 'markdown' | 'diff';
|
|
720
|
-
|
|
721
|
-
export declare interface VoidEmitter {
|
|
722
|
-
publish: () => void;
|
|
723
|
-
subscribe: (callback: () => void) => void;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
export { }
|
|
1
|
+
/**
|
|
2
|
+
* The `@mdxeditor/editor` package exports the MDXEditor React component and a set of plugins and pre-made components for custom editing/editor chrome.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export * from './MDXEditor';
|
|
6
|
+
export * from './importMarkdownToLexical';
|
|
7
|
+
export * from './exportMarkdownFromLexical';
|
|
8
|
+
export * from './plugins/core';
|
|
9
|
+
export * from './plugins/headings';
|
|
10
|
+
export * from './plugins/thematic-break';
|
|
11
|
+
export * from './plugins/lists';
|
|
12
|
+
export * from './plugins/table';
|
|
13
|
+
export * from './plugins/link';
|
|
14
|
+
export * from './plugins/image';
|
|
15
|
+
export * from './plugins/frontmatter';
|
|
16
|
+
export * from './plugins/quote';
|
|
17
|
+
export * from './plugins/jsx';
|
|
18
|
+
export * from './jsx-editors/GenericJsxEditor';
|
|
19
|
+
export * from './plugins/sandpack';
|
|
20
|
+
export * from './plugins/codemirror';
|
|
21
|
+
export * from './plugins/codemirror/CodeMirrorEditor';
|
|
22
|
+
export * from './plugins/codeblock';
|
|
23
|
+
export * from './plugins/directives';
|
|
24
|
+
export * from './directive-editors/AdmonitionDirectiveDescriptor';
|
|
25
|
+
export * from './directive-editors/GenericDirectiveEditor';
|
|
26
|
+
export * from './plugins/link-dialog';
|
|
27
|
+
export * from './plugins/toolbar';
|
|
28
|
+
export * from './plugins/diff-source';
|
|
29
|
+
export * from './plugins/markdown-shortcut';
|
|
30
|
+
export * from './plugins/toolbar/components/BlockTypeSelect';
|
|
31
|
+
export * from './plugins/toolbar/components/BoldItalicUnderlineToggles';
|
|
32
|
+
export * from './plugins/toolbar/components/ChangeAdmonitionType';
|
|
33
|
+
export * from './plugins/toolbar/components/ChangeCodeMirrorLanguage';
|
|
34
|
+
export * from './plugins/toolbar/components/CodeToggle';
|
|
35
|
+
export * from './plugins/toolbar/components/CreateLink';
|
|
36
|
+
export * from './plugins/toolbar/components/DiffSourceToggleWrapper';
|
|
37
|
+
export * from './plugins/toolbar/components/InsertAdmonition';
|
|
38
|
+
export * from './plugins/toolbar/components/InsertCodeBlock';
|
|
39
|
+
export * from './plugins/toolbar/components/InsertFrontmatter';
|
|
40
|
+
export * from './plugins/toolbar/components/InsertImage';
|
|
41
|
+
export * from './plugins/toolbar/components/InsertSandpack';
|
|
42
|
+
export * from './plugins/toolbar/components/InsertTable';
|
|
43
|
+
export * from './plugins/toolbar/components/InsertThematicBreak';
|
|
44
|
+
export * from './plugins/toolbar/components/ListsToggle';
|
|
45
|
+
export * from './plugins/toolbar/components/ShowSandpackInfo';
|
|
46
|
+
export * from './plugins/toolbar/components/UndoRedo';
|
|
47
|
+
export * from './plugins/toolbar/components/KitchenSinkToolbar';
|
|
48
|
+
export * from './plugins/toolbar/primitives/toolbar';
|
|
49
|
+
export * from './plugins/toolbar/primitives/DialogButton';
|
|
50
|
+
export * from './plugins/toolbar/primitives/TooltipWrap';
|
|
51
|
+
export * from './plugins/toolbar/primitives/select';
|
|
52
|
+
export * from './plugins/core/NestedLexicalEditor';
|
|
53
|
+
export * from './plugins/core/PropertyPopover';
|
|
54
|
+
export * from './utils/detectMac';
|
|
55
|
+
export * from './utils/fp';
|
|
56
|
+
export * from './utils/isPartOftheEditorUI';
|
|
57
|
+
export * from './utils/lexicalHelpers';
|
|
58
|
+
export * from './utils/makeHslTransparent';
|
|
59
|
+
export * from './utils/uuid4';
|
|
60
|
+
export * from './utils/voidEmitter';
|
|
61
|
+
export * from './utils/whitespaceConversion';
|
|
62
|
+
export * from './gurx';
|