@mdxeditor/editor 1.9.2 → 1.10.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/dist/MDXEditor.d.ts +5 -0
- package/dist/MDXEditor.js +6 -1
- package/dist/icons/add_column.svg.js +1 -2
- package/dist/icons/add_photo.svg.js +1 -2
- package/dist/icons/add_row.svg.js +1 -2
- package/dist/icons/{emergency_home.svg.js → admonition.svg.js} +2 -3
- package/dist/icons/arrow_drop_down.svg.js +3 -4
- package/dist/icons/check.svg.js +1 -2
- package/dist/icons/check_small.svg.js +7 -0
- package/dist/icons/close.svg.js +1 -2
- package/dist/icons/code.svg.js +1 -2
- package/dist/icons/content_copy.svg.js +1 -2
- package/dist/icons/delete_big.svg.js +7 -0
- package/dist/icons/delete_small.svg.js +1 -2
- package/dist/icons/difference.svg.js +1 -2
- package/dist/icons/edit.svg.js +1 -2
- package/dist/icons/extension.svg.js +7 -0
- package/dist/icons/format_align_center.svg.js +1 -2
- package/dist/icons/format_align_left.svg.js +1 -2
- package/dist/icons/format_align_right.svg.js +1 -2
- package/dist/icons/format_bold.svg.js +1 -2
- package/dist/icons/format_italic.svg.js +1 -2
- package/dist/icons/format_list_bulleted.svg.js +1 -2
- package/dist/icons/format_list_checked.svg.js +1 -2
- package/dist/icons/format_list_numbered.svg.js +1 -2
- package/dist/icons/format_underlined.svg.js +1 -2
- package/dist/icons/frame_source.svg.js +1 -2
- package/dist/icons/frontmatter.svg.js +1 -2
- package/dist/icons/horizontal_rule.svg.js +1 -2
- package/dist/icons/insert_col_left.svg.js +1 -2
- package/dist/icons/insert_col_right.svg.js +1 -2
- package/dist/icons/insert_row_above.svg.js +1 -2
- package/dist/icons/insert_row_below.svg.js +1 -2
- package/dist/icons/link.svg.js +1 -2
- package/dist/icons/link_off.svg.js +1 -2
- package/dist/icons/markdown.svg.js +1 -2
- package/dist/icons/more_horiz.svg.js +1 -2
- package/dist/icons/more_vert.svg.js +7 -0
- package/dist/icons/open_in_new.svg.js +1 -2
- package/dist/icons/redo.svg.js +1 -2
- package/dist/icons/rich_text.svg.js +1 -2
- package/dist/icons/{deployed_code.svg.js → sandpack.svg.js} +2 -3
- package/dist/icons/settings.svg.js +1 -2
- package/dist/icons/table.svg.js +1 -2
- package/dist/icons/undo.svg.js +1 -2
- package/dist/plugins/codeblock/index.d.ts +13 -2
- package/dist/plugins/codemirror/index.d.ts +17 -2
- package/dist/plugins/core/Icon.d.ts +6 -0
- package/dist/plugins/core/Icon.js +96 -0
- package/dist/plugins/core/PropertyPopover.js +3 -2
- package/dist/plugins/core/index.d.ts +12 -2
- package/dist/plugins/core/index.js +7 -2
- package/dist/plugins/core/ui/DownshiftAutoComplete.js +3 -2
- package/dist/plugins/diff-source/index.d.ts +13 -2
- package/dist/plugins/directives/index.d.ts +13 -2
- package/dist/plugins/frontmatter/FrontmatterEditor.js +7 -5
- package/dist/plugins/frontmatter/index.d.ts +13 -2
- package/dist/plugins/headings/index.d.ts +13 -2
- package/dist/plugins/image/ImageEditor.js +3 -2
- package/dist/plugins/image/index.d.ts +13 -2
- package/dist/plugins/jsx/index.d.ts +13 -2
- package/dist/plugins/link/index.d.ts +2 -0
- package/dist/plugins/link-dialog/LinkDialog.js +11 -14
- package/dist/plugins/link-dialog/index.d.ts +11 -2
- package/dist/plugins/lists/index.d.ts +13 -2
- package/dist/plugins/markdown-shortcut/index.d.ts +2 -0
- package/dist/plugins/quote/index.d.ts +10 -2
- package/dist/plugins/sandpack/index.d.ts +17 -2
- package/dist/plugins/table/TableEditor.js +22 -28
- package/dist/plugins/table/index.d.ts +13 -2
- package/dist/plugins/thematic-break/index.d.ts +13 -2
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +4 -6
- package/dist/plugins/toolbar/components/CodeToggle.js +2 -3
- package/dist/plugins/toolbar/components/CreateLink.js +2 -2
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +4 -6
- package/dist/plugins/toolbar/components/InsertAdmonition.js +2 -2
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +2 -2
- package/dist/plugins/toolbar/components/InsertFrontmatter.js +2 -2
- package/dist/plugins/toolbar/components/InsertImage.js +2 -3
- package/dist/plugins/toolbar/components/InsertSandpack.js +2 -2
- package/dist/plugins/toolbar/components/InsertTable.js +2 -2
- package/dist/plugins/toolbar/components/InsertThematicBreak.js +2 -2
- package/dist/plugins/toolbar/components/ListsToggle.js +4 -6
- package/dist/plugins/toolbar/components/ShowSandpackInfo.js +3 -4
- package/dist/plugins/toolbar/components/UndoRedo.js +3 -4
- package/dist/plugins/toolbar/index.d.ts +11 -2
- package/dist/plugins/toolbar/primitives/DialogButton.js +4 -6
- package/dist/plugins/toolbar/primitives/TooltipWrap.js +1 -1
- package/dist/plugins/toolbar/primitives/select.js +4 -5
- package/dist/style.css +252 -236
- package/dist/styles/ui.module.css.js +105 -102
- package/package.json +2 -1
- package/dist/icons/delete.svg.js +0 -8
|
@@ -3,9 +3,6 @@ import * as RadixToolbar from "@radix-ui/react-toolbar";
|
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { useCombobox } from "downshift";
|
|
6
|
-
import DropDownIcon from "../../../icons/arrow_drop_down.svg.js";
|
|
7
|
-
import CheckIcon from "../../../icons/check.svg.js";
|
|
8
|
-
import CloseIcon from "../../../icons/close.svg.js";
|
|
9
6
|
import { corePluginHooks } from "../../core/index.js";
|
|
10
7
|
import styles from "../../../styles/ui.module.css.js";
|
|
11
8
|
import { TooltipWrap } from "./TooltipWrap.js";
|
|
@@ -34,6 +31,7 @@ const DialogButton = React__default.forwardRef(
|
|
|
34
31
|
);
|
|
35
32
|
const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlaceholder, submitButtonTitle }) => {
|
|
36
33
|
const [items, setItems] = React__default.useState(autocompleteSuggestions.slice(0, MAX_SUGGESTIONS));
|
|
34
|
+
const [iconComponentFor] = corePluginHooks.useEmitterValues("iconComponentFor");
|
|
37
35
|
const enableAutoComplete = autocompleteSuggestions.length > 0;
|
|
38
36
|
const { isOpen, getToggleButtonProps, getMenuProps, getInputProps, highlightedIndex, getItemProps, selectedItem } = useCombobox({
|
|
39
37
|
initialInputValue: "",
|
|
@@ -91,7 +89,7 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
|
|
|
91
89
|
size: 30,
|
|
92
90
|
"data-editor-dialog": true
|
|
93
91
|
}
|
|
94
|
-
), enableAutoComplete && /* @__PURE__ */ React__default.createElement("button", { "aria-label": "toggle menu", type: "button", ...getToggleButtonProps() },
|
|
92
|
+
), enableAutoComplete && /* @__PURE__ */ React__default.createElement("button", { "aria-label": "toggle menu", type: "button", ...getToggleButtonProps() }, iconComponentFor("arrow_drop_down"))), /* @__PURE__ */ React__default.createElement("div", { className: styles.downshiftAutocompleteContainer }, /* @__PURE__ */ React__default.createElement("ul", { ...getMenuProps(), "data-visible": dropdownIsVisible }, items.map((item, index) => /* @__PURE__ */ React__default.createElement(
|
|
95
93
|
"li",
|
|
96
94
|
{
|
|
97
95
|
"data-selected": selectedItem === item,
|
|
@@ -108,8 +106,8 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
|
|
|
108
106
|
"aria-label": submitButtonTitle,
|
|
109
107
|
className: classNames(styles.actionButton, styles.primaryActionButton)
|
|
110
108
|
},
|
|
111
|
-
|
|
112
|
-
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { className: styles.actionButton },
|
|
109
|
+
iconComponentFor("check")
|
|
110
|
+
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { className: styles.actionButton }, iconComponentFor("close")));
|
|
113
111
|
};
|
|
114
112
|
export {
|
|
115
113
|
DialogButton
|
|
@@ -5,7 +5,7 @@ import styles from "../../../styles/ui.module.css.js";
|
|
|
5
5
|
import { corePluginHooks } from "../../core/index.js";
|
|
6
6
|
const TooltipWrap = React__default.forwardRef(({ title, children }, ref) => {
|
|
7
7
|
const [editorRootElementRef] = corePluginHooks.useEmitterValues("editorRootElementRef");
|
|
8
|
-
return /* @__PURE__ */ React__default.createElement(Tooltip.Provider, { delayDuration: 100 }, /* @__PURE__ */ React__default.createElement(Tooltip.Root, null, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { ref, asChild: true }, /* @__PURE__ */ React__default.createElement("span",
|
|
8
|
+
return /* @__PURE__ */ React__default.createElement(Tooltip.Provider, { delayDuration: 100 }, /* @__PURE__ */ React__default.createElement(Tooltip.Root, null, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { ref, asChild: true }, /* @__PURE__ */ React__default.createElement("span", { className: styles.tooltipTrigger }, children)), /* @__PURE__ */ React__default.createElement(Tooltip.Portal, { container: editorRootElementRef == null ? void 0 : editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(Tooltip.Content, { className: classNames(styles.tooltipContent), sideOffset: 10 }, title))));
|
|
9
9
|
});
|
|
10
10
|
export {
|
|
11
11
|
TooltipWrap
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
2
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
3
|
-
import DropDownIcon from "../../../icons/arrow_drop_down.svg.js";
|
|
4
3
|
import classNames from "classnames";
|
|
5
4
|
import styles from "../../../styles/ui.module.css.js";
|
|
6
5
|
import { TooltipWrap } from "./TooltipWrap.js";
|
|
@@ -11,7 +10,7 @@ const SelectItem = React__default.forwardRef(
|
|
|
11
10
|
}
|
|
12
11
|
);
|
|
13
12
|
const SelectTrigger = ({ title, placeholder, className }) => {
|
|
14
|
-
const [readOnly] = corePluginHooks.useEmitterValues("readOnly");
|
|
13
|
+
const [readOnly, iconComponentFor] = corePluginHooks.useEmitterValues("readOnly", "iconComponentFor");
|
|
15
14
|
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(
|
|
16
15
|
RadixSelect.Trigger,
|
|
17
16
|
{
|
|
@@ -21,7 +20,7 @@ const SelectTrigger = ({ title, placeholder, className }) => {
|
|
|
21
20
|
disabled: readOnly
|
|
22
21
|
},
|
|
23
22
|
/* @__PURE__ */ React__default.createElement(RadixSelect.Value, { placeholder }),
|
|
24
|
-
/* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow },
|
|
23
|
+
/* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow }, iconComponentFor("arrow_drop_down"))
|
|
25
24
|
));
|
|
26
25
|
};
|
|
27
26
|
const SelectContent = ({
|
|
@@ -36,8 +35,8 @@ const SelectButtonTrigger = ({
|
|
|
36
35
|
title,
|
|
37
36
|
className
|
|
38
37
|
}) => {
|
|
39
|
-
const [readOnly] = corePluginHooks.useEmitterValues("readOnly");
|
|
40
|
-
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(RadixSelect.Trigger, { className: classNames(styles.toolbarButtonSelectTrigger, className), disabled: readOnly }, children, /* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow },
|
|
38
|
+
const [readOnly, iconComponentFor] = corePluginHooks.useEmitterValues("readOnly", "iconComponentFor");
|
|
39
|
+
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(RadixSelect.Trigger, { className: classNames(styles.toolbarButtonSelectTrigger, className), disabled: readOnly }, children, /* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow }, iconComponentFor("arrow_drop_down"))));
|
|
41
40
|
};
|
|
42
41
|
const Select = (props) => {
|
|
43
42
|
return /* @__PURE__ */ React__default.createElement(RadixSelect.Root, { value: props.value || void 0, onValueChange: props.onChange }, /* @__PURE__ */ React__default.createElement(SelectTrigger, { title: props.triggerTitle, placeholder: props.placeholder }), /* @__PURE__ */ React__default.createElement(SelectContent, null, props.items.map((item, index) => {
|