@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.
- package/DOCS.md +7 -8
- package/README.md +4 -3
- package/README.md.txt +4 -3
- package/dist/mailcraft-editor.bundle.js +79 -51
- package/dist/mailcraft-editor.bundle.js.map +3 -3
- package/examples/templates/activate-your-account.html +1 -1
- package/examples/templates/back-in-stock.html +1 -1
- package/examples/templates/cart-left-behind.html +1 -1
- package/examples/templates/community-giveaway.html +1 -1
- package/examples/templates/frontend-futures-invite.html +1 -1
- package/examples/templates/give-25-get-25.html +1 -1
- package/examples/templates/invoice-paid.html +1 -1
- package/examples/templates/meet-nova-launch.html +1 -1
- package/examples/templates/mega-weekend-sale.html +1 -1
- package/examples/templates/order-confirmed.html +1 -1
- package/examples/templates/rate-your-headphones.html +1 -1
- package/examples/templates/reset-your-password.html +1 -1
- package/examples/templates/thankyou-promo-code.html +1 -1
- package/examples/templates/the-sunday-brief.html +1 -1
- package/examples/templates/welcome-to-your-workspace.html +1 -1
- package/examples/templates/your-order-shipped.html +1 -1
- package/examples/templates/your-password-was-changed.html +1 -1
- package/examples/templates/your-signin-code.html +1 -1
- package/examples/vanilla.html +27 -25
- package/package.json +1 -1
- package/src/core/binder.js +21 -1
- package/src/core/editor-core.js +12 -2
- package/src/core/export.js +19 -3
- package/src/core/i18n/ar.js +0 -1
- package/src/core/i18n/bg.js +0 -1
- package/src/core/i18n/bn.js +0 -1
- package/src/core/i18n/ca.js +0 -1
- package/src/core/i18n/cs.js +0 -1
- package/src/core/i18n/da.js +0 -1
- package/src/core/i18n/de-CH.js +0 -1
- package/src/core/i18n/de.js +0 -1
- package/src/core/i18n/dz.js +0 -1
- package/src/core/i18n/el.js +0 -1
- package/src/core/i18n/en.js +0 -1
- package/src/core/i18n/es.js +0 -1
- package/src/core/i18n/et.js +0 -1
- package/src/core/i18n/fi.js +0 -1
- package/src/core/i18n/fr.js +0 -1
- package/src/core/i18n/hr.js +0 -1
- package/src/core/i18n/hu.js +0 -1
- package/src/core/i18n/it.js +0 -1
- package/src/core/i18n/lt.js +0 -1
- package/src/core/i18n/lv.js +0 -1
- package/src/core/i18n/nb.js +0 -1
- package/src/core/i18n/nl.js +0 -1
- package/src/core/i18n/pl.js +0 -1
- package/src/core/i18n/pt.js +0 -1
- package/src/core/i18n/ro.js +0 -1
- package/src/core/i18n/ru.js +0 -1
- package/src/core/i18n/sk.js +0 -1
- package/src/core/i18n/sl.js +0 -1
- package/src/core/i18n/sv.js +0 -1
- package/src/core/i18n/tr.js +0 -1
- package/src/core/i18n/uk.js +0 -1
- package/src/core/import-html.js +22 -0
- package/src/core/storage-limits.js +16 -11
- package/src/core/storage.js +1 -1
- package/src/core/theme.js +15 -1
- package/src/mailcraft-editor.js +38 -11
- package/src/render/canvas.js +43 -6
- package/src/render/fields.js +17 -0
- package/src/render/screenshot.js +7 -1
- package/src/render/style.js +36 -8
- package/types/index.d.ts +5 -2
package/src/render/style.js
CHANGED
|
@@ -200,7 +200,7 @@ export const STYLE = `
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
/* Dotted-grid workspace background, shared by the canvas and the preview body. */
|
|
203
|
-
.mc-workspace
|
|
203
|
+
.mc-workspace {
|
|
204
204
|
background-color: var(--ed-work);
|
|
205
205
|
background-image: radial-gradient(circle, var(--ed-grid) 1px, transparent 1.2px);
|
|
206
206
|
background-size: 22px 22px;
|
|
@@ -221,8 +221,12 @@ export const STYLE = `
|
|
|
221
221
|
.mc-sheet-wrap { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
|
|
222
222
|
.mc-workspace [data-mc-sheet="1"] { border: 1px solid var(--ed-line); border-radius: 6px; box-shadow: 0 2px 5px rgba(15,23,42,0.05), 0 14px 38px rgba(15,23,42,0.10); }
|
|
223
223
|
#mc[data-chrome="dark"] .mc-workspace [data-mc-sheet="1"] { border-color: rgba(148,163,184,0.4); box-shadow: 0 0 0 1px rgba(15,23,42,0.4), 0 22px 58px rgba(0,0,0,0.36); }
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
/* The preview body is the *sent* email's page: the theme's own page
|
|
225
|
+
background paints it edge to edge (set inline by renderPreviewModal) and
|
|
226
|
+
the sheet sits flush -- no dotted grid, no padding, no framing. What you
|
|
227
|
+
see is what exportHtml() gives the recipient. */
|
|
228
|
+
.mc-preview-body [data-mc-sheet="1"] { border: 0; border-radius: 0; box-shadow: none; }
|
|
229
|
+
#mc[data-chrome="dark"] .mc-preview-body [data-mc-sheet="1"] { border: 0; box-shadow: none; }
|
|
226
230
|
|
|
227
231
|
/* Final component polish mirrored from the approved standalone editor. */
|
|
228
232
|
#mc { --ed-success: #20a779; --ed-danger: #e05766; }
|
|
@@ -276,8 +280,7 @@ export const STYLE = `
|
|
|
276
280
|
#mc .mc-canvas-stage { padding: 28px 40px 150px !important; }
|
|
277
281
|
#mc .mc-workspace [data-mc-sheet="1"] { border: 1px solid rgba(15,23,42,.10); border-radius: 4px; background: #ffffff; box-shadow: 0 2px 5px rgba(15,23,42,.05), 0 14px 38px rgba(15,23,42,.10) !important; }
|
|
278
282
|
#mc[data-chrome="dark"] .mc-workspace [data-mc-sheet="1"] { border-color: rgba(148,163,184,.46); box-shadow: 0 0 0 1px rgba(15,23,42,.48), 0 22px 58px rgba(0,0,0,.38) !important; }
|
|
279
|
-
#mc .mc-preview-body [data-mc-sheet="1"] { border:
|
|
280
|
-
#mc[data-chrome="dark"] .mc-preview-body [data-mc-sheet="1"] { border-color: rgba(203,213,225,.42); box-shadow: 0 0 0 1px rgba(15,23,42,.65), 0 24px 65px rgba(0,0,0,.40) !important; }
|
|
283
|
+
#mc[data-chrome="dark"] .mc-preview-body [data-mc-sheet="1"] { border: 0; box-shadow: none !important; }
|
|
281
284
|
#mc .mc-inspector { box-shadow: -10px 0 30px rgba(42,47,77,.04); color: var(--ed-panel-label); }
|
|
282
285
|
#mc .mc-tabbar { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 7px 8px 0; gap: 3px; border-bottom: 0 !important; background: var(--ed-panel) !important; overflow: visible; position: relative; z-index: 12; }
|
|
283
286
|
#mc .mc-tabbar button { position: relative; min-width: 0; height: 39px; border-radius: 8px 8px 0 0 !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; font-family: var(--ed-font) !important; }
|
|
@@ -398,12 +401,18 @@ export const STYLE = `
|
|
|
398
401
|
#mc .mc-code-split { gap: 12px; padding: 12px; background: var(--ed-work); }
|
|
399
402
|
#mc .mc-code-source, #mc .mc-code-preview { border: 1px solid var(--ed-line) !important; border-radius: 12px; overflow: hidden; background: var(--ed-panel) !important; }
|
|
400
403
|
#mc .mc-pane-label { padding: 8px 13px !important; background: var(--ed-panel-2) !important; font-size: 9.5px !important; letter-spacing: .025em !important; text-transform: none !important; }
|
|
401
|
-
|
|
402
|
-
|
|
404
|
+
/* The live preview is the email, not a card of it: at full width the frame
|
|
405
|
+
fills the pane and the document's own page background is the only surround.
|
|
406
|
+
Only the 390px phone width gets the mat and the card, where the inset frame
|
|
407
|
+
is what reads as a device. */
|
|
408
|
+
#mc .mc-code-preview-body { padding: 0 !important; background: var(--ed-work); }
|
|
409
|
+
#mc .mc-code-preview-body.is-device { padding: 14px !important; }
|
|
410
|
+
#mc .mc-code-frame { border: 0 !important; border-radius: 0; box-shadow: none !important; }
|
|
411
|
+
#mc .mc-code-preview-body.is-device .mc-code-frame { border-radius: 9px; box-shadow: 0 5px 20px rgba(15,23,42,.10) !important; }
|
|
403
412
|
#mc .mc-code-footer { padding: 8px 16px !important; background: var(--ed-panel); font-family: var(--ed-font) !important; font-size: 9.5px !important; letter-spacing: 0 !important; }
|
|
404
413
|
#mc .mc-preview-panel { grid-template-rows: 58px minmax(0,1fr) !important; }
|
|
405
414
|
#mc .mc-preview-title { font-family: var(--ed-font); font-size: 12px !important; font-weight: 600; }
|
|
406
|
-
#mc .mc-preview-body { padding:
|
|
415
|
+
#mc .mc-preview-body { padding: 0 !important; }
|
|
407
416
|
#mc .mc-toast { border-radius: 10px; box-shadow: 0 12px 34px rgba(16,19,36,.28) !important; }
|
|
408
417
|
#mc[data-chrome="dark"] .mc-shell { box-shadow: 0 24px 70px rgba(0,0,0,.44) !important; }
|
|
409
418
|
#mc[data-chrome="dark"] .mc-header { background: rgba(25,28,41,.88) !important; }
|
|
@@ -457,4 +466,23 @@ export const STYLE = `
|
|
|
457
466
|
/* The inspector inherits the active chrome palette. Keeping theme ownership
|
|
458
467
|
at #mc makes the header, menus, every panel and every field switch together
|
|
459
468
|
when light/dark changes, instead of leaving the side panel permanently dark. */
|
|
469
|
+
|
|
470
|
+
/*
|
|
471
|
+
* The page section (render/canvas.js) -- the full-width area the email sits
|
|
472
|
+
* on, painted from the document's own bg/padY/padX. It only takes the
|
|
473
|
+
* editor's frame once it is actually visible: at the 0 default it hugs the
|
|
474
|
+
* sheet exactly, so the sheet keeps the frame and an untouched canvas is
|
|
475
|
+
* pixel-identical to before. Once there is padding the page becomes the
|
|
476
|
+
* outermost surface and owns the border and lift, and the sheet drops to a
|
|
477
|
+
* small card shadow so its glow does not spill past the page's edge.
|
|
478
|
+
*/
|
|
479
|
+
#mc .mc-page.is-padded { border-radius: 6px; }
|
|
480
|
+
#mc .mc-workspace .mc-page.is-padded { border: 1px solid var(--ed-line); box-shadow: 0 2px 5px rgba(15,23,42,.05), 0 14px 38px rgba(15,23,42,.10); }
|
|
481
|
+
#mc .mc-workspace .mc-page.is-padded [data-mc-sheet="1"] { box-shadow: 0 1px 3px rgba(15,23,42,.12) !important; }
|
|
482
|
+
#mc[data-chrome="dark"] .mc-workspace .mc-page.is-padded { border-color: rgba(148,163,184,.46); box-shadow: 0 0 0 1px rgba(15,23,42,.48), 0 22px 58px rgba(0,0,0,.38); }
|
|
483
|
+
#mc[data-chrome="dark"] .mc-workspace .mc-page.is-padded [data-mc-sheet="1"] { box-shadow: 0 1px 4px rgba(0,0,0,.35) !important; }
|
|
484
|
+
#mc .mc-preview-body .mc-page.is-padded { border: 1px solid rgba(15,23,42,.12); border-radius: 10px; box-shadow: 0 18px 50px rgba(15,23,42,.13); }
|
|
485
|
+
#mc .mc-preview-body .mc-page.is-padded [data-mc-sheet="1"] { box-shadow: 0 1px 3px rgba(15,23,42,.12) !important; }
|
|
486
|
+
#mc[data-chrome="dark"] .mc-preview-body .mc-page.is-padded { border-color: rgba(203,213,225,.42); box-shadow: 0 0 0 1px rgba(15,23,42,.65), 0 24px 65px rgba(0,0,0,.40); }
|
|
487
|
+
#mc[data-chrome="dark"] .mc-preview-body .mc-page.is-padded [data-mc-sheet="1"] { box-shadow: 0 1px 4px rgba(0,0,0,.35) !important; }
|
|
460
488
|
`;
|
package/types/index.d.ts
CHANGED
|
@@ -74,8 +74,11 @@ export interface Asset {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export interface StorageLimits {
|
|
77
|
-
/**
|
|
78
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Allowed MIME types. Omitted or empty means every image type the validator
|
|
79
|
+
* recognizes (SVG still needs `allowSvg`).
|
|
80
|
+
*/
|
|
81
|
+
accept?: string[];
|
|
79
82
|
/** Per-file byte ceiling. Required. */
|
|
80
83
|
maxBytes: number;
|
|
81
84
|
maxWidth?: number;
|