@templatical/template-tools 0.38.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.
- package/LICENSE +109 -0
- package/README.md +48 -0
- package/dist/bin.d.ts +5 -0
- package/dist/bin.js +698 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +2 -0
- package/dist/live/index.d.ts +87 -0
- package/dist/live/index.js +279 -0
- package/dist/live/index.js.map +1 -0
- package/dist/src-unNYVMlC.js +1278 -0
- package/dist/src-unNYVMlC.js.map +1 -0
- package/live/index.html +978 -0
- package/package.json +107 -0
- package/schema.json +1504 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026-present Templatical
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under these Terms and Conditions, as indicated by our inclusion of these Terms and Conditions with the Software.
|
|
20
|
+
|
|
21
|
+
### License Grant
|
|
22
|
+
|
|
23
|
+
Subject to your compliance with this License Grant and the Patents, Redistribution and Trademark clauses below, we hereby grant you the right to use, copy, modify, create derivative works, publicly perform, publicly display and redistribute the Software for any Permitted Purpose identified below.
|
|
24
|
+
|
|
25
|
+
### Permitted Purpose
|
|
26
|
+
|
|
27
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use means making the Software available to others in a commercial product or service that:
|
|
28
|
+
|
|
29
|
+
1. substitutes for the Software;
|
|
30
|
+
|
|
31
|
+
2. substitutes for any other product or service we offer using the Software that exists as of the date we make the Software available; or
|
|
32
|
+
|
|
33
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
34
|
+
|
|
35
|
+
Permitted Purposes specifically include using the Software:
|
|
36
|
+
|
|
37
|
+
1. for your internal use and access;
|
|
38
|
+
|
|
39
|
+
2. for non-commercial education;
|
|
40
|
+
|
|
41
|
+
3. for non-commercial research; and
|
|
42
|
+
|
|
43
|
+
4. in connection with professional services that you provide to a licensee using the Software in accordance with these Terms and Conditions.
|
|
44
|
+
|
|
45
|
+
### Patents
|
|
46
|
+
|
|
47
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our patents, the license grant above includes a license under our patents. If you make a claim against any party that the Software infringes or contributes to the infringement of any patent, then your patent license to the Software ends immediately.
|
|
48
|
+
|
|
49
|
+
### Redistribution
|
|
50
|
+
|
|
51
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of the Software.
|
|
52
|
+
|
|
53
|
+
If you redistribute any copies, modifications or derivatives of the Software, you must include a copy of or a link to these Terms and Conditions and not remove any copyright notices provided in or with the Software.
|
|
54
|
+
|
|
55
|
+
### Disclaimer
|
|
56
|
+
|
|
57
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
58
|
+
|
|
59
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
60
|
+
|
|
61
|
+
### Trademarks
|
|
62
|
+
|
|
63
|
+
Except for displaying the License Details and identifying us as the origin of the Software, you have no right under these Terms and Conditions to use our trademarks, trade names, service marks or product names.
|
|
64
|
+
|
|
65
|
+
## Grant of Future License
|
|
66
|
+
|
|
67
|
+
We hereby irrevocably grant you an additional license to use the Software under the MIT license that is effective on the second anniversary of the date we make the Software available. On or after that date, you may use the Software under the MIT license, in which case the following will apply:
|
|
68
|
+
|
|
69
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
70
|
+
|
|
71
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
74
|
+
|
|
75
|
+
## Additional Permission
|
|
76
|
+
|
|
77
|
+
The following Additional Permission grants rights in addition to the Terms and Conditions above. It does not limit, reduce, or condition any right granted there. In the event of any conflict, the interpretation more favorable to you controls.
|
|
78
|
+
|
|
79
|
+
### Embedding
|
|
80
|
+
|
|
81
|
+
Clause 3 of the Permitted Purpose section ("offers the same or substantially similar functionality as the Software") does not apply to a commercial product or service that embeds the Software as one component among others, where that product or service would remain independently useful to its users if the Software were removed.
|
|
82
|
+
|
|
83
|
+
Clauses 1 and 2 of the Permitted Purpose section continue to apply in full. A product or service that substitutes for the Software, or for any other product or service we offer using the Software, remains a Competing Use whether or not it embeds the Software as a component.
|
|
84
|
+
|
|
85
|
+
### Examples
|
|
86
|
+
|
|
87
|
+
Each of the following is a Permitted Purpose under this Additional Permission:
|
|
88
|
+
|
|
89
|
+
1. embedding the Software as one feature of a CRM, marketing automation platform, transactional email service, newsletter product, content management system, or comparable application;
|
|
90
|
+
|
|
91
|
+
2. charging your customers for such a product or service, including the embedded Software as part of it, at any number of customer accounts; and
|
|
92
|
+
|
|
93
|
+
3. customizing the Software with your own branding, theme, and extensions for use within such a product or service.
|
|
94
|
+
|
|
95
|
+
Each of the following remains a Competing Use and is not permitted:
|
|
96
|
+
|
|
97
|
+
1. offering the Software, or a modified or rebranded version of it, as a product or service whose primary function is composing, designing, or editing email templates; and
|
|
98
|
+
|
|
99
|
+
2. offering a hosted or managed service that substitutes for any product or service we offer using the Software.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
Scope: These Terms and Conditions apply to the @templatical/core,
|
|
104
|
+
@templatical/editor, and @templatical/media-library packages.
|
|
105
|
+
|
|
106
|
+
The @templatical/types, @templatical/renderer, @templatical/quality,
|
|
107
|
+
@templatical/import-beefree, @templatical/import-unlayer, and
|
|
108
|
+
@templatical/import-html packages are licensed separately under the MIT
|
|
109
|
+
License. See LICENSE-MIT for those packages' terms.
|
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @templatical/template-tools
|
|
2
|
+
|
|
3
|
+
CLI and library for [Templatical](https://templatical.com) email templates.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx -y @templatical/template-tools validate .templatical/my-template.json
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
| Command | What it does |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `validate <file>` | Structural validation plus the accessibility / structure / link lint |
|
|
14
|
+
| `render <file> --format mjml\|html` | Render to MJML, or to sending-ready HTML |
|
|
15
|
+
| `edit <file> --op <json>` | Apply one operation, or a batch with `--ops <file>` |
|
|
16
|
+
| `import <file>` | Convert a template from another tool's export format — run `import --list-formats` to see what's supported |
|
|
17
|
+
| `live` | Open the template in the real editor in a browser |
|
|
18
|
+
| `schema` | Print the block JSON Schema |
|
|
19
|
+
| `list` | List the working templates in `.templatical/` |
|
|
20
|
+
|
|
21
|
+
Add `--json` to any command for machine-readable output on stdout.
|
|
22
|
+
|
|
23
|
+
## Exit codes
|
|
24
|
+
|
|
25
|
+
| Code | Meaning |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `0` | Success. Lint warnings may still be reported. |
|
|
28
|
+
| `1` | The template is invalid — structural errors, or a lint issue of severity `error`. |
|
|
29
|
+
| `2` | Usage error — bad flags, missing or unreadable input. |
|
|
30
|
+
| `3` | An optional dependency is missing. The message names the install command. |
|
|
31
|
+
|
|
32
|
+
## Optional dependencies
|
|
33
|
+
|
|
34
|
+
Nothing is installed into your project by default. Two commands can ask for one thing:
|
|
35
|
+
|
|
36
|
+
- `render --format html` needs `mjml` (the SDK bundles no MJML compiler).
|
|
37
|
+
- `import` needs the converter package for that format. Run `import --list-formats` to see which are resolvable right now — the list grows over time, so this is the only answer that doesn't go stale.
|
|
38
|
+
|
|
39
|
+
Install them wherever you run the command; they are resolved from your working directory.
|
|
40
|
+
|
|
41
|
+
## Library use
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { validateTemplate, runQualityLint, applyOperation } from "@templatical/template-tools";
|
|
45
|
+
import { startBridge } from "@templatical/template-tools/live";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
MIT.
|