fix(email-renderer): validate brand settings and apply them to AMP
This commit is contained in:
1 parent
fd777605e1
commit
371c23db46
5 files changed
+74
-9
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
type BlockDefinition,
|
||||
type BlockNode,
|
||||
} from "@wrnexus/blocks";
|
||||
import { brandColor, brandFont, brandWidth } from "./brand.ts";
|
||||
|
||||
const styles = record(json, { maxKeys: 50 }) as never;
|
||||
const label = (key: string, fallback: string) => ({ key, fallback });
|
||||
@@ -72,12 +73,12 @@ export const emailDocumentBlock = defineBlock({
|
||||
category: "layout",
|
||||
capabilities: ["root"],
|
||||
props: object({
|
||||
width: string({ default: "600" }),
|
||||
background: string({ default: "#f3f4f6" }),
|
||||
contentBackground: string({ default: "#ffffff" }),
|
||||
fontFamily: string({ default: "Arial, sans-serif" }),
|
||||
textColor: string({ default: "#111827" }),
|
||||
linkColor: string({ default: "#2563eb" }),
|
||||
width: brandWidth,
|
||||
background: brandColor("#f3f4f6"),
|
||||
contentBackground: brandColor("#ffffff"),
|
||||
fontFamily: brandFont,
|
||||
textColor: brandColor("#111827"),
|
||||
linkColor: brandColor("#2563eb"),
|
||||
logoUrl: safeUrl({ schemes: ["https"], optional: true }),
|
||||
logoAlt: string({ max: 300, default: "" }),
|
||||
}) as never,
|
||||
|
||||
Reference in new issue
Block a user