fix(email-renderer): validate brand settings and apply them to AMP
Quality / quality (ubuntu-latest) (push) Failing after 10m1s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-09-05 12:47:43 +05:30
1 parent fd777605e1
commit 371c23db46
5 files changed
+74 -9

No files matched your search

+7 -6
View File
@@ -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,