@seliseblocks/mailcraft 0.2.9 → 0.2.11
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/CHANGELOG.md +45 -0
- package/DOCS.md +5 -5
- package/README.md +3 -0
- package/README.md.txt +3 -0
- package/dist/mailcraft-editor.bundle.js +75 -60
- package/dist/mailcraft-editor.bundle.js.map +3 -3
- package/package.json +2 -2
- package/src/core/blocks.js +30 -11
- package/src/core/css-cascade.js +120 -117
- package/src/core/editor-core.js +74 -27
- package/src/core/export.js +83 -10
- package/src/core/i18n/index.js +83 -83
- package/src/core/icons.js +0 -1
- package/src/core/ids.js +1 -1
- package/src/core/import-html.js +604 -48
- package/src/core/layout-style.js +100 -100
- package/src/core/parse.js +10 -10
- package/src/core/placeholder.js +15 -15
- package/src/core/sanitize.js +11 -1
- package/src/core/variables.js +11 -11
- package/src/mailcraft-editor.js +25 -2
- package/src/render/block-body.js +17 -5
- package/src/render/canvas.js +14 -0
- package/src/render/focus-preserve.js +158 -158
- package/src/render/story.js +415 -415
- package/src/render/style.js +7 -0
- package/types/index.d.ts +10 -3
package/src/render/style.js
CHANGED
|
@@ -98,6 +98,13 @@ export const STYLE = `
|
|
|
98
98
|
#mc ::selection { background: var(--ed-select); }
|
|
99
99
|
#mc a { color: var(--ed-accent); }
|
|
100
100
|
#mc a:hover { color: var(--ed-accent); opacity: 0.72; }
|
|
101
|
+
/* Content links are the document's, not the chrome's: inside the sheet the
|
|
102
|
+
accent rule above painted every anchor in the HOST's brand color, which is
|
|
103
|
+
why the theme's own Link color setting never did anything visible. The
|
|
104
|
+
variable is set per render on the sheet root (render/canvas.js); anchors
|
|
105
|
+
with their own inline color keep it, exactly as in the sent mail. */
|
|
106
|
+
#mc [data-mc-sheet] a { color: var(--mc-link, var(--ed-accent)); }
|
|
107
|
+
#mc [data-mc-sheet] a:hover { color: var(--mc-link, var(--ed-accent)); opacity: 1; }
|
|
101
108
|
@keyframes mcIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
|
|
102
109
|
@keyframes mcFade { from { opacity: 0; } to { opacity: 1; } }
|
|
103
110
|
@keyframes mcPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
|
package/types/index.d.ts
CHANGED
|
@@ -272,8 +272,15 @@ export class MailCraftEditor extends HTMLElement {
|
|
|
272
272
|
/** Merged over `storageProvider.limits` per key, this side winning. */
|
|
273
273
|
storageLimits: StorageLimits | null;
|
|
274
274
|
|
|
275
|
-
/**
|
|
276
|
-
|
|
275
|
+
/**
|
|
276
|
+
* Send-ready email HTML — valid input to the importer, so saving the export
|
|
277
|
+
* is saving the work. `{ markers: false }` omits the fidelity-marker
|
|
278
|
+
* attributes (`data-mc*`, the inert `mc-keep` class) for hosts that want
|
|
279
|
+
* pristine HTML, at the price of a lossy reload for the few blocks whose
|
|
280
|
+
* rendered shape cannot be read back (countdown, video, section box, code,
|
|
281
|
+
* raw CSS, flex/grid rows).
|
|
282
|
+
*/
|
|
283
|
+
exportHtml(options?: { markers?: boolean }): string;
|
|
277
284
|
|
|
278
285
|
/** Parses email HTML back onto the canvas. Returns the number of rows produced. */
|
|
279
286
|
importHtml(html: string): number;
|
|
@@ -365,7 +372,7 @@ export interface EditorHandle {
|
|
|
365
372
|
element: MailCraftEditor;
|
|
366
373
|
/** Removes the editor and detaches the listeners this call attached. */
|
|
367
374
|
destroy(): void;
|
|
368
|
-
exportHtml(): string;
|
|
375
|
+
exportHtml(options?: { markers?: boolean }): string;
|
|
369
376
|
importHtml(html: string): number;
|
|
370
377
|
loadTemplate(tpl: Template): void;
|
|
371
378
|
undo(): void;
|