@mdxeditor/editor 3.30.1 → 3.31.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/MDXEditor.js +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/mdastUtilHtmlComment.js +1 -13
- package/dist/plugins/codeblock/index.js +1 -1
- package/dist/plugins/core/MdastFormattingVisitor.js +1 -1
- package/dist/plugins/core/index.js +5 -5
- package/dist/plugins/diff-source/index.js +1 -1
- package/dist/plugins/directives/index.js +2 -2
- package/dist/plugins/frontmatter/index.js +2 -2
- package/dist/plugins/headings/index.js +1 -1
- package/dist/plugins/image/ImageDialog.js +3 -3
- package/dist/plugins/image/index.js +5 -5
- package/dist/plugins/jsx/index.js +2 -2
- package/dist/plugins/link/AutoLinkPlugin.js +1 -1
- package/dist/plugins/link/index.js +1 -1
- package/dist/plugins/link-dialog/index.js +1 -1
- package/dist/plugins/lists/index.js +4 -4
- package/dist/plugins/markdown-shortcut/index.js +3 -3
- package/dist/plugins/quote/index.js +1 -1
- package/dist/plugins/table/TableEditor.js +1 -1
- package/dist/plugins/table/index.js +2 -2
- package/dist/plugins/thematic-break/index.js +1 -1
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +10 -15
- package/dist/plugins/toolbar/components/InsertTable.js +2 -2
- package/dist/plugins/toolbar/primitives/toolbar.js +2 -1
- package/dist/style.css +267 -266
- package/dist/styles/lexical-theme.module.css.js +0 -12
- package/dist/styles/ui.module.css.js +97 -139
- package/package.json +15 -14
package/dist/MDXEditor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePublisher, useCellValue, useCellValues, useRealm } from "@mdxeditor/gurx";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import { RealmWithPlugins } from "./RealmWithPlugins.js";
|
|
4
|
-
import { corePlugin, rootEditor$, useTranslation, contentEditableRef$, contentEditableClassName$, spellCheck$, composerChildren$, topAreaChildren$, editorWrappers$, placeholder$, bottomAreaChildren$,
|
|
4
|
+
import { corePlugin, editorRootElementRef$, rootEditor$, useTranslation, contentEditableRef$, contentEditableClassName$, spellCheck$, composerChildren$, topAreaChildren$, editorWrappers$, placeholder$, bottomAreaChildren$, insertMarkdown$, setMarkdown$, viewMode$, markdownSourceEditorValue$, markdown$ } from "./plugins/core/index.js";
|
|
5
5
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
6
6
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
7
7
|
import classNames from "classnames";
|
package/dist/index.d.ts
CHANGED
|
@@ -2619,7 +2619,7 @@ export declare const saveImage$: NodeRef<SaveImageParameters>;
|
|
|
2619
2619
|
*/
|
|
2620
2620
|
export declare interface SaveImageParameters extends BaseImageParameters {
|
|
2621
2621
|
src?: string;
|
|
2622
|
-
file
|
|
2622
|
+
file?: FileList;
|
|
2623
2623
|
}
|
|
2624
2624
|
|
|
2625
2625
|
/**
|
|
@@ -2733,7 +2733,7 @@ export declare const ShowSandpackInfo: () => default_2.JSX.Element;
|
|
|
2733
2733
|
* A toolbar primitive that allows you to build an UI with multiple exclusive toggle groups, like the list type toggle.
|
|
2734
2734
|
* @group Toolbar Primitives
|
|
2735
2735
|
*/
|
|
2736
|
-
export declare const SingleChoiceToggleGroup: <T extends string>({ value, onChange, className, items }: {
|
|
2736
|
+
export declare const SingleChoiceToggleGroup: <T extends string>({ value, onChange, className, ggClassName, items }: {
|
|
2737
2737
|
items: {
|
|
2738
2738
|
title: string;
|
|
2739
2739
|
value: T;
|
|
@@ -2741,6 +2741,7 @@ export declare const SingleChoiceToggleGroup: <T extends string>({ value, onChan
|
|
|
2741
2741
|
}[];
|
|
2742
2742
|
onChange: (value: T | '') => void;
|
|
2743
2743
|
value: T | '';
|
|
2744
|
+
ggClassName?: string;
|
|
2744
2745
|
className?: string;
|
|
2745
2746
|
}) => default_2.JSX.Element;
|
|
2746
2747
|
|
|
@@ -11,19 +11,7 @@ function commentFromMarkdown(_options) {
|
|
|
11
11
|
},
|
|
12
12
|
exit: {
|
|
13
13
|
comment(token) {
|
|
14
|
-
|
|
15
|
-
if (_options.ast) {
|
|
16
|
-
this.enter(
|
|
17
|
-
{
|
|
18
|
-
// @ts-expect-error: not typing this
|
|
19
|
-
type: "comment",
|
|
20
|
-
value: "",
|
|
21
|
-
commentValue: text.slice(0, -2)
|
|
22
|
-
},
|
|
23
|
-
token
|
|
24
|
-
);
|
|
25
|
-
this.exit(token);
|
|
26
|
-
}
|
|
14
|
+
this.resume();
|
|
27
15
|
}
|
|
28
16
|
}
|
|
29
17
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CodeBlockVisitor } from "./CodeBlockVisitor.js";
|
|
2
2
|
import { MdastCodeVisitor } from "./MdastCodeVisitor.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Appender, insertDecoratorNode$, codeBlockEditorDescriptors$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addActivePlugin$ } from "../core/index.js";
|
|
4
4
|
import { $createCodeBlockNode, CodeBlockNode } from "./CodeBlockNode.js";
|
|
5
5
|
import { $convertPreElement, $isCodeBlockNode, useCodeBlockEditorContext } from "./CodeBlockNode.js";
|
|
6
6
|
import { Cell, Signal, withLatestFrom, map } from "@mdxeditor/gurx";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IS_ITALIC, IS_BOLD, IS_CODE, IS_STRIKETHROUGH, IS_UNDERLINE, IS_SUPERSCRIPT, IS_SUBSCRIPT } from "../../FormatConstants.js";
|
|
2
2
|
import { $createTextNode } from "lexical";
|
|
3
3
|
function buildFormattingVisitors(tag, format) {
|
|
4
4
|
return [
|
|
@@ -3,10 +3,10 @@ import { createEmptyHistoryState } from "@lexical/react/LexicalHistoryPlugin.js"
|
|
|
3
3
|
import { $isHeadingNode } from "@lexical/rich-text";
|
|
4
4
|
import { $setBlocksType } from "@lexical/selection";
|
|
5
5
|
import { $findMatchingParent, $wrapNodeInElement, $insertNodeToNearestRoot } from "@lexical/utils";
|
|
6
|
-
import { Cell,
|
|
7
|
-
import { createCommand, FORMAT_TEXT_COMMAND, $isRootOrShadowRoot, $getRoot, $setSelection, $getSelection, $insertNodes, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_CRITICAL, DecoratorNode, $createParagraphNode, FOCUS_COMMAND, BLUR_COMMAND, $isRangeSelection, ParagraphNode, TextNode
|
|
6
|
+
import { Cell, Signal, withLatestFrom, filter, useCellValue, scan, map } from "@mdxeditor/gurx";
|
|
7
|
+
import { createCommand, FORMAT_TEXT_COMMAND, $isRootOrShadowRoot, $getRoot, $setSelection, $getSelection, $insertNodes, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_CRITICAL, DecoratorNode, $createParagraphNode, FOCUS_COMMAND, BLUR_COMMAND, $isRangeSelection, createEditor, ParagraphNode, TextNode } from "lexical";
|
|
8
8
|
import { gfmStrikethrough } from "micromark-extension-gfm-strikethrough";
|
|
9
|
-
import {
|
|
9
|
+
import { gfmStrikethroughToMarkdown, gfmStrikethroughFromMarkdown } from "mdast-util-gfm-strikethrough";
|
|
10
10
|
import { mdxJsxToMarkdown, mdxJsxFromMarkdown } from "mdast-util-mdx-jsx";
|
|
11
11
|
import { mdxJsx } from "micromark-extension-mdx-jsx";
|
|
12
12
|
import { mdxMd } from "micromark-extension-mdx-md";
|
|
@@ -27,7 +27,7 @@ import { MdastParagraphVisitor } from "./MdastParagraphVisitor.js";
|
|
|
27
27
|
import { MdastRootVisitor } from "./MdastRootVisitor.js";
|
|
28
28
|
import { MdastTextVisitor } from "./MdastTextVisitor.js";
|
|
29
29
|
import { SharedHistoryPlugin } from "./SharedHistoryPlugin.js";
|
|
30
|
-
import {
|
|
30
|
+
import { comment, commentFromMarkdown } from "../../mdastUtilHtmlComment.js";
|
|
31
31
|
import { lexicalTheme } from "../../styles/lexicalTheme.js";
|
|
32
32
|
const NESTED_EDITOR_UPDATED_COMMAND = createCommand("NESTED_EDITOR_UPDATED_COMMAND");
|
|
33
33
|
const rootEditor$ = Cell(null);
|
|
@@ -523,7 +523,7 @@ const corePlugin = realmPlugin({
|
|
|
523
523
|
r.singletonSub(onBlur$, params == null ? void 0 : params.onBlur);
|
|
524
524
|
if (!(params == null ? void 0 : params.suppressHtmlProcessing)) {
|
|
525
525
|
r.pubIn({
|
|
526
|
-
[addMdastExtension$]: [mdxJsxFromMarkdown(), commentFromMarkdown(
|
|
526
|
+
[addMdastExtension$]: [mdxJsxFromMarkdown(), commentFromMarkdown()],
|
|
527
527
|
[addSyntaxExtension$]: [mdxJsx(), mdxMd(), comment],
|
|
528
528
|
[addImportVisitor$]: MdastHTMLVisitor
|
|
529
529
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewMode$, addEditorWrapper$ } from "../core/index.js";
|
|
2
2
|
import { DiffSourceWrapper } from "./DiffSourceWrapper.js";
|
|
3
3
|
import { Cell } from "@mdxeditor/gurx";
|
|
4
4
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
2
|
-
import { insertDecoratorNode$,
|
|
2
|
+
import { insertDecoratorNode$, addToMarkdownExtension$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addSyntaxExtension$, addMdastExtension$, directiveDescriptors$ } from "../core/index.js";
|
|
3
3
|
import { Signal, map } from "@mdxeditor/gurx";
|
|
4
|
-
import {
|
|
4
|
+
import { directiveToMarkdown, directiveFromMarkdown } from "mdast-util-directive";
|
|
5
5
|
import { directive } from "micromark-extension-directive";
|
|
6
6
|
import { $createDirectiveNode, DirectiveNode } from "./DirectiveNode.js";
|
|
7
7
|
import { $isDirectiveNode } from "./DirectiveNode.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
2
|
-
import { rootEditor$, createRootEditorSubscription$,
|
|
2
|
+
import { rootEditor$, createRootEditorSubscription$, addToMarkdownExtension$, addExportVisitor$, addImportVisitor$, addLexicalNode$, addSyntaxExtension$, addMdastExtension$ } from "../core/index.js";
|
|
3
3
|
import { Cell, Action, withLatestFrom } from "@mdxeditor/gurx";
|
|
4
4
|
import { $getRoot, KEY_DOWN_COMMAND, $getSelection, $isRangeSelection, $isTextNode, COMMAND_PRIORITY_CRITICAL } from "lexical";
|
|
5
|
-
import {
|
|
5
|
+
import { frontmatterToMarkdown, frontmatterFromMarkdown } from "mdast-util-frontmatter";
|
|
6
6
|
import { frontmatter } from "micromark-extension-frontmatter";
|
|
7
7
|
import { $isFrontmatterNode, $createFrontmatterNode, FrontmatterNode } from "./FrontmatterNode.js";
|
|
8
8
|
import { LexicalFrontmatterVisitor } from "./LexicalFrontmatterVisitor.js";
|
|
@@ -3,7 +3,7 @@ import { Cell } from "@mdxeditor/gurx";
|
|
|
3
3
|
import { KEY_DOWN_COMMAND, $createParagraphNode, COMMAND_PRIORITY_LOW } from "lexical";
|
|
4
4
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
5
5
|
import { controlOrMeta } from "../../utils/detectMac.js";
|
|
6
|
-
import { createRootEditorSubscription$, convertSelectionToNode$,
|
|
6
|
+
import { createRootEditorSubscription$, convertSelectionToNode$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addActivePlugin$ } from "../core/index.js";
|
|
7
7
|
import { LexicalHeadingVisitor } from "./LexicalHeadingVisitor.js";
|
|
8
8
|
import { MdastHeadingVisitor } from "./MdastHeadingVisitor.js";
|
|
9
9
|
const FORMATTING_KEYS = [48, 49, 50, 51, 52, 53, 54];
|
|
@@ -46,11 +46,11 @@ const ImageDialog = () => {
|
|
|
46
46
|
/* @__PURE__ */ React__default.createElement(
|
|
47
47
|
"form",
|
|
48
48
|
{
|
|
49
|
-
onSubmit: (e) => {
|
|
50
|
-
void handleSubmit(saveImage)(e);
|
|
51
|
-
reset({ src: "", title: "", altText: "" });
|
|
49
|
+
onSubmit: async (e) => {
|
|
52
50
|
e.preventDefault();
|
|
53
51
|
e.stopPropagation();
|
|
52
|
+
await handleSubmit(saveImage)(e);
|
|
53
|
+
reset({ src: "", title: "", altText: "" });
|
|
54
54
|
},
|
|
55
55
|
className: styles.multiFieldForm
|
|
56
56
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $wrapNodeInElement
|
|
2
|
-
import { Signal,
|
|
3
|
-
import { $insertNodes, $isRootOrShadowRoot, $createParagraphNode,
|
|
1
|
+
import { mergeRegister, $wrapNodeInElement } from "@lexical/utils";
|
|
2
|
+
import { Signal, Cell, Action, withLatestFrom, mapTo, map } from "@mdxeditor/gurx";
|
|
3
|
+
import { createCommand, $getNodeByKey, $insertNodes, $isRootOrShadowRoot, $createParagraphNode, COMMAND_PRIORITY_EDITOR, DRAGSTART_COMMAND, COMMAND_PRIORITY_HIGH, DRAGOVER_COMMAND, COMMAND_PRIORITY_LOW, DROP_COMMAND, PASTE_COMMAND, COMMAND_PRIORITY_CRITICAL, $createRangeSelection, $setSelection, $getSelection, $isNodeSelection } from "lexical";
|
|
4
4
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
5
5
|
import { CAN_USE_DOM } from "../../utils/detectMac.js";
|
|
6
|
-
import { activeEditor$, createActiveEditorSubscription$,
|
|
6
|
+
import { activeEditor$, createActiveEditorSubscription$, addComposerChild$, addExportVisitor$, addLexicalNode$, addImportVisitor$ } from "../core/index.js";
|
|
7
7
|
import { EditImageToolbar } from "./EditImageToolbar.js";
|
|
8
8
|
import { ImageDialog } from "./ImageDialog.js";
|
|
9
9
|
import { $createImageNode, ImageNode, $isImageNode } from "./ImageNode.js";
|
|
@@ -57,7 +57,7 @@ const imageDialogState$ = Cell(
|
|
|
57
57
|
r.pub(internalInsertImage$, { ...values, src });
|
|
58
58
|
r.pub(imageDialogState$, { type: "inactive" });
|
|
59
59
|
};
|
|
60
|
-
if (values.file.length > 0) {
|
|
60
|
+
if (values.file && values.file.length > 0) {
|
|
61
61
|
imageUploadHandler == null ? void 0 : imageUploadHandler(values.file.item(0)).then(handler).catch((e) => {
|
|
62
62
|
throw e;
|
|
63
63
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mdxToMarkdown, mdxFromMarkdown } from "mdast-util-mdx";
|
|
2
2
|
import { mdxjs } from "micromark-extension-mdxjs";
|
|
3
|
-
import { insertDecoratorNode$,
|
|
3
|
+
import { insertDecoratorNode$, jsxComponentDescriptors$, addToMarkdownExtension$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addSyntaxExtension$, addMdastExtension$, jsxIsAvailable$ } from "../core/index.js";
|
|
4
4
|
import { $createLexicalJsxNode, LexicalJsxNode } from "./LexicalJsxNode.js";
|
|
5
5
|
import { LexicalJsxVisitor } from "./LexicalJsxVisitor.js";
|
|
6
6
|
import { MdastMdxJsEsmVisitor } from "./MdastMdxJsEsmVisitor.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AutoLinkPlugin, createLinkMatcherWithRegExp } from "@lexical/react/LexicalAutoLinkPlugin";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
const URL_REGEX = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
|
|
4
4
|
const EMAIL_REGEX = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
|
@@ -6,7 +6,7 @@ import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
|
6
6
|
import { LexicalAutoLinkPlugin } from "./AutoLinkPlugin.js";
|
|
7
7
|
import { Cell } from "@mdxeditor/gurx";
|
|
8
8
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
9
|
-
import {
|
|
9
|
+
import { addComposerChild$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addActivePlugin$ } from "../core/index.js";
|
|
10
10
|
const disableAutoLink$ = Cell(false);
|
|
11
11
|
const linkPlugin = realmPlugin({
|
|
12
12
|
init(realm, params) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $createLinkNode, TOGGLE_LINK_COMMAND, $isLinkNode, LinkNode } from "@lexical/link";
|
|
2
|
-
import { Signal, Cell, withLatestFrom, map,
|
|
2
|
+
import { Signal, Cell, Action, withLatestFrom, map, filter } from "@mdxeditor/gurx";
|
|
3
3
|
import { KEY_ESCAPE_COMMAND, COMMAND_PRIORITY_LOW, KEY_MODIFIER_COMMAND, $getSelection, $isRangeSelection, COMMAND_PRIORITY_HIGH, $createTextNode, $insertNodes, $getNearestNodeFromDOMNode } from "lexical";
|
|
4
4
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
5
5
|
import { IS_APPLE } from "../../utils/detectMac.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { currentSelection$, activeEditor$, rootEditor$,
|
|
1
|
+
import { currentSelection$, activeEditor$, rootEditor$, addNestedEditorChild$, addComposerChild$, addToMarkdownExtension$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addSyntaxExtension$, addMdastExtension$, addActivePlugin$ } from "../core/index.js";
|
|
2
2
|
import { MdastListVisitor } from "./MdastListVisitor.js";
|
|
3
3
|
import { MdastListItemVisitor } from "./MdastListItemVisitor.js";
|
|
4
4
|
import { LexicalListVisitor } from "./LexicalListVisitor.js";
|
|
5
5
|
import { LexicalListItemVisitor } from "./LexicalListItemVisitor.js";
|
|
6
|
-
import { $isListNode, ListNode, ListItemNode,
|
|
6
|
+
import { $isListNode, ListNode, ListItemNode, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INSERT_CHECK_LIST_COMMAND, REMOVE_LIST_COMMAND, $getListDepth, $isListItemNode } from "@lexical/list";
|
|
7
7
|
import { $isRootOrShadowRoot, INDENT_CONTENT_COMMAND, COMMAND_PRIORITY_CRITICAL, $getSelection, $isRangeSelection, $isElementNode } from "lexical";
|
|
8
8
|
import { TabIndentationPlugin } from "@lexical/react/LexicalTabIndentationPlugin.js";
|
|
9
9
|
import { CheckListPlugin } from "@lexical/react/LexicalCheckListPlugin.js";
|
|
10
10
|
import { ListPlugin } from "@lexical/react/LexicalListPlugin.js";
|
|
11
11
|
import { $findMatchingParent, $getNearestNodeOfType } from "@lexical/utils";
|
|
12
12
|
import { gfmTaskListItem } from "micromark-extension-gfm-task-list-item";
|
|
13
|
-
import {
|
|
14
|
-
import { Cell,
|
|
13
|
+
import { gfmTaskListItemToMarkdown, gfmTaskListItemFromMarkdown } from "mdast-util-gfm-task-list-item";
|
|
14
|
+
import { Cell, Signal, withLatestFrom } from "@mdxeditor/gurx";
|
|
15
15
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
16
16
|
const ListTypeCommandMap = /* @__PURE__ */ new Map([
|
|
17
17
|
["number", INSERT_ORDERED_LIST_COMMAND],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, QUOTE, LINK, ORDERED_LIST, UNORDERED_LIST, CHECK_LIST, CODE } from "@lexical/markdown";
|
|
2
2
|
import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
3
3
|
import { HeadingNode, $isHeadingNode, $createHeadingNode } from "@lexical/rich-text";
|
|
4
4
|
import React__default from "react";
|
|
5
5
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
6
6
|
import { CodeBlockNode, $createCodeBlockNode } from "../codeblock/CodeBlockNode.js";
|
|
7
|
-
import { activePlugins$,
|
|
7
|
+
import { activePlugins$, addNestedEditorChild$, addComposerChild$ } from "../core/index.js";
|
|
8
8
|
import { allowedHeadingLevels$ } from "../headings/index.js";
|
|
9
|
-
import { HorizontalRuleNode, $
|
|
9
|
+
import { HorizontalRuleNode, $createHorizontalRuleNode, $isHorizontalRuleNode } from "@lexical/react/LexicalHorizontalRuleNode";
|
|
10
10
|
const markdownShortcutPlugin = realmPlugin({
|
|
11
11
|
init(realm) {
|
|
12
12
|
const pluginIds = realm.getValue(activePlugins$);
|
|
@@ -2,7 +2,7 @@ import { QuoteNode } from "@lexical/rich-text";
|
|
|
2
2
|
import { MdastBlockQuoteVisitor } from "./MdastBlockQuoteVisitor.js";
|
|
3
3
|
import { LexicalQuoteVisitor } from "./LexicalQuoteVisitor.js";
|
|
4
4
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
5
|
-
import {
|
|
5
|
+
import { addExportVisitor$, addLexicalNode$, addImportVisitor$, addActivePlugin$ } from "../core/index.js";
|
|
6
6
|
const quotePlugin = realmPlugin({
|
|
7
7
|
init(realm) {
|
|
8
8
|
realm.pubIn({
|
|
@@ -15,7 +15,7 @@ import classNames from "classnames";
|
|
|
15
15
|
import styles from "../../styles/ui.module.css.js";
|
|
16
16
|
import { isPartOftheEditorUI } from "../../utils/isPartOftheEditorUI.js";
|
|
17
17
|
import { uuidv4 } from "../../utils/uuid4.js";
|
|
18
|
-
import { iconComponentFor$, readOnly$, useTranslation, importVisitors$, exportVisitors$, usedLexicalNodes$, jsxComponentDescriptors$, directiveDescriptors$, codeBlockEditorDescriptors$, jsxIsAvailable$, rootEditor$, NESTED_EDITOR_UPDATED_COMMAND
|
|
18
|
+
import { iconComponentFor$, readOnly$, useTranslation, editorRootElementRef$, importVisitors$, exportVisitors$, usedLexicalNodes$, jsxComponentDescriptors$, directiveDescriptors$, codeBlockEditorDescriptors$, jsxIsAvailable$, rootEditor$, NESTED_EDITOR_UPDATED_COMMAND } from "../core/index.js";
|
|
19
19
|
import { useCellValues } from "@mdxeditor/gurx";
|
|
20
20
|
const getCellType = (rowIndex) => {
|
|
21
21
|
if (rowIndex === 0) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
2
2
|
import { Signal, map } from "@mdxeditor/gurx";
|
|
3
|
-
import {
|
|
3
|
+
import { gfmTableToMarkdown, gfmTableFromMarkdown } from "mdast-util-gfm-table";
|
|
4
4
|
import { gfmTable } from "micromark-extension-gfm-table";
|
|
5
|
-
import { insertDecoratorNode$,
|
|
5
|
+
import { insertDecoratorNode$, addToMarkdownExtension$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addSyntaxExtension$, addMdastExtension$ } from "../core/index.js";
|
|
6
6
|
import { LexicalTableVisitor } from "./LexicalTableVisitor.js";
|
|
7
7
|
import { MdastTableVisitor } from "./MdastTableVisitor.js";
|
|
8
8
|
import { $createTableNode, TableNode } from "./TableNode.js";
|
|
@@ -2,7 +2,7 @@ import { realmPlugin } from "../../RealmWithPlugins.js";
|
|
|
2
2
|
import { INSERT_HORIZONTAL_RULE_COMMAND, HorizontalRuleNode } from "@lexical/react/LexicalHorizontalRuleNode.js";
|
|
3
3
|
import { HorizontalRulePlugin } from "@lexical/react/LexicalHorizontalRulePlugin.js";
|
|
4
4
|
import { Action, withLatestFrom } from "@mdxeditor/gurx";
|
|
5
|
-
import { activeEditor$,
|
|
5
|
+
import { activeEditor$, addComposerChild$, addExportVisitor$, addLexicalNode$, addImportVisitor$, addActivePlugin$ } from "../core/index.js";
|
|
6
6
|
import { LexicalThematicBreakVisitor } from "./LexicalThematicBreakVisitor.js";
|
|
7
7
|
import { MdastThematicBreakVisitor } from "./MdastThematicBreakVisitor.js";
|
|
8
8
|
const insertThematicBreak$ = Action((r) => {
|
|
@@ -21,23 +21,18 @@ const DiffSourceToggleWrapper = ({
|
|
|
21
21
|
if (options.includes("source")) {
|
|
22
22
|
toggleGroupItems.push({ title: t("toolbar.source", "Source mode"), contents: iconComponentFor("markdown"), value: "source" });
|
|
23
23
|
}
|
|
24
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, viewMode === "rich-text" ? children : viewMode === "diff" ? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.diffMode", "Diff mode")) : SourceToolbar ?? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.source", "Source mode")), /* @__PURE__ */ React__default.createElement(
|
|
25
|
-
|
|
24
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, viewMode === "rich-text" ? children : viewMode === "diff" ? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.diffMode", "Diff mode")) : SourceToolbar ?? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.source", "Source mode")), /* @__PURE__ */ React__default.createElement("div", { className: styles.diffSourceToggleWrapper }, /* @__PURE__ */ React__default.createElement(
|
|
25
|
+
SingleChoiceToggleGroup,
|
|
26
26
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
value: viewMode,
|
|
34
|
-
items: toggleGroupItems,
|
|
35
|
-
onChange: (value) => {
|
|
36
|
-
changeViewMode(value === "" ? "rich-text" : value);
|
|
37
|
-
}
|
|
27
|
+
className: styles.diffSourceToggle,
|
|
28
|
+
ggClassName: styles.ggDiffSourceToggle,
|
|
29
|
+
value: viewMode,
|
|
30
|
+
items: toggleGroupItems,
|
|
31
|
+
onChange: (value) => {
|
|
32
|
+
changeViewMode(value === "" ? "rich-text" : value);
|
|
38
33
|
}
|
|
39
|
-
|
|
40
|
-
));
|
|
34
|
+
}
|
|
35
|
+
)));
|
|
41
36
|
};
|
|
42
37
|
export {
|
|
43
38
|
DiffSourceToggleWrapper
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonWithTooltip } from "../primitives/toolbar.js";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import { insertTable$ } from "../../table/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useCellValue, usePublisher, Cell, map } from "@mdxeditor/gurx";
|
|
5
|
+
import { iconComponentFor$, useTranslation, activeEditor$ } from "../../core/index.js";
|
|
6
6
|
const disableInsertTableButton$ = Cell(false, (r) => {
|
|
7
7
|
r.link(
|
|
8
8
|
r.pipe(
|
|
@@ -70,10 +70,11 @@ const SingleChoiceToggleGroup = ({
|
|
|
70
70
|
value,
|
|
71
71
|
onChange,
|
|
72
72
|
className,
|
|
73
|
+
ggClassName,
|
|
73
74
|
items
|
|
74
75
|
}) => {
|
|
75
76
|
const t = useTranslation();
|
|
76
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: styles.toolbarGroupOfGroups }, /* @__PURE__ */ React__default.createElement(
|
|
77
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.toolbarGroupOfGroups, ggClassName) }, /* @__PURE__ */ React__default.createElement(
|
|
77
78
|
RadixToolbar.ToggleGroup,
|
|
78
79
|
{
|
|
79
80
|
"aria-label": t("toolbar.toggleGroup", "toggle group"),
|