@seliseblocks/mailcraft 0.2.0 → 0.2.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.
Files changed (69) hide show
  1. package/DOCS.md +7 -8
  2. package/README.md +4 -3
  3. package/README.md.txt +4 -3
  4. package/dist/mailcraft-editor.bundle.js +79 -51
  5. package/dist/mailcraft-editor.bundle.js.map +3 -3
  6. package/examples/templates/activate-your-account.html +1 -1
  7. package/examples/templates/back-in-stock.html +1 -1
  8. package/examples/templates/cart-left-behind.html +1 -1
  9. package/examples/templates/community-giveaway.html +1 -1
  10. package/examples/templates/frontend-futures-invite.html +1 -1
  11. package/examples/templates/give-25-get-25.html +1 -1
  12. package/examples/templates/invoice-paid.html +1 -1
  13. package/examples/templates/meet-nova-launch.html +1 -1
  14. package/examples/templates/mega-weekend-sale.html +1 -1
  15. package/examples/templates/order-confirmed.html +1 -1
  16. package/examples/templates/rate-your-headphones.html +1 -1
  17. package/examples/templates/reset-your-password.html +1 -1
  18. package/examples/templates/thankyou-promo-code.html +1 -1
  19. package/examples/templates/the-sunday-brief.html +1 -1
  20. package/examples/templates/welcome-to-your-workspace.html +1 -1
  21. package/examples/templates/your-order-shipped.html +1 -1
  22. package/examples/templates/your-password-was-changed.html +1 -1
  23. package/examples/templates/your-signin-code.html +1 -1
  24. package/examples/vanilla.html +27 -25
  25. package/package.json +1 -1
  26. package/src/core/binder.js +21 -1
  27. package/src/core/editor-core.js +12 -2
  28. package/src/core/export.js +19 -3
  29. package/src/core/i18n/ar.js +0 -1
  30. package/src/core/i18n/bg.js +0 -1
  31. package/src/core/i18n/bn.js +0 -1
  32. package/src/core/i18n/ca.js +0 -1
  33. package/src/core/i18n/cs.js +0 -1
  34. package/src/core/i18n/da.js +0 -1
  35. package/src/core/i18n/de-CH.js +0 -1
  36. package/src/core/i18n/de.js +0 -1
  37. package/src/core/i18n/dz.js +0 -1
  38. package/src/core/i18n/el.js +0 -1
  39. package/src/core/i18n/en.js +0 -1
  40. package/src/core/i18n/es.js +0 -1
  41. package/src/core/i18n/et.js +0 -1
  42. package/src/core/i18n/fi.js +0 -1
  43. package/src/core/i18n/fr.js +0 -1
  44. package/src/core/i18n/hr.js +0 -1
  45. package/src/core/i18n/hu.js +0 -1
  46. package/src/core/i18n/it.js +0 -1
  47. package/src/core/i18n/lt.js +0 -1
  48. package/src/core/i18n/lv.js +0 -1
  49. package/src/core/i18n/nb.js +0 -1
  50. package/src/core/i18n/nl.js +0 -1
  51. package/src/core/i18n/pl.js +0 -1
  52. package/src/core/i18n/pt.js +0 -1
  53. package/src/core/i18n/ro.js +0 -1
  54. package/src/core/i18n/ru.js +0 -1
  55. package/src/core/i18n/sk.js +0 -1
  56. package/src/core/i18n/sl.js +0 -1
  57. package/src/core/i18n/sv.js +0 -1
  58. package/src/core/i18n/tr.js +0 -1
  59. package/src/core/i18n/uk.js +0 -1
  60. package/src/core/import-html.js +22 -0
  61. package/src/core/storage-limits.js +16 -11
  62. package/src/core/storage.js +1 -1
  63. package/src/core/theme.js +15 -1
  64. package/src/mailcraft-editor.js +38 -11
  65. package/src/render/canvas.js +43 -6
  66. package/src/render/fields.js +17 -0
  67. package/src/render/screenshot.js +7 -1
  68. package/src/render/style.js +36 -8
  69. package/types/index.d.ts +5 -2
package/DOCS.md CHANGED
@@ -84,11 +84,11 @@ You write those functions next to the auth and base URL you already own, and poi
84
84
 
85
85
  The same applies to AI (`.aiProvider` is one `async (prompt) => text` function) and to social icons (`.iconProvider`).
86
86
 
87
- ### 3. Upload policy belongs to the host
87
+ ### 3. Upload policy belongs to the host — formats excepted
88
88
 
89
- The package ships **no default limits**. What an email may carry depends on the sending platform's caps, the audience's mail clients, and the host's own product rules — none of which this package can know.
89
+ Sizes and counts ship undefaulted: what an email may carry depends on the sending platform's caps and the host's own product rules — none of which this package can know. With a provider wired and no `maxBytes` declared, uploads are refused rather than waved through.
90
90
 
91
- With a provider wired and no limits declared, uploads are refused rather than waved through. Silently accepting anything is the exact failure the limits exist to prevent.
91
+ Formats are the one default: **every image type is allowed** — JPEG, PNG, GIF, WebP, BMP, TIFF, ICO, AVIF, HEIC unless `accept` lists a narrower set. SVG keeps its own gate below.
92
92
 
93
93
  Two supporting details:
94
94
 
@@ -269,12 +269,12 @@ A start marker's expression field suggests the host's `variables` in a dropdown
269
269
 
270
270
  ## Image uploads
271
271
 
272
- Both properties are required. The package ships no files of its own: with no provider the library opens empty and holds only what is dropped into it — data URIs, kept in the local draft, which no email client renders. With a provider but no limits every upload is refused.
272
+ A provider and a `maxBytes` ceiling are both required. The package ships no files of its own: with no provider the library opens empty and holds only what is dropped into it — data URIs, kept in the local draft, which no email client renders. With a provider but no `maxBytes` every upload is refused.
273
273
 
274
274
  ```js
275
275
  editor.storageLimits = {
276
- accept: ['image/jpeg', 'image/png', 'image/gif'],
277
276
  maxBytes: 2 * 1024 * 1024,
277
+ accept: ['image/jpeg', 'image/png', 'image/gif'], // optional: omit to allow every image type
278
278
  maxWidth: 1600, maxHeight: 1600, // optional
279
279
  maxFilesPerDrop: 20, // optional
280
280
  allowSvg: false, // SVG needs this AND a place in `accept`
@@ -316,7 +316,7 @@ A provider may also carry its own `limits` object, for a backend that knows its
316
316
  editor.storageProvider = { list, upload, limits: { accept: [...], maxBytes: 5e6 } };
317
317
  ```
318
318
 
319
- The two are merged **per key**, with `editor.storageLimits` winning — so a provider can ship sane defaults and the host can still tighten one number without restating the rest. Either source satisfies the "limits are required" rule; only a file that passes the merged result reaches `upload`.
319
+ The two are merged **per key**, with `editor.storageLimits` winning — so a provider can ship sane defaults and the host can still tighten one number without restating the rest. Either source satisfies the "`maxBytes` is required" rule; only a file that passes the merged result reaches `upload`.
320
320
 
321
321
  Setting `editor.storageProvider = null` drops back to that empty local library.
322
322
 
@@ -509,7 +509,7 @@ template, not to your app.
509
509
  | `.accent` | string |
510
510
  | `.messages` | `{ key: string }` |
511
511
  | `.storageProvider` | `{ list, upload, folders?, remove?, limits? }` — `null` drops back to the empty local library |
512
- | `.storageLimits` | `{ accept, maxBytes, maxWidth?, maxHeight?, maxFilesPerDrop?, allowSvg? }`, merged over `provider.limits` per key |
512
+ | `.storageLimits` | `{ accept?, maxBytes, maxWidth?, maxHeight?, maxFilesPerDrop?, allowSvg? }`, merged over `provider.limits` per key |
513
513
  | `.aiProvider` | `async (prompt) => text` |
514
514
  | `.iconProvider` | `(platformKey, { label, size, color }) => Node` — social-icon override; falls back to the built-in icon when it is unset, throws, or returns a non-node |
515
515
 
@@ -686,7 +686,6 @@ The complete catalog of UI strings that `.messages` accepts — every key the ed
686
686
  | `storage.errDimensions` | {name} is {w}×{ht}px — the limit is {maxW}×{maxH}px. |
687
687
  | `storage.errFormat` | {name} is a {type} file, which is not allowed here. |
688
688
  | `storage.errLoadFailed` | The file library could not be loaded — {reason} |
689
- | `storage.errNoAccept` | Uploads are switched off: no file formats have been allowed. |
690
689
  | `storage.errNoLimits` | Uploads are switched off: this app has not set any upload limits. |
691
690
  | `storage.errNoMaxBytes` | Uploads are switched off: no maximum file size has been set. |
692
691
  | `storage.errSvg` | {name} is an SVG, which this app does not accept. |
package/README.md CHANGED
@@ -102,9 +102,10 @@ KEYS Bound on window, so they survive toolbar="none":
102
102
  Ctrl/Cmd+E (export dialog), Ctrl/Cmd+K (link, while editing),
103
103
  Ctrl/Cmd+D (duplicate), Backspace|Delete (delete selection).
104
104
 
105
- UPLOADS Limits and a provider are both required, or every upload is refused.
106
- editor.storageLimits = { accept:['image/jpeg','image/png','image/gif'],
107
- maxBytes: 2*1024*1024 }
105
+ UPLOADS A provider plus `maxBytes` are required, or every upload is refused;
106
+ every image type is allowed unless `accept` narrows it.
107
+ editor.storageLimits = { maxBytes: 2*1024*1024,
108
+ accept:['image/jpeg','image/png'] } // accept optional
108
109
  editor.storageProvider = { list(q), upload(file, o), folders?(), remove?(a),
109
110
  limits? }
110
111
  provider.limits is merged per key under .storageLimits, and satisfies
package/README.md.txt CHANGED
@@ -102,9 +102,10 @@ KEYS Bound on window, so they survive toolbar="none":
102
102
  Ctrl/Cmd+E (export dialog), Ctrl/Cmd+K (link, while editing),
103
103
  Ctrl/Cmd+D (duplicate), Backspace|Delete (delete selection).
104
104
 
105
- UPLOADS Limits and a provider are both required, or every upload is refused.
106
- editor.storageLimits = { accept:['image/jpeg','image/png','image/gif'],
107
- maxBytes: 2*1024*1024 }
105
+ UPLOADS A provider plus `maxBytes` are required, or every upload is refused;
106
+ every image type is allowed unless `accept` narrows it.
107
+ editor.storageLimits = { maxBytes: 2*1024*1024,
108
+ accept:['image/jpeg','image/png'] } // accept optional
108
109
  editor.storageProvider = { list(q), upload(file, o), folders?(), remove?(a),
109
110
  limits? }
110
111
  provider.limits is merged per key under .storageLimits, and satisfies