@react-email/preview-server 4.2.12 → 4.3.1
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 +9 -9
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- 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/page.js +2 -2
- 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 +46 -44
- 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/235.js +1 -1
- package/.next/server/chunks/{597.js → 385.js} +7 -7
- package/.next/server/chunks/785.js +1 -0
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/442-9645091f2b304619.js +1 -0
- package/.next/static/chunks/{615-96e04174ae422082.js → 615-8a4d176118a88d9a.js} +1 -1
- package/.next/static/chunks/900-d73ea57316faa50d.js +1 -0
- package/.next/static/chunks/app/layout-6e1b13b53823bb39.js +1 -0
- package/.next/static/chunks/app/{page-af54466b804e69f7.js → page-80a93dc65160c488.js} +1 -1
- package/.next/static/chunks/app/preview/[...slug]/page-4923a1ded9397d02.js +1 -0
- package/.next/static/css/7d8cf00703036864.css +3 -0
- package/.next/trace +29 -29
- package/CHANGELOG.md +12 -0
- package/package.json +12 -12
- package/src/actions/email-validation/__snapshots__/check-images.spec.tsx.snap +2 -2
- package/src/actions/email-validation/check-images.spec.tsx +1 -1
- package/src/app/preview/[...slug]/preview.tsx +25 -21
- package/src/components/resizable-wrapper.tsx +167 -69
- package/src/components/topbar/active-view-toggle-group.tsx +4 -4
- package/src/components/topbar/view-size-controls.tsx +107 -186
- package/src/utils/caniemail/tailwind/get-tailwind-config.spec.ts +1 -19
- package/src/utils/contains-email-template.spec.ts +6 -6
- package/src/utils/get-email-component.spec.ts +1 -4
- package/src/utils/js-email-detection.spec.ts +3 -3
- package/src/utils/run-bundled-code.ts +62 -43
- package/src/utils/testing/vercel-invite-user.tsx +160 -0
- package/.next/server/chunks/593.js +0 -1
- package/.next/static/chunks/557-287480320fe241b8.js +0 -1
- package/.next/static/chunks/926-cd84f2c04e4197e1.js +0 -1
- package/.next/static/chunks/app/layout-873f139023fe1b60.js +0 -1
- package/.next/static/chunks/app/preview/[...slug]/page-2bd3b2c525aecbf3.js +0 -1
- package/.next/static/css/2016446a90966a61.css +0 -3
- /package/.next/static/{uokDo0eZqRUtNrDAJfT75 → mDfZyWiMWrOG1nNEdydy-}/_buildManifest.js +0 -0
- /package/.next/static/{uokDo0eZqRUtNrDAJfT75 → mDfZyWiMWrOG1nNEdydy-}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Button,
|
|
4
|
+
Column,
|
|
5
|
+
Container,
|
|
6
|
+
Head,
|
|
7
|
+
Heading,
|
|
8
|
+
Hr,
|
|
9
|
+
Html,
|
|
10
|
+
Img,
|
|
11
|
+
Link,
|
|
12
|
+
Preview,
|
|
13
|
+
pixelBasedPreset,
|
|
14
|
+
Row,
|
|
15
|
+
Section,
|
|
16
|
+
Tailwind,
|
|
17
|
+
Text,
|
|
18
|
+
} from '@react-email/components';
|
|
19
|
+
|
|
20
|
+
interface VercelInviteUserEmailProps {
|
|
21
|
+
username?: string;
|
|
22
|
+
userImage?: string;
|
|
23
|
+
invitedByUsername?: string;
|
|
24
|
+
invitedByEmail?: string;
|
|
25
|
+
teamName?: string;
|
|
26
|
+
teamImage?: string;
|
|
27
|
+
inviteLink?: string;
|
|
28
|
+
inviteFromIp?: string;
|
|
29
|
+
inviteFromLocation?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const baseUrl = process.env.VERCEL_URL
|
|
33
|
+
? `https://${process.env.VERCEL_URL}`
|
|
34
|
+
: '';
|
|
35
|
+
|
|
36
|
+
export const VercelInviteUserEmail = ({
|
|
37
|
+
username,
|
|
38
|
+
userImage,
|
|
39
|
+
invitedByUsername,
|
|
40
|
+
invitedByEmail,
|
|
41
|
+
teamName,
|
|
42
|
+
teamImage,
|
|
43
|
+
inviteLink,
|
|
44
|
+
inviteFromIp,
|
|
45
|
+
inviteFromLocation,
|
|
46
|
+
}: VercelInviteUserEmailProps) => {
|
|
47
|
+
const previewText = `Join ${invitedByUsername} on Vercel`;
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Html>
|
|
51
|
+
<Head />
|
|
52
|
+
<Tailwind
|
|
53
|
+
config={{
|
|
54
|
+
presets: [pixelBasedPreset],
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<Body className="mx-auto my-auto bg-white px-2 font-sans">
|
|
58
|
+
<Preview>{previewText}</Preview>
|
|
59
|
+
<Container className="mx-auto my-[40px] max-w-[465px] rounded border border-[#eaeaea] border-solid p-[20px]">
|
|
60
|
+
<Section className="mt-[32px]">
|
|
61
|
+
<Img
|
|
62
|
+
src={`${baseUrl}/static/vercel-logo.png`}
|
|
63
|
+
width="40"
|
|
64
|
+
height="37"
|
|
65
|
+
alt="Vercel Logo"
|
|
66
|
+
className="mx-auto my-0"
|
|
67
|
+
/>
|
|
68
|
+
</Section>
|
|
69
|
+
<Heading className="mx-0 my-[30px] p-0 text-center font-normal text-[24px] text-black">
|
|
70
|
+
Join <strong>{teamName}</strong> on <strong>Vercel</strong>
|
|
71
|
+
</Heading>
|
|
72
|
+
<Text className="text-[14px] text-black leading-[24px]">
|
|
73
|
+
Hello {username},
|
|
74
|
+
</Text>
|
|
75
|
+
<Text className="text-[14px] text-black leading-[24px]">
|
|
76
|
+
<strong>{invitedByUsername}</strong> (
|
|
77
|
+
<Link
|
|
78
|
+
href={`mailto:${invitedByEmail}`}
|
|
79
|
+
className="text-blue-600 no-underline"
|
|
80
|
+
>
|
|
81
|
+
{invitedByEmail}
|
|
82
|
+
</Link>
|
|
83
|
+
) has invited you to the <strong>{teamName}</strong> team on{' '}
|
|
84
|
+
<strong>Vercel</strong>.
|
|
85
|
+
</Text>
|
|
86
|
+
<Section>
|
|
87
|
+
<Row>
|
|
88
|
+
<Column align="right">
|
|
89
|
+
<Img
|
|
90
|
+
className="rounded-full"
|
|
91
|
+
src={userImage}
|
|
92
|
+
width="64"
|
|
93
|
+
height="64"
|
|
94
|
+
alt={`${username}'s profile picture`}
|
|
95
|
+
/>
|
|
96
|
+
</Column>
|
|
97
|
+
<Column align="center">
|
|
98
|
+
<Img
|
|
99
|
+
src={`${baseUrl}/static/vercel-arrow.png`}
|
|
100
|
+
width="12"
|
|
101
|
+
height="9"
|
|
102
|
+
alt="Arrow indicating invitation"
|
|
103
|
+
/>
|
|
104
|
+
</Column>
|
|
105
|
+
<Column align="left">
|
|
106
|
+
<Img
|
|
107
|
+
className="rounded-full"
|
|
108
|
+
src={teamImage}
|
|
109
|
+
width="64"
|
|
110
|
+
height="64"
|
|
111
|
+
alt={`${teamName} team logo`}
|
|
112
|
+
/>
|
|
113
|
+
</Column>
|
|
114
|
+
</Row>
|
|
115
|
+
</Section>
|
|
116
|
+
<Section className="mt-[32px] mb-[32px] text-center">
|
|
117
|
+
<Button
|
|
118
|
+
className="rounded bg-[#000000] px-5 py-3 text-center font-semibold text-[12px] text-white no-underline"
|
|
119
|
+
href={inviteLink}
|
|
120
|
+
>
|
|
121
|
+
Join the team
|
|
122
|
+
</Button>
|
|
123
|
+
</Section>
|
|
124
|
+
<Text className="text-[14px] text-black leading-[24px]">
|
|
125
|
+
or copy and paste this URL into your browser:{' '}
|
|
126
|
+
<Link href={inviteLink} className="text-blue-600 no-underline">
|
|
127
|
+
{inviteLink}
|
|
128
|
+
</Link>
|
|
129
|
+
</Text>
|
|
130
|
+
<Hr className="mx-0 my-[26px] w-full border border-[#eaeaea] border-solid" />
|
|
131
|
+
<Text className="text-[#666666] text-[12px] leading-[24px]">
|
|
132
|
+
This invitation was intended for{' '}
|
|
133
|
+
<span className="text-black">{username}</span>. This invite was
|
|
134
|
+
sent from <span className="text-black">{inviteFromIp}</span>{' '}
|
|
135
|
+
located in{' '}
|
|
136
|
+
<span className="text-black">{inviteFromLocation}</span>. If you
|
|
137
|
+
were not expecting this invitation, you can ignore this email. If
|
|
138
|
+
you are concerned about your account's safety, please reply to
|
|
139
|
+
this email to get in touch with us.
|
|
140
|
+
</Text>
|
|
141
|
+
</Container>
|
|
142
|
+
</Body>
|
|
143
|
+
</Tailwind>
|
|
144
|
+
</Html>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
VercelInviteUserEmail.PreviewProps = {
|
|
149
|
+
username: 'alanturing',
|
|
150
|
+
userImage: `${baseUrl}/static/vercel-user.png`,
|
|
151
|
+
invitedByUsername: 'Alan',
|
|
152
|
+
invitedByEmail: 'alan.turing@example.com',
|
|
153
|
+
teamName: 'Enigma',
|
|
154
|
+
teamImage: `${baseUrl}/static/vercel-team.png`,
|
|
155
|
+
inviteLink: 'https://vercel.com',
|
|
156
|
+
inviteFromIp: '204.13.186.218',
|
|
157
|
+
inviteFromLocation: 'São Paulo, Brazil',
|
|
158
|
+
} as VercelInviteUserEmailProps;
|
|
159
|
+
|
|
160
|
+
export default VercelInviteUserEmail;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=593,exports.ids=[593],exports.modules={8332:(a,b,c)=>{"use strict";c.r(b),c.d(b,{getEmailsDirectoryMetadata:()=>i});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f);let h=async a=>{let b;try{b=await e().promises.open(a,"r")}catch(a){return console.warn(a),!1}if((await b.stat()).isDirectory())return await b.close(),!1;let{ext:c}=g().parse(a);if(![".js",".tsx",".jsx"].includes(c))return await b.close(),!1;let d=await b.readFile("utf8");await b.close();let f=/\bexport\s+default\b/gm.test(d),h=/\bmodule\.exports\s*=/gm.test(d),i=/\bexport\s+\{[^}]*\bdefault\b[^}]*\}/gm.test(d);return f||h||i},i=async(a,b=!1,c=!1,d=a)=>{if(!e().existsSync(a))return;let f=await e().promises.readdir(a,{withFileTypes:!0}),j=await Promise.all(f.map(b=>h(g().join(a,b.name)))),k=f.filter((a,b)=>j[b]).map(a=>b?a.name:a.name.replace(g().extname(a.name),"")),l=await Promise.all(f.filter(a=>a.isDirectory()&&!a.name.startsWith("_")&&"static"!==a.name).map(c=>i(g().join(a,c.name),b,!0,d))),m={absolutePath:a,relativePath:g().relative(d,a),directoryName:a.split(g().sep).pop(),emailFilenames:k,subDirectories:l};return c?(a=>{let b=a;for(;0===b.emailFilenames.length&&1===b.subDirectories.length;){let a=b.subDirectories[0];b={...a,directoryName:g().join(b.directoryName,a.directoryName)}}return b})(m):m}},25880:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,36100,23)),Promise.resolve().then(c.t.bind(c,99455,23)),Promise.resolve().then(c.t.bind(c,26835,23)),Promise.resolve().then(c.t.bind(c,36726,23)),Promise.resolve().then(c.t.bind(c,33666,23)),Promise.resolve().then(c.t.bind(c,23670,23)),Promise.resolve().then(c.t.bind(c,30006,23)),Promise.resolve().then(c.t.bind(c,41971,23)),Promise.resolve().then(c.t.bind(c,40614,23))},27378:(a,b,c)=>{Promise.resolve().then(c.bind(c,90948))},35191:()=>{},35608:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5058,23)),Promise.resolve().then(c.t.bind(c,35621,23)),Promise.resolve().then(c.t.bind(c,44325,23)),Promise.resolve().then(c.t.bind(c,20908,23)),Promise.resolve().then(c.t.bind(c,83572,23)),Promise.resolve().then(c.t.bind(c,25928,23)),Promise.resolve().then(c.t.bind(c,57920,23)),Promise.resolve().then(c.t.bind(c,2761,23)),Promise.resolve().then(c.bind(c,98400))},39520:(a,b,c)=>{"use strict";c.d(b,{a:()=>f});var d=c(2179),e=c(80095);let f=a=>{let b=(0,d.useRef)(null);(0,d.useEffect)(()=>{b.current||(b.current=(0,e.io)());let c=b.current;return c.on("reload",b=>{console.debug("Reloading..."),a(b)}),()=>{c.off()}},[a])}},50938:(a,b,c)=>{Promise.resolve().then(c.bind(c,52300))},52300:(a,b,c)=>{"use strict";c.d(b,{EmailsProvider:()=>l,J:()=>k});var d=c(6362),e=c(2179),f=c(14298);let g=(0,f.createServerReference)("7f49e1a7002069501d3d21d33dff124ad78faec818",f.callServer,void 0,f.findSourceMapURL,"getEmailsDirectoryMetadataAction");var h=c(70985),i=c(39520);let j=(0,e.createContext)(void 0),k=()=>{let a=(0,e.useContext)(j);if(void 0===a)throw Error("Cannot call `useEmails` outside of an `EmailsContext` provider.");return a},l=a=>{let[b,c]=(0,e.useState)(a.initialEmailsDirectoryMetadata);return h.Hf||h.m4||(0,i.a)(async()=>{let b=await g(a.initialEmailsDirectoryMetadata.absolutePath);if(b)c(b);else throw Error("Hot reloading: unable to find the emails directory to update the sidebar")}),(0,d.jsx)(j.Provider,{value:{emailsDirectoryMetadata:b},children:a.children})}},54208:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>n,dynamic:()=>m,metadata:()=>l});var d=c(51064);c(35191);var e=c(90948),f=c(8332),g=c(88155),h=c(84858),i=c.n(h),j=c(54629),k=c.n(j);let l={title:"React Email"},m="force-dynamic";async function n({children:a}){let b=await (0,f.getEmailsDirectoryMetadata)(g.Z8);if(void 0===b)throw Error(`Could not find the emails directory specified under ${g.Z8}!`);return(0,d.jsx)("html",{className:`${i().variable} ${k().variable} font-sans`,lang:"en",children:(0,d.jsx)("body",{className:"relative h-screen bg-black text-slate-11 leading-loose selection:bg-cyan-5 selection:text-cyan-12",children:(0,d.jsx)("div",{className:"bg-gradient-to-t from-slate-3 flex flex-col",children:(0,d.jsx)(e.EmailsProvider,{initialEmailsDirectoryMetadata:b,children:a})})})})}},70985:(a,b,c)=>{"use strict";c.d(b,{Hf:()=>d,m4:()=>e}),process.env.USER_PROJECT_LOCATION,process.env.PREVIEW_SERVER_LOCATION,process.env.EMAILS_DIR_ABSOLUTE_PATH;let d="true"===process.env.NEXT_PUBLIC_IS_BUILDING,e="true"===process.env.NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT},72112:()=>{},81314:(a,b,c)=>{"use strict";c.r(b),c.d(b,{"7f49e1a7002069501d3d21d33dff124ad78faec818":()=>l});var d=c(90466);c(69300);var e=c(73024),f=c.n(e),g=c(76760),h=c.n(g);let i=async a=>{let b;try{b=await f().promises.open(a,"r")}catch(a){return console.warn(a),!1}if((await b.stat()).isDirectory())return await b.close(),!1;let{ext:c}=h().parse(a);if(![".js",".tsx",".jsx"].includes(c))return await b.close(),!1;let d=await b.readFile("utf8");await b.close();let e=/\bexport\s+default\b/gm.test(d),g=/\bmodule\.exports\s*=/gm.test(d),i=/\bexport\s+\{[^}]*\bdefault\b[^}]*\}/gm.test(d);return e||g||i},j=async(a,b=!1,c=!1,d=a)=>{if(!f().existsSync(a))return;let e=await f().promises.readdir(a,{withFileTypes:!0}),g=await Promise.all(e.map(b=>i(h().join(a,b.name)))),k=e.filter((a,b)=>g[b]).map(a=>b?a.name:a.name.replace(h().extname(a.name),"")),l=await Promise.all(e.filter(a=>a.isDirectory()&&!a.name.startsWith("_")&&"static"!==a.name).map(c=>j(h().join(a,c.name),b,!0,d))),m={absolutePath:a,relativePath:h().relative(d,a),directoryName:a.split(h().sep).pop(),emailFilenames:k,subDirectories:l};return c?(a=>{let b=a;for(;0===b.emailFilenames.length&&1===b.subDirectories.length;){let a=b.subDirectories[0];b={...a,directoryName:h().join(b.directoryName,a.directoryName)}}return b})(m):m};var k=c(18012);let l=async(a,b=!1,c=!1,d=a)=>j(a,b,c,d);(0,k.D)([l]),(0,d.A)(l,"7f49e1a7002069501d3d21d33dff124ad78faec818",null)},86944:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(89993);let e=async a=>[{type:"image/x-icon",sizes:"16x16",url:(0,d.fillMetadataSegment)(".",await a.params,"favicon.ico")+""}]},88155:(a,b,c)=>{"use strict";c.d(b,{Hf:()=>g,Z8:()=>f,m4:()=>h,n_:()=>e,w5:()=>d});let d=process.env.USER_PROJECT_LOCATION,e=process.env.PREVIEW_SERVER_LOCATION,f=process.env.EMAILS_DIR_ABSOLUTE_PATH,g="true"===process.env.NEXT_PUBLIC_IS_BUILDING,h="true"===process.env.NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT},90948:(a,b,c)=>{"use strict";c.d(b,{EmailsProvider:()=>e});var d=c(9756);(0,d.registerClientReference)(function(){throw Error("Attempted to call useEmails() from the server but useEmails is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/actions-runner/_work/react-email/react-email/packages/preview-server/src/contexts/emails.tsx","useEmails");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call EmailsProvider() from the server but EmailsProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/actions-runner/_work/react-email/react-email/packages/preview-server/src/contexts/emails.tsx","EmailsProvider")},92665:()=>{}};
|