@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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const lightTheme = "_light-theme_7hn0e_1";
|
|
2
|
+
const darkTheme = "_dark-theme_7hn0e_1";
|
|
3
|
+
const bold = "_bold_7hn0e_10";
|
|
4
|
+
const italic = "_italic_7hn0e_14";
|
|
5
|
+
const underline = "_underline_7hn0e_18";
|
|
6
|
+
const strikethrough = "_strikethrough_7hn0e_34";
|
|
7
|
+
const underlineStrikethrough = "_underlineStrikethrough_7hn0e_38";
|
|
8
|
+
const subscript = "_subscript_7hn0e_42";
|
|
9
|
+
const superscript = "_superscript_7hn0e_47";
|
|
10
|
+
const code = "_code_7hn0e_52";
|
|
11
|
+
const nestedListItem = "_nestedListItem_7hn0e_59";
|
|
12
|
+
const listitem = "_listitem_7hn0e_69";
|
|
13
|
+
const listItemChecked = "_listItemChecked_7hn0e_73";
|
|
14
|
+
const listItemUnchecked = "_listItemUnchecked_7hn0e_74";
|
|
15
|
+
const admonitionDanger = "_admonitionDanger_7hn0e_151";
|
|
16
|
+
const admonitionInfo = "_admonitionInfo_7hn0e_151";
|
|
17
|
+
const admonitionNote = "_admonitionNote_7hn0e_151";
|
|
18
|
+
const admonitionTip = "_admonitionTip_7hn0e_151";
|
|
19
|
+
const admonitionCaution = "_admonitionCaution_7hn0e_151";
|
|
20
|
+
const styles = {
|
|
21
|
+
lightTheme,
|
|
22
|
+
darkTheme,
|
|
23
|
+
bold,
|
|
24
|
+
italic,
|
|
25
|
+
underline,
|
|
26
|
+
strikethrough,
|
|
27
|
+
underlineStrikethrough,
|
|
28
|
+
subscript,
|
|
29
|
+
superscript,
|
|
30
|
+
code,
|
|
31
|
+
nestedListItem,
|
|
32
|
+
listitem,
|
|
33
|
+
listItemChecked,
|
|
34
|
+
listItemUnchecked,
|
|
35
|
+
admonitionDanger,
|
|
36
|
+
admonitionInfo,
|
|
37
|
+
admonitionNote,
|
|
38
|
+
admonitionTip,
|
|
39
|
+
admonitionCaution
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
admonitionCaution,
|
|
43
|
+
admonitionDanger,
|
|
44
|
+
admonitionInfo,
|
|
45
|
+
admonitionNote,
|
|
46
|
+
admonitionTip,
|
|
47
|
+
bold,
|
|
48
|
+
code,
|
|
49
|
+
darkTheme,
|
|
50
|
+
styles as default,
|
|
51
|
+
italic,
|
|
52
|
+
lightTheme,
|
|
53
|
+
listItemChecked,
|
|
54
|
+
listItemUnchecked,
|
|
55
|
+
listitem,
|
|
56
|
+
nestedListItem,
|
|
57
|
+
strikethrough,
|
|
58
|
+
subscript,
|
|
59
|
+
superscript,
|
|
60
|
+
underline,
|
|
61
|
+
underlineStrikethrough
|
|
62
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
listitem: styles.listitem,
|
|
15
|
+
listitemChecked: styles.listItemChecked,
|
|
16
|
+
listitemUnchecked: styles.listItemUnchecked,
|
|
17
|
+
nested: {
|
|
18
|
+
listitem: styles.nestedListItem
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
admonition: {
|
|
22
|
+
danger: styles.admonitionDanger,
|
|
23
|
+
info: styles.admonitionInfo,
|
|
24
|
+
note: styles.admonitionNote,
|
|
25
|
+
tip: styles.admonitionTip,
|
|
26
|
+
caution: styles.admonitionCaution
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
lexicalTheme
|
|
31
|
+
};
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
const editorRoot = "_editorRoot_1qeio_37";
|
|
2
|
+
const editorWrapper = "_editorWrapper_1qeio_138";
|
|
3
|
+
const nestedListItem = "_nestedListItem_1qeio_141";
|
|
4
|
+
const toolbarRoot = "_toolbarRoot_1qeio_145";
|
|
5
|
+
const readOnlyToolbarRoot = "_readOnlyToolbarRoot_1qeio_168";
|
|
6
|
+
const toolbarModeSwitch = "_toolbarModeSwitch_1qeio_176";
|
|
7
|
+
const toolbarToggleItem = "_toolbarToggleItem_1qeio_186";
|
|
8
|
+
const toolbarGroupOfGroups = "_toolbarGroupOfGroups_1qeio_196";
|
|
9
|
+
const toolbarToggleSingleGroup = "_toolbarToggleSingleGroup_1qeio_201";
|
|
10
|
+
const toolbarButton = "_toolbarButton_1qeio_215";
|
|
11
|
+
const activeToolbarButton = "_activeToolbarButton_1qeio_246";
|
|
12
|
+
const toolbarNodeKindSelectContainer = "_toolbarNodeKindSelectContainer_1qeio_254";
|
|
13
|
+
const toolbarButtonDropdownContainer = "_toolbarButtonDropdownContainer_1qeio_255";
|
|
14
|
+
const toolbarCodeBlockLanguageSelectContent = "_toolbarCodeBlockLanguageSelectContent_1qeio_256";
|
|
15
|
+
const selectContainer = "_selectContainer_1qeio_257";
|
|
16
|
+
const selectItem = "_selectItem_1qeio_271";
|
|
17
|
+
const toolbarNodeKindSelectTrigger = "_toolbarNodeKindSelectTrigger_1qeio_276";
|
|
18
|
+
const toolbarButtonSelectTrigger = "_toolbarButtonSelectTrigger_1qeio_277";
|
|
19
|
+
const selectTrigger = "_selectTrigger_1qeio_278";
|
|
20
|
+
const toolbarCodeBlockLanguageSelectTrigger = "_toolbarCodeBlockLanguageSelectTrigger_1qeio_312";
|
|
21
|
+
const toolbarNodeKindSelectItem = "_toolbarNodeKindSelectItem_1qeio_318";
|
|
22
|
+
const toolbarNodeKindSelectDropdownArrow = "_toolbarNodeKindSelectDropdownArrow_1qeio_344";
|
|
23
|
+
const selectDropdownArrow = "_selectDropdownArrow_1qeio_345";
|
|
24
|
+
const contentEditable = "_contentEditable_1qeio_351";
|
|
25
|
+
const sandpackWrapper = "_sandpackWrapper_1qeio_361";
|
|
26
|
+
const frontmatterWrapper = "_frontmatterWrapper_1qeio_365";
|
|
27
|
+
const frontmatterToggleButton = "_frontmatterToggleButton_1qeio_375";
|
|
28
|
+
const propertyPanelTitle = "_propertyPanelTitle_1qeio_383";
|
|
29
|
+
const propertyEditorTable = "_propertyEditorTable_1qeio_391";
|
|
30
|
+
const iconButton = "_iconButton_1qeio_408";
|
|
31
|
+
const readOnlyColumnCell = "_readOnlyColumnCell_1qeio_413";
|
|
32
|
+
const propertyEditorLabelCell = "_propertyEditorLabelCell_1qeio_418";
|
|
33
|
+
const buttonsFooter = "_buttonsFooter_1qeio_426";
|
|
34
|
+
const propertyEditorInput = "_propertyEditorInput_1qeio_432";
|
|
35
|
+
const primaryButton = "_primaryButton_1qeio_453";
|
|
36
|
+
const secondaryButton = "_secondaryButton_1qeio_453";
|
|
37
|
+
const smallButton = "_smallButton_1qeio_467";
|
|
38
|
+
const dialogForm = "_dialogForm_1qeio_479";
|
|
39
|
+
const linkDialogEditForm = "_linkDialogEditForm_1qeio_485";
|
|
40
|
+
const linkDialogInputContainer = "_linkDialogInputContainer_1qeio_493";
|
|
41
|
+
const linkDialogInputWrapper = "_linkDialogInputWrapper_1qeio_499";
|
|
42
|
+
const linkDialogInput = "_linkDialogInput_1qeio_493";
|
|
43
|
+
const dialogInput = "_dialogInput_1qeio_519";
|
|
44
|
+
const linkDialogAnchor = "_linkDialogAnchor_1qeio_529";
|
|
45
|
+
const linkDialogPopoverContent = "_linkDialogPopoverContent_1qeio_543";
|
|
46
|
+
const tableColumnEditorPopoverContent = "_tableColumnEditorPopoverContent_1qeio_543";
|
|
47
|
+
const dialogContent = "_dialogContent_1qeio_543";
|
|
48
|
+
const largeDialogContent = "_largeDialogContent_1qeio_555";
|
|
49
|
+
const dialogTitle = "_dialogTitle_1qeio_565";
|
|
50
|
+
const dialogCloseButton = "_dialogCloseButton_1qeio_571";
|
|
51
|
+
const popoverContent = "_popoverContent_1qeio_578";
|
|
52
|
+
const popoverArrow = "_popoverArrow_1qeio_590";
|
|
53
|
+
const linkDialogPreviewAnchor = "_linkDialogPreviewAnchor_1qeio_594";
|
|
54
|
+
const tooltipTrigger = "_tooltipTrigger_1qeio_615";
|
|
55
|
+
const tooltipContent = "_tooltipContent_1qeio_619";
|
|
56
|
+
const actionButton = "_actionButton_1qeio_633";
|
|
57
|
+
const primaryActionButton = "_primaryActionButton_1qeio_639";
|
|
58
|
+
const tableEditor = "_tableEditor_1qeio_648";
|
|
59
|
+
const toolCell = "_toolCell_1qeio_659";
|
|
60
|
+
const tableColumnEditorTrigger = "_tableColumnEditorTrigger_1qeio_676";
|
|
61
|
+
const tableRowEditorTrigger = "_tableRowEditorTrigger_1qeio_676";
|
|
62
|
+
const addRowButton = "_addRowButton_1qeio_676";
|
|
63
|
+
const addColumnButton = "_addColumnButton_1qeio_676";
|
|
64
|
+
const tableColumnEditorToolbar = "_tableColumnEditorToolbar_1qeio_710";
|
|
65
|
+
const toggleGroupRoot = "_toggleGroupRoot_1qeio_723";
|
|
66
|
+
const tableToolsColumn = "_tableToolsColumn_1qeio_740";
|
|
67
|
+
const leftAlignedCell = "_leftAlignedCell_1qeio_748";
|
|
68
|
+
const rightAlignedCell = "_rightAlignedCell_1qeio_752";
|
|
69
|
+
const centeredCell = "_centeredCell_1qeio_756";
|
|
70
|
+
const dialogOverlay = "_dialogOverlay_1qeio_787";
|
|
71
|
+
const overlayShow = "_overlayShow_1qeio_1";
|
|
72
|
+
const contentShow = "_contentShow_1qeio_1";
|
|
73
|
+
const focusedImage = "_focusedImage_1qeio_830";
|
|
74
|
+
const imageWrapper = "_imageWrapper_1qeio_834";
|
|
75
|
+
const editImageButton = "_editImageButton_1qeio_846";
|
|
76
|
+
const inlineEditor = "_inlineEditor_1qeio_858";
|
|
77
|
+
const blockEditor = "_blockEditor_1qeio_867";
|
|
78
|
+
const nestedEditor = "_nestedEditor_1qeio_876";
|
|
79
|
+
const genericComponentName = "_genericComponentName_1qeio_893";
|
|
80
|
+
const diffSourceToggle = "_diffSourceToggle_1qeio_899";
|
|
81
|
+
const selectWithLabel = "_selectWithLabel_1qeio_912";
|
|
82
|
+
const toolbarTitleMode = "_toolbarTitleMode_1qeio_926";
|
|
83
|
+
const imageControlWrapperResizing = "_imageControlWrapperResizing_1qeio_932";
|
|
84
|
+
const imageResizer = "_imageResizer_1qeio_936";
|
|
85
|
+
const imageResizerN = "_imageResizerN_1qeio_945";
|
|
86
|
+
const imageResizerNe = "_imageResizerNe_1qeio_951";
|
|
87
|
+
const imageResizerE = "_imageResizerE_1qeio_957";
|
|
88
|
+
const imageResizerSe = "_imageResizerSe_1qeio_963";
|
|
89
|
+
const imageResizerS = "_imageResizerS_1qeio_963";
|
|
90
|
+
const imageResizerSw = "_imageResizerSw_1qeio_975";
|
|
91
|
+
const imageResizerW = "_imageResizerW_1qeio_981";
|
|
92
|
+
const imageResizerNw = "_imageResizerNw_1qeio_987";
|
|
93
|
+
const placeholder = "_placeholder_1qeio_993";
|
|
94
|
+
const rootContentEditableWrapper = "_rootContentEditableWrapper_1qeio_1006";
|
|
95
|
+
const downshiftContainer = "_downshiftContainer_1qeio_1012";
|
|
96
|
+
const downshiftInputWrapper = "_downshiftInputWrapper_1qeio_1018";
|
|
97
|
+
const downshiftInput = "_downshiftInput_1qeio_1018";
|
|
98
|
+
const downshiftAutocompleteContainer = "_downshiftAutocompleteContainer_1qeio_1048";
|
|
99
|
+
const textInput = "_textInput_1qeio_1093";
|
|
100
|
+
const multiFieldForm = "_multiFieldForm_1qeio_1101";
|
|
101
|
+
const formField = "_formField_1qeio_1107";
|
|
102
|
+
const markdownParseError = "_markdownParseError_1qeio_1118";
|
|
103
|
+
const styles = {
|
|
104
|
+
editorRoot,
|
|
105
|
+
editorWrapper,
|
|
106
|
+
nestedListItem,
|
|
107
|
+
toolbarRoot,
|
|
108
|
+
readOnlyToolbarRoot,
|
|
109
|
+
toolbarModeSwitch,
|
|
110
|
+
toolbarToggleItem,
|
|
111
|
+
toolbarGroupOfGroups,
|
|
112
|
+
toolbarToggleSingleGroup,
|
|
113
|
+
toolbarButton,
|
|
114
|
+
activeToolbarButton,
|
|
115
|
+
toolbarNodeKindSelectContainer,
|
|
116
|
+
toolbarButtonDropdownContainer,
|
|
117
|
+
toolbarCodeBlockLanguageSelectContent,
|
|
118
|
+
selectContainer,
|
|
119
|
+
selectItem,
|
|
120
|
+
toolbarNodeKindSelectTrigger,
|
|
121
|
+
toolbarButtonSelectTrigger,
|
|
122
|
+
selectTrigger,
|
|
123
|
+
toolbarCodeBlockLanguageSelectTrigger,
|
|
124
|
+
toolbarNodeKindSelectItem,
|
|
125
|
+
toolbarNodeKindSelectDropdownArrow,
|
|
126
|
+
selectDropdownArrow,
|
|
127
|
+
contentEditable,
|
|
128
|
+
sandpackWrapper,
|
|
129
|
+
frontmatterWrapper,
|
|
130
|
+
frontmatterToggleButton,
|
|
131
|
+
propertyPanelTitle,
|
|
132
|
+
propertyEditorTable,
|
|
133
|
+
iconButton,
|
|
134
|
+
readOnlyColumnCell,
|
|
135
|
+
propertyEditorLabelCell,
|
|
136
|
+
buttonsFooter,
|
|
137
|
+
propertyEditorInput,
|
|
138
|
+
primaryButton,
|
|
139
|
+
secondaryButton,
|
|
140
|
+
smallButton,
|
|
141
|
+
dialogForm,
|
|
142
|
+
linkDialogEditForm,
|
|
143
|
+
linkDialogInputContainer,
|
|
144
|
+
linkDialogInputWrapper,
|
|
145
|
+
linkDialogInput,
|
|
146
|
+
dialogInput,
|
|
147
|
+
linkDialogAnchor,
|
|
148
|
+
linkDialogPopoverContent,
|
|
149
|
+
tableColumnEditorPopoverContent,
|
|
150
|
+
dialogContent,
|
|
151
|
+
largeDialogContent,
|
|
152
|
+
dialogTitle,
|
|
153
|
+
dialogCloseButton,
|
|
154
|
+
popoverContent,
|
|
155
|
+
popoverArrow,
|
|
156
|
+
linkDialogPreviewAnchor,
|
|
157
|
+
tooltipTrigger,
|
|
158
|
+
tooltipContent,
|
|
159
|
+
actionButton,
|
|
160
|
+
primaryActionButton,
|
|
161
|
+
tableEditor,
|
|
162
|
+
toolCell,
|
|
163
|
+
tableColumnEditorTrigger,
|
|
164
|
+
tableRowEditorTrigger,
|
|
165
|
+
addRowButton,
|
|
166
|
+
addColumnButton,
|
|
167
|
+
tableColumnEditorToolbar,
|
|
168
|
+
toggleGroupRoot,
|
|
169
|
+
tableToolsColumn,
|
|
170
|
+
leftAlignedCell,
|
|
171
|
+
rightAlignedCell,
|
|
172
|
+
centeredCell,
|
|
173
|
+
dialogOverlay,
|
|
174
|
+
overlayShow,
|
|
175
|
+
contentShow,
|
|
176
|
+
focusedImage,
|
|
177
|
+
imageWrapper,
|
|
178
|
+
editImageButton,
|
|
179
|
+
inlineEditor,
|
|
180
|
+
blockEditor,
|
|
181
|
+
nestedEditor,
|
|
182
|
+
genericComponentName,
|
|
183
|
+
diffSourceToggle,
|
|
184
|
+
selectWithLabel,
|
|
185
|
+
toolbarTitleMode,
|
|
186
|
+
imageControlWrapperResizing,
|
|
187
|
+
imageResizer,
|
|
188
|
+
imageResizerN,
|
|
189
|
+
imageResizerNe,
|
|
190
|
+
imageResizerE,
|
|
191
|
+
imageResizerSe,
|
|
192
|
+
imageResizerS,
|
|
193
|
+
imageResizerSw,
|
|
194
|
+
imageResizerW,
|
|
195
|
+
imageResizerNw,
|
|
196
|
+
placeholder,
|
|
197
|
+
rootContentEditableWrapper,
|
|
198
|
+
downshiftContainer,
|
|
199
|
+
downshiftInputWrapper,
|
|
200
|
+
downshiftInput,
|
|
201
|
+
downshiftAutocompleteContainer,
|
|
202
|
+
textInput,
|
|
203
|
+
multiFieldForm,
|
|
204
|
+
formField,
|
|
205
|
+
markdownParseError
|
|
206
|
+
};
|
|
207
|
+
export {
|
|
208
|
+
actionButton,
|
|
209
|
+
activeToolbarButton,
|
|
210
|
+
addColumnButton,
|
|
211
|
+
addRowButton,
|
|
212
|
+
blockEditor,
|
|
213
|
+
buttonsFooter,
|
|
214
|
+
centeredCell,
|
|
215
|
+
contentEditable,
|
|
216
|
+
contentShow,
|
|
217
|
+
styles as default,
|
|
218
|
+
dialogCloseButton,
|
|
219
|
+
dialogContent,
|
|
220
|
+
dialogForm,
|
|
221
|
+
dialogInput,
|
|
222
|
+
dialogOverlay,
|
|
223
|
+
dialogTitle,
|
|
224
|
+
diffSourceToggle,
|
|
225
|
+
downshiftAutocompleteContainer,
|
|
226
|
+
downshiftContainer,
|
|
227
|
+
downshiftInput,
|
|
228
|
+
downshiftInputWrapper,
|
|
229
|
+
editImageButton,
|
|
230
|
+
editorRoot,
|
|
231
|
+
editorWrapper,
|
|
232
|
+
focusedImage,
|
|
233
|
+
formField,
|
|
234
|
+
frontmatterToggleButton,
|
|
235
|
+
frontmatterWrapper,
|
|
236
|
+
genericComponentName,
|
|
237
|
+
iconButton,
|
|
238
|
+
imageControlWrapperResizing,
|
|
239
|
+
imageResizer,
|
|
240
|
+
imageResizerE,
|
|
241
|
+
imageResizerN,
|
|
242
|
+
imageResizerNe,
|
|
243
|
+
imageResizerNw,
|
|
244
|
+
imageResizerS,
|
|
245
|
+
imageResizerSe,
|
|
246
|
+
imageResizerSw,
|
|
247
|
+
imageResizerW,
|
|
248
|
+
imageWrapper,
|
|
249
|
+
inlineEditor,
|
|
250
|
+
largeDialogContent,
|
|
251
|
+
leftAlignedCell,
|
|
252
|
+
linkDialogAnchor,
|
|
253
|
+
linkDialogEditForm,
|
|
254
|
+
linkDialogInput,
|
|
255
|
+
linkDialogInputContainer,
|
|
256
|
+
linkDialogInputWrapper,
|
|
257
|
+
linkDialogPopoverContent,
|
|
258
|
+
linkDialogPreviewAnchor,
|
|
259
|
+
markdownParseError,
|
|
260
|
+
multiFieldForm,
|
|
261
|
+
nestedEditor,
|
|
262
|
+
nestedListItem,
|
|
263
|
+
overlayShow,
|
|
264
|
+
placeholder,
|
|
265
|
+
popoverArrow,
|
|
266
|
+
popoverContent,
|
|
267
|
+
primaryActionButton,
|
|
268
|
+
primaryButton,
|
|
269
|
+
propertyEditorInput,
|
|
270
|
+
propertyEditorLabelCell,
|
|
271
|
+
propertyEditorTable,
|
|
272
|
+
propertyPanelTitle,
|
|
273
|
+
readOnlyColumnCell,
|
|
274
|
+
readOnlyToolbarRoot,
|
|
275
|
+
rightAlignedCell,
|
|
276
|
+
rootContentEditableWrapper,
|
|
277
|
+
sandpackWrapper,
|
|
278
|
+
secondaryButton,
|
|
279
|
+
selectContainer,
|
|
280
|
+
selectDropdownArrow,
|
|
281
|
+
selectItem,
|
|
282
|
+
selectTrigger,
|
|
283
|
+
selectWithLabel,
|
|
284
|
+
smallButton,
|
|
285
|
+
tableColumnEditorPopoverContent,
|
|
286
|
+
tableColumnEditorToolbar,
|
|
287
|
+
tableColumnEditorTrigger,
|
|
288
|
+
tableEditor,
|
|
289
|
+
tableRowEditorTrigger,
|
|
290
|
+
tableToolsColumn,
|
|
291
|
+
textInput,
|
|
292
|
+
toggleGroupRoot,
|
|
293
|
+
toolCell,
|
|
294
|
+
toolbarButton,
|
|
295
|
+
toolbarButtonDropdownContainer,
|
|
296
|
+
toolbarButtonSelectTrigger,
|
|
297
|
+
toolbarCodeBlockLanguageSelectContent,
|
|
298
|
+
toolbarCodeBlockLanguageSelectTrigger,
|
|
299
|
+
toolbarGroupOfGroups,
|
|
300
|
+
toolbarModeSwitch,
|
|
301
|
+
toolbarNodeKindSelectContainer,
|
|
302
|
+
toolbarNodeKindSelectDropdownArrow,
|
|
303
|
+
toolbarNodeKindSelectItem,
|
|
304
|
+
toolbarNodeKindSelectTrigger,
|
|
305
|
+
toolbarRoot,
|
|
306
|
+
toolbarTitleMode,
|
|
307
|
+
toolbarToggleItem,
|
|
308
|
+
toolbarToggleSingleGroup,
|
|
309
|
+
tooltipContent,
|
|
310
|
+
tooltipTrigger
|
|
311
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
function controlOrMeta(metaKey, ctrlKey) {
|
|
4
|
+
if (IS_APPLE) {
|
|
5
|
+
return metaKey;
|
|
6
|
+
}
|
|
7
|
+
return ctrlKey;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
CAN_USE_DOM,
|
|
11
|
+
IS_APPLE,
|
|
12
|
+
controlOrMeta
|
|
13
|
+
};
|
|
@@ -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,44 @@
|
|
|
1
|
+
function compose(a, b) {
|
|
2
|
+
return (arg) => a(b(arg));
|
|
3
|
+
}
|
|
4
|
+
function thrush(arg, proc) {
|
|
5
|
+
return proc(arg);
|
|
6
|
+
}
|
|
7
|
+
function curry2to1(proc, arg1) {
|
|
8
|
+
return (arg2) => proc(arg1, arg2);
|
|
9
|
+
}
|
|
10
|
+
function curry1to0(proc, arg) {
|
|
11
|
+
return () => proc(arg);
|
|
12
|
+
}
|
|
13
|
+
function prop(property) {
|
|
14
|
+
return (object) => object[property];
|
|
15
|
+
}
|
|
16
|
+
function tap(arg, proc) {
|
|
17
|
+
proc(arg);
|
|
18
|
+
return arg;
|
|
19
|
+
}
|
|
20
|
+
function call(proc) {
|
|
21
|
+
proc();
|
|
22
|
+
}
|
|
23
|
+
function always(value) {
|
|
24
|
+
return () => value;
|
|
25
|
+
}
|
|
26
|
+
function joinProc(...procs) {
|
|
27
|
+
return () => {
|
|
28
|
+
procs.map(call);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function noop() {
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
always,
|
|
35
|
+
call,
|
|
36
|
+
compose,
|
|
37
|
+
curry1to0,
|
|
38
|
+
curry2to1,
|
|
39
|
+
joinProc,
|
|
40
|
+
noop,
|
|
41
|
+
prop,
|
|
42
|
+
tap,
|
|
43
|
+
thrush
|
|
44
|
+
};
|
|
@@ -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 | null;
|
|
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,80 @@
|
|
|
1
|
+
import { $getSelection, $getRoot } from "lexical";
|
|
2
|
+
import { $isAtNodeEnd } from "@lexical/selection";
|
|
3
|
+
import { tap } from "./fp.js";
|
|
4
|
+
import { exportMarkdownFromLexical } from "../exportMarkdownFromLexical.js";
|
|
5
|
+
function fromWithinEditorRead(editor, fn) {
|
|
6
|
+
let result = null;
|
|
7
|
+
editor.getEditorState().read(() => {
|
|
8
|
+
result = fn();
|
|
9
|
+
});
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
function getSelectedNode(selection) {
|
|
13
|
+
try {
|
|
14
|
+
const anchor = selection.anchor;
|
|
15
|
+
const focus = selection.focus;
|
|
16
|
+
const anchorNode = selection.anchor.getNode();
|
|
17
|
+
const focusNode = selection.focus.getNode();
|
|
18
|
+
if (anchorNode === focusNode) {
|
|
19
|
+
return anchorNode;
|
|
20
|
+
}
|
|
21
|
+
const isBackward = selection.isBackward();
|
|
22
|
+
if (isBackward) {
|
|
23
|
+
return $isAtNodeEnd(focus) ? anchorNode : focusNode;
|
|
24
|
+
} else {
|
|
25
|
+
return $isAtNodeEnd(anchor) ? anchorNode : focusNode;
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function getSelectionRectangle(editor) {
|
|
32
|
+
const selection = $getSelection();
|
|
33
|
+
const nativeSelection = window.getSelection();
|
|
34
|
+
const activeElement = document.activeElement;
|
|
35
|
+
const rootElement = editor.getRootElement();
|
|
36
|
+
if (selection !== null && nativeSelection !== null && rootElement !== null && rootElement.contains(nativeSelection.anchorNode) && editor.isEditable()) {
|
|
37
|
+
const domRange = nativeSelection.getRangeAt(0);
|
|
38
|
+
let rect;
|
|
39
|
+
if (nativeSelection.isCollapsed) {
|
|
40
|
+
let node = nativeSelection.anchorNode;
|
|
41
|
+
if ((node == null ? void 0 : node.nodeType) == 3) {
|
|
42
|
+
node = node.parentNode;
|
|
43
|
+
}
|
|
44
|
+
rect = node.getBoundingClientRect();
|
|
45
|
+
rect.width = 0;
|
|
46
|
+
} else {
|
|
47
|
+
if (nativeSelection.anchorNode === rootElement) {
|
|
48
|
+
let inner = rootElement;
|
|
49
|
+
while (inner.firstElementChild != null) {
|
|
50
|
+
inner = inner.firstElementChild;
|
|
51
|
+
}
|
|
52
|
+
rect = inner.getBoundingClientRect();
|
|
53
|
+
} else {
|
|
54
|
+
rect = domRange.getBoundingClientRect();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
top: Math.round(rect.top),
|
|
59
|
+
left: Math.round(rect.left),
|
|
60
|
+
width: Math.round(rect.width),
|
|
61
|
+
height: Math.round(rect.height)
|
|
62
|
+
};
|
|
63
|
+
} else if (!activeElement || activeElement.className !== "link-input") {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
function getStateAsMarkdown(editor, exportParams) {
|
|
69
|
+
return tap({ markdown: "" }, (result) => {
|
|
70
|
+
editor.getEditorState().read(() => {
|
|
71
|
+
result.markdown = exportMarkdownFromLexical({ root: $getRoot(), ...exportParams });
|
|
72
|
+
});
|
|
73
|
+
}).markdown;
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
fromWithinEditorRead,
|
|
77
|
+
getSelectedNode,
|
|
78
|
+
getSelectionRectangle,
|
|
79
|
+
getStateAsMarkdown
|
|
80
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function makeHslTransparent(hsl: string, alpha: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergeStyleAttributes(style1: string, style2: string): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function mergeStyleAttributes(style1, style2) {
|
|
2
|
+
const styleObject1 = styleToObject(style1);
|
|
3
|
+
const styleObject2 = styleToObject(style2);
|
|
4
|
+
const mergedStyleObject = { ...styleObject1, ...styleObject2 };
|
|
5
|
+
const mergedStyleString = objectToStyle(mergedStyleObject);
|
|
6
|
+
return mergedStyleString;
|
|
7
|
+
}
|
|
8
|
+
function styleToObject(style) {
|
|
9
|
+
const styleObject = {};
|
|
10
|
+
const stylePairs = style.split(";").filter((pair) => pair.trim() !== "");
|
|
11
|
+
stylePairs.forEach((pair) => {
|
|
12
|
+
const [key, value] = pair.split(":").map((part) => part.trim());
|
|
13
|
+
styleObject[key] = value;
|
|
14
|
+
});
|
|
15
|
+
return styleObject;
|
|
16
|
+
}
|
|
17
|
+
function objectToStyle(styleObject) {
|
|
18
|
+
return Object.entries(styleObject).map(([key, value]) => `${key}: ${value}`).join("; ");
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
mergeStyleAttributes
|
|
22
|
+
};
|
|
@@ -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
|
+
};
|