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.
- package/CHANGELOG.md +12 -0
- package/dist/cli/index.js +1175 -2658
- package/dist/cli/index.mjs +18 -12
- package/dist/preview/.next/BUILD_ID +1 -1
- package/dist/preview/.next/app-build-manifest.json +31 -34
- package/dist/preview/.next/app-path-routes-manifest.json +6 -1
- package/dist/preview/.next/build-manifest.json +14 -14
- package/dist/preview/.next/cache/.rscinfo +1 -1
- package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/preview/.next/diagnostics/framework.json +1 -1
- package/dist/preview/.next/export-marker.json +6 -1
- package/dist/preview/.next/images-manifest.json +57 -1
- package/dist/preview/.next/next-minimal-server.js.nft.json +1 -1
- package/dist/preview/.next/next-server.js.nft.json +1 -1
- package/dist/preview/.next/prerender-manifest.json +41 -1
- package/dist/preview/.next/required-server-files.json +310 -1
- package/dist/preview/.next/routes-manifest.json +64 -1
- package/dist/preview/.next/server/app/_not-found/page.js +1 -1
- package/dist/preview/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/preview/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/preview/.next/server/app/favicon.ico/route.js +1 -1
- package/dist/preview/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/dist/preview/.next/server/app/page.js +1 -1
- package/dist/preview/.next/server/app/page.js.nft.json +1 -1
- package/dist/preview/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/preview/.next/server/app/preview/[...slug]/page.js +47 -10
- package/dist/preview/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
- package/dist/preview/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
- package/dist/preview/.next/server/app-paths-manifest.json +1 -1
- package/dist/preview/.next/server/chunks/171.js +14 -0
- package/dist/preview/.next/server/chunks/446.js +6 -0
- package/dist/preview/.next/server/chunks/600.js +8 -0
- package/dist/preview/.next/server/chunks/811.js +13 -0
- package/dist/preview/.next/server/chunks/833.js +1 -0
- package/dist/preview/.next/server/functions-config-manifest.json +4 -1
- package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
- package/dist/preview/.next/server/next-font-manifest.js +1 -1
- package/dist/preview/.next/server/next-font-manifest.json +1 -1
- package/dist/preview/.next/server/pages/500.html +1 -1
- package/dist/preview/.next/server/pages/_app.js +1 -1
- package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/_document.js +1 -1
- package/dist/preview/.next/server/pages/_document.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/_error.js +1 -1
- package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
- package/dist/preview/.next/server/pages-manifest.json +5 -1
- package/dist/preview/.next/server/server-reference-manifest.js +1 -1
- package/dist/preview/.next/server/server-reference-manifest.json +1 -1
- package/dist/preview/.next/server/webpack-runtime.js +1 -1
- package/dist/preview/.next/static/chunks/416-56f79fc7e689f06f.js +1 -0
- package/dist/preview/.next/static/chunks/683-8bbfd191e5105f01.js +1 -0
- package/dist/preview/.next/static/chunks/744-79730358b37b2212.js +1 -0
- package/dist/preview/.next/static/chunks/781-5f16c6bc9d9d4cc1.js +1 -0
- package/dist/preview/.next/static/chunks/832ad4be-cb988facfb8f955f.js +1 -0
- package/dist/preview/.next/static/chunks/87-38e35f08507de015.js +1 -0
- package/dist/preview/.next/static/chunks/{afa401a5-9ebf2515b1397993.js → afa401a5-3e949a1cfd317dd3.js} +3 -3
- package/dist/preview/.next/static/chunks/app/_not-found/page-09d694081cc9d4dc.js +1 -0
- package/dist/preview/.next/static/chunks/app/layout-a6640e62690d8fd6.js +1 -0
- package/dist/preview/.next/static/chunks/app/page-ba68f50b287e7478.js +1 -0
- package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-4a5b026ab543e27f.js +1 -0
- package/dist/preview/.next/static/chunks/framework-c2bd6d936e3077bc.js +1 -0
- package/dist/preview/.next/static/chunks/main-44463a8301435b64.js +1 -0
- package/dist/preview/.next/static/chunks/main-app-c2e686acf8d370d7.js +1 -0
- package/dist/preview/.next/static/chunks/pages/_app-f3011d3f00bb8dba.js +1 -0
- package/dist/preview/.next/static/chunks/pages/_error-39a87dee2e97a2a3.js +1 -0
- package/dist/preview/.next/static/chunks/{webpack-9255716c9496e606.js → webpack-41e2667c9f086a4f.js} +1 -1
- package/dist/preview/.next/static/css/d7df9cfc3e182163.css +3 -0
- package/dist/preview/.next/static/gFk9UfWL8joM4iD7-wlKF/_buildManifest.js +1 -0
- package/dist/preview/.next/static/media/05613964ce6c782e-s.p.otf +0 -0
- package/dist/preview/.next/static/media/11c6126b9369e85e-s.p.otf +0 -0
- package/dist/preview/.next/static/media/26cb97734d8cb717-s.p.otf +0 -0
- package/dist/preview/.next/static/media/bb6462617151f6b7-s.p.otf +0 -0
- package/dist/preview/.next/static/media/cf6daef822ab0142-s.p.otf +0 -0
- package/dist/preview/.next/static/media/e4051546b3043204-s.p.otf +0 -0
- package/dist/preview/.next/trace +26 -22
- package/dist/preview/.next/types/cache-life.d.ts +3 -3
- package/package.json +17 -11
- package/scripts/build-preview-server.mjs +32 -0
- package/scripts/fill-caniemail-data.mjs +36 -0
- package/src/actions/email-validation/caniemail-data.ts +85993 -0
- package/src/actions/email-validation/check-compatibility.ts +322 -0
- package/src/actions/email-validation/check-images.spec.tsx +21 -12
- package/src/actions/email-validation/check-images.ts +88 -86
- package/src/actions/email-validation/check-links.spec.tsx +24 -14
- package/src/actions/email-validation/check-links.ts +59 -56
- package/src/actions/get-email-path-from-slug.ts +1 -1
- package/src/actions/render-email-by-path.tsx +2 -1
- package/src/{utils/emails-directory-absolute-path.ts → app/env.ts} +2 -0
- package/src/app/fonts/SFMono/SFMonoBold.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoBoldItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoHeavy.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoHeavyItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoLight.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoLightItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoMedium.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoMediumItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoRegular.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoRegularItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoSemibold.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoSemiboldItalic.otf +0 -0
- package/src/app/fonts.ts +39 -0
- package/src/app/layout.tsx +6 -3
- package/src/app/page.tsx +4 -4
- package/src/app/preview/[...slug]/page.tsx +73 -16
- package/src/app/preview/[...slug]/preview.tsx +49 -77
- package/src/components/code.tsx +0 -1
- package/src/components/icons/icon-base.tsx +4 -2
- package/src/components/icons/icon-reload.tsx +19 -0
- package/src/components/icons/icon-scanner.tsx +19 -0
- package/src/components/icons/icon-scissors.tsx +19 -0
- package/src/components/icons/icon-warning.tsx +31 -0
- package/src/components/send.tsx +1 -2
- package/src/components/shell.tsx +52 -88
- package/src/components/sidebar/file-tree-directory-children.tsx +1 -1
- package/src/components/sidebar/file-tree.tsx +1 -1
- package/src/components/sidebar/sidebar.tsx +23 -378
- package/src/components/toolbar/linter.tsx +310 -0
- package/src/components/toolbar/results-table.tsx +0 -0
- package/src/components/toolbar/results.tsx +48 -0
- package/src/components/toolbar/spam-assassin.tsx +144 -0
- package/src/components/toolbar/toolbar-button.tsx +50 -0
- package/src/components/toolbar/use-cached-state.ts +33 -0
- package/src/components/toolbar.tsx +197 -0
- package/src/components/tooltip-content.tsx +1 -2
- package/src/components/topbar/view-size-controls.tsx +1 -0
- package/src/components/topbar.tsx +29 -48
- package/src/contexts/emails.tsx +2 -1
- package/src/contexts/preview.tsx +81 -0
- package/src/hooks/use-email-rendering-result.ts +2 -1
- package/src/utils/__snapshots__/get-email-component.spec.ts.snap +1 -1
- package/src/utils/caniemail/all-css-properties.ts +358 -0
- package/src/utils/caniemail/ast/get-object-variables.ts +61 -0
- package/src/utils/caniemail/ast/get-used-style-properties.ts +91 -0
- package/src/utils/caniemail/get-compatibility-stats-for-entry.ts +118 -0
- package/src/utils/caniemail/get-css-functions.ts +25 -0
- package/src/utils/caniemail/get-css-property-names.ts +32 -0
- package/src/utils/caniemail/get-css-property-with-value.ts +14 -0
- package/src/utils/caniemail/get-css-unit.ts +3 -0
- package/src/utils/caniemail/get-element-attributes.ts +7 -0
- package/src/utils/caniemail/get-element-names.ts +20 -0
- package/src/utils/caniemail/tailwind/generate-tailwind-rules.ts +30 -0
- package/src/utils/caniemail/tailwind/get-tailwind-config.ts +205 -0
- package/src/utils/caniemail/tailwind/get-tailwind-metadata.spec.ts +25 -0
- package/src/utils/caniemail/tailwind/get-tailwind-metadata.ts +45 -0
- package/src/utils/caniemail/tailwind/setup-tailwind-context.ts +15 -0
- package/src/utils/get-email-component.ts +34 -67
- package/src/utils/linting.ts +85 -0
- package/src/utils/result.ts +49 -0
- package/src/utils/run-bundled-code.ts +64 -0
- package/tailwind-internals.d.ts +133 -0
- package/tailwind.config.ts +1 -0
- package/tsconfig.json +9 -3
- package/build-preview-server.mjs +0 -25
- package/dist/preview/.next/server/chunks/196.js +0 -5
- package/dist/preview/.next/server/chunks/300.js +0 -13
- package/dist/preview/.next/server/chunks/631.js +0 -6
- package/dist/preview/.next/server/chunks/644.js +0 -1
- package/dist/preview/.next/server/chunks/734.js +0 -15
- package/dist/preview/.next/static/Pt6wqIrWnQxbiyqaKNFOx/_buildManifest.js +0 -1
- package/dist/preview/.next/static/chunks/285-dbf6306a0d45c33d.js +0 -1
- package/dist/preview/.next/static/chunks/447-886131c35ca42b91.js +0 -1
- package/dist/preview/.next/static/chunks/490-d5745684930d49e0.js +0 -1
- package/dist/preview/.next/static/chunks/5fec7a0a-5179023f3f5a9421.js +0 -1
- package/dist/preview/.next/static/chunks/603-36207c8905355e23.js +0 -1
- package/dist/preview/.next/static/chunks/797-46f6c20952f0a280.js +0 -2
- package/dist/preview/.next/static/chunks/app/_not-found/page-96d3eac723be3ee2.js +0 -1
- package/dist/preview/.next/static/chunks/app/layout-d06046b8a368df3b.js +0 -1
- package/dist/preview/.next/static/chunks/app/page-ef1c23b954fbd0b5.js +0 -1
- package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-ea8e1ae2b5a4a0ec.js +0 -1
- package/dist/preview/.next/static/chunks/framework-e7cae9cecd5c9ba2.js +0 -1
- package/dist/preview/.next/static/chunks/main-app-9f2fb5ea26e2765b.js +0 -1
- package/dist/preview/.next/static/chunks/main-df761fde212f9cda.js +0 -1
- package/dist/preview/.next/static/chunks/pages/_app-203a61b355820ccf.js +0 -1
- package/dist/preview/.next/static/chunks/pages/_error-1764ca54938748c8.js +0 -1
- package/dist/preview/.next/static/css/e4822d5ba3082a95.css +0 -3
- package/dist/preview/.next/static/css/ec5d7e66bd3b6cb8.css +0 -1
- package/src/app/inter.ts +0 -7
- package/src/components/icons/icon-circle-check.tsx +0 -21
- package/src/components/icons/icon-circle-close.tsx +0 -17
- package/src/components/icons/icon-circle-warning.tsx +0 -17
- package/src/components/sidebar/image-checker.tsx +0 -162
- package/src/components/sidebar/link-checker.tsx +0 -151
- package/src/components/sidebar/spam-assassin.tsx +0 -158
- /package/dist/preview/.next/static/{Pt6wqIrWnQxbiyqaKNFOx → gFk9UfWL8joM4iD7-wlKF}/_ssgManifest.js +0 -0
- /package/src/components/{sidebar → toolbar}/checking-results.tsx +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
|
|
3
|
+
declare module "tailwindcss/lib/lib/evaluateTailwindFunctions" {
|
|
4
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
5
|
+
import type { Root } from "postcss";
|
|
6
|
+
|
|
7
|
+
export default function evaluateTailwindFunctions(
|
|
8
|
+
context: JITContext,
|
|
9
|
+
): (root: Root) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module "tailwindcss/lib/lib/resolveDefaultsAtRules" {
|
|
13
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
14
|
+
import type { Root } from "postcss";
|
|
15
|
+
|
|
16
|
+
export default function expandApplyAtRules(
|
|
17
|
+
context: JITContext,
|
|
18
|
+
): (root: Root) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module "tailwindcss/lib/lib/partitionApplyAtRules" {
|
|
22
|
+
import type { Root } from "postcss";
|
|
23
|
+
|
|
24
|
+
export default function partitionApplyAtRules(): (root: Root) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare module "tailwindcss/lib/lib/substituteScreenAtRules" {
|
|
28
|
+
import type { Root } from "postcss";
|
|
29
|
+
|
|
30
|
+
export default function substituteScreenAtRules(
|
|
31
|
+
context: JITContext,
|
|
32
|
+
): (root: Root) => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare module "tailwindcss/lib/lib/resolveDefaultsAtRules" {
|
|
36
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
37
|
+
import type { Root } from "postcss";
|
|
38
|
+
|
|
39
|
+
export default function expandApplyAtRules(
|
|
40
|
+
context: JITContext,
|
|
41
|
+
): (root: Root) => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare module "tailwindcss/lib/lib/expandApplyAtRules" {
|
|
45
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
46
|
+
import type { Root } from "postcss";
|
|
47
|
+
|
|
48
|
+
export default function expandApplyAtRules(
|
|
49
|
+
context: JITContext,
|
|
50
|
+
): (root: Root) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare module "tailwindcss/lib/lib/expandTailwindAtRules" {
|
|
54
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
55
|
+
import type { Root } from "postcss";
|
|
56
|
+
|
|
57
|
+
export default async function expandTailwindAtRules(
|
|
58
|
+
context: JITContext,
|
|
59
|
+
): (root: Root) => Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare module "tailwindcss/lib/lib/collapseAdjacentRules" {
|
|
63
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
64
|
+
import type { Root } from "postcss";
|
|
65
|
+
|
|
66
|
+
export default async function collapseAdjacentRules(
|
|
67
|
+
context: JITContext,
|
|
68
|
+
): (root: Root) => void;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare module "tailwindcss/lib/lib/collapseDuplicateDeclarations" {
|
|
72
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
73
|
+
import type { Root } from "postcss";
|
|
74
|
+
|
|
75
|
+
export default async function collapseDuplicateDeclarations(
|
|
76
|
+
context: JITContext,
|
|
77
|
+
): (root: Root) => void;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare module "tailwindcss/lib/lib/generateRules" {
|
|
81
|
+
import type { JitContext } from "tailwindcss/lib/lib/setupContextUtils";
|
|
82
|
+
import type { Rule } from "postcss";
|
|
83
|
+
|
|
84
|
+
export function generateRules(
|
|
85
|
+
classNames: Set<string>,
|
|
86
|
+
context: JITContext,
|
|
87
|
+
): [bigint, Rule][];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// taken from https://github.com/vinicoder/tw-to-css/blob/main/types.d.ts
|
|
91
|
+
// thanks vinicoder!
|
|
92
|
+
declare module "tailwindcss/lib/lib/setupContextUtils" {
|
|
93
|
+
import type { Container, Node } from "postcss";
|
|
94
|
+
import type { Config } from "tailwindcss";
|
|
95
|
+
import type resolveConfig from "tailwindcss/resolveConfig";
|
|
96
|
+
|
|
97
|
+
interface ChangedContent {
|
|
98
|
+
content: string;
|
|
99
|
+
extension?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface Api {
|
|
103
|
+
container: Container;
|
|
104
|
+
separator: string;
|
|
105
|
+
format: (def: string) => void;
|
|
106
|
+
wrap: (rule: Container) => void;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
type VariantPreview = string;
|
|
110
|
+
|
|
111
|
+
type VariantFn = [number, (api: Api) => VariantPreview | undefined];
|
|
112
|
+
|
|
113
|
+
type VariantName = string;
|
|
114
|
+
|
|
115
|
+
export interface JitContext {
|
|
116
|
+
changedContent: ChangedContent[];
|
|
117
|
+
ruleCache: Set<unknown>;
|
|
118
|
+
candidateRuleCache: Map<unknown, unknown>;
|
|
119
|
+
classCache: Map<unknown, unknown>;
|
|
120
|
+
applyClassCache: Map<unknown, unknown>;
|
|
121
|
+
notClassCache: Set<unknown>;
|
|
122
|
+
postCssNodeCache: Map<unknown, unknown>;
|
|
123
|
+
|
|
124
|
+
getClassList: () => string[];
|
|
125
|
+
tailwindConfig: TailwindConfig;
|
|
126
|
+
variantMap: Map<VariantName, VariantFn[]>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function createContext(
|
|
130
|
+
config: ReturnType<typeof resolveConfig>,
|
|
131
|
+
changedContent?: ChangedContent[],
|
|
132
|
+
): JitContext;
|
|
133
|
+
}
|
package/tailwind.config.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -24,16 +24,22 @@
|
|
|
24
24
|
"declarationMap": false,
|
|
25
25
|
"incremental": false,
|
|
26
26
|
"jsx": "preserve",
|
|
27
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
27
|
+
"lib": ["dom", "dom.iterable", "esnext", "ESNext.AsyncIterable"],
|
|
28
28
|
"noEmit": true,
|
|
29
29
|
"strict": false,
|
|
30
|
-
"target": "
|
|
30
|
+
"target": "ESNext",
|
|
31
31
|
"module": "CommonJS",
|
|
32
32
|
"noUncheckedIndexedAccess": true,
|
|
33
33
|
"resolveJsonModule": true,
|
|
34
34
|
"types": ["vitest/globals"],
|
|
35
35
|
"outDir": "dist"
|
|
36
36
|
},
|
|
37
|
-
"include": [
|
|
37
|
+
"include": [
|
|
38
|
+
"next-env.d.ts",
|
|
39
|
+
"tailwind-internals.d.ts",
|
|
40
|
+
"**/*.ts",
|
|
41
|
+
"**/*.tsx",
|
|
42
|
+
".next/types/**/*.ts"
|
|
43
|
+
],
|
|
38
44
|
"exclude": [".next", "dist", "node_modules"]
|
|
39
45
|
}
|
package/build-preview-server.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
|
|
4
|
-
const nextBuildProcess = spawn('pnpm', ['next', 'build'], {
|
|
5
|
-
detached: true,
|
|
6
|
-
shell: true,
|
|
7
|
-
stdio: 'inherit',
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
process.on('SIGINT', () => {
|
|
11
|
-
nextBuildProcess.kill('SIGINT');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
nextBuildProcess.on('exit', (code) => {
|
|
15
|
-
if (code !== 0) {
|
|
16
|
-
console.error(`next build failed with exit code ${code}`);
|
|
17
|
-
process.exit(code);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (fs.existsSync('dist/preview')) {
|
|
21
|
-
fs.rmSync('dist/preview', { recursive: true });
|
|
22
|
-
}
|
|
23
|
-
fs.mkdirSync('dist/preview', { recursive: true });
|
|
24
|
-
fs.renameSync('.next', 'dist/preview/.next');
|
|
25
|
-
});
|