Phase 4 of the dashboard roadmap. New RichTextEditor component (Tiptap 3.31.3, pinned past a mergeAttributes XSS advisory affecting 2.x/older 3.x - GHSA-cp6q-959q-f8rh) replaces the plain textareas for the customer/owner mail bodies in EmailSettings.jsx: bold, italic, underline, lists, links, and a font-family dropdown. Font choices are classic system fonts rather than self-hosted webfonts - most email clients don't load custom @font-face at all, so system fonts are the only choice that reliably renders as chosen once delivered. Existing plain-text templates (including the built-in defaults) are converted to HTML once on load so line breaks survive the switch. Security fix that had to go with this: Mailer::render() does a raw strtr() with no escaping, which was fine while bodies were plain text, but ContactController now sends these as HTML mail - a customer's public contact-form message could otherwise inject markup into the HTML notification mail. New Mailer::renderHtml() escapes each substituted value before it goes into the (admin-authored, otherwise unchanged) HTML template; ContactController sets isHTML(true) and an AltBody plain-text fallback for both the owner notification and customer confirmation. Known trade-off: Tiptap adds ~400KB (gzipped ~130KB) to the shared admin+public JS bundle, since the app has no route-based code-splitting anywhere yet - flagged for a possible follow-up, not fixed here since it'd mean restructuring the whole admin bundle, not just this feature. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
33 lines
968 B
JSON
33 lines
968 B
JSON
{
|
|
"name": "hifi-frontend",
|
|
"private": true,
|
|
"version": "1.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"prebuild": "node -e \"const fs=require('fs');fs.rmSync('../hifi/assets',{recursive:true,force:true});fs.rmSync('../hifi/index.html',{force:true})\"",
|
|
"build": "vite build",
|
|
"preview": "vite preview"
|
|
},
|
|
"dependencies": {
|
|
"@tiptap/extension-font-family": "^3.31.3",
|
|
"@tiptap/extension-link": "^3.31.3",
|
|
"@tiptap/extension-text-style": "^3.31.3",
|
|
"@tiptap/extension-underline": "^3.31.3",
|
|
"@tiptap/react": "^3.31.3",
|
|
"@tiptap/starter-kit": "^3.31.3",
|
|
"framer-motion": "^12.42.2",
|
|
"lucide-react": "^1.23.0",
|
|
"qrcode": "^1.5.4",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1",
|
|
"react-router-dom": "^6.26.0"
|
|
},
|
|
"devDependencies": {
|
|
"@vitejs/plugin-react": "^4.3.1",
|
|
"autoprefixer": "^10.4.20",
|
|
"postcss": "^8.4.47",
|
|
"tailwindcss": "^3.4.13",
|
|
"vite": "^5.4.6"
|
|
}
|
|
}
|