better-svelte-email 1.4.0 → 2.0.0-beta.0

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 (98) hide show
  1. package/package.json +18 -103
  2. package/LICENSE +0 -21
  3. package/README.md +0 -117
  4. package/dist/components/Body.svelte +0 -22
  5. package/dist/components/Body.svelte.d.ts +0 -7
  6. package/dist/components/Button.svelte +0 -58
  7. package/dist/components/Button.svelte.d.ts +0 -11
  8. package/dist/components/Column.svelte +0 -14
  9. package/dist/components/Column.svelte.d.ts +0 -7
  10. package/dist/components/Container.svelte +0 -34
  11. package/dist/components/Container.svelte.d.ts +0 -7
  12. package/dist/components/Head.svelte +0 -13
  13. package/dist/components/Head.svelte.d.ts +0 -6
  14. package/dist/components/Heading.svelte +0 -34
  15. package/dist/components/Heading.svelte.d.ts +0 -15
  16. package/dist/components/Hr.svelte +0 -16
  17. package/dist/components/Hr.svelte.d.ts +0 -4
  18. package/dist/components/Html.svelte +0 -20
  19. package/dist/components/Html.svelte.d.ts +0 -10
  20. package/dist/components/Img.svelte +0 -27
  21. package/dist/components/Img.svelte.d.ts +0 -10
  22. package/dist/components/Link.svelte +0 -22
  23. package/dist/components/Link.svelte.d.ts +0 -9
  24. package/dist/components/Preview.svelte +0 -35
  25. package/dist/components/Preview.svelte.d.ts +0 -7
  26. package/dist/components/Row.svelte +0 -26
  27. package/dist/components/Row.svelte.d.ts +0 -7
  28. package/dist/components/Section.svelte +0 -28
  29. package/dist/components/Section.svelte.d.ts +0 -7
  30. package/dist/components/Text.svelte +0 -25
  31. package/dist/components/Text.svelte.d.ts +0 -8
  32. package/dist/components/index.d.ts +0 -14
  33. package/dist/components/index.js +0 -15
  34. package/dist/index.d.ts +0 -2
  35. package/dist/index.js +0 -4
  36. package/dist/preview/EmailPreview.svelte +0 -1122
  37. package/dist/preview/EmailPreview.svelte.d.ts +0 -17
  38. package/dist/preview/EmailTreeNode.svelte +0 -270
  39. package/dist/preview/EmailTreeNode.svelte.d.ts +0 -10
  40. package/dist/preview/Favicon.svelte +0 -106
  41. package/dist/preview/Favicon.svelte.d.ts +0 -5
  42. package/dist/preview/email-tree.d.ts +0 -13
  43. package/dist/preview/email-tree.js +0 -61
  44. package/dist/preview/index.d.ts +0 -151
  45. package/dist/preview/index.js +0 -293
  46. package/dist/preview/theme.css +0 -42
  47. package/dist/render/index.d.ts +0 -78
  48. package/dist/render/index.js +0 -167
  49. package/dist/render/utils/compatibility/sanitize-class-name.d.ts +0 -7
  50. package/dist/render/utils/compatibility/sanitize-class-name.js +0 -35
  51. package/dist/render/utils/css/extract-global-rules.d.ts +0 -19
  52. package/dist/render/utils/css/extract-global-rules.js +0 -104
  53. package/dist/render/utils/css/extract-rules-per-class.d.ts +0 -5
  54. package/dist/render/utils/css/extract-rules-per-class.js +0 -26
  55. package/dist/render/utils/css/get-custom-properties.d.ts +0 -8
  56. package/dist/render/utils/css/get-custom-properties.js +0 -22
  57. package/dist/render/utils/css/get-matching-global-rules-for-element.d.ts +0 -3
  58. package/dist/render/utils/css/get-matching-global-rules-for-element.js +0 -35
  59. package/dist/render/utils/css/is-rule-inlinable.d.ts +0 -2
  60. package/dist/render/utils/css/is-rule-inlinable.js +0 -32
  61. package/dist/render/utils/css/make-inline-styles-for.d.ts +0 -3
  62. package/dist/render/utils/css/make-inline-styles-for.js +0 -54
  63. package/dist/render/utils/css/resolve-all-css-variables.d.ts +0 -7
  64. package/dist/render/utils/css/resolve-all-css-variables.js +0 -165
  65. package/dist/render/utils/css/resolve-calc-expressions.d.ts +0 -5
  66. package/dist/render/utils/css/resolve-calc-expressions.js +0 -247
  67. package/dist/render/utils/css/sanitize-declarations.d.ts +0 -19
  68. package/dist/render/utils/css/sanitize-declarations.js +0 -391
  69. package/dist/render/utils/css/sanitize-non-inlinable-rules.d.ts +0 -11
  70. package/dist/render/utils/css/sanitize-non-inlinable-rules.js +0 -28
  71. package/dist/render/utils/css/sanitize-stylesheet.d.ts +0 -5
  72. package/dist/render/utils/css/sanitize-stylesheet.js +0 -8
  73. package/dist/render/utils/css/split-selector-list.d.ts +0 -6
  74. package/dist/render/utils/css/split-selector-list.js +0 -41
  75. package/dist/render/utils/html/is-valid-node.d.ts +0 -2
  76. package/dist/render/utils/html/is-valid-node.js +0 -3
  77. package/dist/render/utils/html/remove-attributes-functions.d.ts +0 -2
  78. package/dist/render/utils/html/remove-attributes-functions.js +0 -10
  79. package/dist/render/utils/html/walk.d.ts +0 -15
  80. package/dist/render/utils/html/walk.js +0 -36
  81. package/dist/render/utils/tailwindcss/add-inlined-styles-to-element.d.ts +0 -5
  82. package/dist/render/utils/tailwindcss/add-inlined-styles-to-element.js +0 -113
  83. package/dist/render/utils/tailwindcss/pixel-based-preset.d.ts +0 -2
  84. package/dist/render/utils/tailwindcss/pixel-based-preset.js +0 -58
  85. package/dist/render/utils/tailwindcss/sanitize-custom-css.d.ts +0 -1
  86. package/dist/render/utils/tailwindcss/sanitize-custom-css.js +0 -10
  87. package/dist/render/utils/tailwindcss/setup-tailwind.d.ts +0 -12
  88. package/dist/render/utils/tailwindcss/setup-tailwind.js +0 -76
  89. package/dist/render/utils/tailwindcss/tailwind-stylesheets/index.d.ts +0 -2
  90. package/dist/render/utils/tailwindcss/tailwind-stylesheets/index.js +0 -899
  91. package/dist/render/utils/tailwindcss/tailwind-stylesheets/preflight.d.ts +0 -2
  92. package/dist/render/utils/tailwindcss/tailwind-stylesheets/preflight.js +0 -396
  93. package/dist/render/utils/tailwindcss/tailwind-stylesheets/theme.d.ts +0 -2
  94. package/dist/render/utils/tailwindcss/tailwind-stylesheets/theme.js +0 -465
  95. package/dist/render/utils/tailwindcss/tailwind-stylesheets/utilities.d.ts +0 -2
  96. package/dist/render/utils/tailwindcss/tailwind-stylesheets/utilities.js +0 -4
  97. package/dist/utils/index.d.ts +0 -40
  98. package/dist/utils/index.js +0 -74
package/package.json CHANGED
@@ -1,101 +1,28 @@
1
1
  {
2
2
  "name": "better-svelte-email",
3
- "description": "Svelte email renderer with Tailwind support",
4
- "version": "1.4.0",
3
+ "version": "2.0.0-beta.0",
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
- "html-to-text": "^9.0.5",
22
- "parse5": "^8.0.0",
23
- "postcss": "^8.5.6",
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
- "types": "./dist/index.d.ts",
65
- "svelte": "./dist/index.js",
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
- "./components/*": {
75
- "types": "./dist/components/*.svelte.d.ts",
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
- "dev": "vite dev",
119
- "build": "bun run prepack && vite build",
120
- "preview": "vite preview",
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.ts"
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.
package/README.md DELETED
@@ -1,117 +0,0 @@
1
- <p align="center">
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>
24
-
25
- ## Usage
26
-
27
- See the [documentation](https://better-svelte-email.konixy.fr/docs) for a complete guide on how to use Better Svelte Email.
28
-
29
- ## Features
30
-
31
- - **Tailwind v4 Support** - Transforms Tailwind classes to inline styles for email clients
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
35
-
36
- _See [Roadmap](./ROADMAP.md) for future features and planned improvements._
37
-
38
- ## Why?
39
-
40
- Existing Svelte email solutions have significant limitations:
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
55
-
56
- - All tailwindcss v4 utilities
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)
65
-
66
- ## Author
67
-
68
- Anatole Dufour ([@Konixy](https://github.com/Konixy))
69
-
70
- ### Author of `svelte-email-tailwind`
71
-
72
- Steven Polak ([@steveninety](https://github.com/steveninety))
73
-
74
- ### Authors of `react-email`
75
-
76
- Bu Kinoshita ([@bukinoshita](https://github.com/bukinoshita))
77
-
78
- Zeno Rocha ([@zenorocha](https://github.com/zenorocha))
79
-
80
- ## Development
81
-
82
- ### Running Tests
83
-
84
- ```bash
85
- bun run test
86
- ```
87
-
88
- All tests must pass before pushing to main. The CI/CD pipeline will automatically run tests on every push and pull request.
89
-
90
- ### Building
91
-
92
- ```bash
93
- bun run build
94
- ```
95
-
96
- ### Contributing
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
116
-
117
- Many components and logic were inspired by or adapted from [svelte-email-tailwind](https://github.com/steveninety/svelte-email-tailwind) and [react-email](https://react.email/). Huge thanks to the authors and contributors of these projects for their excellent work.
@@ -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>&nbsp;</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>&nbsp;</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,14 +0,0 @@
1
- <script lang="ts">
2
- import type { HTMLTdAttributes } from 'svelte/elements';
3
-
4
- let {
5
- children,
6
- ...restProps
7
- }: {
8
- children?: any;
9
- } & HTMLTdAttributes = $props();
10
- </script>
11
-
12
- <td {...restProps}>
13
- {@render children?.()}
14
- </td>
@@ -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,6 +0,0 @@
1
- type $$ComponentProps = {
2
- children?: any;
3
- };
4
- declare const Head: import("svelte").Component<$$ComponentProps, {}, "">;
5
- type Head = ReturnType<typeof Head>;
6
- export default 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;
@@ -1,16 +0,0 @@
1
- <script lang="ts">
2
- import { combineStyles, styleToString } from '../utils/index.js';
3
- import type { HTMLAttributes } from 'svelte/elements';
4
-
5
- let { style, ...restProps }: HTMLAttributes<HTMLHRElement> = $props();
6
-
7
- const defaultStyles = styleToString({
8
- width: '100%',
9
- border: 'none',
10
- borderTopWidth: '1px',
11
- borderTopStyle: 'solid',
12
- borderColor: '#eaeaea'
13
- });
14
- </script>
15
-
16
- <hr style={combineStyles(defaultStyles, style)} {...restProps} />
@@ -1,4 +0,0 @@
1
- import type { HTMLAttributes } from 'svelte/elements';
2
- declare const Hr: import("svelte").Component<HTMLAttributes<HTMLHRElement>, {}, "">;
3
- type Hr = ReturnType<typeof Hr>;
4
- export default Hr;
@@ -1,20 +0,0 @@
1
- <script lang="ts">
2
- import type { HTMLHtmlAttributes } from 'svelte/elements';
3
-
4
- type Props = HTMLHtmlAttributes & {
5
- lang?: string;
6
- dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
7
- style?: string;
8
- children?: any;
9
- };
10
-
11
- let { lang = 'en', dir = 'ltr', children, ...restProps }: Props = $props();
12
-
13
- const doctype =
14
- '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
15
- </script>
16
-
17
- {@html doctype}
18
- <html {...restProps} id="__better-svelte-email" {lang} {dir}>
19
- {@render children?.()}
20
- </html>
@@ -1,10 +0,0 @@
1
- import type { HTMLHtmlAttributes } from 'svelte/elements';
2
- type Props = HTMLHtmlAttributes & {
3
- lang?: string;
4
- dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
5
- style?: string;
6
- children?: any;
7
- };
8
- declare const Html: import("svelte").Component<Props, {}, "">;
9
- type Html = ReturnType<typeof Html>;
10
- export default Html;
@@ -1,27 +0,0 @@
1
- <script lang="ts">
2
- import { combineStyles, styleToString } from '../utils/index.js';
3
- import type { HTMLImgAttributes } from 'svelte/elements';
4
-
5
- let {
6
- style,
7
- alt,
8
- src,
9
- width,
10
- height,
11
- ...restProps
12
- }: HTMLImgAttributes & {
13
- alt: string;
14
- src: string;
15
- width: string;
16
- height: string;
17
- } = $props();
18
-
19
- const defaultStyles = styleToString({
20
- display: 'block',
21
- outline: 'none',
22
- border: 'none',
23
- textDecoration: 'none'
24
- });
25
- </script>
26
-
27
- <img {alt} {src} {width} {height} style={combineStyles(defaultStyles, style)} {...restProps} />
@@ -1,10 +0,0 @@
1
- import type { HTMLImgAttributes } from 'svelte/elements';
2
- type $$ComponentProps = HTMLImgAttributes & {
3
- alt: string;
4
- src: string;
5
- width: string;
6
- height: string;
7
- };
8
- declare const Img: import("svelte").Component<$$ComponentProps, {}, "">;
9
- type Img = ReturnType<typeof Img>;
10
- export default Img;
@@ -1,22 +0,0 @@
1
- <script lang="ts">
2
- import { combineStyles, styleToString } from '../utils/index.js';
3
- import type { HTMLAnchorAttributes } from 'svelte/elements';
4
-
5
- let {
6
- children,
7
- href,
8
- target = '_blank',
9
- style,
10
- ...restProps
11
- }: {
12
- href: string;
13
- target?: string;
14
- children: any;
15
- } & HTMLAnchorAttributes = $props();
16
-
17
- const defaultStyles = styleToString({ textDecorationLine: 'none', color: '#067df7' });
18
- </script>
19
-
20
- <a {href} {target} {...restProps} style={combineStyles(defaultStyles, style)}>
21
- {@render children?.()}
22
- </a>
@@ -1,9 +0,0 @@
1
- import type { HTMLAnchorAttributes } from 'svelte/elements';
2
- type $$ComponentProps = {
3
- href: string;
4
- target?: string;
5
- children: any;
6
- } & HTMLAnchorAttributes;
7
- declare const Link: import("svelte").Component<$$ComponentProps, {}, "">;
8
- type Link = ReturnType<typeof Link>;
9
- export default Link;