@mdxeditor/editor 0.10.1 → 0.11.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/README.md +4 -3
- package/dist/FormatConstants.d.ts +9 -0
- package/dist/FormatConstants.js +10 -0
- package/dist/MDXEditor.d.ts +60 -0
- package/dist/MDXEditor.js +105 -0
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts +17 -0
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.js +29 -0
- package/dist/directive-editors/GenericDirectiveEditor.d.ts +8 -0
- package/dist/directive-editors/GenericDirectiveEditor.js +32 -0
- package/dist/exportMarkdownFromLexical.d.ts +114 -0
- package/dist/exportMarkdownFromLexical.js +199 -0
- package/dist/gurx/index.d.ts +3 -0
- package/dist/gurx/react.d.ts +121 -0
- package/dist/gurx/react.js +112 -0
- package/dist/gurx/realm.d.ts +133 -0
- package/dist/gurx/realm.js +491 -0
- package/dist/gurx/realmFactory.d.ts +58 -0
- package/dist/gurx/realmFactory.js +28 -0
- package/dist/icons/add_column.svg.js +8 -0
- package/dist/icons/add_photo.svg.js +8 -0
- package/dist/icons/add_row.svg.js +8 -0
- package/dist/icons/arrow_drop_down.svg.js +8 -0
- package/dist/icons/arrow_right.svg.js +8 -0
- package/dist/icons/check.svg.js +8 -0
- package/dist/icons/close.svg.js +8 -0
- package/dist/icons/code.svg.js +8 -0
- package/dist/icons/content_copy.svg.js +8 -0
- package/dist/icons/delete.svg.js +8 -0
- package/dist/icons/delete_small.svg.js +8 -0
- package/dist/icons/deployed_code.svg.js +8 -0
- package/dist/icons/difference.svg.js +8 -0
- package/dist/icons/edit.svg.js +8 -0
- package/dist/icons/emergency_home.svg.js +8 -0
- package/dist/icons/format_align_center.svg.js +8 -0
- package/dist/icons/format_align_left.svg.js +8 -0
- package/dist/icons/format_align_right.svg.js +8 -0
- package/dist/icons/format_bold.svg.js +8 -0
- package/dist/icons/format_italic.svg.js +8 -0
- package/dist/icons/format_list_bulleted.svg.js +8 -0
- package/dist/icons/format_list_numbered.svg.js +8 -0
- package/dist/icons/format_underlined.svg.js +8 -0
- package/dist/icons/frame_source.svg.js +8 -0
- package/dist/icons/frontmatter.svg.js +8 -0
- package/dist/icons/horizontal_rule.svg.js +8 -0
- package/dist/icons/insert_col_left.svg.js +8 -0
- package/dist/icons/insert_col_right.svg.js +8 -0
- package/dist/icons/insert_row_above.svg.js +8 -0
- package/dist/icons/insert_row_below.svg.js +8 -0
- package/dist/icons/link.svg.js +8 -0
- package/dist/icons/link_off.svg.js +8 -0
- package/dist/icons/markdown.svg.js +8 -0
- package/dist/icons/more_horiz.svg.js +8 -0
- package/dist/icons/open_in_new.svg.js +8 -0
- package/dist/icons/redo.svg.js +8 -0
- package/dist/icons/rich_text.svg.js +8 -0
- package/dist/icons/settings.svg.js +8 -0
- package/dist/icons/table.svg.js +8 -0
- package/dist/icons/undo.svg.js +8 -0
- package/dist/importMarkdownToLexical.d.ts +84 -0
- package/dist/importMarkdownToLexical.js +65 -0
- package/dist/index.d.ts +49 -1105
- package/dist/index.js +140 -72
- package/dist/jsx-editors/GenericJsxEditor.d.ts +8 -0
- package/dist/jsx-editors/GenericJsxEditor.js +56 -0
- package/dist/node_modules/react-diff-view/style/index.css.js +4 -0
- package/dist/plugins/codeblock/CodeBlockNode.d.ts +99 -0
- package/dist/plugins/codeblock/CodeBlockNode.js +155 -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 +617 -0
- package/dist/plugins/codeblock/index.js +73 -0
- package/dist/plugins/codemirror/CodeMirrorEditor.d.ts +3 -0
- package/dist/plugins/codemirror/CodeMirrorEditor.js +33 -0
- package/dist/plugins/codemirror/index.d.ts +800 -0
- package/dist/plugins/codemirror/index.js +62 -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 +85 -0
- package/dist/plugins/core/MdastFormattingVisitor.d.ts +4 -0
- package/dist/plugins/core/MdastFormattingVisitor.js +36 -0
- package/dist/plugins/core/MdastInlineCodeVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastInlineCodeVisitor.js +11 -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 +96 -0
- package/dist/plugins/core/NestedLexicalEditor.js +181 -0
- package/dist/plugins/core/PropertyPopover.d.ts +23 -0
- package/dist/plugins/core/PropertyPopover.js +36 -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 +423 -0
- package/dist/plugins/core/index.js +346 -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 +11 -0
- package/dist/plugins/diff-source/DiffViewer.d.ts +2 -0
- package/dist/plugins/diff-source/DiffViewer.js +18 -0
- package/dist/plugins/diff-source/SourceEditor.d.ts +2 -0
- package/dist/plugins/diff-source/SourceEditor.js +27 -0
- package/dist/plugins/diff-source/index.d.ts +544 -0
- package/dist/plugins/diff-source/index.js +55 -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 +603 -0
- package/dist/plugins/directives/index.js +53 -0
- package/dist/plugins/frontmatter/FrontmatterEditor.d.ts +6 -0
- package/dist/plugins/frontmatter/FrontmatterEditor.js +69 -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 +523 -0
- package/dist/plugins/frontmatter/index.js +53 -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 +118 -0
- package/dist/plugins/headings/index.js +20 -0
- package/dist/plugins/image/ImageEditor.d.ts +9 -0
- package/dist/{ImageEditor-8db2f131.js → plugins/image/ImageEditor.js} +40 -52
- package/dist/plugins/image/ImageNode.d.ts +63 -0
- package/dist/plugins/image/ImageNode.js +136 -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 +36 -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 +557 -0
- package/dist/plugins/image/index.js +246 -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 +12 -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 +599 -0
- package/dist/plugins/jsx/index.js +59 -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 +68 -0
- package/dist/plugins/link/index.js +22 -0
- package/dist/plugins/link-dialog/LinkDialog.d.ts +12 -0
- package/dist/plugins/link-dialog/LinkDialog.js +174 -0
- package/dist/plugins/link-dialog/index.d.ts +508 -0
- package/dist/plugins/link-dialog/index.js +242 -0
- package/dist/plugins/lists/LexicalListItemVisitor.d.ts +4 -0
- package/dist/plugins/lists/LexicalListItemVisitor.js +22 -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 +18 -0
- package/dist/plugins/lists/index.d.ts +533 -0
- package/dist/plugins/lists/index.js +111 -0
- package/dist/plugins/markdown-shortcut/index.d.ts +63 -0
- package/dist/plugins/markdown-shortcut/index.js +34 -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 +361 -0
- package/dist/plugins/quote/index.js +26 -0
- package/dist/plugins/sandpack/SandpackEditor.d.ts +7 -0
- package/dist/plugins/sandpack/SandpackEditor.js +35 -0
- package/dist/plugins/sandpack/index.d.ts +839 -0
- package/dist/plugins/sandpack/index.js +93 -0
- package/dist/plugins/sandpack/useCodeMirrorRef.d.ts +4 -0
- package/dist/{useCodeMirrorRef-5356dfa5.js → plugins/sandpack/useCodeMirrorRef.js} +22 -10
- 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 +384 -0
- package/dist/plugins/table/TableNode.d.ts +52 -0
- package/dist/plugins/table/TableNode.js +147 -0
- package/dist/plugins/table/index.d.ts +523 -0
- package/dist/plugins/table/index.js +59 -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 +523 -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 +52 -0
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts +5 -0
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +35 -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 +20 -0
- package/dist/plugins/toolbar/components/CreateLink.d.ts +6 -0
- package/dist/plugins/toolbar/components/CreateLink.js +11 -0
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts +18 -0
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +27 -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 +11 -0
- package/dist/plugins/toolbar/components/InsertImage.d.ts +6 -0
- package/dist/plugins/toolbar/components/InsertImage.js +23 -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 +32 -0
- package/dist/plugins/toolbar/components/UndoRedo.d.ts +5 -0
- package/dist/plugins/toolbar/components/UndoRedo.js +59 -0
- package/dist/plugins/toolbar/index.d.ts +428 -0
- package/dist/plugins/toolbar/index.js +39 -0
- package/dist/plugins/toolbar/primitives/DialogButton.d.ts +40 -0
- package/dist/plugins/toolbar/primitives/DialogButton.js +115 -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 +44 -0
- package/dist/plugins/toolbar/primitives/toolbar.d.ts +160 -0
- package/dist/plugins/toolbar/primitives/toolbar.js +111 -0
- package/dist/style.css +556 -249
- package/dist/styles/globals.css.js +4 -0
- package/dist/styles/lexical-theme.module.css.js +53 -0
- package/dist/styles/lexicalTheme.d.ts +2 -0
- package/dist/styles/lexicalTheme.js +28 -0
- package/dist/styles/ui.module.css.js +254 -0
- package/dist/utils/detectMac.d.ts +2 -0
- package/dist/utils/detectMac.js +6 -0
- package/dist/utils/fp.d.ts +47 -0
- package/dist/utils/fp.js +10 -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 +49 -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/package.json +246 -14
- package/dist/CodeBlockEditor-02116cba.js +0 -79
- package/dist/CodeBlockEditor-1c7b46dc.cjs +0 -1
- package/dist/FrontmatterEditor-37a4c091.cjs +0 -1
- package/dist/FrontmatterEditor-988a8fb6.js +0 -118
- package/dist/ImageEditor-524159e9.cjs +0 -1
- package/dist/JsxEditor-606e9d86.js +0 -108
- package/dist/JsxEditor-98a94a9d.cjs +0 -1
- package/dist/LeafDirectiveEditor-38a73f5c.js +0 -59
- package/dist/LeafDirectiveEditor-dfa1ce78.cjs +0 -1
- package/dist/SandpackEditor-90425f26.cjs +0 -1
- package/dist/SandpackEditor-c771b4d0.js +0 -100
- package/dist/SourceEditor-19eb2c9e.js +0 -64
- package/dist/SourceEditor-46ed1f77.cjs +0 -1
- package/dist/TableEditor-4a993dab.cjs +0 -1
- package/dist/TableEditor-c28b3ca2.js +0 -426
- package/dist/index-1ab1a12e.js +0 -4363
- package/dist/index-8217810f.cjs +0 -1
- package/dist/index.cjs +0 -1
- package/dist/useCodeMirrorRef-7055e7de.cjs +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgDeleteSmall = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h20v20H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M6.5 17a1.45 1.45 0 0 1-1.06-.44A1.445 1.445 0 0 1 5 15.5v-10H4V4h4V3h4v1h4v1.5h-1v9.991c0 .423-.147.78-.44 1.072A1.45 1.45 0 0 1 13.5 17h-7Zm7-11.5h-7v10h7v-10ZM8 14h1.5V7H8v7Zm2.5 0H12V7h-1.5v7Z" })));
|
|
5
|
+
const DeleteSmallIcon = SvgDeleteSmall;
|
|
6
|
+
export {
|
|
7
|
+
DeleteSmallIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgDeployedCode = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m5 15.95 6 3.475v-6.85L5 9.1v6.85Zm8 3.475 6-3.475V9.1l-6 3.475v6.85Zm-6.925-12L12 10.85l5.925-3.425L12 4 6.075 7.425ZM3 17.125V6.875L12 1.7l9 5.175v10.25L12 22.3l-9-5.175Z" })));
|
|
5
|
+
const LiveCodeIcon = SvgDeployedCode;
|
|
6
|
+
export {
|
|
7
|
+
LiveCodeIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgDifference = (props) => /* @__PURE__ */ React.createElement("svg", { width: 25, height: 24, viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_318_257", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 25, height: 24 }, /* @__PURE__ */ React.createElement("rect", { x: 0.929688, width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_318_257)" }, /* @__PURE__ */ React.createElement("path", { d: "M12.4297 13H14.4297V11H16.4297V9H14.4297V7H12.4297V9H10.4297V11H12.4297V13ZM10.4297 17H16.4297V15H10.4297V17ZM5.92969 21V3H14.9297L20.9297 9V21H5.92969ZM7.92969 19H18.9297V10L13.9297 5H7.92969V19Z", fill: "currentColor" })));
|
|
5
|
+
const DiffIcon = SvgDifference;
|
|
6
|
+
export {
|
|
7
|
+
DiffIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgEdit = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M5 19h1.4l8.625-8.625-1.4-1.4L5 17.6V19ZM19.3 8.925l-4.25-4.2L17.875 1.9 22.1 6.125l-2.8 2.8ZM3 21v-4.25l10.6-10.6 4.25 4.25L7.25 21H3Z" })));
|
|
5
|
+
const EditIcon = SvgEdit;
|
|
6
|
+
export {
|
|
7
|
+
EditIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgEmergencyHome = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_403_47", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 24, height: 24 }, /* @__PURE__ */ React.createElement("rect", { width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_403_47)" }, /* @__PURE__ */ React.createElement("path", { d: "M11 6.625H13V13.375H11V6.625ZM12 16C11.7166 16 11.4791 15.9042 11.2875 15.7125C11.0958 15.5208 11 15.2833 11 15C11 14.7167 11.0958 14.4792 11.2875 14.2875C11.4791 14.0958 11.7166 14 12 14C12.2833 14 12.5208 14.0958 12.7125 14.2875C12.9041 14.4792 13 14.7167 13 15C13 15.2833 12.9041 15.5208 12.7125 15.7125C12.5208 15.9042 12.2833 16 12 16ZM12 22.8L1.19995 12L12 1.2L22.8 12L12 22.8ZM12 20L20 12L12 4L3.99995 12L12 20Z", fill: "currentColor" })));
|
|
5
|
+
const AdmonitionIcon = SvgEmergencyHome;
|
|
6
|
+
export {
|
|
7
|
+
AdmonitionIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatAlignCenter = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h20v20H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M3 17v-1.5h14V17H3Zm3-3.125v-1.5h8v1.5H6ZM3 10.75v-1.5h14v1.5H3Zm3-3.125v-1.5h8v1.5H6ZM3 4.5V3h14v1.5H3Z" })));
|
|
5
|
+
const AlignCenterIcon = SvgFormatAlignCenter;
|
|
6
|
+
export {
|
|
7
|
+
AlignCenterIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatAlignLeft = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h20v20H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M3 17v-1.5h14V17H3Zm0-3.125v-1.5h10v1.5H3Zm0-3.125v-1.5h14v1.5H3Zm0-3.125v-1.5h10v1.5H3ZM3 4.5V3h14v1.5H3Z" })));
|
|
5
|
+
const AlignLeftIcon = SvgFormatAlignLeft;
|
|
6
|
+
export {
|
|
7
|
+
AlignLeftIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatAlignRight = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h20v20H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M3 17v-1.5h14V17H3Zm4-3.125v-1.5h10v1.5H7ZM3 10.75v-1.5h14v1.5H3Zm4-3.125v-1.5h10v1.5H7ZM3 4.5V3h14v1.5H3Z" })));
|
|
5
|
+
const AlignRightIcon = SvgFormatAlignRight;
|
|
6
|
+
export {
|
|
7
|
+
AlignRightIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatBold = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M6.8 19V5h5.525c1.083 0 2.083.333 3 1 .917.667 1.375 1.592 1.375 2.775 0 .85-.192 1.504-.575 1.962-.383.459-.742.788-1.075.988.417.183.88.525 1.388 1.025.508.5.762 1.25.762 2.25 0 1.483-.542 2.521-1.625 3.113-1.083.591-2.1.887-3.05.887H6.8Zm3.025-2.8h2.6c.8 0 1.287-.204 1.462-.613.175-.408.263-.704.263-.887 0-.183-.088-.48-.263-.888-.175-.408-.687-.612-1.537-.612H9.825v3Zm0-5.7h2.325c.55 0 .95-.142 1.2-.425a1.4 1.4 0 0 0 .375-.95c0-.4-.142-.725-.425-.975-.283-.25-.65-.375-1.1-.375H9.825V10.5Z" })));
|
|
5
|
+
const BoldIcon = SvgFormatBold;
|
|
6
|
+
export {
|
|
7
|
+
BoldIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatItalic = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M5 19v-2.5h4l3-9H8V5h10v2.5h-3.5l-3 9H15V19H5Z" })));
|
|
5
|
+
const ItalicIcon = SvgFormatItalic;
|
|
6
|
+
export {
|
|
7
|
+
ItalicIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatListBulleted = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20a1.93 1.93 0 0 1-1.413-.587A1.928 1.928 0 0 1 3 18c0-.55.196-1.021.587-1.413A1.928 1.928 0 0 1 5 16c.55 0 1.02.196 1.412.587.392.392.588.863.588 1.413s-.196 1.021-.588 1.413A1.925 1.925 0 0 1 5 20Zm0-6c-.55 0-1.021-.196-1.413-.588A1.925 1.925 0 0 1 3 12c0-.55.196-1.021.587-1.413A1.928 1.928 0 0 1 5 10c.55 0 1.02.196 1.412.587.392.392.588.863.588 1.413s-.196 1.02-.588 1.412A1.923 1.923 0 0 1 5 14Zm0-6c-.55 0-1.021-.196-1.413-.588A1.925 1.925 0 0 1 3 6c0-.55.196-1.02.587-1.412A1.927 1.927 0 0 1 5 4c.55 0 1.02.196 1.412.588C6.804 4.979 7 5.45 7 6c0 .55-.196 1.02-.588 1.412A1.923 1.923 0 0 1 5 8Z" })));
|
|
5
|
+
const BulletedListIcon = SvgFormatListBulleted;
|
|
6
|
+
export {
|
|
7
|
+
BulletedListIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatListNumbered = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h4v2.25L6 19l1 .75V22H3Zm0-7v-3.75h2.5v-.75H3V9h4v3.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z" })));
|
|
5
|
+
const NumberedListIcon = SvgFormatListNumbered;
|
|
6
|
+
export {
|
|
7
|
+
NumberedListIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFormatUnderlined = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M5 21v-2h14v2H5Zm7-4c-1.683 0-2.992-.525-3.925-1.575-.933-1.05-1.4-2.442-1.4-4.175V3H9.25v8.4c0 .933.233 1.692.7 2.275.467.583 1.15.875 2.05.875.9 0 1.583-.292 2.05-.875.467-.583.7-1.342.7-2.275V3h2.575v8.25c0 1.733-.467 3.125-1.4 4.175C14.992 16.475 13.683 17 12 17Z" })));
|
|
5
|
+
const UnderlinedIcon = SvgFormatUnderlined;
|
|
6
|
+
export {
|
|
7
|
+
UnderlinedIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFrameSource = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M3 21v-6h2v4h4v2H3Zm12 0v-2h4v-4h2v6h-6Zm-6.4-5.4L5 12l3.6-3.6L10 9.825 7.825 12 10 14.175 8.6 15.6Zm6.8 0L14 14.175 16.175 12 14 9.825 15.4 8.4 19 12l-3.6 3.6ZM3 9V3h6v2H5v4H3Zm16 0V5h-4V3h6v6h-2Z" })));
|
|
5
|
+
const FrameSourceIcon = SvgFrameSource;
|
|
6
|
+
export {
|
|
7
|
+
FrameSourceIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgFrontmatter = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M5 7h4v2H5z" }), /* @__PURE__ */ React.createElement("path", { d: "M5 7h4v2H5zm0 7h4v2H5z" }), /* @__PURE__ */ React.createElement("path", { d: "M5 14h4v2H5zm5-7h4v2h-4z" }), /* @__PURE__ */ React.createElement("path", { d: "M10 7h4v2h-4zm0 7h4v2h-4z" }), /* @__PURE__ */ React.createElement("path", { d: "M10 14h4v2h-4zm5-7h4v2h-4z" }), /* @__PURE__ */ React.createElement("path", { d: "M15 7h4v2h-4zm0 7h4v2h-4z" }), /* @__PURE__ */ React.createElement("path", { d: "M15 14h4v2h-4z" })));
|
|
5
|
+
const FrontmatterIcon = SvgFrontmatter;
|
|
6
|
+
export {
|
|
7
|
+
FrontmatterIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgHorizontalRule = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M4 13v-2h16v2H4Z" })));
|
|
5
|
+
const HorizontalRuleIcon = SvgHorizontalRule;
|
|
6
|
+
export {
|
|
7
|
+
HorizontalRuleIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgInsertColLeft = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 20h20v20H0z", transform: "rotate(-90 0 20)" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M15.75 4.5H13v2.75h-1.5V4.5H8.75V3h2.75V.25H13V3h2.75v1.5ZM13 17H5V3h2.25v1.5H6.5v11h5V8.75H13V17Z" })));
|
|
5
|
+
const InsertColLeftIcon = SvgInsertColLeft;
|
|
6
|
+
export {
|
|
7
|
+
InsertColLeftIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgInsertColRight = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h20v20H0z", transform: "matrix(0 -1 -1 0 20 20)" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M4.25 4.5H7v2.75h1.5V4.5h2.75V3H8.5V.25H7V3H4.25v1.5ZM7 17h8V3h-2.25v1.5h.75v11h-5V8.75H7V17Z" })));
|
|
5
|
+
const InsertColRightIcon = SvgInsertColRight;
|
|
6
|
+
export {
|
|
7
|
+
InsertColRightIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgInsertRowAbove = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h20v20H0z", transform: "matrix(-1 0 0 1 20 0)" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M4.5 16.75V14h2.75v-1.5H4.5V9.75H3v2.75H.25V14H3v2.75h1.5ZM17 14V6H3v2.25h1.5V7.5h11v5H8.75V14H17Z" })));
|
|
5
|
+
const InsertRowAboveIcon = SvgInsertRowAbove;
|
|
6
|
+
export {
|
|
7
|
+
InsertRowAboveIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgInsertRowBelow = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "currentColor", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 20, height: 20, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M20 20h20v20H20z", transform: "rotate(180 20 20)" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M4.5 3.25V6h2.75v1.5H4.5v2.75H3V7.5H.25V6H3V3.25h1.5ZM17 6v8H3v-2.25h1.5v.75h11v-5H8.75V6H17Z" })));
|
|
5
|
+
const InsertRowBelowIcon = SvgInsertRowBelow;
|
|
6
|
+
export {
|
|
7
|
+
InsertRowBelowIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgLink = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M11 17H7c-1.383 0-2.562-.488-3.537-1.463C2.488 14.562 2 13.383 2 12s.488-2.563 1.463-3.538C4.438 7.487 5.617 7 7 7h4v2H7c-.833 0-1.542.292-2.125.875A2.893 2.893 0 0 0 4 12c0 .833.292 1.542.875 2.125A2.893 2.893 0 0 0 7 15h4v2Zm-3-4v-2h8v2H8Zm5 4v-2h4c.833 0 1.542-.292 2.125-.875A2.893 2.893 0 0 0 20 12c0-.833-.292-1.542-.875-2.125A2.893 2.893 0 0 0 17 9h-4V7h4c1.383 0 2.563.487 3.538 1.462C21.513 9.437 22 10.617 22 12s-.487 2.562-1.462 3.537C19.563 16.512 18.383 17 17 17h-4Z" })));
|
|
5
|
+
const LinkIcon = SvgLink;
|
|
6
|
+
export {
|
|
7
|
+
LinkIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgLinkOff = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m19.25 16.45-1.5-1.55a3.05 3.05 0 0 0 1.625-1.063A2.867 2.867 0 0 0 20 12c0-.833-.292-1.542-.875-2.125A2.893 2.893 0 0 0 17 9h-4V7h4c1.383 0 2.563.487 3.538 1.462C21.513 9.437 22 10.617 22 12c0 .95-.246 1.825-.737 2.625a4.79 4.79 0 0 1-2.013 1.825ZM15.85 13l-2-2H16v2h-.15Zm3.95 9.6L1.4 4.2l1.4-1.4 18.4 18.4-1.4 1.4ZM11 17H7c-1.383 0-2.562-.488-3.537-1.463C2.488 14.562 2 13.383 2 12c0-1.15.35-2.175 1.05-3.075.7-.9 1.6-1.492 2.7-1.775L7.6 9H7c-.833 0-1.542.292-2.125.875A2.893 2.893 0 0 0 4 12c0 .833.292 1.542.875 2.125A2.893 2.893 0 0 0 7 15h4v2Zm-3-4v-2h1.625l1.975 2H8Z" })));
|
|
5
|
+
const LinkOffIcon = SvgLinkOff;
|
|
6
|
+
export {
|
|
7
|
+
LinkOffIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgMarkdown = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_46_56", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 24, height: 24 }, /* @__PURE__ */ React.createElement("rect", { width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_46_56)" }, /* @__PURE__ */ React.createElement("path", { d: "M19 19L14 14L15.4 12.575L18 15.175V5H20V15.175L22.6 12.575L24 14L19 19Z", fill: "currentColor" }), /* @__PURE__ */ React.createElement("path", { d: "M13 19H10.5V9L6.5 15L2.5 9V19H0V5H2.5L6.5 11L10.5 5H13V19Z", fill: "currentColor" })));
|
|
5
|
+
const SourceIcon = SvgMarkdown;
|
|
6
|
+
export {
|
|
7
|
+
SourceIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgMoreHoriz = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M6 14c-.55 0-1.02-.196-1.412-.588A1.926 1.926 0 0 1 4 12c0-.55.196-1.02.588-1.412A1.926 1.926 0 0 1 6 10c.55 0 1.02.196 1.412.588.392.391.588.862.588 1.412 0 .55-.196 1.02-.588 1.412A1.926 1.926 0 0 1 6 14Zm6 0c-.55 0-1.02-.196-1.412-.588A1.926 1.926 0 0 1 10 12c0-.55.196-1.02.588-1.412A1.926 1.926 0 0 1 12 10c.55 0 1.02.196 1.412.588.392.391.588.862.588 1.412 0 .55-.196 1.02-.588 1.412A1.926 1.926 0 0 1 12 14Zm6 0c-.55 0-1.02-.196-1.413-.588A1.926 1.926 0 0 1 16 12c0-.55.196-1.02.587-1.412A1.926 1.926 0 0 1 18 10c.55 0 1.02.196 1.413.588.391.391.587.862.587 1.412 0 .55-.196 1.02-.587 1.412A1.926 1.926 0 0 1 18 14Z" })));
|
|
5
|
+
const MoreHorizIcon = SvgMoreHoriz;
|
|
6
|
+
export {
|
|
7
|
+
MoreHorizIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgOpenInNew = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M3 21V3h9v2H5v14h14v-7h2v9H3Zm6.7-5.3-1.4-1.4L17.6 5H14V3h7v7h-2V6.4l-9.3 9.3Z" })));
|
|
5
|
+
const OpenInNewIcon = SvgOpenInNew;
|
|
6
|
+
export {
|
|
7
|
+
OpenInNewIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgRedo = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_404_65", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 24, height: 24 }, /* @__PURE__ */ React.createElement("rect", { width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_404_65)" }, /* @__PURE__ */ React.createElement("path", { d: "M9.9 19C8.28333 19 6.89583 18.475 5.7375 17.425C4.57917 16.375 4 15.0667 4 13.5C4 11.9333 4.57917 10.625 5.7375 9.575C6.89583 8.525 8.28333 8 9.9 8H16.2L13.6 5.4L15 4L20 9L15 14L13.6 12.6L16.2 10H9.9C8.85 10 7.9375 10.3333 7.1625 11C6.3875 11.6667 6 12.5 6 13.5C6 14.5 6.3875 15.3333 7.1625 16C7.9375 16.6667 8.85 17 9.9 17H17V19H9.9Z", fill: "currentColor" })));
|
|
5
|
+
const RedoIcon = SvgRedo;
|
|
6
|
+
export {
|
|
7
|
+
RedoIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgRichText = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_318_249", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 24, height: 24 }, /* @__PURE__ */ React.createElement("rect", { width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_318_249)" }, /* @__PURE__ */ React.createElement("path", { d: "M5 22V20H19V22H5Z", fill: "currentColor" }), /* @__PURE__ */ React.createElement("path", { d: "M6.80005 18V4H12.325C13.4084 4 14.4084 4.33333 15.325 5C16.2417 5.66667 16.7001 6.59167 16.7001 7.775C16.7001 8.625 16.5084 9.279 16.125 9.737C15.7417 10.1957 15.3834 10.525 15.05 10.725C15.4667 10.9083 15.9294 11.25 16.438 11.75C16.946 12.25 17.2001 13 17.2001 14C17.2001 15.4833 16.6584 16.521 15.575 17.113C14.4917 17.7043 13.475 18 12.525 18H6.80005ZM9.82505 15.2H12.425C13.225 15.2 13.7124 14.9957 13.887 14.587C14.0624 14.179 14.15 13.8833 14.15 13.7C14.15 13.5167 14.0624 13.2207 13.887 12.812C13.7124 12.404 13.2 12.2 12.35 12.2H9.82505V15.2ZM9.82505 9.5H12.15C12.7 9.5 13.1 9.35833 13.35 9.075C13.6 8.79167 13.725 8.475 13.725 8.125C13.725 7.725 13.5834 7.4 13.3 7.15C13.0167 6.9 12.65 6.775 12.2 6.775H9.82505V9.5Z", fill: "currentColor" })));
|
|
5
|
+
const RichTextIcon = SvgRichText;
|
|
6
|
+
export {
|
|
7
|
+
RichTextIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgSettings = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m9.25 22-.4-3.2a3.79 3.79 0 0 1-.613-.3 8.266 8.266 0 0 1-.562-.375L4.7 19.375l-2.75-4.75 2.575-1.95a2.387 2.387 0 0 1-.025-.338v-.675c0-.108.008-.22.025-.337L1.95 9.375l2.75-4.75 2.975 1.25c.183-.133.375-.258.575-.375.2-.117.4-.217.6-.3l.4-3.2h5.5l.4 3.2c.217.083.42.183.612.3.192.117.38.242.563.375l2.975-1.25 2.75 4.75-2.575 1.95c.017.117.025.23.025.338v.675c0 .108-.017.22-.05.337l2.575 1.95-2.75 4.75-2.95-1.25a6.842 6.842 0 0 1-.575.375c-.2.117-.4.217-.6.3l-.4 3.2h-5.5Zm2.8-6.5c.967 0 1.792-.342 2.475-1.025A3.372 3.372 0 0 0 15.55 12c0-.967-.342-1.792-1.025-2.475A3.373 3.373 0 0 0 12.05 8.5c-.983 0-1.813.342-2.488 1.025A3.393 3.393 0 0 0 8.55 12c0 .967.337 1.792 1.012 2.475.676.683 1.505 1.025 2.488 1.025Zm0-2c-.417 0-.77-.146-1.063-.438A1.446 1.446 0 0 1 10.55 12c0-.417.146-.77.438-1.063a1.446 1.446 0 0 1 1.062-.437c.417 0 .77.146 1.063.438.291.291.437.645.437 1.062 0 .417-.146.77-.438 1.063a1.447 1.447 0 0 1-1.062.437ZM11 20h1.975l.35-2.65a5.61 5.61 0 0 0 1.438-.588c.441-.258.845-.57 1.212-.937l2.475 1.025.975-1.7-2.15-1.625c.083-.233.142-.48.175-.738a6.153 6.153 0 0 0 0-1.575 3.535 3.535 0 0 0-.175-.737l2.15-1.625-.975-1.7-2.475 1.05a5.556 5.556 0 0 0-1.213-.962 5.607 5.607 0 0 0-1.437-.588L13 4h-1.975l-.35 2.65c-.517.133-.996.33-1.438.587a6.015 6.015 0 0 0-1.212.938L5.55 7.15l-.975 1.7 2.15 1.6c-.083.25-.142.5-.175.75a6.122 6.122 0 0 0 0 1.575c.033.25.092.5.175.75l-2.15 1.625.975 1.7 2.475-1.05c.367.383.77.704 1.212.962.442.259.921.455 1.438.588L11 20Z" })));
|
|
5
|
+
const SettingsIcon = SvgSettings;
|
|
6
|
+
export {
|
|
7
|
+
SettingsIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgTable = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "a", width: 24, height: 24, x: 0, y: 0, maskUnits: "userSpaceOnUse", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M3 21V3h18v18H3ZM5 9h14V5H5v4Zm5.325 5h3.35v-3h-3.35v3Zm0 5h3.35v-3h-3.35v3ZM5 14h3.325v-3H5v3Zm10.675 0H19v-3h-3.325v3ZM5 19h3.325v-3H5v3Zm10.675 0H19v-3h-3.325v3Z" }), /* @__PURE__ */ React.createElement("path", { d: "M8.325 9h2V5h-2v4Zm5.35 0h2V5h-2v4Z" })));
|
|
5
|
+
const TableIcon = SvgTable;
|
|
6
|
+
export {
|
|
7
|
+
TableIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgUndo = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_404_71", style: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
}, maskUnits: "userSpaceOnUse", x: 0, y: 0, width: 24, height: 24 }, /* @__PURE__ */ React.createElement("rect", { width: 24, height: 24, fill: "#D9D9D9" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#mask0_404_71)" }, /* @__PURE__ */ React.createElement("path", { d: "M7 19V17H14.1C15.15 17 16.0625 16.6667 16.8375 16C17.6125 15.3333 18 14.5 18 13.5C18 12.5 17.6125 11.6667 16.8375 11C16.0625 10.3333 15.15 10 14.1 10H7.8L10.4 12.6L9 14L4 9L9 4L10.4 5.4L7.8 8H14.1C15.7167 8 17.1042 8.525 18.2625 9.575C19.4208 10.625 20 11.9333 20 13.5C20 15.0667 19.4208 16.375 18.2625 17.425C17.1042 18.475 15.7167 19 14.1 19H7Z", fill: "currentColor" })));
|
|
5
|
+
const UndoIcon = SvgUndo;
|
|
6
|
+
export {
|
|
7
|
+
UndoIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { LexicalNode, RootNode as LexicalRootNode } from 'lexical';
|
|
2
|
+
import * as Mdast from 'mdast';
|
|
3
|
+
import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
4
|
+
import { ParseOptions } from 'micromark-util-types';
|
|
5
|
+
import { IS_BOLD, IS_ITALIC, IS_UNDERLINE } from './FormatConstants';
|
|
6
|
+
export type MdastExtensions = NonNullable<Parameters<typeof fromMarkdown>[1]>['mdastExtensions'];
|
|
7
|
+
/**
|
|
8
|
+
* A set of actions that can be used to modify the lexical tree while visiting the mdast tree.
|
|
9
|
+
*/
|
|
10
|
+
export interface MdastVisitActions {
|
|
11
|
+
/**
|
|
12
|
+
* Iterate the children of the node with the lexical node as the parent.
|
|
13
|
+
*/
|
|
14
|
+
visitChildren(node: Mdast.Parent, lexicalParent: LexicalNode): void;
|
|
15
|
+
/**
|
|
16
|
+
* Add the given node to the lexical tree, and iterate the current mdast node's children with the newly created lexical node as a parent.
|
|
17
|
+
*/
|
|
18
|
+
addAndStepInto(lexicalNode: LexicalNode): void;
|
|
19
|
+
/**
|
|
20
|
+
* Adds formatting as a context for the current node and its children.
|
|
21
|
+
* This is necessary due to mdast treating formatting as a node, while lexical considering it an attribute of a node.
|
|
22
|
+
*/
|
|
23
|
+
addFormatting(format: typeof IS_BOLD | typeof IS_ITALIC | typeof IS_UNDERLINE, node?: Mdast.Content): void;
|
|
24
|
+
/**
|
|
25
|
+
* Adds formatting as a context for the current node and its children.
|
|
26
|
+
* This is necessary due to mdast treating formatting as a node, while lexical considering it an attribute of a node.
|
|
27
|
+
*/
|
|
28
|
+
removeFormatting(format: typeof IS_BOLD | typeof IS_ITALIC | typeof IS_UNDERLINE, node?: Mdast.Content): void;
|
|
29
|
+
/**
|
|
30
|
+
* Access the current formatting context.
|
|
31
|
+
*/
|
|
32
|
+
getParentFormatting(): number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parameters passed to the {@link MdastImportVisitor.visitNode} function.
|
|
36
|
+
* @param mdastNode - The node that is currently being visited.
|
|
37
|
+
* @param lexicalParent - The parent lexical node to which the results of the processing should be added.
|
|
38
|
+
* @param actions - A set of convenience utilities that can be used to add nodes to the lexical tree.
|
|
39
|
+
* @typeParam T - The type of the mdast node that is being visited.
|
|
40
|
+
*/
|
|
41
|
+
export interface MdastVisitParams<T extends Mdast.Content> {
|
|
42
|
+
mdastNode: T;
|
|
43
|
+
mdastParent: Mdast.Parent | null;
|
|
44
|
+
lexicalParent: LexicalNode;
|
|
45
|
+
actions: MdastVisitActions;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Implement this interface to convert certian mdast nodes into lexical nodes.
|
|
49
|
+
* @typeParam UN - The type of the mdast node that is being visited.
|
|
50
|
+
*/
|
|
51
|
+
export interface MdastImportVisitor<UN extends Mdast.Content> {
|
|
52
|
+
/**
|
|
53
|
+
* The test function that determines if this visitor should be used for the given node.
|
|
54
|
+
* As a convenience, you can also pass a string here, which will be compared to the node's type.
|
|
55
|
+
*/
|
|
56
|
+
testNode: ((mdastNode: Mdast.Content | Mdast.Root) => boolean) | string;
|
|
57
|
+
/**
|
|
58
|
+
* The function that is called when the node is visited. See {@link MdastVisitParams} for details.
|
|
59
|
+
*/
|
|
60
|
+
visitNode(params: MdastVisitParams<UN>): void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The options of the tree import utility. Not meant to be used directly.
|
|
64
|
+
*/
|
|
65
|
+
export interface MdastTreeImportOptions {
|
|
66
|
+
root: LexicalRootNode;
|
|
67
|
+
visitors: MdastImportVisitor<Mdast.Content>[];
|
|
68
|
+
mdastRoot: Mdast.Root;
|
|
69
|
+
}
|
|
70
|
+
export interface MarkdownParseOptions extends Omit<MdastTreeImportOptions, 'mdastRoot'> {
|
|
71
|
+
markdown: string;
|
|
72
|
+
syntaxExtensions: NonNullable<ParseOptions['extensions']>;
|
|
73
|
+
mdastExtensions: MdastExtensions;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* An extension for the `fromMarkdown` utility tree construction.
|
|
77
|
+
*/
|
|
78
|
+
export type MdastExtension = NonNullable<MdastExtensions>[number];
|
|
79
|
+
/**
|
|
80
|
+
* An extension for the `fromMarkdown` utility markdown parse.
|
|
81
|
+
*/
|
|
82
|
+
export type SyntaxExtension = MarkdownParseOptions['syntaxExtensions'][number];
|
|
83
|
+
export declare function importMarkdownToLexical({ root, markdown, visitors, syntaxExtensions, mdastExtensions }: MarkdownParseOptions): void;
|
|
84
|
+
export declare function importMdastTreeToLexical({ root, mdastRoot, visitors }: MdastTreeImportOptions): void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
2
|
+
function isParent(node) {
|
|
3
|
+
return node.children instanceof Array;
|
|
4
|
+
}
|
|
5
|
+
function importMarkdownToLexical({ root, markdown, visitors, syntaxExtensions, mdastExtensions }) {
|
|
6
|
+
const mdastRoot = fromMarkdown(markdown, {
|
|
7
|
+
extensions: syntaxExtensions,
|
|
8
|
+
mdastExtensions
|
|
9
|
+
});
|
|
10
|
+
if (mdastRoot.children.length === 0) {
|
|
11
|
+
mdastRoot.children.push({ type: "paragraph", children: [] });
|
|
12
|
+
}
|
|
13
|
+
importMdastTreeToLexical({ root, mdastRoot, visitors });
|
|
14
|
+
}
|
|
15
|
+
function importMdastTreeToLexical({ root, mdastRoot, visitors }) {
|
|
16
|
+
const formattingMap = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
function visitChildren(mdastNode, lexicalParent) {
|
|
18
|
+
if (!isParent(mdastNode)) {
|
|
19
|
+
throw new Error("Attempting to visit children of a non-parent");
|
|
20
|
+
}
|
|
21
|
+
mdastNode.children.forEach((child) => visit(child, lexicalParent, mdastNode));
|
|
22
|
+
}
|
|
23
|
+
function visit(mdastNode, lexicalParent, mdastParent) {
|
|
24
|
+
const visitor = visitors.find((visitor2) => {
|
|
25
|
+
if (typeof visitor2.testNode === "string") {
|
|
26
|
+
return visitor2.testNode === mdastNode.type;
|
|
27
|
+
}
|
|
28
|
+
return visitor2.testNode(mdastNode);
|
|
29
|
+
});
|
|
30
|
+
if (!visitor) {
|
|
31
|
+
throw new Error(`no MdastImportVisitor found for ${mdastNode.type} ${JSON.stringify(mdastNode)}`, {
|
|
32
|
+
cause: mdastNode
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
visitor.visitNode({
|
|
36
|
+
//@ts-expect-error root type is glitching
|
|
37
|
+
mdastNode,
|
|
38
|
+
lexicalParent,
|
|
39
|
+
mdastParent,
|
|
40
|
+
actions: {
|
|
41
|
+
visitChildren,
|
|
42
|
+
addAndStepInto(lexicalNode) {
|
|
43
|
+
lexicalParent.append(lexicalNode);
|
|
44
|
+
if (isParent(mdastNode)) {
|
|
45
|
+
visitChildren(mdastNode, lexicalNode);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
addFormatting(format, node = mdastNode) {
|
|
49
|
+
formattingMap.set(node, format | (formattingMap.get(mdastParent) ?? 0));
|
|
50
|
+
},
|
|
51
|
+
removeFormatting(format, node = mdastNode) {
|
|
52
|
+
formattingMap.set(node, format ^ (formattingMap.get(mdastParent) ?? 0));
|
|
53
|
+
},
|
|
54
|
+
getParentFormatting() {
|
|
55
|
+
return formattingMap.get(mdastParent) ?? 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
visit(mdastRoot, root, null);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
importMarkdownToLexical,
|
|
64
|
+
importMdastTreeToLexical
|
|
65
|
+
};
|