@nkzw/mdx-editor 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/UPSTREAM.md +21 -0
- package/dist/EditorIcon.js +75 -0
- package/dist/FormatConstants.js +20 -0
- package/dist/MDXEditor.js +189 -0
- package/dist/MarkdownEditor.js +281 -0
- package/dist/PersistentMarkdownEditor.js +358 -0
- package/dist/RealmWithPlugins.js +35 -0
- package/dist/core.d.ts +3232 -0
- package/dist/core.js +354 -0
- package/dist/defaultSvgIcons.js +371 -0
- package/dist/directive-editors/AdmonitionDirectiveDescriptor.js +28 -0
- package/dist/directive-editors/GenericDirectiveEditor.js +37 -0
- package/dist/exportMarkdownFromLexical.js +262 -0
- package/dist/horizontalRuleShortcut.js +37 -0
- package/dist/importMarkdownToLexical.js +172 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +8 -0
- package/dist/jsx-editors/GenericJsxEditor.js +84 -0
- package/dist/mdastUtilHtmlComment.js +125 -0
- package/dist/persistence.d.ts +128 -0
- package/dist/persistence.js +4 -0
- package/dist/plugins/codeblock/CodeBlockNode.js +183 -0
- package/dist/plugins/codeblock/CodeBlockVisitor.js +14 -0
- package/dist/plugins/codeblock/MdastCodeVisitor.js +23 -0
- package/dist/plugins/codeblock/findCodeBlockDescriptor.js +8 -0
- package/dist/plugins/codeblock/index.js +46 -0
- package/dist/plugins/codemirror/CodeMirrorEditor.js +145 -0
- package/dist/plugins/codemirror/index.js +115 -0
- package/dist/plugins/codemirror/useCodeMirrorRef.js +101 -0
- package/dist/plugins/core/GenericHTMLNode.js +118 -0
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.js +15 -0
- package/dist/plugins/core/LexicalLinebreakVisitor.js +10 -0
- package/dist/plugins/core/LexicalParagraphVisitor.js +10 -0
- package/dist/plugins/core/LexicalRootVisitor.js +10 -0
- package/dist/plugins/core/LexicalTextVisitor.js +160 -0
- package/dist/plugins/core/MdastBreakVisitor.js +10 -0
- package/dist/plugins/core/MdastFormattingVisitor.js +81 -0
- package/dist/plugins/core/MdastHTMLNode.js +120 -0
- package/dist/plugins/core/MdastHTMLVisitor.js +17 -0
- package/dist/plugins/core/MdastParagraphVisitor.js +23 -0
- package/dist/plugins/core/MdastRootVisitor.js +9 -0
- package/dist/plugins/core/MdastTextVisitor.js +16 -0
- package/dist/plugins/core/NestedLexicalEditor.js +221 -0
- package/dist/plugins/core/PropertyPopover.js +75 -0
- package/dist/plugins/core/SharedHistoryPlugin.js +10 -0
- package/dist/plugins/core/index.js +692 -0
- package/dist/plugins/core/ui/DownshiftAutoComplete.js +89 -0
- package/dist/plugins/core/ui/PopoverUtils.js +22 -0
- package/dist/plugins/diff-source/DiffSourceWrapper.js +24 -0
- package/dist/plugins/diff-source/DiffViewer.js +84 -0
- package/dist/plugins/diff-source/SourceEditor.js +60 -0
- package/dist/plugins/diff-source/index.js +27 -0
- package/dist/plugins/directives/DirectiveNode.js +107 -0
- package/dist/plugins/directives/DirectiveVisitor.js +10 -0
- package/dist/plugins/directives/MdastDirectiveVisitor.js +30 -0
- package/dist/plugins/directives/index.js +45 -0
- package/dist/plugins/frontmatter/FrontmatterEditor.js +137 -0
- package/dist/plugins/frontmatter/FrontmatterNode.js +70 -0
- package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.js +10 -0
- package/dist/plugins/frontmatter/MdastFrontmatterVisitor.js +10 -0
- package/dist/plugins/frontmatter/index.js +113 -0
- package/dist/plugins/headings/LexicalHeadingVisitor.js +11 -0
- package/dist/plugins/headings/MdastHeadingVisitor.js +10 -0
- package/dist/plugins/headings/index.js +63 -0
- package/dist/plugins/image/EditImageToolbar.js +58 -0
- package/dist/plugins/image/ImageDialog.js +132 -0
- package/dist/plugins/image/ImageEditor.js +279 -0
- package/dist/plugins/image/ImageNode.js +187 -0
- package/dist/plugins/image/ImagePlaceholder.js +9 -0
- package/dist/plugins/image/ImageResizer.js +223 -0
- package/dist/plugins/image/LexicalImageVisitor.js +42 -0
- package/dist/plugins/image/MdastImageVisitor.js +91 -0
- package/dist/plugins/image/index.js +364 -0
- package/dist/plugins/jsx/LexicalJsxNode.js +103 -0
- package/dist/plugins/jsx/LexicalJsxVisitor.js +27 -0
- package/dist/plugins/jsx/LexicalMdxExpressionNode.js +130 -0
- package/dist/plugins/jsx/LexicalMdxExpressionVisitor.js +14 -0
- package/dist/plugins/jsx/MdastMdxExpressionVisitor.js +11 -0
- package/dist/plugins/jsx/MdastMdxJsEsmVisitor.js +8 -0
- package/dist/plugins/jsx/MdastMdxJsxElementVisitor.js +28 -0
- package/dist/plugins/jsx/index.js +97 -0
- package/dist/plugins/jsx/jsxTagName.js +7 -0
- package/dist/plugins/link/AutoLinkPlugin.js +18 -0
- package/dist/plugins/link/LexicalLinkVisitor.js +10 -0
- package/dist/plugins/link/MdastLinkVisitor.js +14 -0
- package/dist/plugins/link/index.js +34 -0
- package/dist/plugins/link-dialog/LinkDialog.js +262 -0
- package/dist/plugins/link-dialog/index.js +304 -0
- package/dist/plugins/lists/CheckListPlugin.js +270 -0
- package/dist/plugins/lists/LexicalListItemVisitor.js +41 -0
- package/dist/plugins/lists/LexicalListVisitor.js +13 -0
- package/dist/plugins/lists/MdastListItemVisitor.js +11 -0
- package/dist/plugins/lists/MdastListVisitor.js +19 -0
- package/dist/plugins/lists/NotesListItemNode.js +22 -0
- package/dist/plugins/lists/index.js +111 -0
- package/dist/plugins/markdown-shortcut/index.js +114 -0
- package/dist/plugins/maxlength/index.js +36 -0
- package/dist/plugins/quote/LexicalQuoteVisitor.js +10 -0
- package/dist/plugins/quote/MdastBlockQuoteVisitor.js +10 -0
- package/dist/plugins/quote/index.js +18 -0
- package/dist/plugins/remote/index.js +52 -0
- package/dist/plugins/search/index.js +360 -0
- package/dist/plugins/table/LexicalTableVisitor.js +10 -0
- package/dist/plugins/table/MdastTableVisitor.js +10 -0
- package/dist/plugins/table/TableEditor.js +527 -0
- package/dist/plugins/table/TableNode.js +208 -0
- package/dist/plugins/table/index.js +66 -0
- package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.js +10 -0
- package/dist/plugins/thematic-break/MdastThematicBreakVisitor.js +10 -0
- package/dist/plugins/thematic-break/index.js +27 -0
- package/dist/plugins/toolbar/components/BlockTypeSelect.js +62 -0
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +98 -0
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +43 -0
- package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js +42 -0
- package/dist/plugins/toolbar/components/CodeToggle.js +21 -0
- package/dist/plugins/toolbar/components/CreateLink.js +24 -0
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +42 -0
- package/dist/plugins/toolbar/components/HighlightToggle.js +28 -0
- package/dist/plugins/toolbar/components/InsertAdmonition.js +34 -0
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +23 -0
- package/dist/plugins/toolbar/components/InsertFrontmatter.js +28 -0
- package/dist/plugins/toolbar/components/InsertImage.js +29 -0
- package/dist/plugins/toolbar/components/InsertTable.js +25 -0
- package/dist/plugins/toolbar/components/InsertThematicBreak.js +23 -0
- package/dist/plugins/toolbar/components/KitchenSinkToolbar.js +82 -0
- package/dist/plugins/toolbar/components/ListsToggle.js +29 -0
- package/dist/plugins/toolbar/components/UndoRedo.js +60 -0
- package/dist/plugins/toolbar/index.js +32 -0
- package/dist/plugins/toolbar/primitives/DialogButton.js +130 -0
- package/dist/plugins/toolbar/primitives/TooltipWrap.js +17 -0
- package/dist/plugins/toolbar/primitives/select.js +76 -0
- package/dist/plugins/toolbar/primitives/toolbar.js +144 -0
- package/dist/registerCodeBoundaryEscape.js +40 -0
- package/dist/styles/lexical-theme.module.css.js +62 -0
- package/dist/styles/lexicalTheme.js +32 -0
- package/dist/styles/ui.module.css.js +296 -0
- package/dist/styles.css +2838 -0
- package/dist/utils/detectMac.js +16 -0
- package/dist/utils/fp.js +44 -0
- package/dist/utils/isPartOftheEditorUI.js +12 -0
- package/dist/utils/lexicalHelpers.js +185 -0
- package/dist/utils/makeHslTransparent.js +6 -0
- package/dist/utils/mergeStyleAttributes.js +22 -0
- package/dist/utils/uuid4.js +10 -0
- package/dist/utils/voidEmitter.js +15 -0
- package/package.json +133 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as RadixSelect from "@radix-ui/react-select";
|
|
3
|
+
import * as RadixToolbar from "@radix-ui/react-toolbar";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import styles from "../../../styles/ui.module.css.js";
|
|
7
|
+
import { TooltipWrap } from "./TooltipWrap.js";
|
|
8
|
+
import { SelectButtonTrigger, SelectContent, SelectItem } from "./select.js";
|
|
9
|
+
import { readOnly$, editorInFocus$, useTranslation } from "../../core/index.js";
|
|
10
|
+
import { useCellValue } from "@mdxeditor/gurx";
|
|
11
|
+
function decorateWithRef(Component, decoratedProps) {
|
|
12
|
+
return React.forwardRef((props, ref) => {
|
|
13
|
+
const className = classNames(decoratedProps.className, props.className);
|
|
14
|
+
return /* @__PURE__ */ jsx(Component, { ...decoratedProps, ...props, className, ref });
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function addTooltipToChildren(Component) {
|
|
18
|
+
return ({ title, children, ...props }) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(Component, { "aria-label": title, ...props, children: /* @__PURE__ */ jsx(TooltipWrap, { title, children }) });
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const Root = ({ readOnly, children, className }) => {
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
RadixToolbar.Root,
|
|
25
|
+
{
|
|
26
|
+
className: classNames("mdxeditor-toolbar", styles.toolbarRoot, { [styles.readOnlyToolbarRoot]: readOnly }, className),
|
|
27
|
+
...readOnly ? { tabIndex: -1 } : {},
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
const Button = decorateWithRef(RadixToolbar.Button, { className: styles.toolbarButton, "data-toolbar-item": true });
|
|
33
|
+
const ButtonWithTooltip = addTooltipToChildren(Button);
|
|
34
|
+
const ToolbarToggleItem = decorateWithRef(RadixToolbar.ToggleItem, {
|
|
35
|
+
className: styles.toolbarToggleItem,
|
|
36
|
+
"data-toolbar-item": true
|
|
37
|
+
});
|
|
38
|
+
const SingleToggleGroup = decorateWithRef(RadixToolbar.ToggleGroup, {
|
|
39
|
+
type: "single",
|
|
40
|
+
className: styles.toolbarToggleSingleGroup
|
|
41
|
+
});
|
|
42
|
+
const ToggleSingleGroupWithItem = React.forwardRef(({ on, title, children, disabled, ...props }, forwardedRef) => {
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
RadixToolbar.ToggleGroup,
|
|
45
|
+
{
|
|
46
|
+
type: "single",
|
|
47
|
+
className: styles.toolbarToggleSingleGroup,
|
|
48
|
+
...props,
|
|
49
|
+
value: on ? "on" : "off",
|
|
50
|
+
ref: forwardedRef,
|
|
51
|
+
children: /* @__PURE__ */ jsx(ToolbarToggleItem, { "aria-label": title, value: "on", disabled, children: /* @__PURE__ */ jsx(TooltipWrap, { title, children }) })
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
const MultipleChoiceToggleGroup = ({ items }) => {
|
|
56
|
+
return /* @__PURE__ */ jsx("div", { className: styles.toolbarGroupOfGroups, children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
57
|
+
ToggleSingleGroupWithItem,
|
|
58
|
+
{
|
|
59
|
+
title: item.title,
|
|
60
|
+
on: item.active,
|
|
61
|
+
onValueChange: (v) => {
|
|
62
|
+
item.onChange(v === "on");
|
|
63
|
+
},
|
|
64
|
+
disabled: item.disabled,
|
|
65
|
+
children: item.contents
|
|
66
|
+
},
|
|
67
|
+
index
|
|
68
|
+
)) });
|
|
69
|
+
};
|
|
70
|
+
const SingleChoiceToggleGroup = ({
|
|
71
|
+
value,
|
|
72
|
+
onChange,
|
|
73
|
+
className,
|
|
74
|
+
ggClassName,
|
|
75
|
+
items,
|
|
76
|
+
disabled
|
|
77
|
+
}) => {
|
|
78
|
+
const t = useTranslation();
|
|
79
|
+
return /* @__PURE__ */ jsx("div", { className: classNames(styles.toolbarGroupOfGroups, ggClassName), children: /* @__PURE__ */ jsx(
|
|
80
|
+
RadixToolbar.ToggleGroup,
|
|
81
|
+
{
|
|
82
|
+
"aria-label": t("toolbar.toggleGroup", "toggle group"),
|
|
83
|
+
type: "single",
|
|
84
|
+
className: classNames(styles.toolbarToggleSingleGroup, className),
|
|
85
|
+
onValueChange: onChange,
|
|
86
|
+
value: value || "",
|
|
87
|
+
disabled,
|
|
88
|
+
onFocus: (e) => {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
},
|
|
91
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx(ToolbarToggleItem, { "aria-label": item.title, value: item.value, children: /* @__PURE__ */ jsx(TooltipWrap, { title: item.title, children: item.contents }) }, index))
|
|
92
|
+
}
|
|
93
|
+
) });
|
|
94
|
+
};
|
|
95
|
+
const ButtonOrDropdownButton = (props) => {
|
|
96
|
+
const readOnly = useCellValue(readOnly$);
|
|
97
|
+
return /* @__PURE__ */ jsx(Fragment, { children: props.items.length === 1 ? /* @__PURE__ */ jsx(
|
|
98
|
+
ButtonWithTooltip,
|
|
99
|
+
{
|
|
100
|
+
title: props.title,
|
|
101
|
+
onClick: () => {
|
|
102
|
+
props.onChoose("");
|
|
103
|
+
},
|
|
104
|
+
disabled: readOnly,
|
|
105
|
+
children: props.children
|
|
106
|
+
}
|
|
107
|
+
) : /* @__PURE__ */ jsxs(RadixSelect.Root, { value: "", onValueChange: props.onChoose, children: [
|
|
108
|
+
/* @__PURE__ */ jsx(SelectButtonTrigger, { title: props.title, children: props.children }),
|
|
109
|
+
/* @__PURE__ */ jsx(SelectContent, { className: styles.toolbarButtonDropdownContainer, children: props.items.map((item, index) => /* @__PURE__ */ jsx(SelectItem, { value: item.value, children: item.label }, index)) })
|
|
110
|
+
] }) });
|
|
111
|
+
};
|
|
112
|
+
function isConditionalContentsOption(option) {
|
|
113
|
+
return Object.hasOwn(option, "when");
|
|
114
|
+
}
|
|
115
|
+
const ConditionalContents = ({ options }) => {
|
|
116
|
+
const editorInFocus = useCellValue(editorInFocus$);
|
|
117
|
+
const contents = React.useMemo(() => {
|
|
118
|
+
const option = options.find((option2) => {
|
|
119
|
+
if (isConditionalContentsOption(option2)) {
|
|
120
|
+
if (option2.when(editorInFocus)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return option ? isConditionalContentsOption(option) ? option.contents() : option.fallback() : null;
|
|
128
|
+
}, [options, editorInFocus]);
|
|
129
|
+
return /* @__PURE__ */ jsx("div", { style: { display: "flex" }, children: contents });
|
|
130
|
+
};
|
|
131
|
+
const Separator = RadixToolbar.Separator;
|
|
132
|
+
export {
|
|
133
|
+
Button,
|
|
134
|
+
ButtonOrDropdownButton,
|
|
135
|
+
ButtonWithTooltip,
|
|
136
|
+
ConditionalContents,
|
|
137
|
+
MultipleChoiceToggleGroup,
|
|
138
|
+
Root,
|
|
139
|
+
Separator,
|
|
140
|
+
SingleChoiceToggleGroup,
|
|
141
|
+
SingleToggleGroup,
|
|
142
|
+
ToggleSingleGroupWithItem,
|
|
143
|
+
ToolbarToggleItem
|
|
144
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { KEY_ARROW_LEFT_COMMAND, COMMAND_PRIORITY_HIGH, KEY_ARROW_RIGHT_COMMAND, $getSelection, $isRangeSelection, $isTextNode } from "lexical";
|
|
2
|
+
import { mergeRegister } from "@lexical/utils";
|
|
3
|
+
function escapeCodeFormatAtBoundary(direction, shiftKey) {
|
|
4
|
+
if (shiftKey) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
const selection = $getSelection();
|
|
8
|
+
if (!$isRangeSelection(selection) || !selection.isCollapsed() || selection.anchor.type !== "text") {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const node = selection.anchor.getNode();
|
|
12
|
+
if (!$isTextNode(node) || !node.hasFormat("code") || !selection.hasFormat("code")) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const offset = selection.anchor.offset;
|
|
16
|
+
const isBoundary = direction === "start" ? offset === 0 && node.getPreviousSibling() === null : offset === node.getTextContentSize() && node.getNextSibling() === null;
|
|
17
|
+
if (!isBoundary) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
selection.toggleFormat("code");
|
|
21
|
+
selection.setStyle("");
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
function registerCodeBoundaryEscape(editor) {
|
|
25
|
+
return mergeRegister(
|
|
26
|
+
editor.registerCommand(
|
|
27
|
+
KEY_ARROW_LEFT_COMMAND,
|
|
28
|
+
(event) => escapeCodeFormatAtBoundary("start", event.shiftKey),
|
|
29
|
+
COMMAND_PRIORITY_HIGH
|
|
30
|
+
),
|
|
31
|
+
editor.registerCommand(
|
|
32
|
+
KEY_ARROW_RIGHT_COMMAND,
|
|
33
|
+
(event) => escapeCodeFormatAtBoundary("end", event.shiftKey),
|
|
34
|
+
COMMAND_PRIORITY_HIGH
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
registerCodeBoundaryEscape
|
|
40
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const bold = "_bold_6j9u9_10";
|
|
2
|
+
const italic = "_italic_6j9u9_14";
|
|
3
|
+
const underline = "_underline_6j9u9_18";
|
|
4
|
+
const strikethrough = "_strikethrough_6j9u9_34";
|
|
5
|
+
const underlineStrikethrough = "_underlineStrikethrough_6j9u9_38";
|
|
6
|
+
const subscript = "_subscript_6j9u9_42";
|
|
7
|
+
const superscript = "_superscript_6j9u9_47";
|
|
8
|
+
const code = "_code_6j9u9_52";
|
|
9
|
+
const quote = "_quote_6j9u9_59";
|
|
10
|
+
const nestedListItem = "_nestedListItem_6j9u9_66";
|
|
11
|
+
const listitem = "_listitem_6j9u9_76";
|
|
12
|
+
const listItemChecked = "_listItemChecked_6j9u9_80";
|
|
13
|
+
const listItemUnchecked = "_listItemUnchecked_6j9u9_81";
|
|
14
|
+
const admonitionDanger = "_admonitionDanger_6j9u9_158";
|
|
15
|
+
const admonitionInfo = "_admonitionInfo_6j9u9_159";
|
|
16
|
+
const admonitionNote = "_admonitionNote_6j9u9_160";
|
|
17
|
+
const admonitionTip = "_admonitionTip_6j9u9_161";
|
|
18
|
+
const admonitionCaution = "_admonitionCaution_6j9u9_162";
|
|
19
|
+
const mdxExpression = "_mdxExpression_6j9u9_195";
|
|
20
|
+
const lexicalThemeStyles = {
|
|
21
|
+
bold,
|
|
22
|
+
italic,
|
|
23
|
+
underline,
|
|
24
|
+
strikethrough,
|
|
25
|
+
underlineStrikethrough,
|
|
26
|
+
subscript,
|
|
27
|
+
superscript,
|
|
28
|
+
code,
|
|
29
|
+
quote,
|
|
30
|
+
nestedListItem,
|
|
31
|
+
listitem,
|
|
32
|
+
listItemChecked,
|
|
33
|
+
listItemUnchecked,
|
|
34
|
+
admonitionDanger,
|
|
35
|
+
admonitionInfo,
|
|
36
|
+
admonitionNote,
|
|
37
|
+
admonitionTip,
|
|
38
|
+
admonitionCaution,
|
|
39
|
+
mdxExpression
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
admonitionCaution,
|
|
43
|
+
admonitionDanger,
|
|
44
|
+
admonitionInfo,
|
|
45
|
+
admonitionNote,
|
|
46
|
+
admonitionTip,
|
|
47
|
+
bold,
|
|
48
|
+
code,
|
|
49
|
+
lexicalThemeStyles as default,
|
|
50
|
+
italic,
|
|
51
|
+
listItemChecked,
|
|
52
|
+
listItemUnchecked,
|
|
53
|
+
listitem,
|
|
54
|
+
mdxExpression,
|
|
55
|
+
nestedListItem,
|
|
56
|
+
quote,
|
|
57
|
+
strikethrough,
|
|
58
|
+
subscript,
|
|
59
|
+
superscript,
|
|
60
|
+
underline,
|
|
61
|
+
underlineStrikethrough
|
|
62
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import lexicalThemeStyles from "./lexical-theme.module.css.js";
|
|
2
|
+
const lexicalTheme = {
|
|
3
|
+
quote: lexicalThemeStyles.quote,
|
|
4
|
+
text: {
|
|
5
|
+
bold: lexicalThemeStyles.bold,
|
|
6
|
+
italic: lexicalThemeStyles.italic,
|
|
7
|
+
underline: lexicalThemeStyles.underline,
|
|
8
|
+
code: lexicalThemeStyles.code,
|
|
9
|
+
strikethrough: lexicalThemeStyles.strikethrough,
|
|
10
|
+
subscript: lexicalThemeStyles.subscript,
|
|
11
|
+
superscript: lexicalThemeStyles.superscript,
|
|
12
|
+
underlineStrikethrough: lexicalThemeStyles.underlineStrikethrough
|
|
13
|
+
},
|
|
14
|
+
list: {
|
|
15
|
+
listitem: lexicalThemeStyles.listitem,
|
|
16
|
+
listitemChecked: lexicalThemeStyles.listItemChecked,
|
|
17
|
+
listitemUnchecked: lexicalThemeStyles.listItemUnchecked,
|
|
18
|
+
nested: {
|
|
19
|
+
listitem: lexicalThemeStyles.nestedListItem
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
admonition: {
|
|
23
|
+
danger: lexicalThemeStyles.admonitionDanger,
|
|
24
|
+
info: lexicalThemeStyles.admonitionInfo,
|
|
25
|
+
note: lexicalThemeStyles.admonitionNote,
|
|
26
|
+
tip: lexicalThemeStyles.admonitionTip,
|
|
27
|
+
caution: lexicalThemeStyles.admonitionCaution
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
lexicalTheme
|
|
32
|
+
};
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
const editorRoot = "_editorRoot_17t84_85";
|
|
2
|
+
const editorWrapper = "_editorWrapper_17t84_187";
|
|
3
|
+
const toolbarRoot = "_toolbarRoot_17t84_194";
|
|
4
|
+
const readOnlyToolbarRoot = "_readOnlyToolbarRoot_17t84_221";
|
|
5
|
+
const toolbarToggleItem = "_toolbarToggleItem_17t84_240";
|
|
6
|
+
const toolbarGroupOfGroups = "_toolbarGroupOfGroups_17t84_251";
|
|
7
|
+
const toolbarToggleSingleGroup = "_toolbarToggleSingleGroup_17t84_256";
|
|
8
|
+
const toolbarButton = "_toolbarButton_17t84_271";
|
|
9
|
+
const activeToolbarButton = "_activeToolbarButton_17t84_307";
|
|
10
|
+
const toolbarButtonDropdownContainer = "_toolbarButtonDropdownContainer_17t84_318";
|
|
11
|
+
const selectContainer = "_selectContainer_17t84_320";
|
|
12
|
+
const selectItem = "_selectItem_17t84_333";
|
|
13
|
+
const toolbarButtonSelectTrigger = "_toolbarButtonSelectTrigger_17t84_339";
|
|
14
|
+
const selectTrigger = "_selectTrigger_17t84_340";
|
|
15
|
+
const selectDropdownArrow = "_selectDropdownArrow_17t84_405";
|
|
16
|
+
const contentEditable = "_contentEditable_17t84_411";
|
|
17
|
+
const codeMirrorWrapper = "_codeMirrorWrapper_17t84_423";
|
|
18
|
+
const codeMirrorToolbar = "_codeMirrorToolbar_17t84_440";
|
|
19
|
+
const propertyPanelTitle = "_propertyPanelTitle_17t84_462";
|
|
20
|
+
const propertyEditorTable = "_propertyEditorTable_17t84_470";
|
|
21
|
+
const iconButton = "_iconButton_17t84_488";
|
|
22
|
+
const readOnlyColumnCell = "_readOnlyColumnCell_17t84_493";
|
|
23
|
+
const buttonsFooter = "_buttonsFooter_17t84_506";
|
|
24
|
+
const propertyEditorInput = "_propertyEditorInput_17t84_512";
|
|
25
|
+
const primaryButton = "_primaryButton_17t84_526";
|
|
26
|
+
const secondaryButton = "_secondaryButton_17t84_527";
|
|
27
|
+
const smallButton = "_smallButton_17t84_542";
|
|
28
|
+
const dialogForm = "_dialogForm_17t84_554";
|
|
29
|
+
const linkDialogEditForm = "_linkDialogEditForm_17t84_560";
|
|
30
|
+
const linkDialogInputContainer = "_linkDialogInputContainer_17t84_568";
|
|
31
|
+
const linkDialogInputWrapper = "_linkDialogInputWrapper_17t84_574";
|
|
32
|
+
const linkDialogInput = "_linkDialogInput_17t84_568";
|
|
33
|
+
const linkDialogAnchor = "_linkDialogAnchor_17t84_606";
|
|
34
|
+
const linkDialogPopoverContent = "_linkDialogPopoverContent_17t84_620";
|
|
35
|
+
const tableColumnEditorPopoverContent = "_tableColumnEditorPopoverContent_17t84_621";
|
|
36
|
+
const dialogContent = "_dialogContent_17t84_622";
|
|
37
|
+
const largeDialogContent = "_largeDialogContent_17t84_634";
|
|
38
|
+
const dialogTitle = "_dialogTitle_17t84_644";
|
|
39
|
+
const dialogCloseButton = "_dialogCloseButton_17t84_650";
|
|
40
|
+
const popoverContent = "_popoverContent_17t84_657";
|
|
41
|
+
const popoverArrow = "_popoverArrow_17t84_669";
|
|
42
|
+
const linkDialogPreviewAnchor = "_linkDialogPreviewAnchor_17t84_673";
|
|
43
|
+
const tooltipTrigger = "_tooltipTrigger_17t84_704";
|
|
44
|
+
const tooltipContent = "_tooltipContent_17t84_708";
|
|
45
|
+
const actionButton = "_actionButton_17t84_722";
|
|
46
|
+
const linkDialogActionButton = "_linkDialogActionButton_17t84_729";
|
|
47
|
+
const editorIcon = "_editorIcon_17t84_733";
|
|
48
|
+
const primaryActionButton = "_primaryActionButton_17t84_744";
|
|
49
|
+
const tableEditor = "_tableEditor_17t84_756";
|
|
50
|
+
const toolCell = "_toolCell_17t84_767";
|
|
51
|
+
const tableColumnEditorTrigger = "_tableColumnEditorTrigger_17t84_786";
|
|
52
|
+
const addRowButton = "_addRowButton_17t84_788";
|
|
53
|
+
const addColumnButton = "_addColumnButton_17t84_789";
|
|
54
|
+
const tableColumnEditorToolbar = "_tableColumnEditorToolbar_17t84_862";
|
|
55
|
+
const toggleGroupRoot = "_toggleGroupRoot_17t84_876";
|
|
56
|
+
const tableToolsColumn = "_tableToolsColumn_17t84_895";
|
|
57
|
+
const leftAlignedCell = "_leftAlignedCell_17t84_904";
|
|
58
|
+
const rightAlignedCell = "_rightAlignedCell_17t84_908";
|
|
59
|
+
const centeredCell = "_centeredCell_17t84_912";
|
|
60
|
+
const tableAddButtonIcon = "_tableAddButtonIcon_17t84_939";
|
|
61
|
+
const dialogOverlay = "_dialogOverlay_17t84_987";
|
|
62
|
+
const focusedImage = "_focusedImage_17t84_1033";
|
|
63
|
+
const imageWrapper = "_imageWrapper_17t84_1037";
|
|
64
|
+
const editImageToolbar = "_editImageToolbar_17t84_1050";
|
|
65
|
+
const editImageButton = "_editImageButton_17t84_1054";
|
|
66
|
+
const inlineEditor = "_inlineEditor_17t84_1060";
|
|
67
|
+
const blockEditor = "_blockEditor_17t84_1069";
|
|
68
|
+
const nestedEditor = "_nestedEditor_17t84_1078";
|
|
69
|
+
const genericComponentName = "_genericComponentName_17t84_1097";
|
|
70
|
+
const diffSourceToggleWrapper = "_diffSourceToggleWrapper_17t84_1103";
|
|
71
|
+
const ggDiffSourceToggle = "_ggDiffSourceToggle_17t84_1111";
|
|
72
|
+
const diffSourceToggle = "_diffSourceToggle_17t84_1103";
|
|
73
|
+
const selectWithLabel = "_selectWithLabel_17t84_1129";
|
|
74
|
+
const toolbarTitleMode = "_toolbarTitleMode_17t84_1144";
|
|
75
|
+
const imageControlWrapperResizing = "_imageControlWrapperResizing_17t84_1149";
|
|
76
|
+
const imageResizer = "_imageResizer_17t84_1153";
|
|
77
|
+
const imageResizerN = "_imageResizerN_17t84_1162";
|
|
78
|
+
const imageResizerNe = "_imageResizerNe_17t84_1168";
|
|
79
|
+
const imageResizerE = "_imageResizerE_17t84_1174";
|
|
80
|
+
const imageResizerSe = "_imageResizerSe_17t84_1180";
|
|
81
|
+
const imageResizerS = "_imageResizerS_17t84_1180";
|
|
82
|
+
const imageResizerSw = "_imageResizerSw_17t84_1192";
|
|
83
|
+
const imageResizerW = "_imageResizerW_17t84_1198";
|
|
84
|
+
const imageResizerNw = "_imageResizerNw_17t84_1204";
|
|
85
|
+
const imagePlaceholder = "_imagePlaceholder_17t84_1210";
|
|
86
|
+
const imageDimensionsContainer = "_imageDimensionsContainer_17t84_1218";
|
|
87
|
+
const placeholder = "_placeholder_17t84_1223";
|
|
88
|
+
const rootContentEditableWrapper = "_rootContentEditableWrapper_17t84_1236";
|
|
89
|
+
const downshiftInputWrapper = "_downshiftInputWrapper_17t84_1246";
|
|
90
|
+
const downshiftInput = "_downshiftInput_17t84_1246";
|
|
91
|
+
const downshiftAutocompleteContainer = "_downshiftAutocompleteContainer_17t84_1292";
|
|
92
|
+
const textInput = "_textInput_17t84_1338";
|
|
93
|
+
const multiFieldForm = "_multiFieldForm_17t84_1346";
|
|
94
|
+
const formField = "_formField_17t84_1352";
|
|
95
|
+
const markdownParseError = "_markdownParseError_17t84_1363";
|
|
96
|
+
const popupContainer = "_popupContainer_17t84_1372";
|
|
97
|
+
const inputSizer = "_inputSizer_17t84_1377";
|
|
98
|
+
const styles = {
|
|
99
|
+
editorRoot,
|
|
100
|
+
editorWrapper,
|
|
101
|
+
toolbarRoot,
|
|
102
|
+
readOnlyToolbarRoot,
|
|
103
|
+
toolbarToggleItem,
|
|
104
|
+
toolbarGroupOfGroups,
|
|
105
|
+
toolbarToggleSingleGroup,
|
|
106
|
+
toolbarButton,
|
|
107
|
+
activeToolbarButton,
|
|
108
|
+
toolbarButtonDropdownContainer,
|
|
109
|
+
selectContainer,
|
|
110
|
+
selectItem,
|
|
111
|
+
toolbarButtonSelectTrigger,
|
|
112
|
+
selectTrigger,
|
|
113
|
+
selectDropdownArrow,
|
|
114
|
+
contentEditable,
|
|
115
|
+
codeMirrorWrapper,
|
|
116
|
+
codeMirrorToolbar,
|
|
117
|
+
propertyPanelTitle,
|
|
118
|
+
propertyEditorTable,
|
|
119
|
+
iconButton,
|
|
120
|
+
readOnlyColumnCell,
|
|
121
|
+
buttonsFooter,
|
|
122
|
+
propertyEditorInput,
|
|
123
|
+
primaryButton,
|
|
124
|
+
secondaryButton,
|
|
125
|
+
smallButton,
|
|
126
|
+
dialogForm,
|
|
127
|
+
linkDialogEditForm,
|
|
128
|
+
linkDialogInputContainer,
|
|
129
|
+
linkDialogInputWrapper,
|
|
130
|
+
linkDialogInput,
|
|
131
|
+
linkDialogAnchor,
|
|
132
|
+
linkDialogPopoverContent,
|
|
133
|
+
tableColumnEditorPopoverContent,
|
|
134
|
+
dialogContent,
|
|
135
|
+
largeDialogContent,
|
|
136
|
+
dialogTitle,
|
|
137
|
+
dialogCloseButton,
|
|
138
|
+
popoverContent,
|
|
139
|
+
popoverArrow,
|
|
140
|
+
linkDialogPreviewAnchor,
|
|
141
|
+
tooltipTrigger,
|
|
142
|
+
tooltipContent,
|
|
143
|
+
actionButton,
|
|
144
|
+
linkDialogActionButton,
|
|
145
|
+
editorIcon,
|
|
146
|
+
primaryActionButton,
|
|
147
|
+
tableEditor,
|
|
148
|
+
toolCell,
|
|
149
|
+
tableColumnEditorTrigger,
|
|
150
|
+
addRowButton,
|
|
151
|
+
addColumnButton,
|
|
152
|
+
tableColumnEditorToolbar,
|
|
153
|
+
toggleGroupRoot,
|
|
154
|
+
tableToolsColumn,
|
|
155
|
+
leftAlignedCell,
|
|
156
|
+
rightAlignedCell,
|
|
157
|
+
centeredCell,
|
|
158
|
+
tableAddButtonIcon,
|
|
159
|
+
dialogOverlay,
|
|
160
|
+
focusedImage,
|
|
161
|
+
imageWrapper,
|
|
162
|
+
editImageToolbar,
|
|
163
|
+
editImageButton,
|
|
164
|
+
inlineEditor,
|
|
165
|
+
blockEditor,
|
|
166
|
+
nestedEditor,
|
|
167
|
+
genericComponentName,
|
|
168
|
+
diffSourceToggleWrapper,
|
|
169
|
+
ggDiffSourceToggle,
|
|
170
|
+
diffSourceToggle,
|
|
171
|
+
selectWithLabel,
|
|
172
|
+
toolbarTitleMode,
|
|
173
|
+
imageControlWrapperResizing,
|
|
174
|
+
imageResizer,
|
|
175
|
+
imageResizerN,
|
|
176
|
+
imageResizerNe,
|
|
177
|
+
imageResizerE,
|
|
178
|
+
imageResizerSe,
|
|
179
|
+
imageResizerS,
|
|
180
|
+
imageResizerSw,
|
|
181
|
+
imageResizerW,
|
|
182
|
+
imageResizerNw,
|
|
183
|
+
imagePlaceholder,
|
|
184
|
+
imageDimensionsContainer,
|
|
185
|
+
placeholder,
|
|
186
|
+
rootContentEditableWrapper,
|
|
187
|
+
downshiftInputWrapper,
|
|
188
|
+
downshiftInput,
|
|
189
|
+
downshiftAutocompleteContainer,
|
|
190
|
+
textInput,
|
|
191
|
+
multiFieldForm,
|
|
192
|
+
formField,
|
|
193
|
+
markdownParseError,
|
|
194
|
+
popupContainer,
|
|
195
|
+
inputSizer
|
|
196
|
+
};
|
|
197
|
+
export {
|
|
198
|
+
actionButton,
|
|
199
|
+
activeToolbarButton,
|
|
200
|
+
addColumnButton,
|
|
201
|
+
addRowButton,
|
|
202
|
+
blockEditor,
|
|
203
|
+
buttonsFooter,
|
|
204
|
+
centeredCell,
|
|
205
|
+
codeMirrorToolbar,
|
|
206
|
+
codeMirrorWrapper,
|
|
207
|
+
contentEditable,
|
|
208
|
+
styles as default,
|
|
209
|
+
dialogCloseButton,
|
|
210
|
+
dialogContent,
|
|
211
|
+
dialogForm,
|
|
212
|
+
dialogOverlay,
|
|
213
|
+
dialogTitle,
|
|
214
|
+
diffSourceToggle,
|
|
215
|
+
diffSourceToggleWrapper,
|
|
216
|
+
downshiftAutocompleteContainer,
|
|
217
|
+
downshiftInput,
|
|
218
|
+
downshiftInputWrapper,
|
|
219
|
+
editImageButton,
|
|
220
|
+
editImageToolbar,
|
|
221
|
+
editorIcon,
|
|
222
|
+
editorRoot,
|
|
223
|
+
editorWrapper,
|
|
224
|
+
focusedImage,
|
|
225
|
+
formField,
|
|
226
|
+
genericComponentName,
|
|
227
|
+
ggDiffSourceToggle,
|
|
228
|
+
iconButton,
|
|
229
|
+
imageControlWrapperResizing,
|
|
230
|
+
imageDimensionsContainer,
|
|
231
|
+
imagePlaceholder,
|
|
232
|
+
imageResizer,
|
|
233
|
+
imageResizerE,
|
|
234
|
+
imageResizerN,
|
|
235
|
+
imageResizerNe,
|
|
236
|
+
imageResizerNw,
|
|
237
|
+
imageResizerS,
|
|
238
|
+
imageResizerSe,
|
|
239
|
+
imageResizerSw,
|
|
240
|
+
imageResizerW,
|
|
241
|
+
imageWrapper,
|
|
242
|
+
inlineEditor,
|
|
243
|
+
inputSizer,
|
|
244
|
+
largeDialogContent,
|
|
245
|
+
leftAlignedCell,
|
|
246
|
+
linkDialogActionButton,
|
|
247
|
+
linkDialogAnchor,
|
|
248
|
+
linkDialogEditForm,
|
|
249
|
+
linkDialogInput,
|
|
250
|
+
linkDialogInputContainer,
|
|
251
|
+
linkDialogInputWrapper,
|
|
252
|
+
linkDialogPopoverContent,
|
|
253
|
+
linkDialogPreviewAnchor,
|
|
254
|
+
markdownParseError,
|
|
255
|
+
multiFieldForm,
|
|
256
|
+
nestedEditor,
|
|
257
|
+
placeholder,
|
|
258
|
+
popoverArrow,
|
|
259
|
+
popoverContent,
|
|
260
|
+
popupContainer,
|
|
261
|
+
primaryActionButton,
|
|
262
|
+
primaryButton,
|
|
263
|
+
propertyEditorInput,
|
|
264
|
+
propertyEditorTable,
|
|
265
|
+
propertyPanelTitle,
|
|
266
|
+
readOnlyColumnCell,
|
|
267
|
+
readOnlyToolbarRoot,
|
|
268
|
+
rightAlignedCell,
|
|
269
|
+
rootContentEditableWrapper,
|
|
270
|
+
secondaryButton,
|
|
271
|
+
selectContainer,
|
|
272
|
+
selectDropdownArrow,
|
|
273
|
+
selectItem,
|
|
274
|
+
selectTrigger,
|
|
275
|
+
selectWithLabel,
|
|
276
|
+
smallButton,
|
|
277
|
+
tableAddButtonIcon,
|
|
278
|
+
tableColumnEditorPopoverContent,
|
|
279
|
+
tableColumnEditorToolbar,
|
|
280
|
+
tableColumnEditorTrigger,
|
|
281
|
+
tableEditor,
|
|
282
|
+
tableToolsColumn,
|
|
283
|
+
textInput,
|
|
284
|
+
toggleGroupRoot,
|
|
285
|
+
toolCell,
|
|
286
|
+
toolbarButton,
|
|
287
|
+
toolbarButtonDropdownContainer,
|
|
288
|
+
toolbarButtonSelectTrigger,
|
|
289
|
+
toolbarGroupOfGroups,
|
|
290
|
+
toolbarRoot,
|
|
291
|
+
toolbarTitleMode,
|
|
292
|
+
toolbarToggleItem,
|
|
293
|
+
toolbarToggleSingleGroup,
|
|
294
|
+
tooltipContent,
|
|
295
|
+
tooltipTrigger
|
|
296
|
+
};
|