esender-email-editor 1.2.1 → 1.3.1
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 +21 -41
- package/dist/index.cjs +6 -7
- package/dist/index.js +6 -7
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -11,10 +11,23 @@ A drag-and-drop **MJML email editor** for React 18 + Ant Design 5. The editor re
|
|
|
11
11
|
The package is published on the public **npm registry**.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install esender-email-editor
|
|
14
|
+
npm install esender-email-editor
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
>
|
|
17
|
+
> A transitive runtime dep (`react-giphy-searchbox`, used by the Gif block) still declares an ancient `react@16.x` peer. To keep npm install clean without `--legacy-peer-deps`, add the following `overrides` block to your **host app's** `package.json`. It pins the stale peer to your real React version — runtime is unaffected.
|
|
18
|
+
>
|
|
19
|
+
> ```json
|
|
20
|
+
> {
|
|
21
|
+
> "overrides": {
|
|
22
|
+
> "react-giphy-searchbox": {
|
|
23
|
+
> "react": "$react",
|
|
24
|
+
> "react-dom": "$react-dom"
|
|
25
|
+
> }
|
|
26
|
+
> }
|
|
27
|
+
> }
|
|
28
|
+
> ```
|
|
29
|
+
>
|
|
30
|
+
> Yarn users: use `"resolutions"` with the same shape. pnpm users: use `"pnpm.overrides"`.
|
|
18
31
|
|
|
19
32
|
## Peer dependencies
|
|
20
33
|
|
|
@@ -25,12 +38,13 @@ npm install \
|
|
|
25
38
|
react@^18 react-dom@^18 \
|
|
26
39
|
antd@^5 @ant-design/icons@^5 @ant-design/pro-components@^2 \
|
|
27
40
|
@reduxjs/toolkit@^2 react-redux@^9 redux-persist@^6 \
|
|
28
|
-
mjml-browser@^4 cheerio@1.0.0-rc.12 \
|
|
29
41
|
lodash@^4 axios@^1 swr@^2 \
|
|
30
42
|
framer-motion@^12 html2canvas@^1 \
|
|
31
43
|
styled-components@^6 use-sync-external-store@^1
|
|
32
44
|
```
|
|
33
45
|
|
|
46
|
+
> `mjml-browser` and `cheerio` are **bundled inside the published package** — you do **not** install them.
|
|
47
|
+
|
|
34
48
|
### Supported version ranges
|
|
35
49
|
|
|
36
50
|
| Package | Declared range | Notes |
|
|
@@ -42,7 +56,6 @@ npm install \
|
|
|
42
56
|
| `@reduxjs/toolkit` | `>=2.0.0 <3.0.0` | |
|
|
43
57
|
| `react-redux` | `>=8.0.0 <10.0.0` | v8 and v9 both work under React 18. |
|
|
44
58
|
| `redux-persist` | `>=6.0.0 <7.0.0` | |
|
|
45
|
-
| `mjml-browser` | `>=4.15.0 <6.0.0` | v5 still requires `cheerio`. |
|
|
46
59
|
| `lodash` | `>=4.17.0 <5.0.0` | |
|
|
47
60
|
| `axios` | `>=1.0.0 <2.0.0` | |
|
|
48
61
|
| `swr` | `>=2.0.0 <3.0.0` | |
|
|
@@ -50,7 +63,8 @@ npm install \
|
|
|
50
63
|
| `html2canvas` | `>=1.0.0 <2.0.0` | |
|
|
51
64
|
| `styled-components` | `>=5.0.0 <7.0.0` | v5 and v6 both work. |
|
|
52
65
|
| `use-sync-external-store` | `>=1.0.0 <2.0.0` | |
|
|
53
|
-
| `
|
|
66
|
+
| `mjml-browser` | bundled | Shipped inside `dist/`; host does not install. |
|
|
67
|
+
| `cheerio` | bundled | Shipped inside `dist/` alongside `mjml-browser`; host does not install. |
|
|
54
68
|
|
|
55
69
|
### The non-negotiables
|
|
56
70
|
|
|
@@ -58,8 +72,7 @@ npm install \
|
|
|
58
72
|
|---|---|
|
|
59
73
|
| **React must be 18.x** (not 19) | antd v5 only officially supports React 16–18. Under React 19 you will see `[antd: compatible]` warnings and cascading hook bugs in dropdown / tooltip / message. |
|
|
60
74
|
| **Single React copy** in `node_modules` | Two copies of React → `Invalid hook call`. Run `npm ls react` — it must show exactly one version. For Vite hosts use `resolve.dedupe`. |
|
|
61
|
-
|
|
|
62
|
-
| **`@ant-design/icons` stays on v5** | `@ant-design/pro-components` resolves icons v5. Installing v6 forces `--legacy-peer-deps` everywhere and can cause runtime mismatches. |
|
|
75
|
+
| **`@ant-design/icons` stays on v5** | `@ant-design/pro-components` resolves icons v5. Installing v6 can cause runtime mismatches. |
|
|
63
76
|
|
|
64
77
|
## Quick start
|
|
65
78
|
|
|
@@ -163,8 +176,6 @@ The editor does **not** mount its own `<ConfigProvider>` or antd `<App />`. It i
|
|
|
163
176
|
|
|
164
177
|
All editor-specific CSS lives under a single `.aee-root` class scope (the wrapper div around the editor), so SCSS overrides and resets cannot reach host components either.
|
|
165
178
|
|
|
166
|
-
If you want the editor branded purple like the default screenshots, wrap your host app in your own `<ConfigProvider theme={{ token: { colorPrimary: '#7747ff' } }}>` — the editor will inherit it.
|
|
167
|
-
|
|
168
179
|
## License handshake
|
|
169
180
|
|
|
170
181
|
The editor will not render until the eSender license is verified:
|
|
@@ -219,7 +230,6 @@ export default defineConfig({
|
|
|
219
230
|
optimizeDeps: {
|
|
220
231
|
include: [
|
|
221
232
|
'esender-email-editor',
|
|
222
|
-
'mjml-browser', 'cheerio',
|
|
223
233
|
'antd', '@ant-design/icons', '@ant-design/pro-components',
|
|
224
234
|
'react-is', 'react-redux',
|
|
225
235
|
'use-sync-external-store',
|
|
@@ -279,7 +289,7 @@ import Package, {
|
|
|
279
289
|
| Symptom | Cause / fix |
|
|
280
290
|
|---|---|
|
|
281
291
|
| `Invalid hook call` | Two copies of React are loaded. Run `npm ls react` — must show one version. Vite: add `resolve.dedupe`. |
|
|
282
|
-
| Canvas shows
|
|
292
|
+
| Canvas shows "Failed to render preview" | You're on an outdated version of the package. Update — current builds bundle `mjml-browser` + `cheerio` so this no longer requires a host install. |
|
|
283
293
|
| Vite: `'classnames' does not provide an export named 'default'` | Vite hasn't pre-bundled antd's CJS transitive deps. Add the `optimizeDeps.include` list above, delete `node_modules/.vite`, and restart with `vite --force`. |
|
|
284
294
|
| antd `[antd: compatible] React is 16 ~ 18` warning + broken dropdowns / tooltips | You are on React 19. Downgrade to React 18.3.1. |
|
|
285
295
|
| Editor shows "Editor unavailable" forever | License verify failed. Check the `/license/verify` network response, confirm `apiKey`, watch `onLicenseError`. |
|
|
@@ -287,36 +297,6 @@ import Package, {
|
|
|
287
297
|
| `You cannot render a <Router> inside another <Router>` | You're on an outdated version. Update — current package uses `MemoryRouter` internally. |
|
|
288
298
|
| Renders during SSR throw | Mount the component client-side only (see Next.js example above). |
|
|
289
299
|
|
|
290
|
-
## Publishing (maintainers)
|
|
291
|
-
|
|
292
|
-
```bash
|
|
293
|
-
# 1. Bump version (semver)
|
|
294
|
-
npm version patch # or minor / major
|
|
295
|
-
|
|
296
|
-
# 2. prepublishOnly chains: check-secrets → typecheck → rollup (clean + bundle + obfuscate + bundle check)
|
|
297
|
-
npm publish
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
Pre-publish hooks:
|
|
301
|
-
- `check-secrets` — scans for forbidden files (`.env`, `.pem`, `.key`) and provider-prefixed key strings (AWS / OpenAI / SendGrid / Google / GitHub / Slack / private-key blocks).
|
|
302
|
-
- `typecheck` — `tsc --noEmit`.
|
|
303
|
-
- `rollup` — produces `dist/index.js`, `dist/index.cjs`, `dist/index.d.ts`, `dist/styles.css`, then runs `scripts/obfuscate.js` and `scripts/check-bundle.js`.
|
|
304
|
-
|
|
305
|
-
Inspect the publish tarball before pushing:
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
npm pack --dry-run
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
Only the contents of `dist/`, `README.md`, `LICENSE`, and `package.json` ship.
|
|
312
|
-
|
|
313
|
-
## Versioning
|
|
314
|
-
|
|
315
|
-
Strict semver:
|
|
316
|
-
- **PATCH** — bug fixes, no API changes.
|
|
317
|
-
- **MINOR** — additive features, no breakage.
|
|
318
|
-
- **MAJOR** — breaking changes to `<Package />` props or `EditorHandle`.
|
|
319
|
-
|
|
320
300
|
## Author
|
|
321
301
|
|
|
322
302
|
bitbeast private limited
|