@aswin.dev/editor 0.6.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 +78 -0
- package/package.json +99 -0
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @aswin.dev/editor
|
|
2
|
+
|
|
3
|
+
> Vue 3 visual drag-and-drop email editor — drop into any web app with one function call.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@aswin.dev/editor)
|
|
6
|
+
[](https://github.com/templatical/sdk/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
The visual editor for [Templatical](https://github.com/templatical/sdk) — an open-source drag-and-drop email editor with JSON templates and MJML output.
|
|
9
|
+
|
|
10
|
+
- 🧩 **14 block types** — title, paragraph, image, button, section, divider, spacer, social icons, menu, table, HTML, video, countdown, custom
|
|
11
|
+
- 🎨 **27 design tokens** — full theming, dark mode, custom fonts
|
|
12
|
+
- 🔌 **Framework-agnostic** — works in React, Vue, Svelte, Angular, vanilla
|
|
13
|
+
- 📦 **JSON in, MJML out** — portable templates, render with any email provider
|
|
14
|
+
- 🌍 **Bilingual** — English + German built in
|
|
15
|
+
- 🔒 **TypeScript strict** — full type safety end to end
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @aswin.dev/editor
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`@templatical/renderer` is an optional peer — install it only if you need to convert templates to MJML. The two common cases are:
|
|
24
|
+
|
|
25
|
+
- **In the browser, alongside the editor**, when you call `editor.toMjml()` to export from the user's session.
|
|
26
|
+
- **In Node.js (or another runtime)**, when you only have stored template JSON and want to convert it to MJML server-side. You don't need the editor for this — install just the renderer.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @templatical/renderer
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If you call `editor.toMjml()` without the renderer installed, it throws a clear error naming the missing package.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { init } from '@aswin.dev/editor';
|
|
38
|
+
import '@aswin.dev/editor/style.css';
|
|
39
|
+
|
|
40
|
+
const editor = await init({
|
|
41
|
+
container: '#editor',
|
|
42
|
+
onChange(content) {
|
|
43
|
+
// content is JSON — store/version/sync however you want
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Render to MJML when sending email — async; requires @templatical/renderer
|
|
48
|
+
const mjml = await editor.toMjml();
|
|
49
|
+
|
|
50
|
+
// Always unmount when removing the editor (cleans up listeners + DOM)
|
|
51
|
+
editor.unmount();
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div id="editor" style="height: 100vh"></div>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Framework integration
|
|
59
|
+
|
|
60
|
+
First-class examples for **React, Vue, Svelte, Angular, and vanilla JS** are in the [installation guide](https://docs.templatical.com/getting-started/installation).
|
|
61
|
+
|
|
62
|
+
## Cloud features
|
|
63
|
+
|
|
64
|
+
For AI rewrite, real-time collaboration, comments, snapshots, and saved modules, use `initCloud()` instead. See the [Cloud guide](https://docs.templatical.com/cloud/getting-started).
|
|
65
|
+
|
|
66
|
+
## Documentation
|
|
67
|
+
|
|
68
|
+
- [Quick Start](https://docs.templatical.com/getting-started/quick-start)
|
|
69
|
+
- [Editor API reference](https://docs.templatical.com/api/editor)
|
|
70
|
+
- [Block reference](https://docs.templatical.com/guide/blocks)
|
|
71
|
+
- [Theming](https://docs.templatical.com/guide/theming)
|
|
72
|
+
- [Custom blocks](https://docs.templatical.com/guide/custom-blocks)
|
|
73
|
+
|
|
74
|
+
Full docs at **[docs.templatical.com](https://docs.templatical.com)**.
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
[FSL-1.1-MIT](https://github.com/templatical/sdk/blob/main/LICENSE) — free for any non-competing commercial use, automatically converts to MIT after 2 years per release. [License FAQ](https://docs.templatical.com/license-faq).
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aswin.dev/editor",
|
|
3
|
+
"description": "Vue 3 visual drag-and-drop email editor powered by Templatical",
|
|
4
|
+
"version": "0.6.3",
|
|
5
|
+
"bugs": "https://github.com/templatical/sdk/issues",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@lucide/vue": "^1.11.0",
|
|
8
|
+
"@templatical/core": "workspace:*",
|
|
9
|
+
"@templatical/quality": "workspace:*",
|
|
10
|
+
"@templatical/types": "workspace:*",
|
|
11
|
+
"@tiptap/core": "^3.22.4",
|
|
12
|
+
"@tiptap/extension-color": "^3.22.4",
|
|
13
|
+
"@tiptap/extension-font-family": "^3.22.4",
|
|
14
|
+
"@tiptap/extension-highlight": "^3.22.4",
|
|
15
|
+
"@tiptap/extension-link": "^3.22.4",
|
|
16
|
+
"@tiptap/extension-subscript": "^3.22.4",
|
|
17
|
+
"@tiptap/extension-superscript": "^3.22.4",
|
|
18
|
+
"@tiptap/extension-text-align": "^3.22.4",
|
|
19
|
+
"@tiptap/extension-text-style": "^3.22.4",
|
|
20
|
+
"@tiptap/extension-underline": "^3.22.4",
|
|
21
|
+
"@tiptap/starter-kit": "^3.22.4",
|
|
22
|
+
"@tiptap/suggestion": "^3.22.4",
|
|
23
|
+
"@tiptap/vue-3": "^3.22.4",
|
|
24
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
25
|
+
"@vue/test-utils": "^2.4.8",
|
|
26
|
+
"@vueuse/core": "^14.2.1",
|
|
27
|
+
"es-module-lexer": "^2.1.0",
|
|
28
|
+
"happy-dom": "^20.9.0",
|
|
29
|
+
"liquidjs": "^10.25.7",
|
|
30
|
+
"tailwindcss": "^4.2.4",
|
|
31
|
+
"typescript": "^6.0.3",
|
|
32
|
+
"vanilla-colorful": "^0.7.2",
|
|
33
|
+
"vite": "^8.0.10",
|
|
34
|
+
"vite-plugin-dts": "^4.5.4",
|
|
35
|
+
"vitest": "^4.1.5",
|
|
36
|
+
"vue": "^3.5.33",
|
|
37
|
+
"vue-tsc": "^3.2.7",
|
|
38
|
+
"vuedraggable": "^4.1.0"
|
|
39
|
+
},
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"import": "./dist/templatical-editor.js"
|
|
44
|
+
},
|
|
45
|
+
"./style.css": "./dist/style.css"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dist"
|
|
49
|
+
],
|
|
50
|
+
"homepage": "https://templatical.com",
|
|
51
|
+
"keywords": [
|
|
52
|
+
"drag-and-drop",
|
|
53
|
+
"email",
|
|
54
|
+
"email-builder",
|
|
55
|
+
"email-editor",
|
|
56
|
+
"email-template",
|
|
57
|
+
"mjml",
|
|
58
|
+
"templatical",
|
|
59
|
+
"tiptap",
|
|
60
|
+
"vue",
|
|
61
|
+
"wysiwyg"
|
|
62
|
+
],
|
|
63
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
64
|
+
"module": "./dist/templatical-editor.js",
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@templatical/media-library": "workspace:*",
|
|
67
|
+
"@templatical/quality": "workspace:*",
|
|
68
|
+
"@templatical/renderer": "workspace:*"
|
|
69
|
+
},
|
|
70
|
+
"peerDependenciesMeta": {
|
|
71
|
+
"@templatical/renderer": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@templatical/media-library": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"@templatical/quality": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"access": "public"
|
|
83
|
+
},
|
|
84
|
+
"repository": {
|
|
85
|
+
"type": "git",
|
|
86
|
+
"url": "git+https://github.com/templatical/sdk.git",
|
|
87
|
+
"directory": "packages/editor"
|
|
88
|
+
},
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build": "vite build",
|
|
91
|
+
"build:all": "vite build && vite build --config vite.cdn.config.ts",
|
|
92
|
+
"build:cdn": "vite build --config vite.cdn.config.ts",
|
|
93
|
+
"test": "vitest run",
|
|
94
|
+
"typecheck": "vue-tsc --noEmit",
|
|
95
|
+
"verify:pack": "node scripts/verify-pack.mjs"
|
|
96
|
+
},
|
|
97
|
+
"type": "module",
|
|
98
|
+
"types": "./dist/index.d.ts"
|
|
99
|
+
}
|