@mdxeditor/editor
Advanced tools
Comparing version 2.7.1 to 2.8.0
@@ -6,17 +6,21 @@ import React__default from "react"; | ||
import { iconComponentFor$ } from "../../core/index.js"; | ||
const ListsToggle = () => { | ||
const LIST_TITLE_MAP = { | ||
bullet: "Bulleted list", | ||
number: "Numbered list", | ||
check: "Check list" | ||
}; | ||
const ICON_NAME_MAP = { | ||
bullet: "format_list_bulleted", | ||
number: "format_list_numbered", | ||
check: "format_list_checked" | ||
}; | ||
const ListsToggle = ({ options = ["bullet", "number", "check"] }) => { | ||
const [currentListType, iconComponentFor] = useCellValues(currentListType$, iconComponentFor$); | ||
const applyListType = usePublisher(applyListType$); | ||
return /* @__PURE__ */ React__default.createElement( | ||
SingleChoiceToggleGroup, | ||
{ | ||
value: currentListType || "", | ||
items: [ | ||
{ title: "Bulleted list", contents: iconComponentFor("format_list_bulleted"), value: "bullet" }, | ||
{ title: "Numbered list", contents: iconComponentFor("format_list_numbered"), value: "number" }, | ||
{ title: "Check list", contents: iconComponentFor("format_list_checked"), value: "check" } | ||
], | ||
onChange: applyListType | ||
} | ||
); | ||
const items = options.map((type) => ({ | ||
value: type, | ||
title: LIST_TITLE_MAP[type], | ||
contents: iconComponentFor(ICON_NAME_MAP[type]) | ||
})); | ||
return /* @__PURE__ */ React__default.createElement(SingleChoiceToggleGroup, { value: currentListType || "", items, onChange: applyListType }); | ||
}; | ||
@@ -23,0 +27,0 @@ export { |
@@ -14,3 +14,3 @@ { | ||
"type": "module", | ||
"version": "2.7.1", | ||
"version": "2.8.0", | ||
"description": "React component for rich text markdown editing", | ||
@@ -17,0 +17,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
494645
12888