@mdxeditor/editor 3.2.0 → 3.3.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 -5
- package/dist/defaultSvgIcons.js +330 -0
- package/dist/index.d.ts +5 -5
- package/dist/plugins/codeblock/CodeBlockNode.js +1 -0
- package/dist/plugins/codemirror/CodeMirrorEditor.js +45 -6
- package/dist/plugins/image/ImageEditor.js +17 -2
- package/dist/plugins/sandpack/SandpackEditor.js +24 -7
- package/dist/plugins/sandpack/useCodeMirrorRef.js +10 -1
- package/dist/plugins/table/TableEditor.js +16 -16
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +3 -4
- package/dist/style.css +317 -277
- package/dist/styles/ui.module.css.js +113 -104
- package/package.json +5 -3
- package/dist/icons/add_column.svg.js +0 -5
- package/dist/icons/add_photo.svg.js +0 -5
- package/dist/icons/add_row.svg.js +0 -5
- package/dist/icons/admonition.svg.js +0 -5
- package/dist/icons/arrow_drop_down.svg.js +0 -5
- package/dist/icons/check.svg.js +0 -5
- package/dist/icons/check_small.svg.js +0 -5
- package/dist/icons/close.svg.js +0 -5
- package/dist/icons/code.svg.js +0 -5
- package/dist/icons/content_copy.svg.js +0 -5
- package/dist/icons/delete_big.svg.js +0 -5
- package/dist/icons/delete_small.svg.js +0 -5
- package/dist/icons/difference.svg.js +0 -5
- package/dist/icons/edit.svg.js +0 -5
- package/dist/icons/extension.svg.js +0 -5
- package/dist/icons/format_align_center.svg.js +0 -5
- package/dist/icons/format_align_left.svg.js +0 -5
- package/dist/icons/format_align_right.svg.js +0 -5
- package/dist/icons/format_bold.svg.js +0 -5
- package/dist/icons/format_italic.svg.js +0 -5
- package/dist/icons/format_list_bulleted.svg.js +0 -5
- package/dist/icons/format_list_checked.svg.js +0 -5
- package/dist/icons/format_list_numbered.svg.js +0 -5
- package/dist/icons/format_underlined.svg.js +0 -5
- package/dist/icons/frame_source.svg.js +0 -5
- package/dist/icons/frontmatter.svg.js +0 -5
- package/dist/icons/horizontal_rule.svg.js +0 -5
- package/dist/icons/insert_col_left.svg.js +0 -5
- package/dist/icons/insert_col_right.svg.js +0 -5
- package/dist/icons/insert_row_above.svg.js +0 -5
- package/dist/icons/insert_row_below.svg.js +0 -5
- package/dist/icons/link.svg.js +0 -5
- package/dist/icons/link_off.svg.js +0 -5
- package/dist/icons/markdown.svg.js +0 -5
- package/dist/icons/more_horiz.svg.js +0 -5
- package/dist/icons/more_vert.svg.js +0 -5
- package/dist/icons/open_in_new.svg.js +0 -5
- package/dist/icons/redo.svg.js +0 -5
- package/dist/icons/rich_text.svg.js +0 -5
- package/dist/icons/sandpack.svg.js +0 -5
- package/dist/icons/settings.svg.js +0 -5
- package/dist/icons/strikethrough_s.svg.js +0 -5
- package/dist/icons/subscript.svg.js +0 -5
- package/dist/icons/superscript.svg.js +0 -5
- package/dist/icons/table.svg.js +0 -5
- package/dist/icons/undo.svg.js +0 -5
- package/dist/plugins/core/Icon.js +0 -102
|
@@ -137,7 +137,21 @@ const TableEditor = ({ mdastNode, parentEditor, lexicalTable }) => {
|
|
|
137
137
|
const className = AlignToTailwindClassMap[currentColumnAlign];
|
|
138
138
|
return /* @__PURE__ */ React__default.createElement("col", { key: colIndex, className });
|
|
139
139
|
}), readOnly ? null : /* @__PURE__ */ React__default.createElement("col", null)),
|
|
140
|
-
readOnly || /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", { className: styles.tableToolsColumn,
|
|
140
|
+
readOnly || /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", { className: styles.tableToolsColumn }), Array.from({ length: mdastNode.children[0].children.length }, (_, colIndex) => {
|
|
141
|
+
return /* @__PURE__ */ React__default.createElement("th", { key: colIndex, "data-tool-cell": true }, /* @__PURE__ */ React__default.createElement(
|
|
142
|
+
ColumnEditor,
|
|
143
|
+
{
|
|
144
|
+
...{
|
|
145
|
+
setActiveCellWithBoundaries,
|
|
146
|
+
parentEditor,
|
|
147
|
+
colIndex,
|
|
148
|
+
highlightedCoordinates,
|
|
149
|
+
lexicalTable,
|
|
150
|
+
align: (mdastNode.align ?? [])[colIndex]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
));
|
|
154
|
+
}), /* @__PURE__ */ React__default.createElement("th", { className: styles.tableToolsColumn, "data-tool-cell": true }, /* @__PURE__ */ React__default.createElement(
|
|
141
155
|
"button",
|
|
142
156
|
{
|
|
143
157
|
className: styles.iconButton,
|
|
@@ -152,21 +166,7 @@ const TableEditor = ({ mdastNode, parentEditor, lexicalTable }) => {
|
|
|
152
166
|
}
|
|
153
167
|
},
|
|
154
168
|
iconComponentFor("delete_small")
|
|
155
|
-
)),
|
|
156
|
-
return /* @__PURE__ */ React__default.createElement("th", { key: colIndex, "data-tool-cell": true }, /* @__PURE__ */ React__default.createElement(
|
|
157
|
-
ColumnEditor,
|
|
158
|
-
{
|
|
159
|
-
...{
|
|
160
|
-
setActiveCellWithBoundaries,
|
|
161
|
-
parentEditor,
|
|
162
|
-
colIndex,
|
|
163
|
-
highlightedCoordinates,
|
|
164
|
-
lexicalTable,
|
|
165
|
-
align: (mdastNode.align ?? [])[colIndex]
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
));
|
|
169
|
-
}), /* @__PURE__ */ React__default.createElement("th", { className: styles.tableToolsColumn }))),
|
|
169
|
+
)))),
|
|
170
170
|
/* @__PURE__ */ React__default.createElement("tbody", null, mdastNode.children.map((row, rowIndex) => {
|
|
171
171
|
const CellElement = getCellType(rowIndex);
|
|
172
172
|
return /* @__PURE__ */ React__default.createElement("tr", { key: rowIndex }, readOnly || /* @__PURE__ */ React__default.createElement(CellElement, { className: styles.toolCell, "data-tool-cell": true }, /* @__PURE__ */ React__default.createElement(RowEditor, { ...{ setActiveCellWithBoundaries, parentEditor, rowIndex, highlightedCoordinates, lexicalTable } })), row.children.map((mdastCell, colIndex) => {
|
|
@@ -4,7 +4,7 @@ import React__default from "react";
|
|
|
4
4
|
import { IS_BOLD, IS_ITALIC, IS_UNDERLINE, IS_STRIKETHROUGH, IS_SUPERSCRIPT, IS_SUBSCRIPT } from "../../../FormatConstants.js";
|
|
5
5
|
import { ToggleSingleGroupWithItem } from "../primitives/toolbar.js";
|
|
6
6
|
import styles from "../../../styles/ui.module.css.js";
|
|
7
|
-
const FormatButton = ({ format, addTitle, removeTitle, icon,
|
|
7
|
+
const FormatButton = ({ format, addTitle, removeTitle, icon, formatName }) => {
|
|
8
8
|
const [currentFormat, iconComponentFor] = useCellValues(currentFormat$, iconComponentFor$);
|
|
9
9
|
const applyFormat = usePublisher(applyFormat$);
|
|
10
10
|
const active = (currentFormat & format) !== 0;
|
|
@@ -17,7 +17,7 @@ const FormatButton = ({ format, addTitle, removeTitle, icon, style, formatName }
|
|
|
17
17
|
applyFormat(formatName);
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
iconComponentFor(icon)
|
|
21
21
|
);
|
|
22
22
|
};
|
|
23
23
|
const BoldItalicUnderlineToggles = () => {
|
|
@@ -47,8 +47,7 @@ const BoldItalicUnderlineToggles = () => {
|
|
|
47
47
|
addTitle: t("toolbar.underline", "Underline"),
|
|
48
48
|
removeTitle: t("toolbar.removeUnderline", "Remove underline"),
|
|
49
49
|
icon: "format_underlined",
|
|
50
|
-
formatName: "underline"
|
|
51
|
-
style: { transform: "translateY(2px)" }
|
|
50
|
+
formatName: "underline"
|
|
52
51
|
}
|
|
53
52
|
));
|
|
54
53
|
};
|