react-email 4.0.0-alpha.4 → 4.0.0-alpha.6

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 (189) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cli/index.js +1175 -2658
  3. package/dist/cli/index.mjs +18 -12
  4. package/dist/preview/.next/BUILD_ID +1 -1
  5. package/dist/preview/.next/app-build-manifest.json +31 -34
  6. package/dist/preview/.next/app-path-routes-manifest.json +6 -1
  7. package/dist/preview/.next/build-manifest.json +14 -14
  8. package/dist/preview/.next/cache/.rscinfo +1 -1
  9. package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
  10. package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
  12. package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
  13. package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
  14. package/dist/preview/.next/diagnostics/framework.json +1 -1
  15. package/dist/preview/.next/export-marker.json +6 -1
  16. package/dist/preview/.next/images-manifest.json +57 -1
  17. package/dist/preview/.next/next-minimal-server.js.nft.json +1 -1
  18. package/dist/preview/.next/next-server.js.nft.json +1 -1
  19. package/dist/preview/.next/prerender-manifest.json +41 -1
  20. package/dist/preview/.next/required-server-files.json +310 -1
  21. package/dist/preview/.next/routes-manifest.json +64 -1
  22. package/dist/preview/.next/server/app/_not-found/page.js +1 -1
  23. package/dist/preview/.next/server/app/_not-found/page.js.nft.json +1 -1
  24. package/dist/preview/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  25. package/dist/preview/.next/server/app/favicon.ico/route.js +1 -1
  26. package/dist/preview/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  27. package/dist/preview/.next/server/app/page.js +1 -1
  28. package/dist/preview/.next/server/app/page.js.nft.json +1 -1
  29. package/dist/preview/.next/server/app/page_client-reference-manifest.js +1 -1
  30. package/dist/preview/.next/server/app/preview/[...slug]/page.js +47 -10
  31. package/dist/preview/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
  32. package/dist/preview/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
  33. package/dist/preview/.next/server/app-paths-manifest.json +1 -1
  34. package/dist/preview/.next/server/chunks/171.js +14 -0
  35. package/dist/preview/.next/server/chunks/446.js +6 -0
  36. package/dist/preview/.next/server/chunks/600.js +8 -0
  37. package/dist/preview/.next/server/chunks/811.js +13 -0
  38. package/dist/preview/.next/server/chunks/833.js +1 -0
  39. package/dist/preview/.next/server/functions-config-manifest.json +4 -1
  40. package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
  41. package/dist/preview/.next/server/next-font-manifest.js +1 -1
  42. package/dist/preview/.next/server/next-font-manifest.json +1 -1
  43. package/dist/preview/.next/server/pages/500.html +1 -1
  44. package/dist/preview/.next/server/pages/_app.js +1 -1
  45. package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
  46. package/dist/preview/.next/server/pages/_document.js +1 -1
  47. package/dist/preview/.next/server/pages/_document.js.nft.json +1 -1
  48. package/dist/preview/.next/server/pages/_error.js +1 -1
  49. package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
  50. package/dist/preview/.next/server/pages-manifest.json +5 -1
  51. package/dist/preview/.next/server/server-reference-manifest.js +1 -1
  52. package/dist/preview/.next/server/server-reference-manifest.json +1 -1
  53. package/dist/preview/.next/server/webpack-runtime.js +1 -1
  54. package/dist/preview/.next/static/chunks/416-56f79fc7e689f06f.js +1 -0
  55. package/dist/preview/.next/static/chunks/683-8bbfd191e5105f01.js +1 -0
  56. package/dist/preview/.next/static/chunks/744-79730358b37b2212.js +1 -0
  57. package/dist/preview/.next/static/chunks/781-5f16c6bc9d9d4cc1.js +1 -0
  58. package/dist/preview/.next/static/chunks/832ad4be-cb988facfb8f955f.js +1 -0
  59. package/dist/preview/.next/static/chunks/87-38e35f08507de015.js +1 -0
  60. package/dist/preview/.next/static/chunks/{afa401a5-9ebf2515b1397993.js → afa401a5-3e949a1cfd317dd3.js} +3 -3
  61. package/dist/preview/.next/static/chunks/app/_not-found/page-09d694081cc9d4dc.js +1 -0
  62. package/dist/preview/.next/static/chunks/app/layout-a6640e62690d8fd6.js +1 -0
  63. package/dist/preview/.next/static/chunks/app/page-ba68f50b287e7478.js +1 -0
  64. package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-4a5b026ab543e27f.js +1 -0
  65. package/dist/preview/.next/static/chunks/framework-c2bd6d936e3077bc.js +1 -0
  66. package/dist/preview/.next/static/chunks/main-44463a8301435b64.js +1 -0
  67. package/dist/preview/.next/static/chunks/main-app-c2e686acf8d370d7.js +1 -0
  68. package/dist/preview/.next/static/chunks/pages/_app-f3011d3f00bb8dba.js +1 -0
  69. package/dist/preview/.next/static/chunks/pages/_error-39a87dee2e97a2a3.js +1 -0
  70. package/dist/preview/.next/static/chunks/{webpack-9255716c9496e606.js → webpack-41e2667c9f086a4f.js} +1 -1
  71. package/dist/preview/.next/static/css/d7df9cfc3e182163.css +3 -0
  72. package/dist/preview/.next/static/gFk9UfWL8joM4iD7-wlKF/_buildManifest.js +1 -0
  73. package/dist/preview/.next/static/media/05613964ce6c782e-s.p.otf +0 -0
  74. package/dist/preview/.next/static/media/11c6126b9369e85e-s.p.otf +0 -0
  75. package/dist/preview/.next/static/media/26cb97734d8cb717-s.p.otf +0 -0
  76. package/dist/preview/.next/static/media/bb6462617151f6b7-s.p.otf +0 -0
  77. package/dist/preview/.next/static/media/cf6daef822ab0142-s.p.otf +0 -0
  78. package/dist/preview/.next/static/media/e4051546b3043204-s.p.otf +0 -0
  79. package/dist/preview/.next/trace +26 -22
  80. package/dist/preview/.next/types/cache-life.d.ts +3 -3
  81. package/package.json +17 -11
  82. package/scripts/build-preview-server.mjs +32 -0
  83. package/scripts/fill-caniemail-data.mjs +36 -0
  84. package/src/actions/email-validation/caniemail-data.ts +85993 -0
  85. package/src/actions/email-validation/check-compatibility.ts +322 -0
  86. package/src/actions/email-validation/check-images.spec.tsx +21 -12
  87. package/src/actions/email-validation/check-images.ts +88 -86
  88. package/src/actions/email-validation/check-links.spec.tsx +24 -14
  89. package/src/actions/email-validation/check-links.ts +59 -56
  90. package/src/actions/get-email-path-from-slug.ts +1 -1
  91. package/src/actions/render-email-by-path.tsx +2 -1
  92. package/src/{utils/emails-directory-absolute-path.ts → app/env.ts} +2 -0
  93. package/src/app/fonts/SFMono/SFMonoBold.otf +0 -0
  94. package/src/app/fonts/SFMono/SFMonoBoldItalic.otf +0 -0
  95. package/src/app/fonts/SFMono/SFMonoHeavy.otf +0 -0
  96. package/src/app/fonts/SFMono/SFMonoHeavyItalic.otf +0 -0
  97. package/src/app/fonts/SFMono/SFMonoLight.otf +0 -0
  98. package/src/app/fonts/SFMono/SFMonoLightItalic.otf +0 -0
  99. package/src/app/fonts/SFMono/SFMonoMedium.otf +0 -0
  100. package/src/app/fonts/SFMono/SFMonoMediumItalic.otf +0 -0
  101. package/src/app/fonts/SFMono/SFMonoRegular.otf +0 -0
  102. package/src/app/fonts/SFMono/SFMonoRegularItalic.otf +0 -0
  103. package/src/app/fonts/SFMono/SFMonoSemibold.otf +0 -0
  104. package/src/app/fonts/SFMono/SFMonoSemiboldItalic.otf +0 -0
  105. package/src/app/fonts.ts +39 -0
  106. package/src/app/layout.tsx +6 -3
  107. package/src/app/page.tsx +4 -4
  108. package/src/app/preview/[...slug]/page.tsx +73 -16
  109. package/src/app/preview/[...slug]/preview.tsx +49 -77
  110. package/src/components/code.tsx +0 -1
  111. package/src/components/icons/icon-base.tsx +4 -2
  112. package/src/components/icons/icon-reload.tsx +19 -0
  113. package/src/components/icons/icon-scanner.tsx +19 -0
  114. package/src/components/icons/icon-scissors.tsx +19 -0
  115. package/src/components/icons/icon-warning.tsx +31 -0
  116. package/src/components/send.tsx +1 -2
  117. package/src/components/shell.tsx +52 -88
  118. package/src/components/sidebar/file-tree-directory-children.tsx +1 -1
  119. package/src/components/sidebar/file-tree.tsx +1 -1
  120. package/src/components/sidebar/sidebar.tsx +23 -378
  121. package/src/components/toolbar/linter.tsx +310 -0
  122. package/src/components/toolbar/results-table.tsx +0 -0
  123. package/src/components/toolbar/results.tsx +48 -0
  124. package/src/components/toolbar/spam-assassin.tsx +144 -0
  125. package/src/components/toolbar/toolbar-button.tsx +50 -0
  126. package/src/components/toolbar/use-cached-state.ts +33 -0
  127. package/src/components/toolbar.tsx +197 -0
  128. package/src/components/tooltip-content.tsx +1 -2
  129. package/src/components/topbar/view-size-controls.tsx +1 -0
  130. package/src/components/topbar.tsx +29 -48
  131. package/src/contexts/emails.tsx +2 -1
  132. package/src/contexts/preview.tsx +81 -0
  133. package/src/hooks/use-email-rendering-result.ts +2 -1
  134. package/src/utils/__snapshots__/get-email-component.spec.ts.snap +1 -1
  135. package/src/utils/caniemail/all-css-properties.ts +358 -0
  136. package/src/utils/caniemail/ast/get-object-variables.ts +61 -0
  137. package/src/utils/caniemail/ast/get-used-style-properties.ts +91 -0
  138. package/src/utils/caniemail/get-compatibility-stats-for-entry.ts +118 -0
  139. package/src/utils/caniemail/get-css-functions.ts +25 -0
  140. package/src/utils/caniemail/get-css-property-names.ts +32 -0
  141. package/src/utils/caniemail/get-css-property-with-value.ts +14 -0
  142. package/src/utils/caniemail/get-css-unit.ts +3 -0
  143. package/src/utils/caniemail/get-element-attributes.ts +7 -0
  144. package/src/utils/caniemail/get-element-names.ts +20 -0
  145. package/src/utils/caniemail/tailwind/generate-tailwind-rules.ts +30 -0
  146. package/src/utils/caniemail/tailwind/get-tailwind-config.ts +205 -0
  147. package/src/utils/caniemail/tailwind/get-tailwind-metadata.spec.ts +25 -0
  148. package/src/utils/caniemail/tailwind/get-tailwind-metadata.ts +45 -0
  149. package/src/utils/caniemail/tailwind/setup-tailwind-context.ts +15 -0
  150. package/src/utils/get-email-component.ts +34 -67
  151. package/src/utils/linting.ts +85 -0
  152. package/src/utils/result.ts +49 -0
  153. package/src/utils/run-bundled-code.ts +64 -0
  154. package/tailwind-internals.d.ts +133 -0
  155. package/tailwind.config.ts +1 -0
  156. package/tsconfig.json +9 -3
  157. package/build-preview-server.mjs +0 -25
  158. package/dist/preview/.next/server/chunks/196.js +0 -5
  159. package/dist/preview/.next/server/chunks/300.js +0 -13
  160. package/dist/preview/.next/server/chunks/631.js +0 -6
  161. package/dist/preview/.next/server/chunks/644.js +0 -1
  162. package/dist/preview/.next/server/chunks/734.js +0 -15
  163. package/dist/preview/.next/static/Pt6wqIrWnQxbiyqaKNFOx/_buildManifest.js +0 -1
  164. package/dist/preview/.next/static/chunks/285-dbf6306a0d45c33d.js +0 -1
  165. package/dist/preview/.next/static/chunks/447-886131c35ca42b91.js +0 -1
  166. package/dist/preview/.next/static/chunks/490-d5745684930d49e0.js +0 -1
  167. package/dist/preview/.next/static/chunks/5fec7a0a-5179023f3f5a9421.js +0 -1
  168. package/dist/preview/.next/static/chunks/603-36207c8905355e23.js +0 -1
  169. package/dist/preview/.next/static/chunks/797-46f6c20952f0a280.js +0 -2
  170. package/dist/preview/.next/static/chunks/app/_not-found/page-96d3eac723be3ee2.js +0 -1
  171. package/dist/preview/.next/static/chunks/app/layout-d06046b8a368df3b.js +0 -1
  172. package/dist/preview/.next/static/chunks/app/page-ef1c23b954fbd0b5.js +0 -1
  173. package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-ea8e1ae2b5a4a0ec.js +0 -1
  174. package/dist/preview/.next/static/chunks/framework-e7cae9cecd5c9ba2.js +0 -1
  175. package/dist/preview/.next/static/chunks/main-app-9f2fb5ea26e2765b.js +0 -1
  176. package/dist/preview/.next/static/chunks/main-df761fde212f9cda.js +0 -1
  177. package/dist/preview/.next/static/chunks/pages/_app-203a61b355820ccf.js +0 -1
  178. package/dist/preview/.next/static/chunks/pages/_error-1764ca54938748c8.js +0 -1
  179. package/dist/preview/.next/static/css/e4822d5ba3082a95.css +0 -3
  180. package/dist/preview/.next/static/css/ec5d7e66bd3b6cb8.css +0 -1
  181. package/src/app/inter.ts +0 -7
  182. package/src/components/icons/icon-circle-check.tsx +0 -21
  183. package/src/components/icons/icon-circle-close.tsx +0 -17
  184. package/src/components/icons/icon-circle-warning.tsx +0 -17
  185. package/src/components/sidebar/image-checker.tsx +0 -162
  186. package/src/components/sidebar/link-checker.tsx +0 -151
  187. package/src/components/sidebar/spam-assassin.tsx +0 -158
  188. /package/dist/preview/.next/static/{Pt6wqIrWnQxbiyqaKNFOx → gFk9UfWL8joM4iD7-wlKF}/_ssgManifest.js +0 -0
  189. /package/src/components/{sidebar → toolbar}/checking-results.tsx +0 -0
@@ -0,0 +1,19 @@
1
+ export const IconScanner = (props: React.ComponentProps<'svg'>) => {
2
+ return (
3
+ <svg
4
+ width="13"
5
+ height="12"
6
+ viewBox="0 0 13 12"
7
+ fill="none"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ {...props}
10
+ >
11
+ <path
12
+ fillRule="evenodd"
13
+ clipRule="evenodd"
14
+ d="M1.5 1.5C1.22386 1.5 1 1.72386 1 2V8C1 8.27614 1.22386 8.5 1.5 8.5H11.5C11.7761 8.5 12 8.27614 12 8V2C12 1.72386 11.7761 1.5 11.5 1.5H1.5ZM0 8C0 8.6531 0.4174 9.2087 1 9.4146V10C1 10.8284 1.67157 11.5 2.5 11.5H10.5C11.3284 11.5 12 10.8284 12 10V9.4146C12.5826 9.2087 13 8.6531 13 8V2C13 1.17157 12.3284 0.5 11.5 0.5H1.5C0.67157 0.5 0 1.17157 0 2V8ZM11 10V9.5H2V10C2 10.2761 2.22386 10.5 2.5 10.5H10.5C10.7761 10.5 11 10.2761 11 10ZM4.5 4.5C4.22386 4.5 4 4.72386 4 5C4 5.27614 4.22386 5.5 4.5 5.5H8.5C8.77614 5.5 9 5.27614 9 5C9 4.72386 8.77614 4.5 8.5 4.5H4.5Z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ );
19
+ };
@@ -0,0 +1,19 @@
1
+ export const IconScissors = (props: React.ComponentProps<'svg'>) => {
2
+ return (
3
+ <svg
4
+ width="12"
5
+ height="10"
6
+ viewBox="0 0 12 10"
7
+ fill="none"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ {...props}
10
+ >
11
+ <path
12
+ fillRule="evenodd"
13
+ clipRule="evenodd"
14
+ d="M0.760039 2.58762C0.760039 3.27246 1.31521 3.82762 2.00004 3.82762C2.68487 3.82762 3.24004 3.27246 3.24004 2.58762C3.24004 1.90278 2.68487 1.34762 2.00004 1.34762C1.31521 1.34762 0.760039 1.90278 0.760039 2.58762ZM2.00004 4.54762C0.917561 4.54762 0.0400391 3.6701 0.0400391 2.58762C0.0400391 1.50514 0.917561 0.627625 2.00004 0.627625C3.08252 0.627625 3.96004 1.50514 3.96004 2.58762C3.96004 2.84649 3.90986 3.09364 3.81868 3.31986L4.58929 3.83529C4.58359 3.85323 4.5782 3.8713 4.57313 3.88949L4.45035 4.32947L4.16809 4.51817L3.37248 3.98691C3.0189 4.33374 2.53445 4.54762 2.00004 4.54762ZM0.760042 7.39998C0.760042 6.71514 1.31521 6.15997 2.00004 6.15997C2.68487 6.15997 3.24004 6.71514 3.24004 7.39998C3.24004 8.08478 2.68487 8.63999 2.00004 8.63999C1.31521 8.63999 0.760042 8.08478 0.760042 7.39998ZM2.00004 5.43997C0.917561 5.43997 0.0400415 6.31749 0.0400415 7.39998C0.0400415 8.48246 0.917561 9.35998 2.00004 9.35998C3.08252 9.35998 3.96004 8.48246 3.96004 7.39998C3.96004 7.14422 3.91106 6.89996 3.82199 6.67598L12 1.20588L11.2389 1.28588C10.1662 1.39862 9.12733 1.72714 8.18485 2.25167L5.72522 3.6205C5.5385 3.72441 5.40112 3.8987 5.34369 4.10451L5.14127 4.82988L3.37954 6.00764C3.02538 5.65671 2.53802 5.43997 2.00004 5.43997ZM5.71553 6.3719L5.72522 6.37739L8.18485 7.74622C9.12733 8.27071 10.1662 8.59927 11.2389 8.71199L12 8.79198L7.04863 5.48022L5.71553 6.3719Z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ );
19
+ };
@@ -0,0 +1,31 @@
1
+ export const IconWarning = (props: React.ComponentProps<'svg'>) => (
2
+ <svg
3
+ width="13"
4
+ height="12"
5
+ viewBox="0 0 13 12"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ {...props}
9
+ >
10
+ <path
11
+ d="M10.8777 8.99999L6.87766 1.99999C6.79044 1.84609 6.66396 1.71808 6.51112 1.62902C6.35828 1.53997 6.18455 1.49304 6.00766 1.49304C5.83077 1.49304 5.65704 1.53997 5.5042 1.62902C5.35136 1.71808 5.22488 1.84609 5.13766 1.99999L1.13766 8.99999C1.0495 9.15267 1.00327 9.32594 1.00366 9.50224C1.00405 9.67855 1.05105 9.85161 1.13988 10.0039C1.22872 10.1562 1.35623 10.2823 1.50951 10.3694C1.66278 10.4565 1.83636 10.5016 2.01266 10.5H10.0127C10.1881 10.4998 10.3604 10.4535 10.5123 10.3656C10.6642 10.2778 10.7903 10.1515 10.8779 9.99955C10.9656 9.84756 11.0117 9.67518 11.0116 9.49973C11.0116 9.32428 10.9654 9.15193 10.8777 8.99999Z"
12
+ stroke="currentColor"
13
+ strokeLinecap="round"
14
+ strokeLinejoin="round"
15
+ />
16
+ <path
17
+ d="M6.0127 4.5V6.5"
18
+ stroke="currentColor"
19
+ strokeLinecap="round"
20
+ strokeLinejoin="round"
21
+ />
22
+ <path
23
+ d="M6.0127 8.5H6.01853"
24
+ stroke="currentColor"
25
+ strokeLinecap="round"
26
+ strokeLinejoin="round"
27
+ />
28
+ </svg>
29
+ );
30
+
31
+ IconWarning.displayName = 'IconCircleWarning';
@@ -1,7 +1,6 @@
1
1
  import * as Popover from '@radix-ui/react-popover';
2
2
  import * as React from 'react';
3
3
  import { toast } from 'sonner';
4
- import { inter } from '../app/inter';
5
4
  import { Button } from './button';
6
5
  import { Text } from './text';
7
6
 
@@ -64,7 +63,7 @@ export const Send = ({ markup }: { markup: string }) => {
64
63
  <Popover.Portal>
65
64
  <Popover.Content
66
65
  align="end"
67
- className={`-mt-10 w-80 rounded-lg border border-slate-6 bg-black/70 p-3 font-sans text-slate-11 shadow-md backdrop-blur-lg ${inter.variable}`}
66
+ className="-mt-10 w-80 rounded-lg border border-slate-6 bg-black/70 p-3 font-sans text-slate-11 shadow-md backdrop-blur-lg font-sans"
68
67
  sideOffset={48}
69
68
  >
70
69
  <form className="mt-1" onSubmit={(e) => void onFormSubmit(e)}>
@@ -4,44 +4,36 @@ import * as React from 'react';
4
4
  import { cn } from '../utils';
5
5
  import { Logo } from './logo';
6
6
  import { Sidebar } from './sidebar';
7
- import { Topbar } from './topbar';
8
7
 
9
- type RootProps = React.ComponentPropsWithoutRef<'div'>;
10
-
11
- interface ShellProps extends RootProps {
12
- markup?: string;
13
- plainText?: string;
8
+ interface ShellProps {
9
+ children: React.ReactNode;
14
10
  currentEmailOpenSlug?: string;
15
- pathSeparator?: string;
16
-
17
- activeView?: string;
18
- setActiveView?: (view: string) => void;
11
+ }
19
12
 
20
- viewWidth?: number;
21
- setViewWidth?: (width: number) => void;
22
- viewHeight?: number;
23
- setViewHeight?: (height: number) => void;
13
+ interface ShellContextValue {
14
+ sidebarToggled: boolean;
15
+ toggleSidebar: () => void;
24
16
  }
25
17
 
26
- export const Shell = ({
27
- currentEmailOpenSlug,
28
- children,
29
- pathSeparator,
30
- markup,
31
- plainText,
32
- activeView,
33
- setActiveView,
34
- viewHeight,
35
- viewWidth,
36
- setViewHeight,
37
- setViewWidth,
38
- }: ShellProps) => {
39
- const [sidebarToggled, setSidebarToggled] = React.useState(false);
40
- const [triggerTransition, setTriggerTransition] = React.useState(false);
18
+ export const ShellContext = React.createContext<ShellContextValue | undefined>(
19
+ undefined,
20
+ );
21
+
22
+ export const Shell = ({ children, currentEmailOpenSlug }: ShellProps) => {
23
+ const [sidebarToggled, setSidebarToggled] = React.useState(true);
41
24
 
42
25
  return (
43
- <>
44
- <div className="flex h-[4.375rem] items-center justify-between border-slate-6 border-b px-6 lg:hidden">
26
+ <ShellContext.Provider
27
+ value={{
28
+ toggleSidebar: () => setSidebarToggled((v) => !v),
29
+ sidebarToggled,
30
+ }}
31
+ >
32
+ <div
33
+ className={
34
+ 'flex h-[4.375rem] items-center justify-between border-slate-6 border-b px-6 lg:hidden'
35
+ }
36
+ >
45
37
  <div className="flex h-[4.375rem] items-center">
46
38
  <Logo />
47
39
  </div>
@@ -70,64 +62,36 @@ export const Shell = ({
70
62
  </svg>
71
63
  </button>
72
64
  </div>
73
- <React.Suspense>
74
- <Sidebar
75
- className={cn({
76
- 'lg:-translate-x-full translate-x-0': sidebarToggled,
77
- '-translate-x-full lg:translate-x-0': !sidebarToggled,
78
- })}
79
- currentEmailOpenSlug={currentEmailOpenSlug}
80
- markup={markup}
81
- plainText={plainText}
82
- style={{
83
- transition: triggerTransition ? 'transform 0.2s ease-in-out' : '',
84
- }}
85
- />
86
- </React.Suspense>
87
- <main
88
- className={cn(
89
- 'relative h-full max-h-full min-h-screen w-[100vw] overflow-hidden will-change-width sm:mt-[4.375rem] md:absolute md:right-0 lg:mt-0',
90
- {
91
- 'lg:w-[calc(100dvw)] lg:translate-x-0': sidebarToggled,
92
- 'lg:w-[calc(100dvw-20rem)] lg:translate-x-0': !sidebarToggled,
93
- },
94
- )}
95
- style={{
96
- transition: triggerTransition
97
- ? 'width 0.2s ease-in-out, transform 0.2s ease-in-out'
98
- : '',
99
- }}
100
- >
101
- <div className="relative h-full w-full">
102
- {currentEmailOpenSlug && pathSeparator ? (
103
- <Topbar
104
- activeView={activeView}
105
- currentEmailOpenSlug={currentEmailOpenSlug}
106
- markup={markup}
107
- onToggleSidebar={() => {
108
- setTriggerTransition(true);
65
+ <div className="flex w-[100dvw] h-[100dvh] flex-row">
66
+ <React.Suspense>
67
+ <Sidebar
68
+ className={cn('shrink [transition:width_0.2s_ease-in-out]', {
69
+ '-translate-x-full lg:translate-x-0': sidebarToggled,
70
+ 'lg:w-0': !sidebarToggled,
71
+ })}
72
+ currentEmailOpenSlug={currentEmailOpenSlug}
73
+ />
74
+ </React.Suspense>
75
+ <main
76
+ className={cn(
77
+ 'h-full max-h-full min-h-full overflow-hidden will-change-width lg:mt-0',
78
+ 'grow',
79
+ '[transition:width_0.2s_ease-in-out,_transform_0.2s_ease-in-out]',
80
+ )}
81
+ >
82
+ <div className="relative flex h-full w-full flex-col">{children}</div>
83
+ </main>
84
+ </div>
85
+ </ShellContext.Provider>
86
+ );
87
+ };
109
88
 
110
- requestAnimationFrame(() => {
111
- setSidebarToggled((v) => !v);
112
- });
89
+ type ShellContentRootProps = React.ComponentProps<'div'>;
113
90
 
114
- setTimeout(() => {
115
- setTriggerTransition(false);
116
- }, 300);
117
- }}
118
- pathSeparator={pathSeparator}
119
- setActiveView={setActiveView}
120
- setViewHeight={setViewHeight}
121
- setViewWidth={setViewWidth}
122
- viewHeight={viewHeight}
123
- viewWidth={viewWidth}
124
- />
125
- ) : null}
126
- <div className="relative mx-auto h-[calc(100dvh-3.3125rem)] grow md:h-full">
127
- {children}
128
- </div>
129
- </div>
130
- </main>
131
- </>
91
+ export const ShellContent = ({ children, ...rest }: ShellContentRootProps) => {
92
+ return (
93
+ <div {...rest} className={cn('relative grow', rest.className)}>
94
+ {children}
95
+ </div>
132
96
  );
133
97
  };
@@ -99,7 +99,7 @@ export const FileTreeDirectoryChildren = (props: {
99
99
  >
100
100
  {props.isRoot ? null : (
101
101
  <motion.div
102
- className="absolute top-1 left-[.625rem] h-6 w-px rounded-sm bg-cyan-11"
102
+ className="absolute top-1 left-[0.4rem] inset-0 h-6 w-px rounded-sm bg-cyan-11"
103
103
  layoutId="active-file"
104
104
  transition={{
105
105
  type: 'spring',
@@ -13,7 +13,7 @@ export const FileTree = ({
13
13
  emailsDirectoryMetadata,
14
14
  }: FileTreeProps) => {
15
15
  return (
16
- <div className="flex h-full w-full flex-col overflow-hidden lg:w-full lg:min-w-[14.5rem] lg:max-w-[14.5rem]">
16
+ <div className="flex h-full w-full flex-col overflow-hidden lg:w-full lg:min-w-[14.5rem]">
17
17
  <nav className="flex w-full flex-grow flex-col overflow-y-auto p-4 pr-0 pl-0">
18
18
  <Collapsible.Root open>
19
19
  <React.Suspense>