@emabuild/core 0.1.2 → 0.1.4

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.
@@ -329,8 +329,8 @@ class wt {
329
329
  const n = structuredClone(o), i = this.counterManager.next("u_row");
330
330
  n.id = `u_row_${i}`, n.values._meta = { htmlID: n.id, htmlClassNames: "u_row" };
331
331
  for (const r of n.columns) {
332
- const a = this.counterManager.next("u_column");
333
- r.id = `u_column_${a}`, r.values._meta = { htmlID: r.id, htmlClassNames: "u_column" };
332
+ const l = this.counterManager.next("u_column");
333
+ r.id = `u_column_${l}`, r.values._meta = { htmlID: r.id, htmlClassNames: "u_column" };
334
334
  for (const d of r.contents) {
335
335
  const c = this.counterManager.next(`u_content_${d.type}`);
336
336
  d.id = `u_content_${d.type}_${c}`, d.values._meta = { htmlID: d.id, htmlClassNames: `u_content_${d.type}` };
@@ -385,10 +385,10 @@ class wt {
385
385
  if (!i) return;
386
386
  this.history.push(this.design);
387
387
  for (const r of this.design.body.rows)
388
- for (const a of r.columns) {
389
- const d = a.contents.findIndex((c) => c.id === t);
388
+ for (const l of r.columns) {
389
+ const d = l.contents.findIndex((c) => c.id === t);
390
390
  if (d !== -1) {
391
- a.contents.splice(d, 1);
391
+ l.contents.splice(d, 1);
392
392
  break;
393
393
  }
394
394
  }
@@ -404,8 +404,8 @@ class wt {
404
404
  const s = i.contents.findIndex((r) => r.id === t);
405
405
  if (s !== -1) {
406
406
  this.history.push(this.design);
407
- const r = structuredClone(o), a = this.counterManager.next(`u_content_${o.type}`);
408
- r.id = `u_content_${o.type}_${a}`, r.values._meta = { htmlID: r.id, htmlClassNames: `u_content_${o.type}` }, i.contents.splice(s + 1, 0, r), this.syncCounters(), this.notifyChannels("design"), this.emitUpdate("content_added", r);
407
+ const r = structuredClone(o), l = this.counterManager.next(`u_content_${o.type}`);
408
+ r.id = `u_content_${o.type}_${l}`, r.values._meta = { htmlID: r.id, htmlClassNames: `u_content_${o.type}` }, i.contents.splice(s + 1, 0, r), this.syncCounters(), this.notifyChannels("design"), this.emitUpdate("content_added", r);
409
409
  return;
410
410
  }
411
411
  }
@@ -535,7 +535,7 @@ class vt {
535
535
  return this.tools.get(t)?.options ?? {};
536
536
  }
537
537
  }
538
- const z = {
538
+ const L = {
539
539
  /** ID of the content currently being dragged (null if not dragging content) */
540
540
  draggingContentId: null,
541
541
  startContentDrag(e) {
@@ -563,10 +563,10 @@ function Z(e) {
563
563
  function tt(e, t, o, n, i = "4px") {
564
564
  e.parentNode !== t && (e.remove(), t.appendChild(e));
565
565
  const r = (t instanceof ShadowRoot ? t.host : t).getBoundingClientRect();
566
- let a;
567
- o.length === 0 || n === 0 ? a = o.length === 0 ? 0 : o[0].getBoundingClientRect().top - r.top : n >= o.length ? a = o[o.length - 1].getBoundingClientRect().bottom - r.top : a = o[n].getBoundingClientRect().top - r.top, Object.assign(e.style, {
566
+ let l;
567
+ o.length === 0 || n === 0 ? l = o.length === 0 ? 0 : o[0].getBoundingClientRect().top - r.top : n >= o.length ? l = o[o.length - 1].getBoundingClientRect().bottom - r.top : l = o[n].getBoundingClientRect().top - r.top, Object.assign(e.style, {
568
568
  display: "block",
569
- top: `${a}px`,
569
+ top: `${l}px`,
570
570
  left: i,
571
571
  right: i,
572
572
  width: "auto"
@@ -591,8 +591,8 @@ function et(e, t) {
591
591
  class $t {
592
592
  constructor(t, o, n) {
593
593
  this.currentDrop = null, this.contentIndicator = null, this.rowIndicator = null, this.onDragOver = (i) => {
594
- const s = i.dataTransfer?.types || [], r = s.includes("application/maileditor-tool"), a = s.includes("application/maileditor-layout"), d = s.includes("application/maileditor-content") || !!z.draggingContentId;
595
- !r && !d && !a || (i.preventDefault(), i.dataTransfer.dropEffect = r || a ? "copy" : "move", a ? (this.currentDrop = this.findRowDropTarget(i.clientY), I(this.contentIndicator), this.showRowIndicator()) : (this.currentDrop = this.findContentDropTarget(i.clientX, i.clientY), I(this.rowIndicator), this.showContentIndicator()));
594
+ const s = i.dataTransfer?.types || [], r = s.includes("application/maileditor-tool"), l = s.includes("application/maileditor-layout"), d = s.includes("application/maileditor-content") || !!L.draggingContentId;
595
+ !r && !d && !l || (i.preventDefault(), i.dataTransfer.dropEffect = r || l ? "copy" : "move", l ? (this.currentDrop = this.findRowDropTarget(i.clientY), I(this.contentIndicator), this.showRowIndicator()) : (this.currentDrop = this.findContentDropTarget(i.clientX, i.clientY), I(this.rowIndicator), this.showContentIndicator()));
596
596
  }, this.onDrop = (i) => {
597
597
  i.preventDefault(), this.hideAllIndicators();
598
598
  const s = this.currentDrop, r = i.dataTransfer?.getData("application/maileditor-layout");
@@ -600,12 +600,12 @@ class $t {
600
600
  this.handleLayoutDrop(JSON.parse(r), s), this.reset();
601
601
  return;
602
602
  }
603
- const a = i.dataTransfer?.getData("application/maileditor-tool");
604
- if (a) {
605
- this.handleToolDrop(a, s), this.reset();
603
+ const l = i.dataTransfer?.getData("application/maileditor-tool");
604
+ if (l) {
605
+ this.handleToolDrop(l, s), this.reset();
606
606
  return;
607
607
  }
608
- const d = i.dataTransfer?.getData("application/maileditor-content") || z.draggingContentId;
608
+ const d = i.dataTransfer?.getData("application/maileditor-content") || L.draggingContentId;
609
609
  d && this.handleContentDrop(d, s), this.reset();
610
610
  }, this.onDragEnd = () => {
611
611
  this.hideAllIndicators(), this.reset();
@@ -649,8 +649,8 @@ class $t {
649
649
  if (n.length === 0) return { type: "row", rowIndex: 0, y: 0 };
650
650
  let i = Math.abs(t - n[0].getBoundingClientRect().top), s = { type: "row", rowIndex: 0, y: n[0].getBoundingClientRect().top };
651
651
  for (let r = 0; r < n.length; r++) {
652
- const a = n[r].getBoundingClientRect().bottom, d = Math.abs(t - a);
653
- d < i && (i = d, s = { type: "row", rowIndex: r + 1, y: a });
652
+ const l = n[r].getBoundingClientRect().bottom, d = Math.abs(t - l);
653
+ d < i && (i = d, s = { type: "row", rowIndex: r + 1, y: l });
654
654
  }
655
655
  return s;
656
656
  }
@@ -658,22 +658,22 @@ class $t {
658
658
  const n = et(this.root, "me-column-renderer");
659
659
  let i = null, s = 1 / 0;
660
660
  for (const r of n) {
661
- const a = r.dataset.columnId;
662
- if (!a || !r.shadowRoot) continue;
661
+ const l = r.dataset.columnId;
662
+ if (!l || !r.shadowRoot) continue;
663
663
  const d = r.getBoundingClientRect();
664
664
  if (t < d.left || t > d.right) continue;
665
665
  const c = Array.from(r.shadowRoot.querySelectorAll("me-content-renderer"));
666
666
  if (c.length === 0) {
667
667
  const u = Math.abs(o - (d.top + d.height / 2));
668
- u < s && (s = u, i = { type: "content", columnId: a, contentIndex: 0, y: d.top + d.height / 2 });
668
+ u < s && (s = u, i = { type: "content", columnId: l, contentIndex: 0, y: d.top + d.height / 2 });
669
669
  continue;
670
670
  }
671
671
  const h = c[0].getBoundingClientRect().top;
672
672
  let g = Math.abs(o - h);
673
- g < s && (s = g, i = { type: "content", columnId: a, contentIndex: 0, y: h });
673
+ g < s && (s = g, i = { type: "content", columnId: l, contentIndex: 0, y: h });
674
674
  for (let u = 0; u < c.length; u++) {
675
675
  const f = c[u].getBoundingClientRect(), y = c[u + 1]?.getBoundingClientRect(), x = y ? (f.bottom + y.top) / 2 : f.bottom;
676
- g = Math.abs(o - x), g < s && (s = g, i = { type: "content", columnId: a, contentIndex: u + 1, y: x });
676
+ g = Math.abs(o - x), g < s && (s = g, i = { type: "content", columnId: l, contentIndex: u + 1, y: x });
677
677
  }
678
678
  }
679
679
  return i;
@@ -703,10 +703,10 @@ class $t {
703
703
  I(this.contentIndicator), I(this.rowIndicator);
704
704
  }
705
705
  reset() {
706
- this.currentDrop = null, z.reset();
706
+ this.currentDrop = null, L.reset();
707
707
  }
708
708
  }
709
- function l(e, t, o = "") {
709
+ function a(e, t, o = "") {
710
710
  const n = e[t];
711
711
  return typeof n == "string" && n !== "" ? n : typeof n == "number" ? String(n) : o;
712
712
  }
@@ -733,8 +733,8 @@ function kt(e) {
733
733
  };
734
734
  }
735
735
  return {
736
- href: l(e, "href"),
737
- target: l(e, "target", "_blank")
736
+ href: a(e, "href"),
737
+ target: a(e, "target", "_blank")
738
738
  };
739
739
  }
740
740
  function it(e, t = "") {
@@ -743,9 +743,9 @@ function it(e, t = "") {
743
743
  const n = e.textJson;
744
744
  if (typeof n == "string")
745
745
  try {
746
- const i = JSON.parse(n), s = [], r = (a) => {
747
- typeof a.text == "string" && s.push(a.text), a.type === "linebreak" && s.push("<br/>");
748
- const d = a.children;
746
+ const i = JSON.parse(n), s = [], r = (l) => {
747
+ typeof l.text == "string" && s.push(l.text), l.type === "linebreak" && s.push("<br/>");
748
+ const d = l.children;
749
749
  d && d.forEach(r);
750
750
  };
751
751
  if (r(i.root || i), s.length > 0) return s.join("");
@@ -761,8 +761,8 @@ function Y(e, t = "arial,helvetica,sans-serif") {
761
761
  if (s && typeof document < "u") {
762
762
  const r = `emabuild-font-${i.replace(/[^a-z]/gi, "")}`;
763
763
  if (!document.getElementById(r)) {
764
- const a = document.createElement("link");
765
- a.id = r, a.rel = "stylesheet", a.href = s, document.head.appendChild(a);
764
+ const l = document.createElement("link");
765
+ l.id = r, l.rel = "stylesheet", l.href = s, document.head.appendChild(l);
766
766
  }
767
767
  }
768
768
  return i;
@@ -777,7 +777,7 @@ function me(e, t) {
777
777
  return t;
778
778
  }
779
779
  }
780
- function L(e, t) {
780
+ function z(e, t) {
781
781
  const { padding: o, align: n = "left", extraTdStyle: i = "" } = t;
782
782
  return `<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
783
783
  <tbody><tr><td style="${`padding:${o};font-family:arial,helvetica,sans-serif;${i}`}" align="${n}">
@@ -786,7 +786,7 @@ function L(e, t) {
786
786
  </table>`;
787
787
  }
788
788
  function Ct(e, t, o) {
789
- const { bgColor: n, textColor: i, fontSize: s, fontWeight: r, borderRadius: a } = o, d = parseInt(a) || 0;
789
+ const { bgColor: n, textColor: i, fontSize: s, fontWeight: r, borderRadius: l } = o, d = parseInt(l) || 0;
790
790
  if (d <= 0) return "";
791
791
  const c = Math.round(d / 20 * 100);
792
792
  return `<!--[if mso]>
@@ -859,7 +859,7 @@ const _t = {
859
859
  },
860
860
  renderer: {
861
861
  renderEditor(e) {
862
- const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor", "transparent"), n = l(e, "color", "inherit"), i = l(e, "lineHeight", "140%"), s = Y(e), r = l(e, "text");
862
+ const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "transparent"), n = a(e, "color", "inherit"), i = a(e, "lineHeight", "140%"), s = Y(e), r = a(e, "text");
863
863
  return p`
864
864
  <div style="padding:${t};background-color:${o};color:${n};line-height:${i};font-family:${s};word-break:break-word;">
865
865
  ${U(r)}
@@ -867,8 +867,8 @@ const _t = {
867
867
  `;
868
868
  },
869
869
  renderHtml(e) {
870
- const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor"), n = l(e, "color", "#000000"), i = l(e, "lineHeight", "140%"), s = l(e, "textAlign", "left"), r = l(e, "text"), a = o ? `background-color:${o};` : "", d = `<div style="font-size:14px;color:${n};line-height:${i};text-align:${s};">${r}</div>`;
871
- return L(d, { padding: t, extraTdStyle: a });
870
+ const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor"), n = a(e, "color", "#000000"), i = a(e, "lineHeight", "140%"), s = a(e, "textAlign", "left"), r = a(e, "text"), l = o ? `background-color:${o};` : "", d = `<div style="font-size:14px;color:${n};line-height:${i};text-align:${s};">${r}</div>`;
871
+ return z(d, { padding: t, extraTdStyle: l });
872
872
  }
873
873
  }
874
874
  }, Dt = {
@@ -973,16 +973,16 @@ const _t = {
973
973
  },
974
974
  renderer: {
975
975
  renderEditor(e) {
976
- const t = l(e, "containerPadding", "10px"), o = l(e, "fontSize", "22px"), n = l(e, "color", "#000000"), i = l(e, "textAlign", "left"), s = l(e, "fontWeight", "700"), r = l(e, "lineHeight", "140%"), a = Y(e), d = it(e, "Heading");
976
+ const t = a(e, "containerPadding", "10px"), o = a(e, "fontSize", "22px"), n = a(e, "color", "#000000"), i = a(e, "textAlign", "left"), s = a(e, "fontWeight", "700"), r = a(e, "lineHeight", "140%"), l = Y(e), d = it(e, "Heading");
977
977
  return p`
978
- <div style="padding:${t};font-size:${o};color:${n};text-align:${i};font-weight:${s};line-height:${r};font-family:${a};">
978
+ <div style="padding:${t};font-size:${o};color:${n};text-align:${i};font-weight:${s};line-height:${r};font-family:${l};">
979
979
  ${U(d)}
980
980
  </div>
981
981
  `;
982
982
  },
983
983
  renderHtml(e) {
984
- const t = l(e, "containerPadding", "10px"), o = l(e, "fontSize", "22px"), n = l(e, "color", "#000000"), i = l(e, "textAlign", "left"), s = l(e, "fontWeight", "700"), r = l(e, "lineHeight", "140%"), a = l(e, "letterSpacing", "normal"), d = Y(e), c = l(e, "headingType", "h1"), h = it(e, "Heading"), g = `<${c} style="margin:0;font-size:${o};color:${n};text-align:${i};font-weight:${s};line-height:${r};letter-spacing:${a};font-family:${d};">${h}</${c}>`;
985
- return L(g, { padding: t });
984
+ const t = a(e, "containerPadding", "10px"), o = a(e, "fontSize", "22px"), n = a(e, "color", "#000000"), i = a(e, "textAlign", "left"), s = a(e, "fontWeight", "700"), r = a(e, "lineHeight", "140%"), l = a(e, "letterSpacing", "normal"), d = Y(e), c = a(e, "headingType", "h1"), h = it(e, "Heading"), g = `<${c} style="margin:0;font-size:${o};color:${n};text-align:${i};font-weight:${s};line-height:${r};letter-spacing:${l};font-family:${d};">${h}</${c}>`;
985
+ return z(g, { padding: t });
986
986
  }
987
987
  }
988
988
  }, St = {
@@ -1028,12 +1028,12 @@ const _t = {
1028
1028
  },
1029
1029
  renderer: {
1030
1030
  renderEditor(e) {
1031
- const t = l(e, "containerPadding", "10px"), o = l(e, "color", "#374151"), n = l(e, "lineHeight", "160%");
1032
- return p`<div style="padding:${t};color:${o};line-height:${n};word-break:break-word;">${U(l(e, "text"))}</div>`;
1031
+ const t = a(e, "containerPadding", "10px"), o = a(e, "color", "#374151"), n = a(e, "lineHeight", "160%");
1032
+ return p`<div style="padding:${t};color:${o};line-height:${n};word-break:break-word;">${U(a(e, "text"))}</div>`;
1033
1033
  },
1034
1034
  renderHtml(e) {
1035
- const t = l(e, "containerPadding", "10px"), o = l(e, "color", "#374151"), n = l(e, "lineHeight", "160%"), i = l(e, "textAlign", "left"), s = l(e, "letterSpacing", "normal"), r = `<div style="font-size:14px;color:${o};line-height:${n};text-align:${i};letter-spacing:${s};word-wrap:break-word;">${l(e, "text")}</div>`;
1036
- return L(r, { padding: t });
1035
+ const t = a(e, "containerPadding", "10px"), o = a(e, "color", "#374151"), n = a(e, "lineHeight", "160%"), i = a(e, "textAlign", "left"), s = a(e, "letterSpacing", "normal"), r = `<div style="font-size:14px;color:${o};line-height:${n};text-align:${i};letter-spacing:${s};word-wrap:break-word;">${a(e, "text")}</div>`;
1036
+ return z(r, { padding: t });
1037
1037
  }
1038
1038
  }
1039
1039
  }, Rt = {
@@ -1097,15 +1097,15 @@ const _t = {
1097
1097
  },
1098
1098
  renderer: {
1099
1099
  renderEditor(e) {
1100
- const t = l(e, "containerPadding", "10px"), o = ot(e.src), n = l(e, "alt"), s = nt(e.src).maxWidth || l(e, "width", "100%"), r = l(e, "borderRadius", "0px"), a = l(e, "textAlign", l(e, "align", "center"));
1101
- return o ? p`<div style="padding:${t};text-align:${a};"><img src=${o} alt=${n} style="display:inline-block;max-width:100%;width:${s};border-radius:${r};border:0;" /></div>` : p`<div style="padding:${t};text-align:${a};"><div style="background:#f1f5f9;border:2px dashed #cbd5e1;border-radius:8px;padding:40px 20px;text-align:center;color:#94a3b8;font-size:13px;">No image set. Enter a URL in the property panel.</div></div>`;
1100
+ const t = a(e, "containerPadding", "10px"), o = ot(e.src), n = a(e, "alt"), s = nt(e.src).maxWidth || a(e, "width", "100%"), r = a(e, "borderRadius", "0px"), l = a(e, "textAlign", a(e, "align", "center"));
1101
+ return o ? p`<div style="padding:${t};text-align:${l};"><img src=${o} alt=${n} style="display:inline-block;max-width:100%;width:${s};border-radius:${r};border:0;" /></div>` : p`<div style="padding:${t};text-align:${l};"><div style="background:#f1f5f9;border:2px dashed #cbd5e1;border-radius:8px;padding:40px 20px;text-align:center;color:#94a3b8;font-size:13px;">No image set. Enter a URL in the property panel.</div></div>`;
1102
1102
  },
1103
1103
  renderHtml(e, t) {
1104
- const o = l(e, "containerPadding", "10px"), n = ot(e.src), i = l(e, "alt"), s = kt(e), r = nt(e.src), a = r.maxWidth || l(e, "width", "100%"), d = l(e, "borderRadius", "0px"), c = l(e, "textAlign", l(e, "align", "center"));
1104
+ const o = a(e, "containerPadding", "10px"), n = ot(e.src), i = a(e, "alt"), s = kt(e), r = nt(e.src), l = r.maxWidth || a(e, "width", "100%"), d = a(e, "borderRadius", "0px"), c = a(e, "textAlign", a(e, "align", "center"));
1105
1105
  let h;
1106
- a.includes("%") ? h = Math.round(t.columnWidth * (parseFloat(a) / 100)) : a === "auto" ? h = r.width || t.columnWidth : h = parseInt(a) || t.columnWidth;
1106
+ l.includes("%") ? h = Math.round(t.columnWidth * (parseFloat(l) / 100)) : l === "auto" ? h = r.width || t.columnWidth : h = parseInt(l) || t.columnWidth;
1107
1107
  const g = d !== "0px" ? `border-radius:${d};` : "", u = `<img align="${c}" border="0" src="${n}" alt="${i}" title="${i}" style="display:block;border:0;height:auto;width:100%;max-width:${h}px;${g}" width="${h}" />`, f = s.href ? `<a href="${s.href}" target="${s.target}" style="text-decoration:none;">${u}</a>` : u;
1108
- return L(f, { padding: o, align: c });
1108
+ return z(f, { padding: o, align: c });
1109
1109
  }
1110
1110
  }
1111
1111
  }, Tt = {
@@ -1195,21 +1195,21 @@ const _t = {
1195
1195
  },
1196
1196
  renderer: {
1197
1197
  renderEditor(e) {
1198
- const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor", "#3b82f6"), n = l(e, "textColor", "#ffffff"), i = l(e, "fontSize", "14px"), s = l(e, "fontWeight", "700"), r = l(e, "borderRadius", "4px"), a = l(e, "buttonPadding", "10px 20px"), d = l(e, "text", "Click Me"), c = l(e, "textAlign", "center"), h = l(e, "buttonWidth", "auto"), g = l(e, "borderWidth", "0px"), u = l(e, "borderColor", o), f = g !== "0px" ? `border:${g} solid ${u};` : "border:none;", y = h === "auto" ? "display:inline-block;" : `display:block;width:${h};`;
1198
+ const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "#3b82f6"), n = a(e, "textColor", "#ffffff"), i = a(e, "fontSize", "14px"), s = a(e, "fontWeight", "700"), r = a(e, "borderRadius", "4px"), l = a(e, "buttonPadding", "10px 20px"), d = a(e, "text", "Click Me"), c = a(e, "textAlign", "center"), h = a(e, "buttonWidth", "auto"), g = a(e, "borderWidth", "0px"), u = a(e, "borderColor", o), f = g !== "0px" ? `border:${g} solid ${u};` : "border:none;", y = h === "auto" ? "display:inline-block;" : `display:block;width:${h};`;
1199
1199
  return p`
1200
1200
  <div style="padding:${t};text-align:${c};">
1201
- <a style="${y}background-color:${o};color:${n};font-size:${i};font-weight:${s};border-radius:${r};padding:${a};text-decoration:none;text-align:center;${f}cursor:pointer;font-family:arial,helvetica,sans-serif;">${d}</a>
1201
+ <a style="${y}background-color:${o};color:${n};font-size:${i};font-weight:${s};border-radius:${r};padding:${l};text-decoration:none;text-align:center;${f}cursor:pointer;font-family:arial,helvetica,sans-serif;">${d}</a>
1202
1202
  </div>
1203
1203
  `;
1204
1204
  },
1205
1205
  renderHtml(e) {
1206
- const t = l(e, "containerPadding", "10px"), o = l(e, "backgroundColor", "#3b82f6"), n = l(e, "textColor", "#ffffff"), i = l(e, "fontSize", "14px"), s = l(e, "fontWeight", "700"), r = l(e, "borderRadius", "4px"), a = l(e, "buttonPadding", "10px 20px"), d = l(e, "text", "Click Me"), c = l(e, "textAlign", "center"), h = l(e, "href", "#"), g = l(e, "target", "_blank"), u = l(e, "borderWidth", "0px"), f = l(e, "borderColor", o), y = u !== "0px" ? `border:${u} solid ${f};` : "border:none;", x = Ct(d, h, { bgColor: o, textColor: n, fontSize: i, fontWeight: s, borderRadius: r }), m = x ? `${x}
1206
+ const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "#3b82f6"), n = a(e, "textColor", "#ffffff"), i = a(e, "fontSize", "14px"), s = a(e, "fontWeight", "700"), r = a(e, "borderRadius", "4px"), l = a(e, "buttonPadding", "10px 20px"), d = a(e, "text", "Click Me"), c = a(e, "textAlign", "center"), h = a(e, "href", "#"), g = a(e, "target", "_blank"), u = a(e, "borderWidth", "0px"), f = a(e, "borderColor", o), y = u !== "0px" ? `border:${u} solid ${f};` : "border:none;", x = Ct(d, h, { bgColor: o, textColor: n, fontSize: i, fontWeight: s, borderRadius: r }), m = x ? `${x}
1207
1207
  <!--[if !mso]><!-->` : "<!--[if !mso]><!-->", v = `<div align="${c}">
1208
1208
  ${m}
1209
- <a href="${h}" target="${g}" style="display:inline-block;text-decoration:none;text-align:center;color:${n};background-color:${o};border-radius:${r};font-size:${i};font-weight:${s};padding:${a};font-family:arial,helvetica,sans-serif;${y}mso-border-alt:none;"><span style="line-height:120%;">${d}</span></a>
1209
+ <a href="${h}" target="${g}" style="display:inline-block;text-decoration:none;text-align:center;color:${n};background-color:${o};border-radius:${r};font-size:${i};font-weight:${s};padding:${l};font-family:arial,helvetica,sans-serif;${y}mso-border-alt:none;"><span style="line-height:120%;">${d}</span></a>
1210
1210
  <!--<![endif]-->
1211
1211
  </div>`;
1212
- return L(v, { padding: t, align: c });
1212
+ return z(v, { padding: t, align: c });
1213
1213
  }
1214
1214
  }
1215
1215
  }, It = {
@@ -1259,12 +1259,12 @@ const _t = {
1259
1259
  },
1260
1260
  renderer: {
1261
1261
  renderEditor(e) {
1262
- const t = l(e, "containerPadding", "10px"), o = l(e, "width", "100%"), n = `${l(e, "borderTopWidth", "1px")} ${l(e, "borderTopStyle", "solid")} ${l(e, "borderTopColor", "#cccccc")}`;
1262
+ const t = a(e, "containerPadding", "10px"), o = a(e, "width", "100%"), n = `${a(e, "borderTopWidth", "1px")} ${a(e, "borderTopStyle", "solid")} ${a(e, "borderTopColor", "#cccccc")}`;
1263
1263
  return p`<div style="padding:${t};"><div style="border-top:${n};width:${o};margin:0 auto;"></div></div>`;
1264
1264
  },
1265
1265
  renderHtml(e) {
1266
- const t = l(e, "containerPadding", "10px"), o = l(e, "width", "100%"), n = `${l(e, "borderTopWidth", "1px")} ${l(e, "borderTopStyle", "solid")} ${l(e, "borderTopColor", "#cccccc")}`, i = `<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="${o}" style="border-collapse:collapse;border-top:${n};"><tbody><tr><td style="font-size:0;line-height:0;">&nbsp;</td></tr></tbody></table>`;
1267
- return L(i, { padding: t, align: "center" });
1266
+ const t = a(e, "containerPadding", "10px"), o = a(e, "width", "100%"), n = `${a(e, "borderTopWidth", "1px")} ${a(e, "borderTopStyle", "solid")} ${a(e, "borderTopColor", "#cccccc")}`, i = `<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="${o}" style="border-collapse:collapse;border-top:${n};"><tbody><tr><td style="font-size:0;line-height:0;">&nbsp;</td></tr></tbody></table>`;
1267
+ return z(i, { padding: t, align: "center" });
1268
1268
  }
1269
1269
  }
1270
1270
  }, Mt = [
@@ -1277,35 +1277,35 @@ const _t = {
1277
1277
  ], st = [
1278
1278
  {
1279
1279
  meta: { name: "html", label: "HTML", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>', position: 6 },
1280
- loader: () => import("./html-tool-BxuBzfKP.js").then((e) => e.htmlTool)
1280
+ loader: () => import("./html-tool-1B9Cos-6.js").then((e) => e.htmlTool)
1281
1281
  },
1282
1282
  {
1283
1283
  meta: { name: "social", label: "Social", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>', position: 8 },
1284
- loader: () => import("./social-tool-BY75hT3n.js").then((e) => e.socialTool)
1284
+ loader: () => import("./social-tool-Ba7QItoR.js").then((e) => e.socialTool)
1285
1285
  },
1286
1286
  {
1287
1287
  meta: { name: "menu", label: "Menu", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>', position: 9 },
1288
- loader: () => import("./menu-tool-BZDYFgXW.js").then((e) => e.menuTool)
1288
+ loader: () => import("./menu-tool-CZjaIKsU.js").then((e) => e.menuTool)
1289
1289
  },
1290
1290
  {
1291
1291
  meta: { name: "video", label: "Video", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>', position: 10 },
1292
- loader: () => import("./video-tool-DiIJBQpM.js").then((e) => e.videoTool)
1292
+ loader: () => import("./video-tool-OdNg0UMg.js").then((e) => e.videoTool)
1293
1293
  },
1294
1294
  {
1295
1295
  meta: { name: "timer", label: "Timer", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>', position: 11 },
1296
- loader: () => import("./timer-tool-Dj9QeWtN.js").then((e) => e.timerTool)
1296
+ loader: () => import("./timer-tool-p0KWo21p.js").then((e) => e.timerTool)
1297
1297
  },
1298
1298
  {
1299
1299
  meta: { name: "table", label: "Table", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M9 3v18"/><path d="M15 3v18"/></svg>', position: 12 },
1300
- loader: () => import("./table-tool-Ep89kXMr.js").then((e) => e.tableTool)
1300
+ loader: () => import("./table-tool-swpmCeU4.js").then((e) => e.tableTool)
1301
1301
  },
1302
1302
  {
1303
1303
  meta: { name: "form", label: "Form", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h6"/></svg>', position: 13 },
1304
- loader: () => import("./form-tool-At5Uq7es.js").then((e) => e.formTool)
1304
+ loader: () => import("./form-tool-DiE5BEft.js").then((e) => e.formTool)
1305
1305
  }
1306
1306
  ];
1307
1307
  function Pt(e, t, o) {
1308
- const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", s = o.fontFamily?.value || "arial,helvetica,sans-serif", r = o.textColor || "#000000", a = o.preheaderText || "" || "&zwnj;", d = `<div style="display:none;font-size:1px;color:${n};line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">${a}${"&zwnj;&nbsp;".repeat(80)}</div>`;
1308
+ const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", s = o.fontFamily?.value || "arial,helvetica,sans-serif", r = o.textColor || "#000000", l = o.preheaderText || "" || "&zwnj;", d = `<div style="display:none;font-size:1px;color:${n};line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">${l}${"&zwnj;&nbsp;".repeat(80)}</div>`;
1309
1309
  return `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1310
1310
  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
1311
1311
  <head>
@@ -1333,7 +1333,7 @@ function Pt(e, t, o) {
1333
1333
  </style>
1334
1334
  <!--<![endif]-->
1335
1335
  <style type="text/css">
1336
- body { margin: 0; padding: 0; }
1336
+ body { margin: 0; padding: 0; word-break: normal; }
1337
1337
  table, tr, td { vertical-align: top; border-collapse: collapse; }
1338
1338
  p { margin: 0; }
1339
1339
  a[x-apple-data-detectors='true'] { color: inherit !important; text-decoration: none !important; }
@@ -1356,15 +1356,15 @@ function Pt(e, t, o) {
1356
1356
  </html>`;
1357
1357
  }
1358
1358
  function Et(e, t, o) {
1359
- const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", s = e.values.columnsBackgroundColor || "", r = e.values.padding || "0px", a = e.cells.reduce((m, w) => m + w, 0), d = i ? `background-color:${i};` : "", c = e.values.backgroundImage;
1359
+ const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", s = e.values.columnsBackgroundColor || "", r = e.values.padding || "0px", l = e.cells.reduce((m, w) => m + w, 0), d = i ? `background-color:${i};` : "", c = e.values.backgroundImage;
1360
1360
  let h = "";
1361
1361
  if (c?.url) {
1362
1362
  const m = c.repeat === !0 || c.repeat === "repeat" ? "repeat" : "no-repeat", w = c.cover === !0 ? "cover" : c.fullWidth === !0 ? "100% auto" : "auto", v = c.center !== !1 ? "center top" : "left top";
1363
1363
  h = `background-image:url('${c.url}');background-repeat:${m};background-position:${v};background-size:${w};`;
1364
1364
  }
1365
1365
  const g = e.columns.length > 1, u = e.columns.map((m, w) => {
1366
- const v = Math.round(e.cells[w] / a * n);
1367
- return { colHtml: Lt(m, v, s, t, o), colWidthPx: v };
1366
+ const v = Math.round(e.cells[w] / l * n);
1367
+ return { colHtml: zt(m, v, s, t, o), colWidthPx: v };
1368
1368
  });
1369
1369
  let f;
1370
1370
  if (g) {
@@ -1379,8 +1379,8 @@ function Et(e, t, o) {
1379
1379
  <div style="margin:0 auto;max-width:${n}px;${g ? "font-size:0;" : ""}text-align:center;">${f}</div>
1380
1380
  </div>`;
1381
1381
  }
1382
- function Lt(e, t, o, n, i) {
1383
- const s = e.values.backgroundColor || o || "", r = e.values.padding || "0px", a = e.values.borderRadius || "0px", d = s ? `background-color:${s};` : "", c = e.contents.map((h) => {
1382
+ function zt(e, t, o, n, i) {
1383
+ const s = e.values.backgroundColor || o || "", r = e.values.padding || "0px", l = e.values.borderRadius || "0px", d = s ? `background-color:${s};` : "", c = e.contents.map((h) => {
1384
1384
  const g = i.get(h.type);
1385
1385
  if (!g) return `<!-- unknown tool: ${h.type} -->`;
1386
1386
  const u = {
@@ -1395,14 +1395,14 @@ function Lt(e, t, o, n, i) {
1395
1395
  }).join(`
1396
1396
  `);
1397
1397
  return `<div class="u_column" style="display:inline-block;vertical-align:top;width:${t}px;max-width:${t}px;font-size:14px;text-align:left;">
1398
- <div style="width:100%;${d}${a !== "0px" ? `border-radius:${a};` : ""}">
1398
+ <div style="width:100%;${d}${l !== "0px" ? `border-radius:${l};` : ""}">
1399
1399
  <div style="padding:${r};">
1400
1400
  ${c || "&nbsp;"}
1401
1401
  </div>
1402
1402
  </div>
1403
1403
  </div>`;
1404
1404
  }
1405
- function zt(e) {
1405
+ function Lt(e) {
1406
1406
  return `
1407
1407
  @media only screen and (min-width: ${e + 20}px) {
1408
1408
  .u_row .u_column { display: inline-block !important; }
@@ -1479,8 +1479,8 @@ function Ot(e) {
1479
1479
  }
1480
1480
  function Ht(e, t, o) {
1481
1481
  const n = e.body.values, i = parseInt(n.contentWidth || "600"), s = e.body.rows.map((u) => Et(u, n, t)).join(`
1482
- `), r = zt(i), a = Ot(s);
1483
- let d = Pt(a, r, n);
1482
+ `), r = Lt(i), l = Ot(s);
1483
+ let d = Pt(l, r, n);
1484
1484
  if (o?.mergeTags)
1485
1485
  for (const [u, f] of Object.entries(o.mergeTags))
1486
1486
  d = d.replaceAll(`{{${u}}}`, f);
@@ -1673,9 +1673,9 @@ let D = class extends $ {
1673
1673
  e.preventDefault();
1674
1674
  return;
1675
1675
  }
1676
- e.dataTransfer.setData("application/maileditor-content", this.content.id), e.dataTransfer.effectAllowed = "move", this.style.opacity = "0.4", z.startContentDrag(this.content.id);
1676
+ e.dataTransfer.setData("application/maileditor-content", this.content.id), e.dataTransfer.effectAllowed = "move", this.style.opacity = "0.4", L.startContentDrag(this.content.id);
1677
1677
  }, this._onDragEnd = () => {
1678
- this.style.opacity = "1", z.reset();
1678
+ this.style.opacity = "1", L.reset();
1679
1679
  }, this.handleInlineInput = () => {
1680
1680
  this.saveDebounceTimer && clearTimeout(this.saveDebounceTimer), this.saveDebounceTimer = setTimeout(() => this.saveInlineContent(), 500), this.showToolbar();
1681
1681
  }, this.handleInlineBlur = (e) => {
@@ -1749,7 +1749,7 @@ let D = class extends $ {
1749
1749
  const r = this.toolRegistry.get(this.content.type);
1750
1750
  if (!r && this.toolRegistry.has(this.content.type))
1751
1751
  return this.toolRegistry.ensureLoaded(this.content.type).then(() => this.requestUpdate()), p`<div style="padding:16px;text-align:center;color:#9ca3af;font-size:13px;">Loading ${this.content.type}...</div>`;
1752
- const a = n ? "Hidden on desktop" : i ? "Hidden on mobile" : "", d = rt.has(this.content.type);
1752
+ const l = n ? "Hidden on desktop" : i ? "Hidden on mobile" : "", d = rt.has(this.content.type);
1753
1753
  if (this.editing && d && r) {
1754
1754
  const h = this.content.values, g = lt(this.content.type), u = h[g] || "", f = this.getInlineStyles(h);
1755
1755
  return p`
@@ -1773,7 +1773,7 @@ let D = class extends $ {
1773
1773
  displayMode: "email"
1774
1774
  });
1775
1775
  return p`
1776
- ${s ? p`<div class="hidden-badge">${a}</div>` : ""}
1776
+ ${s ? p`<div class="hidden-badge">${l}</div>` : ""}
1777
1777
  <div class="action-bar">
1778
1778
  <button class="action-btn" @click=${this.handleDuplicate} title="Duplicate">&#9851;</button>
1779
1779
  <button class="action-btn" @click=${this.handleDelete} title="Delete">&#10005;</button>
@@ -1802,8 +1802,8 @@ let D = class extends $ {
1802
1802
  s && t.push(`font-size:${s}`);
1803
1803
  const r = o("fontWeight");
1804
1804
  r && t.push(`font-weight:${r}`);
1805
- const a = o("lineHeight", "140%");
1806
- t.push(`line-height:${a}`);
1805
+ const l = o("lineHeight", "140%");
1806
+ t.push(`line-height:${l}`);
1807
1807
  const d = o("textAlign");
1808
1808
  d && t.push(`text-align:${d}`);
1809
1809
  const c = o("letterSpacing");
@@ -1981,7 +1981,13 @@ let R = class extends $ {
1981
1981
  }
1982
1982
  render() {
1983
1983
  if (!this.store) return p``;
1984
- const { row: e, store: t, toolRegistry: o } = this, n = e.values.backgroundColor || "transparent", i = e.values.columnsBackgroundColor || "transparent", s = e.values.padding || "0px", r = e.cells.reduce((x, m) => x + m, 0), a = e.values.backgroundImage, d = typeof a == "object" && a?.url ? a.url : "", c = d ? `background-image:url('${d}');background-size:${a?.cover ? "cover" : "contain"};background-position:${a?.center ? "center" : "top left"};background-repeat:${a?.repeat ? "repeat" : "no-repeat"};` : "", h = t.viewMode, g = !!e.values.hideDesktop, u = !!e.values.hideMobile, f = h === "desktop" && g || h === "mobile" && u, y = g ? "Hidden on desktop" : u ? "Hidden on mobile" : "";
1984
+ const { row: e, store: t, toolRegistry: o } = this, n = e.values.backgroundColor || "transparent", i = e.values.columnsBackgroundColor || "transparent", s = e.values.padding || "0px", r = e.cells.reduce((x, m) => x + m, 0), l = e.values.backgroundImage, d = typeof l == "object" && l?.url ? l.url : "";
1985
+ let c = "";
1986
+ if (d) {
1987
+ const x = l.repeat === !0 || l.repeat === "repeat" ? "repeat" : "no-repeat", m = l.cover === !0 ? "cover" : l.fullWidth === !0 ? "100% auto" : "auto", w = l.center !== !1 ? "center" : "top left";
1988
+ c = `background-image:url('${d}');background-size:${m};background-position:${w};background-repeat:${x};`;
1989
+ }
1990
+ const h = t.viewMode, g = !!e.values.hideDesktop, u = !!e.values.hideMobile, f = h === "desktop" && g || h === "mobile" && u, y = g ? "Hidden on desktop" : u ? "Hidden on mobile" : "";
1985
1991
  return this.classList.toggle("hidden-in-view", f), this.setAttribute("draggable", "true"), this.dataset.rowId = e.id, p`
1986
1992
  ${f ? p`<div class="row-hidden-badge">${y}</div>` : ""}
1987
1993
  <div class="row-actions">
@@ -2656,16 +2662,16 @@ function se(e, t, o, n) {
2656
2662
  return e === t && t === o && o === n ? `${e}px` : e === o && t === n ? `${e}px ${t}px` : `${e}px ${t}px ${o}px ${n}px`;
2657
2663
  }
2658
2664
  function re(e, t, o) {
2659
- const [n, i, s, r] = ie(e), a = (c, h, g, u) => t(se(c, h, g, u));
2665
+ const [n, i, s, r] = ie(e), l = (c, h, g, u) => t(se(c, h, g, u));
2660
2666
  return p`
2661
2667
  <div class="prop-row">
2662
2668
  <label class="prop-label">${o}</label>
2663
2669
  <div style="display:grid;grid-template-columns:1fr 1fr;gap:4px;">
2664
2670
  ${[
2665
- { label: "T", val: n, change: (c) => a(c, i, s, r) },
2666
- { label: "R", val: i, change: (c) => a(n, c, s, r) },
2667
- { label: "B", val: s, change: (c) => a(n, i, c, r) },
2668
- { label: "L", val: r, change: (c) => a(n, i, s, c) }
2671
+ { label: "T", val: n, change: (c) => l(c, i, s, r) },
2672
+ { label: "R", val: i, change: (c) => l(n, c, s, r) },
2673
+ { label: "B", val: s, change: (c) => l(n, i, c, r) },
2674
+ { label: "L", val: r, change: (c) => l(n, i, s, c) }
2669
2675
  ].map((c) => p`
2670
2676
  <div style="display:flex;align-items:center;gap:4px;">
2671
2677
  <span style="font-size:10px;color:#9ca3af;width:12px;">${c.label}</span>
@@ -2865,8 +2871,8 @@ let B = class extends $ {
2865
2871
  const o = this.store.getDesign(), n = /* @__PURE__ */ new Set();
2866
2872
  for (const s of o.body.rows)
2867
2873
  for (const r of s.columns)
2868
- for (const a of r.contents)
2869
- n.add(a.type);
2874
+ for (const l of r.contents)
2875
+ n.add(l.type);
2870
2876
  const i = Array.from(n).filter((s) => !this.toolRegistry.isLoaded(s)).map((s) => this.toolRegistry.ensureLoaded(s));
2871
2877
  i.length > 0 ? Promise.all(i).then(() => this.doExport(o, e, t)) : this.doExport(o, e, t);
2872
2878
  }
@@ -2980,8 +2986,8 @@ export {
2980
2986
  B as M,
2981
2987
  vt as T,
2982
2988
  wt as a,
2983
- L as e,
2989
+ z as e,
2984
2990
  me as j,
2985
- l as s
2991
+ a as s
2986
2992
  };
2987
- //# sourceMappingURL=index-BTE3G6Ph.js.map
2993
+ //# sourceMappingURL=index-C_nXnIR5.js.map