@lit-pigeon/parser-mjml 0.1.4 → 0.1.5
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 +43 -0
- package/package.json +19 -3
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @lit-pigeon/parser-mjml
|
|
2
|
+
|
|
3
|
+
MJML → `PigeonDocument` parser for [Lit Pigeon](https://github.com/snxstudio/lit-pigeon).
|
|
4
|
+
Import an existing MJML email template into the editor's JSON document model —
|
|
5
|
+
the inverse of [`@lit-pigeon/renderer-mjml`](../renderer-mjml).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @lit-pigeon/parser-mjml
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { mjmlToDocument } from '@lit-pigeon/parser-mjml';
|
|
17
|
+
|
|
18
|
+
const mjml = `
|
|
19
|
+
<mjml>
|
|
20
|
+
<mj-body>
|
|
21
|
+
<mj-section>
|
|
22
|
+
<mj-column>
|
|
23
|
+
<mj-text>Hello from MJML</mj-text>
|
|
24
|
+
</mj-column>
|
|
25
|
+
</mj-section>
|
|
26
|
+
</mj-body>
|
|
27
|
+
</mjml>
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const { document, warnings } = mjmlToDocument(mjml);
|
|
31
|
+
// `document` is a PigeonDocument you can load into the editor.
|
|
32
|
+
// `warnings` lists unsupported tags that were skipped or approximated.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Pass `{ lenient: true }` to silently skip unknown elements instead of warning.
|
|
36
|
+
The exported `ParseOptions`, `ParseResult`, and `ParseWarning` types describe
|
|
37
|
+
the input and output shapes.
|
|
38
|
+
|
|
39
|
+
Part of [Lit Pigeon](https://github.com/snxstudio/lit-pigeon) — open-source drag-and-drop email editor.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lit-pigeon/parser-mjml",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "MJML-to-PigeonDocument parser for Pigeon email editor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
18
20
|
],
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"htmlparser2": "^9.1.0",
|
|
21
|
-
"@lit-pigeon/core": "^0.3.
|
|
23
|
+
"@lit-pigeon/core": "^0.3.1"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"typescript": "^5.5.0",
|
|
@@ -35,6 +37,20 @@
|
|
|
35
37
|
"directory": "packages/parser-mjml"
|
|
36
38
|
},
|
|
37
39
|
"license": "MIT",
|
|
40
|
+
"homepage": "https://github.com/snxstudio/lit-pigeon/tree/main/packages/parser-mjml#readme",
|
|
41
|
+
"bugs": "https://github.com/snxstudio/lit-pigeon/issues",
|
|
42
|
+
"author": "Lit Pigeon Contributors",
|
|
43
|
+
"keywords": [
|
|
44
|
+
"email",
|
|
45
|
+
"email-template",
|
|
46
|
+
"email-editor",
|
|
47
|
+
"mjml",
|
|
48
|
+
"html-email",
|
|
49
|
+
"lit",
|
|
50
|
+
"web-components",
|
|
51
|
+
"parser",
|
|
52
|
+
"import"
|
|
53
|
+
],
|
|
38
54
|
"scripts": {
|
|
39
55
|
"build": "vite build",
|
|
40
56
|
"dev": "vite build --watch",
|