chore: dependency updates

This commit is contained in:
Lucas Smith
2025-11-22 00:06:12 +11:00
parent 17c6098638
commit 7ff27b3b30
95 changed files with 16657 additions and 72401 deletions

View File

@ -1,3 +1,5 @@
import type { I18n } from '@lingui/core';
import { I18nProvider } from '@lingui/react';
import * as ReactEmail from '@react-email/render';
import config from '@documenso/tailwind-config';
@ -7,6 +9,7 @@ import { BrandingProvider, type BrandingSettings } from './providers/branding';
export type RenderOptions = ReactEmail.Options & {
branding?: BrandingSettings;
i18n?: I18n;
};
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
@ -16,17 +19,46 @@ export const render = (element: React.ReactNode, options?: RenderOptions) => {
const { branding, ...otherOptions } = options ?? {};
return ReactEmail.render(
<Tailwind
config={{
theme: {
extend: {
colors,
<BrandingProvider branding={branding}>
<Tailwind
config={{
theme: {
extend: {
colors,
},
},
},
}}
>
<BrandingProvider branding={branding}>{element}</BrandingProvider>
</Tailwind>,
}}
>
{element}
</Tailwind>
</BrandingProvider>,
otherOptions,
);
};
export const renderWithI18N = (element: React.ReactNode, options?: RenderOptions) => {
const { branding, i18n, ...otherOptions } = options ?? {};
if (!i18n) {
throw new Error('i18n is required');
}
return ReactEmail.render(
<I18nProvider i18n={i18n}>
<BrandingProvider branding={branding}>
<Tailwind
config={{
theme: {
extend: {
colors,
},
},
}}
>
{element}
</Tailwind>
</BrandingProvider>
</I18nProvider>,
otherOptions,
);
};
@ -35,17 +67,19 @@ export const renderAsync = async (element: React.ReactNode, options?: RenderOpti
const { branding, ...otherOptions } = options ?? {};
return await ReactEmail.renderAsync(
<Tailwind
config={{
theme: {
extend: {
colors,
<BrandingProvider branding={branding}>
<Tailwind
config={{
theme: {
extend: {
colors,
},
},
},
}}
>
<BrandingProvider branding={branding}>{element}</BrandingProvider>
</Tailwind>,
}}
>
{element}
</Tailwind>
</BrandingProvider>,
otherOptions,
);
};