promote-email-templates 0.1.6 → 0.1.8
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/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +27 -3
- package/dist/index.mjs +20 -0
- package/package.json +17 -14
- package/.react-email/.eslintrc.js +0 -52
- package/.react-email/.prettierignore +0 -3
- package/.react-email/.prettierrc.js +0 -8
- package/.react-email/license.md +0 -7
- package/.react-email/next.config.js +0 -36
- package/.react-email/package.json +0 -1
- package/.react-email/postcss.config.js +0 -8
- package/.react-email/readme.md +0 -44
- package/.react-email/src/actions/get-email-path-from-slug.ts +0 -26
- package/.react-email/src/actions/get-emails-directory-metadata.spec.ts +0 -73
- package/.react-email/src/actions/get-emails-directory-metadata.ts +0 -91
- package/.react-email/src/actions/render-email-by-path.tsx +0 -59
- package/.react-email/src/app/favicon.ico +0 -0
- package/.react-email/src/app/globals.css +0 -35
- package/.react-email/src/app/inter.ts +0 -7
- package/.react-email/src/app/layout.tsx +0 -36
- package/.react-email/src/app/logo.png +0 -0
- package/.react-email/src/app/page.tsx +0 -47
- package/.react-email/src/app/preview/[...slug]/page.tsx +0 -65
- package/.react-email/src/app/preview/[...slug]/preview.tsx +0 -141
- package/.react-email/src/app/preview/[...slug]/rendering-error.tsx +0 -40
- package/.react-email/src/components/button.tsx +0 -90
- package/.react-email/src/components/code-container.tsx +0 -145
- package/.react-email/src/components/code.tsx +0 -112
- package/.react-email/src/components/heading.tsx +0 -113
- package/.react-email/src/components/icons/icon-arrow-down.tsx +0 -16
- package/.react-email/src/components/icons/icon-base.tsx +0 -24
- package/.react-email/src/components/icons/icon-button.tsx +0 -23
- package/.react-email/src/components/icons/icon-check.tsx +0 -19
- package/.react-email/src/components/icons/icon-clipboard.tsx +0 -40
- package/.react-email/src/components/icons/icon-download.tsx +0 -19
- package/.react-email/src/components/icons/icon-file.tsx +0 -19
- package/.react-email/src/components/icons/icon-folder-open.tsx +0 -19
- package/.react-email/src/components/icons/icon-folder.tsx +0 -18
- package/.react-email/src/components/icons/icon-hide-sidebar.tsx +0 -23
- package/.react-email/src/components/icons/icon-monitor.tsx +0 -19
- package/.react-email/src/components/icons/icon-phone.tsx +0 -26
- package/.react-email/src/components/icons/icon-source.tsx +0 -19
- package/.react-email/src/components/index.ts +0 -7
- package/.react-email/src/components/logo.tsx +0 -64
- package/.react-email/src/components/send.tsx +0 -135
- package/.react-email/src/components/shell.tsx +0 -115
- package/.react-email/src/components/sidebar/index.ts +0 -1
- package/.react-email/src/components/sidebar/sidebar-directory-children.tsx +0 -134
- package/.react-email/src/components/sidebar/sidebar-directory.tsx +0 -106
- package/.react-email/src/components/sidebar/sidebar.tsx +0 -45
- package/.react-email/src/components/text.tsx +0 -99
- package/.react-email/src/components/tooltip-content.tsx +0 -32
- package/.react-email/src/components/tooltip.tsx +0 -19
- package/.react-email/src/components/topbar.tsx +0 -161
- package/.react-email/src/contexts/emails.tsx +0 -127
- package/.react-email/src/hooks/use-hot-reload.ts +0 -35
- package/.react-email/src/hooks/use-rendering-metadata.ts +0 -36
- package/.react-email/src/utils/cn.ts +0 -6
- package/.react-email/src/utils/constants.ts +0 -6
- package/.react-email/src/utils/copy-text-to-clipboard.ts +0 -7
- package/.react-email/src/utils/emails-directory-absolute-path.ts +0 -34
- package/.react-email/src/utils/get-email-component.ts +0 -108
- package/.react-email/src/utils/improve-error-with-sourcemap.ts +0 -55
- package/.react-email/src/utils/index.ts +0 -5
- package/.react-email/src/utils/language-map.ts +0 -7
- package/.react-email/src/utils/static-node-modules-for-vm.ts +0 -92
- package/.react-email/src/utils/types/as.ts +0 -26
- package/.react-email/src/utils/types/email-template.ts +0 -8
- package/.react-email/src/utils/types/error-object.ts +0 -11
- package/.react-email/src/utils/types/hot-reload-change.ts +0 -6
- package/.react-email/src/utils/types/hot-reload-event.ts +0 -6
- package/.react-email/src/utils/unreachable.ts +0 -8
- package/.react-email/tailwind.config.ts +0 -94
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as stackTraceParser from 'stacktrace-parser';
|
|
2
|
-
import { SourceMapConsumer, type RawSourceMap } from 'source-map-js';
|
|
3
|
-
import type { ErrorObject } from './types/error-object';
|
|
4
|
-
|
|
5
|
-
export const improveErrorWithSourceMap = (
|
|
6
|
-
error: Error,
|
|
7
|
-
|
|
8
|
-
originalFilePath: string,
|
|
9
|
-
sourceMapToOriginalFile: RawSourceMap,
|
|
10
|
-
): ErrorObject => {
|
|
11
|
-
let stack: string | undefined;
|
|
12
|
-
|
|
13
|
-
if (typeof error.stack !== 'undefined') {
|
|
14
|
-
const parsedStack = stackTraceParser.parse(error.stack);
|
|
15
|
-
const sourceMapConsumer = new SourceMapConsumer(sourceMapToOriginalFile);
|
|
16
|
-
const newStackLines = [] as string[];
|
|
17
|
-
for (const stackFrame of parsedStack) {
|
|
18
|
-
if (stackFrame.file === originalFilePath) {
|
|
19
|
-
if (stackFrame.column || stackFrame.lineNumber) {
|
|
20
|
-
const positionWithError = sourceMapConsumer.originalPositionFor({
|
|
21
|
-
column: stackFrame.column ?? 0,
|
|
22
|
-
line: stackFrame.lineNumber ?? 0,
|
|
23
|
-
});
|
|
24
|
-
const columnAndLine =
|
|
25
|
-
positionWithError.column && positionWithError.line
|
|
26
|
-
? `${positionWithError.line}:${positionWithError.column}`
|
|
27
|
-
: positionWithError.line;
|
|
28
|
-
newStackLines.push(
|
|
29
|
-
` at ${stackFrame.methodName} (${originalFilePath}:${columnAndLine})`,
|
|
30
|
-
);
|
|
31
|
-
} else {
|
|
32
|
-
newStackLines.push(
|
|
33
|
-
` at ${stackFrame.methodName} (${originalFilePath})`,
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
const columnAndLine =
|
|
38
|
-
stackFrame.column && stackFrame.lineNumber
|
|
39
|
-
? `${stackFrame.lineNumber}:${stackFrame.column}`
|
|
40
|
-
: stackFrame.lineNumber;
|
|
41
|
-
newStackLines.push(
|
|
42
|
-
` at ${stackFrame.methodName} (${stackFrame.file}:${columnAndLine})`,
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
stack = newStackLines.join('\n');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
name: error.name,
|
|
51
|
-
message: error.message,
|
|
52
|
-
cause: error.cause,
|
|
53
|
-
stack,
|
|
54
|
-
};
|
|
55
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import zlib from 'node:zlib';
|
|
2
|
-
import vm from 'node:vm';
|
|
3
|
-
import v8 from 'node:v8';
|
|
4
|
-
import util from 'node:util';
|
|
5
|
-
import url from 'node:url';
|
|
6
|
-
import tty from 'node:tty';
|
|
7
|
-
import tls from 'node:tls';
|
|
8
|
-
import timers from 'node:timers';
|
|
9
|
-
import stringDecoder from 'node:string_decoder';
|
|
10
|
-
import stream from 'node:stream';
|
|
11
|
-
import readline from 'node:readline';
|
|
12
|
-
import querystring from 'node:querystring';
|
|
13
|
-
import punycode from 'node:punycode';
|
|
14
|
-
import path from 'node:path';
|
|
15
|
-
import os from 'node:os';
|
|
16
|
-
import net from 'node:net';
|
|
17
|
-
import https from 'node:https';
|
|
18
|
-
import http from 'node:http';
|
|
19
|
-
import fs from 'node:fs';
|
|
20
|
-
import events from 'node:events';
|
|
21
|
-
import domain from 'node:domain';
|
|
22
|
-
import dns from 'node:dns';
|
|
23
|
-
import dgram from 'node:dgram';
|
|
24
|
-
import crypto from 'node:crypto';
|
|
25
|
-
import cluster from 'node:cluster';
|
|
26
|
-
import childProcess from 'node:child_process';
|
|
27
|
-
import buffer from 'node:buffer';
|
|
28
|
-
import assert from 'node:assert';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* A map of the name of the modules (including `node:` prefixed ones)
|
|
32
|
-
* provided by Node because dynamic requires of them, even on the server
|
|
33
|
-
* will not be resolved properly
|
|
34
|
-
*/
|
|
35
|
-
export const staticNodeModulesForVM = {
|
|
36
|
-
zlib,
|
|
37
|
-
'node:zlib': zlib,
|
|
38
|
-
vm,
|
|
39
|
-
'node:vm': vm,
|
|
40
|
-
v8,
|
|
41
|
-
'node:v8': v8,
|
|
42
|
-
util,
|
|
43
|
-
'node:util': util,
|
|
44
|
-
url,
|
|
45
|
-
'node:url': url,
|
|
46
|
-
tty,
|
|
47
|
-
'node:tty': tty,
|
|
48
|
-
tls,
|
|
49
|
-
'node:tls': tls,
|
|
50
|
-
timers,
|
|
51
|
-
'node:timers': timers,
|
|
52
|
-
'string_decoder': stringDecoder,
|
|
53
|
-
'node:string_decoder': stringDecoder,
|
|
54
|
-
stream,
|
|
55
|
-
'node:stream': stream,
|
|
56
|
-
readline,
|
|
57
|
-
'node:readline': readline,
|
|
58
|
-
querystring,
|
|
59
|
-
'node:querystring': querystring,
|
|
60
|
-
punycode,
|
|
61
|
-
'node:punycode': punycode,
|
|
62
|
-
path,
|
|
63
|
-
'node:path': path,
|
|
64
|
-
os,
|
|
65
|
-
'node:os': os,
|
|
66
|
-
net,
|
|
67
|
-
'node:net': net,
|
|
68
|
-
https,
|
|
69
|
-
'node:https': https,
|
|
70
|
-
http,
|
|
71
|
-
'node:http': http,
|
|
72
|
-
fs,
|
|
73
|
-
'node:fs': fs,
|
|
74
|
-
events,
|
|
75
|
-
'node:events': events,
|
|
76
|
-
domain,
|
|
77
|
-
'node:domain': domain,
|
|
78
|
-
dns,
|
|
79
|
-
'node:dns': dns,
|
|
80
|
-
dgram,
|
|
81
|
-
'node:dgram': dgram,
|
|
82
|
-
crypto,
|
|
83
|
-
'node:crypto': crypto,
|
|
84
|
-
cluster,
|
|
85
|
-
'node:cluster': cluster,
|
|
86
|
-
'child_process': childProcess,
|
|
87
|
-
'node:child_process': childProcess,
|
|
88
|
-
buffer,
|
|
89
|
-
'node:buffer': buffer,
|
|
90
|
-
assert,
|
|
91
|
-
'node:assert': assert,
|
|
92
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type As<
|
|
2
|
-
DefaultTag extends React.ElementType,
|
|
3
|
-
T1 extends React.ElementType,
|
|
4
|
-
T2 extends React.ElementType = T1,
|
|
5
|
-
T3 extends React.ElementType = T1,
|
|
6
|
-
T4 extends React.ElementType = T1,
|
|
7
|
-
T5 extends React.ElementType = T1,
|
|
8
|
-
> =
|
|
9
|
-
| (React.ComponentPropsWithRef<DefaultTag> & {
|
|
10
|
-
as?: DefaultTag;
|
|
11
|
-
})
|
|
12
|
-
| (React.ComponentPropsWithRef<T1> & {
|
|
13
|
-
as: T1;
|
|
14
|
-
})
|
|
15
|
-
| (React.ComponentPropsWithRef<T2> & {
|
|
16
|
-
as: T2;
|
|
17
|
-
})
|
|
18
|
-
| (React.ComponentPropsWithRef<T3> & {
|
|
19
|
-
as: T3;
|
|
20
|
-
})
|
|
21
|
-
| (React.ComponentPropsWithRef<T4> & {
|
|
22
|
-
as: T4;
|
|
23
|
-
})
|
|
24
|
-
| (React.ComponentPropsWithRef<T5> & {
|
|
25
|
-
as: T5;
|
|
26
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface EmailTemplate {
|
|
2
|
-
(props: Record<string, unknown> | Record<string, never>): React.ReactNode;
|
|
3
|
-
PreviewProps?: Record<string, unknown>;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const isEmailTemplate = (val: unknown): val is EmailTemplate => {
|
|
7
|
-
return typeof val === 'function';
|
|
8
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An object that mimics the structure of the Error class,
|
|
3
|
-
* we just can't use the Error class here because server actions can't
|
|
4
|
-
* return classes
|
|
5
|
-
*/
|
|
6
|
-
export interface ErrorObject {
|
|
7
|
-
name: string;
|
|
8
|
-
stack: string | undefined;
|
|
9
|
-
cause: unknown;
|
|
10
|
-
message: string;
|
|
11
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { Config } from 'tailwindcss';
|
|
2
|
-
import colors = require('@radix-ui/colors');
|
|
3
|
-
import { fontFamily } from 'tailwindcss/defaultTheme';
|
|
4
|
-
import plugin from 'tailwindcss/plugin';
|
|
5
|
-
|
|
6
|
-
const iOsHeight = plugin(({ addUtilities }) => {
|
|
7
|
-
const supportsTouchRule = '@supports (-webkit-touch-callout: none)';
|
|
8
|
-
const webkitFillAvailable = '-webkit-fill-available';
|
|
9
|
-
|
|
10
|
-
const utilities = {
|
|
11
|
-
'.min-h-screen-ios': {
|
|
12
|
-
[supportsTouchRule]: {
|
|
13
|
-
minHeight: webkitFillAvailable,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
'.h-screen-ios': {
|
|
17
|
-
[supportsTouchRule]: {
|
|
18
|
-
height: webkitFillAvailable,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// @ts-expect-error This works normally, not sure what this error is
|
|
24
|
-
addUtilities(utilities, ['responsive']);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const config: Config = {
|
|
28
|
-
content: {
|
|
29
|
-
// needs to be relative because tailwind will find the content
|
|
30
|
-
// by default based on the process's cwd
|
|
31
|
-
relative: true,
|
|
32
|
-
files: [
|
|
33
|
-
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
34
|
-
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
theme: {
|
|
38
|
-
extend: {
|
|
39
|
-
backgroundImage: {
|
|
40
|
-
gradient:
|
|
41
|
-
'linear-gradient(145.37deg, rgba(255, 255, 255, 0.09) -8.75%, rgba(255, 255, 255, 0.027) 83.95%)',
|
|
42
|
-
gradientHover:
|
|
43
|
-
'linear-gradient(145.37deg, rgba(255, 255, 255, 0.1) -8.75%, rgba(255, 255, 255, 0.057) 83.95%)',
|
|
44
|
-
shine:
|
|
45
|
-
'linear-gradient(45deg, rgba(255,255,255,0) 45%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 55%,rgba(255,255,255,0) 100%)',
|
|
46
|
-
},
|
|
47
|
-
colors: {
|
|
48
|
-
cyan: {
|
|
49
|
-
1: colors.cyanDarkA.cyanA1,
|
|
50
|
-
2: colors.cyanDarkA.cyanA2,
|
|
51
|
-
3: colors.cyanDarkA.cyanA3,
|
|
52
|
-
4: colors.cyanDarkA.cyanA4,
|
|
53
|
-
5: colors.cyanDarkA.cyanA5,
|
|
54
|
-
6: colors.cyanDarkA.cyanA6,
|
|
55
|
-
7: colors.cyanDarkA.cyanA7,
|
|
56
|
-
8: colors.cyanDarkA.cyanA8,
|
|
57
|
-
9: colors.cyanDarkA.cyanA9,
|
|
58
|
-
10: colors.cyanDarkA.cyanA10,
|
|
59
|
-
11: colors.cyanDarkA.cyanA11,
|
|
60
|
-
12: colors.cyanDarkA.cyanA12,
|
|
61
|
-
},
|
|
62
|
-
slate: {
|
|
63
|
-
1: colors.slateDarkA.slateA1,
|
|
64
|
-
2: colors.slateDarkA.slateA2,
|
|
65
|
-
3: colors.slateDarkA.slateA3,
|
|
66
|
-
4: colors.slateDarkA.slateA4,
|
|
67
|
-
5: colors.slateDarkA.slateA5,
|
|
68
|
-
6: colors.slateDarkA.slateA6,
|
|
69
|
-
7: colors.slateDarkA.slateA7,
|
|
70
|
-
8: colors.slateDarkA.slateA8,
|
|
71
|
-
9: colors.slateDarkA.slateA9,
|
|
72
|
-
10: colors.slateDarkA.slateA10,
|
|
73
|
-
11: colors.slateDarkA.slateA11,
|
|
74
|
-
12: colors.slateDarkA.slateA12,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
fontFamily: {
|
|
78
|
-
sans: ['var(--font-inter)', ...fontFamily.sans],
|
|
79
|
-
},
|
|
80
|
-
keyframes: {
|
|
81
|
-
shine: {
|
|
82
|
-
'0%': { backgroundPosition: '-100%' },
|
|
83
|
-
'100%': { backgroundPosition: '100%' },
|
|
84
|
-
},
|
|
85
|
-
dash: {
|
|
86
|
-
'0%': { strokeDashoffset: '1000' },
|
|
87
|
-
'100%': { strokeDashoffset: '0' },
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
plugins: [iOsHeight],
|
|
93
|
-
};
|
|
94
|
-
export default config;
|