@react-email/preview-server 4.1.0-canary.11 → 4.1.0-canary.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +32 -32
- package/.next/build-manifest.json +14 -14
- package/.next/diagnostics/framework.json +1 -1
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/preview/[...slug]/page.js +356 -174
- package/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/151.js +1 -0
- package/.next/server/chunks/277.js +1 -0
- package/.next/server/chunks/{879.js → 532.js} +7 -7
- package/.next/server/chunks/550.js +6 -0
- package/.next/server/chunks/834.js +15 -0
- package/.next/server/chunks/851.js +20 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/343-0aa226f42148dce4.js +1 -0
- package/.next/static/chunks/353-5e7d05b120b2e25f.js +1 -0
- package/.next/static/chunks/445-576b0c51a037fe4d.js +1 -0
- package/.next/static/chunks/483-33f8edd35a9abbac.js +1 -0
- package/.next/static/chunks/624-9d1650c8211771cd.js +1 -0
- package/.next/static/chunks/755-01456539a6894956.js +1 -0
- package/.next/static/chunks/app/_not-found/{page-aee2c5619f94a965.js → page-e9c9ee8e737ce3f8.js} +1 -1
- package/.next/static/chunks/app/layout-094f1db7cb89023e.js +1 -0
- package/.next/static/chunks/app/page-ee81303e36f65d71.js +1 -0
- package/.next/static/chunks/app/preview/[...slug]/page-17daf55202c7ed10.js +1 -0
- package/.next/static/chunks/{04c799b8-f2be86d6e75dbf29.js → e8809b48-6a73b3f51ba71e9c.js} +1 -1
- package/.next/static/chunks/{f33a14d2-188715a58266ac15.js → f33a14d2-13f6de3d216cf617.js} +1 -1
- package/.next/static/chunks/framework-4f208795521d076c.js +1 -0
- package/.next/static/chunks/main-0000d0a5ac74fec0.js +1 -0
- package/.next/static/chunks/main-app-5ba7fd8e7a976edb.js +1 -0
- package/.next/static/chunks/pages/_app-550e3587fddcaa19.js +1 -0
- package/.next/static/chunks/pages/_error-870af0ad63b0e49e.js +1 -0
- package/.next/static/chunks/{webpack-c09dcf4c47767be8.js → webpack-fc6f324c4c88f6e3.js} +1 -1
- package/.next/static/css/48dcea18d820a298.css +3 -0
- package/.next/static/{Q4WULorzcLOlAMtk3ZhAj → hWjgzfxten__dpm6I5Okv}/_buildManifest.js +1 -1
- package/.next/trace +27 -27
- package/CHANGELOG.md +7 -0
- package/_index.js +4 -0
- package/package.json +2 -2
- package/src/actions/email-validation/__snapshots__/check-images.spec.tsx.snap +84 -0
- package/src/actions/email-validation/check-images.spec.tsx +1 -80
- package/src/components/code-container.tsx +3 -1
- package/src/components/code.tsx +60 -59
- package/src/components/logo.tsx +68 -63
- package/src/components/send.tsx +8 -5
- package/src/components/sidebar/file-tree-directory-children.tsx +4 -1
- package/src/components/toolbar.tsx +9 -5
- package/src/utils/__snapshots__/get-email-component.spec.ts.snap +183 -1
- package/src/utils/caniemail/ast/get-used-style-properties.ts +1 -0
- package/src/utils/get-email-component.spec.ts +3 -0
- package/.next/server/chunks/200.js +0 -1
- package/.next/server/chunks/3.js +0 -15
- package/.next/server/chunks/593.js +0 -1
- package/.next/server/chunks/784.js +0 -6
- package/.next/server/chunks/915.js +0 -20
- package/.next/static/chunks/188-e278e5f1e9c4067e.js +0 -1
- package/.next/static/chunks/336-0767fdc0ff1ceaa1.js +0 -1
- package/.next/static/chunks/551-d9ce0a77591e6bf7.js +0 -1
- package/.next/static/chunks/651-25b2499f3d267dcc.js +0 -1
- package/.next/static/chunks/713-6c7607cb54b8278e.js +0 -1
- package/.next/static/chunks/834-e77d5196a2631efe.js +0 -1
- package/.next/static/chunks/app/layout-bbcdc0f24b69a313.js +0 -1
- package/.next/static/chunks/app/page-ddc5b5b5b8d2de0e.js +0 -1
- package/.next/static/chunks/app/preview/[...slug]/page-2ecabfb34d4f874a.js +0 -1
- package/.next/static/chunks/framework-f71c687711cb40cc.js +0 -1
- package/.next/static/chunks/main-697e2f65b52ad05c.js +0 -1
- package/.next/static/chunks/main-app-deb9839bdc2bcbd4.js +0 -1
- package/.next/static/chunks/pages/_app-2e335329c12ac3e7.js +0 -1
- package/.next/static/chunks/pages/_error-73094c2ebe868f44.js +0 -1
- package/.next/static/css/78c81281aa95270f.css +0 -3
- /package/.next/static/{Q4WULorzcLOlAMtk3ZhAj → hWjgzfxten__dpm6I5Okv}/_ssgManifest.js +0 -0
|
@@ -2,6 +2,7 @@ import * as Collapsible from '@radix-ui/react-collapsible';
|
|
|
2
2
|
import { AnimatePresence, LayoutGroup, motion } from 'framer-motion';
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { useRouter, useSearchParams } from 'next/navigation';
|
|
5
|
+
import * as React from 'react';
|
|
5
6
|
import { cn } from '../../utils';
|
|
6
7
|
import type { EmailsDirectory } from '../../utils/get-emails-directory-metadata';
|
|
7
8
|
import { IconFile } from '../icons/icon-file';
|
|
@@ -16,6 +17,8 @@ export const FileTreeDirectoryChildren = (props: {
|
|
|
16
17
|
const searchParams = useSearchParams();
|
|
17
18
|
const router = useRouter();
|
|
18
19
|
|
|
20
|
+
const id = React.useId();
|
|
21
|
+
|
|
19
22
|
return (
|
|
20
23
|
<AnimatePresence initial={false}>
|
|
21
24
|
{props.open ? (
|
|
@@ -33,7 +36,7 @@ export const FileTreeDirectoryChildren = (props: {
|
|
|
33
36
|
<div className="line absolute left-2.5 h-full w-px bg-slate-6" />
|
|
34
37
|
)}
|
|
35
38
|
<div className="flex flex-col truncate">
|
|
36
|
-
<LayoutGroup id=
|
|
39
|
+
<LayoutGroup id={`sidebar-${id}`}>
|
|
37
40
|
{props.emailsDirectoryMetadata.subDirectories.map(
|
|
38
41
|
(subDirectory) => (
|
|
39
42
|
<FileTreeDirectory
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as Tabs from '@radix-ui/react-tabs';
|
|
3
3
|
import { LayoutGroup } from 'framer-motion';
|
|
4
4
|
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
|
5
|
-
import
|
|
5
|
+
import * as React from 'react';
|
|
6
6
|
import type { CompatibilityCheckingResult } from '../actions/email-validation/check-compatibility';
|
|
7
7
|
import { isBuilding } from '../app/env';
|
|
8
8
|
import { PreviewContext } from '../contexts/preview';
|
|
@@ -105,7 +105,8 @@ const ToolbarInner = ({
|
|
|
105
105
|
|
|
106
106
|
if (!isBuilding) {
|
|
107
107
|
// biome-ignore lint/correctness/useHookAtTopLevel: This is fine since isBuilding does not change at runtime
|
|
108
|
-
|
|
108
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: Setters don't need dependencies
|
|
109
|
+
React.useEffect(() => {
|
|
109
110
|
(async () => {
|
|
110
111
|
const lintingRows = await loadLinting();
|
|
111
112
|
setCachedLintingRows(lintingRows);
|
|
@@ -119,6 +120,8 @@ const ToolbarInner = ({
|
|
|
119
120
|
}, []);
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
const id = React.useId();
|
|
124
|
+
|
|
122
125
|
return (
|
|
123
126
|
<div
|
|
124
127
|
data-toggled={toggled}
|
|
@@ -137,7 +140,7 @@ const ToolbarInner = ({
|
|
|
137
140
|
>
|
|
138
141
|
<div className="flex flex-col h-full">
|
|
139
142
|
<Tabs.List className="flex gap-4 px-4 border-b border-solid border-slate-6 h-10 w-full flex-shrink-0">
|
|
140
|
-
<LayoutGroup id=
|
|
143
|
+
<LayoutGroup id={`toolbar-${id}`}>
|
|
141
144
|
<Tabs.Trigger asChild value="linter">
|
|
142
145
|
<ToolbarButton active={activeTab === 'linter'}>
|
|
143
146
|
Linter
|
|
@@ -189,7 +192,7 @@ const ToolbarInner = ({
|
|
|
189
192
|
<IconReload
|
|
190
193
|
size={24}
|
|
191
194
|
className={cn({
|
|
192
|
-
'
|
|
195
|
+
'opacity-60 animate-spin-fast':
|
|
193
196
|
lintLoading || spamLoading,
|
|
194
197
|
})}
|
|
195
198
|
/>
|
|
@@ -329,7 +332,8 @@ export const Toolbar = ({
|
|
|
329
332
|
serverSpamCheckingResult,
|
|
330
333
|
serverCompatibilityResults,
|
|
331
334
|
}: ToolbarProps) => {
|
|
332
|
-
const { emailPath, emailSlug, renderedEmailMetadata } =
|
|
335
|
+
const { emailPath, emailSlug, renderedEmailMetadata } =
|
|
336
|
+
React.use(PreviewContext)!;
|
|
333
337
|
|
|
334
338
|
if (renderedEmailMetadata === undefined) return null;
|
|
335
339
|
const { markup, plainText, reactMarkup } = renderedEmailMetadata;
|
|
@@ -1,3 +1,185 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`getEmailComponent() > with a demo email template 1`] = `
|
|
3
|
+
exports[`getEmailComponent() > with a demo email template 1`] = `
|
|
4
|
+
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
<html dir="ltr" lang="en">
|
|
6
|
+
<head>
|
|
7
|
+
<link rel="preload" as="image" href="/static/vercel-logo.png" />
|
|
8
|
+
<link rel="preload" as="image" href="/static/vercel-user.png" />
|
|
9
|
+
<link rel="preload" as="image" href="/static/vercel-arrow.png" />
|
|
10
|
+
<link rel="preload" as="image" href="/static/vercel-team.png" />
|
|
11
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
12
|
+
<meta name="x-apple-disable-message-reformatting" />
|
|
13
|
+
<!--$-->
|
|
14
|
+
</head>
|
|
15
|
+
<body
|
|
16
|
+
style='margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;background-color:rgb(255,255,255);padding-left:0.5rem;padding-right:0.5rem;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'>
|
|
17
|
+
<div
|
|
18
|
+
style="display:none;overflow:hidden;line-height:1px;opacity:0;max-height:0;max-width:0"
|
|
19
|
+
data-skip-in-text="true">
|
|
20
|
+
Join Alan on Vercel
|
|
21
|
+
<div>
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<table
|
|
26
|
+
align="center"
|
|
27
|
+
width="100%"
|
|
28
|
+
border="0"
|
|
29
|
+
cellpadding="0"
|
|
30
|
+
cellspacing="0"
|
|
31
|
+
role="presentation"
|
|
32
|
+
style="margin-left:auto;margin-right:auto;margin-top:40px;margin-bottom:40px;max-width:465px;border-radius:0.25rem;border-width:1px;border-color:rgb(234,234,234);border-style:solid;padding:20px">
|
|
33
|
+
<tbody>
|
|
34
|
+
<tr style="width:100%">
|
|
35
|
+
<td>
|
|
36
|
+
<table
|
|
37
|
+
align="center"
|
|
38
|
+
width="100%"
|
|
39
|
+
border="0"
|
|
40
|
+
cellpadding="0"
|
|
41
|
+
cellspacing="0"
|
|
42
|
+
role="presentation"
|
|
43
|
+
style="margin-top:32px">
|
|
44
|
+
<tbody>
|
|
45
|
+
<tr>
|
|
46
|
+
<td>
|
|
47
|
+
<img
|
|
48
|
+
alt="Vercel Logo"
|
|
49
|
+
height="37"
|
|
50
|
+
src="/static/vercel-logo.png"
|
|
51
|
+
style="margin-left:auto;margin-right:auto;margin-top:0px;margin-bottom:0px;display:block;outline:none;border:none;text-decoration:none"
|
|
52
|
+
width="40" />
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
</tbody>
|
|
56
|
+
</table>
|
|
57
|
+
<h1
|
|
58
|
+
style="margin-left:0px;margin-right:0px;margin-top:30px;margin-bottom:30px;padding:0px;text-align:center;font-weight:400;font-size:24px;color:rgb(0,0,0)">
|
|
59
|
+
Join <strong>Enigma</strong> on <strong>Vercel</strong>
|
|
60
|
+
</h1>
|
|
61
|
+
<p
|
|
62
|
+
style="font-size:14px;color:rgb(0,0,0);line-height:24px;margin-top:16px;margin-bottom:16px">
|
|
63
|
+
Hello
|
|
64
|
+
<!-- -->alanturing<!-- -->,
|
|
65
|
+
</p>
|
|
66
|
+
<p
|
|
67
|
+
style="font-size:14px;color:rgb(0,0,0);line-height:24px;margin-top:16px;margin-bottom:16px">
|
|
68
|
+
<strong>Alan</strong> (<a
|
|
69
|
+
href="mailto:alan.turing@example.com"
|
|
70
|
+
style="color:rgb(37,99,235);text-decoration-line:none"
|
|
71
|
+
target="_blank"
|
|
72
|
+
>alan.turing@example.com</a
|
|
73
|
+
>) has invited you to the <strong>Enigma</strong> team on<!-- -->
|
|
74
|
+
<strong>Vercel</strong>.
|
|
75
|
+
</p>
|
|
76
|
+
<table
|
|
77
|
+
align="center"
|
|
78
|
+
width="100%"
|
|
79
|
+
border="0"
|
|
80
|
+
cellpadding="0"
|
|
81
|
+
cellspacing="0"
|
|
82
|
+
role="presentation">
|
|
83
|
+
<tbody>
|
|
84
|
+
<tr>
|
|
85
|
+
<td>
|
|
86
|
+
<table
|
|
87
|
+
align="center"
|
|
88
|
+
width="100%"
|
|
89
|
+
border="0"
|
|
90
|
+
cellpadding="0"
|
|
91
|
+
cellspacing="0"
|
|
92
|
+
role="presentation">
|
|
93
|
+
<tbody style="width:100%">
|
|
94
|
+
<tr style="width:100%">
|
|
95
|
+
<td align="right" data-id="__react-email-column">
|
|
96
|
+
<img
|
|
97
|
+
alt="alanturing's profile picture"
|
|
98
|
+
height="64"
|
|
99
|
+
src="/static/vercel-user.png"
|
|
100
|
+
style="border-radius:9999px;display:block;outline:none;border:none;text-decoration:none"
|
|
101
|
+
width="64" />
|
|
102
|
+
</td>
|
|
103
|
+
<td align="center" data-id="__react-email-column">
|
|
104
|
+
<img
|
|
105
|
+
alt="Arrow indicating invitation"
|
|
106
|
+
height="9"
|
|
107
|
+
src="/static/vercel-arrow.png"
|
|
108
|
+
style="display:block;outline:none;border:none;text-decoration:none"
|
|
109
|
+
width="12" />
|
|
110
|
+
</td>
|
|
111
|
+
<td align="left" data-id="__react-email-column">
|
|
112
|
+
<img
|
|
113
|
+
alt="Enigma team logo"
|
|
114
|
+
height="64"
|
|
115
|
+
src="/static/vercel-team.png"
|
|
116
|
+
style="border-radius:9999px;display:block;outline:none;border:none;text-decoration:none"
|
|
117
|
+
width="64" />
|
|
118
|
+
</td>
|
|
119
|
+
</tr>
|
|
120
|
+
</tbody>
|
|
121
|
+
</table>
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
</tbody>
|
|
125
|
+
</table>
|
|
126
|
+
<table
|
|
127
|
+
align="center"
|
|
128
|
+
width="100%"
|
|
129
|
+
border="0"
|
|
130
|
+
cellpadding="0"
|
|
131
|
+
cellspacing="0"
|
|
132
|
+
role="presentation"
|
|
133
|
+
style="margin-top:32px;margin-bottom:32px;text-align:center">
|
|
134
|
+
<tbody>
|
|
135
|
+
<tr>
|
|
136
|
+
<td>
|
|
137
|
+
<a
|
|
138
|
+
href="https://vercel.com"
|
|
139
|
+
style="border-radius:0.25rem;background-color:rgb(0,0,0);padding-left:20px;padding-right:20px;padding-top:12px;padding-bottom:12px;text-align:center;font-weight:600;font-size:12px;color:rgb(255,255,255);text-decoration-line:none;line-height:100%;text-decoration:none;display:inline-block;max-width:100%;mso-padding-alt:0px"
|
|
140
|
+
target="_blank"
|
|
141
|
+
><span
|
|
142
|
+
><!--[if mso]><i style="mso-font-width:500%;mso-text-raise:18" hidden>  </i><![endif]--></span
|
|
143
|
+
><span
|
|
144
|
+
style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:9px"
|
|
145
|
+
>Join the team</span
|
|
146
|
+
><span
|
|
147
|
+
><!--[if mso]><i style="mso-font-width:500%" hidden>  ​</i><![endif]--></span
|
|
148
|
+
></a
|
|
149
|
+
>
|
|
150
|
+
</td>
|
|
151
|
+
</tr>
|
|
152
|
+
</tbody>
|
|
153
|
+
</table>
|
|
154
|
+
<p
|
|
155
|
+
style="font-size:14px;color:rgb(0,0,0);line-height:24px;margin-top:16px;margin-bottom:16px">
|
|
156
|
+
or copy and paste this URL into your browser:<!-- -->
|
|
157
|
+
<a
|
|
158
|
+
href="https://vercel.com"
|
|
159
|
+
style="color:rgb(37,99,235);text-decoration-line:none"
|
|
160
|
+
target="_blank"
|
|
161
|
+
>https://vercel.com</a
|
|
162
|
+
>
|
|
163
|
+
</p>
|
|
164
|
+
<hr
|
|
165
|
+
style="margin-left:0px;margin-right:0px;margin-top:26px;margin-bottom:26px;width:100%;border-width:1px;border-color:rgb(234,234,234);border-style:solid;border:none;border-top:1px solid #eaeaea" />
|
|
166
|
+
<p
|
|
167
|
+
style="color:rgb(102,102,102);font-size:12px;line-height:24px;margin-top:16px;margin-bottom:16px">
|
|
168
|
+
This invitation was intended for<!-- -->
|
|
169
|
+
<span style="color:rgb(0,0,0)">alanturing</span>. This invite was
|
|
170
|
+
sent from <span style="color:rgb(0,0,0)">204.13.186.218</span>
|
|
171
|
+
<!-- -->located in<!-- -->
|
|
172
|
+
<span style="color:rgb(0,0,0)">São Paulo, Brazil</span>. If you
|
|
173
|
+
were not expecting this invitation, you can ignore this email. If
|
|
174
|
+
you are concerned about your account's safety, please reply
|
|
175
|
+
to this email to get in touch with us.
|
|
176
|
+
</p>
|
|
177
|
+
</td>
|
|
178
|
+
</tr>
|
|
179
|
+
</tbody>
|
|
180
|
+
</table>
|
|
181
|
+
<!--/$-->
|
|
182
|
+
</body>
|
|
183
|
+
</html>
|
|
184
|
+
"
|
|
185
|
+
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** biome-ignore-all lint/nursery/noNestedComponentDefinitions: There are no components here, just visitor functions */
|
|
1
2
|
import traverse from '@babel/traverse';
|
|
2
3
|
import type { AST } from '../../../actions/email-validation/check-compatibility';
|
|
3
4
|
import { generateTailwindCssRules } from '../tailwind/generate-tailwind-rules';
|