react-email 3.0.3 → 3.0.5

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.
Files changed (224) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cli/index.js +96 -100
  3. package/dist/cli/index.mjs +75 -64
  4. package/dist/index.d.mts +20 -0
  5. package/dist/index.d.ts +20 -0
  6. package/dist/index.js +96 -0
  7. package/dist/index.mjs +21 -0
  8. package/dist/package/index.d.mts +33 -0
  9. package/dist/package/index.d.ts +33 -0
  10. package/dist/package/index.js +62 -0
  11. package/dist/package/index.mjs +7 -0
  12. package/dist/preview/.next/BUILD_ID +1 -1
  13. package/dist/preview/.next/app-build-manifest.json +31 -31
  14. package/dist/preview/.next/app-path-routes-manifest.json +1 -1
  15. package/dist/preview/.next/build-manifest.json +16 -15
  16. package/dist/preview/.next/cache/.rscinfo +1 -0
  17. package/dist/preview/.next/cache/eslint/.cache_1vyas3k +1 -0
  18. package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
  19. package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
  20. package/dist/preview/.next/cache/webpack/edge-server-production/0.pack +0 -0
  21. package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
  22. package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
  23. package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
  24. package/dist/preview/.next/diagnostics/build-diagnostics.json +6 -0
  25. package/dist/preview/.next/diagnostics/framework.json +1 -0
  26. package/dist/preview/.next/images-manifest.json +1 -1
  27. package/dist/preview/.next/next-minimal-server.js.nft.json +1 -1
  28. package/dist/preview/.next/next-server.js.nft.json +1 -1
  29. package/dist/preview/.next/prerender-manifest.json +1 -1
  30. package/dist/preview/.next/required-server-files.json +1 -1
  31. package/dist/preview/.next/routes-manifest.json +1 -1
  32. package/dist/preview/.next/server/app/_not-found/page.js +1 -1
  33. package/dist/preview/.next/server/app/_not-found/page.js.nft.json +1 -1
  34. package/dist/preview/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  35. package/dist/preview/.next/server/app/favicon.ico/route.js +1 -12
  36. package/dist/preview/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  37. package/dist/preview/.next/server/app/page.js +1 -1
  38. package/dist/preview/.next/server/app/page.js.nft.json +1 -1
  39. package/dist/preview/.next/server/app/page_client-reference-manifest.js +1 -1
  40. package/dist/preview/.next/server/app/preview/[...slug]/page.js +6 -6
  41. package/dist/preview/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
  42. package/dist/preview/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
  43. package/dist/preview/.next/server/app-paths-manifest.json +1 -1
  44. package/dist/preview/.next/server/chunks/300.js +13 -0
  45. package/dist/preview/.next/server/chunks/420.js +1 -0
  46. package/dist/preview/.next/server/chunks/625.js +5 -0
  47. package/dist/preview/.next/server/chunks/631.js +6 -0
  48. package/dist/preview/.next/server/chunks/720.js +10 -0
  49. package/dist/preview/.next/server/functions-config-manifest.json +1 -1
  50. package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
  51. package/dist/preview/.next/server/next-font-manifest.js +1 -1
  52. package/dist/preview/.next/server/next-font-manifest.json +1 -1
  53. package/dist/preview/.next/server/pages/500.html +1 -1
  54. package/dist/preview/.next/server/pages/_app.js +1 -1
  55. package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
  56. package/dist/preview/.next/server/pages/_document.js +1 -1
  57. package/dist/preview/.next/server/pages/_document.js.nft.json +1 -1
  58. package/dist/preview/.next/server/pages/_error.js +1 -1
  59. package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
  60. package/dist/preview/.next/server/server-reference-manifest.js +1 -1
  61. package/dist/preview/.next/server/server-reference-manifest.json +1 -1
  62. package/dist/preview/.next/server/webpack-runtime.js +1 -1
  63. package/dist/preview/.next/static/6K68y2QEZ1dLbv-Xhi30p/_buildManifest.js +1 -0
  64. package/dist/preview/.next/static/chunks/12-b9450aa0845e7574.js +1 -0
  65. package/dist/preview/.next/static/chunks/154-69b91a0c2fd801b8.js +1 -0
  66. package/dist/preview/.next/static/chunks/447-886131c35ca42b91.js +1 -0
  67. package/dist/preview/.next/static/chunks/5fec7a0a-5179023f3f5a9421.js +1 -0
  68. package/dist/preview/.next/static/chunks/797-46f6c20952f0a280.js +2 -0
  69. package/dist/preview/.next/static/chunks/860-38d96c8819ba6f19.js +1 -0
  70. package/dist/preview/.next/static/chunks/app/_not-found/page-96d3eac723be3ee2.js +1 -0
  71. package/dist/preview/.next/static/chunks/app/layout-e1b6f1534cbbe5bd.js +1 -0
  72. package/dist/preview/.next/static/chunks/app/page-2c3e297e38c526ef.js +1 -0
  73. package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-2b4988ba6daf34e1.js +1 -0
  74. package/dist/preview/.next/static/chunks/framework-e7cae9cecd5c9ba2.js +1 -0
  75. package/dist/preview/.next/static/chunks/main-app-2c7f96205a73f128.js +1 -0
  76. package/dist/preview/.next/static/chunks/main-df761fde212f9cda.js +1 -0
  77. package/dist/preview/.next/static/chunks/pages/_app-203a61b355820ccf.js +1 -0
  78. package/dist/preview/.next/static/chunks/pages/_error-1764ca54938748c8.js +1 -0
  79. package/dist/preview/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  80. package/dist/preview/.next/static/chunks/webpack-9255716c9496e606.js +1 -0
  81. package/dist/preview/.next/static/css/ec5d7e66bd3b6cb8.css +1 -0
  82. package/dist/preview/.next/trace +20 -52
  83. package/dist/preview/.next/types/app/layout.ts +11 -6
  84. package/dist/preview/.next/types/app/preview/[...slug]/page.ts +11 -6
  85. package/dist/preview/.next/types/cache-life.d.ts +141 -0
  86. package/next-env.d.ts +1 -1
  87. package/package.json +12 -12
  88. package/src/actions/get-email-path-from-slug.ts +3 -2
  89. package/src/actions/get-emails-directory-metadata.spec.ts +1 -0
  90. package/src/actions/get-emails-directory-metadata.ts +62 -59
  91. package/src/actions/render-email-by-path.tsx +16 -5
  92. package/src/app/preview/[...slug]/page.tsx +19 -9
  93. package/src/app/preview/[...slug]/preview.tsx +6 -7
  94. package/src/contexts/emails.tsx +2 -56
  95. package/src/hooks/use-email-rendering-result.ts +44 -0
  96. package/src/hooks/use-rendering-metadata.ts +5 -5
  97. package/src/package/body/dist/index.d.mts +6 -0
  98. package/src/package/body/dist/index.d.ts +6 -0
  99. package/src/package/body/dist/index.js +79 -0
  100. package/src/package/body/dist/index.mjs +45 -0
  101. package/src/package/button/dist/index.d.mts +6 -0
  102. package/src/package/button/dist/index.d.ts +6 -0
  103. package/src/package/button/dist/index.js +252 -0
  104. package/src/package/button/dist/index.mjs +218 -0
  105. package/src/package/code-block/dist/index.d.mts +4906 -0
  106. package/src/package/code-block/dist/index.d.ts +4906 -0
  107. package/src/package/code-block/dist/index.js +18205 -0
  108. package/src/package/code-block/dist/index.mjs +18133 -0
  109. package/src/package/code-inline/dist/index.d.mts +11 -0
  110. package/src/package/code-inline/dist/index.d.ts +11 -0
  111. package/src/package/code-inline/dist/index.js +106 -0
  112. package/src/package/code-inline/dist/index.mjs +72 -0
  113. package/src/package/column/dist/index.d.mts +6 -0
  114. package/src/package/column/dist/index.d.ts +6 -0
  115. package/src/package/column/dist/index.js +79 -0
  116. package/src/package/column/dist/index.mjs +45 -0
  117. package/src/package/components/dist/index.d.mts +20 -0
  118. package/src/package/components/dist/index.d.ts +20 -0
  119. package/src/package/components/dist/index.js +62 -0
  120. package/src/package/components/dist/index.mjs +21 -0
  121. package/src/package/container/dist/index.d.mts +6 -0
  122. package/src/package/container/dist/index.d.ts +6 -0
  123. package/src/package/container/dist/index.js +93 -0
  124. package/src/package/container/dist/index.mjs +59 -0
  125. package/src/package/font/dist/index.d.mts +25 -0
  126. package/src/package/font/dist/index.d.ts +25 -0
  127. package/src/package/font/dist/index.js +55 -0
  128. package/src/package/font/dist/index.mjs +28 -0
  129. package/src/package/head/dist/index.d.mts +6 -0
  130. package/src/package/head/dist/index.d.ts +6 -0
  131. package/src/package/head/dist/index.js +83 -0
  132. package/src/package/head/dist/index.mjs +49 -0
  133. package/src/package/heading/dist/index.d.mts +43 -0
  134. package/src/package/heading/dist/index.d.ts +43 -0
  135. package/src/package/heading/dist/index.js +113 -0
  136. package/src/package/heading/dist/index.mjs +79 -0
  137. package/src/package/hr/dist/index.d.mts +6 -0
  138. package/src/package/hr/dist/index.d.ts +6 -0
  139. package/src/package/hr/dist/index.js +89 -0
  140. package/src/package/hr/dist/index.mjs +55 -0
  141. package/src/package/html/dist/index.d.mts +6 -0
  142. package/src/package/html/dist/index.d.ts +6 -0
  143. package/src/package/html/dist/index.js +79 -0
  144. package/src/package/html/dist/index.mjs +45 -0
  145. package/src/package/img/dist/index.d.mts +6 -0
  146. package/src/package/img/dist/index.d.ts +6 -0
  147. package/src/package/img/dist/index.js +94 -0
  148. package/src/package/img/dist/index.mjs +60 -0
  149. package/src/package/link/dist/index.d.mts +6 -0
  150. package/src/package/link/dist/index.d.ts +6 -0
  151. package/src/package/link/dist/index.js +90 -0
  152. package/src/package/link/dist/index.mjs +56 -0
  153. package/src/package/markdown/dist/index.d.mts +15 -0
  154. package/src/package/markdown/dist/index.d.ts +15 -0
  155. package/src/package/markdown/dist/index.js +92 -0
  156. package/src/package/markdown/dist/index.mjs +58 -0
  157. package/src/package/preview/dist/index.d.mts +12 -0
  158. package/src/package/preview/dist/index.d.ts +12 -0
  159. package/src/package/preview/dist/index.js +108 -0
  160. package/src/package/preview/dist/index.mjs +73 -0
  161. package/src/package/render/dist/browser/index.d.mts +24 -0
  162. package/src/package/render/dist/browser/index.d.ts +24 -0
  163. package/src/package/render/dist/browser/index.js +250 -0
  164. package/src/package/render/dist/browser/index.mjs +214 -0
  165. package/src/package/render/dist/index.d.mts +23 -0
  166. package/src/package/render/dist/index.d.ts +23 -0
  167. package/src/package/render/dist/index.js +768 -0
  168. package/src/package/render/dist/index.mjs +733 -0
  169. package/src/package/render/dist/node/index.d.mts +27 -0
  170. package/src/package/render/dist/node/index.d.ts +27 -0
  171. package/src/package/render/dist/node/index.js +212 -0
  172. package/src/package/render/dist/node/index.mjs +176 -0
  173. package/src/package/row/dist/index.d.mts +10 -0
  174. package/src/package/row/dist/index.d.ts +10 -0
  175. package/src/package/row/dist/index.js +93 -0
  176. package/src/package/row/dist/index.mjs +59 -0
  177. package/src/package/section/dist/index.d.mts +6 -0
  178. package/src/package/section/dist/index.d.ts +6 -0
  179. package/src/package/section/dist/index.js +93 -0
  180. package/src/package/section/dist/index.mjs +59 -0
  181. package/src/package/tailwind/dist/index.d.ts +19 -0
  182. package/src/package/tailwind/dist/index.js +48 -0
  183. package/src/package/tailwind/dist/index.mjs +17167 -0
  184. package/src/package/tailwind/dist/tailwindcss/config.d.ts +376 -0
  185. package/src/package/tailwind/dist/tailwindcss/generated/.gitkeep +0 -0
  186. package/src/package/tailwind/dist/tailwindcss/generated/colors.d.ts +298 -0
  187. package/src/package/tailwind/dist/tailwindcss/generated/corePluginList.d.ts +1 -0
  188. package/src/package/tailwind/dist/tailwindcss/generated/default-theme.d.ts +397 -0
  189. package/src/package/tailwind/dist/tailwindcss/index.d.ts +11 -0
  190. package/src/package/text/dist/index.d.mts +6 -0
  191. package/src/package/text/dist/index.d.ts +6 -0
  192. package/src/package/text/dist/index.js +89 -0
  193. package/src/package/text/dist/index.mjs +55 -0
  194. package/src/utils/types/hot-reload-event.ts +3 -6
  195. package/dist/preview/.next/cache/eslint/.cache_117y9un +0 -1
  196. package/dist/preview/.next/server/chunks/128.js +0 -7
  197. package/dist/preview/.next/server/chunks/176.js +0 -2
  198. package/dist/preview/.next/server/chunks/287.js +0 -4
  199. package/dist/preview/.next/server/chunks/303.js +0 -6
  200. package/dist/preview/.next/server/chunks/359.js +0 -10
  201. package/dist/preview/.next/server/chunks/6.js +0 -1
  202. package/dist/preview/.next/server/chunks/894.js +0 -4
  203. package/dist/preview/.next/server/chunks/font-manifest.json +0 -1
  204. package/dist/preview/.next/server/font-manifest.json +0 -1
  205. package/dist/preview/.next/static/9wK7iUJPUvFYJNYOqHNpo/_buildManifest.js +0 -1
  206. package/dist/preview/.next/static/chunks/121-c9990f9db62882f2.js +0 -2
  207. package/dist/preview/.next/static/chunks/262-1ec6780d76508af8.js +0 -1
  208. package/dist/preview/.next/static/chunks/599-b4e686757f7b900d.js +0 -1
  209. package/dist/preview/.next/static/chunks/732-2b6186d8c8624033.js +0 -1
  210. package/dist/preview/.next/static/chunks/783-41562adc25d0c844.js +0 -9
  211. package/dist/preview/.next/static/chunks/app/_not-found/page-02dfc5a8a0bd636e.js +0 -1
  212. package/dist/preview/.next/static/chunks/app/layout-62d01ca567f6fd12.js +0 -1
  213. package/dist/preview/.next/static/chunks/app/page-630c6c846e3efc69.js +0 -1
  214. package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-6547e9f3ba86c271.js +0 -1
  215. package/dist/preview/.next/static/chunks/f38cb6f6-40e76da092bb0490.js +0 -1
  216. package/dist/preview/.next/static/chunks/framework-bef83a85c94ff7de.js +0 -1
  217. package/dist/preview/.next/static/chunks/main-app-6ed588927d8fd56c.js +0 -1
  218. package/dist/preview/.next/static/chunks/main-ee2ceeb6c8bf53ac.js +0 -1
  219. package/dist/preview/.next/static/chunks/pages/_app-02aac361ebb5625a.js +0 -1
  220. package/dist/preview/.next/static/chunks/pages/_error-52f603c388364756.js +0 -1
  221. package/dist/preview/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +0 -1
  222. package/dist/preview/.next/static/chunks/webpack-cf1ab84f284a4073.js +0 -1
  223. package/dist/preview/.next/static/css/0a13d10225a26b9d.css +0 -1
  224. /package/dist/preview/.next/static/{9wK7iUJPUvFYJNYOqHNpo → 6K68y2QEZ1dLbv-Xhi30p}/_ssgManifest.js +0 -0
@@ -13,7 +13,7 @@ import { program } from "commander";
13
13
  // package.json
14
14
  var package_default = {
15
15
  name: "react-email",
16
- version: "3.0.3",
16
+ version: "3.0.5",
17
17
  description: "A live preview of your emails right in your browser.",
18
18
  bin: {
19
19
  email: "./dist/cli/index.js"
@@ -43,14 +43,14 @@ var package_default = {
43
43
  "@babel/core": "7.24.5",
44
44
  "@babel/parser": "7.24.5",
45
45
  chalk: "4.1.2",
46
- chokidar: "^4.0.1",
46
+ chokidar: "4.0.3",
47
47
  commander: "11.1.0",
48
48
  debounce: "2.0.0",
49
49
  esbuild: "0.19.11",
50
50
  glob: "10.3.4",
51
51
  "log-symbols": "4.1.0",
52
52
  "mime-types": "2.1.35",
53
- next: "14.2.16",
53
+ next: "15.1.2",
54
54
  "normalize-path": "3.0.0",
55
55
  ora: "5.4.1",
56
56
  "socket.io": "4.8.0"
@@ -67,25 +67,25 @@ var package_default = {
67
67
  "@types/babel__core": "7.20.5",
68
68
  "@types/fs-extra": "11.0.1",
69
69
  "@types/mime-types": "2.1.4",
70
- "@types/node": "18.0.0",
70
+ "@types/node": "22.10.2",
71
71
  "@types/normalize-path": "3.0.2",
72
- "@types/react": "^18.2.0",
73
- "@types/react-dom": "^18.2.0",
72
+ "@types/react": "^19",
73
+ "@types/react-dom": "^19",
74
74
  "@types/webpack": "5.28.5",
75
75
  "@vercel/style-guide": "5.1.0",
76
- autoprefixer: "10.4.14",
76
+ autoprefixer: "10.4.20",
77
77
  clsx: "2.1.0",
78
78
  eslint: "8.50.0",
79
79
  "eslint-config-prettier": "9.0.0",
80
80
  "eslint-config-turbo": "2.1.0",
81
- "framer-motion": "12.0.0-alpha.0",
81
+ "framer-motion": "12.0.0-alpha.2",
82
82
  postcss: "8.4.40",
83
83
  "prism-react-renderer": "2.1.0",
84
- react: "18.3.1",
85
- "react-dom": "18.3.1",
84
+ react: "^19",
85
+ "react-dom": "^19",
86
86
  sharp: "0.33.3",
87
87
  "socket.io-client": "4.8.0",
88
- sonner: "1.3.1",
88
+ sonner: "1.7.1",
89
89
  "source-map-js": "1.0.2",
90
90
  "stacktrace-parser": "0.1.10",
91
91
  "tailwind-merge": "2.2.0",
@@ -122,7 +122,8 @@ var getTreeLines = async (dirPath, depth, currentDepth = 0) => {
122
122
  childDirents.sort((a, b) => {
123
123
  if (a.isDirectory() && b.isFile()) {
124
124
  return -1;
125
- } else if (a.isFile() && b.isDirectory()) {
125
+ }
126
+ if (a.isFile() && b.isDirectory()) {
126
127
  return 1;
127
128
  }
128
129
  return b.name > a.name ? -1 : 1;
@@ -258,7 +259,7 @@ var serveStaticFile = async (res, parsedUrl, staticDirRelativePath) => {
258
259
  );
259
260
  res.statusCode = 500;
260
261
  res.end(
261
- `Could not read file to be served! Check your terminal for more information.`
262
+ "Could not read file to be served! Check your terminal for more information."
262
263
  );
263
264
  } finally {
264
265
  fileHandle.close();
@@ -266,7 +267,7 @@ var serveStaticFile = async (res, parsedUrl, staticDirRelativePath) => {
266
267
  };
267
268
 
268
269
  // src/cli/utils/preview/get-env-variables-for-preview-app.ts
269
- import path3 from "path";
270
+ import path3 from "node:path";
270
271
  var getEnvVariablesForPreviewApp = (relativePathToEmailsDirectory, cwd) => {
271
272
  return {
272
273
  EMAILS_DIR_RELATIVE_PATH: relativePathToEmailsDirectory,
@@ -439,15 +440,20 @@ var isJavascriptModule = (filePath) => {
439
440
  var checkFileExtensionsUntilItExists = (pathWithoutExtension) => {
440
441
  if (existsSync(`${pathWithoutExtension}.ts`)) {
441
442
  return `${pathWithoutExtension}.ts`;
442
- } else if (existsSync(`${pathWithoutExtension}.tsx`)) {
443
+ }
444
+ if (existsSync(`${pathWithoutExtension}.tsx`)) {
443
445
  return `${pathWithoutExtension}.tsx`;
444
- } else if (existsSync(`${pathWithoutExtension}.js`)) {
446
+ }
447
+ if (existsSync(`${pathWithoutExtension}.js`)) {
445
448
  return `${pathWithoutExtension}.js`;
446
- } else if (existsSync(`${pathWithoutExtension}.jsx`)) {
449
+ }
450
+ if (existsSync(`${pathWithoutExtension}.jsx`)) {
447
451
  return `${pathWithoutExtension}.jsx`;
448
- } else if (existsSync(`${pathWithoutExtension}.mjs`)) {
452
+ }
453
+ if (existsSync(`${pathWithoutExtension}.mjs`)) {
449
454
  return `${pathWithoutExtension}.mjs`;
450
- } else if (existsSync(`${pathWithoutExtension}.cjs`)) {
455
+ }
456
+ if (existsSync(`${pathWithoutExtension}.cjs`)) {
451
457
  return `${pathWithoutExtension}.cjs`;
452
458
  }
453
459
  };
@@ -509,7 +515,7 @@ var createDependencyGraph = async (directory) => {
509
515
  pathToDependencyFromDirectory = pathWithExtension;
510
516
  } else if (isDev) {
511
517
  console.warn(
512
- `Could not determine the file extension for the file at ${pathWithExtension}`
518
+ `Could not determine the file extension for the file at ${pathToDependencyFromDirectory}`
513
519
  );
514
520
  }
515
521
  }
@@ -595,25 +601,27 @@ var createDependencyGraph = async (directory) => {
595
601
  await updateModuleDependenciesInGraph(pathToModified);
596
602
  }
597
603
  break;
598
- case "addDir":
604
+ case "addDir": {
599
605
  const filesInsideAddedDirectory = await readAllFilesInsideDirectory(pathToModified);
600
606
  const modulesInsideAddedDirectory = filesInsideAddedDirectory.filter(isJavascriptModule);
601
607
  for await (const filePath of modulesInsideAddedDirectory) {
602
608
  await updateModuleDependenciesInGraph(filePath);
603
609
  }
604
610
  break;
611
+ }
605
612
  case "unlink":
606
613
  if (isJavascriptModule(pathToModified)) {
607
614
  removeModuleFromGraph(pathToModified);
608
615
  }
609
616
  break;
610
- case "unlinkDir":
617
+ case "unlinkDir": {
611
618
  const filesInsideDeletedDirectory = await readAllFilesInsideDirectory(pathToModified);
612
619
  const modulesInsideDeletedDirectory = filesInsideDeletedDirectory.filter(isJavascriptModule);
613
620
  for await (const filePath of modulesInsideDeletedDirectory) {
614
621
  removeModuleFromGraph(filePath);
615
622
  }
616
623
  break;
624
+ }
617
625
  }
618
626
  },
619
627
  {
@@ -719,7 +727,7 @@ var dev = async ({ dir: emailsDirRelativePath, port }) => {
719
727
  emailsDirRelativePath,
720
728
  emailsDirRelativePath,
721
729
  // defaults to ./emails/static for the static files that are served to the preview
722
- parseInt(port)
730
+ Number.parseInt(port)
723
731
  );
724
732
  await setupHotreloading(devServer2, emailsDirRelativePath);
725
733
  } catch (error) {
@@ -740,6 +748,7 @@ import normalize from "normalize-path";
740
748
  // src/actions/get-emails-directory-metadata.ts
741
749
  import fs5 from "node:fs";
742
750
  import path7 from "node:path";
751
+ import { cache } from "react";
743
752
  var isFileAnEmail = (fullPath) => {
744
753
  const stat = fs5.statSync(fullPath);
745
754
  if (stat.isDirectory())
@@ -767,45 +776,47 @@ var mergeDirectoriesWithSubDirectories = (emailsDirectoryMetadata) => {
767
776
  }
768
777
  return currentResultingMergedDirectory;
769
778
  };
770
- var getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFileExtensions = false, isSubDirectory = false, baseDirectoryPath = absolutePathToEmailsDirectory) => {
771
- if (!fs5.existsSync(absolutePathToEmailsDirectory))
772
- return;
773
- const dirents = await fs5.promises.readdir(absolutePathToEmailsDirectory, {
774
- withFileTypes: true
775
- });
776
- const emailFilenames = dirents.filter(
777
- (dirent) => isFileAnEmail(path7.join(absolutePathToEmailsDirectory, dirent.name))
778
- ).map(
779
- (dirent) => keepFileExtensions ? dirent.name : dirent.name.replace(path7.extname(dirent.name), "")
780
- );
781
- const subDirectories = await Promise.all(
782
- dirents.filter(
783
- (dirent) => dirent.isDirectory() && !dirent.name.startsWith("_") && dirent.name !== "static"
784
- ).map((dirent) => {
785
- const direntAbsolutePath = path7.join(
786
- absolutePathToEmailsDirectory,
787
- dirent.name
788
- );
789
- return getEmailsDirectoryMetadata(
790
- direntAbsolutePath,
791
- keepFileExtensions,
792
- true,
793
- baseDirectoryPath
794
- );
795
- })
796
- );
797
- const emailsMetadata = {
798
- absolutePath: absolutePathToEmailsDirectory,
799
- relativePath: path7.relative(
800
- baseDirectoryPath,
801
- absolutePathToEmailsDirectory
802
- ),
803
- directoryName: absolutePathToEmailsDirectory.split(path7.sep).pop(),
804
- emailFilenames,
805
- subDirectories
806
- };
807
- return isSubDirectory ? mergeDirectoriesWithSubDirectories(emailsMetadata) : emailsMetadata;
808
- };
779
+ var getEmailsDirectoryMetadata = cache(
780
+ async (absolutePathToEmailsDirectory, keepFileExtensions = false, isSubDirectory = false, baseDirectoryPath = absolutePathToEmailsDirectory) => {
781
+ if (!fs5.existsSync(absolutePathToEmailsDirectory))
782
+ return;
783
+ const dirents = await fs5.promises.readdir(absolutePathToEmailsDirectory, {
784
+ withFileTypes: true
785
+ });
786
+ const emailFilenames = dirents.filter(
787
+ (dirent) => isFileAnEmail(path7.join(absolutePathToEmailsDirectory, dirent.name))
788
+ ).map(
789
+ (dirent) => keepFileExtensions ? dirent.name : dirent.name.replace(path7.extname(dirent.name), "")
790
+ );
791
+ const subDirectories = await Promise.all(
792
+ dirents.filter(
793
+ (dirent) => dirent.isDirectory() && !dirent.name.startsWith("_") && dirent.name !== "static"
794
+ ).map((dirent) => {
795
+ const direntAbsolutePath = path7.join(
796
+ absolutePathToEmailsDirectory,
797
+ dirent.name
798
+ );
799
+ return getEmailsDirectoryMetadata(
800
+ direntAbsolutePath,
801
+ keepFileExtensions,
802
+ true,
803
+ baseDirectoryPath
804
+ );
805
+ })
806
+ );
807
+ const emailsMetadata = {
808
+ absolutePath: absolutePathToEmailsDirectory,
809
+ relativePath: path7.relative(
810
+ baseDirectoryPath,
811
+ absolutePathToEmailsDirectory
812
+ ),
813
+ directoryName: absolutePathToEmailsDirectory.split(path7.sep).pop(),
814
+ emailFilenames,
815
+ subDirectories
816
+ };
817
+ return isSubDirectory ? mergeDirectoriesWithSubDirectories(emailsMetadata) : emailsMetadata;
818
+ }
819
+ );
809
820
 
810
821
  // src/utils/esbuild/renderring-utilities-exporter.ts
811
822
  import path8 from "node:path";
@@ -956,7 +967,7 @@ var exportTemplates = async (pathToWhereEmailMarkupShouldBeDumped, emailsDirecto
956
967
  }
957
968
  if (spinner) {
958
969
  spinner.succeed("Rendered all files");
959
- spinner.text = `Copying static files`;
970
+ spinner.text = "Copying static files";
960
971
  spinner.render();
961
972
  }
962
973
  const staticDirectoryPath = path9.join(emailsDirectoryPath, "static");
@@ -1134,7 +1145,7 @@ var updatePackageJson = async (builtPreviewAppPath) => {
1134
1145
  );
1135
1146
  };
1136
1147
  var npmInstall = async (builtPreviewAppPath, packageManager) => {
1137
- return new Promise(async (resolve, reject) => {
1148
+ return new Promise((resolve, reject) => {
1138
1149
  const childProc = spawn(
1139
1150
  packageManager,
1140
1151
  ["install", "--silent", "--include=dev"],
@@ -0,0 +1,20 @@
1
+ export * from '@react-email/body';
2
+ export * from '@react-email/button';
3
+ export * from '@react-email/code-block';
4
+ export * from '@react-email/code-inline';
5
+ export * from '@react-email/column';
6
+ export * from '@react-email/container';
7
+ export * from '@react-email/font';
8
+ export * from '@react-email/head';
9
+ export * from '@react-email/heading';
10
+ export * from '@react-email/hr';
11
+ export * from '@react-email/html';
12
+ export * from '@react-email/img';
13
+ export * from '@react-email/link';
14
+ export * from '@react-email/markdown';
15
+ export * from '@react-email/preview';
16
+ export * from '@react-email/render';
17
+ export * from '@react-email/row';
18
+ export * from '@react-email/section';
19
+ export * from '@react-email/tailwind';
20
+ export * from '@react-email/text';
@@ -0,0 +1,20 @@
1
+ export * from '@react-email/body';
2
+ export * from '@react-email/button';
3
+ export * from '@react-email/code-block';
4
+ export * from '@react-email/code-inline';
5
+ export * from '@react-email/column';
6
+ export * from '@react-email/container';
7
+ export * from '@react-email/font';
8
+ export * from '@react-email/head';
9
+ export * from '@react-email/heading';
10
+ export * from '@react-email/hr';
11
+ export * from '@react-email/html';
12
+ export * from '@react-email/img';
13
+ export * from '@react-email/link';
14
+ export * from '@react-email/markdown';
15
+ export * from '@react-email/preview';
16
+ export * from '@react-email/render';
17
+ export * from '@react-email/row';
18
+ export * from '@react-email/section';
19
+ export * from '@react-email/tailwind';
20
+ export * from '@react-email/text';
package/dist/index.js ADDED
@@ -0,0 +1,96 @@
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _object_spread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ var __defProp = Object.defineProperty;
30
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
31
+ var __getOwnPropNames = Object.getOwnPropertyNames;
32
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
33
+ var __copyProps = function(to, from, except, desc) {
34
+ if (from && typeof from === "object" || typeof from === "function") {
35
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
36
+ try {
37
+ var _loop = function() {
38
+ var key = _step.value;
39
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
40
+ get: function() {
41
+ return from[key];
42
+ },
43
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44
+ });
45
+ };
46
+ for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
47
+ } catch (err) {
48
+ _didIteratorError = true;
49
+ _iteratorError = err;
50
+ } finally{
51
+ try {
52
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
53
+ _iterator.return();
54
+ }
55
+ } finally{
56
+ if (_didIteratorError) {
57
+ throw _iteratorError;
58
+ }
59
+ }
60
+ }
61
+ }
62
+ return to;
63
+ };
64
+ var __reExport = function(target, mod, secondTarget) {
65
+ return __copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
66
+ };
67
+ var __toCommonJS = function(mod) {
68
+ return __copyProps(__defProp({}, "__esModule", {
69
+ value: true
70
+ }), mod);
71
+ };
72
+ // src/package/index.ts
73
+ var package_exports = {};
74
+ module.exports = __toCommonJS(package_exports);
75
+ __reExport(package_exports, require("@react-email/body"), module.exports);
76
+ __reExport(package_exports, require("@react-email/button"), module.exports);
77
+ __reExport(package_exports, require("@react-email/code-block"), module.exports);
78
+ __reExport(package_exports, require("@react-email/code-inline"), module.exports);
79
+ __reExport(package_exports, require("@react-email/column"), module.exports);
80
+ __reExport(package_exports, require("@react-email/container"), module.exports);
81
+ __reExport(package_exports, require("@react-email/font"), module.exports);
82
+ __reExport(package_exports, require("@react-email/head"), module.exports);
83
+ __reExport(package_exports, require("@react-email/heading"), module.exports);
84
+ __reExport(package_exports, require("@react-email/hr"), module.exports);
85
+ __reExport(package_exports, require("@react-email/html"), module.exports);
86
+ __reExport(package_exports, require("@react-email/img"), module.exports);
87
+ __reExport(package_exports, require("@react-email/link"), module.exports);
88
+ __reExport(package_exports, require("@react-email/markdown"), module.exports);
89
+ __reExport(package_exports, require("@react-email/preview"), module.exports);
90
+ __reExport(package_exports, require("@react-email/render"), module.exports);
91
+ __reExport(package_exports, require("@react-email/row"), module.exports);
92
+ __reExport(package_exports, require("@react-email/section"), module.exports);
93
+ __reExport(package_exports, require("@react-email/tailwind"), module.exports);
94
+ __reExport(package_exports, require("@react-email/text"), module.exports);
95
+ // Annotate the CommonJS export names for ESM import in node:
96
+ 0 && (module.exports = _object_spread({}, require("@react-email/body"), require("@react-email/button"), require("@react-email/code-block"), require("@react-email/code-inline"), require("@react-email/column"), require("@react-email/container"), require("@react-email/font"), require("@react-email/head"), require("@react-email/heading"), require("@react-email/hr"), require("@react-email/html"), require("@react-email/img"), require("@react-email/link"), require("@react-email/markdown"), require("@react-email/preview"), require("@react-email/render"), require("@react-email/row"), require("@react-email/section"), require("@react-email/tailwind"), require("@react-email/text")));
package/dist/index.mjs ADDED
@@ -0,0 +1,21 @@
1
+ // src/package/index.ts
2
+ export * from "@react-email/body";
3
+ export * from "@react-email/button";
4
+ export * from "@react-email/code-block";
5
+ export * from "@react-email/code-inline";
6
+ export * from "@react-email/column";
7
+ export * from "@react-email/container";
8
+ export * from "@react-email/font";
9
+ export * from "@react-email/head";
10
+ export * from "@react-email/heading";
11
+ export * from "@react-email/hr";
12
+ export * from "@react-email/html";
13
+ export * from "@react-email/img";
14
+ export * from "@react-email/link";
15
+ export * from "@react-email/markdown";
16
+ export * from "@react-email/preview";
17
+ export * from "@react-email/render";
18
+ export * from "@react-email/row";
19
+ export * from "@react-email/section";
20
+ export * from "@react-email/tailwind";
21
+ export * from "@react-email/text";
@@ -0,0 +1,33 @@
1
+ type Control<ValueType> = {
2
+ type: 'number';
3
+ defaultValue: ValueType;
4
+ } | {
5
+ type: 'email' | 'text';
6
+ defaultValue: string;
7
+ } | {
8
+ type: 'checkbox';
9
+ defaultValue: boolean;
10
+ } | {
11
+ type: 'select';
12
+ options: {
13
+ name: string;
14
+ value: ValueType;
15
+ }[];
16
+ defaultValue: ValueType;
17
+ };
18
+ type SafeControl<ValueType> = ValueType extends string ? Control<ValueType> & {
19
+ type: 'email' | 'text' | 'select';
20
+ } : ValueType extends number ? Control<ValueType> & {
21
+ type: 'number';
22
+ } : ValueType extends boolean ? Control<ValueType> & {
23
+ type: 'checkbox';
24
+ } : Control<ValueType>;
25
+ type Controls<Props extends object = Record<string, unknown>> = {
26
+ [K in keyof Props]?: SafeControl<Props[K]>;
27
+ };
28
+ declare const setupForPreview: <Props extends object>(component: {
29
+ (props: Props): React.ReactNode;
30
+ controls?: Controls<Props> | undefined;
31
+ }, controls: Controls<Props>) => void;
32
+
33
+ export { Control, Controls, setupForPreview };
@@ -0,0 +1,33 @@
1
+ type Control<ValueType> = {
2
+ type: 'number';
3
+ defaultValue: ValueType;
4
+ } | {
5
+ type: 'email' | 'text';
6
+ defaultValue: string;
7
+ } | {
8
+ type: 'checkbox';
9
+ defaultValue: boolean;
10
+ } | {
11
+ type: 'select';
12
+ options: {
13
+ name: string;
14
+ value: ValueType;
15
+ }[];
16
+ defaultValue: ValueType;
17
+ };
18
+ type SafeControl<ValueType> = ValueType extends string ? Control<ValueType> & {
19
+ type: 'email' | 'text' | 'select';
20
+ } : ValueType extends number ? Control<ValueType> & {
21
+ type: 'number';
22
+ } : ValueType extends boolean ? Control<ValueType> & {
23
+ type: 'checkbox';
24
+ } : Control<ValueType>;
25
+ type Controls<Props extends object = Record<string, unknown>> = {
26
+ [K in keyof Props]?: SafeControl<Props[K]>;
27
+ };
28
+ declare const setupForPreview: <Props extends object>(component: {
29
+ (props: Props): React.ReactNode;
30
+ controls?: Controls<Props> | undefined;
31
+ }, controls: Controls<Props>) => void;
32
+
33
+ export { Control, Controls, setupForPreview };
@@ -0,0 +1,62 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = function(target, all) {
6
+ for(var name in all)__defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = function(to, from, except, desc) {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
14
+ try {
15
+ var _loop = function() {
16
+ var key = _step.value;
17
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: function() {
19
+ return from[key];
20
+ },
21
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
+ });
23
+ };
24
+ for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
25
+ } catch (err) {
26
+ _didIteratorError = true;
27
+ _iteratorError = err;
28
+ } finally{
29
+ try {
30
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
31
+ _iterator.return();
32
+ }
33
+ } finally{
34
+ if (_didIteratorError) {
35
+ throw _iteratorError;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ return to;
41
+ };
42
+ var __toCommonJS = function(mod) {
43
+ return __copyProps(__defProp({}, "__esModule", {
44
+ value: true
45
+ }), mod);
46
+ };
47
+ // src/package/index.ts
48
+ var package_exports = {};
49
+ __export(package_exports, {
50
+ setupForPreview: function() {
51
+ return setupForPreview;
52
+ }
53
+ });
54
+ module.exports = __toCommonJS(package_exports);
55
+ // src/package/setup-for-preview.ts
56
+ var setupForPreview = function(component, controls) {
57
+ component.controls = controls;
58
+ };
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ setupForPreview: setupForPreview
62
+ });
@@ -0,0 +1,7 @@
1
+ // src/package/setup-for-preview.ts
2
+ var setupForPreview = (component, controls) => {
3
+ component.controls = controls;
4
+ };
5
+ export {
6
+ setupForPreview
7
+ };
@@ -1 +1 @@
1
- 9wK7iUJPUvFYJNYOqHNpo
1
+ 6K68y2QEZ1dLbv-Xhi30p
@@ -1,44 +1,44 @@
1
1
  {
2
2
  "pages": {
3
3
  "/_not-found/page": [
4
- "static/chunks/webpack-cf1ab84f284a4073.js",
5
- "static/chunks/f38cb6f6-40e76da092bb0490.js",
6
- "static/chunks/121-c9990f9db62882f2.js",
7
- "static/chunks/main-app-6ed588927d8fd56c.js",
8
- "static/chunks/app/_not-found/page-02dfc5a8a0bd636e.js"
4
+ "static/chunks/webpack-9255716c9496e606.js",
5
+ "static/chunks/5fec7a0a-5179023f3f5a9421.js",
6
+ "static/chunks/797-46f6c20952f0a280.js",
7
+ "static/chunks/main-app-2c7f96205a73f128.js",
8
+ "static/chunks/app/_not-found/page-96d3eac723be3ee2.js"
9
9
  ],
10
10
  "/layout": [
11
- "static/chunks/webpack-cf1ab84f284a4073.js",
12
- "static/chunks/f38cb6f6-40e76da092bb0490.js",
13
- "static/chunks/121-c9990f9db62882f2.js",
14
- "static/chunks/main-app-6ed588927d8fd56c.js",
11
+ "static/chunks/webpack-9255716c9496e606.js",
12
+ "static/chunks/5fec7a0a-5179023f3f5a9421.js",
13
+ "static/chunks/797-46f6c20952f0a280.js",
14
+ "static/chunks/main-app-2c7f96205a73f128.js",
15
15
  "static/css/eb0a93282704d7ab.css",
16
- "static/css/0a13d10225a26b9d.css",
17
- "static/chunks/262-1ec6780d76508af8.js",
18
- "static/chunks/app/layout-62d01ca567f6fd12.js"
16
+ "static/css/ec5d7e66bd3b6cb8.css",
17
+ "static/chunks/447-886131c35ca42b91.js",
18
+ "static/chunks/app/layout-e1b6f1534cbbe5bd.js"
19
19
  ],
20
20
  "/page": [
21
- "static/chunks/webpack-cf1ab84f284a4073.js",
22
- "static/chunks/f38cb6f6-40e76da092bb0490.js",
23
- "static/chunks/121-c9990f9db62882f2.js",
24
- "static/chunks/main-app-6ed588927d8fd56c.js",
25
- "static/css/0a13d10225a26b9d.css",
26
- "static/chunks/262-1ec6780d76508af8.js",
27
- "static/chunks/783-41562adc25d0c844.js",
28
- "static/chunks/732-2b6186d8c8624033.js",
29
- "static/chunks/app/page-630c6c846e3efc69.js"
21
+ "static/chunks/webpack-9255716c9496e606.js",
22
+ "static/chunks/5fec7a0a-5179023f3f5a9421.js",
23
+ "static/chunks/797-46f6c20952f0a280.js",
24
+ "static/chunks/main-app-2c7f96205a73f128.js",
25
+ "static/css/ec5d7e66bd3b6cb8.css",
26
+ "static/chunks/447-886131c35ca42b91.js",
27
+ "static/chunks/12-b9450aa0845e7574.js",
28
+ "static/chunks/154-69b91a0c2fd801b8.js",
29
+ "static/chunks/app/page-2c3e297e38c526ef.js"
30
30
  ],
31
31
  "/preview/[...slug]/page": [
32
- "static/chunks/webpack-cf1ab84f284a4073.js",
33
- "static/chunks/f38cb6f6-40e76da092bb0490.js",
34
- "static/chunks/121-c9990f9db62882f2.js",
35
- "static/chunks/main-app-6ed588927d8fd56c.js",
36
- "static/css/0a13d10225a26b9d.css",
37
- "static/chunks/262-1ec6780d76508af8.js",
38
- "static/chunks/783-41562adc25d0c844.js",
39
- "static/chunks/599-b4e686757f7b900d.js",
40
- "static/chunks/732-2b6186d8c8624033.js",
41
- "static/chunks/app/preview/[...slug]/page-6547e9f3ba86c271.js"
32
+ "static/chunks/webpack-9255716c9496e606.js",
33
+ "static/chunks/5fec7a0a-5179023f3f5a9421.js",
34
+ "static/chunks/797-46f6c20952f0a280.js",
35
+ "static/chunks/main-app-2c7f96205a73f128.js",
36
+ "static/css/ec5d7e66bd3b6cb8.css",
37
+ "static/chunks/447-886131c35ca42b91.js",
38
+ "static/chunks/12-b9450aa0845e7574.js",
39
+ "static/chunks/860-38d96c8819ba6f19.js",
40
+ "static/chunks/154-69b91a0c2fd801b8.js",
41
+ "static/chunks/app/preview/[...slug]/page-2b4988ba6daf34e1.js"
42
42
  ]
43
43
  }
44
44
  }
@@ -1 +1 @@
1
- {"/_not-found/page":"/_not-found","/page":"/","/favicon.ico/route":"/favicon.ico","/preview/[...slug]/page":"/preview/[...slug]"}
1
+ {"/_not-found/page":"/_not-found","/favicon.ico/route":"/favicon.ico","/page":"/","/preview/[...slug]/page":"/preview/[...slug]"}