PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / ai-edit / highlight-format.js

highlight-format.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/ai-edit/highlight-format.js

28 lines 884 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from "@wordpress/i18n";
2 import { registerFormatType, toggleFormat } from "@wordpress/rich-text";
3 import { RichTextToolbarButton } from "@wordpress/block-editor";
4
5 const FORMAT_NAME = "betterdocs/highlight";
6
7 const highlightIcon = (
8 <svg width="20" height="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
9 <path d="M5 18l3.5-3.5 6-6L18 12l-7 7H5v-1zm10.5-13.5l3 3-2 2-3-3 2-2z" fill="currentColor" />
10 </svg>
11 );
12
13 const Edit = ({ isActive, value, onChange }) => (
14 <RichTextToolbarButton
15 icon={highlightIcon}
16 title={__("Highlight", "betterdocs")}
17 onClick={() => onChange(toggleFormat(value, { type: FORMAT_NAME }))}
18 isActive={isActive}
19 />
20 );
21
22 registerFormatType(FORMAT_NAME, {
23 title: __("Highlight", "betterdocs"),
24 tagName: "span",
25 className: "highlight",
26 edit: Edit,
27 });
28