The Open Framework for Building Agents
fix(docs): render masked integration social images (#2039)
Colton Padden0f359fe68de8
diff --git a/apps/docs/lib/integrations/logos.tsx b/apps/docs/lib/integrations/logos.tsxindex 22265da9f..0b8a656b6 100644--- a/apps/docs/lib/integrations/logos.tsx+++ b/apps/docs/lib/integrations/logos.tsx@@ -38,7 +38,7 @@ import {SiZapier,SiZomato,} from "@icons-pack/react-simple-icons";-import { type ComponentProps, useId } from "react";+import type { ComponentProps } from "react";type LogoProps = ComponentProps<"svg">;@@ -60,26 +60,22 @@ export const webLogo = (props: LogoProps) => (</svg>);-export const BuzzLogo = (props: LogoProps) => {- const maskId = useId();-- return (- <svg fill="none" viewBox="0 0 466 309" xmlns="http://www.w3.org/2000/svg" {...props}>- <defs>- <mask id={maskId}>- <circle cx="91.7" cy="154.5" fill="white" r="91.7" />- <circle cx="374.3" cy="154.5" fill="white" r="91.7" />- <rect fill="white" height="309" rx="34" width="210" x="128" />- <ellipse cx="193.3" cy="84.4" fill="black" rx="27" ry="27" />- <ellipse cx="276" cy="84.4" fill="black" rx="27" ry="27" />- <rect fill="black" height="38.3" rx="5" width="136.9" x="166.3" y="157.2" />- <rect fill="black" height="37.6" rx="5" width="136.2" x="166.9" y="235.1" />- </mask>- </defs>- <rect fill="currentColor" height="309" mask={`url(#${maskId})`} width="466" />- </svg>- );-};+export const BuzzLogo = (props: LogoProps) => (+ <svg fill="none" viewBox="0 0 466 309" xmlns="http://www.w3.org/2000/svg" {...props}>+ <defs>+ <mask id="buzz-logo-mask">+ <circle cx="91.7" cy="154.5" fill="white" r="91.7" />+ <circle cx="374.3" cy="154.5" fill="white" r="91.7" />+ <rect fill="white" height="309" rx="34" width="210" x="128" />+ <ellipse cx="193.3" cy="84.4" fill="black" rx="27" ry="27" />+ <ellipse cx="276" cy="84.4" fill="black" rx="27" ry="27" />+ <rect fill="black" height="38.3" rx="5" width="136.9" x="166.3" y="157.2" />+ <rect fill="black" height="37.6" rx="5" width="136.2" x="166.9" y="235.1" />+ </mask>+ </defs>+ <rect fill="currentColor" height="309" mask="url(#buzz-logo-mask)" width="466" />+ </svg>+);export const browserUseLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" {...props}>diff --git a/apps/docs/lib/integrations/og-image.tsx b/apps/docs/lib/integrations/og-image.tsxindex a2ecfa624..6c3679472 100644--- a/apps/docs/lib/integrations/og-image.tsx+++ b/apps/docs/lib/integrations/og-image.tsx@@ -145,7 +145,10 @@ const rasterizeLogo = async (logo: ReactNode): Promise<RasterizedLogo> => {const collectLogoColors = (node: ReactNode, colors = new Set<string>()): Set<string> => {if (!isValidElement(node)) return colors;- const { children, fill, stroke } = (node as ReactElement<LogoElementProps>).props;+ const element = node as ReactElement<LogoElementProps>;+ if (element.type === "mask") return colors;++ const { children, fill, stroke } = element.props;for (const color of [fill, stroke]) {if (color && color !== "none" && color !== "currentColor") colors.add(color.toLowerCase());}@@ -174,6 +177,8 @@ const recolorLogo = (node: ReactNode, preserveTones: boolean): ReactNode => {if (!isValidElement(node)) return node;const element = node as ReactElement<LogoElementProps>;+ if (element.type === "mask") return element;+const props = element.props;const recolor = (color: string | undefined): string | undefined => {if (!color || color === "none") return color;