@mdxeditor/editor 0.0.4-development → 0.0.6-development
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/icons/check_small.svg.js +5 -0
- package/dist/icons/difference.svg.js +1 -1
- package/dist/icons/extension.svg.js +7 -0
- package/dist/plugins/core/Icon.d.ts +1 -1
- package/dist/plugins/core/Icon.js +4 -0
- package/dist/plugins/table/TableEditor.js +3 -3
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +1 -1
- package/dist/plugins/toolbar/primitives/toolbar.js +1 -1
- package/dist/style.css +194 -195
- package/dist/styles/ui.module.css.js +102 -102
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgCheckSmall = (props) => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.1122 4.21967C12.4051 3.92678 12.88 3.92678 13.1729 4.21967C13.4658 4.51256 13.4658 4.98744 13.1729 5.28033L7.57851 10.8747C7.57792 10.8753 7.57731 10.8759 7.57671 10.8765C7.50349 10.9497 7.41889 11.0047 7.32861 11.0413C7.05795 11.151 6.73617 11.0963 6.51651 10.877C6.51636 10.8768 6.51621 10.8767 6.51605 10.8765C6.51551 10.876 6.51496 10.8754 6.51441 10.8749L3.91987 8.28033C3.62697 7.98744 3.62697 7.51256 3.91987 7.21967C4.21276 6.92678 4.68763 6.92678 4.98053 7.21967L7.04639 9.28553L12.1122 4.21967Z", fill: "currentColor" }));
|
|
3
|
+
export {
|
|
4
|
+
SvgCheckSmall as default
|
|
5
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
const SvgDifference = (props) => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.75 16H15.3C15.7 16 16 15.7 16 15.3V0.599998C16 0.300003 15.7 0 15.3 0H8.75H7.5H0.600006C0.299988 0 0 0.300003 0 0.599998V15.3C0 15.7 0.299988 16 0.600006 16H7.5H8.75ZM8.75 14.7H14.7V1.2H8.75V14.7ZM7.5 14.7V1.2H1.20001V14.7H7.5Z", fill: "currentColor" }));
|
|
2
|
+
const SvgDifference = (props) => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.75 16H15.3C15.7 16 16 15.7 16 15.3V0.599998C16 0.300003 15.7 0 15.3 0H8.75H7.5H0.600006C0.299988 0 0 0.300003 0 0.599998V15.3C0 15.7 0.299988 16 0.600006 16H7.5H8.75ZM8.75 14.7H14.7V1.2H8.75V14.7ZM7.5 14.7V1.2H1.20001V14.7H7.5Z", fill: "currentColor" }), /* @__PURE__ */ React.createElement("rect", { x: 2.25, y: 11, width: 3, height: 1.25, rx: 0.625, fill: "currentColor" }), /* @__PURE__ */ React.createElement("rect", { x: 2.25, y: 8.5, width: 4, height: 1.25, rx: 0.625, fill: "currentColor" }), /* @__PURE__ */ React.createElement("rect", { x: 2.25, y: 6, width: 3, height: 1.25, rx: 0.625, fill: "currentColor" }), /* @__PURE__ */ React.createElement("rect", { x: 2.25, y: 3.5, width: 3, height: 1.25, rx: 0.625, fill: "currentColor" }), /* @__PURE__ */ React.createElement("rect", { x: 9.75, y: 8.5, width: 3, height: 1.25, rx: 0.625, fill: "currentColor" }), /* @__PURE__ */ React.createElement("rect", { x: 9.75, y: 6, width: 4, height: 1.25, rx: 0.625, fill: "currentColor" }), /* @__PURE__ */ React.createElement("rect", { x: 9.75, y: 3.5, width: 4, height: 1.25, rx: 0.625, fill: "currentColor" }));
|
|
3
3
|
export {
|
|
4
4
|
SvgDifference as default
|
|
5
5
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgExtension = (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: {
|
|
3
|
+
maskType: "alpha"
|
|
4
|
+
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "M8.8 21H5c-.55 0-1.02-.196-1.413-.587A1.926 1.926 0 0 1 3 19v-3.8c.8 0 1.5-.254 2.1-.762.6-.509.9-1.155.9-1.938 0-.783-.3-1.43-.9-1.938A3.15 3.15 0 0 0 3 9.8V6c0-.55.196-1.02.587-1.412A1.926 1.926 0 0 1 5 4h4c0-.7.242-1.292.725-1.775.483-.483 1.075-.725 1.775-.725s1.292.242 1.775.725C13.758 2.708 14 3.3 14 4h4c.55 0 1.02.196 1.413.588.391.391.587.862.587 1.412v4c.7 0 1.292.242 1.775.725.483.483.725 1.075.725 1.775s-.242 1.292-.725 1.775C21.292 14.758 20.7 15 20 15v4c0 .55-.196 1.02-.587 1.413A1.926 1.926 0 0 1 18 21h-3.8c0-.833-.262-1.542-.787-2.125C12.886 18.292 12.25 18 11.5 18s-1.387.292-1.912.875C9.063 19.458 8.8 20.167 8.8 21ZM5 19h2.125c.4-1.1 1.042-1.875 1.925-2.325.883-.45 1.7-.675 2.45-.675.75 0 1.567.225 2.45.675.883.45 1.525 1.225 1.925 2.325H18v-6h2a.48.48 0 0 0 .35-.15.48.48 0 0 0 0-.7A.48.48 0 0 0 20 12h-2V6h-6V4a.48.48 0 0 0-.15-.35.48.48 0 0 0-.7 0A.48.48 0 0 0 11 4v2H5v2.2c.9.333 1.625.892 2.175 1.675.55.783.825 1.658.825 2.625 0 .95-.275 1.817-.825 2.6A4.666 4.666 0 0 1 5 16.8V19Z" })));
|
|
5
|
+
export {
|
|
6
|
+
SvgExtension as default
|
|
7
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export type IconKey = 'add_column' | 'add_photo' | 'add_row' | 'arrow_drop_down' | 'check' | 'close' | 'code' | 'content_copy' | 'delete_big' | 'delete_small' | 'sandpack' | 'difference' | 'edit' | 'admonition' | 'format_align_center' | 'format_align_left' | 'format_align_right' | 'format_bold' | 'format_italic' | 'format_list_bulleted' | 'format_list_checked' | 'format_list_numbered' | 'format_underlined' | 'frame_source' | 'frontmatter' | 'horizontal_rule' | 'insert_col_left' | 'insert_col_right' | 'insert_row_above' | 'insert_row_below' | 'link' | 'link_off' | 'markdown' | 'more_horiz' | 'more_vert' | 'open_in_new' | 'redo' | 'rich_text' | 'settings' | 'table' | 'undo';
|
|
2
|
+
export type IconKey = 'add_column' | 'add_photo' | 'add_row' | 'arrow_drop_down' | 'check' | 'check_small' | 'close' | 'code' | 'content_copy' | 'delete_big' | 'delete_small' | 'sandpack' | 'difference' | 'edit' | 'admonition' | 'extension' | 'format_align_center' | 'format_align_left' | 'format_align_right' | 'format_bold' | 'format_italic' | 'format_list_bulleted' | 'format_list_checked' | 'format_list_numbered' | 'format_underlined' | 'frame_source' | 'frontmatter' | 'horizontal_rule' | 'insert_col_left' | 'insert_col_right' | 'insert_row_above' | 'insert_row_below' | 'link' | 'link_off' | 'markdown' | 'more_horiz' | 'more_vert' | 'open_in_new' | 'redo' | 'rich_text' | 'settings' | 'table' | 'undo';
|
|
3
3
|
declare const Icon: React.FC<{
|
|
4
4
|
name: IconKey;
|
|
5
5
|
}>;
|
|
@@ -4,6 +4,7 @@ import SvgAddPhoto from "../../icons/add_photo.svg.js";
|
|
|
4
4
|
import SvgAddRow from "../../icons/add_row.svg.js";
|
|
5
5
|
import SvgArrowDropDown from "../../icons/arrow_drop_down.svg.js";
|
|
6
6
|
import SvgCheck from "../../icons/check.svg.js";
|
|
7
|
+
import SvgCheckSmall from "../../icons/check_small.svg.js";
|
|
7
8
|
import SvgClose from "../../icons/close.svg.js";
|
|
8
9
|
import SvgCode from "../../icons/code.svg.js";
|
|
9
10
|
import SvgContentCopy from "../../icons/content_copy.svg.js";
|
|
@@ -13,6 +14,7 @@ import SvgSandpack from "../../icons/sandpack.svg.js";
|
|
|
13
14
|
import SvgDifference from "../../icons/difference.svg.js";
|
|
14
15
|
import SvgEdit from "../../icons/edit.svg.js";
|
|
15
16
|
import SvgAdmonition from "../../icons/admonition.svg.js";
|
|
17
|
+
import SvgExtension from "../../icons/extension.svg.js";
|
|
16
18
|
import SvgFormatAlignCenter from "../../icons/format_align_center.svg.js";
|
|
17
19
|
import SvgFormatAlignLeft from "../../icons/format_align_left.svg.js";
|
|
18
20
|
import SvgFormatAlignRight from "../../icons/format_align_right.svg.js";
|
|
@@ -46,6 +48,7 @@ const IconMap = {
|
|
|
46
48
|
add_row: SvgAddRow,
|
|
47
49
|
arrow_drop_down: SvgArrowDropDown,
|
|
48
50
|
check: SvgCheck,
|
|
51
|
+
check_small: SvgCheckSmall,
|
|
49
52
|
close: SvgClose,
|
|
50
53
|
code: SvgCode,
|
|
51
54
|
content_copy: SvgContentCopy,
|
|
@@ -55,6 +58,7 @@ const IconMap = {
|
|
|
55
58
|
difference: SvgDifference,
|
|
56
59
|
edit: SvgEdit,
|
|
57
60
|
admonition: SvgAdmonition,
|
|
61
|
+
extension: SvgExtension,
|
|
58
62
|
format_align_center: SvgFormatAlignCenter,
|
|
59
63
|
format_align_left: SvgFormatAlignLeft,
|
|
60
64
|
format_align_right: SvgFormatAlignRight,
|
|
@@ -134,7 +134,7 @@ const TableEditor = ({ mdastNode, parentEditor, lexicalTable }) => {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
iconComponentFor("
|
|
137
|
+
iconComponentFor("delete_big")
|
|
138
138
|
)), Array.from({ length: mdastNode.children[0].children.length }, (_, colIndex) => {
|
|
139
139
|
return /* @__PURE__ */ React__default.createElement("th", { key: colIndex, "data-tool-cell": true }, /* @__PURE__ */ React__default.createElement(
|
|
140
140
|
ColumnEditor,
|
|
@@ -341,7 +341,7 @@ const ColumnEditor = ({
|
|
|
341
341
|
/* @__PURE__ */ React__default.createElement(RadixToolbar.ToggleItem, { value: "left", title: "Align left" }, iconComponentFor("format_align_left")),
|
|
342
342
|
/* @__PURE__ */ React__default.createElement(RadixToolbar.ToggleItem, { value: "center", title: "Align center" }, iconComponentFor("format_align_center")),
|
|
343
343
|
/* @__PURE__ */ React__default.createElement(RadixToolbar.ToggleItem, { value: "right", title: "Align right" }, iconComponentFor("format_align_right"))
|
|
344
|
-
), /* @__PURE__ */ React__default.createElement(RadixToolbar.Separator, null), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertColumnAt.bind(null, colIndex), title: "Insert a column to the left of this one" }, iconComponentFor("insert_col_left")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertColumnAt.bind(null, colIndex + 1), title: "Insert a column to the right of this one" }, iconComponentFor("insert_col_right")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: deleteColumnAt.bind(null, colIndex), title: "Delete this column" }, iconComponentFor("
|
|
344
|
+
), /* @__PURE__ */ React__default.createElement(RadixToolbar.Separator, null), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertColumnAt.bind(null, colIndex), title: "Insert a column to the left of this one" }, iconComponentFor("insert_col_left")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertColumnAt.bind(null, colIndex + 1), title: "Insert a column to the right of this one" }, iconComponentFor("insert_col_right")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: deleteColumnAt.bind(null, colIndex), title: "Delete this column" }, iconComponentFor("delete_big"))),
|
|
345
345
|
/* @__PURE__ */ React__default.createElement(RadixPopover.Arrow, { className: styles.popoverArrow })
|
|
346
346
|
)));
|
|
347
347
|
};
|
|
@@ -379,7 +379,7 @@ const RowEditor = ({
|
|
|
379
379
|
sideOffset: 5,
|
|
380
380
|
side: "bottom"
|
|
381
381
|
},
|
|
382
|
-
/* @__PURE__ */ React__default.createElement(RadixToolbar.Root, { className: styles.tableColumnEditorToolbar }, /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertRowAt.bind(null, rowIndex), title: "Insert a row above this one" }, iconComponentFor("insert_row_above")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertRowAt.bind(null, rowIndex + 1), title: "Insert a row below this one" }, iconComponentFor("insert_row_below")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: deleteRowAt.bind(null, rowIndex), title: "Delete this row" }, iconComponentFor("
|
|
382
|
+
/* @__PURE__ */ React__default.createElement(RadixToolbar.Root, { className: styles.tableColumnEditorToolbar }, /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertRowAt.bind(null, rowIndex), title: "Insert a row above this one" }, iconComponentFor("insert_row_above")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: insertRowAt.bind(null, rowIndex + 1), title: "Insert a row below this one" }, iconComponentFor("insert_row_below")), /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { onClick: deleteRowAt.bind(null, rowIndex), title: "Delete this row" }, iconComponentFor("delete_big"))),
|
|
383
383
|
/* @__PURE__ */ React__default.createElement(RadixPopover.Arrow, { className: styles.popoverArrow })
|
|
384
384
|
)));
|
|
385
385
|
};
|
|
@@ -20,7 +20,7 @@ const BoldItalicUnderlineToggles = () => {
|
|
|
20
20
|
{ title: italicTitle, contents: iconComponentFor("format_italic"), active: italicIsOn, onChange: applyFormat.bind(null, "italic") },
|
|
21
21
|
{
|
|
22
22
|
title: underlineTitle,
|
|
23
|
-
contents: /* @__PURE__ */ React__default.createElement("div",
|
|
23
|
+
contents: /* @__PURE__ */ React__default.createElement("div", null, iconComponentFor("format_underlined")),
|
|
24
24
|
active: underlineIsOn,
|
|
25
25
|
onChange: applyFormat.bind(null, "underline")
|
|
26
26
|
}
|
|
@@ -97,7 +97,7 @@ const ConditionalContents = ({ options }) => {
|
|
|
97
97
|
});
|
|
98
98
|
return option ? isConditionalContentsOption(option) ? option.contents() : option.fallback() : null;
|
|
99
99
|
}, [options, editorInFocus]);
|
|
100
|
-
return /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex" } }, contents);
|
|
100
|
+
return /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", flexDirection: "row", alignItems: "center" } }, contents);
|
|
101
101
|
};
|
|
102
102
|
const Separator = RadixToolbar.Separator;
|
|
103
103
|
export {
|