@emabuild/core 0.0.9 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/content-renderer.d.ts.map +1 -1
- package/dist/canvas/row-renderer.d.ts.map +1 -1
- package/dist/{form-tool-CxJstLJz.js → form-tool-DShwYWpp.js} +2 -2
- package/dist/{form-tool-CxJstLJz.js.map → form-tool-DShwYWpp.js.map} +1 -1
- package/dist/{html-tool-Cqvglh05.js → html-tool-YYfXkFIO.js} +2 -2
- package/dist/{html-tool-Cqvglh05.js.map → html-tool-YYfXkFIO.js.map} +1 -1
- package/dist/{index-DV_tofKb.js → index-BQJRD2VW.js} +439 -332
- package/dist/index-BQJRD2VW.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{menu-tool-ACBHeTTN.js → menu-tool-Dus3qFoN.js} +2 -2
- package/dist/{menu-tool-ACBHeTTN.js.map → menu-tool-Dus3qFoN.js.map} +1 -1
- package/dist/sidebar/body-settings.d.ts.map +1 -1
- package/dist/{social-tool-MqaqWdRm.js → social-tool-Ba7s8khr.js} +2 -2
- package/dist/{social-tool-MqaqWdRm.js.map → social-tool-Ba7s8khr.js.map} +1 -1
- package/dist/{table-tool-AnVvJ0rV.js → table-tool-D8yaPASq.js} +2 -2
- package/dist/{table-tool-AnVvJ0rV.js.map → table-tool-D8yaPASq.js.map} +1 -1
- package/dist/{timer-tool-BxrGmF-W.js → timer-tool-YDsaHv7a.js} +2 -2
- package/dist/{timer-tool-BxrGmF-W.js.map → timer-tool-YDsaHv7a.js.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/built-in/text-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 +41 -0
- package/dist/tools/helpers/value-extractor.d.ts.map +1 -1
- package/dist/{video-tool-8g1_UVbn.js → video-tool-3FQ9rHns.js} +2 -2
- package/dist/{video-tool-8g1_UVbn.js.map → video-tool-3FQ9rHns.js.map} +1 -1
- package/package.json +3 -3
- package/dist/index-DV_tofKb.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { html as c, LitElement as
|
|
2
|
-
import { property as b, customElement as
|
|
3
|
-
import { unsafeHTML as
|
|
4
|
-
function
|
|
1
|
+
import { html as c, LitElement as v, css as $ } from "lit";
|
|
2
|
+
import { property as b, customElement as k } from "lit/decorators.js";
|
|
3
|
+
import { unsafeHTML as H } from "lit/directives/unsafe-html.js";
|
|
4
|
+
function dt() {
|
|
5
5
|
const e = {};
|
|
6
6
|
return {
|
|
7
7
|
getCounters() {
|
|
@@ -18,7 +18,7 @@ function rt() {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
class
|
|
21
|
+
class ct {
|
|
22
22
|
constructor() {
|
|
23
23
|
this.listeners = /* @__PURE__ */ new Map();
|
|
24
24
|
}
|
|
@@ -45,7 +45,7 @@ class st {
|
|
|
45
45
|
t ? this.listeners.delete(t) : this.listeners.clear();
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
class
|
|
48
|
+
class pt {
|
|
49
49
|
constructor(t = 50) {
|
|
50
50
|
this.undoStack = [], this.redoStack = [], this.maxHistory = t;
|
|
51
51
|
}
|
|
@@ -78,7 +78,7 @@ class lt {
|
|
|
78
78
|
this.undoStack = [], this.redoStack = [];
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function ht() {
|
|
82
82
|
return {
|
|
83
83
|
counters: { u_row: 0, u_column: 0 },
|
|
84
84
|
body: {
|
|
@@ -123,7 +123,7 @@ function at() {
|
|
|
123
123
|
schemaVersion: 16
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function ut(e, t) {
|
|
127
127
|
const o = e.next("u_row"), n = t.map(() => {
|
|
128
128
|
const i = e.next("u_column");
|
|
129
129
|
return {
|
|
@@ -156,7 +156,7 @@ function dt(e, t) {
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function gt(e, t, o = {}) {
|
|
160
160
|
const n = e.next(`u_content_${t}`), i = `u_content_${t}_${n}`;
|
|
161
161
|
return {
|
|
162
162
|
id: i,
|
|
@@ -172,7 +172,7 @@ function ct(e, t, o = {}) {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function F(e, t) {
|
|
176
176
|
return e.body.rows.find((o) => o.id === t);
|
|
177
177
|
}
|
|
178
178
|
function O(e, t) {
|
|
@@ -181,28 +181,28 @@ function O(e, t) {
|
|
|
181
181
|
if (n) return n;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function j(e, t) {
|
|
185
185
|
for (const o of e.body.rows)
|
|
186
186
|
for (const n of o.columns) {
|
|
187
187
|
const i = n.contents.find((r) => r.id === t);
|
|
188
188
|
if (i) return i;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function ft(e, t) {
|
|
192
192
|
for (const o of e.body.rows)
|
|
193
193
|
for (const n of o.columns)
|
|
194
194
|
if (n.contents.some((i) => i.id === t)) return n;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function bt(e, t) {
|
|
197
197
|
for (const o of e.body.rows)
|
|
198
198
|
if (o.columns.some((n) => n.id === t)) return o;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function N(e, t) {
|
|
201
201
|
return e.body.rows.findIndex((o) => o.id === t);
|
|
202
202
|
}
|
|
203
|
-
class
|
|
203
|
+
class mt {
|
|
204
204
|
constructor() {
|
|
205
|
-
this.history = new
|
|
205
|
+
this.history = new pt(), this.counterManager = dt(), this.subscribers = /* @__PURE__ */ new Set(), this.channelSubscribers = /* @__PURE__ */ new Map(), this.events = new ct(), this._selectedId = null, this._hoveredId = null, this._viewMode = "desktop", this._activeTab = "content", this.design = ht();
|
|
206
206
|
}
|
|
207
207
|
// ── Subscriptions ──────────────────────────────────────────
|
|
208
208
|
/** Subscribe to ALL state changes (legacy). Returns an unsubscribe function. */
|
|
@@ -312,7 +312,7 @@ class ut {
|
|
|
312
312
|
}
|
|
313
313
|
/** Remove a row by ID */
|
|
314
314
|
removeRow(t) {
|
|
315
|
-
const o =
|
|
315
|
+
const o = N(this.design, t);
|
|
316
316
|
o !== -1 && (this.history.push(this.design), this.design.body.rows.splice(o, 1), this._selectedId === t && (this._selectedId = null), this.notifyChannels("design"), this.emitUpdate("row_removed"));
|
|
317
317
|
}
|
|
318
318
|
/** Move a row from one index to another */
|
|
@@ -323,29 +323,29 @@ class ut {
|
|
|
323
323
|
}
|
|
324
324
|
/** Duplicate a row, assigning fresh IDs to all nested elements */
|
|
325
325
|
duplicateRow(t) {
|
|
326
|
-
const o =
|
|
326
|
+
const o = F(this.design, t);
|
|
327
327
|
if (!o) return;
|
|
328
328
|
this.history.push(this.design);
|
|
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 s of n.columns) {
|
|
332
|
-
const
|
|
333
|
-
s.id = `u_column_${
|
|
332
|
+
const l = this.counterManager.next("u_column");
|
|
333
|
+
s.id = `u_column_${l}`, s.values._meta = { htmlID: s.id, htmlClassNames: "u_column" };
|
|
334
334
|
for (const d of s.contents) {
|
|
335
335
|
const p = this.counterManager.next(`u_content_${d.type}`);
|
|
336
336
|
d.id = `u_content_${d.type}_${p}`, d.values._meta = { htmlID: d.id, htmlClassNames: `u_content_${d.type}` };
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const r =
|
|
339
|
+
const r = N(this.design, t);
|
|
340
340
|
this.design.body.rows.splice(r + 1, 0, n), this.syncCounters(), this.notifyChannels("design"), this.emitUpdate("row_added", n);
|
|
341
341
|
}
|
|
342
342
|
/** Get the index of a row */
|
|
343
343
|
getRowIndex(t) {
|
|
344
|
-
return
|
|
344
|
+
return N(this.design, t);
|
|
345
345
|
}
|
|
346
346
|
/** Update row-level values */
|
|
347
347
|
updateRowValues(t, o) {
|
|
348
|
-
const n =
|
|
348
|
+
const n = F(this.design, t);
|
|
349
349
|
n && (this.history.push(this.design), Object.assign(n.values, o), this.notifyChannels("design"), this.emitUpdate("content_updated"));
|
|
350
350
|
}
|
|
351
351
|
// ── Column Operations ──────────────────────────────────────
|
|
@@ -376,19 +376,19 @@ class ut {
|
|
|
376
376
|
}
|
|
377
377
|
/** Update content values by ID */
|
|
378
378
|
updateContentValues(t, o) {
|
|
379
|
-
const n =
|
|
379
|
+
const n = j(this.design, t);
|
|
380
380
|
n && (this.history.push(this.design), Object.assign(n.values, o), this.notifyChannels("design"), this.emitUpdate("content_updated"));
|
|
381
381
|
}
|
|
382
382
|
/** Move a content block to a different column at a given index */
|
|
383
383
|
moveContent(t, o, n) {
|
|
384
|
-
const i =
|
|
384
|
+
const i = j(this.design, t);
|
|
385
385
|
if (!i) return;
|
|
386
386
|
this.history.push(this.design);
|
|
387
387
|
for (const s of this.design.body.rows)
|
|
388
|
-
for (const
|
|
389
|
-
const d =
|
|
388
|
+
for (const l of s.columns) {
|
|
389
|
+
const d = l.contents.findIndex((p) => p.id === t);
|
|
390
390
|
if (d !== -1) {
|
|
391
|
-
|
|
391
|
+
l.contents.splice(d, 1);
|
|
392
392
|
break;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
@@ -397,15 +397,15 @@ class ut {
|
|
|
397
397
|
}
|
|
398
398
|
/** Duplicate a content block, inserting the copy right after the original */
|
|
399
399
|
duplicateContent(t) {
|
|
400
|
-
const o =
|
|
400
|
+
const o = j(this.design, t);
|
|
401
401
|
if (o)
|
|
402
402
|
for (const n of this.design.body.rows)
|
|
403
403
|
for (const i of n.columns) {
|
|
404
404
|
const r = i.contents.findIndex((s) => s.id === t);
|
|
405
405
|
if (r !== -1) {
|
|
406
406
|
this.history.push(this.design);
|
|
407
|
-
const s = structuredClone(o),
|
|
408
|
-
s.id = `u_content_${o.type}_${
|
|
407
|
+
const s = structuredClone(o), l = this.counterManager.next(`u_content_${o.type}`);
|
|
408
|
+
s.id = `u_content_${o.type}_${l}`, s.values._meta = { htmlID: s.id, htmlClassNames: `u_content_${o.type}` }, i.contents.splice(r + 1, 0, s), this.syncCounters(), this.notifyChannels("design"), this.emitUpdate("content_added", s);
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
@@ -417,29 +417,29 @@ class ut {
|
|
|
417
417
|
}
|
|
418
418
|
// ── Lookups (delegate to design-lookup) ────────────────────
|
|
419
419
|
findRow(t) {
|
|
420
|
-
return
|
|
420
|
+
return F(this.design, t);
|
|
421
421
|
}
|
|
422
422
|
findColumn(t) {
|
|
423
423
|
return O(this.design, t);
|
|
424
424
|
}
|
|
425
425
|
findContent(t) {
|
|
426
|
-
return
|
|
426
|
+
return j(this.design, t);
|
|
427
427
|
}
|
|
428
428
|
findParentColumn(t) {
|
|
429
|
-
return
|
|
429
|
+
return ft(this.design, t);
|
|
430
430
|
}
|
|
431
431
|
findParentRow(t) {
|
|
432
|
-
return
|
|
432
|
+
return bt(this.design, t);
|
|
433
433
|
}
|
|
434
434
|
// ── Factory Methods (delegate to design-factory) ───────────
|
|
435
435
|
/** Create a new row with the given column layout */
|
|
436
436
|
createRow(t) {
|
|
437
|
-
const o =
|
|
437
|
+
const o = ut(this.counterManager, t);
|
|
438
438
|
return this.syncCounters(), o;
|
|
439
439
|
}
|
|
440
440
|
/** Create a new content block for the given tool type */
|
|
441
441
|
createContent(t, o = {}) {
|
|
442
|
-
const n =
|
|
442
|
+
const n = gt(this.counterManager, t, o);
|
|
443
443
|
return this.syncCounters(), n;
|
|
444
444
|
}
|
|
445
445
|
// ── Private Helpers ────────────────────────────────────────
|
|
@@ -450,7 +450,7 @@ class ut {
|
|
|
450
450
|
this.events.emit("design:updated", { type: t, item: o });
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class xt {
|
|
454
454
|
constructor() {
|
|
455
455
|
this.tools = /* @__PURE__ */ new Map(), this.lazyLoaders = /* @__PURE__ */ new Map(), this.lazyMeta = /* @__PURE__ */ new Map(), this.loadingPromises = /* @__PURE__ */ new Map();
|
|
456
456
|
}
|
|
@@ -535,7 +535,7 @@ class gt {
|
|
|
535
535
|
return this.tools.get(t)?.options ?? {};
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
const
|
|
538
|
+
const E = {
|
|
539
539
|
/** ID of the content currently being dragged (null if not dragging content) */
|
|
540
540
|
draggingContentId: null,
|
|
541
541
|
startContentDrag(e) {
|
|
@@ -545,7 +545,7 @@ const z = {
|
|
|
545
545
|
this.draggingContentId = null;
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
|
-
function
|
|
548
|
+
function Q(e) {
|
|
549
549
|
const t = document.createElement("div");
|
|
550
550
|
return Object.assign(t.style, {
|
|
551
551
|
position: "absolute",
|
|
@@ -560,39 +560,39 @@ function J(e) {
|
|
|
560
560
|
boxShadow: `0 0 6px ${e}80`
|
|
561
561
|
}), t;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Z(e, t, o, n, i = "4px") {
|
|
564
564
|
e.parentNode !== t && (e.remove(), t.appendChild(e));
|
|
565
565
|
const s = (t instanceof ShadowRoot ? t.host : t).getBoundingClientRect();
|
|
566
|
-
let
|
|
567
|
-
o.length === 0 || n === 0 ?
|
|
566
|
+
let l;
|
|
567
|
+
o.length === 0 || n === 0 ? l = o.length === 0 ? 0 : o[0].getBoundingClientRect().top - s.top : n >= o.length ? l = o[o.length - 1].getBoundingClientRect().bottom - s.top : l = o[n].getBoundingClientRect().top - s.top, Object.assign(e.style, {
|
|
568
568
|
display: "block",
|
|
569
|
-
top: `${
|
|
569
|
+
top: `${l}px`,
|
|
570
570
|
left: i,
|
|
571
571
|
right: i,
|
|
572
572
|
width: "auto"
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function M(e) {
|
|
576
576
|
e && (e.style.display = "none");
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function G(e, t) {
|
|
579
579
|
const o = (e instanceof ShadowRoot, e.children);
|
|
580
580
|
for (const n of Array.from(o)) {
|
|
581
581
|
const i = n;
|
|
582
|
-
t(i), i.shadowRoot &&
|
|
582
|
+
t(i), i.shadowRoot && G(i.shadowRoot, t), i.children?.length && G(i, t);
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function tt(e, t) {
|
|
586
586
|
const o = [];
|
|
587
|
-
return
|
|
587
|
+
return G(e, (n) => {
|
|
588
588
|
n.matches?.(t) && o.push(n);
|
|
589
589
|
}), o;
|
|
590
590
|
}
|
|
591
|
-
class
|
|
591
|
+
class yt {
|
|
592
592
|
constructor(t, o, n) {
|
|
593
593
|
this.currentDrop = null, this.contentIndicator = null, this.rowIndicator = null, this.onDragOver = (i) => {
|
|
594
|
-
const r = i.dataTransfer?.types || [], s = r.includes("application/maileditor-tool"),
|
|
595
|
-
!s && !d && !
|
|
594
|
+
const r = i.dataTransfer?.types || [], s = r.includes("application/maileditor-tool"), l = r.includes("application/maileditor-layout"), d = r.includes("application/maileditor-content") || !!E.draggingContentId;
|
|
595
|
+
!s && !d && !l || (i.preventDefault(), i.dataTransfer.dropEffect = s || l ? "copy" : "move", l ? (this.currentDrop = this.findRowDropTarget(i.clientY), M(this.contentIndicator), this.showRowIndicator()) : (this.currentDrop = this.findContentDropTarget(i.clientX, i.clientY), M(this.rowIndicator), this.showContentIndicator()));
|
|
596
596
|
}, this.onDrop = (i) => {
|
|
597
597
|
i.preventDefault(), this.hideAllIndicators();
|
|
598
598
|
const r = this.currentDrop, s = i.dataTransfer?.getData("application/maileditor-layout");
|
|
@@ -600,12 +600,12 @@ class bt {
|
|
|
600
600
|
this.handleLayoutDrop(JSON.parse(s), r), this.reset();
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
605
|
-
this.handleToolDrop(
|
|
603
|
+
const l = i.dataTransfer?.getData("application/maileditor-tool");
|
|
604
|
+
if (l) {
|
|
605
|
+
this.handleToolDrop(l, r), this.reset();
|
|
606
606
|
return;
|
|
607
607
|
}
|
|
608
|
-
const d = i.dataTransfer?.getData("application/maileditor-content") ||
|
|
608
|
+
const d = i.dataTransfer?.getData("application/maileditor-content") || E.draggingContentId;
|
|
609
609
|
d && this.handleContentDrop(d, r), this.reset();
|
|
610
610
|
}, this.onDragEnd = () => {
|
|
611
611
|
this.hideAllIndicators(), this.reset();
|
|
@@ -616,7 +616,7 @@ class bt {
|
|
|
616
616
|
}
|
|
617
617
|
/** Attach all drag event listeners to the shadow root */
|
|
618
618
|
attach() {
|
|
619
|
-
this.root.addEventListener("dragover", this.onDragOver), this.root.addEventListener("drop", this.onDrop), this.root.addEventListener("dragend", this.onDragEnd), this.root.addEventListener("dragleave", this.onDragLeave), this.contentIndicator =
|
|
619
|
+
this.root.addEventListener("dragover", this.onDragOver), this.root.addEventListener("drop", this.onDrop), this.root.addEventListener("dragend", this.onDragEnd), this.root.addEventListener("dragleave", this.onDragLeave), this.contentIndicator = Q("#3b82f6"), this.rowIndicator = Q("#8b5cf6");
|
|
620
620
|
}
|
|
621
621
|
/** Remove all event listeners and clean up indicators */
|
|
622
622
|
detach() {
|
|
@@ -649,31 +649,31 @@ class bt {
|
|
|
649
649
|
if (n.length === 0) return { type: "row", rowIndex: 0, y: 0 };
|
|
650
650
|
let i = Math.abs(t - n[0].getBoundingClientRect().top), r = { type: "row", rowIndex: 0, y: n[0].getBoundingClientRect().top };
|
|
651
651
|
for (let s = 0; s < n.length; s++) {
|
|
652
|
-
const
|
|
653
|
-
d < i && (i = d, r = { type: "row", rowIndex: s + 1, y:
|
|
652
|
+
const l = n[s].getBoundingClientRect().bottom, d = Math.abs(t - l);
|
|
653
|
+
d < i && (i = d, r = { type: "row", rowIndex: s + 1, y: l });
|
|
654
654
|
}
|
|
655
655
|
return r;
|
|
656
656
|
}
|
|
657
657
|
findContentDropTarget(t, o) {
|
|
658
|
-
const n =
|
|
658
|
+
const n = tt(this.root, "me-column-renderer");
|
|
659
659
|
let i = null, r = 1 / 0;
|
|
660
660
|
for (const s of n) {
|
|
661
|
-
const
|
|
662
|
-
if (!
|
|
661
|
+
const l = s.dataset.columnId;
|
|
662
|
+
if (!l || !s.shadowRoot) continue;
|
|
663
663
|
const d = s.getBoundingClientRect();
|
|
664
664
|
if (t < d.left || t > d.right) continue;
|
|
665
665
|
const p = Array.from(s.shadowRoot.querySelectorAll("me-content-renderer"));
|
|
666
666
|
if (p.length === 0) {
|
|
667
|
-
const
|
|
668
|
-
|
|
667
|
+
const g = Math.abs(o - (d.top + d.height / 2));
|
|
668
|
+
g < r && (r = g, i = { type: "content", columnId: l, contentIndex: 0, y: d.top + d.height / 2 });
|
|
669
669
|
continue;
|
|
670
670
|
}
|
|
671
671
|
const h = p[0].getBoundingClientRect().top;
|
|
672
|
-
let
|
|
673
|
-
|
|
674
|
-
for (let
|
|
675
|
-
const m = p[
|
|
676
|
-
|
|
672
|
+
let u = Math.abs(o - h);
|
|
673
|
+
u < r && (r = u, i = { type: "content", columnId: l, contentIndex: 0, y: h });
|
|
674
|
+
for (let g = 0; g < p.length; g++) {
|
|
675
|
+
const m = p[g].getBoundingClientRect(), x = p[g + 1]?.getBoundingClientRect(), f = x ? (m.bottom + x.top) / 2 : m.bottom;
|
|
676
|
+
u = Math.abs(o - f), u < r && (r = u, i = { type: "content", columnId: l, contentIndex: g + 1, y: f });
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
return i;
|
|
@@ -681,36 +681,95 @@ class bt {
|
|
|
681
681
|
// ── Indicator Positioning ──────────────────────────────────
|
|
682
682
|
showContentIndicator() {
|
|
683
683
|
if (!this.contentIndicator || !this.currentDrop?.columnId) {
|
|
684
|
-
|
|
684
|
+
M(this.contentIndicator);
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
|
-
const o =
|
|
687
|
+
const o = tt(this.root, "me-column-renderer").find((i) => i.dataset.columnId === this.currentDrop.columnId);
|
|
688
688
|
if (!o?.shadowRoot) return;
|
|
689
689
|
const n = Array.from(o.shadowRoot.querySelectorAll("me-content-renderer"));
|
|
690
|
-
|
|
690
|
+
Z(this.contentIndicator, o.shadowRoot, n, this.currentDrop.contentIndex ?? 0, "4px");
|
|
691
691
|
}
|
|
692
692
|
showRowIndicator() {
|
|
693
693
|
if (!this.rowIndicator || !this.currentDrop) {
|
|
694
|
-
|
|
694
|
+
M(this.rowIndicator);
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
697
|
const t = this.root.querySelector("me-editor-canvas"), o = t?.shadowRoot?.querySelector(".canvas-body");
|
|
698
698
|
if (!o) return;
|
|
699
699
|
const n = Array.from(t.shadowRoot.querySelectorAll("me-row-renderer"));
|
|
700
|
-
|
|
700
|
+
Z(this.rowIndicator, o, n, this.currentDrop.rowIndex ?? 0, "0");
|
|
701
701
|
}
|
|
702
702
|
hideAllIndicators() {
|
|
703
|
-
|
|
703
|
+
M(this.contentIndicator), M(this.rowIndicator);
|
|
704
704
|
}
|
|
705
705
|
reset() {
|
|
706
|
-
this.currentDrop = null,
|
|
706
|
+
this.currentDrop = null, E.reset();
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function a(e, t, o = "") {
|
|
710
710
|
const n = e[t];
|
|
711
|
-
return typeof n == "string" && n !== "" ? n : o;
|
|
711
|
+
return typeof n == "string" && n !== "" ? n : typeof n == "number" ? String(n) : o;
|
|
712
|
+
}
|
|
713
|
+
function et(e) {
|
|
714
|
+
return typeof e == "string" ? e : e && typeof e == "object" && "url" in e && e.url || "";
|
|
715
|
+
}
|
|
716
|
+
function ot(e) {
|
|
717
|
+
if (e && typeof e == "object") {
|
|
718
|
+
const t = e;
|
|
719
|
+
return {
|
|
720
|
+
width: typeof t.width == "number" ? t.width : void 0,
|
|
721
|
+
maxWidth: typeof t.maxWidth == "string" ? t.maxWidth : void 0
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
return {};
|
|
712
725
|
}
|
|
713
|
-
function
|
|
726
|
+
function wt(e) {
|
|
727
|
+
const t = e.action;
|
|
728
|
+
if (t && typeof t == "object") {
|
|
729
|
+
const o = t.values;
|
|
730
|
+
return {
|
|
731
|
+
href: o?.href || "",
|
|
732
|
+
target: o?.target || "_blank"
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
return {
|
|
736
|
+
href: a(e, "href"),
|
|
737
|
+
target: a(e, "target", "_blank")
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
function nt(e, t = "") {
|
|
741
|
+
const o = e.text;
|
|
742
|
+
if (typeof o == "string" && o !== "") return o;
|
|
743
|
+
const n = e.textJson;
|
|
744
|
+
if (typeof n == "string")
|
|
745
|
+
try {
|
|
746
|
+
const i = JSON.parse(n), r = [], s = (l) => {
|
|
747
|
+
typeof l.text == "string" && r.push(l.text), l.type === "linebreak" && r.push("<br/>");
|
|
748
|
+
const d = l.children;
|
|
749
|
+
d && d.forEach(s);
|
|
750
|
+
};
|
|
751
|
+
if (s(i.root || i), r.length > 0) return r.join("");
|
|
752
|
+
} catch {
|
|
753
|
+
}
|
|
754
|
+
return t;
|
|
755
|
+
}
|
|
756
|
+
function Y(e, t = "arial,helvetica,sans-serif") {
|
|
757
|
+
const o = e.fontFamily;
|
|
758
|
+
if (typeof o == "string" && o !== "") return o;
|
|
759
|
+
if (o && typeof o == "object") {
|
|
760
|
+
const n = o, i = n.value || t, r = n.url;
|
|
761
|
+
if (r && typeof document < "u") {
|
|
762
|
+
const s = `emabuild-font-${i.replace(/[^a-z]/gi, "")}`;
|
|
763
|
+
if (!document.getElementById(s)) {
|
|
764
|
+
const l = document.createElement("link");
|
|
765
|
+
l.id = s, l.rel = "stylesheet", l.href = r, document.head.appendChild(l);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
return i;
|
|
769
|
+
}
|
|
770
|
+
return t;
|
|
771
|
+
}
|
|
772
|
+
function le(e, t) {
|
|
714
773
|
if (typeof e != "string") return t;
|
|
715
774
|
try {
|
|
716
775
|
return JSON.parse(e);
|
|
@@ -718,7 +777,7 @@ function oe(e, t) {
|
|
|
718
777
|
return t;
|
|
719
778
|
}
|
|
720
779
|
}
|
|
721
|
-
function
|
|
780
|
+
function V(e, t) {
|
|
722
781
|
const { padding: o, align: n = "left", extraTdStyle: i = "" } = t;
|
|
723
782
|
return `<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
|
|
724
783
|
<tbody><tr><td style="${`overflow-wrap:break-word;word-break:break-word;padding:${o};font-family:arial,helvetica,sans-serif;${i}`}" align="${n}">
|
|
@@ -726,8 +785,8 @@ function M(e, t) {
|
|
|
726
785
|
</td></tr></tbody>
|
|
727
786
|
</table>`;
|
|
728
787
|
}
|
|
729
|
-
function
|
|
730
|
-
const { bgColor: n, textColor: i, fontSize: r, fontWeight: s, borderRadius:
|
|
788
|
+
function vt(e, t, o) {
|
|
789
|
+
const { bgColor: n, textColor: i, fontSize: r, fontWeight: s, borderRadius: l } = o, d = parseInt(l) || 0;
|
|
731
790
|
if (d <= 0) return "";
|
|
732
791
|
const p = Math.round(d / 20 * 100);
|
|
733
792
|
return `<!--[if mso]>
|
|
@@ -737,7 +796,7 @@ function ft(e, t, o) {
|
|
|
737
796
|
</v:roundrect>
|
|
738
797
|
<![endif]-->`;
|
|
739
798
|
}
|
|
740
|
-
const
|
|
799
|
+
const $t = {
|
|
741
800
|
name: "text",
|
|
742
801
|
label: "Text",
|
|
743
802
|
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>',
|
|
@@ -800,19 +859,19 @@ const mt = {
|
|
|
800
859
|
},
|
|
801
860
|
renderer: {
|
|
802
861
|
renderEditor(e) {
|
|
803
|
-
const t =
|
|
862
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "transparent"), n = a(e, "color", "inherit"), i = a(e, "lineHeight", "140%"), r = Y(e), s = a(e, "text");
|
|
804
863
|
return c`
|
|
805
|
-
<div style="padding:${t};background-color:${o};color:${n};line-height:${i};word-break:break-word;">
|
|
806
|
-
${
|
|
864
|
+
<div style="padding:${t};background-color:${o};color:${n};line-height:${i};font-family:${r};word-break:break-word;">
|
|
865
|
+
${H(s)}
|
|
807
866
|
</div>
|
|
808
867
|
`;
|
|
809
868
|
},
|
|
810
869
|
renderHtml(e) {
|
|
811
|
-
const t =
|
|
812
|
-
return
|
|
870
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor"), n = a(e, "color", "#000000"), i = a(e, "lineHeight", "140%"), r = a(e, "textAlign", "left"), s = a(e, "text"), l = o ? `background-color:${o};` : "", d = `<div style="font-size:14px;color:${n};line-height:${i};text-align:${r};word-wrap:break-word;">${s}</div>`;
|
|
871
|
+
return V(d, { padding: t, extraTdStyle: l });
|
|
813
872
|
}
|
|
814
873
|
}
|
|
815
|
-
},
|
|
874
|
+
}, kt = {
|
|
816
875
|
name: "heading",
|
|
817
876
|
label: "Heading",
|
|
818
877
|
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>',
|
|
@@ -914,19 +973,19 @@ const mt = {
|
|
|
914
973
|
},
|
|
915
974
|
renderer: {
|
|
916
975
|
renderEditor(e) {
|
|
917
|
-
const t =
|
|
976
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "fontSize", "22px"), n = a(e, "color", "#000000"), i = a(e, "textAlign", "left"), r = a(e, "fontWeight", "700"), s = a(e, "lineHeight", "140%"), l = Y(e), d = nt(e, "Heading");
|
|
918
977
|
return c`
|
|
919
|
-
<div style="padding:${t};font-size:${o};color:${n};text-align:${i};font-weight:${r};line-height:${s};">
|
|
920
|
-
${
|
|
978
|
+
<div style="padding:${t};font-size:${o};color:${n};text-align:${i};font-weight:${r};line-height:${s};font-family:${l};">
|
|
979
|
+
${H(d)}
|
|
921
980
|
</div>
|
|
922
981
|
`;
|
|
923
982
|
},
|
|
924
983
|
renderHtml(e) {
|
|
925
|
-
const t =
|
|
926
|
-
return
|
|
984
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "fontSize", "22px"), n = a(e, "color", "#000000"), i = a(e, "textAlign", "left"), r = a(e, "fontWeight", "700"), s = a(e, "lineHeight", "140%"), l = a(e, "letterSpacing", "normal"), d = Y(e), p = a(e, "headingType", "h1"), h = nt(e, "Heading"), u = `<${p} style="margin:0;font-size:${o};color:${n};text-align:${i};font-weight:${r};line-height:${s};letter-spacing:${l};font-family:${d};">${h}</${p}>`;
|
|
985
|
+
return V(u, { padding: t });
|
|
927
986
|
}
|
|
928
987
|
}
|
|
929
|
-
},
|
|
988
|
+
}, Ct = {
|
|
930
989
|
name: "paragraph",
|
|
931
990
|
label: "Paragraph",
|
|
932
991
|
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>',
|
|
@@ -969,15 +1028,15 @@ const mt = {
|
|
|
969
1028
|
},
|
|
970
1029
|
renderer: {
|
|
971
1030
|
renderEditor(e) {
|
|
972
|
-
const t =
|
|
973
|
-
return c`<div style="padding:${t};color:${o};line-height:${n};word-break:break-word;">${
|
|
1031
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "color", "#374151"), n = a(e, "lineHeight", "160%");
|
|
1032
|
+
return c`<div style="padding:${t};color:${o};line-height:${n};word-break:break-word;">${H(a(e, "text"))}</div>`;
|
|
974
1033
|
},
|
|
975
1034
|
renderHtml(e) {
|
|
976
|
-
const t =
|
|
977
|
-
return
|
|
1035
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "color", "#374151"), n = a(e, "lineHeight", "160%"), i = a(e, "textAlign", "left"), r = a(e, "letterSpacing", "normal"), s = `<div style="font-size:14px;color:${o};line-height:${n};text-align:${i};letter-spacing:${r};word-wrap:break-word;">${a(e, "text")}</div>`;
|
|
1036
|
+
return V(s, { padding: t });
|
|
978
1037
|
}
|
|
979
1038
|
}
|
|
980
|
-
},
|
|
1039
|
+
}, _t = {
|
|
981
1040
|
name: "image",
|
|
982
1041
|
label: "Image",
|
|
983
1042
|
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>',
|
|
@@ -1038,15 +1097,15 @@ const mt = {
|
|
|
1038
1097
|
},
|
|
1039
1098
|
renderer: {
|
|
1040
1099
|
renderEditor(e) {
|
|
1041
|
-
const t =
|
|
1042
|
-
return o ? c`<div style="padding:${t};text-align:${
|
|
1100
|
+
const t = a(e, "containerPadding", "10px"), o = et(e.src), n = a(e, "alt"), r = ot(e.src).maxWidth || a(e, "width", "100%"), s = a(e, "borderRadius", "0px"), l = a(e, "textAlign", a(e, "align", "center"));
|
|
1101
|
+
return o ? c`<div style="padding:${t};text-align:${l};"><img src=${o} alt=${n} style="display:inline-block;max-width:100%;width:${r};border-radius:${s};border:0;" /></div>` : c`<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>`;
|
|
1043
1102
|
},
|
|
1044
1103
|
renderHtml(e, t) {
|
|
1045
|
-
const o =
|
|
1046
|
-
return
|
|
1104
|
+
const o = a(e, "containerPadding", "10px"), n = et(e.src), i = a(e, "alt"), r = wt(e), l = ot(e.src).maxWidth || a(e, "width", "100%"), d = a(e, "borderRadius", "0px"), p = a(e, "textAlign", a(e, "align", "center")), h = l === "100%" ? t.columnWidth : parseInt(l) || t.columnWidth, u = d !== "0px" ? `border-radius:${d};` : "", g = `<img align="${p}" border="0" src="${n}" alt="${i}" title="${i}" style="outline:none;text-decoration:none;clear:both;display:inline-block!important;border:none;height:auto;float:none;width:${l};max-width:${h}px;${u}" width="${h}" />`, m = r.href ? `<a href="${r.href}" target="${r.target}" style="text-decoration:none;">${g}</a>` : g;
|
|
1105
|
+
return V(m, { padding: o, align: p });
|
|
1047
1106
|
}
|
|
1048
1107
|
}
|
|
1049
|
-
},
|
|
1108
|
+
}, Dt = {
|
|
1050
1109
|
name: "button",
|
|
1051
1110
|
label: "Button",
|
|
1052
1111
|
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>',
|
|
@@ -1133,24 +1192,24 @@ const mt = {
|
|
|
1133
1192
|
},
|
|
1134
1193
|
renderer: {
|
|
1135
1194
|
renderEditor(e) {
|
|
1136
|
-
const t =
|
|
1195
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "#3b82f6"), n = a(e, "textColor", "#ffffff"), i = a(e, "fontSize", "14px"), r = a(e, "fontWeight", "700"), s = a(e, "borderRadius", "4px"), l = a(e, "buttonPadding", "10px 20px"), d = a(e, "text", "Click Me"), p = a(e, "textAlign", "center"), h = a(e, "buttonWidth", "auto"), u = a(e, "borderWidth", "0px"), g = a(e, "borderColor", o), m = u !== "0px" ? `border:${u} solid ${g};` : "border:none;", x = h === "auto" ? "display:inline-block;" : `display:block;width:${h};`;
|
|
1137
1196
|
return c`
|
|
1138
1197
|
<div style="padding:${t};text-align:${p};">
|
|
1139
|
-
<a style="${x}background-color:${o};color:${n};font-size:${i};font-weight:${r};border-radius:${s};padding:${
|
|
1198
|
+
<a style="${x}background-color:${o};color:${n};font-size:${i};font-weight:${r};border-radius:${s};padding:${l};text-decoration:none;text-align:center;${m}cursor:pointer;font-family:arial,helvetica,sans-serif;box-sizing:border-box;">${d}</a>
|
|
1140
1199
|
</div>
|
|
1141
1200
|
`;
|
|
1142
1201
|
},
|
|
1143
1202
|
renderHtml(e) {
|
|
1144
|
-
const t =
|
|
1145
|
-
<!--[if !mso]><!-->` : "<!--[if !mso]><!-->",
|
|
1146
|
-
${
|
|
1147
|
-
<a href="${h}" target="${
|
|
1203
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "backgroundColor", "#3b82f6"), n = a(e, "textColor", "#ffffff"), i = a(e, "fontSize", "14px"), r = a(e, "fontWeight", "700"), s = a(e, "borderRadius", "4px"), l = a(e, "buttonPadding", "10px 20px"), d = a(e, "text", "Click Me"), p = a(e, "textAlign", "center"), h = a(e, "href", "#"), u = a(e, "target", "_blank"), g = a(e, "borderWidth", "0px"), m = a(e, "borderColor", o), x = g !== "0px" ? `border:${g} solid ${m};` : "border:none;", f = vt(d, h, { bgColor: o, textColor: n, fontSize: i, fontWeight: r, borderRadius: s }), y = f ? `${f}
|
|
1204
|
+
<!--[if !mso]><!-->` : "<!--[if !mso]><!-->", z = `<div align="${p}">
|
|
1205
|
+
${y}
|
|
1206
|
+
<a href="${h}" target="${u}" style="box-sizing:border-box;display:inline-block;text-decoration:none;text-align:center;color:${n};background-color:${o};border-radius:${s};font-size:${i};font-weight:${r};padding:${l};font-family:arial,helvetica,sans-serif;${x}mso-border-alt:none;word-break:keep-all;"><span style="line-height:120%;">${d}</span></a>
|
|
1148
1207
|
<!--<![endif]-->
|
|
1149
1208
|
</div>`;
|
|
1150
|
-
return
|
|
1209
|
+
return V(z, { padding: t, align: p });
|
|
1151
1210
|
}
|
|
1152
1211
|
}
|
|
1153
|
-
},
|
|
1212
|
+
}, St = {
|
|
1154
1213
|
name: "divider",
|
|
1155
1214
|
label: "Divider",
|
|
1156
1215
|
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>',
|
|
@@ -1197,53 +1256,53 @@ const mt = {
|
|
|
1197
1256
|
},
|
|
1198
1257
|
renderer: {
|
|
1199
1258
|
renderEditor(e) {
|
|
1200
|
-
const t =
|
|
1259
|
+
const t = a(e, "containerPadding", "10px"), o = a(e, "width", "100%"), n = `${a(e, "borderTopWidth", "1px")} ${a(e, "borderTopStyle", "solid")} ${a(e, "borderTopColor", "#cccccc")}`;
|
|
1201
1260
|
return c`<div style="padding:${t};"><div style="border-top:${n};width:${o};margin:0 auto;"></div></div>`;
|
|
1202
1261
|
},
|
|
1203
1262
|
renderHtml(e) {
|
|
1204
|
-
const t =
|
|
1205
|
-
return
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
},
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
],
|
|
1263
|
+
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;"> </td></tr></tbody></table>`;
|
|
1264
|
+
return V(i, { padding: t, align: "center" });
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}, Rt = [
|
|
1268
|
+
$t,
|
|
1269
|
+
kt,
|
|
1270
|
+
Ct,
|
|
1271
|
+
_t,
|
|
1272
|
+
Dt,
|
|
1273
|
+
St
|
|
1274
|
+
], it = [
|
|
1216
1275
|
{
|
|
1217
1276
|
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 },
|
|
1218
|
-
loader: () => import("./html-tool-
|
|
1277
|
+
loader: () => import("./html-tool-YYfXkFIO.js").then((e) => e.htmlTool)
|
|
1219
1278
|
},
|
|
1220
1279
|
{
|
|
1221
1280
|
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 },
|
|
1222
|
-
loader: () => import("./social-tool-
|
|
1281
|
+
loader: () => import("./social-tool-Ba7s8khr.js").then((e) => e.socialTool)
|
|
1223
1282
|
},
|
|
1224
1283
|
{
|
|
1225
1284
|
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 },
|
|
1226
|
-
loader: () => import("./menu-tool-
|
|
1285
|
+
loader: () => import("./menu-tool-Dus3qFoN.js").then((e) => e.menuTool)
|
|
1227
1286
|
},
|
|
1228
1287
|
{
|
|
1229
1288
|
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 },
|
|
1230
|
-
loader: () => import("./video-tool-
|
|
1289
|
+
loader: () => import("./video-tool-3FQ9rHns.js").then((e) => e.videoTool)
|
|
1231
1290
|
},
|
|
1232
1291
|
{
|
|
1233
1292
|
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 },
|
|
1234
|
-
loader: () => import("./timer-tool-
|
|
1293
|
+
loader: () => import("./timer-tool-YDsaHv7a.js").then((e) => e.timerTool)
|
|
1235
1294
|
},
|
|
1236
1295
|
{
|
|
1237
1296
|
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 },
|
|
1238
|
-
loader: () => import("./table-tool-
|
|
1297
|
+
loader: () => import("./table-tool-D8yaPASq.js").then((e) => e.tableTool)
|
|
1239
1298
|
},
|
|
1240
1299
|
{
|
|
1241
1300
|
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 },
|
|
1242
|
-
loader: () => import("./form-tool-
|
|
1301
|
+
loader: () => import("./form-tool-DShwYWpp.js").then((e) => e.formTool)
|
|
1243
1302
|
}
|
|
1244
1303
|
];
|
|
1245
|
-
function
|
|
1246
|
-
const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", r = o.fontFamily?.value || "arial,helvetica,sans-serif", s = o.textColor || "#000000",
|
|
1304
|
+
function Mt(e, t, o) {
|
|
1305
|
+
const n = o.backgroundColor || "#e7e7e7", i = o.contentWidth || "600px", r = o.fontFamily?.value || "arial,helvetica,sans-serif", s = o.textColor || "#000000", l = o.preheaderText || "", d = l ? `<div style="display:none;font-size:1px;color:${n};line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">${l}${"‌ ".repeat(80)}</div>` : "";
|
|
1247
1306
|
return `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
1248
1307
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
|
1249
1308
|
<head>
|
|
@@ -1295,20 +1354,20 @@ function Ct(e, t, o) {
|
|
|
1295
1354
|
</body>
|
|
1296
1355
|
</html>`;
|
|
1297
1356
|
}
|
|
1298
|
-
function
|
|
1299
|
-
const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", r = e.values.columnsBackgroundColor || "", s = e.values.padding || "0px",
|
|
1300
|
-
const
|
|
1301
|
-
return
|
|
1302
|
-
}),
|
|
1303
|
-
let
|
|
1304
|
-
if (
|
|
1305
|
-
const f = e.columns.map((
|
|
1306
|
-
const
|
|
1307
|
-
return `<!--[if (mso)|(IE)]><td align="center" width="${
|
|
1308
|
-
${
|
|
1357
|
+
function Tt(e, t, o) {
|
|
1358
|
+
const n = parseInt(t.contentWidth || "600"), i = e.values.backgroundColor || "", r = e.values.columnsBackgroundColor || "", s = e.values.padding || "0px", l = e.cells.reduce((f, y) => f + y, 0), d = i ? `background-color:${i};` : "", p = e.values.backgroundImage?.url ? `background-image:url('${e.values.backgroundImage.url}');background-repeat:${e.values.backgroundImage.repeat ? "repeat" : "no-repeat"};background-position:center top;background-size:${e.values.backgroundImage.cover ? "cover" : "auto"};` : "", h = e.columns.map((f, y) => {
|
|
1359
|
+
const R = Math.round(e.cells[y] / l * n);
|
|
1360
|
+
return rt(f, R, r, t, o);
|
|
1361
|
+
}), u = e.columns.length > 1;
|
|
1362
|
+
let g;
|
|
1363
|
+
if (u) {
|
|
1364
|
+
const f = e.columns.map((y, R) => {
|
|
1365
|
+
const z = Math.round(e.cells[R] / l * n), at = rt(y, z, r, t, o);
|
|
1366
|
+
return `<!--[if (mso)|(IE)]><td align="center" width="${z}" style="width:${z}px;padding:0px;border:none;" valign="top"><![endif]-->
|
|
1367
|
+
${at}
|
|
1309
1368
|
<!--[if (mso)|(IE)]></td><![endif]-->`;
|
|
1310
1369
|
});
|
|
1311
|
-
|
|
1370
|
+
g = `<!--[if (mso)|(IE)]><table role="presentation" width="${n}" cellpadding="0" cellspacing="0" border="0"><tr>${f.join(`
|
|
1312
1371
|
`)}</tr></table><![endif]-->
|
|
1313
1372
|
|
|
1314
1373
|
<!--[if !mso]><!-->
|
|
@@ -1318,39 +1377,41 @@ ${h.join(`
|
|
|
1318
1377
|
</div>
|
|
1319
1378
|
<!--<![endif]-->`;
|
|
1320
1379
|
} else
|
|
1321
|
-
|
|
1380
|
+
g = h.join(`
|
|
1322
1381
|
`);
|
|
1323
1382
|
const m = e.values.hideDesktop ? " u_hide_desktop" : "", x = e.values.hideMobile ? " u_hide_mobile" : "";
|
|
1324
1383
|
return `<div class="u_row${m}${x}" style="padding:${s};${d}${p}">
|
|
1325
1384
|
<div style="margin:0 auto;min-width:320px;max-width:${n}px;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;background-color:transparent;">
|
|
1326
1385
|
<div style="border-collapse:collapse;display:table;width:100%;height:100%;background-color:transparent;">
|
|
1327
|
-
${
|
|
1386
|
+
${g}
|
|
1328
1387
|
</div>
|
|
1329
1388
|
</div>
|
|
1330
1389
|
</div>`;
|
|
1331
1390
|
}
|
|
1332
|
-
function
|
|
1333
|
-
const r = e.values.backgroundColor || o || "", s = e.values.padding || "0px",
|
|
1334
|
-
const
|
|
1335
|
-
if (!
|
|
1336
|
-
const
|
|
1391
|
+
function rt(e, t, o, n, i) {
|
|
1392
|
+
const r = e.values.backgroundColor || o || "", s = e.values.padding || "0px", l = e.values.borderRadius || "0px", d = r ? `background-color:${r};` : "", p = e.contents.map((h) => {
|
|
1393
|
+
const u = i.get(h.type);
|
|
1394
|
+
if (!u) return `<!-- unknown tool: ${h.type} -->`;
|
|
1395
|
+
const g = {
|
|
1337
1396
|
columnWidth: t,
|
|
1338
1397
|
displayMode: "email",
|
|
1339
1398
|
contentWidth: parseInt(n.contentWidth || "600"),
|
|
1340
1399
|
bodyValues: n
|
|
1341
1400
|
};
|
|
1342
|
-
|
|
1401
|
+
let m = u(h.values, g);
|
|
1402
|
+
const x = !!h.values.hideDesktop, f = !!h.values.hideMobile;
|
|
1403
|
+
return (x || f) && (m = `<div class="${[x && "u_hide_desktop", f && "u_hide_mobile"].filter(Boolean).join(" ")}">${m}</div>`), m;
|
|
1343
1404
|
}).join(`
|
|
1344
1405
|
`);
|
|
1345
1406
|
return `<div class="u_column" style="max-width:${t}px;min-width:${Math.min(t, 320)}px;display:table-cell;vertical-align:top;">
|
|
1346
|
-
<div style="height:100%;width:100% !important;border-radius:${
|
|
1347
|
-
<div style="box-sizing:border-box;height:100%;padding:${s};border:none;border-radius:${
|
|
1407
|
+
<div style="height:100%;width:100% !important;border-radius:${l};-webkit-border-radius:${l};${d}">
|
|
1408
|
+
<div style="box-sizing:border-box;height:100%;padding:${s};border:none;border-radius:${l};-webkit-border-radius:${l};">
|
|
1348
1409
|
${p || '<!--[if (!mso)&(!IE)]><!--><div style="height:0;min-height:1px;font-size:0;"> </div><!--<![endif]-->'}
|
|
1349
1410
|
</div>
|
|
1350
1411
|
</div>
|
|
1351
1412
|
</div>`;
|
|
1352
1413
|
}
|
|
1353
|
-
function
|
|
1414
|
+
function It(e) {
|
|
1354
1415
|
return `
|
|
1355
1416
|
@media only screen and (min-width: ${e + 20}px) {
|
|
1356
1417
|
.u_row .u_column { display: table-cell; }
|
|
@@ -1400,27 +1461,27 @@ function Dt(e) {
|
|
|
1400
1461
|
.u_hide_mobile { display: block !important; }
|
|
1401
1462
|
}`;
|
|
1402
1463
|
}
|
|
1403
|
-
function
|
|
1404
|
-
const n = e.body.values, i = parseInt(n.contentWidth || "600"), r = e.body.rows.map((
|
|
1405
|
-
`), s =
|
|
1406
|
-
let
|
|
1464
|
+
function Pt(e, t, o) {
|
|
1465
|
+
const n = e.body.values, i = parseInt(n.contentWidth || "600"), r = e.body.rows.map((u) => Tt(u, n, t)).join(`
|
|
1466
|
+
`), s = It(i);
|
|
1467
|
+
let l = Mt(r, s, n);
|
|
1407
1468
|
if (o?.mergeTags)
|
|
1408
|
-
for (const [
|
|
1409
|
-
|
|
1410
|
-
const d =
|
|
1469
|
+
for (const [u, g] of Object.entries(o.mergeTags))
|
|
1470
|
+
l = l.replaceAll(`{{${u}}}`, g);
|
|
1471
|
+
const d = l.match(/<body[^>]*>([\s\S]*)<\/body>/i), p = l.match(/<style[^>]*>([\s\S]*?)<\/style>/gi), h = [];
|
|
1411
1472
|
return n.fontFamily?.url && h.push(n.fontFamily.url), {
|
|
1412
1473
|
design: structuredClone(e),
|
|
1413
|
-
html:
|
|
1474
|
+
html: l,
|
|
1414
1475
|
chunks: {
|
|
1415
1476
|
body: d?.[1] ?? r,
|
|
1416
|
-
css: p?.map((
|
|
1477
|
+
css: p?.map((u) => u.replace(/<\/?style[^>]*>/gi, "")).join(`
|
|
1417
1478
|
`) ?? s,
|
|
1418
1479
|
fonts: h,
|
|
1419
1480
|
js: ""
|
|
1420
1481
|
}
|
|
1421
1482
|
};
|
|
1422
1483
|
}
|
|
1423
|
-
class
|
|
1484
|
+
class S {
|
|
1424
1485
|
/**
|
|
1425
1486
|
* @param host - The Lit component that owns this controller
|
|
1426
1487
|
* @param channels - Which store channels to subscribe to
|
|
@@ -1444,17 +1505,17 @@ class R {
|
|
|
1444
1505
|
}));
|
|
1445
1506
|
}
|
|
1446
1507
|
}
|
|
1447
|
-
var
|
|
1448
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1508
|
+
var Vt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, W = (e, t, o, n) => {
|
|
1509
|
+
for (var i = n > 1 ? void 0 : n ? zt(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
1449
1510
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
1450
|
-
return n && i &&
|
|
1511
|
+
return n && i && Vt(t, o, i), i;
|
|
1451
1512
|
};
|
|
1452
|
-
let _ = class extends
|
|
1513
|
+
let _ = class extends v {
|
|
1453
1514
|
constructor() {
|
|
1454
|
-
super(...arguments), this.storeCtrl = new
|
|
1455
|
-
e.dataTransfer.setData("application/maileditor-content", this.content.id), e.dataTransfer.effectAllowed = "move", this.style.opacity = "0.4",
|
|
1515
|
+
super(...arguments), this.storeCtrl = new S(this, ["design", "selection", "hover", "viewMode"]), this._onDragStart = (e) => {
|
|
1516
|
+
e.dataTransfer.setData("application/maileditor-content", this.content.id), e.dataTransfer.effectAllowed = "move", this.style.opacity = "0.4", E.startContentDrag(this.content.id);
|
|
1456
1517
|
}, this._onDragEnd = () => {
|
|
1457
|
-
this.style.opacity = "1",
|
|
1518
|
+
this.style.opacity = "1", E.reset();
|
|
1458
1519
|
};
|
|
1459
1520
|
}
|
|
1460
1521
|
set store(e) {
|
|
@@ -1486,30 +1547,31 @@ let _ = class extends w {
|
|
|
1486
1547
|
}
|
|
1487
1548
|
render() {
|
|
1488
1549
|
if (!this.store) return c``;
|
|
1489
|
-
const e = this.store.selectedId === this.content.id, t = this.store.hoveredId === this.content.id;
|
|
1490
|
-
this.classList.toggle("selected", e), this.classList.toggle("hovered", t), this.setAttribute("draggable", "true"), this.dataset.contentId = this.content.id;
|
|
1491
|
-
const
|
|
1492
|
-
if (!
|
|
1550
|
+
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, r = o === "desktop" && n || o === "mobile" && i;
|
|
1551
|
+
this.classList.toggle("selected", e), this.classList.toggle("hovered", t), this.classList.toggle("hidden-in-view", r), this.setAttribute("draggable", "true"), this.dataset.contentId = this.content.id;
|
|
1552
|
+
const s = this.toolRegistry.get(this.content.type);
|
|
1553
|
+
if (!s && this.toolRegistry.has(this.content.type))
|
|
1493
1554
|
return this.toolRegistry.ensureLoaded(this.content.type).then(() => this.requestUpdate()), c`<div style="padding:16px;text-align:center;color:#9ca3af;font-size:13px;font-family:sans-serif;">Loading ${this.content.type}...</div>`;
|
|
1494
|
-
const
|
|
1555
|
+
const l = s?.renderer.renderEditor(this.content.values, {
|
|
1495
1556
|
isSelected: e,
|
|
1496
1557
|
isHovered: t,
|
|
1497
1558
|
columnWidth: 600,
|
|
1498
1559
|
displayMode: "email"
|
|
1499
1560
|
});
|
|
1500
1561
|
return c`
|
|
1562
|
+
${r ? c`<div class="hidden-badge">${n ? "Hidden on desktop" : i ? "Hidden on mobile" : ""}</div>` : ""}
|
|
1501
1563
|
<div class="action-bar">
|
|
1502
1564
|
<button class="action-btn" @click=${this.handleDuplicate} title="Duplicate">♻</button>
|
|
1503
1565
|
<button class="action-btn" @click=${this.handleDelete} title="Delete">✕</button>
|
|
1504
1566
|
</div>
|
|
1505
1567
|
<div class="content-wrapper" @click=${this.handleClick}
|
|
1506
1568
|
@mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave}>
|
|
1507
|
-
${
|
|
1569
|
+
${l ?? c`<div style="padding:10px;color:#999;font-style:italic;">Unknown tool: ${this.content.type}</div>`}
|
|
1508
1570
|
</div>
|
|
1509
1571
|
`;
|
|
1510
1572
|
}
|
|
1511
1573
|
};
|
|
1512
|
-
_.styles =
|
|
1574
|
+
_.styles = $`
|
|
1513
1575
|
:host {
|
|
1514
1576
|
display: block; position: relative; cursor: pointer;
|
|
1515
1577
|
transition: outline 0.15s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
|
|
@@ -1519,6 +1581,16 @@ _.styles = v`
|
|
|
1519
1581
|
:host(.just-dropped) {
|
|
1520
1582
|
animation: dropIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
1521
1583
|
}
|
|
1584
|
+
:host(.hidden-in-view) {
|
|
1585
|
+
opacity: 0.3;
|
|
1586
|
+
position: relative;
|
|
1587
|
+
}
|
|
1588
|
+
.hidden-badge {
|
|
1589
|
+
position: absolute; top: 4px; right: 4px; z-index: 5;
|
|
1590
|
+
background: #f59e0b; color: white; font-size: 10px; font-weight: 600;
|
|
1591
|
+
padding: 2px 6px; border-radius: 3px; font-family: sans-serif;
|
|
1592
|
+
pointer-events: none;
|
|
1593
|
+
}
|
|
1522
1594
|
@keyframes dropIn {
|
|
1523
1595
|
0% { opacity: 0; transform: scale(0.92) translateY(-8px); }
|
|
1524
1596
|
100% { opacity: 1; transform: scale(1) translateY(0); }
|
|
@@ -1535,26 +1607,26 @@ _.styles = v`
|
|
|
1535
1607
|
.action-btn:hover { background: rgba(255,255,255,0.2); }
|
|
1536
1608
|
.content-wrapper { position: relative; }
|
|
1537
1609
|
`;
|
|
1538
|
-
|
|
1610
|
+
W([
|
|
1539
1611
|
b({ attribute: !1 })
|
|
1540
1612
|
], _.prototype, "content", 2);
|
|
1541
|
-
|
|
1613
|
+
W([
|
|
1542
1614
|
b({ attribute: !1 })
|
|
1543
1615
|
], _.prototype, "store", 1);
|
|
1544
|
-
|
|
1616
|
+
W([
|
|
1545
1617
|
b({ attribute: !1 })
|
|
1546
1618
|
], _.prototype, "toolRegistry", 2);
|
|
1547
|
-
_ =
|
|
1548
|
-
|
|
1619
|
+
_ = W([
|
|
1620
|
+
k("me-content-renderer")
|
|
1549
1621
|
], _);
|
|
1550
|
-
var
|
|
1551
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1622
|
+
var Et = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, A = (e, t, o, n) => {
|
|
1623
|
+
for (var i = n > 1 ? void 0 : n ? Lt(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
1552
1624
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
1553
|
-
return n && i &&
|
|
1625
|
+
return n && i && Et(t, o, i), i;
|
|
1554
1626
|
};
|
|
1555
|
-
let
|
|
1627
|
+
let w = class extends v {
|
|
1556
1628
|
constructor() {
|
|
1557
|
-
super(...arguments), this.storeCtrl = new
|
|
1629
|
+
super(...arguments), this.storeCtrl = new S(this, ["design"]), this.widthPercent = 100;
|
|
1558
1630
|
}
|
|
1559
1631
|
set store(e) {
|
|
1560
1632
|
this.storeCtrl.setStore(e);
|
|
@@ -1581,7 +1653,7 @@ let y = class extends w {
|
|
|
1581
1653
|
`;
|
|
1582
1654
|
}
|
|
1583
1655
|
};
|
|
1584
|
-
|
|
1656
|
+
w.styles = $`
|
|
1585
1657
|
:host {
|
|
1586
1658
|
display: block;
|
|
1587
1659
|
min-height: 40px;
|
|
@@ -1611,29 +1683,29 @@ y.styles = v`
|
|
|
1611
1683
|
opacity: 1;
|
|
1612
1684
|
}
|
|
1613
1685
|
`;
|
|
1614
|
-
|
|
1686
|
+
A([
|
|
1615
1687
|
b({ attribute: !1 })
|
|
1616
|
-
],
|
|
1617
|
-
|
|
1688
|
+
], w.prototype, "column", 2);
|
|
1689
|
+
A([
|
|
1618
1690
|
b({ attribute: !1 })
|
|
1619
|
-
],
|
|
1620
|
-
|
|
1691
|
+
], w.prototype, "store", 1);
|
|
1692
|
+
A([
|
|
1621
1693
|
b({ attribute: !1 })
|
|
1622
|
-
],
|
|
1623
|
-
|
|
1694
|
+
], w.prototype, "toolRegistry", 2);
|
|
1695
|
+
A([
|
|
1624
1696
|
b({ type: Number })
|
|
1625
|
-
],
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
],
|
|
1629
|
-
var
|
|
1630
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1697
|
+
], w.prototype, "widthPercent", 2);
|
|
1698
|
+
w = A([
|
|
1699
|
+
k("me-column-renderer")
|
|
1700
|
+
], w);
|
|
1701
|
+
var Bt = Object.defineProperty, At = Object.getOwnPropertyDescriptor, U = (e, t, o, n) => {
|
|
1702
|
+
for (var i = n > 1 ? void 0 : n ? At(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
1631
1703
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
1632
|
-
return n && i &&
|
|
1704
|
+
return n && i && Bt(t, o, i), i;
|
|
1633
1705
|
};
|
|
1634
|
-
let D = class extends
|
|
1706
|
+
let D = class extends v {
|
|
1635
1707
|
constructor() {
|
|
1636
|
-
super(...arguments), this.storeCtrl = new
|
|
1708
|
+
super(...arguments), this.storeCtrl = new S(this, ["design", "viewMode"]);
|
|
1637
1709
|
}
|
|
1638
1710
|
set store(e) {
|
|
1639
1711
|
this.storeCtrl.setStore(e);
|
|
@@ -1658,8 +1730,10 @@ let D = class extends w {
|
|
|
1658
1730
|
e.stopPropagation(), this.store.removeRow(this.row.id);
|
|
1659
1731
|
}
|
|
1660
1732
|
render() {
|
|
1661
|
-
|
|
1662
|
-
|
|
1733
|
+
if (!this.store) return c``;
|
|
1734
|
+
const { row: e, store: t, toolRegistry: o } = this, n = e.values.backgroundColor || "transparent", i = e.values.columnsBackgroundColor || "transparent", r = e.values.padding || "0px", s = e.cells.reduce((f, y) => f + y, 0), l = e.values.backgroundImage, d = typeof l == "object" && l?.url ? l.url : "", p = d ? `background-image:url('${d}');background-size:${l?.cover ? "cover" : "contain"};background-position:${l?.center ? "center" : "top left"};background-repeat:${l?.repeat ? "repeat" : "no-repeat"};` : "", h = t.viewMode, u = !!e.values.hideDesktop, g = !!e.values.hideMobile, m = h === "desktop" && u || h === "mobile" && g, x = u ? "Hidden on desktop" : g ? "Hidden on mobile" : "";
|
|
1735
|
+
return this.classList.toggle("hidden-in-view", m), this.setAttribute("draggable", "true"), this.dataset.rowId = e.id, c`
|
|
1736
|
+
${m ? c`<div class="row-hidden-badge">${x}</div>` : ""}
|
|
1663
1737
|
<div class="row-actions">
|
|
1664
1738
|
<button class="row-action-btn" @click=${this.handleMoveUp} title="Move Up">
|
|
1665
1739
|
<svg viewBox="0 0 24 24"><path d="M12 19V5"/><path d="m5 12 7-7 7 7"/></svg>
|
|
@@ -1676,16 +1750,16 @@ let D = class extends w {
|
|
|
1676
1750
|
</div>
|
|
1677
1751
|
<div
|
|
1678
1752
|
class="row-wrapper"
|
|
1679
|
-
style="background-color:${n};padding:${r}
|
|
1753
|
+
style="background-color:${n};padding:${r};${p}"
|
|
1680
1754
|
>
|
|
1681
|
-
${e.columns.map((
|
|
1682
|
-
const
|
|
1755
|
+
${e.columns.map((f, y) => {
|
|
1756
|
+
const R = e.cells[y] / s * 100;
|
|
1683
1757
|
return c`
|
|
1684
1758
|
<me-column-renderer
|
|
1685
|
-
.column=${
|
|
1759
|
+
.column=${f}
|
|
1686
1760
|
.store=${t}
|
|
1687
1761
|
.toolRegistry=${o}
|
|
1688
|
-
.widthPercent=${
|
|
1762
|
+
.widthPercent=${R}
|
|
1689
1763
|
style="background-color:${i};"
|
|
1690
1764
|
></me-column-renderer>
|
|
1691
1765
|
`;
|
|
@@ -1694,10 +1768,18 @@ let D = class extends w {
|
|
|
1694
1768
|
`;
|
|
1695
1769
|
}
|
|
1696
1770
|
};
|
|
1697
|
-
D.styles =
|
|
1771
|
+
D.styles = $`
|
|
1698
1772
|
:host {
|
|
1699
1773
|
display: block;
|
|
1700
1774
|
position: relative;
|
|
1775
|
+
transition: opacity 0.2s ease;
|
|
1776
|
+
}
|
|
1777
|
+
:host(.hidden-in-view) { opacity: 0.3; }
|
|
1778
|
+
.row-hidden-badge {
|
|
1779
|
+
position: absolute; top: 4px; left: 4px; z-index: 5;
|
|
1780
|
+
background: #f59e0b; color: white; font-size: 10px; font-weight: 600;
|
|
1781
|
+
padding: 2px 6px; border-radius: 3px; font-family: sans-serif;
|
|
1782
|
+
pointer-events: none;
|
|
1701
1783
|
}
|
|
1702
1784
|
.row-wrapper {
|
|
1703
1785
|
display: flex;
|
|
@@ -1750,26 +1832,26 @@ D.styles = v`
|
|
|
1750
1832
|
stroke-linejoin: round;
|
|
1751
1833
|
}
|
|
1752
1834
|
`;
|
|
1753
|
-
|
|
1835
|
+
U([
|
|
1754
1836
|
b({ attribute: !1 })
|
|
1755
1837
|
], D.prototype, "row", 2);
|
|
1756
|
-
|
|
1838
|
+
U([
|
|
1757
1839
|
b({ attribute: !1 })
|
|
1758
1840
|
], D.prototype, "store", 1);
|
|
1759
|
-
|
|
1841
|
+
U([
|
|
1760
1842
|
b({ attribute: !1 })
|
|
1761
1843
|
], D.prototype, "toolRegistry", 2);
|
|
1762
|
-
D =
|
|
1763
|
-
|
|
1844
|
+
D = U([
|
|
1845
|
+
k("me-row-renderer")
|
|
1764
1846
|
], D);
|
|
1765
|
-
var
|
|
1766
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1847
|
+
var Ot = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, K = (e, t, o, n) => {
|
|
1848
|
+
for (var i = n > 1 ? void 0 : n ? jt(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
1767
1849
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
1768
|
-
return n && i &&
|
|
1850
|
+
return n && i && Ot(t, o, i), i;
|
|
1769
1851
|
};
|
|
1770
|
-
let T = class extends
|
|
1852
|
+
let T = class extends v {
|
|
1771
1853
|
constructor() {
|
|
1772
|
-
super(...arguments), this.storeCtrl = new
|
|
1854
|
+
super(...arguments), this.storeCtrl = new S(this, ["design", "viewMode"]);
|
|
1773
1855
|
}
|
|
1774
1856
|
set store(e) {
|
|
1775
1857
|
this.storeCtrl.setStore(e);
|
|
@@ -1820,7 +1902,7 @@ let T = class extends w {
|
|
|
1820
1902
|
`;
|
|
1821
1903
|
}
|
|
1822
1904
|
};
|
|
1823
|
-
T.styles =
|
|
1905
|
+
T.styles = $`
|
|
1824
1906
|
:host {
|
|
1825
1907
|
display: block;
|
|
1826
1908
|
flex: 1;
|
|
@@ -1874,32 +1956,44 @@ T.styles = v`
|
|
|
1874
1956
|
color: white;
|
|
1875
1957
|
}
|
|
1876
1958
|
`;
|
|
1877
|
-
|
|
1959
|
+
K([
|
|
1878
1960
|
b({ attribute: !1 })
|
|
1879
1961
|
], T.prototype, "store", 1);
|
|
1880
|
-
|
|
1962
|
+
K([
|
|
1881
1963
|
b({ attribute: !1 })
|
|
1882
1964
|
], T.prototype, "toolRegistry", 2);
|
|
1883
|
-
T =
|
|
1884
|
-
|
|
1965
|
+
T = K([
|
|
1966
|
+
k("me-editor-canvas")
|
|
1885
1967
|
], T);
|
|
1886
|
-
var
|
|
1887
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1968
|
+
var Ht = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, st = (e, t, o, n) => {
|
|
1969
|
+
for (var i = n > 1 ? void 0 : n ? Wt(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
1888
1970
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
1889
|
-
return n && i &&
|
|
1971
|
+
return n && i && Ht(t, o, i), i;
|
|
1890
1972
|
};
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1893
|
-
{ label: "
|
|
1894
|
-
{ label: "
|
|
1895
|
-
{ label: "
|
|
1896
|
-
{ label: "
|
|
1897
|
-
{ label: "
|
|
1898
|
-
{ label: "
|
|
1973
|
+
const q = [
|
|
1974
|
+
// System / email-safe fonts
|
|
1975
|
+
{ label: "Arial", value: "arial,helvetica,sans-serif", url: "" },
|
|
1976
|
+
{ label: "Helvetica", value: "helvetica,sans-serif", url: "" },
|
|
1977
|
+
{ label: "Georgia", value: "georgia,serif", url: "" },
|
|
1978
|
+
{ label: "Times New Roman", value: "'times new roman',times,serif", url: "" },
|
|
1979
|
+
{ label: "Trebuchet MS", value: "trebuchet ms,helvetica,sans-serif", url: "" },
|
|
1980
|
+
{ label: "Verdana", value: "verdana,geneva,sans-serif", url: "" },
|
|
1981
|
+
{ label: "Courier New", value: "'courier new',courier,monospace", url: "" },
|
|
1982
|
+
// Google Fonts
|
|
1983
|
+
{ label: "Lato", value: "'Lato',sans-serif", url: "https://fonts.googleapis.com/css?family=Lato:400,700" },
|
|
1984
|
+
{ label: "Montserrat", value: "'Montserrat',sans-serif", url: "https://fonts.googleapis.com/css?family=Montserrat:400,700" },
|
|
1985
|
+
{ label: "Old Standard TT", value: "'Old Standard TT',serif", url: "https://fonts.googleapis.com/css?family=Old+Standard+TT:400,700" },
|
|
1986
|
+
{ label: "Open Sans", value: "'Open Sans',sans-serif", url: "https://fonts.googleapis.com/css?family=Open+Sans:400,700" },
|
|
1987
|
+
{ label: "Pacifico", value: "'Pacifico',cursive", url: "https://fonts.googleapis.com/css?family=Pacifico:400" },
|
|
1988
|
+
{ label: "Playfair Display", value: "'Playfair Display',serif", url: "https://fonts.googleapis.com/css?family=Playfair+Display:400,700" },
|
|
1989
|
+
{ label: "Raleway", value: "'Raleway',sans-serif", url: "https://fonts.googleapis.com/css?family=Raleway:400,700" },
|
|
1990
|
+
{ label: "Roboto", value: "'Roboto',sans-serif", url: "https://fonts.googleapis.com/css?family=Roboto:400,700" },
|
|
1991
|
+
{ label: "Rubik", value: "'Rubik',sans-serif", url: "https://fonts.googleapis.com/css?family=Rubik:400,700" },
|
|
1992
|
+
{ label: "Source Sans Pro", value: "'Source Sans Pro',sans-serif", url: "https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" }
|
|
1899
1993
|
];
|
|
1900
|
-
let
|
|
1994
|
+
let L = class extends v {
|
|
1901
1995
|
constructor() {
|
|
1902
|
-
super(...arguments), this.storeCtrl = new
|
|
1996
|
+
super(...arguments), this.storeCtrl = new S(this, ["design"]);
|
|
1903
1997
|
}
|
|
1904
1998
|
set store(e) {
|
|
1905
1999
|
this.storeCtrl.setStore(e);
|
|
@@ -1915,8 +2009,16 @@ let E = class extends w {
|
|
|
1915
2009
|
this.store.updateBodyValues({ linkStyle: { ...o, [e]: t } });
|
|
1916
2010
|
}
|
|
1917
2011
|
updateFontFamily(e) {
|
|
1918
|
-
const t =
|
|
1919
|
-
|
|
2012
|
+
const t = q.find((n) => n.value === e), o = { label: t?.label || e, value: e };
|
|
2013
|
+
if (t?.url) {
|
|
2014
|
+
o.url = t.url;
|
|
2015
|
+
const n = `emabuild-font-${e.replace(/[^a-z]/gi, "")}`;
|
|
2016
|
+
if (!document.getElementById(n)) {
|
|
2017
|
+
const i = document.createElement("link");
|
|
2018
|
+
i.id = n, i.rel = "stylesheet", i.href = t.url, document.head.appendChild(i);
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
this.store.updateBodyValues({ fontFamily: o });
|
|
1920
2022
|
}
|
|
1921
2023
|
render() {
|
|
1922
2024
|
const e = this.store.getBodyValues();
|
|
@@ -1943,7 +2045,12 @@ let E = class extends w {
|
|
|
1943
2045
|
<div class="field">
|
|
1944
2046
|
<label class="field-label">Font Family</label>
|
|
1945
2047
|
<select class="input" @change=${(t) => this.updateFontFamily(t.target.value)}>
|
|
1946
|
-
|
|
2048
|
+
<optgroup label="System Fonts">
|
|
2049
|
+
${q.filter((t) => !t.url).map((t) => c`<option value=${t.value} ?selected=${e.fontFamily?.value === t.value}>${t.label}</option>`)}
|
|
2050
|
+
</optgroup>
|
|
2051
|
+
<optgroup label="Google Fonts">
|
|
2052
|
+
${q.filter((t) => !!t.url).map((t) => c`<option value=${t.value} ?selected=${e.fontFamily?.value === t.value}>${t.label}</option>`)}
|
|
2053
|
+
</optgroup>
|
|
1947
2054
|
</select>
|
|
1948
2055
|
</div>
|
|
1949
2056
|
${this.renderColorField("Text Color", e.textColor || "#000000", (t) => this.update_("textColor", t))}
|
|
@@ -1980,7 +2087,7 @@ let E = class extends w {
|
|
|
1980
2087
|
`;
|
|
1981
2088
|
}
|
|
1982
2089
|
};
|
|
1983
|
-
|
|
2090
|
+
L.styles = $`
|
|
1984
2091
|
:host { display: block; }
|
|
1985
2092
|
.section-title {
|
|
1986
2093
|
font-size: 11px; font-weight: 600; text-transform: uppercase;
|
|
@@ -2005,20 +2112,20 @@ E.styles = v`
|
|
|
2005
2112
|
}
|
|
2006
2113
|
.align-btn.active { border-color: #3b82f6; background: #eff6ff; color: #3b82f6; }
|
|
2007
2114
|
`;
|
|
2008
|
-
|
|
2115
|
+
st([
|
|
2009
2116
|
b({ attribute: !1 })
|
|
2010
|
-
],
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
],
|
|
2014
|
-
var
|
|
2015
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2117
|
+
], L.prototype, "store", 1);
|
|
2118
|
+
L = st([
|
|
2119
|
+
k("me-body-settings")
|
|
2120
|
+
], L);
|
|
2121
|
+
var Ut = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, J = (e, t, o, n) => {
|
|
2122
|
+
for (var i = n > 1 ? void 0 : n ? Ft(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
2016
2123
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
2017
|
-
return n && i &&
|
|
2124
|
+
return n && i && Ut(t, o, i), i;
|
|
2018
2125
|
};
|
|
2019
|
-
let I = class extends
|
|
2126
|
+
let I = class extends v {
|
|
2020
2127
|
constructor() {
|
|
2021
|
-
super(...arguments), this.storeCtrl = new
|
|
2128
|
+
super(...arguments), this.storeCtrl = new S(this, ["activeTab"]);
|
|
2022
2129
|
}
|
|
2023
2130
|
set store(e) {
|
|
2024
2131
|
this.storeCtrl.setStore(e);
|
|
@@ -2063,7 +2170,7 @@ let I = class extends w {
|
|
|
2063
2170
|
draggable="true"
|
|
2064
2171
|
@dragstart=${(o) => this.handleDragStart(o, t.name)}
|
|
2065
2172
|
>
|
|
2066
|
-
<div class="tool-icon">${
|
|
2173
|
+
<div class="tool-icon">${H(t.icon)}</div>
|
|
2067
2174
|
<span>${t.label}</span>
|
|
2068
2175
|
</div>
|
|
2069
2176
|
`
|
|
@@ -2108,7 +2215,7 @@ let I = class extends w {
|
|
|
2108
2215
|
return c`<me-body-settings .store=${this.store}></me-body-settings>`;
|
|
2109
2216
|
}
|
|
2110
2217
|
};
|
|
2111
|
-
I.styles =
|
|
2218
|
+
I.styles = $`
|
|
2112
2219
|
:host {
|
|
2113
2220
|
display: flex;
|
|
2114
2221
|
flex-direction: column;
|
|
@@ -2242,16 +2349,16 @@ I.styles = v`
|
|
|
2242
2349
|
transition: background 0.2s ease;
|
|
2243
2350
|
}
|
|
2244
2351
|
`;
|
|
2245
|
-
|
|
2352
|
+
J([
|
|
2246
2353
|
b({ attribute: !1 })
|
|
2247
2354
|
], I.prototype, "store", 1);
|
|
2248
|
-
|
|
2355
|
+
J([
|
|
2249
2356
|
b({ attribute: !1 })
|
|
2250
2357
|
], I.prototype, "toolRegistry", 2);
|
|
2251
|
-
I =
|
|
2252
|
-
|
|
2358
|
+
I = J([
|
|
2359
|
+
k("me-editor-sidebar")
|
|
2253
2360
|
], I);
|
|
2254
|
-
function
|
|
2361
|
+
function Nt(e, t, o) {
|
|
2255
2362
|
const n = e && /^#[0-9a-fA-F]{3,8}$/.test(e) ? e : "#000000";
|
|
2256
2363
|
return c`
|
|
2257
2364
|
<div class="prop-row">
|
|
@@ -2265,7 +2372,7 @@ function Ht(e, t, o) {
|
|
|
2265
2372
|
</div>
|
|
2266
2373
|
`;
|
|
2267
2374
|
}
|
|
2268
|
-
function
|
|
2375
|
+
function qt(e, t, o, n) {
|
|
2269
2376
|
const i = n?.options || [];
|
|
2270
2377
|
return c`
|
|
2271
2378
|
<div class="prop-row">
|
|
@@ -2276,7 +2383,7 @@ function jt(e, t, o, n) {
|
|
|
2276
2383
|
</div>
|
|
2277
2384
|
`;
|
|
2278
2385
|
}
|
|
2279
|
-
function
|
|
2386
|
+
function Gt(e, t, o) {
|
|
2280
2387
|
return c`
|
|
2281
2388
|
<div class="prop-row">
|
|
2282
2389
|
<label class="prop-label">${o}</label>
|
|
@@ -2291,24 +2398,24 @@ function Wt(e, t, o) {
|
|
|
2291
2398
|
</div>
|
|
2292
2399
|
`;
|
|
2293
2400
|
}
|
|
2294
|
-
function
|
|
2401
|
+
function Yt(e) {
|
|
2295
2402
|
const t = (e || "0px").split(/\s+/).map((s) => parseInt(s) || 0), o = t[0], n = t[1] ?? o, i = t[2] ?? o, r = t[3] ?? n;
|
|
2296
2403
|
return [o, n, i, r];
|
|
2297
2404
|
}
|
|
2298
|
-
function
|
|
2405
|
+
function Kt(e, t, o, n) {
|
|
2299
2406
|
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`;
|
|
2300
2407
|
}
|
|
2301
|
-
function
|
|
2302
|
-
const [n, i, r, s] =
|
|
2408
|
+
function Jt(e, t, o) {
|
|
2409
|
+
const [n, i, r, s] = Yt(e), l = (p, h, u, g) => t(Kt(p, h, u, g));
|
|
2303
2410
|
return c`
|
|
2304
2411
|
<div class="prop-row">
|
|
2305
2412
|
<label class="prop-label">${o}</label>
|
|
2306
2413
|
<div style="display:grid;grid-template-columns:1fr 1fr;gap:4px;">
|
|
2307
2414
|
${[
|
|
2308
|
-
{ label: "T", val: n, change: (p) =>
|
|
2309
|
-
{ label: "R", val: i, change: (p) =>
|
|
2310
|
-
{ label: "B", val: r, change: (p) =>
|
|
2311
|
-
{ label: "L", val: s, change: (p) =>
|
|
2415
|
+
{ label: "T", val: n, change: (p) => l(p, i, r, s) },
|
|
2416
|
+
{ label: "R", val: i, change: (p) => l(n, p, r, s) },
|
|
2417
|
+
{ label: "B", val: r, change: (p) => l(n, i, p, s) },
|
|
2418
|
+
{ label: "L", val: s, change: (p) => l(n, i, r, p) }
|
|
2312
2419
|
].map((p) => c`
|
|
2313
2420
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
2314
2421
|
<span style="font-size:10px;color:#9ca3af;width:12px;">${p.label}</span>
|
|
@@ -2321,7 +2428,7 @@ function Nt(e, t, o) {
|
|
|
2321
2428
|
</div>
|
|
2322
2429
|
`;
|
|
2323
2430
|
}
|
|
2324
|
-
function
|
|
2431
|
+
function Xt(e, t, o) {
|
|
2325
2432
|
return c`
|
|
2326
2433
|
<div class="prop-row">
|
|
2327
2434
|
<div class="prop-toggle">
|
|
@@ -2332,7 +2439,7 @@ function qt(e, t, o) {
|
|
|
2332
2439
|
</div>
|
|
2333
2440
|
`;
|
|
2334
2441
|
}
|
|
2335
|
-
function
|
|
2442
|
+
function Qt(e, t, o) {
|
|
2336
2443
|
return c`
|
|
2337
2444
|
<div class="prop-row">
|
|
2338
2445
|
<label class="prop-label">${o}</label>
|
|
@@ -2341,7 +2448,7 @@ function Gt(e, t, o) {
|
|
|
2341
2448
|
</div>
|
|
2342
2449
|
`;
|
|
2343
2450
|
}
|
|
2344
|
-
function
|
|
2451
|
+
function Zt(e, t, o) {
|
|
2345
2452
|
return c`
|
|
2346
2453
|
<div class="prop-row">
|
|
2347
2454
|
<label class="prop-label">${o}</label>
|
|
@@ -2353,14 +2460,14 @@ function Yt(e, t, o) {
|
|
|
2353
2460
|
</div>
|
|
2354
2461
|
`;
|
|
2355
2462
|
}
|
|
2356
|
-
var
|
|
2357
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2463
|
+
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, X = (e, t, o, n) => {
|
|
2464
|
+
for (var i = n > 1 ? void 0 : n ? ee(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
2358
2465
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
2359
|
-
return n && i &&
|
|
2466
|
+
return n && i && te(t, o, i), i;
|
|
2360
2467
|
};
|
|
2361
|
-
let P = class extends
|
|
2468
|
+
let P = class extends v {
|
|
2362
2469
|
constructor() {
|
|
2363
|
-
super(...arguments), this.storeCtrl = new
|
|
2470
|
+
super(...arguments), this.storeCtrl = new S(this, ["design", "selection"]);
|
|
2364
2471
|
}
|
|
2365
2472
|
set store(e) {
|
|
2366
2473
|
this.storeCtrl.setStore(e);
|
|
@@ -2407,24 +2514,24 @@ let P = class extends w {
|
|
|
2407
2514
|
const n = e.values[t] ?? o.defaultValue, i = this.onChange(e.id, t);
|
|
2408
2515
|
switch (o.widget) {
|
|
2409
2516
|
case "color_picker":
|
|
2410
|
-
return
|
|
2517
|
+
return Nt(n, i, o.label);
|
|
2411
2518
|
case "toggle":
|
|
2412
|
-
return
|
|
2519
|
+
return Xt(n, i, o.label);
|
|
2413
2520
|
case "rich_text":
|
|
2414
|
-
return
|
|
2521
|
+
return Zt(n, i, o.label);
|
|
2415
2522
|
case "dropdown":
|
|
2416
|
-
return
|
|
2523
|
+
return qt(n, i, o.label, o.widgetParams);
|
|
2417
2524
|
case "alignment":
|
|
2418
|
-
return
|
|
2525
|
+
return Gt(n, i, o.label);
|
|
2419
2526
|
case "padding":
|
|
2420
|
-
return
|
|
2527
|
+
return Jt(n, i, o.label);
|
|
2421
2528
|
case "text":
|
|
2422
2529
|
default:
|
|
2423
|
-
return
|
|
2530
|
+
return Qt(n, i, o.label);
|
|
2424
2531
|
}
|
|
2425
2532
|
}
|
|
2426
2533
|
};
|
|
2427
|
-
P.styles =
|
|
2534
|
+
P.styles = $`
|
|
2428
2535
|
:host {
|
|
2429
2536
|
display: flex; flex-direction: column; width: 300px; min-width: 300px;
|
|
2430
2537
|
background: #fff; border-left: 1px solid #e5e7eb;
|
|
@@ -2458,23 +2565,23 @@ P.styles = v`
|
|
|
2458
2565
|
.color-swatch { width: 28px; height: 28px; border-radius: 4px; border: 1px solid #d1d5db; cursor: pointer; padding: 0; }
|
|
2459
2566
|
textarea.prop-input { min-height: 80px; resize: vertical; font-family: monospace; }
|
|
2460
2567
|
`;
|
|
2461
|
-
|
|
2568
|
+
X([
|
|
2462
2569
|
b({ attribute: !1 })
|
|
2463
2570
|
], P.prototype, "store", 1);
|
|
2464
|
-
|
|
2571
|
+
X([
|
|
2465
2572
|
b({ attribute: !1 })
|
|
2466
2573
|
], P.prototype, "toolRegistry", 2);
|
|
2467
|
-
P =
|
|
2468
|
-
|
|
2574
|
+
P = X([
|
|
2575
|
+
k("me-property-panel")
|
|
2469
2576
|
], P);
|
|
2470
|
-
var
|
|
2471
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2577
|
+
var oe = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, lt = (e, t, o, n) => {
|
|
2578
|
+
for (var i = n > 1 ? void 0 : n ? ne(t, o) : t, r = e.length - 1, s; r >= 0; r--)
|
|
2472
2579
|
(s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
|
|
2473
|
-
return n && i &&
|
|
2580
|
+
return n && i && oe(t, o, i), i;
|
|
2474
2581
|
};
|
|
2475
|
-
let
|
|
2582
|
+
let B = class extends v {
|
|
2476
2583
|
constructor() {
|
|
2477
|
-
super(...arguments), this.options = {}, this.store = new
|
|
2584
|
+
super(...arguments), this.options = {}, this.store = new mt(), this.toolRegistry = new xt(), this.dragManager = null, this.callbacks = /* @__PURE__ */ new Map(), this.unsubscribe = null, this._handleKeydown = (e) => {
|
|
2478
2585
|
const t = e.metaKey || e.ctrlKey, n = e.composedPath().some((i) => {
|
|
2479
2586
|
const r = i?.tagName;
|
|
2480
2587
|
return r === "INPUT" || r === "TEXTAREA" || r === "SELECT";
|
|
@@ -2486,7 +2593,7 @@ let L = class extends w {
|
|
|
2486
2593
|
super.connectedCallback(), this.registerBuiltInTools(), this.applyOptions(), this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this._handleKeydown);
|
|
2487
2594
|
}
|
|
2488
2595
|
firstUpdated() {
|
|
2489
|
-
this.dragManager = new
|
|
2596
|
+
this.dragManager = new yt(this.store, this.toolRegistry, this.shadowRoot), this.dragManager.attach(), this.store.events.on("design:loaded", (e) => {
|
|
2490
2597
|
this.dispatchEvent(new CustomEvent("design:loaded", { detail: e, bubbles: !0, composed: !0 }));
|
|
2491
2598
|
}), this.store.events.on("design:updated", (e) => {
|
|
2492
2599
|
this.dispatchEvent(new CustomEvent("design:updated", { detail: e, bubbles: !0, composed: !0 }));
|
|
@@ -2508,8 +2615,8 @@ let L = class extends w {
|
|
|
2508
2615
|
const o = this.store.getDesign(), n = /* @__PURE__ */ new Set();
|
|
2509
2616
|
for (const r of o.body.rows)
|
|
2510
2617
|
for (const s of r.columns)
|
|
2511
|
-
for (const
|
|
2512
|
-
n.add(
|
|
2618
|
+
for (const l of s.contents)
|
|
2619
|
+
n.add(l.type);
|
|
2513
2620
|
const i = Array.from(n).filter((r) => !this.toolRegistry.isLoaded(r)).map((r) => this.toolRegistry.ensureLoaded(r));
|
|
2514
2621
|
i.length > 0 ? Promise.all(i).then(() => this.doExport(o, e, t)) : this.doExport(o, e, t);
|
|
2515
2622
|
}
|
|
@@ -2517,7 +2624,7 @@ let L = class extends w {
|
|
|
2517
2624
|
const n = /* @__PURE__ */ new Map();
|
|
2518
2625
|
for (const i of this.toolRegistry.getAll())
|
|
2519
2626
|
n.set(i.name, (r, s) => i.renderer.renderHtml(r, s));
|
|
2520
|
-
t(
|
|
2627
|
+
t(Pt(e, n, o));
|
|
2521
2628
|
}
|
|
2522
2629
|
async exportHtmlAsync(e) {
|
|
2523
2630
|
return new Promise((t) => this.exportHtml(t, e));
|
|
@@ -2553,15 +2660,15 @@ let L = class extends w {
|
|
|
2553
2660
|
*/
|
|
2554
2661
|
preloadLazyTools() {
|
|
2555
2662
|
const e = window.requestIdleCallback ?? ((t) => setTimeout(t, 1e3));
|
|
2556
|
-
for (const { meta: t } of
|
|
2663
|
+
for (const { meta: t } of it)
|
|
2557
2664
|
e(() => {
|
|
2558
2665
|
this.toolRegistry.ensureLoaded(t.name);
|
|
2559
2666
|
});
|
|
2560
2667
|
}
|
|
2561
2668
|
registerBuiltInTools() {
|
|
2562
|
-
for (const e of
|
|
2669
|
+
for (const e of Rt)
|
|
2563
2670
|
this.toolRegistry.register(e);
|
|
2564
|
-
for (const { meta: e, loader: t } of
|
|
2671
|
+
for (const { meta: e, loader: t } of it)
|
|
2565
2672
|
this.toolRegistry.registerLazy(e, t);
|
|
2566
2673
|
}
|
|
2567
2674
|
applyOptions() {
|
|
@@ -2584,7 +2691,7 @@ let L = class extends w {
|
|
|
2584
2691
|
`;
|
|
2585
2692
|
}
|
|
2586
2693
|
};
|
|
2587
|
-
|
|
2694
|
+
B.styles = $`
|
|
2588
2695
|
:host {
|
|
2589
2696
|
display: flex;
|
|
2590
2697
|
width: 100%;
|
|
@@ -2599,31 +2706,31 @@ L.styles = v`
|
|
|
2599
2706
|
}
|
|
2600
2707
|
* { box-sizing: border-box; }
|
|
2601
2708
|
`;
|
|
2602
|
-
|
|
2709
|
+
lt([
|
|
2603
2710
|
b({ type: Object })
|
|
2604
|
-
],
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
],
|
|
2608
|
-
function
|
|
2711
|
+
], B.prototype, "options", 2);
|
|
2712
|
+
B = lt([
|
|
2713
|
+
k("mail-editor")
|
|
2714
|
+
], B);
|
|
2715
|
+
function C(e, t) {
|
|
2609
2716
|
customElements.get(e) || customElements.define(e, t);
|
|
2610
2717
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
const
|
|
2718
|
+
C("mail-editor", B);
|
|
2719
|
+
C("me-editor-canvas", T);
|
|
2720
|
+
C("me-row-renderer", D);
|
|
2721
|
+
C("me-column-renderer", w);
|
|
2722
|
+
C("me-content-renderer", _);
|
|
2723
|
+
C("me-editor-sidebar", I);
|
|
2724
|
+
C("me-body-settings", L);
|
|
2725
|
+
C("me-property-panel", P);
|
|
2726
|
+
const ae = customElements.get("mail-editor") !== void 0;
|
|
2620
2727
|
export {
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2728
|
+
ae as E,
|
|
2729
|
+
B as M,
|
|
2730
|
+
xt as T,
|
|
2731
|
+
mt as a,
|
|
2732
|
+
V as e,
|
|
2733
|
+
le as j,
|
|
2734
|
+
a as s
|
|
2628
2735
|
};
|
|
2629
|
-
//# sourceMappingURL=index-
|
|
2736
|
+
//# sourceMappingURL=index-BQJRD2VW.js.map
|