@mdxeditor/editor 0.8.0 → 0.10.0-alpha.1
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 +2 -2
- package/dist/FormatConstants.d.ts +9 -0
- package/dist/FormatConstants.js +10 -0
- package/dist/MDXEditor.d.ts +31 -0
- package/dist/MDXEditor.js +105 -0
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts +4 -0
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.js +29 -0
- package/dist/directive-editors/GenericDirectiveEditor.d.ts +3 -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 -973
- package/dist/index.js +133 -66
- package/dist/jsx-editors/GenericJsxEditor.d.ts +3 -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 +604 -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 +786 -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 +69 -0
- package/dist/plugins/core/NestedLexicalEditor.js +181 -0
- package/dist/plugins/core/PropertyPopover.d.ts +8 -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 +419 -0
- package/dist/plugins/core/index.js +343 -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 +25 -0
- package/dist/plugins/diff-source/index.d.ts +530 -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 +591 -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 +510 -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 +105 -0
- package/dist/plugins/headings/index.js +20 -0
- package/dist/plugins/image/ImageEditor.d.ts +7 -0
- package/dist/{ImageEditor-5f203a1c.js → plugins/image/ImageEditor.js} +12 -46
- package/dist/plugins/image/ImageNode.d.ts +53 -0
- package/dist/plugins/image/ImageNode.js +108 -0
- package/dist/plugins/image/LexicalImageVisitor.d.ts +4 -0
- package/dist/plugins/image/LexicalImageVisitor.js +15 -0
- package/dist/plugins/image/MdastImageVisitor.d.ts +3 -0
- package/dist/plugins/image/MdastImageVisitor.js +16 -0
- package/dist/plugins/image/index.d.ts +541 -0
- package/dist/plugins/image/index.js +244 -0
- package/dist/plugins/jsx/LexicalJsxNode.d.ts +54 -0
- package/dist/plugins/jsx/LexicalJsxNode.js +99 -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 +461 -0
- package/dist/plugins/jsx/index.js +37 -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 +108 -0
- package/dist/plugins/link/index.js +24 -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 +496 -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 +14 -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 +521 -0
- package/dist/plugins/lists/index.js +111 -0
- package/dist/plugins/markdown-shortcut/index.d.ts +51 -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 +14 -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 +348 -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 +826 -0
- package/dist/plugins/sandpack/index.js +93 -0
- package/dist/plugins/sandpack/useCodeMirrorRef.d.ts +4 -0
- package/dist/{useCodeMirrorRef-ff0c2781.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/{TableEditor-bb94be2b.js → plugins/table/TableEditor.js} +109 -161
- package/dist/plugins/table/TableNode.d.ts +52 -0
- package/dist/plugins/table/TableNode.js +147 -0
- package/dist/plugins/table/index.d.ts +511 -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 +510 -0
- package/dist/plugins/thematic-break/index.js +39 -0
- package/dist/plugins/toolbar/components/BlockTypeSelect.d.ts +2 -0
- package/dist/plugins/toolbar/components/BlockTypeSelect.js +52 -0
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts +2 -0
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +35 -0
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.d.ts +2 -0
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +30 -0
- package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.d.ts +2 -0
- package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js +32 -0
- package/dist/plugins/toolbar/components/CodeToggle.d.ts +2 -0
- package/dist/plugins/toolbar/components/CodeToggle.js +20 -0
- package/dist/plugins/toolbar/components/CreateLink.d.ts +2 -0
- package/dist/plugins/toolbar/components/CreateLink.js +11 -0
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts +4 -0
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +27 -0
- package/dist/plugins/toolbar/components/InsertAdmonition.d.ts +2 -0
- package/dist/plugins/toolbar/components/InsertAdmonition.js +29 -0
- package/dist/plugins/toolbar/components/InsertCodeBlock.d.ts +2 -0
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +20 -0
- package/dist/plugins/toolbar/components/InsertFrontmatter.d.ts +2 -0
- package/dist/plugins/toolbar/components/InsertFrontmatter.js +11 -0
- package/dist/plugins/toolbar/components/InsertImage.d.ts +2 -0
- package/dist/plugins/toolbar/components/InsertImage.js +23 -0
- package/dist/plugins/toolbar/components/InsertSandpack.d.ts +2 -0
- package/dist/plugins/toolbar/components/InsertSandpack.js +13 -0
- package/dist/plugins/toolbar/components/InsertTable.d.ts +2 -0
- package/dist/plugins/toolbar/components/InsertTable.js +20 -0
- package/dist/plugins/toolbar/components/InsertThematicBreak.d.ts +2 -0
- package/dist/plugins/toolbar/components/InsertThematicBreak.js +11 -0
- package/dist/plugins/toolbar/components/KitchenSinkToolbar.d.ts +2 -0
- package/dist/plugins/toolbar/components/KitchenSinkToolbar.js +58 -0
- package/dist/plugins/toolbar/components/ListsToggle.d.ts +2 -0
- package/dist/plugins/toolbar/components/ListsToggle.js +23 -0
- package/dist/plugins/toolbar/components/ShowSandpackInfo.d.ts +2 -0
- package/dist/plugins/toolbar/components/ShowSandpackInfo.js +32 -0
- package/dist/plugins/toolbar/components/UndoRedo.d.ts +2 -0
- package/dist/plugins/toolbar/components/UndoRedo.js +59 -0
- package/dist/plugins/toolbar/index.d.ts +416 -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 +5 -0
- package/dist/plugins/toolbar/primitives/TooltipWrap.js +12 -0
- package/dist/plugins/toolbar/primitives/select.d.ts +31 -0
- package/dist/plugins/toolbar/primitives/select.js +44 -0
- package/dist/plugins/toolbar/primitives/toolbar.d.ts +85 -0
- package/dist/plugins/toolbar/primitives/toolbar.js +111 -0
- package/dist/style.css +480 -240
- 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 +227 -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 +184 -14
- package/dist/CodeBlockEditor-59b65408.js +0 -78
- package/dist/CodeBlockEditor-5ae8b0a9.cjs +0 -1
- package/dist/FrontmatterEditor-2b27f5a7.js +0 -117
- package/dist/FrontmatterEditor-74ad4eb7.cjs +0 -1
- package/dist/ImageEditor-e5fd6b26.cjs +0 -1
- package/dist/JsxEditor-95724372.cjs +0 -1
- package/dist/JsxEditor-f061cc75.js +0 -108
- package/dist/SandpackEditor-37261889.cjs +0 -1
- package/dist/SandpackEditor-ce901c3c.js +0 -98
- package/dist/SourceEditor-6135bf63.cjs +0 -1
- package/dist/SourceEditor-e499b8bb.js +0 -63
- package/dist/TableEditor-4d00f956.cjs +0 -1
- package/dist/index-383c60bb.cjs +0 -1
- package/dist/index-470693d8.js +0 -4095
- package/dist/index.cjs +0 -1
- package/dist/useCodeMirrorRef-72d8430b.cjs +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const lightTheme = "_light-theme_13nbk_1";
|
|
2
|
+
const darkTheme = "_dark-theme_13nbk_1";
|
|
3
|
+
const bold = "_bold_13nbk_10";
|
|
4
|
+
const italic = "_italic_13nbk_14";
|
|
5
|
+
const underline = "_underline_13nbk_18";
|
|
6
|
+
const strikethrough = "_strikethrough_13nbk_34";
|
|
7
|
+
const underlineStrikethrough = "_underlineStrikethrough_13nbk_38";
|
|
8
|
+
const subscript = "_subscript_13nbk_42";
|
|
9
|
+
const superscript = "_superscript_13nbk_47";
|
|
10
|
+
const code = "_code_13nbk_52";
|
|
11
|
+
const nestedListItem = "_nestedListItem_13nbk_59";
|
|
12
|
+
const admonitionDanger = "_admonitionDanger_13nbk_63";
|
|
13
|
+
const admonitionInfo = "_admonitionInfo_13nbk_63";
|
|
14
|
+
const admonitionNote = "_admonitionNote_13nbk_63";
|
|
15
|
+
const admonitionTip = "_admonitionTip_13nbk_63";
|
|
16
|
+
const admonitionCaution = "_admonitionCaution_13nbk_63";
|
|
17
|
+
const styles = {
|
|
18
|
+
lightTheme,
|
|
19
|
+
darkTheme,
|
|
20
|
+
bold,
|
|
21
|
+
italic,
|
|
22
|
+
underline,
|
|
23
|
+
strikethrough,
|
|
24
|
+
underlineStrikethrough,
|
|
25
|
+
subscript,
|
|
26
|
+
superscript,
|
|
27
|
+
code,
|
|
28
|
+
nestedListItem,
|
|
29
|
+
admonitionDanger,
|
|
30
|
+
admonitionInfo,
|
|
31
|
+
admonitionNote,
|
|
32
|
+
admonitionTip,
|
|
33
|
+
admonitionCaution
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
admonitionCaution,
|
|
37
|
+
admonitionDanger,
|
|
38
|
+
admonitionInfo,
|
|
39
|
+
admonitionNote,
|
|
40
|
+
admonitionTip,
|
|
41
|
+
bold,
|
|
42
|
+
code,
|
|
43
|
+
darkTheme,
|
|
44
|
+
styles as default,
|
|
45
|
+
italic,
|
|
46
|
+
lightTheme,
|
|
47
|
+
nestedListItem,
|
|
48
|
+
strikethrough,
|
|
49
|
+
subscript,
|
|
50
|
+
superscript,
|
|
51
|
+
underline,
|
|
52
|
+
underlineStrikethrough
|
|
53
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import styles from "./lexical-theme.module.css.js";
|
|
2
|
+
const lexicalTheme = {
|
|
3
|
+
text: {
|
|
4
|
+
bold: styles.bold,
|
|
5
|
+
italic: styles.italic,
|
|
6
|
+
underline: styles.underline,
|
|
7
|
+
code: styles.code,
|
|
8
|
+
strikethrough: styles.strikethrough,
|
|
9
|
+
subscript: styles.subscript,
|
|
10
|
+
superscript: styles.superscript,
|
|
11
|
+
underlineStrikethrough: styles.underlineStrikethrough
|
|
12
|
+
},
|
|
13
|
+
list: {
|
|
14
|
+
nested: {
|
|
15
|
+
listitem: styles.nestedListItem
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
admonition: {
|
|
19
|
+
danger: styles.admonitionDanger,
|
|
20
|
+
info: styles.admonitionInfo,
|
|
21
|
+
note: styles.admonitionNote,
|
|
22
|
+
tip: styles.admonitionTip,
|
|
23
|
+
caution: styles.admonitionCaution
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
lexicalTheme
|
|
28
|
+
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
const editorRoot = "_editorRoot_1tl3n_36";
|
|
2
|
+
const dropZone = "_dropZone_1tl3n_129";
|
|
3
|
+
const editorWrapper = "_editorWrapper_1tl3n_137";
|
|
4
|
+
const nestedListItem = "_nestedListItem_1tl3n_141";
|
|
5
|
+
const toolbarRoot = "_toolbarRoot_1tl3n_145";
|
|
6
|
+
const toolbarModeSwitch = "_toolbarModeSwitch_1tl3n_169";
|
|
7
|
+
const toolbarToggleItem = "_toolbarToggleItem_1tl3n_178";
|
|
8
|
+
const toolbarGroupOfGroups = "_toolbarGroupOfGroups_1tl3n_188";
|
|
9
|
+
const toolbarToggleSingleGroup = "_toolbarToggleSingleGroup_1tl3n_193";
|
|
10
|
+
const toolbarButton = "_toolbarButton_1tl3n_207";
|
|
11
|
+
const toolbarNodeKindSelectContainer = "_toolbarNodeKindSelectContainer_1tl3n_241";
|
|
12
|
+
const toolbarButtonDropdownContainer = "_toolbarButtonDropdownContainer_1tl3n_242";
|
|
13
|
+
const toolbarCodeBlockLanguageSelectContent = "_toolbarCodeBlockLanguageSelectContent_1tl3n_243";
|
|
14
|
+
const selectContainer = "_selectContainer_1tl3n_244";
|
|
15
|
+
const toolbarNodeKindSelectTrigger = "_toolbarNodeKindSelectTrigger_1tl3n_258";
|
|
16
|
+
const toolbarButtonSelectTrigger = "_toolbarButtonSelectTrigger_1tl3n_259";
|
|
17
|
+
const selectTrigger = "_selectTrigger_1tl3n_260";
|
|
18
|
+
const toolbarCodeBlockLanguageSelectTrigger = "_toolbarCodeBlockLanguageSelectTrigger_1tl3n_293";
|
|
19
|
+
const toolbarNodeKindSelectItem = "_toolbarNodeKindSelectItem_1tl3n_299";
|
|
20
|
+
const selectItem = "_selectItem_1tl3n_300";
|
|
21
|
+
const toolbarNodeKindSelectDropdownArrow = "_toolbarNodeKindSelectDropdownArrow_1tl3n_324";
|
|
22
|
+
const selectDropdownArrow = "_selectDropdownArrow_1tl3n_325";
|
|
23
|
+
const contentEditable = "_contentEditable_1tl3n_329";
|
|
24
|
+
const sandpackWrapper = "_sandpackWrapper_1tl3n_337";
|
|
25
|
+
const frontmatterWrapper = "_frontmatterWrapper_1tl3n_341";
|
|
26
|
+
const frontmatterToggleButton = "_frontmatterToggleButton_1tl3n_351";
|
|
27
|
+
const propertyPanelTitle = "_propertyPanelTitle_1tl3n_359";
|
|
28
|
+
const propertyEditorTable = "_propertyEditorTable_1tl3n_367";
|
|
29
|
+
const iconButton = "_iconButton_1tl3n_384";
|
|
30
|
+
const readOnlyColumnCell = "_readOnlyColumnCell_1tl3n_389";
|
|
31
|
+
const propertyEditorLabelCell = "_propertyEditorLabelCell_1tl3n_394";
|
|
32
|
+
const buttonsFooter = "_buttonsFooter_1tl3n_402";
|
|
33
|
+
const propertyEditorInput = "_propertyEditorInput_1tl3n_408";
|
|
34
|
+
const primaryButton = "_primaryButton_1tl3n_423";
|
|
35
|
+
const secondaryButton = "_secondaryButton_1tl3n_423";
|
|
36
|
+
const linkDialogEditForm = "_linkDialogEditForm_1tl3n_439";
|
|
37
|
+
const linkDialogInputContainer = "_linkDialogInputContainer_1tl3n_445";
|
|
38
|
+
const linkDialogInputWrapper = "_linkDialogInputWrapper_1tl3n_451";
|
|
39
|
+
const linkDialogInput = "_linkDialogInput_1tl3n_445";
|
|
40
|
+
const linkDialogAutocompleteContainer = "_linkDialogAutocompleteContainer_1tl3n_481";
|
|
41
|
+
const linkDialogAnchor = "_linkDialogAnchor_1tl3n_526";
|
|
42
|
+
const linkDialogPopoverContent = "_linkDialogPopoverContent_1tl3n_540";
|
|
43
|
+
const tableColumnEditorPopoverContent = "_tableColumnEditorPopoverContent_1tl3n_540";
|
|
44
|
+
const dialogContent = "_dialogContent_1tl3n_540";
|
|
45
|
+
const popoverContent = "_popoverContent_1tl3n_552";
|
|
46
|
+
const popoverArrow = "_popoverArrow_1tl3n_563";
|
|
47
|
+
const linkDialogPreviewAnchor = "_linkDialogPreviewAnchor_1tl3n_569";
|
|
48
|
+
const tooltipContent = "_tooltipContent_1tl3n_591";
|
|
49
|
+
const actionButton = "_actionButton_1tl3n_605";
|
|
50
|
+
const primaryActionButton = "_primaryActionButton_1tl3n_611";
|
|
51
|
+
const tableEditor = "_tableEditor_1tl3n_620";
|
|
52
|
+
const toolCell = "_toolCell_1tl3n_631";
|
|
53
|
+
const tableColumnEditorTrigger = "_tableColumnEditorTrigger_1tl3n_648";
|
|
54
|
+
const tableRowEditorTrigger = "_tableRowEditorTrigger_1tl3n_648";
|
|
55
|
+
const addRowButton = "_addRowButton_1tl3n_648";
|
|
56
|
+
const addColumnButton = "_addColumnButton_1tl3n_648";
|
|
57
|
+
const tableColumnEditorToolbar = "_tableColumnEditorToolbar_1tl3n_682";
|
|
58
|
+
const toggleGroupRoot = "_toggleGroupRoot_1tl3n_694";
|
|
59
|
+
const tableToolsColumn = "_tableToolsColumn_1tl3n_711";
|
|
60
|
+
const leftAlignedCell = "_leftAlignedCell_1tl3n_719";
|
|
61
|
+
const rightAlignedCell = "_rightAlignedCell_1tl3n_723";
|
|
62
|
+
const centeredCell = "_centeredCell_1tl3n_727";
|
|
63
|
+
const dialogOverlay = "_dialogOverlay_1tl3n_755";
|
|
64
|
+
const overlayShow = "_overlayShow_1tl3n_1";
|
|
65
|
+
const contentShow = "_contentShow_1tl3n_1";
|
|
66
|
+
const focusedImage = "_focusedImage_1tl3n_797";
|
|
67
|
+
const imageWrapper = "_imageWrapper_1tl3n_801";
|
|
68
|
+
const inlineEditor = "_inlineEditor_1tl3n_812";
|
|
69
|
+
const blockEditor = "_blockEditor_1tl3n_821";
|
|
70
|
+
const nestedEditor = "_nestedEditor_1tl3n_830";
|
|
71
|
+
const genericComponentName = "_genericComponentName_1tl3n_847";
|
|
72
|
+
const diffSourceToggle = "_diffSourceToggle_1tl3n_853";
|
|
73
|
+
const selectWithLabel = "_selectWithLabel_1tl3n_867";
|
|
74
|
+
const toolbarTitleMode = "_toolbarTitleMode_1tl3n_881";
|
|
75
|
+
const styles = {
|
|
76
|
+
editorRoot,
|
|
77
|
+
dropZone,
|
|
78
|
+
editorWrapper,
|
|
79
|
+
nestedListItem,
|
|
80
|
+
toolbarRoot,
|
|
81
|
+
toolbarModeSwitch,
|
|
82
|
+
toolbarToggleItem,
|
|
83
|
+
toolbarGroupOfGroups,
|
|
84
|
+
toolbarToggleSingleGroup,
|
|
85
|
+
toolbarButton,
|
|
86
|
+
toolbarNodeKindSelectContainer,
|
|
87
|
+
toolbarButtonDropdownContainer,
|
|
88
|
+
toolbarCodeBlockLanguageSelectContent,
|
|
89
|
+
selectContainer,
|
|
90
|
+
toolbarNodeKindSelectTrigger,
|
|
91
|
+
toolbarButtonSelectTrigger,
|
|
92
|
+
selectTrigger,
|
|
93
|
+
toolbarCodeBlockLanguageSelectTrigger,
|
|
94
|
+
toolbarNodeKindSelectItem,
|
|
95
|
+
selectItem,
|
|
96
|
+
toolbarNodeKindSelectDropdownArrow,
|
|
97
|
+
selectDropdownArrow,
|
|
98
|
+
contentEditable,
|
|
99
|
+
sandpackWrapper,
|
|
100
|
+
frontmatterWrapper,
|
|
101
|
+
frontmatterToggleButton,
|
|
102
|
+
propertyPanelTitle,
|
|
103
|
+
propertyEditorTable,
|
|
104
|
+
iconButton,
|
|
105
|
+
readOnlyColumnCell,
|
|
106
|
+
propertyEditorLabelCell,
|
|
107
|
+
buttonsFooter,
|
|
108
|
+
propertyEditorInput,
|
|
109
|
+
primaryButton,
|
|
110
|
+
secondaryButton,
|
|
111
|
+
linkDialogEditForm,
|
|
112
|
+
linkDialogInputContainer,
|
|
113
|
+
linkDialogInputWrapper,
|
|
114
|
+
linkDialogInput,
|
|
115
|
+
linkDialogAutocompleteContainer,
|
|
116
|
+
linkDialogAnchor,
|
|
117
|
+
linkDialogPopoverContent,
|
|
118
|
+
tableColumnEditorPopoverContent,
|
|
119
|
+
dialogContent,
|
|
120
|
+
popoverContent,
|
|
121
|
+
popoverArrow,
|
|
122
|
+
linkDialogPreviewAnchor,
|
|
123
|
+
tooltipContent,
|
|
124
|
+
actionButton,
|
|
125
|
+
primaryActionButton,
|
|
126
|
+
tableEditor,
|
|
127
|
+
toolCell,
|
|
128
|
+
tableColumnEditorTrigger,
|
|
129
|
+
tableRowEditorTrigger,
|
|
130
|
+
addRowButton,
|
|
131
|
+
addColumnButton,
|
|
132
|
+
tableColumnEditorToolbar,
|
|
133
|
+
toggleGroupRoot,
|
|
134
|
+
tableToolsColumn,
|
|
135
|
+
leftAlignedCell,
|
|
136
|
+
rightAlignedCell,
|
|
137
|
+
centeredCell,
|
|
138
|
+
dialogOverlay,
|
|
139
|
+
overlayShow,
|
|
140
|
+
contentShow,
|
|
141
|
+
focusedImage,
|
|
142
|
+
imageWrapper,
|
|
143
|
+
inlineEditor,
|
|
144
|
+
blockEditor,
|
|
145
|
+
nestedEditor,
|
|
146
|
+
genericComponentName,
|
|
147
|
+
diffSourceToggle,
|
|
148
|
+
selectWithLabel,
|
|
149
|
+
toolbarTitleMode
|
|
150
|
+
};
|
|
151
|
+
export {
|
|
152
|
+
actionButton,
|
|
153
|
+
addColumnButton,
|
|
154
|
+
addRowButton,
|
|
155
|
+
blockEditor,
|
|
156
|
+
buttonsFooter,
|
|
157
|
+
centeredCell,
|
|
158
|
+
contentEditable,
|
|
159
|
+
contentShow,
|
|
160
|
+
styles as default,
|
|
161
|
+
dialogContent,
|
|
162
|
+
dialogOverlay,
|
|
163
|
+
diffSourceToggle,
|
|
164
|
+
dropZone,
|
|
165
|
+
editorRoot,
|
|
166
|
+
editorWrapper,
|
|
167
|
+
focusedImage,
|
|
168
|
+
frontmatterToggleButton,
|
|
169
|
+
frontmatterWrapper,
|
|
170
|
+
genericComponentName,
|
|
171
|
+
iconButton,
|
|
172
|
+
imageWrapper,
|
|
173
|
+
inlineEditor,
|
|
174
|
+
leftAlignedCell,
|
|
175
|
+
linkDialogAnchor,
|
|
176
|
+
linkDialogAutocompleteContainer,
|
|
177
|
+
linkDialogEditForm,
|
|
178
|
+
linkDialogInput,
|
|
179
|
+
linkDialogInputContainer,
|
|
180
|
+
linkDialogInputWrapper,
|
|
181
|
+
linkDialogPopoverContent,
|
|
182
|
+
linkDialogPreviewAnchor,
|
|
183
|
+
nestedEditor,
|
|
184
|
+
nestedListItem,
|
|
185
|
+
overlayShow,
|
|
186
|
+
popoverArrow,
|
|
187
|
+
popoverContent,
|
|
188
|
+
primaryActionButton,
|
|
189
|
+
primaryButton,
|
|
190
|
+
propertyEditorInput,
|
|
191
|
+
propertyEditorLabelCell,
|
|
192
|
+
propertyEditorTable,
|
|
193
|
+
propertyPanelTitle,
|
|
194
|
+
readOnlyColumnCell,
|
|
195
|
+
rightAlignedCell,
|
|
196
|
+
sandpackWrapper,
|
|
197
|
+
secondaryButton,
|
|
198
|
+
selectContainer,
|
|
199
|
+
selectDropdownArrow,
|
|
200
|
+
selectItem,
|
|
201
|
+
selectTrigger,
|
|
202
|
+
selectWithLabel,
|
|
203
|
+
tableColumnEditorPopoverContent,
|
|
204
|
+
tableColumnEditorToolbar,
|
|
205
|
+
tableColumnEditorTrigger,
|
|
206
|
+
tableEditor,
|
|
207
|
+
tableRowEditorTrigger,
|
|
208
|
+
tableToolsColumn,
|
|
209
|
+
toggleGroupRoot,
|
|
210
|
+
toolCell,
|
|
211
|
+
toolbarButton,
|
|
212
|
+
toolbarButtonDropdownContainer,
|
|
213
|
+
toolbarButtonSelectTrigger,
|
|
214
|
+
toolbarCodeBlockLanguageSelectContent,
|
|
215
|
+
toolbarCodeBlockLanguageSelectTrigger,
|
|
216
|
+
toolbarGroupOfGroups,
|
|
217
|
+
toolbarModeSwitch,
|
|
218
|
+
toolbarNodeKindSelectContainer,
|
|
219
|
+
toolbarNodeKindSelectDropdownArrow,
|
|
220
|
+
toolbarNodeKindSelectItem,
|
|
221
|
+
toolbarNodeKindSelectTrigger,
|
|
222
|
+
toolbarRoot,
|
|
223
|
+
toolbarTitleMode,
|
|
224
|
+
toolbarToggleItem,
|
|
225
|
+
toolbarToggleSingleGroup,
|
|
226
|
+
tooltipContent
|
|
227
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const CAN_USE_DOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
2
|
+
const IS_APPLE = CAN_USE_DOM && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
3
|
+
export {
|
|
4
|
+
CAN_USE_DOM,
|
|
5
|
+
IS_APPLE
|
|
6
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utils includes a handful of functional utilities inspired by or taken from the [Ramda library](https://ramdajs.com/);
|
|
3
|
+
* Use these for your convenience - they are here so that urx is zero-dependency package.
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
/** @internal */
|
|
7
|
+
export interface Proc {
|
|
8
|
+
(): unknown;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Performs left to right composition of two functions.
|
|
12
|
+
*/
|
|
13
|
+
export declare function compose<I, A, R>(a: (arg: A) => R, b: (arg: I) => A): (arg: I) => R;
|
|
14
|
+
/**
|
|
15
|
+
* Takes a value and applies a function to it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function thrush<I, K>(arg: I, proc: (arg: I) => K): K;
|
|
18
|
+
/**
|
|
19
|
+
* Takes a 2 argument function and partially applies the first argument.
|
|
20
|
+
*/
|
|
21
|
+
export declare function curry2to1<T, K, R>(proc: (arg1: T, arg2: K) => R, arg1: T): (arg2: K) => R;
|
|
22
|
+
/**
|
|
23
|
+
* Takes a 1 argument function and returns a function which when called, executes it with the provided argument.
|
|
24
|
+
*/
|
|
25
|
+
export declare function curry1to0<T, R>(proc: (arg: T) => R, arg: T): () => R;
|
|
26
|
+
/**
|
|
27
|
+
* Returns a function which extracts the property from from the passed object.
|
|
28
|
+
*/
|
|
29
|
+
export declare function prop<T extends Record<string, unknown>>(property: keyof T): (object: T) => T[keyof T];
|
|
30
|
+
/**
|
|
31
|
+
* Calls callback with the first argument, and returns it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function tap<T>(arg: T, proc: (arg: T) => unknown): T;
|
|
34
|
+
/**
|
|
35
|
+
* Calls the passed function.
|
|
36
|
+
*/
|
|
37
|
+
export declare function call(proc: Proc): void;
|
|
38
|
+
/**
|
|
39
|
+
* returns a function which when called always returns the passed value
|
|
40
|
+
*/
|
|
41
|
+
export declare function always<T>(value: T): () => T;
|
|
42
|
+
/**
|
|
43
|
+
* returns a function which calls all passed functions in the passed order.
|
|
44
|
+
* joinProc does not pass arguments or collect return values.
|
|
45
|
+
*/
|
|
46
|
+
export declare function joinProc(...procs: Proc[]): () => void;
|
|
47
|
+
export declare function noop(): void;
|
package/dist/utils/fp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isPartOftheEditorUI(element: HTMLElement | null, editorRoot: HTMLElement): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function isPartOftheEditorUI(element, editorRoot) {
|
|
2
|
+
if (element === null || element === editorRoot) {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
if (element.dataset["editorDialog"] !== void 0 || element.dataset["toolbarItem"] !== void 0 || element.dataset["editorDropdown"]) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
return isPartOftheEditorUI(element.parentElement, editorRoot);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
isPartOftheEditorUI
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementNode, LexicalEditor, RangeSelection, TextNode } from 'lexical';
|
|
2
|
+
import { ExportMarkdownFromLexicalOptions } from '../exportMarkdownFromLexical';
|
|
3
|
+
export declare function fromWithinEditorRead<T>(editor: LexicalEditor, fn: () => T): T;
|
|
4
|
+
export declare function getSelectedNode(selection: RangeSelection): TextNode | ElementNode;
|
|
5
|
+
export declare function getSelectionRectangle(editor: LexicalEditor): {
|
|
6
|
+
top: number;
|
|
7
|
+
left: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
} | null;
|
|
11
|
+
export declare function getStateAsMarkdown(editor: LexicalEditor, exportParams: Omit<ExportMarkdownFromLexicalOptions, 'root'>): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { $getSelection } from "lexical";
|
|
2
|
+
import { $isAtNodeEnd } from "@lexical/selection";
|
|
3
|
+
function getSelectedNode(selection) {
|
|
4
|
+
const anchor = selection.anchor;
|
|
5
|
+
const focus = selection.focus;
|
|
6
|
+
const anchorNode = selection.anchor.getNode();
|
|
7
|
+
const focusNode = selection.focus.getNode();
|
|
8
|
+
if (anchorNode === focusNode) {
|
|
9
|
+
return anchorNode;
|
|
10
|
+
}
|
|
11
|
+
const isBackward = selection.isBackward();
|
|
12
|
+
if (isBackward) {
|
|
13
|
+
return $isAtNodeEnd(focus) ? anchorNode : focusNode;
|
|
14
|
+
} else {
|
|
15
|
+
return $isAtNodeEnd(anchor) ? anchorNode : focusNode;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function getSelectionRectangle(editor) {
|
|
19
|
+
const selection = $getSelection();
|
|
20
|
+
const nativeSelection = window.getSelection();
|
|
21
|
+
const activeElement = document.activeElement;
|
|
22
|
+
const rootElement = editor.getRootElement();
|
|
23
|
+
if (selection !== null && nativeSelection !== null && rootElement !== null && rootElement.contains(nativeSelection.anchorNode) && editor.isEditable()) {
|
|
24
|
+
const domRange = nativeSelection.getRangeAt(0);
|
|
25
|
+
let rect;
|
|
26
|
+
if (nativeSelection.anchorNode === rootElement) {
|
|
27
|
+
let inner = rootElement;
|
|
28
|
+
while (inner.firstElementChild != null) {
|
|
29
|
+
inner = inner.firstElementChild;
|
|
30
|
+
}
|
|
31
|
+
rect = inner.getBoundingClientRect();
|
|
32
|
+
} else {
|
|
33
|
+
rect = domRange.getBoundingClientRect();
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
top: rect.top + window.scrollY,
|
|
37
|
+
left: rect.left + window.scrollX,
|
|
38
|
+
width: rect.width,
|
|
39
|
+
height: rect.height
|
|
40
|
+
};
|
|
41
|
+
} else if (!activeElement || activeElement.className !== "link-input") {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
getSelectedNode,
|
|
48
|
+
getSelectionRectangle
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uuidv4(): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function uuidv4() {
|
|
2
|
+
const hex = [...Array(256).keys()].map((index) => index.toString(16).padStart(2, "0"));
|
|
3
|
+
const r = crypto.getRandomValues(new Uint8Array(16));
|
|
4
|
+
r[6] = r[6] & 15 | 64;
|
|
5
|
+
r[8] = r[8] & 63 | 128;
|
|
6
|
+
return [...r.entries()].map(([index, int]) => [4, 6, 8, 10].includes(index) ? `-${hex[int]}` : hex[int]).join("");
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
uuidv4
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An emitter object that has a single subscription that will be executed.
|
|
3
|
+
* The construct is used so that the lexical nodes can focus their React component editors.
|
|
4
|
+
*/
|
|
5
|
+
export type VoidEmitter = {
|
|
6
|
+
/**
|
|
7
|
+
* Subscribes to the emitter event
|
|
8
|
+
*/
|
|
9
|
+
subscribe: (cb: () => void) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function voidEmitter(): {
|
|
12
|
+
publish: () => void;
|
|
13
|
+
subscribe: (cb: () => void) => void;
|
|
14
|
+
};
|