@lit-pigeon/renderer-mjml 0.2.1 → 0.2.3
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 +44 -0
- package/package.json +23 -7
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @lit-pigeon/renderer-mjml
|
|
2
|
+
|
|
3
|
+
MJML-based HTML renderer for [Lit Pigeon](https://github.com/snxstudio/lit-pigeon).
|
|
4
|
+
Converts a `PigeonDocument` into a full MJML markup string, then compiles it to
|
|
5
|
+
email-client-safe, inlined-CSS, table-based HTML (with optional Outlook
|
|
6
|
+
`mso`/VML workarounds).
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @lit-pigeon/renderer-mjml
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Bundles [`mjml`](https://mjml.io) as a dependency.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { MjmlRenderer } from '@lit-pigeon/renderer-mjml';
|
|
20
|
+
import { createDefaultDocument } from '@lit-pigeon/core';
|
|
21
|
+
|
|
22
|
+
const renderer = new MjmlRenderer();
|
|
23
|
+
const doc = createDefaultDocument();
|
|
24
|
+
|
|
25
|
+
const { html, errors } = await renderer.render(doc, {
|
|
26
|
+
outlookWorkarounds: true, // default
|
|
27
|
+
minify: false,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// `html` is ready to send; `errors` is empty on success.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`MjmlRenderer` implements the core `Renderer` interface, so it can be passed
|
|
34
|
+
straight to the editor's preview/export path or the framework wrappers. Need
|
|
35
|
+
just the MJML markup (no HTML compile)? Use `documentToMjml(doc, options)`.
|
|
36
|
+
|
|
37
|
+
For a DOM-free server pipeline (parse + validate + merge tags), see
|
|
38
|
+
[`@lit-pigeon/ssr`](../ssr).
|
|
39
|
+
|
|
40
|
+
Part of [Lit Pigeon](https://github.com/snxstudio/lit-pigeon) — open-source drag-and-drop email editor.
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lit-pigeon/renderer-mjml",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "MJML-based HTML renderer for Pigeon email editor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -8,24 +8,26 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
11
12
|
"import": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs"
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
18
20
|
],
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"mjml": "^4.15.0",
|
|
21
|
-
"@lit-pigeon/core": "^0.3.
|
|
23
|
+
"@lit-pigeon/core": "^0.3.2"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@types/mjml": "^4.7.0",
|
|
25
27
|
"typescript": "^5.5.0",
|
|
26
|
-
"vite": "^
|
|
28
|
+
"vite": "^6.0.0",
|
|
27
29
|
"vite-plugin-dts": "^4.0.0",
|
|
28
|
-
"vitest": "^
|
|
30
|
+
"vitest": "^3.0.0"
|
|
29
31
|
},
|
|
30
32
|
"publishConfig": {
|
|
31
33
|
"access": "public"
|
|
@@ -36,6 +38,20 @@
|
|
|
36
38
|
"directory": "packages/renderer-mjml"
|
|
37
39
|
},
|
|
38
40
|
"license": "MIT",
|
|
41
|
+
"homepage": "https://github.com/snxstudio/lit-pigeon/tree/main/packages/renderer-mjml#readme",
|
|
42
|
+
"bugs": "https://github.com/snxstudio/lit-pigeon/issues",
|
|
43
|
+
"author": "Lit Pigeon Contributors",
|
|
44
|
+
"keywords": [
|
|
45
|
+
"email",
|
|
46
|
+
"email-template",
|
|
47
|
+
"email-editor",
|
|
48
|
+
"mjml",
|
|
49
|
+
"html-email",
|
|
50
|
+
"lit",
|
|
51
|
+
"web-components",
|
|
52
|
+
"renderer",
|
|
53
|
+
"ssr"
|
|
54
|
+
],
|
|
39
55
|
"scripts": {
|
|
40
56
|
"build": "vite build",
|
|
41
57
|
"dev": "vite build --watch",
|