@emabuild/core 0.1.4 → 0.2.0
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/dist/canvas/content-renderer.d.ts +5 -2
- package/dist/canvas/content-renderer.d.ts.map +1 -1
- package/dist/{form-tool-DiE5BEft.js → form-tool-DdFDrS3b.js} +10 -10
- package/dist/form-tool-DdFDrS3b.js.map +1 -0
- package/dist/{html-tool-1B9Cos-6.js → html-tool-DMtmrF3n.js} +3 -3
- package/dist/{html-tool-1B9Cos-6.js.map → html-tool-DMtmrF3n.js.map} +1 -1
- package/dist/{index-C_nXnIR5.js → index-CpMbWdgn.js} +384 -285
- package/dist/index-CpMbWdgn.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/mail-editor.d.ts.map +1 -1
- package/dist/{menu-tool-CZjaIKsU.js → menu-tool-CJcQdpcP.js} +10 -10
- package/dist/menu-tool-CJcQdpcP.js.map +1 -0
- package/dist/properties/property-panel.d.ts.map +1 -1
- package/dist/properties/widgets/index.d.ts +1 -0
- package/dist/properties/widgets/index.d.ts.map +1 -1
- package/dist/properties/widgets/number-unit-widget.d.ts +10 -0
- package/dist/properties/widgets/number-unit-widget.d.ts.map +1 -0
- package/dist/{social-tool-Ba7QItoR.js → social-tool-CRY3-_sU.js} +8 -8
- package/dist/social-tool-CRY3-_sU.js.map +1 -0
- package/dist/{table-tool-swpmCeU4.js → table-tool-DeIQci5z.js} +8 -8
- package/dist/table-tool-DeIQci5z.js.map +1 -0
- package/dist/{timer-tool-p0KWo21p.js → timer-tool-BVE1shO1.js} +6 -6
- package/dist/timer-tool-BVE1shO1.js.map +1 -0
- package/dist/tools/built-in/button-tool.d.ts.map +1 -1
- package/dist/tools/built-in/heading-tool.d.ts.map +1 -1
- package/dist/tools/built-in/image-tool.d.ts.map +1 -1
- package/dist/tools/helpers/index.d.ts +1 -1
- package/dist/tools/helpers/index.d.ts.map +1 -1
- package/dist/tools/helpers/value-extractor.d.ts +9 -0
- package/dist/tools/helpers/value-extractor.d.ts.map +1 -1
- package/dist/{video-tool-OdNg0UMg.js → video-tool-g1fIoCWW.js} +3 -3
- package/dist/video-tool-g1fIoCWW.js.map +1 -0
- package/package.json +3 -3
- package/dist/form-tool-DiE5BEft.js.map +0 -1
- package/dist/index-C_nXnIR5.js.map +0 -1
- package/dist/menu-tool-CZjaIKsU.js.map +0 -1
- package/dist/social-tool-Ba7QItoR.js.map +0 -1
- package/dist/table-tool-swpmCeU4.js.map +0 -1
- package/dist/timer-tool-p0KWo21p.js.map +0 -1
- package/dist/video-tool-OdNg0UMg.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { html as p, LitElement as $, css as k } from "lit";
|
|
2
|
-
import { property as b, customElement as C, state as
|
|
2
|
+
import { property as b, customElement as C, state as ht } from "lit/decorators.js";
|
|
3
3
|
import { unsafeHTML as U } from "lit/directives/unsafe-html.js";
|
|
4
|
-
|
|
4
|
+
import { styleMap as ut } from "lit/directives/style-map.js";
|
|
5
|
+
function gt() {
|
|
5
6
|
const e = {};
|
|
6
7
|
return {
|
|
7
8
|
getCounters() {
|
|
@@ -18,7 +19,7 @@ function ht() {
|
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
|
-
class
|
|
22
|
+
class ft {
|
|
22
23
|
constructor() {
|
|
23
24
|
this.listeners = /* @__PURE__ */ new Map();
|
|
24
25
|
}
|
|
@@ -45,7 +46,7 @@ class ut {
|
|
|
45
46
|
t ? this.listeners.delete(t) : this.listeners.clear();
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
class
|
|
49
|
+
class bt {
|
|
49
50
|
constructor(t = 50) {
|
|
50
51
|
this.undoStack = [], this.redoStack = [], this.maxHistory = t;
|
|
51
52
|
}
|
|
@@ -78,7 +79,7 @@ class gt {
|
|
|
78
79
|
this.undoStack = [], this.redoStack = [];
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function mt() {
|
|
82
83
|
return {
|
|
83
84
|
counters: { u_row: 0, u_column: 0 },
|
|
84
85
|
body: {
|
|
@@ -123,7 +124,7 @@ function ft() {
|
|
|
123
124
|
schemaVersion: 16
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function xt(e, t) {
|
|
127
128
|
const o = e.next("u_row"), n = t.map(() => {
|
|
128
129
|
const i = e.next("u_column");
|
|
129
130
|
return {
|
|
@@ -156,7 +157,7 @@ function bt(e, t) {
|
|
|
156
157
|
}
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
|
-
function
|
|
160
|
+
function yt(e, t, o = {}) {
|
|
160
161
|
const n = e.next(`u_content_${t}`), i = `u_content_${t}_${n}`;
|
|
161
162
|
return {
|
|
162
163
|
id: i,
|
|
@@ -188,21 +189,21 @@ function W(e, t) {
|
|
|
188
189
|
if (i) return i;
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
+
function wt(e, t) {
|
|
192
193
|
for (const o of e.body.rows)
|
|
193
194
|
for (const n of o.columns)
|
|
194
195
|
if (n.contents.some((i) => i.id === t)) return n;
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function vt(e, t) {
|
|
197
198
|
for (const o of e.body.rows)
|
|
198
199
|
if (o.columns.some((n) => n.id === t)) return o;
|
|
199
200
|
}
|
|
200
201
|
function q(e, t) {
|
|
201
202
|
return e.body.rows.findIndex((o) => o.id === t);
|
|
202
203
|
}
|
|
203
|
-
class
|
|
204
|
+
class $t {
|
|
204
205
|
constructor() {
|
|
205
|
-
this.history = new
|
|
206
|
+
this.history = new bt(), this.counterManager = gt(), this.subscribers = /* @__PURE__ */ new Set(), this.channelSubscribers = /* @__PURE__ */ new Map(), this.events = new ft(), this._selectedId = null, this._hoveredId = null, this._viewMode = "desktop", this._activeTab = "content", this.design = mt();
|
|
206
207
|
}
|
|
207
208
|
// ── Subscriptions ──────────────────────────────────────────
|
|
208
209
|
/** Subscribe to ALL state changes (legacy). Returns an unsubscribe function. */
|
|
@@ -329,8 +330,8 @@ class wt {
|
|
|
329
330
|
const n = structuredClone(o), i = this.counterManager.next("u_row");
|
|
330
331
|
n.id = `u_row_${i}`, n.values._meta = { htmlID: n.id, htmlClassNames: "u_row" };
|
|
331
332
|
for (const r of n.columns) {
|
|
332
|
-
const
|
|
333
|
-
r.id = `u_column_${
|
|
333
|
+
const a = this.counterManager.next("u_column");
|
|
334
|
+
r.id = `u_column_${a}`, r.values._meta = { htmlID: r.id, htmlClassNames: "u_column" };
|
|
334
335
|
for (const d of r.contents) {
|
|
335
336
|
const c = this.counterManager.next(`u_content_${d.type}`);
|
|
336
337
|
d.id = `u_content_${d.type}_${c}`, d.values._meta = { htmlID: d.id, htmlClassNames: `u_content_${d.type}` };
|
|
@@ -385,10 +386,10 @@ class wt {
|
|
|
385
386
|
if (!i) return;
|
|
386
387
|
this.history.push(this.design);
|
|
387
388
|
for (const r of this.design.body.rows)
|
|
388
|
-
for (const
|
|
389
|
-
const d =
|
|
389
|
+
for (const a of r.columns) {
|
|
390
|
+
const d = a.contents.findIndex((c) => c.id === t);
|
|
390
391
|
if (d !== -1) {
|
|
391
|
-
|
|
392
|
+
a.contents.splice(d, 1);
|
|
392
393
|
break;
|
|
393
394
|
}
|
|
394
395
|
}
|
|
@@ -404,8 +405,8 @@ class wt {
|
|
|
404
405
|
const s = i.contents.findIndex((r) => r.id === t);
|
|
405
406
|
if (s !== -1) {
|
|
406
407
|
this.history.push(this.design);
|
|
407
|
-
const r = structuredClone(o),
|
|
408
|
-
r.id = `u_content_${o.type}_${
|
|
408
|
+
const r = structuredClone(o), a = this.counterManager.next(`u_content_${o.type}`);
|
|
409
|
+
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);
|
|
409
410
|
return;
|
|
410
411
|
}
|
|
411
412
|
}
|
|
@@ -426,20 +427,20 @@ class wt {
|
|
|
426
427
|
return W(this.design, t);
|
|
427
428
|
}
|
|
428
429
|
findParentColumn(t) {
|
|
429
|
-
return
|
|
430
|
+
return wt(this.design, t);
|
|
430
431
|
}
|
|
431
432
|
findParentRow(t) {
|
|
432
|
-
return
|
|
433
|
+
return vt(this.design, t);
|
|
433
434
|
}
|
|
434
435
|
// ── Factory Methods (delegate to design-factory) ───────────
|
|
435
436
|
/** Create a new row with the given column layout */
|
|
436
437
|
createRow(t) {
|
|
437
|
-
const o =
|
|
438
|
+
const o = xt(this.counterManager, t);
|
|
438
439
|
return this.syncCounters(), o;
|
|
439
440
|
}
|
|
440
441
|
/** Create a new content block for the given tool type */
|
|
441
442
|
createContent(t, o = {}) {
|
|
442
|
-
const n =
|
|
443
|
+
const n = yt(this.counterManager, t, o);
|
|
443
444
|
return this.syncCounters(), n;
|
|
444
445
|
}
|
|
445
446
|
// ── Private Helpers ────────────────────────────────────────
|
|
@@ -450,7 +451,7 @@ class wt {
|
|
|
450
451
|
this.events.emit("design:updated", { type: t, item: o });
|
|
451
452
|
}
|
|
452
453
|
}
|
|
453
|
-
class
|
|
454
|
+
class kt {
|
|
454
455
|
constructor() {
|
|
455
456
|
this.tools = /* @__PURE__ */ new Map(), this.lazyLoaders = /* @__PURE__ */ new Map(), this.lazyMeta = /* @__PURE__ */ new Map(), this.loadingPromises = /* @__PURE__ */ new Map();
|
|
456
457
|
}
|
|
@@ -563,10 +564,10 @@ function Z(e) {
|
|
|
563
564
|
function tt(e, t, o, n, i = "4px") {
|
|
564
565
|
e.parentNode !== t && (e.remove(), t.appendChild(e));
|
|
565
566
|
const r = (t instanceof ShadowRoot ? t.host : t).getBoundingClientRect();
|
|
566
|
-
let
|
|
567
|
-
o.length === 0 || n === 0 ?
|
|
567
|
+
let a;
|
|
568
|
+
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, {
|
|
568
569
|
display: "block",
|
|
569
|
-
top: `${
|
|
570
|
+
top: `${a}px`,
|
|
570
571
|
left: i,
|
|
571
572
|
right: i,
|
|
572
573
|
width: "auto"
|
|
@@ -588,11 +589,11 @@ function et(e, t) {
|
|
|
588
589
|
n.matches?.(t) && o.push(n);
|
|
589
590
|
}), o;
|
|
590
591
|
}
|
|
591
|
-
class
|
|
592
|
+
class Ct {
|
|
592
593
|
constructor(t, o, n) {
|
|
593
594
|
this.currentDrop = null, this.contentIndicator = null, this.rowIndicator = null, this.onDragOver = (i) => {
|
|
594
|
-
const s = i.dataTransfer?.types || [], r = s.includes("application/maileditor-tool"),
|
|
595
|
-
!r && !d && !
|
|
595
|
+
const s = i.dataTransfer?.types || [], r = s.includes("application/maileditor-tool"), a = s.includes("application/maileditor-layout"), d = s.includes("application/maileditor-content") || !!L.draggingContentId;
|
|
596
|
+
!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()));
|
|
596
597
|
}, this.onDrop = (i) => {
|
|
597
598
|
i.preventDefault(), this.hideAllIndicators();
|
|
598
599
|
const s = this.currentDrop, r = i.dataTransfer?.getData("application/maileditor-layout");
|
|
@@ -600,9 +601,9 @@ class $t {
|
|
|
600
601
|
this.handleLayoutDrop(JSON.parse(r), s), this.reset();
|
|
601
602
|
return;
|
|
602
603
|
}
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
605
|
-
this.handleToolDrop(
|
|
604
|
+
const a = i.dataTransfer?.getData("application/maileditor-tool");
|
|
605
|
+
if (a) {
|
|
606
|
+
this.handleToolDrop(a, s), this.reset();
|
|
606
607
|
return;
|
|
607
608
|
}
|
|
608
609
|
const d = i.dataTransfer?.getData("application/maileditor-content") || L.draggingContentId;
|
|
@@ -649,8 +650,8 @@ class $t {
|
|
|
649
650
|
if (n.length === 0) return { type: "row", rowIndex: 0, y: 0 };
|
|
650
651
|
let i = Math.abs(t - n[0].getBoundingClientRect().top), s = { type: "row", rowIndex: 0, y: n[0].getBoundingClientRect().top };
|
|
651
652
|
for (let r = 0; r < n.length; r++) {
|
|
652
|
-
const
|
|
653
|
-
d < i && (i = d, s = { type: "row", rowIndex: r + 1, y:
|
|
653
|
+
const a = n[r].getBoundingClientRect().bottom, d = Math.abs(t - a);
|
|
654
|
+
d < i && (i = d, s = { type: "row", rowIndex: r + 1, y: a });
|
|
654
655
|
}
|
|
655
656
|
return s;
|
|
656
657
|
}
|
|
@@ -658,22 +659,22 @@ class $t {
|
|
|
658
659
|
const n = et(this.root, "me-column-renderer");
|
|
659
660
|
let i = null, s = 1 / 0;
|
|
660
661
|
for (const r of n) {
|
|
661
|
-
const
|
|
662
|
-
if (!
|
|
662
|
+
const a = r.dataset.columnId;
|
|
663
|
+
if (!a || !r.shadowRoot) continue;
|
|
663
664
|
const d = r.getBoundingClientRect();
|
|
664
665
|
if (t < d.left || t > d.right) continue;
|
|
665
666
|
const c = Array.from(r.shadowRoot.querySelectorAll("me-content-renderer"));
|
|
666
667
|
if (c.length === 0) {
|
|
667
668
|
const u = Math.abs(o - (d.top + d.height / 2));
|
|
668
|
-
u < s && (s = u, i = { type: "content", columnId:
|
|
669
|
+
u < s && (s = u, i = { type: "content", columnId: a, contentIndex: 0, y: d.top + d.height / 2 });
|
|
669
670
|
continue;
|
|
670
671
|
}
|
|
671
672
|
const h = c[0].getBoundingClientRect().top;
|
|
672
673
|
let g = Math.abs(o - h);
|
|
673
|
-
g < s && (s = g, i = { type: "content", columnId:
|
|
674
|
+
g < s && (s = g, i = { type: "content", columnId: a, contentIndex: 0, y: h });
|
|
674
675
|
for (let u = 0; u < c.length; u++) {
|
|
675
|
-
const f = c[u].getBoundingClientRect(),
|
|
676
|
-
g = Math.abs(o - x), g < s && (s = g, i = { type: "content", columnId:
|
|
676
|
+
const f = c[u].getBoundingClientRect(), w = c[u + 1]?.getBoundingClientRect(), x = w ? (f.bottom + w.top) / 2 : f.bottom;
|
|
677
|
+
g = Math.abs(o - x), g < s && (s = g, i = { type: "content", columnId: a, contentIndex: u + 1, y: x });
|
|
677
678
|
}
|
|
678
679
|
}
|
|
679
680
|
return i;
|
|
@@ -706,7 +707,7 @@ class $t {
|
|
|
706
707
|
this.currentDrop = null, L.reset();
|
|
707
708
|
}
|
|
708
709
|
}
|
|
709
|
-
function
|
|
710
|
+
function l(e, t, o = "") {
|
|
710
711
|
const n = e[t];
|
|
711
712
|
return typeof n == "string" && n !== "" ? n : typeof n == "number" ? String(n) : o;
|
|
712
713
|
}
|
|
@@ -723,7 +724,7 @@ function nt(e) {
|
|
|
723
724
|
}
|
|
724
725
|
return {};
|
|
725
726
|
}
|
|
726
|
-
function
|
|
727
|
+
function _t(e) {
|
|
727
728
|
const t = e.action;
|
|
728
729
|
if (t && typeof t == "object") {
|
|
729
730
|
const o = t.values;
|
|
@@ -733,8 +734,8 @@ function kt(e) {
|
|
|
733
734
|
};
|
|
734
735
|
}
|
|
735
736
|
return {
|
|
736
|
-
href:
|
|
737
|
-
target:
|
|
737
|
+
href: l(e, "href"),
|
|
738
|
+
target: l(e, "target", "_blank")
|
|
738
739
|
};
|
|
739
740
|
}
|
|
740
741
|
function it(e, t = "") {
|
|
@@ -743,9 +744,9 @@ function it(e, t = "") {
|
|
|
743
744
|
const n = e.textJson;
|
|
744
745
|
if (typeof n == "string")
|
|
745
746
|
try {
|
|
746
|
-
const i = JSON.parse(n), s = [], r = (
|
|
747
|
-
typeof
|
|
748
|
-
const d =
|
|
747
|
+
const i = JSON.parse(n), s = [], r = (a) => {
|
|
748
|
+
typeof a.text == "string" && s.push(a.text), a.type === "linebreak" && s.push("<br/>");
|
|
749
|
+
const d = a.children;
|
|
749
750
|
d && d.forEach(r);
|
|
750
751
|
};
|
|
751
752
|
if (r(i.root || i), s.length > 0) return s.join("");
|
|
@@ -761,15 +762,29 @@ function Y(e, t = "arial,helvetica,sans-serif") {
|
|
|
761
762
|
if (s && typeof document < "u") {
|
|
762
763
|
const r = `emabuild-font-${i.replace(/[^a-z]/gi, "")}`;
|
|
763
764
|
if (!document.getElementById(r)) {
|
|
764
|
-
const
|
|
765
|
-
|
|
765
|
+
const a = document.createElement("link");
|
|
766
|
+
a.id = r, a.rel = "stylesheet", a.href = s, document.head.appendChild(a);
|
|
766
767
|
}
|
|
767
768
|
}
|
|
768
769
|
return i;
|
|
769
770
|
}
|
|
770
771
|
return t;
|
|
771
772
|
}
|
|
772
|
-
function
|
|
773
|
+
function st(e) {
|
|
774
|
+
const t = e.buttonColors;
|
|
775
|
+
if (t && typeof t == "object") {
|
|
776
|
+
const o = t;
|
|
777
|
+
return {
|
|
778
|
+
bg: o.backgroundColor || l(e, "backgroundColor", "#3b82f6"),
|
|
779
|
+
color: o.color || l(e, "textColor", "#ffffff")
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
return {
|
|
783
|
+
bg: l(e, "backgroundColor", "#3b82f6"),
|
|
784
|
+
color: l(e, "textColor", "#ffffff")
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
function ve(e, t) {
|
|
773
788
|
if (typeof e != "string") return t;
|
|
774
789
|
try {
|
|
775
790
|
return JSON.parse(e);
|
|
@@ -785,8 +800,8 @@ function z(e, t) {
|
|
|
785
800
|
</td></tr></tbody>
|
|
786
801
|
</table>`;
|
|
787
802
|
}
|
|
788
|
-
function
|
|
789
|
-
const { bgColor: n, textColor: i, fontSize: s, fontWeight: r, borderRadius:
|
|
803
|
+
function St(e, t, o) {
|
|
804
|
+
const { bgColor: n, textColor: i, fontSize: s, fontWeight: r, borderRadius: a } = o, d = parseInt(a) || 0;
|
|
790
805
|
if (d <= 0) return "";
|
|
791
806
|
const c = Math.round(d / 20 * 100);
|
|
792
807
|
return `<!--[if mso]>
|
|
@@ -796,7 +811,7 @@ function Ct(e, t, o) {
|
|
|
796
811
|
</v:roundrect>
|
|
797
812
|
<![endif]-->`;
|
|
798
813
|
}
|
|
799
|
-
const
|
|
814
|
+
const Dt = {
|
|
800
815
|
name: "text",
|
|
801
816
|
label: "Text",
|
|
802
817
|
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"><path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/></svg>',
|
|
@@ -859,19 +874,20 @@ const _t = {
|
|
|
859
874
|
},
|
|
860
875
|
renderer: {
|
|
861
876
|
renderEditor(e) {
|
|
862
|
-
const t =
|
|
877
|
+
const t = l(e, "backgroundColor", "transparent"), o = l(e, "color", "inherit"), n = l(e, "lineHeight", "140%"), i = l(e, "textAlign", "left"), s = Y(e), r = l(e, "text");
|
|
863
878
|
return p`
|
|
864
|
-
<div style="
|
|
879
|
+
<div style="background-color:${t};color:${o};line-height:${n};text-align:${i};font-family:${s};">
|
|
865
880
|
${U(r)}
|
|
866
881
|
</div>
|
|
867
882
|
`;
|
|
868
883
|
},
|
|
869
884
|
renderHtml(e) {
|
|
870
|
-
const t =
|
|
871
|
-
return z(d, { padding: t, extraTdStyle:
|
|
885
|
+
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>`;
|
|
886
|
+
return z(d, { padding: t, extraTdStyle: a });
|
|
872
887
|
}
|
|
873
888
|
}
|
|
874
|
-
}
|
|
889
|
+
};
|
|
890
|
+
const Rt = {
|
|
875
891
|
name: "heading",
|
|
876
892
|
label: "Heading",
|
|
877
893
|
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"><path d="M6 12h12"/><path d="M6 4v16"/><path d="M18 4v16"/></svg>',
|
|
@@ -903,6 +919,7 @@ const _t = {
|
|
|
903
919
|
defaultValue: "22px",
|
|
904
920
|
widget: "dropdown",
|
|
905
921
|
widgetParams: { options: [
|
|
922
|
+
{ label: "12px", value: "12px" },
|
|
906
923
|
{ label: "14px", value: "14px" },
|
|
907
924
|
{ label: "16px", value: "16px" },
|
|
908
925
|
{ label: "18px", value: "18px" },
|
|
@@ -942,7 +959,12 @@ const _t = {
|
|
|
942
959
|
{ label: "200%", value: "200%" }
|
|
943
960
|
] }
|
|
944
961
|
},
|
|
945
|
-
letterSpacing: {
|
|
962
|
+
letterSpacing: {
|
|
963
|
+
label: "Letter Spacing",
|
|
964
|
+
defaultValue: "0px",
|
|
965
|
+
widget: "number_unit",
|
|
966
|
+
widgetParams: { unit: "px", min: -5, max: 50, step: 0.1 }
|
|
967
|
+
}
|
|
946
968
|
}
|
|
947
969
|
},
|
|
948
970
|
spacing: {
|
|
@@ -968,24 +990,29 @@ const _t = {
|
|
|
968
990
|
textAlign: "left",
|
|
969
991
|
fontWeight: "700",
|
|
970
992
|
lineHeight: "140%",
|
|
971
|
-
letterSpacing: "
|
|
993
|
+
letterSpacing: "0px",
|
|
972
994
|
containerPadding: "10px"
|
|
973
995
|
},
|
|
974
996
|
renderer: {
|
|
975
997
|
renderEditor(e) {
|
|
976
|
-
const t =
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
998
|
+
const t = {
|
|
999
|
+
padding: l(e, "containerPadding", "10px"),
|
|
1000
|
+
fontSize: l(e, "fontSize", "22px"),
|
|
1001
|
+
color: l(e, "color", "#000000"),
|
|
1002
|
+
textAlign: l(e, "textAlign", "left"),
|
|
1003
|
+
fontWeight: l(e, "fontWeight", "700"),
|
|
1004
|
+
lineHeight: l(e, "lineHeight", "140%"),
|
|
1005
|
+
letterSpacing: l(e, "letterSpacing", "normal"),
|
|
1006
|
+
fontFamily: Y(e)
|
|
1007
|
+
}, o = it(e, "Heading");
|
|
1008
|
+
return p`<div style=${ut(t)}>${U(o)}</div>`;
|
|
982
1009
|
},
|
|
983
1010
|
renderHtml(e) {
|
|
984
|
-
const t =
|
|
1011
|
+
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
1012
|
return z(g, { padding: t });
|
|
986
1013
|
}
|
|
987
1014
|
}
|
|
988
|
-
},
|
|
1015
|
+
}, Tt = {
|
|
989
1016
|
name: "paragraph",
|
|
990
1017
|
label: "Paragraph",
|
|
991
1018
|
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="3" y1="6" x2="21" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/><line x1="3" y1="14" x2="17" y2="14"/></svg>',
|
|
@@ -1028,15 +1055,15 @@ const _t = {
|
|
|
1028
1055
|
},
|
|
1029
1056
|
renderer: {
|
|
1030
1057
|
renderEditor(e) {
|
|
1031
|
-
const t =
|
|
1032
|
-
return p`<div style="
|
|
1058
|
+
const t = l(e, "color", "#374151"), o = l(e, "lineHeight", "160%"), n = l(e, "textAlign", "left");
|
|
1059
|
+
return p`<div style="color:${t};line-height:${o};text-align:${n};">${U(l(e, "text"))}</div>`;
|
|
1033
1060
|
},
|
|
1034
1061
|
renderHtml(e) {
|
|
1035
|
-
const t =
|
|
1062
|
+
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
1063
|
return z(r, { padding: t });
|
|
1037
1064
|
}
|
|
1038
1065
|
}
|
|
1039
|
-
},
|
|
1066
|
+
}, It = {
|
|
1040
1067
|
name: "image",
|
|
1041
1068
|
label: "Image",
|
|
1042
1069
|
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" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
|
|
@@ -1097,18 +1124,18 @@ const _t = {
|
|
|
1097
1124
|
},
|
|
1098
1125
|
renderer: {
|
|
1099
1126
|
renderEditor(e) {
|
|
1100
|
-
const t =
|
|
1101
|
-
return
|
|
1127
|
+
const t = ot(e.src), o = l(e, "alt"), i = nt(e.src).maxWidth || l(e, "width", "100%"), s = l(e, "borderRadius", "0px"), r = l(e, "textAlign", l(e, "align", "center"));
|
|
1128
|
+
return t ? p`<div style="text-align:${r};"><img src=${t} alt=${o} style="display:inline-block;max-width:100%;width:${i};border-radius:${s};border:0;" /></div>` : p`<div style="text-align:${r};"><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
1129
|
},
|
|
1103
1130
|
renderHtml(e, t) {
|
|
1104
|
-
const o =
|
|
1131
|
+
const o = l(e, "containerPadding", "10px"), n = ot(e.src), i = l(e, "alt"), s = _t(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"));
|
|
1105
1132
|
let h;
|
|
1106
|
-
|
|
1133
|
+
a.includes("%") ? h = Math.round(t.columnWidth * (parseFloat(a) / 100)) : a === "auto" ? h = r.width || t.columnWidth : h = parseInt(a) || t.columnWidth;
|
|
1107
1134
|
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
1135
|
return z(f, { padding: o, align: c });
|
|
1109
1136
|
}
|
|
1110
1137
|
}
|
|
1111
|
-
},
|
|
1138
|
+
}, Mt = {
|
|
1112
1139
|
name: "button",
|
|
1113
1140
|
label: "Button",
|
|
1114
1141
|
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="2" y="7" width="20" height="10" rx="2"/><path d="M12 7v10"/><path d="m8 12 4-3 4 3"/></svg>',
|
|
@@ -1195,24 +1222,24 @@ const _t = {
|
|
|
1195
1222
|
},
|
|
1196
1223
|
renderer: {
|
|
1197
1224
|
renderEditor(e) {
|
|
1198
|
-
const
|
|
1225
|
+
const { bg: t, color: o } = st(e), n = l(e, "fontSize", "14px"), i = l(e, "fontWeight", "700"), s = l(e, "borderRadius", "4px"), r = l(e, "buttonPadding", l(e, "padding", "10px 20px")), a = l(e, "text", "Click Me"), d = l(e, "textAlign", "center"), c = l(e, "buttonWidth", "auto"), h = l(e, "borderWidth", "0px"), g = l(e, "borderColor", t), u = h !== "0px" ? `border:${h} solid ${g};` : "border:none;", f = c === "auto" ? "display:inline-block;" : `display:block;width:${c};`;
|
|
1199
1226
|
return p`
|
|
1200
|
-
<div style="
|
|
1201
|
-
<a style="${
|
|
1227
|
+
<div style="text-align:${d};">
|
|
1228
|
+
<a style="${f}background-color:${t};color:${o};font-size:${n};font-weight:${i};border-radius:${s};padding:${r};text-decoration:none;text-align:center;${u}cursor:pointer;font-family:arial,helvetica,sans-serif;">${a}</a>
|
|
1202
1229
|
</div>
|
|
1203
1230
|
`;
|
|
1204
1231
|
},
|
|
1205
1232
|
renderHtml(e) {
|
|
1206
|
-
const t =
|
|
1233
|
+
const t = l(e, "containerPadding", "10px"), { bg: o, color: n } = st(e), i = l(e, "fontSize", "14px"), s = l(e, "fontWeight", "700"), r = l(e, "borderRadius", "4px"), a = l(e, "buttonPadding", l(e, "padding", "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), w = u !== "0px" ? `border:${u} solid ${f};` : "border:none;", x = St(d, h, { bgColor: o, textColor: n, fontSize: i, fontWeight: s, borderRadius: r }), m = x ? `${x}
|
|
1207
1234
|
<!--[if !mso]><!-->` : "<!--[if !mso]><!-->", v = `<div align="${c}">
|
|
1208
1235
|
${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:${
|
|
1236
|
+
<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;${w}mso-border-alt:none;"><span style="line-height:120%;">${d}</span></a>
|
|
1210
1237
|
<!--<![endif]-->
|
|
1211
1238
|
</div>`;
|
|
1212
1239
|
return z(v, { padding: t, align: c });
|
|
1213
1240
|
}
|
|
1214
1241
|
}
|
|
1215
|
-
},
|
|
1242
|
+
}, Pt = {
|
|
1216
1243
|
name: "divider",
|
|
1217
1244
|
label: "Divider",
|
|
1218
1245
|
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="2" y1="12" x2="22" y2="12"/></svg>',
|
|
@@ -1259,53 +1286,53 @@ const _t = {
|
|
|
1259
1286
|
},
|
|
1260
1287
|
renderer: {
|
|
1261
1288
|
renderEditor(e) {
|
|
1262
|
-
const t =
|
|
1263
|
-
return p`<div
|
|
1289
|
+
const t = l(e, "containerPadding", "10px"), o = l(e, "width", "100%"), n = `${l(e, "borderTopWidth", "1px")} ${l(e, "borderTopStyle", "solid")} ${l(e, "borderTopColor", "#cccccc")}`;
|
|
1290
|
+
return p`<div><div style="border-top:${n};width:${o};margin:0 auto;"></div></div>`;
|
|
1264
1291
|
},
|
|
1265
1292
|
renderHtml(e) {
|
|
1266
|
-
const t =
|
|
1293
|
+
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;"> </td></tr></tbody></table>`;
|
|
1267
1294
|
return z(i, { padding: t, align: "center" });
|
|
1268
1295
|
}
|
|
1269
1296
|
}
|
|
1270
|
-
},
|
|
1271
|
-
_t,
|
|
1297
|
+
}, Et = [
|
|
1272
1298
|
Dt,
|
|
1273
|
-
St,
|
|
1274
1299
|
Rt,
|
|
1275
1300
|
Tt,
|
|
1276
|
-
It
|
|
1277
|
-
|
|
1301
|
+
It,
|
|
1302
|
+
Mt,
|
|
1303
|
+
Pt
|
|
1304
|
+
], rt = [
|
|
1278
1305
|
{
|
|
1279
1306
|
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-
|
|
1307
|
+
loader: () => import("./html-tool-DMtmrF3n.js").then((e) => e.htmlTool)
|
|
1281
1308
|
},
|
|
1282
1309
|
{
|
|
1283
1310
|
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-
|
|
1311
|
+
loader: () => import("./social-tool-CRY3-_sU.js").then((e) => e.socialTool)
|
|
1285
1312
|
},
|
|
1286
1313
|
{
|
|
1287
1314
|
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-
|
|
1315
|
+
loader: () => import("./menu-tool-CJcQdpcP.js").then((e) => e.menuTool)
|
|
1289
1316
|
},
|
|
1290
1317
|
{
|
|
1291
1318
|
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-
|
|
1319
|
+
loader: () => import("./video-tool-g1fIoCWW.js").then((e) => e.videoTool)
|
|
1293
1320
|
},
|
|
1294
1321
|
{
|
|
1295
1322
|
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-
|
|
1323
|
+
loader: () => import("./timer-tool-BVE1shO1.js").then((e) => e.timerTool)
|
|
1297
1324
|
},
|
|
1298
1325
|
{
|
|
1299
1326
|
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-
|
|
1327
|
+
loader: () => import("./table-tool-DeIQci5z.js").then((e) => e.tableTool)
|
|
1301
1328
|
},
|
|
1302
1329
|
{
|
|
1303
1330
|
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-
|
|
1331
|
+
loader: () => import("./form-tool-DdFDrS3b.js").then((e) => e.formTool)
|
|
1305
1332
|
}
|
|
1306
1333
|
];
|
|
1307
|
-
function
|
|
1308
|
-
const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", s = o.fontFamily?.value || "arial,helvetica,sans-serif", r = o.textColor || "#000000",
|
|
1334
|
+
function zt(e, t, o) {
|
|
1335
|
+
const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", s = o.fontFamily?.value || "arial,helvetica,sans-serif", r = o.textColor || "#000000", a = o.preheaderText || "" || "‌", d = `<div style="display:none;font-size:1px;color:${n};line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">${a}${"‌ ".repeat(80)}</div>`;
|
|
1309
1336
|
return `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
1310
1337
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
|
1311
1338
|
<head>
|
|
@@ -1355,32 +1382,32 @@ function Pt(e, t, o) {
|
|
|
1355
1382
|
</body>
|
|
1356
1383
|
</html>`;
|
|
1357
1384
|
}
|
|
1358
|
-
function
|
|
1359
|
-
const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", s = e.values.columnsBackgroundColor || "", r = e.values.padding || "0px",
|
|
1385
|
+
function Lt(e, t, o) {
|
|
1386
|
+
const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", s = e.values.columnsBackgroundColor || "", r = e.values.padding || "0px", a = e.cells.reduce((m, y) => m + y, 0), d = i ? `background-color:${i};` : "", c = e.values.backgroundImage;
|
|
1360
1387
|
let h = "";
|
|
1361
1388
|
if (c?.url) {
|
|
1362
|
-
const m = c.repeat === !0 || c.repeat === "repeat" ? "repeat" : "no-repeat",
|
|
1363
|
-
h = `background-image:url('${c.url}');background-repeat:${m};background-position:${v};background-size:${
|
|
1389
|
+
const m = c.repeat === !0 || c.repeat === "repeat" ? "repeat" : "no-repeat", y = c.cover === !0 ? "cover" : c.fullWidth === !0 ? "100% auto" : "auto", v = c.center !== !1 ? "center top" : "left top";
|
|
1390
|
+
h = `background-image:url('${c.url}');background-repeat:${m};background-position:${v};background-size:${y};`;
|
|
1364
1391
|
}
|
|
1365
|
-
const g = e.columns.length > 1, u = e.columns.map((m,
|
|
1366
|
-
const v = Math.round(e.cells[
|
|
1367
|
-
return { colHtml:
|
|
1392
|
+
const g = e.columns.length > 1, u = e.columns.map((m, y) => {
|
|
1393
|
+
const v = Math.round(e.cells[y] / a * n);
|
|
1394
|
+
return { colHtml: Vt(m, v, s, t, o), colWidthPx: v };
|
|
1368
1395
|
});
|
|
1369
1396
|
let f;
|
|
1370
1397
|
if (g) {
|
|
1371
1398
|
const m = u.map(
|
|
1372
|
-
({ colHtml:
|
|
1399
|
+
({ colHtml: y, colWidthPx: v }) => `<!--[if (mso)|(IE)]><td align="center" width="${v}" style="width:${v}px;padding:0px;" valign="top"><![endif]-->${y}<!--[if (mso)|(IE)]></td><![endif]-->`
|
|
1373
1400
|
);
|
|
1374
1401
|
f = `<!--[if (mso)|(IE)]><table role="presentation" width="${n}" cellpadding="0" cellspacing="0" border="0"><tr><![endif]-->${m.join("")}<!--[if (mso)|(IE)]></tr></table><![endif]-->`;
|
|
1375
1402
|
} else
|
|
1376
1403
|
f = u.map(({ colHtml: m }) => m).join("");
|
|
1377
|
-
const
|
|
1378
|
-
return `<div class="u_row${
|
|
1404
|
+
const w = e.values.hideDesktop ? " u_hide_desktop" : "", x = e.values.hideMobile ? " u_hide_mobile" : "";
|
|
1405
|
+
return `<div class="u_row${w}${x}" style="padding:${r};${d}${h}">
|
|
1379
1406
|
<div style="margin:0 auto;max-width:${n}px;${g ? "font-size:0;" : ""}text-align:center;">${f}</div>
|
|
1380
1407
|
</div>`;
|
|
1381
1408
|
}
|
|
1382
|
-
function
|
|
1383
|
-
const s = e.values.backgroundColor || o || "", r = e.values.padding || "0px",
|
|
1409
|
+
function Vt(e, t, o, n, i) {
|
|
1410
|
+
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) => {
|
|
1384
1411
|
const g = i.get(h.type);
|
|
1385
1412
|
if (!g) return `<!-- unknown tool: ${h.type} -->`;
|
|
1386
1413
|
const u = {
|
|
@@ -1390,19 +1417,19 @@ function zt(e, t, o, n, i) {
|
|
|
1390
1417
|
bodyValues: n
|
|
1391
1418
|
};
|
|
1392
1419
|
let f = g(h.values, u);
|
|
1393
|
-
const
|
|
1394
|
-
return (
|
|
1420
|
+
const w = !!h.values.hideDesktop, x = !!h.values.hideMobile;
|
|
1421
|
+
return (w || x) && (f = `<div class="${[w && "u_hide_desktop", x && "u_hide_mobile"].filter(Boolean).join(" ")}">${f}</div>`), f;
|
|
1395
1422
|
}).join(`
|
|
1396
1423
|
`);
|
|
1397
1424
|
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}${
|
|
1425
|
+
<div style="width:100%;${d}${a !== "0px" ? `border-radius:${a};` : ""}">
|
|
1399
1426
|
<div style="padding:${r};">
|
|
1400
1427
|
${c || " "}
|
|
1401
1428
|
</div>
|
|
1402
1429
|
</div>
|
|
1403
1430
|
</div>`;
|
|
1404
1431
|
}
|
|
1405
|
-
function
|
|
1432
|
+
function At(e) {
|
|
1406
1433
|
return `
|
|
1407
1434
|
@media only screen and (min-width: ${e + 20}px) {
|
|
1408
1435
|
.u_row .u_column { display: inline-block !important; }
|
|
@@ -1451,9 +1478,8 @@ function Lt(e) {
|
|
|
1451
1478
|
.u_hide_mobile { display: block !important; }
|
|
1452
1479
|
}`;
|
|
1453
1480
|
}
|
|
1454
|
-
const
|
|
1481
|
+
const Bt = [
|
|
1455
1482
|
"box-sizing",
|
|
1456
|
-
"float",
|
|
1457
1483
|
"overflow-wrap",
|
|
1458
1484
|
"word-break",
|
|
1459
1485
|
"word-wrap",
|
|
@@ -1462,25 +1488,24 @@ const Vt = [
|
|
|
1462
1488
|
"transition",
|
|
1463
1489
|
"animation",
|
|
1464
1490
|
"transform",
|
|
1465
|
-
"position",
|
|
1466
1491
|
"z-index",
|
|
1467
1492
|
"display:\\s*flex",
|
|
1468
1493
|
"display:\\s*grid",
|
|
1469
1494
|
"gap"
|
|
1470
|
-
],
|
|
1471
|
-
`(?:;\\s*|^\\s*)(${
|
|
1495
|
+
], Ot = new RegExp(
|
|
1496
|
+
`(?:;\\s*|^\\s*)(${Bt.join("|")})\\s*:[^;]*;?`,
|
|
1472
1497
|
"gi"
|
|
1473
|
-
),
|
|
1474
|
-
function
|
|
1498
|
+
), Ht = /var\(--[^)]*\)/gi;
|
|
1499
|
+
function jt(e) {
|
|
1475
1500
|
return e.replace(/style="([^"]*)"/gi, (t, o) => {
|
|
1476
1501
|
let n = o;
|
|
1477
|
-
return n = n.replace(
|
|
1502
|
+
return n = n.replace(Ot, ""), n = n.replace(Ht, "inherit"), n = n.replace(/;\s*;/g, ";").replace(/^\s*;\s*/, "").replace(/;\s*$/, "").trim(), n ? `style="${n}"` : "";
|
|
1478
1503
|
});
|
|
1479
1504
|
}
|
|
1480
|
-
function
|
|
1481
|
-
const n = e.body.values, i = parseInt(n.contentWidth || "600"), s = e.body.rows.map((u) =>
|
|
1482
|
-
`), r =
|
|
1483
|
-
let d =
|
|
1505
|
+
function Wt(e, t, o) {
|
|
1506
|
+
const n = e.body.values, i = parseInt(n.contentWidth || "600"), s = e.body.rows.map((u) => Lt(u, n, t)).join(`
|
|
1507
|
+
`), r = At(i), a = jt(s);
|
|
1508
|
+
let d = zt(a, r, n);
|
|
1484
1509
|
if (o?.mergeTags)
|
|
1485
1510
|
for (const [u, f] of Object.entries(o.mergeTags))
|
|
1486
1511
|
d = d.replaceAll(`{{${u}}}`, f);
|
|
@@ -1521,10 +1546,10 @@ class T {
|
|
|
1521
1546
|
}));
|
|
1522
1547
|
}
|
|
1523
1548
|
}
|
|
1524
|
-
var
|
|
1525
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1549
|
+
var Ut = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, dt = (e, t, o, n) => {
|
|
1550
|
+
for (var i = n > 1 ? void 0 : n ? Ft(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
1526
1551
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
1527
|
-
return n && i &&
|
|
1552
|
+
return n && i && Ut(t, o, i), i;
|
|
1528
1553
|
};
|
|
1529
1554
|
let V = class extends $ {
|
|
1530
1555
|
constructor() {
|
|
@@ -1651,40 +1676,37 @@ V.styles = k`
|
|
|
1651
1676
|
stroke-linejoin: round;
|
|
1652
1677
|
}
|
|
1653
1678
|
`;
|
|
1654
|
-
|
|
1679
|
+
dt([
|
|
1655
1680
|
b({ type: Boolean })
|
|
1656
1681
|
], V.prototype, "visible", 2);
|
|
1657
|
-
V =
|
|
1682
|
+
V = dt([
|
|
1658
1683
|
C("me-inline-toolbar")
|
|
1659
1684
|
], V);
|
|
1660
|
-
var
|
|
1661
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1685
|
+
var Nt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, O = (e, t, o, n) => {
|
|
1686
|
+
for (var i = n > 1 ? void 0 : n ? qt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
1662
1687
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
1663
|
-
return n && i &&
|
|
1688
|
+
return n && i && Nt(t, o, i), i;
|
|
1664
1689
|
};
|
|
1665
|
-
const
|
|
1666
|
-
function
|
|
1690
|
+
const lt = /* @__PURE__ */ new Set(["text", "heading", "paragraph"]);
|
|
1691
|
+
function at(e) {
|
|
1667
1692
|
return e === "html" ? "html" : "text";
|
|
1668
1693
|
}
|
|
1669
|
-
let
|
|
1694
|
+
let S = class extends $ {
|
|
1670
1695
|
constructor() {
|
|
1671
|
-
super(...arguments), this.storeCtrl = new T(this, ["design", "selection", "hover", "viewMode"]), this.editing = !1, this.toolbar = null, this.editableEl = null, this.saveDebounceTimer = null, this.
|
|
1672
|
-
|
|
1673
|
-
e.preventDefault();
|
|
1674
|
-
return;
|
|
1675
|
-
}
|
|
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
|
-
}, this._onDragEnd = () => {
|
|
1678
|
-
this.style.opacity = "1", L.reset();
|
|
1679
|
-
}, this.handleInlineInput = () => {
|
|
1680
|
-
this.saveDebounceTimer && clearTimeout(this.saveDebounceTimer), this.saveDebounceTimer = setTimeout(() => this.saveInlineContent(), 500), this.showToolbar();
|
|
1696
|
+
super(...arguments), this.storeCtrl = new T(this, ["design", "selection", "hover", "viewMode"]), this.editing = !1, this.toolbar = null, this.editableEl = null, this.saveDebounceTimer = null, this.handleInlineInput = () => {
|
|
1697
|
+
this.showToolbar();
|
|
1681
1698
|
}, this.handleInlineBlur = (e) => {
|
|
1682
1699
|
const t = e.relatedTarget;
|
|
1683
1700
|
t && (t.closest("me-inline-toolbar") || this.toolbar?.contains(t)) || setTimeout(() => {
|
|
1684
|
-
|
|
1701
|
+
document.activeElement !== this.editableEl && !this.toolbar?.matches(":hover") && this.stopEditing();
|
|
1685
1702
|
}, 150);
|
|
1703
|
+
}, this.handleOverlayBlur = (e) => {
|
|
1704
|
+
const t = e.relatedTarget;
|
|
1705
|
+
t && (t.closest("me-inline-toolbar") || this.toolbar?.contains(t)) || setTimeout(() => {
|
|
1706
|
+
document.activeElement !== this.editableEl && !this.toolbar?.matches(":hover") && this.stopEditing();
|
|
1707
|
+
}, 200);
|
|
1686
1708
|
}, this.handleInlineKeydown = (e) => {
|
|
1687
|
-
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this.stopEditing())
|
|
1709
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this.stopEditing());
|
|
1688
1710
|
};
|
|
1689
1711
|
}
|
|
1690
1712
|
set store(e) {
|
|
@@ -1698,7 +1720,7 @@ let D = class extends $ {
|
|
|
1698
1720
|
e.stopPropagation(), this.editing || this.store.select(this.content.id);
|
|
1699
1721
|
}
|
|
1700
1722
|
handleDblClick(e) {
|
|
1701
|
-
e.stopPropagation(),
|
|
1723
|
+
e.stopPropagation(), lt.has(this.content.type) && this.startEditing();
|
|
1702
1724
|
}
|
|
1703
1725
|
handleMouseEnter() {
|
|
1704
1726
|
this.store.hover(this.content.id);
|
|
@@ -1712,23 +1734,46 @@ let D = class extends $ {
|
|
|
1712
1734
|
handleDuplicate(e) {
|
|
1713
1735
|
e.stopPropagation(), this.store.duplicateContent(this.content.id);
|
|
1714
1736
|
}
|
|
1737
|
+
/** Called from the drag handle only (not the whole block) */
|
|
1738
|
+
handleDragStart(e) {
|
|
1739
|
+
e.stopPropagation(), e.dataTransfer.setData("application/maileditor-content", this.content.id), e.dataTransfer.effectAllowed = "move", this.style.opacity = "0.4", L.startContentDrag(this.content.id);
|
|
1740
|
+
}
|
|
1741
|
+
handleDragEnd() {
|
|
1742
|
+
this.style.opacity = "1", L.reset();
|
|
1743
|
+
}
|
|
1715
1744
|
// ── Inline editing ───────────────────────────────────────
|
|
1716
1745
|
startEditing() {
|
|
1717
|
-
this.editing = !0, this.classList.add("editing"), this.
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1746
|
+
this.editing = !0, this.classList.add("editing"), this.storeCtrl.hostDisconnected();
|
|
1747
|
+
const e = this.getBoundingClientRect(), t = this.getInlineStyles(this.content.values), o = at(this.content.type), n = this.content.values[o] || "", i = document.createElement("div");
|
|
1748
|
+
i.contentEditable = "true", i.innerHTML = n, Object.assign(i.style, {
|
|
1749
|
+
position: "fixed",
|
|
1750
|
+
left: e.left + "px",
|
|
1751
|
+
top: e.top + "px",
|
|
1752
|
+
width: e.width + "px",
|
|
1753
|
+
minHeight: e.height + "px",
|
|
1754
|
+
zIndex: "9999",
|
|
1755
|
+
background: "white",
|
|
1756
|
+
boxShadow: "0 0 0 2px #8b5cf6, 0 4px 16px rgba(0,0,0,0.15)",
|
|
1757
|
+
borderRadius: "2px",
|
|
1758
|
+
outline: "none",
|
|
1759
|
+
boxSizing: "border-box"
|
|
1760
|
+
}), t.split(";").forEach((a) => {
|
|
1761
|
+
const [d, c] = a.split(":").map((h) => h?.trim());
|
|
1762
|
+
if (d && c)
|
|
1763
|
+
try {
|
|
1764
|
+
i.style.setProperty(d, c);
|
|
1765
|
+
} catch {
|
|
1766
|
+
}
|
|
1767
|
+
}), i.addEventListener("keydown", this.handleInlineKeydown), i.addEventListener("blur", this.handleOverlayBlur), document.body.appendChild(i), this.editableEl = i, i.focus();
|
|
1768
|
+
const s = window.getSelection(), r = document.createRange();
|
|
1769
|
+
r.selectNodeContents(i), r.collapse(!1), s?.removeAllRanges(), s?.addRange(r), this.showToolbar();
|
|
1725
1770
|
}
|
|
1726
1771
|
stopEditing() {
|
|
1727
|
-
this.editing && (this.saveInlineContent(), this.
|
|
1772
|
+
this.editing && (this.saveInlineContent(), this.editableEl && (this.editableEl.removeEventListener("keydown", this.handleInlineKeydown), this.editableEl.removeEventListener("blur", this.handleOverlayBlur), this.editableEl.remove()), this.editing = !1, this.classList.remove("editing"), this.editableEl = null, this.storeCtrl.hostConnected(), this.requestUpdate(), this.toolbar?.hide());
|
|
1728
1773
|
}
|
|
1729
1774
|
saveInlineContent() {
|
|
1730
1775
|
if (!this.editableEl) return;
|
|
1731
|
-
const e = this.editableEl.innerHTML, t =
|
|
1776
|
+
const e = this.editableEl.innerHTML, t = at(this.content.type), o = this.content.values[t];
|
|
1732
1777
|
e !== o && this.store.updateContentValues(this.content.id, { [t]: e });
|
|
1733
1778
|
}
|
|
1734
1779
|
showToolbar() {
|
|
@@ -1736,54 +1781,48 @@ let D = class extends $ {
|
|
|
1736
1781
|
}
|
|
1737
1782
|
// ── Lifecycle ────────────────────────────────────────────
|
|
1738
1783
|
connectedCallback() {
|
|
1739
|
-
super.connectedCallback()
|
|
1784
|
+
super.connectedCallback();
|
|
1740
1785
|
}
|
|
1741
1786
|
disconnectedCallback() {
|
|
1742
|
-
super.disconnectedCallback(), this.
|
|
1787
|
+
super.disconnectedCallback(), this.toolbar?.remove(), this.toolbar = null, this.saveDebounceTimer && clearTimeout(this.saveDebounceTimer);
|
|
1743
1788
|
}
|
|
1744
1789
|
// ── Render ───────────────────────────────────────────────
|
|
1745
1790
|
render() {
|
|
1746
1791
|
if (!this.store) return p``;
|
|
1747
1792
|
const e = this.store.selectedId === this.content.id, t = this.store.hoveredId === this.content.id, o = this.store.viewMode, n = !!this.content.values.hideDesktop, i = !!this.content.values.hideMobile, s = o === "desktop" && n || o === "mobile" && i;
|
|
1748
|
-
this.classList.toggle("selected", e && !this.editing), this.classList.toggle("hovered", t && !this.editing), this.classList.toggle("hidden-in-view", s), this.
|
|
1793
|
+
this.classList.toggle("selected", e && !this.editing), this.classList.toggle("hovered", t && !this.editing), this.classList.toggle("hidden-in-view", s), this.removeAttribute("draggable"), this.dataset.contentId = this.content.id, this.editing && !e && this.stopEditing();
|
|
1749
1794
|
const r = this.toolRegistry.get(this.content.type);
|
|
1750
1795
|
if (!r && this.toolRegistry.has(this.content.type))
|
|
1751
1796
|
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
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
style=${f}
|
|
1761
|
-
.innerHTML=${u}
|
|
1762
|
-
@input=${this.handleInlineInput}
|
|
1763
|
-
@blur=${this.handleInlineBlur}
|
|
1764
|
-
@keydown=${this.handleInlineKeydown}
|
|
1765
|
-
></div>
|
|
1766
|
-
</div>
|
|
1767
|
-
`;
|
|
1768
|
-
}
|
|
1769
|
-
const c = r?.renderer.renderEditor(this.content.values, {
|
|
1797
|
+
const a = n ? "Hidden on desktop" : i ? "Hidden on mobile" : "", d = lt.has(this.content.type), c = p`
|
|
1798
|
+
<button class="drag-handle" draggable="true" title="Drag to move"
|
|
1799
|
+
@dragstart=${(u) => this.handleDragStart(u)}
|
|
1800
|
+
@dragend=${() => this.handleDragEnd()}
|
|
1801
|
+
@mousedown=${(u) => u.stopPropagation()}>
|
|
1802
|
+
<svg viewBox="0 0 16 16"><circle cx="5" cy="3" r="1.5"/><circle cx="11" cy="3" r="1.5"/><circle cx="5" cy="8" r="1.5"/><circle cx="11" cy="8" r="1.5"/><circle cx="5" cy="13" r="1.5"/><circle cx="11" cy="13" r="1.5"/></svg>
|
|
1803
|
+
</button>
|
|
1804
|
+
`, h = r?.renderer.renderEditor(this.content.values, {
|
|
1770
1805
|
isSelected: e,
|
|
1771
1806
|
isHovered: t,
|
|
1772
1807
|
columnWidth: 600,
|
|
1773
1808
|
displayMode: "email"
|
|
1774
1809
|
});
|
|
1810
|
+
if (this.editing && d)
|
|
1811
|
+
return p`${c}<div class="content-wrapper" style="visibility:hidden;">${h}</div>`;
|
|
1812
|
+
const g = this.content.values.containerPadding || "0px";
|
|
1775
1813
|
return p`
|
|
1776
|
-
${s ? p`<div class="hidden-badge">${
|
|
1814
|
+
${s ? p`<div class="hidden-badge">${a}</div>` : ""}
|
|
1815
|
+
${c}
|
|
1777
1816
|
<div class="action-bar">
|
|
1778
1817
|
<button class="action-btn" @click=${this.handleDuplicate} title="Duplicate">♻</button>
|
|
1779
1818
|
<button class="action-btn" @click=${this.handleDelete} title="Delete">✕</button>
|
|
1780
1819
|
</div>
|
|
1781
|
-
<div class="content-wrapper"
|
|
1820
|
+
<div class="content-wrapper" style="padding:${g};"
|
|
1782
1821
|
@click=${this.handleClick}
|
|
1783
1822
|
@dblclick=${this.handleDblClick}
|
|
1784
1823
|
@mouseenter=${this.handleMouseEnter}
|
|
1785
1824
|
@mouseleave=${this.handleMouseLeave}>
|
|
1786
|
-
${
|
|
1825
|
+
${h ?? p`<div style="padding:10px;color:#999;font-style:italic;">Unknown tool: ${this.content.type}</div>`}
|
|
1787
1826
|
</div>
|
|
1788
1827
|
`;
|
|
1789
1828
|
}
|
|
@@ -1802,8 +1841,8 @@ let D = class extends $ {
|
|
|
1802
1841
|
s && t.push(`font-size:${s}`);
|
|
1803
1842
|
const r = o("fontWeight");
|
|
1804
1843
|
r && t.push(`font-weight:${r}`);
|
|
1805
|
-
const
|
|
1806
|
-
t.push(`line-height:${
|
|
1844
|
+
const a = o("lineHeight", "140%");
|
|
1845
|
+
t.push(`line-height:${a}`);
|
|
1807
1846
|
const d = o("textAlign");
|
|
1808
1847
|
d && t.push(`text-align:${d}`);
|
|
1809
1848
|
const c = o("letterSpacing");
|
|
@@ -1812,14 +1851,14 @@ let D = class extends $ {
|
|
|
1812
1851
|
return typeof h == "string" ? t.push(`font-family:${h}`) : h && typeof h == "object" && t.push(`font-family:${h.value || "inherit"}`), t.push("word-break:break-word", "outline:none", "min-height:1em"), t.join(";");
|
|
1813
1852
|
}
|
|
1814
1853
|
};
|
|
1815
|
-
|
|
1854
|
+
S.styles = k`
|
|
1816
1855
|
:host {
|
|
1817
|
-
display: block; position: relative;
|
|
1856
|
+
display: block; position: relative;
|
|
1818
1857
|
transition: outline 0.15s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
|
|
1819
1858
|
}
|
|
1820
1859
|
:host(.selected) { outline: 2px solid #3b82f6; outline-offset: -1px; }
|
|
1821
1860
|
:host(.hovered:not(.selected)) { outline: 2px dashed #93c5fd; outline-offset: -1px; }
|
|
1822
|
-
:host(.editing) { outline: 2px solid #8b5cf6; outline-offset: -1px;
|
|
1861
|
+
:host(.editing) { outline: 2px solid #8b5cf6; outline-offset: -1px; }
|
|
1823
1862
|
:host(.just-dropped) {
|
|
1824
1863
|
animation: dropIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
1825
1864
|
}
|
|
@@ -1834,6 +1873,39 @@ D.styles = k`
|
|
|
1834
1873
|
0% { opacity: 0; transform: scale(0.92) translateY(-8px); }
|
|
1835
1874
|
100% { opacity: 1; transform: scale(1) translateY(0); }
|
|
1836
1875
|
}
|
|
1876
|
+
/* Drag handle — straddles the right border, vertically centered */
|
|
1877
|
+
.drag-handle {
|
|
1878
|
+
display: none;
|
|
1879
|
+
position: absolute;
|
|
1880
|
+
top: 50%;
|
|
1881
|
+
right: -12px;
|
|
1882
|
+
transform: translateY(-50%);
|
|
1883
|
+
width: 24px;
|
|
1884
|
+
height: 24px;
|
|
1885
|
+
background: #3b82f6;
|
|
1886
|
+
color: white;
|
|
1887
|
+
border: 2px solid white;
|
|
1888
|
+
border-radius: 50%;
|
|
1889
|
+
cursor: grab;
|
|
1890
|
+
z-index: 20;
|
|
1891
|
+
align-items: center;
|
|
1892
|
+
justify-content: center;
|
|
1893
|
+
padding: 0;
|
|
1894
|
+
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
|
|
1895
|
+
transition: background 0.15s ease, transform 0.15s ease;
|
|
1896
|
+
}
|
|
1897
|
+
.drag-handle:hover {
|
|
1898
|
+
background: #2563eb;
|
|
1899
|
+
transform: translateY(-50%) scale(1.15);
|
|
1900
|
+
}
|
|
1901
|
+
.drag-handle:active { cursor: grabbing; }
|
|
1902
|
+
.drag-handle svg {
|
|
1903
|
+
width: 12px; height: 12px; fill: currentColor; stroke: none;
|
|
1904
|
+
}
|
|
1905
|
+
:host(.selected) .drag-handle,
|
|
1906
|
+
:host(.hovered) .drag-handle { display: flex; }
|
|
1907
|
+
:host(.editing) .drag-handle { display: none; }
|
|
1908
|
+
/* Action bar */
|
|
1837
1909
|
.action-bar {
|
|
1838
1910
|
display: none; position: absolute; top: -28px; right: 4px;
|
|
1839
1911
|
background: #3b82f6; border-radius: 4px; padding: 2px; gap: 2px; z-index: 10;
|
|
@@ -1844,37 +1916,39 @@ D.styles = k`
|
|
|
1844
1916
|
padding: 2px 6px; font-size: 12px; line-height: 1; border-radius: 2px;
|
|
1845
1917
|
}
|
|
1846
1918
|
.action-btn:hover { background: rgba(255,255,255,0.2); }
|
|
1847
|
-
.content-wrapper { position: relative; }
|
|
1919
|
+
.content-wrapper { position: relative; cursor: default; box-sizing: border-box; }
|
|
1920
|
+
/* Reset paragraph margins in user content to match email rendering.
|
|
1921
|
+
Override inline margin from external editors (e.g. margin: 1.25em 0px). */
|
|
1922
|
+
.content-wrapper p { margin: 0 !important; }
|
|
1923
|
+
/* Reset paragraph margins to match email rendering.
|
|
1924
|
+
Spacing comes from line-height, <br>, and in the HTML content. */
|
|
1925
|
+
.content-wrapper p { margin: 0; }
|
|
1848
1926
|
.inline-editable {
|
|
1849
|
-
outline: none;
|
|
1850
|
-
cursor: text;
|
|
1851
|
-
min-height: 1em;
|
|
1852
|
-
}
|
|
1853
|
-
.inline-editable:focus {
|
|
1854
|
-
outline: none;
|
|
1927
|
+
outline: none; cursor: text; min-height: 1em;
|
|
1855
1928
|
}
|
|
1929
|
+
.inline-editable:focus { outline: none; }
|
|
1856
1930
|
`;
|
|
1857
1931
|
O([
|
|
1858
1932
|
b({ attribute: !1 })
|
|
1859
|
-
],
|
|
1933
|
+
], S.prototype, "content", 2);
|
|
1860
1934
|
O([
|
|
1861
1935
|
b({ attribute: !1 })
|
|
1862
|
-
],
|
|
1936
|
+
], S.prototype, "store", 1);
|
|
1863
1937
|
O([
|
|
1864
1938
|
b({ attribute: !1 })
|
|
1865
|
-
],
|
|
1939
|
+
], S.prototype, "toolRegistry", 2);
|
|
1866
1940
|
O([
|
|
1867
|
-
|
|
1868
|
-
],
|
|
1869
|
-
|
|
1941
|
+
ht()
|
|
1942
|
+
], S.prototype, "editing", 2);
|
|
1943
|
+
S = O([
|
|
1870
1944
|
C("me-content-renderer")
|
|
1871
|
-
],
|
|
1872
|
-
var
|
|
1873
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1945
|
+
], S);
|
|
1946
|
+
var Gt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, H = (e, t, o, n) => {
|
|
1947
|
+
for (var i = n > 1 ? void 0 : n ? Kt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
1874
1948
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
1875
|
-
return n && i &&
|
|
1949
|
+
return n && i && Gt(t, o, i), i;
|
|
1876
1950
|
};
|
|
1877
|
-
let
|
|
1951
|
+
let D = class extends $ {
|
|
1878
1952
|
constructor() {
|
|
1879
1953
|
super(...arguments), this.storeCtrl = new T(this, ["design"]), this.widthPercent = 100;
|
|
1880
1954
|
}
|
|
@@ -1903,7 +1977,7 @@ let S = class extends $ {
|
|
|
1903
1977
|
`;
|
|
1904
1978
|
}
|
|
1905
1979
|
};
|
|
1906
|
-
|
|
1980
|
+
D.styles = k`
|
|
1907
1981
|
:host {
|
|
1908
1982
|
display: block;
|
|
1909
1983
|
min-height: 40px;
|
|
@@ -1935,23 +2009,23 @@ S.styles = k`
|
|
|
1935
2009
|
`;
|
|
1936
2010
|
H([
|
|
1937
2011
|
b({ attribute: !1 })
|
|
1938
|
-
],
|
|
2012
|
+
], D.prototype, "column", 2);
|
|
1939
2013
|
H([
|
|
1940
2014
|
b({ attribute: !1 })
|
|
1941
|
-
],
|
|
2015
|
+
], D.prototype, "store", 1);
|
|
1942
2016
|
H([
|
|
1943
2017
|
b({ attribute: !1 })
|
|
1944
|
-
],
|
|
2018
|
+
], D.prototype, "toolRegistry", 2);
|
|
1945
2019
|
H([
|
|
1946
2020
|
b({ type: Number })
|
|
1947
|
-
],
|
|
1948
|
-
|
|
2021
|
+
], D.prototype, "widthPercent", 2);
|
|
2022
|
+
D = H([
|
|
1949
2023
|
C("me-column-renderer")
|
|
1950
|
-
],
|
|
1951
|
-
var
|
|
1952
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2024
|
+
], D);
|
|
2025
|
+
var Yt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, F = (e, t, o, n) => {
|
|
2026
|
+
for (var i = n > 1 ? void 0 : n ? Jt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
1953
2027
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
1954
|
-
return n && i &&
|
|
2028
|
+
return n && i && Yt(t, o, i), i;
|
|
1955
2029
|
};
|
|
1956
2030
|
let R = class extends $ {
|
|
1957
2031
|
constructor() {
|
|
@@ -1981,15 +2055,15 @@ let R = class extends $ {
|
|
|
1981
2055
|
}
|
|
1982
2056
|
render() {
|
|
1983
2057
|
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),
|
|
2058
|
+
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 : "";
|
|
1985
2059
|
let c = "";
|
|
1986
2060
|
if (d) {
|
|
1987
|
-
const x =
|
|
1988
|
-
c = `background-image:url('${d}');background-size:${m};background-position:${
|
|
2061
|
+
const x = a.repeat === !0 || a.repeat === "repeat" ? "repeat" : "no-repeat", m = a.cover === !0 ? "cover" : a.fullWidth === !0 ? "100% auto" : "auto", y = a.center !== !1 ? "center" : "top left";
|
|
2062
|
+
c = `background-image:url('${d}');background-size:${m};background-position:${y};background-repeat:${x};`;
|
|
1989
2063
|
}
|
|
1990
|
-
const h = t.viewMode, g = !!e.values.hideDesktop, u = !!e.values.hideMobile, f = h === "desktop" && g || h === "mobile" && u,
|
|
2064
|
+
const h = t.viewMode, g = !!e.values.hideDesktop, u = !!e.values.hideMobile, f = h === "desktop" && g || h === "mobile" && u, w = g ? "Hidden on desktop" : u ? "Hidden on mobile" : "";
|
|
1991
2065
|
return this.classList.toggle("hidden-in-view", f), this.setAttribute("draggable", "true"), this.dataset.rowId = e.id, p`
|
|
1992
|
-
${f ? p`<div class="row-hidden-badge">${
|
|
2066
|
+
${f ? p`<div class="row-hidden-badge">${w}</div>` : ""}
|
|
1993
2067
|
<div class="row-actions">
|
|
1994
2068
|
<button class="row-action-btn" @click=${this.handleMoveUp} title="Move Up">
|
|
1995
2069
|
<svg viewBox="0 0 24 24"><path d="M12 19V5"/><path d="m5 12 7-7 7 7"/></svg>
|
|
@@ -2009,13 +2083,13 @@ let R = class extends $ {
|
|
|
2009
2083
|
style="background-color:${n};padding:${s};${c}"
|
|
2010
2084
|
>
|
|
2011
2085
|
${e.columns.map((x, m) => {
|
|
2012
|
-
const
|
|
2086
|
+
const y = e.cells[m] / r * 100;
|
|
2013
2087
|
return p`
|
|
2014
2088
|
<me-column-renderer
|
|
2015
2089
|
.column=${x}
|
|
2016
2090
|
.store=${t}
|
|
2017
2091
|
.toolRegistry=${o}
|
|
2018
|
-
.widthPercent=${
|
|
2092
|
+
.widthPercent=${y}
|
|
2019
2093
|
style="background-color:${i};"
|
|
2020
2094
|
></me-column-renderer>
|
|
2021
2095
|
`;
|
|
@@ -2100,10 +2174,10 @@ F([
|
|
|
2100
2174
|
R = F([
|
|
2101
2175
|
C("me-row-renderer")
|
|
2102
2176
|
], R);
|
|
2103
|
-
var
|
|
2104
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2177
|
+
var Xt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, J = (e, t, o, n) => {
|
|
2178
|
+
for (var i = n > 1 ? void 0 : n ? Qt(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
2105
2179
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
2106
|
-
return n && i &&
|
|
2180
|
+
return n && i && Xt(t, o, i), i;
|
|
2107
2181
|
};
|
|
2108
2182
|
let M = class extends $ {
|
|
2109
2183
|
constructor() {
|
|
@@ -2221,10 +2295,10 @@ J([
|
|
|
2221
2295
|
M = J([
|
|
2222
2296
|
C("me-editor-canvas")
|
|
2223
2297
|
], M);
|
|
2224
|
-
var
|
|
2225
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2298
|
+
var Zt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, ct = (e, t, o, n) => {
|
|
2299
|
+
for (var i = n > 1 ? void 0 : n ? te(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
2226
2300
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
2227
|
-
return n && i &&
|
|
2301
|
+
return n && i && Zt(t, o, i), i;
|
|
2228
2302
|
};
|
|
2229
2303
|
const G = [
|
|
2230
2304
|
// System / email-safe fonts
|
|
@@ -2368,16 +2442,16 @@ A.styles = k`
|
|
|
2368
2442
|
}
|
|
2369
2443
|
.align-btn.active { border-color: #3b82f6; background: #eff6ff; color: #3b82f6; }
|
|
2370
2444
|
`;
|
|
2371
|
-
|
|
2445
|
+
ct([
|
|
2372
2446
|
b({ attribute: !1 })
|
|
2373
2447
|
], A.prototype, "store", 1);
|
|
2374
|
-
A =
|
|
2448
|
+
A = ct([
|
|
2375
2449
|
C("me-body-settings")
|
|
2376
2450
|
], A);
|
|
2377
|
-
var
|
|
2378
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2451
|
+
var ee = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, X = (e, t, o, n) => {
|
|
2452
|
+
for (var i = n > 1 ? void 0 : n ? oe(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
2379
2453
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
2380
|
-
return n && i &&
|
|
2454
|
+
return n && i && ee(t, o, i), i;
|
|
2381
2455
|
};
|
|
2382
2456
|
let P = class extends $ {
|
|
2383
2457
|
constructor() {
|
|
@@ -2614,7 +2688,7 @@ X([
|
|
|
2614
2688
|
P = X([
|
|
2615
2689
|
C("me-editor-sidebar")
|
|
2616
2690
|
], P);
|
|
2617
|
-
function
|
|
2691
|
+
function ne(e, t, o) {
|
|
2618
2692
|
const n = e && /^#[0-9a-fA-F]{3,8}$/.test(e) ? e : "#000000";
|
|
2619
2693
|
return p`
|
|
2620
2694
|
<div class="prop-row">
|
|
@@ -2628,7 +2702,7 @@ function ee(e, t, o) {
|
|
|
2628
2702
|
</div>
|
|
2629
2703
|
`;
|
|
2630
2704
|
}
|
|
2631
|
-
function
|
|
2705
|
+
function ie(e, t, o, n) {
|
|
2632
2706
|
const i = n?.options || [];
|
|
2633
2707
|
return p`
|
|
2634
2708
|
<div class="prop-row">
|
|
@@ -2639,7 +2713,7 @@ function oe(e, t, o, n) {
|
|
|
2639
2713
|
</div>
|
|
2640
2714
|
`;
|
|
2641
2715
|
}
|
|
2642
|
-
function
|
|
2716
|
+
function se(e, t, o) {
|
|
2643
2717
|
return p`
|
|
2644
2718
|
<div class="prop-row">
|
|
2645
2719
|
<label class="prop-label">${o}</label>
|
|
@@ -2654,24 +2728,24 @@ function ne(e, t, o) {
|
|
|
2654
2728
|
</div>
|
|
2655
2729
|
`;
|
|
2656
2730
|
}
|
|
2657
|
-
function
|
|
2731
|
+
function re(e) {
|
|
2658
2732
|
const t = (e || "0px").split(/\s+/).map((r) => parseInt(r) || 0), o = t[0], n = t[1] ?? o, i = t[2] ?? o, s = t[3] ?? n;
|
|
2659
2733
|
return [o, n, i, s];
|
|
2660
2734
|
}
|
|
2661
|
-
function
|
|
2735
|
+
function le(e, t, o, n) {
|
|
2662
2736
|
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`;
|
|
2663
2737
|
}
|
|
2664
|
-
function
|
|
2665
|
-
const [n, i, s, r] =
|
|
2738
|
+
function ae(e, t, o) {
|
|
2739
|
+
const [n, i, s, r] = re(e), a = (c, h, g, u) => t(le(c, h, g, u));
|
|
2666
2740
|
return p`
|
|
2667
2741
|
<div class="prop-row">
|
|
2668
2742
|
<label class="prop-label">${o}</label>
|
|
2669
2743
|
<div style="display:grid;grid-template-columns:1fr 1fr;gap:4px;">
|
|
2670
2744
|
${[
|
|
2671
|
-
{ label: "T", val: n, change: (c) =>
|
|
2672
|
-
{ label: "R", val: i, change: (c) =>
|
|
2673
|
-
{ label: "B", val: s, change: (c) =>
|
|
2674
|
-
{ label: "L", val: r, change: (c) =>
|
|
2745
|
+
{ label: "T", val: n, change: (c) => a(c, i, s, r) },
|
|
2746
|
+
{ label: "R", val: i, change: (c) => a(n, c, s, r) },
|
|
2747
|
+
{ label: "B", val: s, change: (c) => a(n, i, c, r) },
|
|
2748
|
+
{ label: "L", val: r, change: (c) => a(n, i, s, c) }
|
|
2675
2749
|
].map((c) => p`
|
|
2676
2750
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
2677
2751
|
<span style="font-size:10px;color:#9ca3af;width:12px;">${c.label}</span>
|
|
@@ -2684,7 +2758,7 @@ function re(e, t, o) {
|
|
|
2684
2758
|
</div>
|
|
2685
2759
|
`;
|
|
2686
2760
|
}
|
|
2687
|
-
function
|
|
2761
|
+
function de(e, t, o) {
|
|
2688
2762
|
return p`
|
|
2689
2763
|
<div class="prop-row">
|
|
2690
2764
|
<div class="prop-toggle">
|
|
@@ -2695,7 +2769,7 @@ function le(e, t, o) {
|
|
|
2695
2769
|
</div>
|
|
2696
2770
|
`;
|
|
2697
2771
|
}
|
|
2698
|
-
function
|
|
2772
|
+
function ce(e, t, o) {
|
|
2699
2773
|
return p`
|
|
2700
2774
|
<div class="prop-row">
|
|
2701
2775
|
<label class="prop-label">${o}</label>
|
|
@@ -2704,7 +2778,7 @@ function ae(e, t, o) {
|
|
|
2704
2778
|
</div>
|
|
2705
2779
|
`;
|
|
2706
2780
|
}
|
|
2707
|
-
function
|
|
2781
|
+
function pe(e, t, o) {
|
|
2708
2782
|
return p`
|
|
2709
2783
|
<div class="prop-row">
|
|
2710
2784
|
<label class="prop-label">${o}</label>
|
|
@@ -2716,10 +2790,33 @@ function de(e, t, o) {
|
|
|
2716
2790
|
</div>
|
|
2717
2791
|
`;
|
|
2718
2792
|
}
|
|
2719
|
-
|
|
2720
|
-
|
|
2793
|
+
function he(e, t, o, n) {
|
|
2794
|
+
const i = n?.unit || "px", s = n?.min ?? 0, r = n?.max ?? 100, a = n?.step ?? 0.1, d = parseFloat(e) || 0, c = (h) => {
|
|
2795
|
+
const g = parseFloat(h.target.value) || 0;
|
|
2796
|
+
t(`${g}${i}`);
|
|
2797
|
+
};
|
|
2798
|
+
return p`
|
|
2799
|
+
<div class="prop-row">
|
|
2800
|
+
<label class="prop-label">${o}</label>
|
|
2801
|
+
<div style="display:flex;align-items:center;gap:4px;">
|
|
2802
|
+
<input
|
|
2803
|
+
type="number"
|
|
2804
|
+
.value=${String(d)}
|
|
2805
|
+
min=${s}
|
|
2806
|
+
max=${r}
|
|
2807
|
+
step=${a}
|
|
2808
|
+
@input=${c}
|
|
2809
|
+
style="flex:1;padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;color:#111827;"
|
|
2810
|
+
/>
|
|
2811
|
+
<span style="font-size:12px;color:#9ca3af;min-width:20px;">${i}</span>
|
|
2812
|
+
</div>
|
|
2813
|
+
</div>
|
|
2814
|
+
`;
|
|
2815
|
+
}
|
|
2816
|
+
var ue = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, Q = (e, t, o, n) => {
|
|
2817
|
+
for (var i = n > 1 ? void 0 : n ? ge(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
2721
2818
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
2722
|
-
return n && i &&
|
|
2819
|
+
return n && i && ue(t, o, i), i;
|
|
2723
2820
|
};
|
|
2724
2821
|
let E = class extends $ {
|
|
2725
2822
|
constructor() {
|
|
@@ -2770,20 +2867,22 @@ let E = class extends $ {
|
|
|
2770
2867
|
const n = e.values[t] ?? o.defaultValue, i = this.onChange(e.id, t);
|
|
2771
2868
|
switch (o.widget) {
|
|
2772
2869
|
case "color_picker":
|
|
2773
|
-
return
|
|
2870
|
+
return ne(n, i, o.label);
|
|
2774
2871
|
case "toggle":
|
|
2775
|
-
return le(n, i, o.label);
|
|
2776
|
-
case "rich_text":
|
|
2777
2872
|
return de(n, i, o.label);
|
|
2873
|
+
case "rich_text":
|
|
2874
|
+
return pe(n, i, o.label);
|
|
2778
2875
|
case "dropdown":
|
|
2779
|
-
return
|
|
2876
|
+
return ie(n, i, o.label, o.widgetParams);
|
|
2780
2877
|
case "alignment":
|
|
2781
|
-
return
|
|
2878
|
+
return se(n, i, o.label);
|
|
2782
2879
|
case "padding":
|
|
2783
|
-
return
|
|
2880
|
+
return ae(n, i, o.label);
|
|
2881
|
+
case "number_unit":
|
|
2882
|
+
return he(n, i, o.label, o.widgetParams);
|
|
2784
2883
|
case "text":
|
|
2785
2884
|
default:
|
|
2786
|
-
return
|
|
2885
|
+
return ce(n, i, o.label);
|
|
2787
2886
|
}
|
|
2788
2887
|
}
|
|
2789
2888
|
};
|
|
@@ -2830,17 +2929,17 @@ Q([
|
|
|
2830
2929
|
E = Q([
|
|
2831
2930
|
C("me-property-panel")
|
|
2832
2931
|
], E);
|
|
2833
|
-
var
|
|
2834
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2932
|
+
var fe = Object.defineProperty, be = Object.getOwnPropertyDescriptor, pt = (e, t, o, n) => {
|
|
2933
|
+
for (var i = n > 1 ? void 0 : n ? be(t, o) : t, s = e.length - 1, r; s >= 0; s--)
|
|
2835
2934
|
(r = e[s]) && (i = (n ? r(t, o, i) : r(i)) || i);
|
|
2836
|
-
return n && i &&
|
|
2935
|
+
return n && i && fe(t, o, i), i;
|
|
2837
2936
|
};
|
|
2838
2937
|
let B = class extends $ {
|
|
2839
2938
|
constructor() {
|
|
2840
|
-
super(...arguments), this.options = {}, this.store = new
|
|
2939
|
+
super(...arguments), this.options = {}, this.store = new $t(), this.toolRegistry = new kt(), this.dragManager = null, this.callbacks = /* @__PURE__ */ new Map(), this.unsubscribe = null, this._handleKeydown = (e) => {
|
|
2841
2940
|
const t = e.metaKey || e.ctrlKey, n = e.composedPath().some((i) => {
|
|
2842
|
-
const s = i?.tagName;
|
|
2843
|
-
return
|
|
2941
|
+
const s = i, r = s?.tagName;
|
|
2942
|
+
return !!(r === "INPUT" || r === "TEXTAREA" || r === "SELECT" || s?.isContentEditable);
|
|
2844
2943
|
});
|
|
2845
2944
|
n && !t || (t && e.key === "z" && !e.shiftKey ? (e.preventDefault(), this.store.undo()) : t && (e.key === "y" || e.key === "z" && e.shiftKey) ? (e.preventDefault(), this.store.redo()) : (e.key === "Delete" || e.key === "Backspace") && this.store.selectedId && !n ? (e.preventDefault(), this.store.removeContent(this.store.selectedId)) : e.key === "Escape" && this.store.select(null));
|
|
2846
2945
|
};
|
|
@@ -2849,7 +2948,7 @@ let B = class extends $ {
|
|
|
2849
2948
|
super.connectedCallback(), this.registerBuiltInTools(), this.applyOptions(), this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this._handleKeydown);
|
|
2850
2949
|
}
|
|
2851
2950
|
firstUpdated() {
|
|
2852
|
-
this.dragManager = new
|
|
2951
|
+
this.dragManager = new Ct(this.store, this.toolRegistry, this.shadowRoot), this.dragManager.attach(), this.store.events.on("design:loaded", (e) => {
|
|
2853
2952
|
this.dispatchEvent(new CustomEvent("design:loaded", { detail: e, bubbles: !0, composed: !0 }));
|
|
2854
2953
|
}), this.store.events.on("design:updated", (e) => {
|
|
2855
2954
|
this.dispatchEvent(new CustomEvent("design:updated", { detail: e, bubbles: !0, composed: !0 }));
|
|
@@ -2871,8 +2970,8 @@ let B = class extends $ {
|
|
|
2871
2970
|
const o = this.store.getDesign(), n = /* @__PURE__ */ new Set();
|
|
2872
2971
|
for (const s of o.body.rows)
|
|
2873
2972
|
for (const r of s.columns)
|
|
2874
|
-
for (const
|
|
2875
|
-
n.add(
|
|
2973
|
+
for (const a of r.contents)
|
|
2974
|
+
n.add(a.type);
|
|
2876
2975
|
const i = Array.from(n).filter((s) => !this.toolRegistry.isLoaded(s)).map((s) => this.toolRegistry.ensureLoaded(s));
|
|
2877
2976
|
i.length > 0 ? Promise.all(i).then(() => this.doExport(o, e, t)) : this.doExport(o, e, t);
|
|
2878
2977
|
}
|
|
@@ -2880,7 +2979,7 @@ let B = class extends $ {
|
|
|
2880
2979
|
const n = /* @__PURE__ */ new Map();
|
|
2881
2980
|
for (const i of this.toolRegistry.getAll())
|
|
2882
2981
|
n.set(i.name, (s, r) => i.renderer.renderHtml(s, r));
|
|
2883
|
-
t(
|
|
2982
|
+
t(Wt(e, n, o));
|
|
2884
2983
|
}
|
|
2885
2984
|
async exportHtmlAsync(e) {
|
|
2886
2985
|
return new Promise((t) => this.exportHtml(t, e));
|
|
@@ -2916,15 +3015,15 @@ let B = class extends $ {
|
|
|
2916
3015
|
*/
|
|
2917
3016
|
preloadLazyTools() {
|
|
2918
3017
|
const e = window.requestIdleCallback ?? ((t) => setTimeout(t, 1e3));
|
|
2919
|
-
for (const { meta: t } of
|
|
3018
|
+
for (const { meta: t } of rt)
|
|
2920
3019
|
e(() => {
|
|
2921
3020
|
this.toolRegistry.ensureLoaded(t.name);
|
|
2922
3021
|
});
|
|
2923
3022
|
}
|
|
2924
3023
|
registerBuiltInTools() {
|
|
2925
|
-
for (const e of
|
|
3024
|
+
for (const e of Et)
|
|
2926
3025
|
this.toolRegistry.register(e);
|
|
2927
|
-
for (const { meta: e, loader: t } of
|
|
3026
|
+
for (const { meta: e, loader: t } of rt)
|
|
2928
3027
|
this.toolRegistry.registerLazy(e, t);
|
|
2929
3028
|
}
|
|
2930
3029
|
applyOptions() {
|
|
@@ -2962,10 +3061,10 @@ B.styles = k`
|
|
|
2962
3061
|
}
|
|
2963
3062
|
* { box-sizing: border-box; }
|
|
2964
3063
|
`;
|
|
2965
|
-
|
|
3064
|
+
pt([
|
|
2966
3065
|
b({ type: Object })
|
|
2967
3066
|
], B.prototype, "options", 2);
|
|
2968
|
-
B =
|
|
3067
|
+
B = pt([
|
|
2969
3068
|
C("mail-editor")
|
|
2970
3069
|
], B);
|
|
2971
3070
|
function _(e, t) {
|
|
@@ -2974,20 +3073,20 @@ function _(e, t) {
|
|
|
2974
3073
|
_("mail-editor", B);
|
|
2975
3074
|
_("me-editor-canvas", M);
|
|
2976
3075
|
_("me-row-renderer", R);
|
|
2977
|
-
_("me-column-renderer",
|
|
2978
|
-
_("me-content-renderer",
|
|
3076
|
+
_("me-column-renderer", D);
|
|
3077
|
+
_("me-content-renderer", S);
|
|
2979
3078
|
_("me-editor-sidebar", P);
|
|
2980
3079
|
_("me-body-settings", A);
|
|
2981
3080
|
_("me-property-panel", E);
|
|
2982
3081
|
_("me-inline-toolbar", V);
|
|
2983
|
-
const
|
|
3082
|
+
const $e = customElements.get("mail-editor") !== void 0;
|
|
2984
3083
|
export {
|
|
2985
|
-
|
|
3084
|
+
$e as E,
|
|
2986
3085
|
B as M,
|
|
2987
|
-
|
|
2988
|
-
|
|
3086
|
+
kt as T,
|
|
3087
|
+
$t as a,
|
|
2989
3088
|
z as e,
|
|
2990
|
-
|
|
2991
|
-
|
|
3089
|
+
ve as j,
|
|
3090
|
+
l as s
|
|
2992
3091
|
};
|
|
2993
|
-
//# sourceMappingURL=index-
|
|
3092
|
+
//# sourceMappingURL=index-CpMbWdgn.js.map
|