fix: resolve container width issues, spa redirects, and appearance settings overwrite. feat: enhance order/sub details and newsletter layout
This commit is contained in:
@@ -7,7 +7,7 @@ export interface ButtonOptions {
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
button: {
|
||||
setButton: (options: { text: string; href: string; style?: 'solid' | 'outline' }) => ReturnType;
|
||||
setButton: (options: { text: string; href: string; style?: 'solid' | 'outline' | 'link' }) => ReturnType;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -70,20 +70,27 @@ export const ButtonExtension = Node.create<ButtonOptions>({
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
const { text, href, style } = HTMLAttributes;
|
||||
|
||||
// Simple link styling - no fancy button appearance in editor
|
||||
// The actual button styling happens in email rendering (EmailRenderer.php)
|
||||
// In editor, just show as a styled link (differentiable from regular links)
|
||||
// Different styling based on button style
|
||||
let inlineStyle: string;
|
||||
if (style === 'link') {
|
||||
// Plain link - just underlined text, no button-like appearance
|
||||
inlineStyle = 'color: #7f54b3; text-decoration: underline; cursor: pointer;';
|
||||
} else {
|
||||
// Solid/Outline buttons - show as styled link with background hint
|
||||
inlineStyle = 'color: #7f54b3; text-decoration: underline; cursor: pointer; font-weight: 600; background: rgba(127,84,179,0.1); padding: 2px 6px; border-radius: 3px;';
|
||||
}
|
||||
|
||||
return [
|
||||
'a',
|
||||
mergeAttributes(this.options.HTMLAttributes, {
|
||||
href,
|
||||
class: 'button-node',
|
||||
style: 'color: #7f54b3; text-decoration: underline; cursor: pointer; font-weight: 600; background: rgba(127,84,179,0.1); padding: 2px 6px; border-radius: 3px;',
|
||||
class: style === 'link' ? 'link-node' : 'button-node',
|
||||
style: inlineStyle,
|
||||
'data-button': '',
|
||||
'data-text': text,
|
||||
'data-href': href,
|
||||
'data-style': style,
|
||||
title: `Button: ${text} → ${href}`,
|
||||
title: style === 'link' ? `Link: ${text}` : `Button: ${text} → ${href}`,
|
||||
}),
|
||||
text,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user