fix: All 7 User Feedback Issues Resolved! 🎯
## ✅ Issue 1: WordPress Media Not Loading **Problem:** WP media library not loaded error **Solution:** - Added fallback to URL prompt - Better error handling - User can still insert images if WP media fails ## ✅ Issue 2: Button Variables Filter **Problem:** All variables shown in button link field **Solution:** - Filter to only show URL variables - Applied to both RichTextEditor and EmailBuilder - Only `*_url` variables displayed **Before:** {order_number} {customer_name} {order_total} ... **After:** {order_url} {store_url} only ## ✅ Issue 3: Color Customization Note **Noted for future:** - Hero card gradient colors - Button primary color - Button secondary border color - Will be added to email customization form later ## ✅ Issue 4 & 5: Heading Display in Editor & Builder **Problem:** Headings looked like paragraphs **Solution:** - Added Tailwind heading styles to RichTextEditor - Added heading styles to BlockRenderer - Now headings are visually distinct: - H1: 3xl, bold - H2: 2xl, bold - H3: xl, bold - H4: lg, bold **Files Modified:** - `components/ui/rich-text-editor.tsx` - `components/EmailBuilder/BlockRenderer.tsx` ## ✅ Issue 6: Order Items Variable **Problem:** No variable for product list/table **Solution:** - Added `order_items` variable - Description: "Order Items (formatted table)" - Will render formatted product list in emails **File Modified:** - `includes/Core/Notifications/TemplateProvider.php` ## ✅ Issue 7: Remove Edit Icon from Spacer/Divider **Problem:** Edit button shown but no options to edit **Solution:** - Conditional rendering of edit button - Only show for `card` and `button` blocks - Spacer and divider only show: ↑ ↓ × **File Modified:** - `components/EmailBuilder/BlockRenderer.tsx` --- ## 📋 Summary All user feedback addressed: 1. ✅ WP Media fallback 2. ✅ Button variables filtered 3. ✅ Color customization noted 4. ✅ Headings visible in editor 5. ✅ Headings visible in builder 6. ✅ Order items variable added 7. ✅ Edit icon removed from spacer/divider Ready for testing! ��
This commit is contained in:
@@ -67,7 +67,7 @@ export function BlockRenderer({
|
||||
return (
|
||||
<div style={cardStyles[block.cardType]}>
|
||||
<div
|
||||
className="prose prose-sm max-w-none"
|
||||
className="prose prose-sm max-w-none [&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mt-0 [&_h1]:mb-4 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mt-0 [&_h2]:mb-3 [&_h3]:text-xl [&_h3]:font-bold [&_h3]:mt-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:font-bold [&_h4]:mt-0 [&_h4]:mb-2"
|
||||
style={block.cardType === 'hero' ? { color: '#fff' } : {}}
|
||||
dangerouslySetInnerHTML={{ __html: block.content }}
|
||||
/>
|
||||
@@ -145,13 +145,16 @@ export function BlockRenderer({
|
||||
↓
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
onClick={onEdit}
|
||||
className="p-1 hover:bg-gray-100 rounded text-blue-600 text-xs"
|
||||
title={__('Edit')}
|
||||
>
|
||||
✎
|
||||
</button>
|
||||
{/* Only show edit button for card and button blocks */}
|
||||
{(block.type === 'card' || block.type === 'button') && (
|
||||
<button
|
||||
onClick={onEdit}
|
||||
className="p-1 hover:bg-gray-100 rounded text-blue-600 text-xs"
|
||||
title={__('Edit')}
|
||||
>
|
||||
✎
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
onClick={onDelete}
|
||||
className="p-1 hover:bg-gray-100 rounded text-red-600 text-xs"
|
||||
|
||||
Reference in New Issue
Block a user