style: Added placeholder to EmailEditor.tsx
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
"@tiptap/extension-image": "^3.11.0",
|
"@tiptap/extension-image": "^3.11.0",
|
||||||
"@tiptap/extension-link": "^3.11.0",
|
"@tiptap/extension-link": "^3.11.0",
|
||||||
"@tiptap/extension-mention": "^3.11.0",
|
"@tiptap/extension-mention": "^3.11.0",
|
||||||
|
"@tiptap/extension-placeholder": "^3.11.0",
|
||||||
"@tiptap/extension-table": "^3.11.0",
|
"@tiptap/extension-table": "^3.11.0",
|
||||||
"@tiptap/extension-table-cell": "^3.11.0",
|
"@tiptap/extension-table-cell": "^3.11.0",
|
||||||
"@tiptap/extension-table-header": "^3.11.0",
|
"@tiptap/extension-table-header": "^3.11.0",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {TextAlign} from '@tiptap/extension-text-align';
|
|||||||
import {Color} from '@tiptap/extension-color';
|
import {Color} from '@tiptap/extension-color';
|
||||||
import {TextStyle} from '@tiptap/extension-text-style';
|
import {TextStyle} from '@tiptap/extension-text-style';
|
||||||
import {Link} from '@tiptap/extension-link';
|
import {Link} from '@tiptap/extension-link';
|
||||||
|
import Placeholder from '@tiptap/extension-placeholder';
|
||||||
import {Variable} from './VariableExtension';
|
import {Variable} from './VariableExtension';
|
||||||
import {setAvailableVariables, VariableMention} from './VariableMention';
|
import {setAvailableVariables, VariableMention} from './VariableMention';
|
||||||
import {Toolbar} from './Toolbar';
|
import {Toolbar} from './Toolbar';
|
||||||
@@ -25,7 +26,7 @@ import {
|
|||||||
SelectContent,
|
SelectContent,
|
||||||
SelectItem,
|
SelectItem,
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue
|
||||||
} from '@plunk/ui';
|
} from '@plunk/ui';
|
||||||
import {Code2, Eye, Monitor, Smartphone, Tablet, Upload, X} from 'lucide-react';
|
import {Code2, Eye, Monitor, Smartphone, Tablet, Upload, X} from 'lucide-react';
|
||||||
import {network} from '../../lib/network';
|
import {network} from '../../lib/network';
|
||||||
@@ -153,6 +154,9 @@ export function EmailEditor({value, onChange, placeholder, subject, from, replyT
|
|||||||
ResizableImage,
|
ResizableImage,
|
||||||
Variable,
|
Variable,
|
||||||
VariableMention,
|
VariableMention,
|
||||||
|
Placeholder.configure({
|
||||||
|
placeholder: placeholder || 'Your next email starts here!',
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
// Only initialize with content if starting in visual mode
|
// Only initialize with content if starting in visual mode
|
||||||
// If starting in HTML mode (due to custom HTML), keep editor empty
|
// If starting in HTML mode (due to custom HTML), keep editor empty
|
||||||
@@ -556,7 +560,7 @@ export function EmailEditor({value, onChange, placeholder, subject, from, replyT
|
|||||||
<textarea
|
<textarea
|
||||||
value={htmlContent}
|
value={htmlContent}
|
||||||
onChange={e => handleHtmlChange(e.target.value)}
|
onChange={e => handleHtmlChange(e.target.value)}
|
||||||
placeholder={placeholder || '<h1>Welcome!</h1><p>Your email content here...</p>'}
|
placeholder={placeholder || 'Your next email starts here!'}
|
||||||
className="w-full h-full px-4 py-3 text-sm font-mono resize-none min-h-[400px] focus:outline-none"
|
className="w-full h-full px-4 py-3 text-sm font-mono resize-none min-h-[400px] focus:outline-none"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -288,7 +288,6 @@ export default function TemplateEditorPage() {
|
|||||||
<EmailEditor
|
<EmailEditor
|
||||||
value={editedTemplate.body || ''}
|
value={editedTemplate.body || ''}
|
||||||
onChange={body => setEditedTemplate({...editedTemplate, body})}
|
onChange={body => setEditedTemplate({...editedTemplate, body})}
|
||||||
placeholder="<h1>Welcome!</h1><p>Thanks for subscribing to our newsletter.</p>"
|
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -185,11 +185,7 @@ export default function CreateTemplatePage() {
|
|||||||
<CardDescription>Create your email using the visual editor or paste custom HTML</CardDescription>
|
<CardDescription>Create your email using the visual editor or paste custom HTML</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<EmailEditor
|
<EmailEditor value={body} onChange={setBody} />
|
||||||
value={body}
|
|
||||||
onChange={setBody}
|
|
||||||
placeholder="<h1>Welcome!</h1><p>Thanks for subscribing to our newsletter.</p>"
|
|
||||||
/>
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user