@haklex/rich-editor 0.0.104 → 0.0.105
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/{AlertQuoteEditNode-C_Cb063D.js → AlertQuoteEditNode-CPb1jFUY.js} +1 -1
- package/dist/{MermaidPlugin-DI86n71x.js → MermaidPlugin-CJ0tqr0F.js} +8 -4
- package/dist/{SubmitShortcutPlugin-CDqj7KHO.js → SubmitShortcutPlugin-BmTJ4o1C.js} +665 -8
- package/dist/commands-entry.mjs +3 -3
- package/dist/components/RichEditor.d.ts.map +1 -1
- package/dist/components/RichEditorShell.d.ts.map +1 -1
- package/dist/{config-mAejoug-.js → config-DjJiU65k.js} +1 -1
- package/dist/context/TextSelectionContext.d.ts +18 -0
- package/dist/context/TextSelectionContext.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +38 -171
- package/dist/{node-registry-BOSH1oBi.js → node-registry-CJe4Pjdm.js} +3 -3
- package/dist/nodes/KaTeXBlockNode.d.ts +7 -2
- package/dist/nodes/KaTeXBlockNode.d.ts.map +1 -1
- package/dist/nodes/KaTeXInlineNode.d.ts +7 -2
- package/dist/nodes/KaTeXInlineNode.d.ts.map +1 -1
- package/dist/nodes-entry.mjs +4 -4
- package/dist/plugins/KaTeXPlugin.d.ts.map +1 -1
- package/dist/plugins/TextSelectionPlugin.d.ts +2 -0
- package/dist/plugins/TextSelectionPlugin.d.ts.map +1 -0
- package/dist/plugins/text-selection.css.d.ts +3 -0
- package/dist/plugins/text-selection.css.d.ts.map +1 -0
- package/dist/plugins-entry.d.ts +1 -0
- package/dist/plugins-entry.d.ts.map +1 -1
- package/dist/plugins-entry.mjs +3 -2
- package/dist/rich-editor.css +1 -1
- package/dist/static-entry.mjs +3 -3
- package/dist/{theme-CrJbATnf.js → theme-I0pMTSBW.js} +78 -10
- package/dist/utils/getRegisteredNodeKlass.d.ts +3 -0
- package/dist/utils/getRegisteredNodeKlass.d.ts.map +1 -0
- package/dist/utils/katex-defaults.d.ts +5 -0
- package/dist/utils/katex-defaults.d.ts.map +1 -0
- package/dist/utils/text-selection-constants.d.ts +3 -0
- package/dist/utils/text-selection-constants.d.ts.map +1 -0
- package/dist/utils/text-selection.d.ts +22 -0
- package/dist/utils/text-selection.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -12,7 +12,7 @@ import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
|
12
12
|
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
|
|
13
13
|
import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer";
|
|
14
14
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
15
|
-
import { s as $isAlertQuoteNode, t as AlertRenderer, S as SpoilerNode, M as MentionNode, F as FootnoteNode, k as KaTeXInlineNode, T as TagNode, v as AlertQuoteNode, n as editorTheme } from "./theme-
|
|
15
|
+
import { s as $isAlertQuoteNode, t as AlertRenderer, S as SpoilerNode, M as MentionNode, F as FootnoteNode, k as KaTeXInlineNode, T as TagNode, v as AlertQuoteNode, n as editorTheme } from "./theme-I0pMTSBW.js";
|
|
16
16
|
import { a as RendererWrapper } from "./KaTeXRenderer-CQyQzNTJ.js";
|
|
17
17
|
import { CodeNode } from "@lexical/code-core";
|
|
18
18
|
import { HorizontalRuleNode } from "@lexical/extension";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
2
2
|
import { createCommand, $insertNodes, COMMAND_PRIORITY_EDITOR } from "lexical";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
|
-
import { $ as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
5
|
-
import { $ as $createImageNode, w as $createKaTeXInlineNode, x as $createKaTeXBlockNode, b as $createMermaidNode } from "./theme-
|
|
4
|
+
import { $ as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-CPb1jFUY.js";
|
|
5
|
+
import { $ as $createImageNode, w as $createKaTeXInlineNode, x as $createKaTeXBlockNode, b as $createMermaidNode } from "./theme-I0pMTSBW.js";
|
|
6
6
|
const INSERT_ALERT_COMMAND = createCommand("INSERT_ALERT");
|
|
7
7
|
function AlertPlugin() {
|
|
8
8
|
const [editor] = useLexicalComposerContext();
|
|
@@ -46,7 +46,9 @@ function KaTeXPlugin() {
|
|
|
46
46
|
const unregisterInline = editor.registerCommand(
|
|
47
47
|
INSERT_KATEX_INLINE_COMMAND,
|
|
48
48
|
(equation) => {
|
|
49
|
-
const node = $createKaTeXInlineNode(equation
|
|
49
|
+
const node = $createKaTeXInlineNode(equation, {
|
|
50
|
+
autoOpenOnMount: !equation.trim()
|
|
51
|
+
});
|
|
50
52
|
$insertNodes([node]);
|
|
51
53
|
return true;
|
|
52
54
|
},
|
|
@@ -55,7 +57,9 @@ function KaTeXPlugin() {
|
|
|
55
57
|
const unregisterBlock = editor.registerCommand(
|
|
56
58
|
INSERT_KATEX_BLOCK_COMMAND,
|
|
57
59
|
(equation) => {
|
|
58
|
-
const node = $createKaTeXBlockNode(equation
|
|
60
|
+
const node = $createKaTeXBlockNode(equation, {
|
|
61
|
+
autoOpenOnMount: !equation.trim()
|
|
62
|
+
});
|
|
59
63
|
$insertNodes([node]);
|
|
60
64
|
return true;
|
|
61
65
|
},
|