12 KiB
MyUIbrix Elementor-Style Page Builder - Complete Feature Guide
🎨 Overview
MyUIbrix has been enhanced with professional Elementor-like page building capabilities, providing a complete visual editing experience with drag-and-drop, inline editing, column layouts, custom CSS, and contextual admin links.
✨ New Features
1. Inline Text Editing ✏️
Component: InlineTextEditor.tsx
Features:
- Click any text element to edit in place
- Rich text formatting toolbar:
- Bold (Ctrl+B)
- Italic (Ctrl+I)
- Underline (Ctrl+U)
- 🔗 Insert Links
- Auto-save on blur
- Visual feedback with outline highlighting
- Cancel/Save buttons
Usage:
import InlineTextEditor from './components/editor/InlineTextEditor';
<InlineTextEditor
elementId="hero-title"
initialContent="<h1>Welcome</h1>"
onSave={(content) => console.log('Saved:', content)}
/>
User Experience:
- Click on any text to activate editing mode
- Formatting toolbar appears above the text
- Make changes with rich formatting
- Click save or click away to auto-save
2. Column Layout Manager 📐
Component: ColumnLayoutManager.tsx
Features:
- Visual column layout builder
- Pre-built templates:
- Single Column (100%)
- Two Equal (50% / 50%)
- Three Equal (33% / 33% / 33%)
- Four Equal (25% each)
- Left Sidebar (33% / 67%)
- Right Sidebar (67% / 33%)
- Featured + Two (50% / 25% / 25%)
- Main + Sidebar (75% / 25%)
- Add/Remove columns dynamically
- Visual preview of layout
- Plus buttons in each column to add elements
Usage:
<ColumnLayoutManager
elementName="hero"
currentColumns={[
{ id: '1', width: '50%', elements: [] },
{ id: '2', width: '50%', elements: [] }
]}
onLayoutChange={(columns) => handleLayoutChange(columns)}
/>
User Experience:
- Click "Templates" button to see pre-built layouts
- Select a template to instantly apply it
- Use + button to add more columns
- Click × on any column to remove it
- Columns auto-resize to maintain 100% width
3. Custom CSS Editor 💻
Component: CustomCSSEditor.tsx
Features:
- Full CSS code editor with syntax highlighting
- Real-time validation
- Live preview mode
- CSS examples library:
- Background gradients
- Shadows & hover effects
- Border radius
- Animations
- Error detection for malformed CSS
- One-click example insertion
Usage:
<CustomCSSEditor
elementName="hero"
currentCSS="background: linear-gradient(...);"
onCSSChange={(css) => applyCustomCSS(css)}
/>
User Experience:
- Click "CSS" tab in style panel
- Write custom CSS properties
- Toggle "Preview" to see changes live
- Browse examples for inspiration
- Click "Apply CSS" to save changes
Example CSS:
/* Background Gradient */
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 60px 20px;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
4. Contextual Admin Links 🔗
Component: ContextualAdminLinks.tsx
Features:
- Smart links based on element type
- Quick access to relevant admin pages
- Link descriptions and badges
- External link indicators
Element-Specific Links:
Hero Section:
- Manage Articles →
/admin/articles - Upload Images →
/admin/media
News Section:
- Manage Articles →
/admin/articles - Categories →
/admin/categories - Article Settings →
/admin/settings/articles
Matches Section:
- Manage Matches →
/admin/matches - Match Settings →
/admin/settings/matches
Team Section:
- Manage Players →
/admin/team/players - Team Settings →
/admin/settings/team
Videos Section:
- Manage Videos →
/admin/videos - Video Settings →
/admin/settings/videos
Sponsors Section:
- Manage Sponsors →
/admin/sponsors
Newsletter:
- Newsletter Settings →
/admin/settings/newsletter - Subscribers →
/admin/newsletter/subscribers
User Experience:
- Select any element
- Click "Admin" tab in style panel
- See relevant admin links for that element
- Click any link to jump to admin page
5. Enhanced Visual Style Panel 🎨
Updated Component: VisualStylePanel.tsx
New Tabs:
- Content - Typography controls
- Style - Colors & spacing
- Layout - Grid & column layouts
- CSS - Custom CSS editor
- Admin - Contextual admin links
Typography Controls:
- Font family selection
- Font size (8-128px)
- Font weight (100-900)
- Line height (0.5-3)
- Letter spacing (-5px to 10px)
- Text transform (none, uppercase, lowercase, capitalize)
Color Controls:
- Text color picker
- Background color picker
- Hex code input
- Visual color preview
Spacing Controls:
- Padding (Top, Right, Bottom, Left)
- Margin (Top, Right, Bottom, Left)
- Numeric input with steppers
Layout Controls:
- Grid templates with visual previews
- Custom grid columns/rows
- Column & row gaps
- Grid auto-flow
- Align & justify controls
🚀 Complete User Workflow
Creating a Custom Hero Section
-
Activate Editor
- Click edit button (bottom left)
- Editor mode activates
-
Select Hero Element
- Click on hero section
- Contextual panel appears
-
Change Layout
- Click "Layout" tab
- Select "Two Equal" template
- Hero splits into 2 columns
-
Edit Text
- Click on hero title
- Inline editor activates
- Format text with bold, italic
- Add link if needed
- Save changes
-
Apply Custom Colors
- Click "Style" tab
- Pick background color
- Select text color
- Adjust padding/margin
-
Add Custom CSS
- Click "CSS" tab
- Add gradient background
- Add box shadow
- Enable preview
- Apply CSS
-
Manage Content
- Click "Admin" tab
- Click "Manage Articles"
- Opens in new tab
- Edit hero content
-
Save & Publish
- Click "Publikovat" button
- Changes go live
- Page reloads with new design
🎯 Key Benefits
For Administrators
- No coding required - Visual editing for everything
- Fast iterations - See changes instantly
- Professional layouts - Pre-built templates
- Custom styling - Full CSS control when needed
- Smart navigation - Quick links to content management
For End Users
- Consistent UX - Familiar Elementor-like interface
- Responsive - All layouts work on mobile/tablet/desktop
- Fast loading - Optimized CSS application
- Accessible - WCAG-compliant color contrast
Technical Benefits
- Modular components - Easy to extend
- TypeScript - Type-safe
- Live preview - No page reloads during editing
- Version control - All changes tracked
- Reversible - Can always go back
📱 Responsive Controls
Viewport Switcher
Located in top toolbar:
- 🖥️ Desktop - Full width preview
- 📱 Tablet - 768px width
- 📱 Mobile - 375px width
Device-Specific Styling
Each element can have different styles per device:
{
desktop: {
fontSize: 48,
padding: 60
},
tablet: {
fontSize: 36,
padding: 40
},
mobile: {
fontSize: 24,
padding: 20
}
}
🔧 Technical Implementation
Architecture
MyUIbrixEditor (Main)
├── InlineTextEditor (Text editing)
├── ColumnLayoutManager (Layouts)
├── CustomCSSEditor (CSS)
├── ContextualAdminLinks (Navigation)
└── VisualStylePanel (Properties)
├── Content Tab
├── Style Tab
├── Layout Tab
├── CSS Tab
└── Admin Tab
Data Flow
User Action → Editor Component → Event Dispatch → Live Preview
↓
Save to State
↓
API Call (on Publish)
↓
Database Storage
Custom Events
myuibrix-change: Element variant/visibility changed
window.dispatchEvent(new CustomEvent('myuibrix-change', {
detail: { elementName, variant, visible, previewMode: true }
}));
myuibrix-style-change: Element styles changed
window.dispatchEvent(new CustomEvent('myuibrix-style-change', {
detail: { elementName, styles, previewMode: true }
}));
myuibrix-reorder: Element order changed
window.dispatchEvent(new CustomEvent('myuibrix-reorder', {
detail: { order: [...], previewMode: true }
}));
🎓 Best Practices
For Custom CSS
- Use relative units (rem, em) for better responsiveness
- Avoid
!important- use specificity instead - Test on all viewports before publishing
- Keep CSS organized with comments
- Use CSS variables for consistent theming
For Column Layouts
- Start with templates, then customize
- Keep mobile-first in mind
- Don't exceed 4 columns on desktop
- Test content overflow in narrow columns
- Use consistent gutters (gaps)
For Inline Editing
- Save frequently
- Keep text concise
- Use formatting sparingly
- Test link targets
- Preview on different devices
For Admin Links
- Use contextual links to stay organized
- Update content before changing design
- Keep images optimized
- Check all links work
- Review settings after changes
🐛 Troubleshooting
CSS Not Applying
- Check for syntax errors (missing braces, semicolons)
- Ensure preview mode is enabled
- Click "Apply CSS" button
- Save and publish changes
Layout Breaking
- Reset to a template
- Check column widths sum to 100%
- Clear custom CSS
- Reload page
Text Not Saving
- Ensure you clicked save or blurred away
- Check network connection
- Look for error toasts
- Try manual save button
Admin Links Not Working
- Verify you're logged in as admin
- Check admin routes are configured
- Ensure backend API is running
- Clear browser cache
🔮 Future Enhancements
Planned Features
- Animation Builder - Visual keyframe editor
- Global Styles - Theme-wide CSS variables
- Template Library - Save/load complete layouts
- Revision History - Undo/redo across sessions
- Collaboration - Multi-user editing
- AI Suggestions - Smart layout recommendations
- A/B Testing - Test multiple designs
- Performance Analytics - Speed insights
- Accessibility Checker - WCAG compliance
- Export/Import - Share designs between sites
📚 Additional Resources
Related Documentation
MYUIBRIX_FIXES.md- Initial editor featuresADMIN_FUNCTIONALITY_REPORT.md- Admin panel guideSETUP_IMPROVEMENTS.md- Initial setup
Component Files
frontend/src/components/editor/InlineTextEditor.tsxfrontend/src/components/editor/CustomCSSEditor.tsxfrontend/src/components/editor/ColumnLayoutManager.tsxfrontend/src/components/editor/ContextualAdminLinks.tsxfrontend/src/components/editor/VisualStylePanel.tsxfrontend/src/components/editor/MyUIbrixEditor.tsx
API Endpoints
GET /api/v1/page-elements/:pageType- Get configurationsPOST /api/v1/page-elements/batch- Save configurations
💡 Tips & Tricks
Keyboard Shortcuts
ESC- Close panels / Exit editingCtrl+S- Save changesL- Toggle layers panelA- Open element picker↑/↓- Move element up/downDelete- Remove selected element
Quick Workflows
- Clone a Section: Copy element, paste, modify
- Batch Styling: Apply CSS to multiple elements at once
- Template Reuse: Save layouts as templates
- Quick Preview: Toggle devices with viewport switcher
- Admin Shortcuts: Use contextual links to jump quickly
Pro Tips
- 🎨 Use color picker for brand consistency
- 📐 Leverage grid templates for complex layouts
- 💻 Learn basic CSS for advanced customization
- 🔗 Bookmark frequently used admin pages
- 💾 Save drafts before major changes
📞 Support
For issues or feature requests:
- Check this documentation first
- Review troubleshooting section
- Check console for errors
- Contact support with:
- Element name
- Steps to reproduce
- Browser/device info
- Screenshots if applicable
Last Updated: December 2024
Version: 2.0.0
Status: ✅ Production Ready