UNPKG

nilfam-editor

Version:

A powerful, customizable rich-text editor built with TipTap, React, and Tailwind CSS. Supports RTL/LTR text, resizable media (images/videos), tables, code blocks, font styling, and more for an enhanced content creation experience.

355 lines (322 loc) 20 kB
// https://tabler.io/icons export const BoldIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-bold"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M7 5h6a3.5 3.5 0 0 1 0 7h-6z"/> <path d="M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"/> </svg> ); export const ItalicIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-italic"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M11 5l6 0"/> <path d="M7 19l6 0"/> <path d="M14 5l-4 14"/> </svg> ); export const LinkIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-link"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M9 15l6 -6"/> <path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"/> <path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"/> </svg> ); export const LinkOffIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-link-off"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M9 15l3 -3m2 -2l1 -1"/> <path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"/> <path d="M3 3l18 18"/> <path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"/> </svg> ); export const ImageIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-photo"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M15 8h.01"/> <path d="M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z"/> <path d="M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"/> <path d="M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"/> </svg> ); export const VideoIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-video"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M15 10l4.553 -2.276a1 1 0 0 1 1.447 .894v6.764a1 1 0 0 1 -1.447 .894l-4.553 -2.276v-4z"/> <path d="M3 6m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"/> </svg> ); export const AudioIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-microphone-2"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M15 12.9a5 5 0 1 0 -3.902 -3.9"/> <path d="M15 12.9l-3.902 -3.899l-7.513 8.584a2 2 0 1 0 2.827 2.83l8.588 -7.515z"/> </svg> ); export const AlignRightIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-align-right"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 6l16 0"/> <path d="M10 12l10 0"/> <path d="M6 18l14 0"/> </svg> ); export const AlignCenterIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-align-center"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 6l16 0"/> <path d="M8 12l8 0"/> <path d="M6 18l12 0"/> </svg> ); export const AlignLeftIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-align-left"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 6l16 0"/> <path d="M4 12l10 0"/> <path d="M4 18l14 0"/> </svg> ); export const AlignJustifyIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-align-justified"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 6l16 0"/> <path d="M4 12l16 0"/> <path d="M4 18l12 0"/> </svg> ); export const TableIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-border-all"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"/> <path d="M4 12l16 0"/> <path d="M12 4l0 16"/> </svg> ); export const ListIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-list"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M9 6l11 0"/> <path d="M9 12l11 0"/> <path d="M9 18l11 0"/> <path d="M5 6l0 .01"/> <path d="M5 12l0 .01"/> <path d="M5 18l0 .01"/> </svg> ); export const ListCheckIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-list-check"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M3.5 5.5l1.5 1.5l2.5 -2.5"/> <path d="M3.5 11.5l1.5 1.5l2.5 -2.5"/> <path d="M3.5 17.5l1.5 1.5l2.5 -2.5"/> <path d="M11 6l9 0"/> <path d="M11 12l9 0"/> <path d="M11 18l9 0"/> </svg> ); export const ListNumberIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-list-numbers"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M11 6h9"/> <path d="M11 12h9"/> <path d="M12 18h8"/> <path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"/> <path d="M6 10v-6l-2 2"/> </svg> ); export const StyleClearIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-clear-formatting"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M17 15l4 4m0 -4l-4 4"/> <path d="M7 6v-1h11v1"/> <path d="M7 19l4 0"/> <path d="M13 5l-4 14"/> </svg> ); export const PaletteIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-palette"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25"/> <path d="M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/> <path d="M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/> <path d="M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/> </svg> ); export const BorderIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-border-sides"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 8v8"/> <path d="M20 16v-8"/> <path d="M8 4h8"/> <path d="M8 20h8"/> </svg> ); export const HighlightIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-highlight"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"/> <path d="M12.5 5.5l4 4"/> <path d="M4.5 13.5l4 4"/> <path d="M21 15v4h-8l4 -4z"/> </svg> ); export const IndentDecreaseIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-indent-decrease"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M20 6l-7 0"/> <path d="M20 12l-9 0"/> <path d="M20 18l-7 0"/> <path d="M8 8l-4 4l4 4"/> </svg> ) export const IndentIncreaseIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-indent-increase"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M20 6l-11 0"/> <path d="M20 12l-7 0"/> <path d="M20 18l-11 0"/> <path d="M4 8l4 4l-4 4"/> </svg> ) export const MicrophoneIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-microphone"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"/> <path d="M5 10a7 7 0 0 0 14 0"/> <path d="M8 21l8 0"/> <path d="M12 17l0 4"/> </svg> ) export const MovieIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-movie"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"/> <path d="M8 4l0 16"/> <path d="M16 4l0 16"/> <path d="M4 8l4 0"/> <path d="M4 16l4 0"/> <path d="M4 12l16 0"/> <path d="M16 8l4 0"/> <path d="M16 16l4 0"/> </svg> ) export const PhotoIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-photo"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M15 8h.01"/> <path d="M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z"/> <path d="M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"/> <path d="M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"/> </svg> ) export const EmojiIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-mood-happy"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/> <path d="M9 9l.01 0"/> <path d="M15 9l.01 0"/> <path d="M8 13a4 4 0 1 0 8 0h-8"/> </svg> ) export const XIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-x"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M18 6l-12 12"/> <path d="M6 6l12 12"/> </svg> ) export const AddRowAfterIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"> <rect width="18" height="18" x="3" y="3" rx="2"/> <path d="M3 12h18"/> <path d="M12 3v18"/> <path d="M9 15h6"/> </svg> ) export const AddColumnAfter = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"> <rect width="18" height="18" x="3" y="3" rx="2"/> <path d="M12 3v18"/> <path d="M3 9h18"/> <path d="M15 6v6"/> </svg> ) export const AlignTableRightIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-layout-align-right"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M20 4l0 16"/> <path d="M4 9m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"/> </svg> ) export const AlignTableCenterIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-layout-align-middle"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 12l5 0"/> <path d="M15 12l5 0"/> <path d="M9 6m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z"/> </svg> ) export const AlignTableLeftIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-layout-align-left"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M4 4l0 16"/> <path d="M8 9m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"/> </svg> ) export const TrashIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"> <path d="M3 6h18"/> <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/> <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/> <line x1="10" x2="10" y1="11" y2="17"/> <line x1="14" x2="14" y1="11" y2="17"/> </svg> ) export const CodeIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-code"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M7 8l-4 4l4 4"/> <path d="M17 8l4 4l-4 4"/> <path d="M14 4l-4 16"/> </svg> ) export const CodeOffIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-code-off"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M7 8l-4 4l4 4"/> <path d="M17 8l4 4l-2.5 2.5"/> <path d="M14 4l-1.201 4.805m-.802 3.207l-2 7.988"/> <path d="M3 3l18 18"/> </svg> ) export const CopyIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-copy"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z"/> <path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"/> </svg> ) export const HtmlIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-file-type-html"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M14 3v4a1 1 0 0 0 1 1h4"/> <path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"/> <path d="M2 21v-6"/> <path d="M5 15v6"/> <path d="M2 18h3"/> <path d="M20 15v6h2"/> <path d="M13 21v-6l2 3l2 -3v6"/> <path d="M7.5 15h3"/> <path d="M9 15v6"/> </svg> ) export const SourceCodeIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="icon icon-tabler icons-tabler-outline icon-tabler-source-code"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M14.5 4h2.5a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-5"/> <path d="M6 5l-2 2l2 2"/> <path d="M10 9l2 -2l-2 -2"/> </svg> )