better-svelte-email 1.4.0 → 2.0.0-beta.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.
- package/README.md +25 -90
- package/dist/chunk-D1SwGrFN.mjs +27 -0
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +5 -0
- package/package.json +18 -103
- package/LICENSE +0 -21
- package/dist/components/Body.svelte +0 -22
- package/dist/components/Body.svelte.d.ts +0 -7
- package/dist/components/Button.svelte +0 -58
- package/dist/components/Button.svelte.d.ts +0 -11
- package/dist/components/Column.svelte +0 -14
- package/dist/components/Column.svelte.d.ts +0 -7
- package/dist/components/Container.svelte +0 -34
- package/dist/components/Container.svelte.d.ts +0 -7
- package/dist/components/Head.svelte +0 -13
- package/dist/components/Head.svelte.d.ts +0 -6
- package/dist/components/Heading.svelte +0 -34
- package/dist/components/Heading.svelte.d.ts +0 -15
- package/dist/components/Hr.svelte +0 -16
- package/dist/components/Hr.svelte.d.ts +0 -4
- package/dist/components/Html.svelte +0 -20
- package/dist/components/Html.svelte.d.ts +0 -10
- package/dist/components/Img.svelte +0 -27
- package/dist/components/Img.svelte.d.ts +0 -10
- package/dist/components/Link.svelte +0 -22
- package/dist/components/Link.svelte.d.ts +0 -9
- package/dist/components/Preview.svelte +0 -35
- package/dist/components/Preview.svelte.d.ts +0 -7
- package/dist/components/Row.svelte +0 -26
- package/dist/components/Row.svelte.d.ts +0 -7
- package/dist/components/Section.svelte +0 -28
- package/dist/components/Section.svelte.d.ts +0 -7
- package/dist/components/Text.svelte +0 -25
- package/dist/components/Text.svelte.d.ts +0 -8
- package/dist/components/index.d.ts +0 -14
- package/dist/components/index.js +0 -15
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -4
- package/dist/preview/EmailPreview.svelte +0 -1122
- package/dist/preview/EmailPreview.svelte.d.ts +0 -17
- package/dist/preview/EmailTreeNode.svelte +0 -270
- package/dist/preview/EmailTreeNode.svelte.d.ts +0 -10
- package/dist/preview/Favicon.svelte +0 -106
- package/dist/preview/Favicon.svelte.d.ts +0 -5
- package/dist/preview/email-tree.d.ts +0 -13
- package/dist/preview/email-tree.js +0 -61
- package/dist/preview/index.d.ts +0 -151
- package/dist/preview/index.js +0 -293
- package/dist/preview/theme.css +0 -42
- package/dist/render/index.d.ts +0 -78
- package/dist/render/index.js +0 -167
- package/dist/render/utils/compatibility/sanitize-class-name.d.ts +0 -7
- package/dist/render/utils/compatibility/sanitize-class-name.js +0 -35
- package/dist/render/utils/css/extract-global-rules.d.ts +0 -19
- package/dist/render/utils/css/extract-global-rules.js +0 -104
- package/dist/render/utils/css/extract-rules-per-class.d.ts +0 -5
- package/dist/render/utils/css/extract-rules-per-class.js +0 -26
- package/dist/render/utils/css/get-custom-properties.d.ts +0 -8
- package/dist/render/utils/css/get-custom-properties.js +0 -22
- package/dist/render/utils/css/get-matching-global-rules-for-element.d.ts +0 -3
- package/dist/render/utils/css/get-matching-global-rules-for-element.js +0 -35
- package/dist/render/utils/css/is-rule-inlinable.d.ts +0 -2
- package/dist/render/utils/css/is-rule-inlinable.js +0 -32
- package/dist/render/utils/css/make-inline-styles-for.d.ts +0 -3
- package/dist/render/utils/css/make-inline-styles-for.js +0 -54
- package/dist/render/utils/css/resolve-all-css-variables.d.ts +0 -7
- package/dist/render/utils/css/resolve-all-css-variables.js +0 -165
- package/dist/render/utils/css/resolve-calc-expressions.d.ts +0 -5
- package/dist/render/utils/css/resolve-calc-expressions.js +0 -247
- package/dist/render/utils/css/sanitize-declarations.d.ts +0 -19
- package/dist/render/utils/css/sanitize-declarations.js +0 -391
- package/dist/render/utils/css/sanitize-non-inlinable-rules.d.ts +0 -11
- package/dist/render/utils/css/sanitize-non-inlinable-rules.js +0 -28
- package/dist/render/utils/css/sanitize-stylesheet.d.ts +0 -5
- package/dist/render/utils/css/sanitize-stylesheet.js +0 -8
- package/dist/render/utils/css/split-selector-list.d.ts +0 -6
- package/dist/render/utils/css/split-selector-list.js +0 -41
- package/dist/render/utils/html/is-valid-node.d.ts +0 -2
- package/dist/render/utils/html/is-valid-node.js +0 -3
- package/dist/render/utils/html/remove-attributes-functions.d.ts +0 -2
- package/dist/render/utils/html/remove-attributes-functions.js +0 -10
- package/dist/render/utils/html/walk.d.ts +0 -15
- package/dist/render/utils/html/walk.js +0 -36
- package/dist/render/utils/tailwindcss/add-inlined-styles-to-element.d.ts +0 -5
- package/dist/render/utils/tailwindcss/add-inlined-styles-to-element.js +0 -113
- package/dist/render/utils/tailwindcss/pixel-based-preset.d.ts +0 -2
- package/dist/render/utils/tailwindcss/pixel-based-preset.js +0 -58
- package/dist/render/utils/tailwindcss/sanitize-custom-css.d.ts +0 -1
- package/dist/render/utils/tailwindcss/sanitize-custom-css.js +0 -10
- package/dist/render/utils/tailwindcss/setup-tailwind.d.ts +0 -12
- package/dist/render/utils/tailwindcss/setup-tailwind.js +0 -76
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/index.d.ts +0 -2
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/index.js +0 -899
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/preflight.d.ts +0 -2
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/preflight.js +0 -396
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/theme.d.ts +0 -2
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/theme.js +0 -465
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/utilities.d.ts +0 -2
- package/dist/render/utils/tailwindcss/tailwind-stylesheets/utilities.js +0 -4
- package/dist/utils/index.d.ts +0 -40
- package/dist/utils/index.js +0 -74
package/README.md
CHANGED
|
@@ -1,117 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
<img src="static/favicon.svg" alt="Better Svelte Email" width="128" height="128">
|
|
3
|
-
<h3 align="center">Better Svelte Email</h3>
|
|
4
|
-
<p align="center">
|
|
5
|
-
Create beautiful emails in Svelte with first-class Tailwind support
|
|
6
|
-
</p>
|
|
7
|
-
<p align="center">
|
|
8
|
-
<a href="https://better-svelte-email.konixy.fr">Website</a>
|
|
9
|
-
·
|
|
10
|
-
<a href="https://github.com/Konixy/better-svelte-email">GitHub</a>
|
|
11
|
-
</p>
|
|
12
|
-
<p align="center">
|
|
13
|
-
<a href="https://github.com/Konixy/better-svelte-email/actions/workflows/release.yml">
|
|
14
|
-
<img src="https://github.com/Konixy/better-svelte-email/actions/workflows/release.yml/badge.svg" alt="Tests">
|
|
15
|
-
</a>
|
|
16
|
-
<a href="https://www.npmjs.com/package/better-svelte-email">
|
|
17
|
-
<img src="https://img.shields.io/npm/v/better-svelte-email.svg?logo=npm" alt="npm version">
|
|
18
|
-
</a>
|
|
19
|
-
<a href="https://github.com/Konixy/better-svelte-email/stargazers">
|
|
20
|
-
<img src="https://img.shields.io/github/stars/Konixy/better-svelte-email?style=default&logo=github" alt="GitHub stars">
|
|
21
|
-
</a>
|
|
22
|
-
</p>
|
|
23
|
-
</p>
|
|
1
|
+
# better-svelte-email
|
|
24
2
|
|
|
25
|
-
|
|
3
|
+
Published meta-package for **Better Svelte Email**: render Svelte 5 email templates to HTML with Tailwind CSS inlined for email clients, plus optional preview and send helpers.
|
|
26
4
|
|
|
27
|
-
|
|
5
|
+
This package depends on [`@better-svelte-email/server`](../server), [`@better-svelte-email/components`](../components), and [`@better-svelte-email/preview`](../preview) (the preview package is installed with it so versions stay aligned). The **published main entry** re-exports **components** plus **`Renderer`**, **`toPlainText`**, and related types from the server package. Import preview and SvelteKit helpers from **`@better-svelte-email/preview`** directly. For maximal control you can depend on the scoped packages only and skip this meta-package.
|
|
28
6
|
|
|
29
|
-
##
|
|
7
|
+
## Documentation
|
|
30
8
|
|
|
31
|
-
|
|
32
|
-
- **Built-in Email Preview** - Visual email preview and test sending
|
|
33
|
-
- **TypeScript First** - Fully typed with comprehensive type definitions
|
|
34
|
-
- **Well Tested** - >90% test coverage with unit and integration tests
|
|
9
|
+
Full usage, guides, and examples: [better-svelte-email.konixy.dev](https://better-svelte-email.konixy.dev/docs)
|
|
35
10
|
|
|
36
|
-
|
|
11
|
+
## Install
|
|
37
12
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- **svelte-email** hasn't been updated in over 2 years
|
|
43
|
-
- **svelte-email-tailwind** suffers from stability issues and maintaining it is not sustainable anymore
|
|
44
|
-
|
|
45
|
-
Better Svelte Email is a complete rewrite of [svelte-email-tailwind](https://github.com/steveninety/svelte-email-tailwind) inspired by [React Email](https://react.email/), providing the rock-solid foundation your email infrastructure needs. It brings the simplicity, reliability, and feature richness of [React Email](https://react.email/) to the Svelte ecosystem.
|
|
46
|
-
|
|
47
|
-
## Minimum Svelte Version
|
|
48
|
-
|
|
49
|
-
The minimum supported Svelte version is 5.14.3.
|
|
50
|
-
For older versions, you can use [`svelte-email-tailwind`](https://github.com/steveninety/svelte-email-tailwind).
|
|
51
|
-
|
|
52
|
-
## Supported Features
|
|
53
|
-
|
|
54
|
-
### ✅ Supported
|
|
13
|
+
```bash
|
|
14
|
+
npm i better-svelte-email
|
|
15
|
+
```
|
|
55
16
|
|
|
56
|
-
|
|
57
|
-
- Custom Tailwind classes (`bg-[#fff]`, `my:[40px]`, ...)
|
|
58
|
-
- Dynamic Tailwind classes (`class={someVar}`)
|
|
59
|
-
- Responsive breakpoints (`sm:`, `md:`, `lg:`, `xl:`, `2xl:`)
|
|
60
|
-
- HTML elements and Svelte components
|
|
61
|
-
- Nested components
|
|
62
|
-
- All svelte features such as each blocks (`{#each}`) and if blocks (`{#if}`), and more
|
|
63
|
-
- Custom Tailwind configurations
|
|
64
|
-
- Custom CSS injection (for app theme integration)
|
|
17
|
+
Minimum **Svelte** version: **5.14.3**.
|
|
65
18
|
|
|
66
|
-
##
|
|
19
|
+
## What you get
|
|
67
20
|
|
|
68
|
-
|
|
21
|
+
From **`better-svelte-email`** (main export):
|
|
69
22
|
|
|
70
|
-
|
|
23
|
+
- **`Renderer`** and **`toPlainText`** — server-side HTML (+ optional plain text) from `.svelte` templates, with Tailwind inlined for email clients
|
|
24
|
+
- **Email layout components** — `Html`, `Body`, `Container`, `Section`, `Text`, `Button`, … (same as [`@better-svelte-email/components`](../components))
|
|
71
25
|
|
|
72
|
-
|
|
26
|
+
From **`@better-svelte-email/preview`** (installed as a dependency; import this module name):
|
|
73
27
|
|
|
74
|
-
|
|
28
|
+
- **`EmailPreview`**, **`createEmail`**, **`sendEmail`**, **`emailList`**, … for local preview and test sends in SvelteKit
|
|
75
29
|
|
|
76
|
-
|
|
30
|
+
## Monorepo
|
|
77
31
|
|
|
78
|
-
|
|
32
|
+
Source: [github.com/Konixy/better-svelte-email](https://github.com/Konixy/better-svelte-email) — this directory is `packages/better-svelte-email`.
|
|
79
33
|
|
|
80
34
|
## Development
|
|
81
35
|
|
|
82
|
-
|
|
36
|
+
From the repository root:
|
|
83
37
|
|
|
84
38
|
```bash
|
|
85
|
-
bun run
|
|
39
|
+
bun run build --filter=better-svelte-email
|
|
40
|
+
bun run test --filter=better-svelte-email
|
|
86
41
|
```
|
|
87
42
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
### Building
|
|
43
|
+
Or from this package:
|
|
91
44
|
|
|
92
45
|
```bash
|
|
93
46
|
bun run build
|
|
47
|
+
bun run test
|
|
94
48
|
```
|
|
95
49
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
99
|
-
|
|
100
|
-
To do so, you'll need to:
|
|
101
|
-
|
|
102
|
-
1. Fork the repository
|
|
103
|
-
2. Create a feature branch (`git checkout -b feat/amazing-feature`)
|
|
104
|
-
3. Make your changes
|
|
105
|
-
4. Run tests (`bun run test`)
|
|
106
|
-
5. Commit your changes using [conventional commits](https://www.conventionalcommits.org/):
|
|
107
|
-
- `feat:` - New features
|
|
108
|
-
- `fix:` - Bug fixes
|
|
109
|
-
- `docs:` - Documentation changes
|
|
110
|
-
- `test:` - Test additions/changes
|
|
111
|
-
- `chore:` - Maintenance tasks
|
|
112
|
-
6. Push to your branch (`git push origin feat/amazing-feature`)
|
|
113
|
-
7. Open a Pull Request
|
|
114
|
-
|
|
115
|
-
## Acknowledgements
|
|
50
|
+
## License
|
|
116
51
|
|
|
117
|
-
|
|
52
|
+
MIT
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __exportAll = (all, no_symbols) => {
|
|
7
|
+
let target = {};
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
+
key = keys[i];
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: ((k) => from[k]).bind(null, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
26
|
+
//#endregion
|
|
27
|
+
export { __reExport as n, __exportAll as t };
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#endregion
|
|
3
|
+
let _better_svelte_email_server = require("@better-svelte-email/server");
|
|
4
|
+
//#endregion
|
|
5
|
+
Object.defineProperty(exports, "Renderer", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _better_svelte_email_server.default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "toPlainText", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function() {
|
|
14
|
+
return _better_svelte_email_server.toPlainText;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var _better_svelte_email_components = require("@better-svelte-email/components");
|
|
18
|
+
Object.keys(_better_svelte_email_components).forEach(function(k) {
|
|
19
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return _better_svelte_email_components[k];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import server_default, { AST, RenderOptions, RendererOptions, TailwindConfig, toPlainText } from "@better-svelte-email/server";
|
|
2
|
+
export * from "@better-svelte-email/components";
|
|
3
|
+
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
declare namespace index_d_exports {
|
|
6
|
+
export { AST, RenderOptions, server_default as Renderer, RendererOptions, TailwindConfig, toPlainText };
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { type AST, type RenderOptions, server_default as Renderer, type RendererOptions, type TailwindConfig, toPlainText };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import server_default, { AST, RenderOptions, RendererOptions, TailwindConfig, toPlainText } from "@better-svelte-email/server";
|
|
2
|
+
export * from "@better-svelte-email/components";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
declare namespace index_d_exports {
|
|
6
|
+
export { AST, RenderOptions, server_default as Renderer, RendererOptions, TailwindConfig, toPlainText };
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { type AST, type RenderOptions, server_default as Renderer, type RendererOptions, type TailwindConfig, toPlainText };
|
package/dist/index.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,101 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-svelte-email",
|
|
3
|
-
"
|
|
4
|
-
"version": "1.4.0",
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
5
4
|
"author": "Konixy",
|
|
6
5
|
"repository": {
|
|
7
6
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/Konixy/better-svelte-email.git"
|
|
9
|
-
|
|
10
|
-
"homepage": "https://better-svelte-email.konixy.fr",
|
|
11
|
-
"peerDependencies": {
|
|
12
|
-
"svelte": ">=5.14.3",
|
|
13
|
-
"@sveltejs/kit": ">=2"
|
|
14
|
-
},
|
|
15
|
-
"peerDependenciesMeta": {
|
|
16
|
-
"@sveltejs/kit": {
|
|
17
|
-
"optional": true
|
|
18
|
-
}
|
|
7
|
+
"url": "git+https://github.com/Konixy/better-svelte-email.git",
|
|
8
|
+
"directory": "packages/better-svelte-email"
|
|
19
9
|
},
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
20
12
|
"dependencies": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"postcss-value-parser": "^4.2.0",
|
|
25
|
-
"tailwindcss": "^4.1.18"
|
|
26
|
-
},
|
|
27
|
-
"optionalDependencies": {
|
|
28
|
-
"prettier": "^3.8.1",
|
|
29
|
-
"resend": "^6.8.0",
|
|
30
|
-
"shiki": "^3.21.0"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@eslint/compat": "^2.0.1",
|
|
34
|
-
"@eslint/js": "^9.39.2",
|
|
35
|
-
"@sveltejs/adapter-vercel": "^6.3.0",
|
|
36
|
-
"@sveltejs/kit": "^2.50.0",
|
|
37
|
-
"@sveltejs/package": "^2.5.7",
|
|
38
|
-
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
39
|
-
"@tailwindcss/vite": "^4.1.18",
|
|
40
|
-
"@types/html-to-text": "^9.0.4",
|
|
41
|
-
"@types/node": "24.10.9",
|
|
42
|
-
"@vitest/coverage-v8": "^4.0.18",
|
|
43
|
-
"eslint": "^9.39.2",
|
|
44
|
-
"eslint-config-prettier": "^10.1.8",
|
|
45
|
-
"eslint-plugin-svelte": "^3.14.0",
|
|
46
|
-
"globals": "^17.0.0",
|
|
47
|
-
"mdsvex": "^0.12.6",
|
|
48
|
-
"mode-watcher": "^1.1.0",
|
|
49
|
-
"prettier-plugin-svelte": "^3.4.1",
|
|
50
|
-
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
51
|
-
"publint": "^0.3.17",
|
|
52
|
-
"rehype-autolink-headings": "^7.1.0",
|
|
53
|
-
"rehype-slug": "^6.0.0",
|
|
54
|
-
"svelte": "5.48.0",
|
|
55
|
-
"svelte-check": "^4.3.5",
|
|
56
|
-
"tailwindcss-motion": "^1.1.1",
|
|
57
|
-
"typescript": "^5.9.3",
|
|
58
|
-
"typescript-eslint": "^8.53.1",
|
|
59
|
-
"vite": "^7.3.1",
|
|
60
|
-
"vitest": "^4.0.18"
|
|
13
|
+
"@better-svelte-email/components": "workspace:*",
|
|
14
|
+
"@better-svelte-email/preview": "workspace:*",
|
|
15
|
+
"@better-svelte-email/server": "workspace:*"
|
|
61
16
|
},
|
|
62
17
|
"exports": {
|
|
63
18
|
".": {
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"import": "./dist/index.js",
|
|
67
|
-
"default": "./dist/index.js"
|
|
68
|
-
},
|
|
69
|
-
"./components": {
|
|
70
|
-
"types": "./dist/components/index.d.ts",
|
|
71
|
-
"import": "./dist/components/index.js",
|
|
72
|
-
"default": "./dist/components/index.js"
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
73
21
|
},
|
|
74
|
-
"./
|
|
75
|
-
|
|
76
|
-
"svelte": "./dist/components/*.svelte"
|
|
77
|
-
},
|
|
78
|
-
"./preview": {
|
|
79
|
-
"types": "./dist/preview/index.d.ts",
|
|
80
|
-
"import": "./dist/preview/index.js",
|
|
81
|
-
"default": "./dist/preview/index.js"
|
|
82
|
-
},
|
|
83
|
-
"./preview/EmailPreview.svelte": {
|
|
84
|
-
"types": "./dist/preview/EmailPreview.svelte.d.ts",
|
|
85
|
-
"svelte": "./dist/preview/EmailPreview.svelte"
|
|
86
|
-
},
|
|
87
|
-
"./utils": {
|
|
88
|
-
"types": "./dist/utils/index.d.ts",
|
|
89
|
-
"import": "./dist/utils/index.js",
|
|
90
|
-
"default": "./dist/utils/index.js"
|
|
91
|
-
},
|
|
92
|
-
"./render": {
|
|
93
|
-
"types": "./dist/render/index.d.ts",
|
|
94
|
-
"import": "./dist/render/index.js",
|
|
95
|
-
"default": "./dist/render/index.js"
|
|
96
|
-
},
|
|
97
|
-
"./package.json": "./package.json"
|
|
22
|
+
"./chunk-D1SwGrFN": "./dist/chunk-D1SwGrFN.mjs",
|
|
23
|
+
"./*": "./*"
|
|
98
24
|
},
|
|
25
|
+
"description": "Svelte email renderer with Tailwind support",
|
|
99
26
|
"files": [
|
|
100
27
|
"dist",
|
|
101
28
|
"!dist/**/*.test.*",
|
|
@@ -103,6 +30,7 @@
|
|
|
103
30
|
"!dist/**/__fixtures__",
|
|
104
31
|
"!dist/emails"
|
|
105
32
|
],
|
|
33
|
+
"homepage": "https://better-svelte-email.konixy.dev",
|
|
106
34
|
"keywords": [
|
|
107
35
|
"svelte",
|
|
108
36
|
"svelte5",
|
|
@@ -115,26 +43,13 @@
|
|
|
115
43
|
],
|
|
116
44
|
"license": "MIT",
|
|
117
45
|
"scripts": {
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"package": "svelte-package",
|
|
122
|
-
"package:watch": "svelte-package --watch",
|
|
123
|
-
"prepare": "svelte-kit sync || echo ''",
|
|
124
|
-
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
125
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
126
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
127
|
-
"format": "prettier --write .",
|
|
128
|
-
"lint": "prettier --check . && eslint .",
|
|
129
|
-
"test": "vitest run",
|
|
130
|
-
"test:watch": "vitest",
|
|
131
|
-
"test:ui": "vitest --ui",
|
|
132
|
-
"test:coverage": "vitest run --coverage"
|
|
46
|
+
"build": "tsdown src/index.ts",
|
|
47
|
+
"lint": "prettier --check . --ignore-path ../../.prettierignore && eslint src",
|
|
48
|
+
"test": "vitest run"
|
|
133
49
|
},
|
|
134
50
|
"sideEffects": [
|
|
135
51
|
"**/*.css"
|
|
136
52
|
],
|
|
137
|
-
"svelte": "./dist/index.js",
|
|
138
53
|
"type": "module",
|
|
139
|
-
"types": "./dist/index.d.
|
|
54
|
+
"types": "./dist/index.d.cts"
|
|
140
55
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Anatole Dufour
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
children,
|
|
6
|
-
style,
|
|
7
|
-
class: className,
|
|
8
|
-
...restProps
|
|
9
|
-
}: { children?: any } & HTMLAttributes<HTMLBodyElement> = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<body {...restProps}>
|
|
13
|
-
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
|
|
14
|
-
<tbody>
|
|
15
|
-
<tr>
|
|
16
|
-
<td {style} class={className}>
|
|
17
|
-
{@render children?.()}
|
|
18
|
-
</td>
|
|
19
|
-
</tr>
|
|
20
|
-
</tbody>
|
|
21
|
-
</table>
|
|
22
|
-
</body>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
children?: any;
|
|
4
|
-
} & HTMLAttributes<HTMLBodyElement>;
|
|
5
|
-
declare const Body: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
-
type Body = ReturnType<typeof Body>;
|
|
7
|
-
export default Body;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<!-- svelte-ignore state_referenced_locally -->
|
|
2
|
-
<script lang="ts">
|
|
3
|
-
import { styleToString, pxToPt, combineStyles } from '../utils/index.js';
|
|
4
|
-
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
href = '#',
|
|
8
|
-
target = '_blank',
|
|
9
|
-
style = '',
|
|
10
|
-
pX = 0,
|
|
11
|
-
pY = 0,
|
|
12
|
-
children,
|
|
13
|
-
...restProps
|
|
14
|
-
}: {
|
|
15
|
-
href?: string;
|
|
16
|
-
target?: string;
|
|
17
|
-
pX?: number;
|
|
18
|
-
pY?: number;
|
|
19
|
-
children: any;
|
|
20
|
-
} & HTMLAnchorAttributes = $props();
|
|
21
|
-
|
|
22
|
-
const y = pY * 2;
|
|
23
|
-
const textRaise = pxToPt(y.toString());
|
|
24
|
-
|
|
25
|
-
// Button link styles
|
|
26
|
-
const buttonStyle = styleToString({
|
|
27
|
-
lineHeight: '100%',
|
|
28
|
-
textDecoration: 'none',
|
|
29
|
-
display: 'inline-block',
|
|
30
|
-
maxWidth: '100%',
|
|
31
|
-
padding: pY || pX ? `${pY}px ${pX}px` : undefined
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// Button text styles with MSO support
|
|
35
|
-
const buttonTextStyle = styleToString({
|
|
36
|
-
maxWidth: '100%',
|
|
37
|
-
display: 'inline-block',
|
|
38
|
-
lineHeight: '120%',
|
|
39
|
-
textDecoration: 'none',
|
|
40
|
-
textTransform: 'none',
|
|
41
|
-
msoPaddingAlt: '0px',
|
|
42
|
-
msoTextRaise: pY ? pxToPt(pY.toString()) : undefined
|
|
43
|
-
});
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<a {...restProps} {href} {target} style={combineStyles(buttonStyle, style)}>
|
|
47
|
-
<span>
|
|
48
|
-
{@html `<!--[if mso]><i style="letter-spacing: ${pX}px;mso-font-width:-100%;mso-text-raise:${textRaise}" hidden> </i><![endif]-->`}
|
|
49
|
-
</span>
|
|
50
|
-
|
|
51
|
-
<span style={buttonTextStyle}>
|
|
52
|
-
{@render children?.()}
|
|
53
|
-
</span>
|
|
54
|
-
|
|
55
|
-
<span style="display: none;">
|
|
56
|
-
{@html `<!--[if mso]><i style="letter-spacing: ${pX}px;mso-font-width:-100%" hidden> </i><![endif]-->`}
|
|
57
|
-
</span>
|
|
58
|
-
</a>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
href?: string;
|
|
4
|
-
target?: string;
|
|
5
|
-
pX?: number;
|
|
6
|
-
pY?: number;
|
|
7
|
-
children: any;
|
|
8
|
-
} & HTMLAnchorAttributes;
|
|
9
|
-
declare const Button: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
-
type Button = ReturnType<typeof Button>;
|
|
11
|
-
export default Button;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HTMLTdAttributes } from 'svelte/elements';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
children?: any;
|
|
4
|
-
} & HTMLTdAttributes;
|
|
5
|
-
declare const Column: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
-
type Column = ReturnType<typeof Column>;
|
|
7
|
-
export default Column;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { combineStyles, styleToString } from '../utils/index.js';
|
|
3
|
-
import type { HTMLTableAttributes } from 'svelte/elements';
|
|
4
|
-
|
|
5
|
-
let {
|
|
6
|
-
children,
|
|
7
|
-
style,
|
|
8
|
-
...restProps
|
|
9
|
-
}: {
|
|
10
|
-
children: any;
|
|
11
|
-
} & HTMLTableAttributes = $props();
|
|
12
|
-
|
|
13
|
-
// Default max-width for email containers (600px = 37.5em)
|
|
14
|
-
const defaultStyles = styleToString({ maxWidth: '37.5em' });
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<table
|
|
18
|
-
align="center"
|
|
19
|
-
width="100%"
|
|
20
|
-
role="presentation"
|
|
21
|
-
cellspacing="0"
|
|
22
|
-
cellpadding="0"
|
|
23
|
-
border="0"
|
|
24
|
-
style={combineStyles(defaultStyles, style)}
|
|
25
|
-
{...restProps}
|
|
26
|
-
>
|
|
27
|
-
<tbody>
|
|
28
|
-
<tr style="width: 100%;">
|
|
29
|
-
<td>
|
|
30
|
-
{@render children?.()}
|
|
31
|
-
</td>
|
|
32
|
-
</tr>
|
|
33
|
-
</tbody>
|
|
34
|
-
</table>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HTMLTableAttributes } from 'svelte/elements';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
children: any;
|
|
4
|
-
} & HTMLTableAttributes;
|
|
5
|
-
declare const Container: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
-
type Container = ReturnType<typeof Container>;
|
|
7
|
-
export default Container;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let { children }: { children?: any } = $props();
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<meta name="x-apple-disable-message-reformatting" />
|
|
9
|
-
<!--[if !mso]><!-->
|
|
10
|
-
<meta http-equiv="x-ua-compatible" content="IE=edge" />
|
|
11
|
-
<!--<![endif]-->
|
|
12
|
-
{@render children?.()}
|
|
13
|
-
</head>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { combineStyles, styleToString, withMargin } from '../utils/index.js';
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<HTMLHeadingElement> & {
|
|
6
|
-
children: any;
|
|
7
|
-
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
8
|
-
m?: string;
|
|
9
|
-
mx?: string;
|
|
10
|
-
my?: string;
|
|
11
|
-
mt?: string;
|
|
12
|
-
mr?: string;
|
|
13
|
-
mb?: string;
|
|
14
|
-
ml?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
let { style, as, children, ...restProps }: Props = $props();
|
|
18
|
-
|
|
19
|
-
const defaultStyles = styleToString({
|
|
20
|
-
...withMargin({
|
|
21
|
-
m: restProps.m,
|
|
22
|
-
mx: restProps.mx,
|
|
23
|
-
my: restProps.my,
|
|
24
|
-
mt: restProps.mt,
|
|
25
|
-
mr: restProps.mr,
|
|
26
|
-
mb: restProps.mb,
|
|
27
|
-
ml: restProps.ml
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<svelte:element this={as} style={combineStyles(defaultStyles, style)} {...restProps}>
|
|
33
|
-
{@render children?.()}
|
|
34
|
-
</svelte:element>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
type Props = HTMLAttributes<HTMLHeadingElement> & {
|
|
3
|
-
children: any;
|
|
4
|
-
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
|
-
m?: string;
|
|
6
|
-
mx?: string;
|
|
7
|
-
my?: string;
|
|
8
|
-
mt?: string;
|
|
9
|
-
mr?: string;
|
|
10
|
-
mb?: string;
|
|
11
|
-
ml?: string;
|
|
12
|
-
};
|
|
13
|
-
declare const Heading: import("svelte").Component<Props, {}, "">;
|
|
14
|
-
type Heading = ReturnType<typeof Heading>;
|
|
15
|
-
export default Heading;
|