nuxt-email-renderer 0.0.8 โ 0.0.9
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 +143 -51
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/DxtrUEuP.js +1 -1
- package/dist/client/_nuxt/YwajB3s2.js +36 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c534c671-6313-474a-9e7c-cf6db80f1b4e.json +1 -0
- package/dist/client/_nuxt/entry.jNjS3-cZ.css +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +41 -1
- package/dist/runtime/server/api/emails/index.get.d.ts +1 -5
- package/dist/runtime/server/api/emails/index.get.js +2 -1
- package/dist/runtime/server/utils/virtual-templates.d.ts +2 -10
- package/dist/runtime/types/index.d.ts +21 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/types.d.ts +1 -0
- package/dist/runtime/types/types.js +0 -0
- package/package.json +1 -1
- package/dist/client/_nuxt/BWau57G6.js +0 -36
- package/dist/client/_nuxt/builds/meta/708fbde9-f767-4f39-b851-ec1205270e83.json +0 -1
- package/dist/client/_nuxt/entry.CJ9_mbro.css +0 -1
package/README.md
CHANGED
|
@@ -1,33 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Get your module up and running quickly.
|
|
1
|
+
# Nuxt Email Renderer
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
- Name: My Module
|
|
6
|
-
- Package name: my-module
|
|
7
|
-
- Description: My new Nuxt module
|
|
8
|
-
-->
|
|
3
|
+
**The next generation of writing emails in Nuxt.**
|
|
9
4
|
|
|
10
|
-
|
|
5
|
+
A Nuxt module that provides high-quality, unstyled components for creating emails using Vue and TypeScript.
|
|
11
6
|
|
|
12
7
|
[![npm version][npm-version-src]][npm-version-href]
|
|
13
8
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
9
|
[![License][license-src]][license-href]
|
|
15
10
|
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
11
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- [โจ Release Notes](/CHANGELOG.md)
|
|
20
|
-
<!-- - [๐ Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
|
|
21
|
-
<!-- - [๐ Documentation](https://example.com) -->
|
|
12
|
+
[๐ Documentation](https://nuxtemail.com) ยท [๐พ Playground](https://nuxtemail.com/playground)
|
|
22
13
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
<!-- Highlight some of the features your module provide here -->
|
|
26
|
-
- โฐ Foo
|
|
27
|
-
- ๐ Bar
|
|
28
|
-
- ๐ฒ Baz
|
|
29
|
-
|
|
30
|
-
## Quick Setup
|
|
14
|
+
## Install
|
|
31
15
|
|
|
32
16
|
Install the module to your Nuxt application with one command:
|
|
33
17
|
|
|
@@ -37,37 +21,145 @@ npx nuxi module add nuxt-email-renderer
|
|
|
37
21
|
|
|
38
22
|
That's it! You can now use Nuxt Email Renderer in your Nuxt app โจ
|
|
39
23
|
|
|
24
|
+
## Getting started
|
|
25
|
+
|
|
26
|
+
Add the module to your `nuxt.config.ts`:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
export default defineNuxtConfig({
|
|
30
|
+
modules: [
|
|
31
|
+
'nuxt-email-renderer'
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Create an email template using Vue components. Include styles where needed:
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<template>
|
|
40
|
+
<EHtml>
|
|
41
|
+
<EHead />
|
|
42
|
+
<EPreview>Welcome to our platform!</EPreview>
|
|
43
|
+
<EBody :style="{ backgroundColor: '#f6f9fc', fontFamily: 'Arial, sans-serif' }">
|
|
44
|
+
<EContainer :style="{ margin: '0 auto', padding: '20px 0 48px' }">
|
|
45
|
+
<EHeading :as="'h1'">Welcome!</EHeading>
|
|
46
|
+
<EText :style="{ fontSize: '16px', lineHeight: '24px' }">
|
|
47
|
+
Thanks for joining us. Click the button below to get started.
|
|
48
|
+
</EText>
|
|
49
|
+
<EButton
|
|
50
|
+
href="https://example.com"
|
|
51
|
+
:style="{ backgroundColor: '#007ee6', color: '#fff', padding: '12px 20px' }"
|
|
52
|
+
>
|
|
53
|
+
Get Started
|
|
54
|
+
</EButton>
|
|
55
|
+
</EContainer>
|
|
56
|
+
</EBody>
|
|
57
|
+
</EHtml>
|
|
58
|
+
</template>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
In your code, you can now render the template by calling the render API endpoint provided by the module:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
const response = await $fetch("/api/emails/render", {}, {
|
|
65
|
+
method: "POST",
|
|
66
|
+
body: {
|
|
67
|
+
template: "WelcomeEmail",
|
|
68
|
+
props: {
|
|
69
|
+
userName: "John Doe",
|
|
70
|
+
confirmationUrl: "https://example.com/confirm?token=abc123",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If you have the Nuxt DevTools enabled, you can also test rendering directly from the DevTools panel. You should see your `WelcomeEmail` template listed.
|
|
40
77
|
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
## Components
|
|
79
|
+
|
|
80
|
+
A set of standard components to help you build amazing emails without having to deal with the mess of creating table-based layouts and maintaining archaic markup.
|
|
81
|
+
|
|
82
|
+
- [Body](src/runtime/components/body) - The main body wrapper for your email
|
|
83
|
+
- [Button](src/runtime/components/button) - A styled button component
|
|
84
|
+
- [CodeBlock](src/runtime/components/code-block) - Syntax-highlighted code blocks
|
|
85
|
+
- [CodeInline](src/runtime/components/code-inline) - Inline code snippets
|
|
86
|
+
- [Column](src/runtime/components/column) - Table column for layouts
|
|
87
|
+
- [Container](src/runtime/components/container) - Centered container wrapper
|
|
88
|
+
- [Font](src/runtime/components/font) - Web font imports
|
|
89
|
+
- [Head](src/runtime/components/head) - HTML head section
|
|
90
|
+
- [Heading](src/runtime/components/heading) - Headings (h1-h6)
|
|
91
|
+
- [Hr](src/runtime/components/hr) - Horizontal divider lines
|
|
92
|
+
- [Html](src/runtime/components/html) - Root HTML wrapper
|
|
93
|
+
- [Img](src/runtime/components/img) - Responsive images
|
|
94
|
+
- [Link](src/runtime/components/link) - Styled anchor links
|
|
95
|
+
- [Preview](src/runtime/components/preview) - Email preview text
|
|
96
|
+
- [Row](src/runtime/components/row) - Table rows for layouts
|
|
97
|
+
- [Section](src/runtime/components/section) - Content sections
|
|
98
|
+
- [Style](src/runtime/components/style) - CSS styles
|
|
99
|
+
- [Text](src/runtime/components/text) - Paragraph and text content
|
|
100
|
+
|
|
101
|
+
## Support
|
|
102
|
+
|
|
103
|
+
All components were tested using the most popular email clients.
|
|
104
|
+
|
|
105
|
+
| Gmail โ | Apple Mail โ | Outlook โ | Yahoo! Mail โ | HEY โ | Superhuman โ |
|
|
106
|
+
|---------|--------------|-----------|---------------|-------|--------------|
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
#### Install dependencies
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pnpm install
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### Build
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pnpm build
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Run playground
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pnpm dev
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
This will start the development server with the playground at [localhost:3000](http://localhost:3000/).
|
|
129
|
+
|
|
130
|
+
#### Run DevTools interface
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pnpm client:dev
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
This starts the email template viewer interface at [localhost:3300](http://localhost:3300/).
|
|
137
|
+
|
|
138
|
+
#### Run tests
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
pnpm test
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Run linting
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
pnpm lint
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Authors
|
|
151
|
+
|
|
152
|
+
- Michael Hoffmann ([@mokkapps](https://twitter.com/mokkapps))
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
- [โจ Release Notes](/CHANGELOG.md)
|
|
161
|
+
- [๐ Documentation](https://nuxtemail.com)
|
|
162
|
+
- [๐ Playground](https://nuxtemail.com/playground)
|
|
71
163
|
|
|
72
164
|
|
|
73
165
|
<!-- Badges -->
|
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-email-renderer/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-email-renderer/_nuxt/YwajB3s2.js"}}</script><link rel="stylesheet" href="/__nuxt-email-renderer/_nuxt/entry.jNjS3-cZ.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/YwajB3s2.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-email-renderer/_nuxt/error-404.BHOIm0B1.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/Dp9LgCK2.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/n57rOy2v.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-email-renderer/_nuxt/error-500.CqX_nDZ5.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/DZaor8iy.js"><script type="module" src="/__nuxt-email-renderer/_nuxt/YwajB3s2.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1759140505695,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{nuxtEmailRenderer:{emailsDir:"/playground/emails",devtools:false}},app:{baseURL:"/__nuxt-email-renderer",buildId:"c534c671-6313-474a-9e7c-cf6db80f1b4e",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-email-renderer/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-email-renderer/_nuxt/YwajB3s2.js"}}</script><link rel="stylesheet" href="/__nuxt-email-renderer/_nuxt/entry.jNjS3-cZ.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/YwajB3s2.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-email-renderer/_nuxt/error-404.BHOIm0B1.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/Dp9LgCK2.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/n57rOy2v.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-email-renderer/_nuxt/error-500.CqX_nDZ5.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-email-renderer/_nuxt/DZaor8iy.js"><script type="module" src="/__nuxt-email-renderer/_nuxt/YwajB3s2.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1759140505695,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{nuxtEmailRenderer:{emailsDir:"/playground/emails",devtools:false}},app:{baseURL:"/__nuxt-email-renderer",buildId:"c534c671-6313-474a-9e7c-cf6db80f1b4e",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./D7nOehHU.js","./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./D7nOehHU.js","./YwajB3s2.js","./entry.jNjS3-cZ.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{j as h,m,k as l}from"#entry";const y=h({name:"ECodeBlock",props:{code:{type:String,required:!0},lang:{type:String,required:!0},theme:{type:String,required:!0},class:{type:String,default:""},showLineNumbers:{type:Boolean,default:!1},lineNumberColor:{type:String,default:"#636E7B"},lineHighlightingColor:{type:String,default:"rgba(101, 117, 133, .16)"},highlightedLines:{type:Array,default:()=>[]}},async setup({code:a,lang:r,theme:t,showLineNumbers:s,lineNumberColor:n,highlightedLines:p,lineHighlightingColor:c}){const{createHighlighter:d}=await m(async()=>{const{createHighlighter:e}=await import("./D7nOehHU.js");return{createHighlighter:e}},__vite__mapDeps([0,1,2]),import.meta.url),i=await d({langs:[r],themes:[t]}),g=i.getTheme(t).bg,u=i.codeToHtml(a,{lang:r,theme:t,transformers:[{code(e){e.properties.style="display: table; width: 100%;"}},{line(e,o){e.properties.style="display: table-row; line-height: 1.5; height: 1.5em;",s&&e.children.unshift({type:"element",tagName:"span",properties:{className:["line-number"],style:`padding-left: 5px; padding-right: 15px; color: ${n}; user-select: none;`},children:[{type:"text",value:`${o}`}]}),p.includes(o)&&(e.properties.style+=`background-color: ${c};`)}}]});return()=>l("pre",{class:["shiki",t],style:{backgroundColor:g,display:"block",whiteSpace:"pre",fontFamily:"monospace"},tabindex:0},[l("span",{innerHTML:u})])}}),b=Object.assign(y,{__name:"CodeBlockECodeBlock"});export{y as ECodeBlock,b as default};
|