import { Quill } from 'react-quill'; // components import Iconify from '../Iconify'; // import EditorToolbarStyle from './EditorToolbarStyle'; // ---------------------------------------------------------------------- const FONT_FAMILY = ['Arial', 'Tahoma', 'Georgia', 'Impact', 'Verdana']; const FONT_SIZE = [ '8px', '9px', '10px', '12px', '14px', '16px', '20px', '24px', '32px', '42px', '54px', '68px', '84px', '98px', ]; const HEADINGS = ['Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Heading 5', 'Heading 6']; export function undoChange() { // @ts-ignore this.quill.history.undo(); } export function redoChange() { // @ts-ignore this.quill.history.redo(); } const Size = Quill.import('attributors/style/size'); Size.whitelist = FONT_SIZE; Quill.register(Size, true); const Font = Quill.import('attributors/style/font'); Font.whitelist = FONT_FAMILY; Quill.register(Font, true); export const formats = [ 'align', 'background', 'blockquote', 'bold', 'bullet', 'code', 'code-block', 'color', 'direction', 'font', 'formula', 'header', 'image', 'indent', 'italic', 'link', 'list', 'script', 'size', 'strike', 'table', 'underline', 'video', ]; type EditorToolbarProps = { id: string; isSimple?: boolean; }; export default function EditorToolbar({ id, isSimple, ...other }: EditorToolbarProps) { return (
{!isSimple && ( )} {!isSimple && ( )}
{!isSimple && (
)}
{!isSimple && (
)} {!isSimple && (
)}