feat: Code Mode Button Position & Markdown Support! 📝
## ✅ 3. Code Mode Button Moved to Left **Problem:** Inconsistent layout, tabs on right should be Editor/Preview only **Solution:** - Moved Code Mode button next to "Message Body" label - Editor/Preview tabs stay on the right - Consistent, logical layout **Before:** ``` Message Body [Editor|Preview] [Code Mode] ``` **After:** ``` Message Body [Code Mode] [Editor|Preview] ``` ## ✅ 4. Markdown Support in Code Mode! 🎉 **Problem:** HTML is verbose, not user-friendly for tech-savvy users **Solution:** - Added Markdown parser with ::: syntax for cards - Toggle between HTML and Markdown modes - Full bidirectional conversion **Markdown Syntax:** ```markdown :::card # Heading Your content here ::: :::card[success] ✅ Success message ::: [button](https://example.com){Click Here} [button style="outline"](url){Secondary Button} ``` **Features:** - Standard Markdown: headings, bold, italic, lists, links - Card blocks: :::card or :::card[type] - Button blocks: [button](url){text} - Variables: {order_url}, {customer_name} - Bidirectional conversion (HTML ↔ Markdown) **Files:** - `lib/markdown-parser.ts` - Parser implementation - `components/ui/code-editor.tsx` - Mode toggle - `routes/Settings/Notifications/EditTemplate.tsx` - Enable support - `DEPENDENCIES.md` - Add @codemirror/lang-markdown **Note:** Requires `npm install @codemirror/lang-markdown` Ready for remaining improvements (5-6)!
This commit is contained in:
@@ -6,7 +6,7 @@ Install all dependencies at once:
|
||||
|
||||
```bash
|
||||
cd admin-spa
|
||||
npm install @tiptap/extension-text-align @tiptap/extension-image codemirror @codemirror/lang-html @codemirror/theme-one-dark @radix-ui/react-radio-group
|
||||
npm install @tiptap/extension-text-align @tiptap/extension-image codemirror @codemirror/lang-html @codemirror/lang-markdown @codemirror/theme-one-dark @radix-ui/react-radio-group
|
||||
```
|
||||
|
||||
---
|
||||
@@ -24,12 +24,13 @@ npm install @tiptap/extension-text-align @tiptap/extension-image
|
||||
|
||||
### CodeMirror (for Code Mode)
|
||||
```bash
|
||||
npm install codemirror @codemirror/lang-html @codemirror/theme-one-dark
|
||||
npm install codemirror @codemirror/lang-html @codemirror/lang-markdown @codemirror/theme-one-dark
|
||||
```
|
||||
|
||||
**What they do:**
|
||||
- **codemirror**: Core editor with professional features
|
||||
- **@codemirror/lang-html**: HTML syntax highlighting & auto-completion
|
||||
- **@codemirror/lang-markdown**: Markdown syntax highlighting & auto-completion
|
||||
- **@codemirror/theme-one-dark**: Professional dark theme
|
||||
|
||||
### Radix UI (for UI Components)
|
||||
|
||||
Reference in New Issue
Block a user