@mdxeditor/editor 0.9.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/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 -1094
- package/dist/index.js +133 -72
- 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-ad505654.js → plugins/image/ImageEditor.js} +12 -47
- 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-177e9901.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-44bef804.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-ce4c85ed.js +0 -79
- package/dist/CodeBlockEditor-ed222322.cjs +0 -1
- package/dist/FrontmatterEditor-914aa241.cjs +0 -1
- package/dist/FrontmatterEditor-e2f25a6a.js +0 -118
- package/dist/ImageEditor-c4e65554.cjs +0 -1
- package/dist/JsxEditor-6cff258d.cjs +0 -1
- package/dist/JsxEditor-88d55ef8.js +0 -108
- package/dist/LeafDirectiveEditor-0e1328e6.cjs +0 -1
- package/dist/LeafDirectiveEditor-34ead530.js +0 -59
- package/dist/SandpackEditor-a999ca47.cjs +0 -1
- package/dist/SandpackEditor-b1e22784.js +0 -99
- package/dist/SourceEditor-0c46ec47.cjs +0 -1
- package/dist/SourceEditor-e509d0a5.js +0 -64
- package/dist/TableEditor-ced03ce4.cjs +0 -1
- package/dist/index-21fcefae.cjs +0 -1
- package/dist/index-ce0832cc.js +0 -4361
- package/dist/index.cjs +0 -1
- package/dist/useCodeMirrorRef-6cb866bd.cjs +0 -1
package/package.json
CHANGED
|
@@ -9,23 +9,12 @@
|
|
|
9
9
|
"private": false,
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"type": "module",
|
|
12
|
-
"
|
|
13
|
-
".": {
|
|
14
|
-
"import": "./dist/index.js",
|
|
15
|
-
"require": "./dist/index.cjs",
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
17
|
-
},
|
|
18
|
-
"./package.json": "./package.json",
|
|
19
|
-
"./style.css": "./dist/style.css"
|
|
20
|
-
},
|
|
21
|
-
"main": "dist/index.cjs",
|
|
22
|
-
"module": "dist/index.js",
|
|
23
|
-
"types": "dist/index.d.ts",
|
|
24
|
-
"version": "0.9.0",
|
|
12
|
+
"version": "0.10.0-alpha.1",
|
|
25
13
|
"description": "React component for rich text markdown editing",
|
|
26
14
|
"scripts": {
|
|
27
15
|
"build": "vite build",
|
|
28
16
|
"build:docs:api": "./scripts/build_docs_api.sh",
|
|
17
|
+
"build:update-exports": "node ./scripts/generate-exports.js",
|
|
29
18
|
"start": "LADLE=true ladle dev",
|
|
30
19
|
"dev": "LADLE=true ladle dev",
|
|
31
20
|
"typecheck": "tsc --noEmit",
|
|
@@ -132,6 +121,7 @@
|
|
|
132
121
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
133
122
|
"express": "^4.18.2",
|
|
134
123
|
"jsdom": "^22.1.0",
|
|
124
|
+
"micromark-util-types": "^1.1.0",
|
|
135
125
|
"multer": "1.4.5-lts.1",
|
|
136
126
|
"postcss": "^8.4.24",
|
|
137
127
|
"postcss-extend": "^1.0.5",
|
|
@@ -159,7 +149,7 @@
|
|
|
159
149
|
"engines": {
|
|
160
150
|
"node": ">=16"
|
|
161
151
|
},
|
|
162
|
-
"packageManager": "
|
|
152
|
+
"packageManager": "npm@9.5.1",
|
|
163
153
|
"repository": {
|
|
164
154
|
"type": "git",
|
|
165
155
|
"url": "https://github.com/mdx-editor/editor.git"
|
|
@@ -179,5 +169,185 @@
|
|
|
179
169
|
"prerelease": true
|
|
180
170
|
}
|
|
181
171
|
]
|
|
172
|
+
},
|
|
173
|
+
"exports": {
|
|
174
|
+
"./package.json": "./package.json",
|
|
175
|
+
"./style.css": "./dist/style.css",
|
|
176
|
+
"./MDXEditor": {
|
|
177
|
+
"import": "./dist/MDXEditor.js",
|
|
178
|
+
"types": "./dist/MDXEditor.d.ts"
|
|
179
|
+
},
|
|
180
|
+
"./directive-editors/AdmonitionDirectiveDescriptor": {
|
|
181
|
+
"import": "./dist/directive-editors/AdmonitionDirectiveDescriptor.js",
|
|
182
|
+
"types": "./dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts"
|
|
183
|
+
},
|
|
184
|
+
"./directive-editors/GenericDirectiveEditor": {
|
|
185
|
+
"import": "./dist/directive-editors/GenericDirectiveEditor.js",
|
|
186
|
+
"types": "./dist/directive-editors/GenericDirectiveEditor.d.ts"
|
|
187
|
+
},
|
|
188
|
+
"./jsx-editors/GenericJsxEditor": {
|
|
189
|
+
"import": "./dist/jsx-editors/GenericJsxEditor.js",
|
|
190
|
+
"types": "./dist/jsx-editors/GenericJsxEditor.d.ts"
|
|
191
|
+
},
|
|
192
|
+
"./plugins/codeblock": {
|
|
193
|
+
"types": "./dist/plugins/codeblock/index.d.ts",
|
|
194
|
+
"import": "./dist/plugins/codeblock/index.js"
|
|
195
|
+
},
|
|
196
|
+
"./plugins/codemirror": {
|
|
197
|
+
"types": "./dist/plugins/codemirror/index.d.ts",
|
|
198
|
+
"import": "./dist/plugins/codemirror/index.js"
|
|
199
|
+
},
|
|
200
|
+
"./plugins/core": {
|
|
201
|
+
"types": "./dist/plugins/core/index.d.ts",
|
|
202
|
+
"import": "./dist/plugins/core/index.js"
|
|
203
|
+
},
|
|
204
|
+
"./plugins/diff-source": {
|
|
205
|
+
"types": "./dist/plugins/diff-source/index.d.ts",
|
|
206
|
+
"import": "./dist/plugins/diff-source/index.js"
|
|
207
|
+
},
|
|
208
|
+
"./plugins/directives": {
|
|
209
|
+
"types": "./dist/plugins/directives/index.d.ts",
|
|
210
|
+
"import": "./dist/plugins/directives/index.js"
|
|
211
|
+
},
|
|
212
|
+
"./plugins/frontmatter": {
|
|
213
|
+
"types": "./dist/plugins/frontmatter/index.d.ts",
|
|
214
|
+
"import": "./dist/plugins/frontmatter/index.js"
|
|
215
|
+
},
|
|
216
|
+
"./plugins/headings": {
|
|
217
|
+
"types": "./dist/plugins/headings/index.d.ts",
|
|
218
|
+
"import": "./dist/plugins/headings/index.js"
|
|
219
|
+
},
|
|
220
|
+
"./plugins/image": {
|
|
221
|
+
"types": "./dist/plugins/image/index.d.ts",
|
|
222
|
+
"import": "./dist/plugins/image/index.js"
|
|
223
|
+
},
|
|
224
|
+
"./plugins/jsx": {
|
|
225
|
+
"types": "./dist/plugins/jsx/index.d.ts",
|
|
226
|
+
"import": "./dist/plugins/jsx/index.js"
|
|
227
|
+
},
|
|
228
|
+
"./plugins/link": {
|
|
229
|
+
"types": "./dist/plugins/link/index.d.ts",
|
|
230
|
+
"import": "./dist/plugins/link/index.js"
|
|
231
|
+
},
|
|
232
|
+
"./plugins/link-dialog": {
|
|
233
|
+
"types": "./dist/plugins/link-dialog/index.d.ts",
|
|
234
|
+
"import": "./dist/plugins/link-dialog/index.js"
|
|
235
|
+
},
|
|
236
|
+
"./plugins/lists": {
|
|
237
|
+
"types": "./dist/plugins/lists/index.d.ts",
|
|
238
|
+
"import": "./dist/plugins/lists/index.js"
|
|
239
|
+
},
|
|
240
|
+
"./plugins/markdown-shortcut": {
|
|
241
|
+
"types": "./dist/plugins/markdown-shortcut/index.d.ts",
|
|
242
|
+
"import": "./dist/plugins/markdown-shortcut/index.js"
|
|
243
|
+
},
|
|
244
|
+
"./plugins/quote": {
|
|
245
|
+
"types": "./dist/plugins/quote/index.d.ts",
|
|
246
|
+
"import": "./dist/plugins/quote/index.js"
|
|
247
|
+
},
|
|
248
|
+
"./plugins/sandpack": {
|
|
249
|
+
"types": "./dist/plugins/sandpack/index.d.ts",
|
|
250
|
+
"import": "./dist/plugins/sandpack/index.js"
|
|
251
|
+
},
|
|
252
|
+
"./plugins/table": {
|
|
253
|
+
"types": "./dist/plugins/table/index.d.ts",
|
|
254
|
+
"import": "./dist/plugins/table/index.js"
|
|
255
|
+
},
|
|
256
|
+
"./plugins/thematic-break": {
|
|
257
|
+
"types": "./dist/plugins/thematic-break/index.d.ts",
|
|
258
|
+
"import": "./dist/plugins/thematic-break/index.js"
|
|
259
|
+
},
|
|
260
|
+
"./plugins/toolbar": {
|
|
261
|
+
"types": "./dist/plugins/toolbar/index.d.ts",
|
|
262
|
+
"import": "./dist/plugins/toolbar/index.js"
|
|
263
|
+
},
|
|
264
|
+
"./plugins/toolbar/components/BlockTypeSelect": {
|
|
265
|
+
"types": "./dist/plugins/toolbar/components/BlockTypeSelect.d.ts",
|
|
266
|
+
"import": "./dist/plugins/toolbar/components/BlockTypeSelect.js"
|
|
267
|
+
},
|
|
268
|
+
"./plugins/toolbar/components/BoldItalicUnderlineToggles": {
|
|
269
|
+
"types": "./dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts",
|
|
270
|
+
"import": "./dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js"
|
|
271
|
+
},
|
|
272
|
+
"./plugins/toolbar/components/ChangeAdmonitionType": {
|
|
273
|
+
"types": "./dist/plugins/toolbar/components/ChangeAdmonitionType.d.ts",
|
|
274
|
+
"import": "./dist/plugins/toolbar/components/ChangeAdmonitionType.js"
|
|
275
|
+
},
|
|
276
|
+
"./plugins/toolbar/components/ChangeCodeMirrorLanguage": {
|
|
277
|
+
"types": "./dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.d.ts",
|
|
278
|
+
"import": "./dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js"
|
|
279
|
+
},
|
|
280
|
+
"./plugins/toolbar/components/CodeToggle": {
|
|
281
|
+
"types": "./dist/plugins/toolbar/components/CodeToggle.d.ts",
|
|
282
|
+
"import": "./dist/plugins/toolbar/components/CodeToggle.js"
|
|
283
|
+
},
|
|
284
|
+
"./plugins/toolbar/components/CreateLink": {
|
|
285
|
+
"types": "./dist/plugins/toolbar/components/CreateLink.d.ts",
|
|
286
|
+
"import": "./dist/plugins/toolbar/components/CreateLink.js"
|
|
287
|
+
},
|
|
288
|
+
"./plugins/toolbar/components/DiffSourceToggleWrapper": {
|
|
289
|
+
"types": "./dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts",
|
|
290
|
+
"import": "./dist/plugins/toolbar/components/DiffSourceToggleWrapper.js"
|
|
291
|
+
},
|
|
292
|
+
"./plugins/toolbar/components/InsertAdmonition": {
|
|
293
|
+
"types": "./dist/plugins/toolbar/components/InsertAdmonition.d.ts",
|
|
294
|
+
"import": "./dist/plugins/toolbar/components/InsertAdmonition.js"
|
|
295
|
+
},
|
|
296
|
+
"./plugins/toolbar/components/InsertCodeBlock": {
|
|
297
|
+
"types": "./dist/plugins/toolbar/components/InsertCodeBlock.d.ts",
|
|
298
|
+
"import": "./dist/plugins/toolbar/components/InsertCodeBlock.js"
|
|
299
|
+
},
|
|
300
|
+
"./plugins/toolbar/components/InsertFrontmatter": {
|
|
301
|
+
"types": "./dist/plugins/toolbar/components/InsertFrontmatter.d.ts",
|
|
302
|
+
"import": "./dist/plugins/toolbar/components/InsertFrontmatter.js"
|
|
303
|
+
},
|
|
304
|
+
"./plugins/toolbar/components/InsertImage": {
|
|
305
|
+
"types": "./dist/plugins/toolbar/components/InsertImage.d.ts",
|
|
306
|
+
"import": "./dist/plugins/toolbar/components/InsertImage.js"
|
|
307
|
+
},
|
|
308
|
+
"./plugins/toolbar/components/InsertSandpack": {
|
|
309
|
+
"types": "./dist/plugins/toolbar/components/InsertSandpack.d.ts",
|
|
310
|
+
"import": "./dist/plugins/toolbar/components/InsertSandpack.js"
|
|
311
|
+
},
|
|
312
|
+
"./plugins/toolbar/components/InsertTable": {
|
|
313
|
+
"types": "./dist/plugins/toolbar/components/InsertTable.d.ts",
|
|
314
|
+
"import": "./dist/plugins/toolbar/components/InsertTable.js"
|
|
315
|
+
},
|
|
316
|
+
"./plugins/toolbar/components/InsertThematicBreak": {
|
|
317
|
+
"types": "./dist/plugins/toolbar/components/InsertThematicBreak.d.ts",
|
|
318
|
+
"import": "./dist/plugins/toolbar/components/InsertThematicBreak.js"
|
|
319
|
+
},
|
|
320
|
+
"./plugins/toolbar/components/KitchenSinkToolbar": {
|
|
321
|
+
"types": "./dist/plugins/toolbar/components/KitchenSinkToolbar.d.ts",
|
|
322
|
+
"import": "./dist/plugins/toolbar/components/KitchenSinkToolbar.js"
|
|
323
|
+
},
|
|
324
|
+
"./plugins/toolbar/components/ListsToggle": {
|
|
325
|
+
"types": "./dist/plugins/toolbar/components/ListsToggle.d.ts",
|
|
326
|
+
"import": "./dist/plugins/toolbar/components/ListsToggle.js"
|
|
327
|
+
},
|
|
328
|
+
"./plugins/toolbar/components/ShowSandpackInfo": {
|
|
329
|
+
"types": "./dist/plugins/toolbar/components/ShowSandpackInfo.d.ts",
|
|
330
|
+
"import": "./dist/plugins/toolbar/components/ShowSandpackInfo.js"
|
|
331
|
+
},
|
|
332
|
+
"./plugins/toolbar/components/UndoRedo": {
|
|
333
|
+
"types": "./dist/plugins/toolbar/components/UndoRedo.d.ts",
|
|
334
|
+
"import": "./dist/plugins/toolbar/components/UndoRedo.js"
|
|
335
|
+
},
|
|
336
|
+
"./plugins/toolbar/primitives/DialogButton": {
|
|
337
|
+
"types": "./dist/plugins/toolbar/primitives/DialogButton.d.ts",
|
|
338
|
+
"import": "./dist/plugins/toolbar/primitives/DialogButton.js"
|
|
339
|
+
},
|
|
340
|
+
"./plugins/toolbar/primitives/TooltipWrap": {
|
|
341
|
+
"types": "./dist/plugins/toolbar/primitives/TooltipWrap.d.ts",
|
|
342
|
+
"import": "./dist/plugins/toolbar/primitives/TooltipWrap.js"
|
|
343
|
+
},
|
|
344
|
+
"./plugins/toolbar/primitives/select": {
|
|
345
|
+
"types": "./dist/plugins/toolbar/primitives/select.d.ts",
|
|
346
|
+
"import": "./dist/plugins/toolbar/primitives/select.js"
|
|
347
|
+
},
|
|
348
|
+
"./plugins/toolbar/primitives/toolbar": {
|
|
349
|
+
"types": "./dist/plugins/toolbar/primitives/toolbar.d.ts",
|
|
350
|
+
"import": "./dist/plugins/toolbar/primitives/toolbar.js"
|
|
351
|
+
}
|
|
182
352
|
}
|
|
183
353
|
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { SandpackProvider, CodeEditor } from "@codesandbox/sandpack-react";
|
|
2
|
-
import React__default from "react";
|
|
3
|
-
import { u as useEmitterValues, a as usePublisher, s as styles } from "./index-ce0832cc.js";
|
|
4
|
-
import { u as useCodeMirrorRef } from "./useCodeMirrorRef-177e9901.js";
|
|
5
|
-
import "@lexical/react/LexicalComposer";
|
|
6
|
-
import "@lexical/react/LexicalContentEditable";
|
|
7
|
-
import "@lexical/react/LexicalErrorBoundary";
|
|
8
|
-
import "@lexical/react/LexicalHorizontalRulePlugin";
|
|
9
|
-
import "@lexical/react/LexicalLinkPlugin";
|
|
10
|
-
import "@lexical/react/LexicalListPlugin";
|
|
11
|
-
import "@lexical/react/LexicalRichTextPlugin";
|
|
12
|
-
import "@lexical/react/LexicalTabIndentationPlugin";
|
|
13
|
-
import "classnames";
|
|
14
|
-
import "lexical";
|
|
15
|
-
import "@lexical/code";
|
|
16
|
-
import "@lexical/link";
|
|
17
|
-
import "@lexical/list";
|
|
18
|
-
import "@lexical/react/LexicalHorizontalRuleNode";
|
|
19
|
-
import "@lexical/rich-text";
|
|
20
|
-
import "mdast-util-directive";
|
|
21
|
-
import "mdast-util-from-markdown";
|
|
22
|
-
import "mdast-util-frontmatter";
|
|
23
|
-
import "mdast-util-gfm-table";
|
|
24
|
-
import "mdast-util-mdx";
|
|
25
|
-
import "micromark-extension-directive";
|
|
26
|
-
import "micromark-extension-frontmatter";
|
|
27
|
-
import "micromark-extension-gfm-table";
|
|
28
|
-
import "micromark-extension-mdxjs";
|
|
29
|
-
import "@lexical/utils";
|
|
30
|
-
import "@lexical/react/LexicalComposerContext";
|
|
31
|
-
import "@lexical/selection";
|
|
32
|
-
import "@lexical/react/LexicalHistoryPlugin";
|
|
33
|
-
import "mdast-util-to-markdown";
|
|
34
|
-
import "@radix-ui/react-popover";
|
|
35
|
-
import "@radix-ui/react-tooltip";
|
|
36
|
-
import "downshift";
|
|
37
|
-
import "@lexical/markdown";
|
|
38
|
-
import "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
39
|
-
import "react-diff-view";
|
|
40
|
-
import "unidiff";
|
|
41
|
-
import "@radix-ui/react-toolbar";
|
|
42
|
-
import "@radix-ui/react-select";
|
|
43
|
-
import "@radix-ui/react-dialog";
|
|
44
|
-
import "@lexical/react/LexicalNestedComposer";
|
|
45
|
-
const CodeBlockEditor = ({ nodeKey, code, language, onChange, focusEmitter }) => {
|
|
46
|
-
const [activeEditor] = useEmitterValues("activeEditor");
|
|
47
|
-
const codeMirrorRef = useCodeMirrorRef(nodeKey, "codeblock", language);
|
|
48
|
-
const setActiveEditorType = usePublisher("activeEditorType");
|
|
49
|
-
React__default.useEffect(() => {
|
|
50
|
-
focusEmitter.subscribe(() => {
|
|
51
|
-
var _a, _b;
|
|
52
|
-
(_b = (_a = codeMirrorRef == null ? void 0 : codeMirrorRef.current) == null ? void 0 : _a.getCodemirror()) == null ? void 0 : _b.focus();
|
|
53
|
-
setActiveEditorType({ type: "codeblock", nodeKey });
|
|
54
|
-
});
|
|
55
|
-
}, [focusEmitter, codeMirrorRef, setActiveEditorType, nodeKey]);
|
|
56
|
-
const wrappedOnChange = React__default.useCallback(
|
|
57
|
-
(code2) => {
|
|
58
|
-
activeEditor == null ? void 0 : activeEditor.update(() => {
|
|
59
|
-
onChange(code2);
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
[onChange, activeEditor]
|
|
63
|
-
);
|
|
64
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: styles.sandpackWrapper }, /* @__PURE__ */ React__default.createElement(SandpackProvider, null, /* @__PURE__ */ React__default.createElement(
|
|
65
|
-
CodeEditor,
|
|
66
|
-
{
|
|
67
|
-
showLineNumbers: true,
|
|
68
|
-
initMode: "immediate",
|
|
69
|
-
key: language,
|
|
70
|
-
filePath: `file.${language || "txt"}`,
|
|
71
|
-
code,
|
|
72
|
-
onCodeUpdate: wrappedOnChange,
|
|
73
|
-
ref: codeMirrorRef
|
|
74
|
-
}
|
|
75
|
-
)));
|
|
76
|
-
};
|
|
77
|
-
export {
|
|
78
|
-
CodeBlockEditor
|
|
79
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@codesandbox/sandpack-react"),r=require("react"),i=require("./index-21fcefae.cjs"),a=require("./useCodeMirrorRef-6cb866bd.cjs");require("@lexical/react/LexicalComposer"),require("@lexical/react/LexicalContentEditable"),require("@lexical/react/LexicalErrorBoundary"),require("@lexical/react/LexicalHorizontalRulePlugin"),require("@lexical/react/LexicalLinkPlugin"),require("@lexical/react/LexicalListPlugin"),require("@lexical/react/LexicalRichTextPlugin"),require("@lexical/react/LexicalTabIndentationPlugin"),require("classnames"),require("lexical"),require("@lexical/code"),require("@lexical/link"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("mdast-util-directive"),require("mdast-util-from-markdown"),require("mdast-util-frontmatter"),require("mdast-util-gfm-table"),require("mdast-util-mdx"),require("micromark-extension-directive"),require("micromark-extension-frontmatter"),require("micromark-extension-gfm-table"),require("micromark-extension-mdxjs"),require("@lexical/utils"),require("@lexical/react/LexicalComposerContext"),require("@lexical/selection"),require("@lexical/react/LexicalHistoryPlugin"),require("mdast-util-to-markdown"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("downshift"),require("@lexical/markdown"),require("@lexical/react/LexicalMarkdownShortcutPlugin"),require("react-diff-view"),require("unidiff"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-select"),require("@radix-ui/react-dialog"),require("@lexical/react/LexicalNestedComposer");exports.CodeBlockEditor=({nodeKey:t,code:l,language:c,onChange:u,focusEmitter:o})=>{const[n]=i.useEmitterValues("activeEditor"),d=a.useCodeMirrorRef(t,"codeblock",c),s=i.usePublisher("activeEditorType");r.useEffect((()=>{o.subscribe((()=>{var e,r;null==(r=null==(e=null==d?void 0:d.current)?void 0:e.getCodemirror())||r.focus(),s({type:"codeblock",nodeKey:t})}))}),[o,d,s,t]);const x=r.useCallback((e=>{null==n||n.update((()=>{u(e)}))}),[u,n]);return r.createElement("div",{className:i.styles.sandpackWrapper},r.createElement(e.SandpackProvider,null,r.createElement(e.CodeEditor,{showLineNumbers:!0,initMode:"immediate",key:c,filePath:`file.${c||"txt"}`,code:l,onCodeUpdate:x,ref:d})))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("js-yaml"),t=require("react"),r=require("react-hook-form"),l=require("classnames"),a=require("./index-21fcefae.cjs");function i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}require("@lexical/react/LexicalComposer"),require("@lexical/react/LexicalContentEditable"),require("@lexical/react/LexicalErrorBoundary"),require("@lexical/react/LexicalHorizontalRulePlugin"),require("@lexical/react/LexicalLinkPlugin"),require("@lexical/react/LexicalListPlugin"),require("@lexical/react/LexicalRichTextPlugin"),require("@lexical/react/LexicalTabIndentationPlugin"),require("lexical"),require("@lexical/code"),require("@lexical/link"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("mdast-util-directive"),require("mdast-util-from-markdown"),require("mdast-util-frontmatter"),require("mdast-util-gfm-table"),require("mdast-util-mdx"),require("micromark-extension-directive"),require("micromark-extension-frontmatter"),require("micromark-extension-gfm-table"),require("micromark-extension-mdxjs"),require("@lexical/utils"),require("@lexical/react/LexicalComposerContext"),require("@lexical/selection"),require("@lexical/react/LexicalHistoryPlugin"),require("mdast-util-to-markdown"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("downshift"),require("@lexical/markdown"),require("@lexical/react/LexicalMarkdownShortcutPlugin"),require("react-diff-view"),require("unidiff"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-select"),require("@radix-ui/react-dialog"),require("@lexical/react/LexicalNestedComposer");const n=i(t),c=e=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"currentColor",viewBox:"0 0 24 24",...e},n.createElement("mask",{id:"a",width:24,height:24,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},n.createElement("path",{d:"M0 0h24v24H0z"})),n.createElement("g",{mask:"url(#a)"},n.createElement("path",{d:"M10 17V7l5 5-5 5Z"}))),u=e=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"currentColor",viewBox:"0 0 24 24",...e},n.createElement("mask",{id:"a",width:24,height:24,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},n.createElement("path",{d:"M0 0h24v24H0z"})),n.createElement("g",{mask:"url(#a)"},n.createElement("path",{d:"m12 15-5-5h10l-5 5Z"}))),o=e=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"currentColor",viewBox:"0 0 20 20",...e},n.createElement("mask",{id:"a",width:20,height:20,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},n.createElement("path",{d:"M0 0h20v20H0z"})),n.createElement("g",{mask:"url(#a)"},n.createElement("path",{d:"M5 17V6.5H4V5h4V4h4v1h4v1.5h-1V17H5Zm1.5-1.5h7v-9h-7v9ZM8 14h1.5V8H8v6Zm2.5 0H12V8h-1.5v6Z"}))),m=t.forwardRef((({className:e,autofocusIfEmpty:r,...i},n)=>(i.autoFocus=Boolean(!i.value&&r),t.createElement("input",{className:l(a.styles.frontmatterInput,e),...i,ref:n}))));exports.FrontmatterEditor=({yaml:l,onChange:i})=>{const[n,s]=t.useState(!0),d=t.useMemo((()=>l?Object.entries(e.load(l)).map((([e,t])=>({key:e,value:t}))):[]),[l]),{register:x,control:h,watch:E}=r.useForm({defaultValues:{yamlConfig:d}}),{fields:f,append:p,remove:q}=r.useFieldArray({control:h,name:"yamlConfig"});return t.useEffect((()=>{const t=E((({yamlConfig:t})=>{const r=t.reduce(((e,{key:t,value:r})=>(t&&r&&(e[t]=r),e)),{});i(e.dump(r).trim())}));return()=>t.unsubscribe()}),[E,i]),t.createElement("div",{className:a.styles.frontmatterWrapper,"data-expanded":n,"data-editor-type":"frontmatter"},t.createElement("button",{className:a.styles.frontmatterToggleButton,onClick:e=>{e.preventDefault(),s((e=>!e))}},n?t.createElement(u,null):t.createElement(c,null),"Document frontmatter"),n&&t.createElement("form",null,t.createElement("table",{className:a.styles.frontmatterEditorTable},t.createElement("colgroup",null,t.createElement("col",null),t.createElement("col",null),t.createElement("col",null)),t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"Key"),t.createElement("th",null,"Value"),t.createElement("th",null))),t.createElement("tbody",null,f.map(((e,r)=>t.createElement("tr",{key:e.id},t.createElement("td",null,t.createElement(m,{...x(`yamlConfig.${r}.key`,{required:!0}),autofocusIfEmpty:!0})),t.createElement("td",null,t.createElement(m,{...x(`yamlConfig.${r}.value`,{required:!0})})),t.createElement("td",null,t.createElement("button",{type:"button",onClick:()=>q(r),className:a.styles.iconButton},t.createElement(o,null))))))),t.createElement("tfoot",null,t.createElement("tr",null,t.createElement("td",null,t.createElement("button",{className:a.styles.primaryButton,type:"button",onClick:()=>{p({key:"",value:""})}},"Add new key")))))))};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import YamlParser from "js-yaml";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import React__default from "react";
|
|
4
|
-
import { useForm, useFieldArray } from "react-hook-form";
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import { s as styles } from "./index-ce0832cc.js";
|
|
7
|
-
import "@lexical/react/LexicalComposer";
|
|
8
|
-
import "@lexical/react/LexicalContentEditable";
|
|
9
|
-
import "@lexical/react/LexicalErrorBoundary";
|
|
10
|
-
import "@lexical/react/LexicalHorizontalRulePlugin";
|
|
11
|
-
import "@lexical/react/LexicalLinkPlugin";
|
|
12
|
-
import "@lexical/react/LexicalListPlugin";
|
|
13
|
-
import "@lexical/react/LexicalRichTextPlugin";
|
|
14
|
-
import "@lexical/react/LexicalTabIndentationPlugin";
|
|
15
|
-
import "lexical";
|
|
16
|
-
import "@lexical/code";
|
|
17
|
-
import "@lexical/link";
|
|
18
|
-
import "@lexical/list";
|
|
19
|
-
import "@lexical/react/LexicalHorizontalRuleNode";
|
|
20
|
-
import "@lexical/rich-text";
|
|
21
|
-
import "mdast-util-directive";
|
|
22
|
-
import "mdast-util-from-markdown";
|
|
23
|
-
import "mdast-util-frontmatter";
|
|
24
|
-
import "mdast-util-gfm-table";
|
|
25
|
-
import "mdast-util-mdx";
|
|
26
|
-
import "micromark-extension-directive";
|
|
27
|
-
import "micromark-extension-frontmatter";
|
|
28
|
-
import "micromark-extension-gfm-table";
|
|
29
|
-
import "micromark-extension-mdxjs";
|
|
30
|
-
import "@lexical/utils";
|
|
31
|
-
import "@lexical/react/LexicalComposerContext";
|
|
32
|
-
import "@lexical/selection";
|
|
33
|
-
import "@lexical/react/LexicalHistoryPlugin";
|
|
34
|
-
import "mdast-util-to-markdown";
|
|
35
|
-
import "@radix-ui/react-popover";
|
|
36
|
-
import "@radix-ui/react-tooltip";
|
|
37
|
-
import "downshift";
|
|
38
|
-
import "@lexical/markdown";
|
|
39
|
-
import "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
40
|
-
import "react-diff-view";
|
|
41
|
-
import "unidiff";
|
|
42
|
-
import "@radix-ui/react-toolbar";
|
|
43
|
-
import "@radix-ui/react-select";
|
|
44
|
-
import "@radix-ui/react-dialog";
|
|
45
|
-
import "@lexical/react/LexicalNestedComposer";
|
|
46
|
-
const SvgArrowRight = (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: {
|
|
47
|
-
maskType: "alpha"
|
|
48
|
-
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M10 17V7l5 5-5 5Z" })));
|
|
49
|
-
const ArrowRight = SvgArrowRight;
|
|
50
|
-
const SvgArrowDropDown = (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: {
|
|
51
|
-
maskType: "alpha"
|
|
52
|
-
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m12 15-5-5h10l-5 5Z" })));
|
|
53
|
-
const ArrowDown = SvgArrowDropDown;
|
|
54
|
-
const SvgDelete = (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: {
|
|
55
|
-
maskType: "alpha"
|
|
56
|
-
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h20v20H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M5 17V6.5H4V5h4V4h4v1h4v1.5h-1V17H5Zm1.5-1.5h7v-9h-7v9ZM8 14h1.5V8H8v6Zm2.5 0H12V8h-1.5v6Z" })));
|
|
57
|
-
const DeleteIcon = SvgDelete;
|
|
58
|
-
const FrontmatterEditor = ({ yaml, onChange }) => {
|
|
59
|
-
const [expanded, setExpanded] = React__default.useState(true);
|
|
60
|
-
const yamlConfig = React__default.useMemo(() => {
|
|
61
|
-
if (!yaml) {
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
return Object.entries(YamlParser.load(yaml)).map(([key, value]) => ({ key, value }));
|
|
65
|
-
}, [yaml]);
|
|
66
|
-
const { register, control, watch } = useForm({
|
|
67
|
-
defaultValues: {
|
|
68
|
-
yamlConfig
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
const { fields, append, remove } = useFieldArray({
|
|
72
|
-
control,
|
|
73
|
-
name: "yamlConfig"
|
|
74
|
-
});
|
|
75
|
-
React__default.useEffect(() => {
|
|
76
|
-
const subscription = watch(({ yamlConfig: yamlConfig2 }) => {
|
|
77
|
-
const yaml2 = yamlConfig2.reduce((acc, { key, value }) => {
|
|
78
|
-
if (key && value) {
|
|
79
|
-
acc[key] = value;
|
|
80
|
-
}
|
|
81
|
-
return acc;
|
|
82
|
-
}, {});
|
|
83
|
-
onChange(YamlParser.dump(yaml2).trim());
|
|
84
|
-
});
|
|
85
|
-
return () => subscription.unsubscribe();
|
|
86
|
-
}, [watch, onChange]);
|
|
87
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: styles.frontmatterWrapper, "data-expanded": expanded, "data-editor-type": "frontmatter" }, /* @__PURE__ */ React__default.createElement(
|
|
88
|
-
"button",
|
|
89
|
-
{
|
|
90
|
-
className: styles.frontmatterToggleButton,
|
|
91
|
-
onClick: (e) => {
|
|
92
|
-
e.preventDefault();
|
|
93
|
-
setExpanded((v) => !v);
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
expanded ? /* @__PURE__ */ React__default.createElement(ArrowDown, null) : /* @__PURE__ */ React__default.createElement(ArrowRight, null),
|
|
97
|
-
"Document frontmatter"
|
|
98
|
-
), expanded && /* @__PURE__ */ React__default.createElement("form", null, /* @__PURE__ */ React__default.createElement("table", { className: styles.frontmatterEditorTable }, /* @__PURE__ */ React__default.createElement("colgroup", null, /* @__PURE__ */ React__default.createElement("col", null), /* @__PURE__ */ React__default.createElement("col", null), /* @__PURE__ */ React__default.createElement("col", null)), /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", null, "Key"), /* @__PURE__ */ React__default.createElement("th", null, "Value"), /* @__PURE__ */ React__default.createElement("th", null))), /* @__PURE__ */ React__default.createElement("tbody", null, fields.map((item, index) => {
|
|
99
|
-
return /* @__PURE__ */ React__default.createElement("tr", { key: item.id }, /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(TableInput, { ...register(`yamlConfig.${index}.key`, { required: true }), autofocusIfEmpty: true })), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(TableInput, { ...register(`yamlConfig.${index}.value`, { required: true }) })), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement("button", { type: "button", onClick: () => remove(index), className: styles.iconButton }, /* @__PURE__ */ React__default.createElement(DeleteIcon, null))));
|
|
100
|
-
})), /* @__PURE__ */ React__default.createElement("tfoot", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(
|
|
101
|
-
"button",
|
|
102
|
-
{
|
|
103
|
-
className: styles.primaryButton,
|
|
104
|
-
type: "button",
|
|
105
|
-
onClick: () => {
|
|
106
|
-
append({ key: "", value: "" });
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"Add new key"
|
|
110
|
-
)))))));
|
|
111
|
-
};
|
|
112
|
-
const TableInput = React__default.forwardRef(({ className, autofocusIfEmpty, ...props }, ref) => {
|
|
113
|
-
props.autoFocus = Boolean(!props.value && autofocusIfEmpty);
|
|
114
|
-
return /* @__PURE__ */ React__default.createElement("input", { className: classNames(styles.frontmatterInput, className), ...props, ref });
|
|
115
|
-
});
|
|
116
|
-
export {
|
|
117
|
-
FrontmatterEditor
|
|
118
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/react/useLexicalNodeSelection"),i=require("@lexical/utils"),l=require("lexical"),a=require("./index-21fcefae.cjs"),c=require("classnames");require("@lexical/react/LexicalComposer"),require("@lexical/react/LexicalContentEditable"),require("@lexical/react/LexicalErrorBoundary"),require("@lexical/react/LexicalHorizontalRulePlugin"),require("@lexical/react/LexicalLinkPlugin"),require("@lexical/react/LexicalListPlugin"),require("@lexical/react/LexicalRichTextPlugin"),require("@lexical/react/LexicalTabIndentationPlugin"),require("@lexical/code"),require("@lexical/link"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("mdast-util-directive"),require("mdast-util-from-markdown"),require("mdast-util-frontmatter"),require("mdast-util-gfm-table"),require("mdast-util-mdx"),require("micromark-extension-directive"),require("micromark-extension-frontmatter"),require("micromark-extension-gfm-table"),require("micromark-extension-mdxjs"),require("@lexical/selection"),require("@lexical/react/LexicalHistoryPlugin"),require("mdast-util-to-markdown"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("downshift"),require("@lexical/markdown"),require("@lexical/react/LexicalMarkdownShortcutPlugin"),require("react-diff-view"),require("unidiff"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-select"),require("@radix-ui/react-dialog"),require("@lexical/react/LexicalNestedComposer");const u=new Set;function n({title:r,className:t,imageRef:i,src:l}){return function(e){if(!u.has(e))throw new Promise((r=>{const t=new Image;t.src=e,t.onload=()=>{u.add(e),r(null)}}))}(l),e.createElement("img",{className:t||void 0,src:l,title:r,ref:i,draggable:"false"})}exports.ImageEditor=function({src:u,title:o,nodeKey:s}){const m=e.useRef(null),d=e.useRef(null),[x,g,q]=t.useLexicalNodeSelection(s),[C]=r.useLexicalComposerContext(),[f,N]=e.useState(null),M=e.useRef(null),O=e.useCallback((e=>{if(x&&l.$isNodeSelection(l.$getSelection())){e.preventDefault();const r=l.$getNodeByKey(s);a.$isImageNode(r)&&r.remove()}return!1}),[x,s]),L=e.useCallback((e=>{const r=l.$getSelection(),t=d.current;return!(!x||!l.$isNodeSelection(r)||1!==r.getNodes().length||null===t||t===document.activeElement)&&(e.preventDefault(),t.focus(),!0)}),[x]),R=e.useCallback((e=>d.current===e.target&&(l.$setSelection(null),C.update((()=>{g(!0);const e=C.getRootElement();null!==e&&e.focus()})),!0)),[C,g]);e.useEffect((()=>{let e=!0;const r=i.mergeRegister(C.registerUpdateListener((({editorState:r})=>{e&&N(r.read((()=>l.$getSelection())))})),C.registerCommand(l.SELECTION_CHANGE_COMMAND,((e,r)=>(M.current=r,!1)),l.COMMAND_PRIORITY_LOW),C.registerCommand(l.CLICK_COMMAND,(e=>{const r=e;return r.target===m.current&&(r.shiftKey?g(!x):(q(),g(!0)),!0)}),l.COMMAND_PRIORITY_LOW),C.registerCommand(l.DRAGSTART_COMMAND,(e=>e.target===m.current&&(e.preventDefault(),!0)),l.COMMAND_PRIORITY_LOW),C.registerCommand(l.KEY_DELETE_COMMAND,O,l.COMMAND_PRIORITY_LOW),C.registerCommand(l.KEY_BACKSPACE_COMMAND,O,l.COMMAND_PRIORITY_LOW),C.registerCommand(l.KEY_ENTER_COMMAND,L,l.COMMAND_PRIORITY_LOW),C.registerCommand(l.KEY_ESCAPE_COMMAND,R,l.COMMAND_PRIORITY_LOW));return()=>{e=!1,r()}}),[q,C,x,s,O,L,R,g]);const E=l.$isNodeSelection(f),_=x;return e.createElement(e.Suspense,{fallback:null},e.createElement(e.Fragment,null,e.createElement("div",{draggable:E,className:a.styles.imageWrapper,"data-editor-block-type":"image"},e.createElement(n,{className:c({[a.styles.focusedImage]:_}),src:u,title:o||"",imageRef:m}))))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/LexicalContentEditable"),l=require("@lexical/react/LexicalErrorBoundary"),a=require("@lexical/react/LexicalNestedComposer"),i=require("@lexical/react/LexicalRichTextPlugin"),n=require("@radix-ui/react-popover"),c=require("react-hook-form"),u=require("./index-21fcefae.cjs");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}require("@lexical/react/LexicalComposer"),require("@lexical/react/LexicalHorizontalRulePlugin"),require("@lexical/react/LexicalLinkPlugin"),require("@lexical/react/LexicalListPlugin"),require("@lexical/react/LexicalTabIndentationPlugin"),require("classnames"),require("lexical"),require("@lexical/code"),require("@lexical/link"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("mdast-util-directive"),require("mdast-util-from-markdown"),require("mdast-util-frontmatter"),require("mdast-util-gfm-table"),require("mdast-util-mdx"),require("micromark-extension-directive"),require("micromark-extension-frontmatter"),require("micromark-extension-gfm-table"),require("micromark-extension-mdxjs"),require("@lexical/utils"),require("@lexical/selection"),require("@lexical/react/LexicalHistoryPlugin"),require("mdast-util-to-markdown"),require("@radix-ui/react-tooltip"),require("downshift"),require("@lexical/markdown"),require("@lexical/react/LexicalMarkdownShortcutPlugin"),require("react-diff-view"),require("unidiff"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-select"),require("@radix-ui/react-dialog");const m=o(e),s=o(n),d=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"currentColor",viewBox:"0 0 24 24",...e},m.createElement("mask",{id:"a",width:24,height:24,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},m.createElement("path",{d:"M0 0h24v24H0z"})),m.createElement("g",{mask:"url(#a)"},m.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"}))),x=e.forwardRef(((t,r)=>e.createElement(s.Content,{...t,className:"",ref:r}))),E=e.forwardRef(((t,r)=>e.createElement(s.Trigger,{...t,className:"",ref:r})));const p=({attributes:t,componentName:r,onSubmit:l})=>{const[a,i]=e.useState(!1),n=e.useCallback((e=>{l(e),i(!1)}),[l]);return e.createElement(s.Root,{open:a,onOpenChange:e=>i(e)},e.createElement(E,null,e.createElement(d,null)),e.createElement(s.Portal,null,e.createElement(x,null,e.createElement(q,{attributes:t,componentName:r,onSubmit:n}))))},q=({attributes:r,componentName:l,onSubmit:a})=>{const[i]=u.useEmitterValues("jsxComponentDescriptors"),n=i.find((e=>e.name===l)),[o]=t.useLexicalComposerContext(),{register:m,handleSubmit:s}=c.useForm({defaultValues:r.reduce(((e,t)=>(e[t.name]=t.value,e)),{})});return e.createElement("form",{onSubmit:s((e=>{o.update((()=>{a(e)}))}))},e.createElement("table",null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Attribute"),e.createElement("th",null,"Value"))),e.createElement("tbody",null,n.props.map((t=>e.createElement("tr",{key:t.name},e.createElement("td",null," ",t.name," "),e.createElement("td",null,e.createElement("input",{...m(t.name)}))))))),e.createElement("button",{type:"submit"},"Submit"))};exports.JsxEditor=function({kind:t,attributes:n,componentName:c,editor:u,onSubmit:o,theme:m}){return"flow"===t?e.createElement("div",null,e.createElement("div",null,c),e.createElement(a.LexicalNestedComposer,{initialEditor:u,initialTheme:m},e.createElement(i.RichTextPlugin,{contentEditable:e.createElement(r.ContentEditable,null),placeholder:e.createElement("div",null,"Type here.."),ErrorBoundary:l}))):e.createElement("span",null,e.createElement("span",null,e.createElement(p,{attributes:n,componentName:c,onSubmit:o})),e.createElement("span",null,c,e.createElement(a.LexicalNestedComposer,{initialEditor:u,initialTheme:m},e.createElement(i.RichTextPlugin,{contentEditable:e.createElement(r.ContentEditable,{style:{padding:5,border:"1px solid red"}}),placeholder:e.createElement("div",null,"Type here.."),ErrorBoundary:l}))))};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React__default from "react";
|
|
3
|
-
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
4
|
-
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
5
|
-
import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
|
|
6
|
-
import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer";
|
|
7
|
-
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
8
|
-
import * as RadixPopover from "@radix-ui/react-popover";
|
|
9
|
-
import { useForm } from "react-hook-form";
|
|
10
|
-
import { u as useEmitterValues } from "./index-ce0832cc.js";
|
|
11
|
-
import "@lexical/react/LexicalComposer";
|
|
12
|
-
import "@lexical/react/LexicalHorizontalRulePlugin";
|
|
13
|
-
import "@lexical/react/LexicalLinkPlugin";
|
|
14
|
-
import "@lexical/react/LexicalListPlugin";
|
|
15
|
-
import "@lexical/react/LexicalTabIndentationPlugin";
|
|
16
|
-
import "classnames";
|
|
17
|
-
import "lexical";
|
|
18
|
-
import "@lexical/code";
|
|
19
|
-
import "@lexical/link";
|
|
20
|
-
import "@lexical/list";
|
|
21
|
-
import "@lexical/react/LexicalHorizontalRuleNode";
|
|
22
|
-
import "@lexical/rich-text";
|
|
23
|
-
import "mdast-util-directive";
|
|
24
|
-
import "mdast-util-from-markdown";
|
|
25
|
-
import "mdast-util-frontmatter";
|
|
26
|
-
import "mdast-util-gfm-table";
|
|
27
|
-
import "mdast-util-mdx";
|
|
28
|
-
import "micromark-extension-directive";
|
|
29
|
-
import "micromark-extension-frontmatter";
|
|
30
|
-
import "micromark-extension-gfm-table";
|
|
31
|
-
import "micromark-extension-mdxjs";
|
|
32
|
-
import "@lexical/utils";
|
|
33
|
-
import "@lexical/selection";
|
|
34
|
-
import "@lexical/react/LexicalHistoryPlugin";
|
|
35
|
-
import "mdast-util-to-markdown";
|
|
36
|
-
import "@radix-ui/react-tooltip";
|
|
37
|
-
import "downshift";
|
|
38
|
-
import "@lexical/markdown";
|
|
39
|
-
import "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
40
|
-
import "react-diff-view";
|
|
41
|
-
import "unidiff";
|
|
42
|
-
import "@radix-ui/react-toolbar";
|
|
43
|
-
import "@radix-ui/react-select";
|
|
44
|
-
import "@radix-ui/react-dialog";
|
|
45
|
-
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: {
|
|
46
|
-
maskType: "alpha"
|
|
47
|
-
} }, /* @__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" })));
|
|
48
|
-
const SettingsIcon = SvgSettings;
|
|
49
|
-
const PopoverContent = React__default.forwardRef(
|
|
50
|
-
(props, ref) => {
|
|
51
|
-
return /* @__PURE__ */ React__default.createElement(RadixPopover.Content, { ...props, className: "", ref });
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
const PopoverTrigger = React__default.forwardRef(
|
|
55
|
-
(props, ref) => {
|
|
56
|
-
return /* @__PURE__ */ React__default.createElement(RadixPopover.Trigger, { ...props, className: "", ref });
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
function JsxEditor({ kind, attributes, componentName, editor, onSubmit, theme }) {
|
|
60
|
-
if (kind === "flow") {
|
|
61
|
-
return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", null, componentName), /* @__PURE__ */ React__default.createElement(LexicalNestedComposer, { initialEditor: editor, initialTheme: theme }, /* @__PURE__ */ React__default.createElement(RichTextPlugin, { contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, null), placeholder: /* @__PURE__ */ React__default.createElement("div", null, "Type here.."), ErrorBoundary: LexicalErrorBoundary })));
|
|
62
|
-
}
|
|
63
|
-
return /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement(InlineJsxComponent, { attributes, componentName, onSubmit })), /* @__PURE__ */ React__default.createElement("span", null, componentName, /* @__PURE__ */ React__default.createElement(LexicalNestedComposer, { initialEditor: editor, initialTheme: theme }, /* @__PURE__ */ React__default.createElement(
|
|
64
|
-
RichTextPlugin,
|
|
65
|
-
{
|
|
66
|
-
contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { style: { padding: 5, border: "1px solid red" } }),
|
|
67
|
-
placeholder: /* @__PURE__ */ React__default.createElement("div", null, "Type here.."),
|
|
68
|
-
ErrorBoundary: LexicalErrorBoundary
|
|
69
|
-
}
|
|
70
|
-
))));
|
|
71
|
-
}
|
|
72
|
-
const InlineJsxComponent = ({ attributes, componentName, onSubmit }) => {
|
|
73
|
-
const [open, setOpen] = React__default.useState(false);
|
|
74
|
-
const decoratedOnSubmit = React__default.useCallback(
|
|
75
|
-
(values) => {
|
|
76
|
-
onSubmit(values);
|
|
77
|
-
setOpen(false);
|
|
78
|
-
},
|
|
79
|
-
[onSubmit]
|
|
80
|
-
);
|
|
81
|
-
return /* @__PURE__ */ React__default.createElement(RadixPopover.Root, { open, onOpenChange: (v) => setOpen(v) }, /* @__PURE__ */ React__default.createElement(PopoverTrigger, null, /* @__PURE__ */ React__default.createElement(SettingsIcon, null)), /* @__PURE__ */ React__default.createElement(RadixPopover.Portal, null, /* @__PURE__ */ React__default.createElement(PopoverContent, null, /* @__PURE__ */ React__default.createElement(JsxPropertyPanel, { attributes, componentName, onSubmit: decoratedOnSubmit }))));
|
|
82
|
-
};
|
|
83
|
-
const JsxPropertyPanel = ({ attributes, componentName, onSubmit }) => {
|
|
84
|
-
const [jsxComponentDescriptors] = useEmitterValues("jsxComponentDescriptors");
|
|
85
|
-
const descriptor = jsxComponentDescriptors.find((descriptor2) => descriptor2.name === componentName);
|
|
86
|
-
const [editor] = useLexicalComposerContext();
|
|
87
|
-
const { register, handleSubmit } = useForm({
|
|
88
|
-
defaultValues: attributes.reduce((acc, attribute) => {
|
|
89
|
-
acc[attribute.name] = attribute.value;
|
|
90
|
-
return acc;
|
|
91
|
-
}, {})
|
|
92
|
-
});
|
|
93
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
94
|
-
"form",
|
|
95
|
-
{
|
|
96
|
-
onSubmit: handleSubmit((data) => {
|
|
97
|
-
editor.update(() => {
|
|
98
|
-
onSubmit(data);
|
|
99
|
-
});
|
|
100
|
-
})
|
|
101
|
-
},
|
|
102
|
-
/* @__PURE__ */ React__default.createElement("table", null, /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", null, "Attribute"), /* @__PURE__ */ React__default.createElement("th", null, "Value"))), /* @__PURE__ */ React__default.createElement("tbody", null, descriptor.props.map((propDescriptor) => /* @__PURE__ */ React__default.createElement("tr", { key: propDescriptor.name }, /* @__PURE__ */ React__default.createElement("td", null, " ", propDescriptor.name, " "), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement("input", { ...register(propDescriptor.name) })))))),
|
|
103
|
-
/* @__PURE__ */ React__default.createElement("button", { type: "submit" }, "Submit")
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
export {
|
|
107
|
-
JsxEditor
|
|
108
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index-21fcefae.cjs");require("@lexical/react/LexicalComposer"),require("@lexical/react/LexicalContentEditable"),require("@lexical/react/LexicalErrorBoundary"),require("@lexical/react/LexicalHorizontalRulePlugin"),require("@lexical/react/LexicalLinkPlugin"),require("@lexical/react/LexicalListPlugin"),require("@lexical/react/LexicalRichTextPlugin"),require("@lexical/react/LexicalTabIndentationPlugin"),require("classnames"),require("lexical"),require("@lexical/code"),require("@lexical/link"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("mdast-util-directive"),require("mdast-util-from-markdown"),require("mdast-util-frontmatter"),require("mdast-util-gfm-table"),require("mdast-util-mdx"),require("micromark-extension-directive"),require("micromark-extension-frontmatter"),require("micromark-extension-gfm-table"),require("micromark-extension-mdxjs"),require("@lexical/utils"),require("@lexical/react/LexicalComposerContext"),require("@lexical/selection"),require("@lexical/react/LexicalHistoryPlugin"),require("mdast-util-to-markdown"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("downshift"),require("@lexical/markdown"),require("@lexical/react/LexicalMarkdownShortcutPlugin"),require("react-diff-view"),require("unidiff"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-select"),require("@radix-ui/react-dialog"),require("@lexical/react/LexicalNestedComposer");exports.LeafDirectiveEditor=({leafDirective:i,mdastNode:t,parentEditor:a})=>{const[l]=r.useEmitterValues("customLeafDirectiveEditors"),c=e.useMemo((()=>{var e;return null==(e=l.find((({testNode:e})=>e(t))))?void 0:e.Editor}),[l,t]);return c?e.createElement(r.NestedEditorsContext.Provider,{value:{parentEditor:a,mdastNode:t,lexicalNode:i}},e.createElement(c,{mdastNode:t,parentEditor:a,leafDirective:i})):e.createElement("pre",null,JSON.stringify(t,null,2))};
|