react-email 5.3.0-canary.2 → 6.0.0-canary.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.
Files changed (190) hide show
  1. package/CHANGELOG.md +64 -2
  2. package/dev/CHANGELOG.md +2 -0
  3. package/dev/index.js +1 -5
  4. package/dev/package.json +1 -1
  5. package/dist/{index.js → cli/index.mjs} +430 -1194
  6. package/dist/index.cjs +39878 -0
  7. package/dist/index.d.cts +5114 -0
  8. package/dist/index.d.mts +5114 -0
  9. package/dist/index.mjs +39788 -0
  10. package/package.json +32 -14
  11. package/src/components/body/__snapshots__/body.spec.tsx.snap +23 -0
  12. package/src/components/body/body.spec.tsx +78 -0
  13. package/src/components/body/body.tsx +48 -0
  14. package/src/components/body/index.ts +1 -0
  15. package/src/components/body/margin-properties.ts +27 -0
  16. package/src/components/button/button.spec.tsx +53 -0
  17. package/src/components/button/button.tsx +112 -0
  18. package/src/components/button/index.ts +1 -0
  19. package/src/components/button/utils/parse-padding.ts +137 -0
  20. package/src/components/button/utils/px-to-pt.ts +4 -0
  21. package/src/components/button/utils/utils.spec.ts +153 -0
  22. package/src/components/code-block/code-block.tsx +134 -0
  23. package/src/components/code-block/index.ts +3 -0
  24. package/src/components/code-block/languages-available.ts +402 -0
  25. package/src/components/code-block/prism.ts +15618 -0
  26. package/src/components/code-block/themes.ts +4929 -0
  27. package/src/components/code-inline/code-inline.tsx +58 -0
  28. package/src/components/code-inline/index.ts +1 -0
  29. package/src/components/column/column.spec.tsx +28 -0
  30. package/src/components/column/column.tsx +15 -0
  31. package/src/components/column/index.ts +1 -0
  32. package/src/components/container/container.spec.tsx +33 -0
  33. package/src/components/container/container.tsx +29 -0
  34. package/src/components/container/index.ts +1 -0
  35. package/src/components/font/font.spec.tsx +63 -0
  36. package/src/components/font/font.tsx +76 -0
  37. package/src/components/font/index.ts +1 -0
  38. package/src/components/head/head.spec.tsx +34 -0
  39. package/src/components/head/head.tsx +15 -0
  40. package/src/components/head/index.ts +1 -0
  41. package/src/components/heading/heading.spec.tsx +32 -0
  42. package/src/components/heading/heading.tsx +29 -0
  43. package/src/components/heading/index.ts +1 -0
  44. package/src/components/heading/utils/as.ts +26 -0
  45. package/src/components/heading/utils/spaces.ts +64 -0
  46. package/src/components/heading/utils/utils.spec.ts +70 -0
  47. package/src/components/hr/hr.spec.tsx +22 -0
  48. package/src/components/hr/hr.tsx +20 -0
  49. package/src/components/hr/index.ts +1 -0
  50. package/src/components/html/html.spec.tsx +26 -0
  51. package/src/components/html/html.tsx +13 -0
  52. package/src/components/html/index.ts +1 -0
  53. package/src/components/img/img.spec.tsx +30 -0
  54. package/src/components/img/img.tsx +25 -0
  55. package/src/components/img/index.ts +1 -0
  56. package/src/components/index.ts +19 -0
  57. package/src/components/link/index.ts +1 -0
  58. package/src/components/link/link.spec.tsx +37 -0
  59. package/src/components/link/link.tsx +22 -0
  60. package/src/components/markdown/index.ts +1 -0
  61. package/src/components/markdown/markdown.spec.tsx +187 -0
  62. package/src/components/markdown/markdown.tsx +238 -0
  63. package/src/components/markdown/styles.ts +130 -0
  64. package/src/components/markdown/utils/parse-css-in-js-to-inline-css.ts +73 -0
  65. package/src/components/preview/index.ts +1 -0
  66. package/src/components/preview/preview.spec.tsx +49 -0
  67. package/src/components/preview/preview.tsx +47 -0
  68. package/src/components/row/index.ts +1 -0
  69. package/src/components/row/row.spec.tsx +28 -0
  70. package/src/components/row/row.tsx +31 -0
  71. package/src/components/section/index.ts +1 -0
  72. package/src/components/section/section.spec.tsx +58 -0
  73. package/src/components/section/section.tsx +29 -0
  74. package/src/components/tailwind/__snapshots__/tailwind.spec.tsx.snap +25 -0
  75. package/src/components/tailwind/e2e/integrations.spec.ts +44 -0
  76. package/src/components/tailwind/e2e/nextjs/README.md +9 -0
  77. package/src/components/tailwind/e2e/nextjs/emails/vercel-invite-user.tsx +151 -0
  78. package/src/components/tailwind/e2e/nextjs/next.config.mjs +7 -0
  79. package/src/components/tailwind/e2e/nextjs/package.json +25 -0
  80. package/src/components/tailwind/e2e/nextjs/src/app/favicon.ico +0 -0
  81. package/src/components/tailwind/e2e/nextjs/src/app/layout.tsx +23 -0
  82. package/src/components/tailwind/e2e/nextjs/src/app/page.tsx +7 -0
  83. package/src/components/tailwind/e2e/nextjs/tsconfig.json +27 -0
  84. package/src/components/tailwind/e2e/vite/README.md +9 -0
  85. package/src/components/tailwind/e2e/vite/emails/vercel-invite-user.tsx +151 -0
  86. package/src/components/tailwind/e2e/vite/index.html +13 -0
  87. package/src/components/tailwind/e2e/vite/package.json +26 -0
  88. package/src/components/tailwind/e2e/vite/public/vite.svg +1 -0
  89. package/src/components/tailwind/e2e/vite/src/App.tsx +10 -0
  90. package/src/components/tailwind/e2e/vite/src/main.tsx +9 -0
  91. package/src/components/tailwind/e2e/vite/src/vite-env.d.ts +1 -0
  92. package/src/components/tailwind/e2e/vite/tsconfig.json +25 -0
  93. package/src/components/tailwind/e2e/vite/tsconfig.node.json +11 -0
  94. package/src/components/tailwind/e2e/vite/vite.config.ts +7 -0
  95. package/src/components/tailwind/hooks/use-suspended-promise.ts +34 -0
  96. package/src/components/tailwind/hooks/use-suspensed-promise.spec.ts +263 -0
  97. package/src/components/tailwind/index.ts +4 -0
  98. package/src/components/tailwind/inline-styles.ts +21 -0
  99. package/src/components/tailwind/sanitize-stylesheet.ts +10 -0
  100. package/src/components/tailwind/tailwind.spec.tsx +941 -0
  101. package/src/components/tailwind/tailwind.tsx +174 -0
  102. package/src/components/tailwind/utils/__snapshots__/quick-safe-render-to-string.spec.tsx.snap +3 -0
  103. package/src/components/tailwind/utils/compatibility/escape-class-name.spec.ts +17 -0
  104. package/src/components/tailwind/utils/compatibility/escape-class-name.ts +18 -0
  105. package/src/components/tailwind/utils/compatibility/get-react-property.ts +15 -0
  106. package/src/components/tailwind/utils/compatibility/sanitize-class-name.spec.ts +7 -0
  107. package/src/components/tailwind/utils/compatibility/sanitize-class-name.ts +36 -0
  108. package/src/components/tailwind/utils/compatibility/unescape-class.ts +3 -0
  109. package/src/components/tailwind/utils/css/__snapshots__/extract-rules-matching-classes.spec.ts.snap +23 -0
  110. package/src/components/tailwind/utils/css/__snapshots__/remove-rule-duplicates-from-root.spec.ts.snap +3 -0
  111. package/src/components/tailwind/utils/css/__snapshots__/sanitize-non-inlinable-classes.spec.ts.snap +7 -0
  112. package/src/components/tailwind/utils/css/extract-rules-per-class.spec.ts +146 -0
  113. package/src/components/tailwind/utils/css/extract-rules-per-class.ts +44 -0
  114. package/src/components/tailwind/utils/css/get-custom-properties.ts +49 -0
  115. package/src/components/tailwind/utils/css/is-part-inlinable.ts +15 -0
  116. package/src/components/tailwind/utils/css/is-rule-inlinable.ts +15 -0
  117. package/src/components/tailwind/utils/css/make-inline-styles-for.spec.ts +51 -0
  118. package/src/components/tailwind/utils/css/make-inline-styles-for.ts +70 -0
  119. package/src/components/tailwind/utils/css/resolve-all-css-variables.spec.ts +280 -0
  120. package/src/components/tailwind/utils/css/resolve-all-css-variables.ts +199 -0
  121. package/src/components/tailwind/utils/css/resolve-calc-expressions.spec.ts +36 -0
  122. package/src/components/tailwind/utils/css/resolve-calc-expressions.ts +147 -0
  123. package/src/components/tailwind/utils/css/sanitize-declarations.spec.ts +397 -0
  124. package/src/components/tailwind/utils/css/sanitize-declarations.ts +429 -0
  125. package/src/components/tailwind/utils/css/sanitize-non-inlinable-rules.spec.ts +51 -0
  126. package/src/components/tailwind/utils/css/sanitize-non-inlinable-rules.ts +35 -0
  127. package/src/components/tailwind/utils/css/split-mixed-rule.ts +68 -0
  128. package/src/components/tailwind/utils/css/unwrap-value.ts +9 -0
  129. package/src/components/tailwind/utils/react/is-component.ts +36 -0
  130. package/src/components/tailwind/utils/react/map-react-tree.spec.tsx +58 -0
  131. package/src/components/tailwind/utils/react/map-react-tree.ts +58 -0
  132. package/src/components/tailwind/utils/tailwindcss/clone-element-with-inlined-styles.ts +61 -0
  133. package/src/components/tailwind/utils/tailwindcss/setup-tailwind.spec.ts +18 -0
  134. package/src/components/tailwind/utils/tailwindcss/setup-tailwind.ts +82 -0
  135. package/src/components/tailwind/utils/tailwindcss/tailwind-stylesheets/index.ts +900 -0
  136. package/src/components/tailwind/utils/tailwindcss/tailwind-stylesheets/preflight.ts +397 -0
  137. package/src/components/tailwind/utils/tailwindcss/tailwind-stylesheets/theme.ts +466 -0
  138. package/src/components/tailwind/utils/tailwindcss/tailwind-stylesheets/utilities.ts +5 -0
  139. package/src/components/tailwind/utils/text/from-dash-case-to-camel-case.ts +3 -0
  140. package/src/components/text/index.ts +1 -0
  141. package/src/components/text/text.spec.tsx +35 -0
  142. package/src/components/text/text.tsx +48 -0
  143. package/src/components/text/utils/compute-margins.spec.ts +67 -0
  144. package/src/components/text/utils/compute-margins.ts +102 -0
  145. package/src/index.ts +2 -71
  146. package/tsconfig.json +3 -3
  147. package/tsdown.config.ts +52 -6
  148. package/vitest.config.ts +1 -0
  149. package/src/actions/email-validation/__snapshots__/check-images.spec.tsx.snap +0 -84
  150. package/src/commands/build.ts +0 -254
  151. package/src/commands/dev.ts +0 -27
  152. package/src/commands/export.ts +0 -204
  153. package/src/commands/resend/reset.ts +0 -8
  154. package/src/commands/resend/setup.ts +0 -29
  155. package/src/commands/start.ts +0 -38
  156. package/src/utils/conf.ts +0 -9
  157. package/src/utils/esbuild/escape-string-for-regex.ts +0 -3
  158. package/src/utils/esbuild/renderring-utilities-exporter.ts +0 -63
  159. package/src/utils/get-emails-directory-metadata.spec.ts +0 -82
  160. package/src/utils/get-emails-directory-metadata.ts +0 -140
  161. package/src/utils/get-preview-server-location.spec.ts +0 -17
  162. package/src/utils/get-preview-server-location.ts +0 -128
  163. package/src/utils/index.ts +0 -2
  164. package/src/utils/packageJson.ts +0 -4
  165. package/src/utils/preview/get-env-variables-for-preview-app.ts +0 -16
  166. package/src/utils/preview/hot-reloading/create-dependency-graph.spec.ts +0 -226
  167. package/src/utils/preview/hot-reloading/create-dependency-graph.ts +0 -343
  168. package/src/utils/preview/hot-reloading/get-imported-modules.spec.ts +0 -151
  169. package/src/utils/preview/hot-reloading/get-imported-modules.ts +0 -49
  170. package/src/utils/preview/hot-reloading/resolve-path-aliases.spec.ts +0 -11
  171. package/src/utils/preview/hot-reloading/resolve-path-aliases.ts +0 -32
  172. package/src/utils/preview/hot-reloading/setup-hot-reloading.ts +0 -121
  173. package/src/utils/preview/hot-reloading/test/dependency-graph/inner/data-to-import.json +0 -1
  174. package/src/utils/preview/hot-reloading/test/dependency-graph/inner/file-a.ts +0 -5
  175. package/src/utils/preview/hot-reloading/test/dependency-graph/inner/file-b.ts +0 -5
  176. package/src/utils/preview/hot-reloading/test/dependency-graph/inner/general-importing-file.ts +0 -9
  177. package/src/utils/preview/hot-reloading/test/dependency-graph/inner/outer-dependency.ts +0 -3
  178. package/src/utils/preview/hot-reloading/test/dependency-graph/inner/path-aliases.ts +0 -1
  179. package/src/utils/preview/hot-reloading/test/dependency-graph/outer.ts +0 -5
  180. package/src/utils/preview/hot-reloading/test/some-file.ts +0 -0
  181. package/src/utils/preview/hot-reloading/test/tsconfig.json +0 -8
  182. package/src/utils/preview/index.ts +0 -2
  183. package/src/utils/preview/serve-static-file.ts +0 -51
  184. package/src/utils/preview/start-dev-server.ts +0 -236
  185. package/src/utils/register-spinner-autostopping.ts +0 -28
  186. package/src/utils/style-text.ts +0 -11
  187. package/src/utils/tree.spec.ts +0 -32
  188. package/src/utils/tree.ts +0 -76
  189. package/src/utils/types/hot-reload-change.ts +0 -6
  190. package/src/utils/types/hot-reload-event.ts +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # react-email
2
2
 
3
+ ## 6.0.0-canary.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7fc539d]
8
+ - @react-email/render@2.0.7-canary.0
9
+
10
+ ## 6.0.0-canary.0
11
+
12
+ ### Major Changes
13
+
14
+ - d0a7a52: Move all components and utilities into the `react-email` package
15
+
16
+ All components (previously in `@react-email/components` or individual packages like `@react-email/button`) and rendering utilities (previously in `@react-email/render`) are now exported directly from `react-email`. This unifies the install and import experience into a single package.
17
+
18
+ We're going to deprecate all packages except `@react-email/render` and `@react-email/preview-server`, and they will not be updated anymore.
19
+
20
+ ### Breaking change
21
+
22
+ Imports from `@react-email/components`, `@react-email/render`, or individual component packages (e.g. `@react-email/button`) are no longer the recommended path and they will all be deprecated with the exception of `@react-email/render` and `@react-email/editor`, and `render` will remain exported from `react-email`. Consumers should import everything from `react-email`.
23
+
24
+ ### Why
25
+
26
+ Having separate packages for components (`@react-email/components`), and the CLI (`react-email`) created unnecessary confusion, and a maintenance burden for us.
27
+
28
+ ### How to migrate
29
+ 1. **Update your dependencies** -- remove `@react-email/components`, keep `react-email`:
30
+
31
+ ```diff
32
+ - npm install @react-email/components react-email @react-email/preview-server
33
+ + npm install react-email @react-email/preview-server
34
+ ```
35
+
36
+ 2. **Update your imports**:
37
+
38
+ ```diff
39
+ - import { Button, Html, Head, render } from "@react-email/components";
40
+ + import { Button, Html, Head, render } from "react-email";
41
+ ```
42
+
43
+ 3. The `@react-email/preview-server` and `@react-email/editor` packages are not included in `react-email`
44
+
45
+ ### Patch Changes
46
+
47
+ - a3a15ea: replace deprecated `url.parse()` with WHATWG URL API in the preview dev server.
48
+
49
+ ## 5.2.10
50
+
51
+ ## 5.2.9
52
+
53
+ ### Patch Changes
54
+
55
+ - 79bb7cc: manually determine esbuild binary path to avoid forcing a host version
56
+
57
+ ## 5.2.8
58
+
59
+ ## 5.2.7
60
+
61
+ ## 5.2.6
62
+
63
+ ### Patch Changes
64
+
65
+ - 11f56c5: fix RESEND_API_KEY being overwritten in email preview
66
+
3
67
  ## 5.3.0-canary.2
4
68
 
5
69
  ### Patch Changes
@@ -555,7 +619,6 @@
555
619
  ## Why
556
620
 
557
621
  Three reasons:
558
-
559
622
  1. Better support of NextJS's latest versions
560
623
  2. Being ready for future React API deprecations
561
624
  3. Support for Suspense which allows for using async inside components
@@ -588,7 +651,6 @@
588
651
  ## Why
589
652
 
590
653
  Three reasons:
591
-
592
654
  1. Better support of NextJS's latest versions
593
655
  2. Being ready for future React API deprecations
594
656
  3. Support for Suspense which allows for using async inside components
package/dev/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # email-dev
2
2
 
3
+ ## 0.0.6
4
+
3
5
  ## 0.0.5
4
6
 
5
7
  ## 0.0.4
package/dev/index.js CHANGED
@@ -6,17 +6,13 @@ import { join } from 'shlex';
6
6
  const filename = url.fileURLToPath(import.meta.url);
7
7
  const dirname = path.dirname(filename);
8
8
 
9
- const root = path.resolve(dirname, '../src/index.ts');
9
+ const root = path.resolve(dirname, '../src/cli/index.ts');
10
10
 
11
11
  const tsx = child_process.spawn(
12
12
  `pnpm tsx ${root} ${join(process.argv.slice(2))}`,
13
13
  {
14
14
  cwd: process.cwd(),
15
15
  shell: true,
16
- env: {
17
- ...process.env,
18
- NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ''} --experimental-vm-modules --disable-warning=ExperimentalWarning`,
19
- },
20
16
  stdio: 'inherit',
21
17
  },
22
18
  );
package/dev/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-dev",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "bin": "index.js",
5
5
  "private": true,
6
6
  "type": "module",