feat(mail): replace contentEditable with TipTap rich text editor
- Add RichTextEditor component with TipTap (ProseMirror-based) editor - Full toolbar: bold, italic, underline, strikethrough, H1/H2/H3, bullet/numbered lists, blockquote, inline code, code block, text alignment (left/center/right/justify), text color picker, link insert/edit, image insert, clear formatting, undo/redo - Replace old contentEditable div + document.execCommand in ComposeModal - Add Placeholder extension for empty editor hint - Add ProseMirror CSS styles (lists, blockquote, code, headings, links, images) - Update signature/template insertion to work with new editor state
This commit is contained in:
@@ -91,3 +91,66 @@
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #94a3b8;
|
||||
}
|
||||
|
||||
/* TipTap editor placeholder */
|
||||
.ProseMirror p.is-editor-empty:first-child::before {
|
||||
content: attr(data-placeholder);
|
||||
float: left;
|
||||
color: #94a3b8;
|
||||
pointer-events: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* TipTap editor base styles */
|
||||
.ProseMirror {
|
||||
outline: none;
|
||||
}
|
||||
.ProseMirror ul,
|
||||
.ProseMirror ol {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
.ProseMirror ul {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.ProseMirror ol {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.ProseMirror blockquote {
|
||||
padding-left: 1rem;
|
||||
border-left: 3px solid #e2e8f0;
|
||||
margin-left: 0;
|
||||
color: #64748b;
|
||||
font-style: italic;
|
||||
}
|
||||
.ProseMirror pre {
|
||||
background: #1e293b;
|
||||
color: #e2e8f0;
|
||||
border-radius: 0.375rem;
|
||||
padding: 0.75rem 1rem;
|
||||
font-family: monospace;
|
||||
font-size: 0.875rem;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.ProseMirror code {
|
||||
background: #f1f5f9;
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.125rem 0.25rem;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
.ProseMirror pre code {
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
.ProseMirror img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
.ProseMirror a {
|
||||
color: #2563eb;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ProseMirror h1 { font-size: 1.5em; font-weight: 700; margin: 0.5em 0; }
|
||||
.ProseMirror h2 { font-size: 1.25em; font-weight: 700; margin: 0.5em 0; }
|
||||
.ProseMirror h3 { font-size: 1.1em; font-weight: 600; margin: 0.5em 0; }
|
||||
|
||||
Reference in New Issue
Block a user