@lit-pigeon/editor 0.3.4 → 0.4.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/README.md +38 -12
- package/dist/ar.js +272 -0
- package/dist/de.js +272 -0
- package/dist/es.js +272 -0
- package/dist/fr.js +272 -0
- package/dist/hi.js +272 -0
- package/dist/index.d.ts +85 -2
- package/dist/index.js +1416 -915
- package/dist/it.js +272 -0
- package/dist/ja.js +272 -0
- package/dist/nl.js +272 -0
- package/dist/pt-BR.js +272 -0
- package/dist/rich-text-bridge.js +108 -40
- package/dist/rich-text.js +2225 -2042
- package/dist/zh-CN.js +272 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { css as g, LitElement as d, html as l, nothing as
|
|
1
|
+
import { css as g, LitElement as d, html as l, nothing as G } from "lit";
|
|
2
2
|
import { property as p, state as c, customElement as h } from "lit/decorators.js";
|
|
3
|
-
import { t as s, l as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
3
|
+
import { t as s, s as Me, l as it, r as Lt, c as bt, a as zt } from "./rich-text-bridge.js";
|
|
4
|
+
import { B as rr, b as nr } from "./rich-text-bridge.js";
|
|
5
|
+
import { getAvailableBlockDefinitions as vt, getBlockDefinition as et, resolveRowBackground as Ot, resolveDirection as Mt, updateBlock as Ve, createBlock as Be, insertBlock as ie, createColumn as me, insertRow as J, createRow as ye, cloneRowWithNewIds as ft, createBodySelection as mt, deleteBlock as At, deleteRow as yt, duplicateBlock as Ft, duplicateRow as _t, generateId as xt, setAvailableBlockTypes as wt, EditorState as $t, createHistoryPlugin as kt, undo as Ht, redo as Ut, InMemoryTemplateStorage as Nt, InMemoryRowLibraryStorage as Kt, SYSTEM_LINK_TYPES as Wt, createDocStep as Ye, createDefaultDocument as qt, HISTORY_PLUGIN_NAME as Ct, canUndo as Vt, canRedo as Yt, createBlockSelection as Xe, createRowSelection as It, createColumnSelection as Xt, moveRow as Gt, moveBlock as Jt, updateRowAttributes as Zt, updateColumnAttributes as Qt, addColumn as eo, removeColumn as to, resizeColumns as oo } from "@lit-pigeon/core";
|
|
6
|
+
import { unsafeHTML as Dt } from "lit/directives/unsafe-html.js";
|
|
7
|
+
import { createRef as re, ref as ne } from "lit/directives/ref.js";
|
|
8
|
+
import { styleMap as io } from "lit/directives/style-map.js";
|
|
9
|
+
import { keyed as ro } from "lit/directives/keyed.js";
|
|
10
|
+
import { PigeonTemplatePicker as sr } from "./templates.js";
|
|
11
|
+
const Pt = g`
|
|
10
12
|
/* base palette */
|
|
11
13
|
--pigeon-bg: #0f172a; /* slate-900 */
|
|
12
14
|
--pigeon-surface: #1e293b; /* slate-800 */
|
|
@@ -42,7 +44,7 @@ const yt = g`
|
|
|
42
44
|
0 2px 4px -2px rgb(0 0 0 / 0.4);
|
|
43
45
|
--pigeon-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5),
|
|
44
46
|
0 4px 6px -4px rgb(0 0 0 / 0.5);
|
|
45
|
-
`,
|
|
47
|
+
`, no = g`
|
|
46
48
|
:host {
|
|
47
49
|
/* base palette */
|
|
48
50
|
--pigeon-bg: #ffffff;
|
|
@@ -103,23 +105,23 @@ const yt = g`
|
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
:host(.pigeon-dark) {
|
|
106
|
-
${
|
|
108
|
+
${Pt}
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
@media (prefers-color-scheme: dark) {
|
|
110
112
|
:host(.pigeon-auto) {
|
|
111
|
-
${
|
|
113
|
+
${Pt}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
`;
|
|
115
|
-
var
|
|
116
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
117
|
+
var ao = Object.defineProperty, so = Object.getOwnPropertyDescriptor, ee = (e, t, o, r) => {
|
|
118
|
+
for (var i = r > 1 ? void 0 : r ? so(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
117
119
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
118
|
-
return r && i &&
|
|
120
|
+
return r && i && ao(t, o, i), i;
|
|
119
121
|
};
|
|
120
|
-
let
|
|
122
|
+
let M = class extends d {
|
|
121
123
|
constructor() {
|
|
122
|
-
super(...arguments), this.canUndo = !1, this.canRedo = !1, this.device = "desktop", this.fullscreen = !1, this._exportMenuOpen = !1;
|
|
124
|
+
super(...arguments), this.canUndo = !1, this.canRedo = !1, this.device = "desktop", this.fullscreen = !1, this.readonly = !1, this._exportMenuOpen = !1;
|
|
123
125
|
}
|
|
124
126
|
connectedCallback() {
|
|
125
127
|
super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "toolbar"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", "Editor toolbar");
|
|
@@ -127,7 +129,7 @@ let H = class extends d {
|
|
|
127
129
|
render() {
|
|
128
130
|
return l`
|
|
129
131
|
<!-- Undo/Redo -->
|
|
130
|
-
|
|
132
|
+
${this.readonly ? "" : l`<button
|
|
131
133
|
class="icon-btn"
|
|
132
134
|
part="toolbar-button toolbar-button-undo"
|
|
133
135
|
title=${s("toolbar.undo")}
|
|
@@ -155,7 +157,7 @@ let H = class extends d {
|
|
|
155
157
|
</svg>
|
|
156
158
|
</button>
|
|
157
159
|
|
|
158
|
-
<div class="separator"></div
|
|
160
|
+
<div class="separator"></div>`}
|
|
159
161
|
|
|
160
162
|
<!-- Device toggle -->
|
|
161
163
|
<div class="device-group" role="group" aria-label=${s("toolbar.preview-device")}>
|
|
@@ -229,7 +231,7 @@ let H = class extends d {
|
|
|
229
231
|
<div class="separator"></div>
|
|
230
232
|
|
|
231
233
|
<!-- Actions -->
|
|
232
|
-
|
|
234
|
+
${this.readonly ? "" : l`<button
|
|
233
235
|
data-action="templates"
|
|
234
236
|
part="toolbar-button toolbar-button-templates"
|
|
235
237
|
title=${s("toolbar.templates")}
|
|
@@ -242,7 +244,7 @@ let H = class extends d {
|
|
|
242
244
|
<rect x="14" y="14" width="7" height="7" rx="1"/>
|
|
243
245
|
</svg>
|
|
244
246
|
${s("toolbar.templates")}
|
|
245
|
-
</button
|
|
247
|
+
</button>`}
|
|
246
248
|
|
|
247
249
|
<button part="toolbar-button toolbar-button-preview" @click=${this._onPreview}>
|
|
248
250
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
@@ -342,7 +344,7 @@ let H = class extends d {
|
|
|
342
344
|
}));
|
|
343
345
|
}
|
|
344
346
|
};
|
|
345
|
-
|
|
347
|
+
M.styles = g`
|
|
346
348
|
:host {
|
|
347
349
|
display: flex;
|
|
348
350
|
align-items: center;
|
|
@@ -472,38 +474,41 @@ H.styles = g`
|
|
|
472
474
|
font-weight: 400;
|
|
473
475
|
}
|
|
474
476
|
`;
|
|
475
|
-
|
|
477
|
+
ee([
|
|
476
478
|
p({ type: Boolean, attribute: "can-undo" })
|
|
477
|
-
],
|
|
478
|
-
|
|
479
|
+
], M.prototype, "canUndo", 2);
|
|
480
|
+
ee([
|
|
479
481
|
p({ type: Boolean, attribute: "can-redo" })
|
|
480
|
-
],
|
|
481
|
-
|
|
482
|
+
], M.prototype, "canRedo", 2);
|
|
483
|
+
ee([
|
|
482
484
|
p({ type: String })
|
|
483
|
-
],
|
|
484
|
-
|
|
485
|
+
], M.prototype, "device", 2);
|
|
486
|
+
ee([
|
|
485
487
|
p({ type: Boolean })
|
|
486
|
-
],
|
|
487
|
-
|
|
488
|
+
], M.prototype, "fullscreen", 2);
|
|
489
|
+
ee([
|
|
490
|
+
p({ type: Boolean })
|
|
491
|
+
], M.prototype, "readonly", 2);
|
|
492
|
+
ee([
|
|
488
493
|
c()
|
|
489
|
-
],
|
|
490
|
-
|
|
494
|
+
], M.prototype, "_exportMenuOpen", 2);
|
|
495
|
+
M = ee([
|
|
491
496
|
h("pigeon-toolbar")
|
|
492
|
-
],
|
|
493
|
-
let
|
|
494
|
-
function
|
|
495
|
-
|
|
497
|
+
], M);
|
|
498
|
+
let rt = null;
|
|
499
|
+
function lo(e) {
|
|
500
|
+
rt = e;
|
|
496
501
|
}
|
|
497
502
|
function _e() {
|
|
498
|
-
return
|
|
503
|
+
return rt;
|
|
499
504
|
}
|
|
500
|
-
function
|
|
501
|
-
|
|
505
|
+
function Re() {
|
|
506
|
+
rt = null;
|
|
502
507
|
}
|
|
503
|
-
function
|
|
504
|
-
e.dataTransfer && (e.dataTransfer.setData("application/json", JSON.stringify(t)), e.dataTransfer.effectAllowed = "move"),
|
|
508
|
+
function nt(e, t) {
|
|
509
|
+
e.dataTransfer && (e.dataTransfer.setData("application/json", JSON.stringify(t)), e.dataTransfer.effectAllowed = "move"), lo(t);
|
|
505
510
|
}
|
|
506
|
-
function
|
|
511
|
+
function tr(e) {
|
|
507
512
|
if (e.dataTransfer)
|
|
508
513
|
try {
|
|
509
514
|
const t = e.dataTransfer.getData("application/json");
|
|
@@ -512,12 +517,12 @@ function Hi(e) {
|
|
|
512
517
|
}
|
|
513
518
|
return _e();
|
|
514
519
|
}
|
|
515
|
-
var
|
|
516
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
520
|
+
var po = Object.defineProperty, co = Object.getOwnPropertyDescriptor, ue = (e, t, o, r) => {
|
|
521
|
+
for (var i = r > 1 ? void 0 : r ? co(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
517
522
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
518
|
-
return r && i &&
|
|
523
|
+
return r && i && po(t, o, i), i;
|
|
519
524
|
};
|
|
520
|
-
const
|
|
525
|
+
const ho = {
|
|
521
526
|
text: "T",
|
|
522
527
|
image: "[]",
|
|
523
528
|
button: "[B]",
|
|
@@ -526,12 +531,12 @@ const eo = {
|
|
|
526
531
|
social: "@",
|
|
527
532
|
html: "</>"
|
|
528
533
|
};
|
|
529
|
-
let
|
|
534
|
+
let W = class extends d {
|
|
530
535
|
constructor() {
|
|
531
536
|
super(...arguments), this.label = "", this.icon = "", this.dragType = "palette-block", this.blockType = "", this.columnCount = 1, this._didDrag = !1;
|
|
532
537
|
}
|
|
533
538
|
render() {
|
|
534
|
-
const e =
|
|
539
|
+
const e = ho[this.icon] ?? this.icon ?? "?", t = this.dragType === "palette-row" ? "Add layout" : "Add block";
|
|
535
540
|
return l`
|
|
536
541
|
<div
|
|
537
542
|
class="item"
|
|
@@ -574,7 +579,7 @@ let U = class extends d {
|
|
|
574
579
|
);
|
|
575
580
|
}
|
|
576
581
|
_onDragStart(e) {
|
|
577
|
-
this._didDrag = !0,
|
|
582
|
+
this._didDrag = !0, nt(e, {
|
|
578
583
|
type: this.dragType,
|
|
579
584
|
blockType: this.blockType || void 0,
|
|
580
585
|
columnCount: this.columnCount
|
|
@@ -599,7 +604,7 @@ let U = class extends d {
|
|
|
599
604
|
}));
|
|
600
605
|
}
|
|
601
606
|
};
|
|
602
|
-
|
|
607
|
+
W.styles = g`
|
|
603
608
|
:host {
|
|
604
609
|
display: block;
|
|
605
610
|
}
|
|
@@ -657,30 +662,30 @@ U.styles = g`
|
|
|
657
662
|
color: var(--pigeon-text, #1e293b);
|
|
658
663
|
}
|
|
659
664
|
`;
|
|
660
|
-
|
|
665
|
+
ue([
|
|
661
666
|
p({ type: String })
|
|
662
|
-
],
|
|
663
|
-
|
|
667
|
+
], W.prototype, "label", 2);
|
|
668
|
+
ue([
|
|
664
669
|
p({ type: String })
|
|
665
|
-
],
|
|
666
|
-
|
|
670
|
+
], W.prototype, "icon", 2);
|
|
671
|
+
ue([
|
|
667
672
|
p({ type: String, attribute: "drag-type" })
|
|
668
|
-
],
|
|
669
|
-
|
|
673
|
+
], W.prototype, "dragType", 2);
|
|
674
|
+
ue([
|
|
670
675
|
p({ type: String, attribute: "block-type" })
|
|
671
|
-
],
|
|
672
|
-
|
|
676
|
+
], W.prototype, "blockType", 2);
|
|
677
|
+
ue([
|
|
673
678
|
p({ type: Number, attribute: "column-count" })
|
|
674
|
-
],
|
|
675
|
-
|
|
679
|
+
], W.prototype, "columnCount", 2);
|
|
680
|
+
W = ue([
|
|
676
681
|
h("pigeon-palette-item")
|
|
677
|
-
],
|
|
678
|
-
var
|
|
679
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
682
|
+
], W);
|
|
683
|
+
var go = Object.defineProperty, uo = Object.getOwnPropertyDescriptor, at = (e, t, o, r) => {
|
|
684
|
+
for (var i = r > 1 ? void 0 : r ? uo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
680
685
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
681
|
-
return r && i &&
|
|
686
|
+
return r && i && go(t, o, i), i;
|
|
682
687
|
};
|
|
683
|
-
const
|
|
688
|
+
const bo = {
|
|
684
689
|
text: "T",
|
|
685
690
|
image: "Img",
|
|
686
691
|
button: "Btn",
|
|
@@ -691,7 +696,7 @@ const io = {
|
|
|
691
696
|
hero: "H",
|
|
692
697
|
navbar: "Nav"
|
|
693
698
|
};
|
|
694
|
-
let
|
|
699
|
+
let xe = class extends d {
|
|
695
700
|
constructor() {
|
|
696
701
|
super(...arguments), this.selection = null;
|
|
697
702
|
}
|
|
@@ -724,7 +729,7 @@ let ye = class extends d {
|
|
|
724
729
|
}
|
|
725
730
|
_renderBlock(e, t, o) {
|
|
726
731
|
var a;
|
|
727
|
-
const r = ((a = this.selection) == null ? void 0 : a.type) === "block" && this.selection.blockId === e.id, i =
|
|
732
|
+
const r = ((a = this.selection) == null ? void 0 : a.type) === "block" && this.selection.blockId === e.id, i = bo[e.type] ?? "?", n = e.type.charAt(0).toUpperCase() + e.type.slice(1);
|
|
728
733
|
return l`
|
|
729
734
|
<div
|
|
730
735
|
class="tree-item indent-3 ${r ? "selected" : ""}"
|
|
@@ -750,7 +755,7 @@ let ye = class extends d {
|
|
|
750
755
|
}));
|
|
751
756
|
}
|
|
752
757
|
};
|
|
753
|
-
|
|
758
|
+
xe.styles = g`
|
|
754
759
|
:host {
|
|
755
760
|
display: block;
|
|
756
761
|
font-family: var(--pigeon-font);
|
|
@@ -814,44 +819,50 @@ ye.styles = g`
|
|
|
814
819
|
padding: 8px 8px 4px;
|
|
815
820
|
}
|
|
816
821
|
`;
|
|
817
|
-
|
|
822
|
+
at([
|
|
818
823
|
p({ type: Object })
|
|
819
|
-
],
|
|
820
|
-
|
|
824
|
+
], xe.prototype, "doc", 2);
|
|
825
|
+
at([
|
|
821
826
|
p({ type: Object })
|
|
822
|
-
],
|
|
823
|
-
|
|
827
|
+
], xe.prototype, "selection", 2);
|
|
828
|
+
xe = at([
|
|
824
829
|
h("pigeon-layers")
|
|
825
|
-
],
|
|
826
|
-
var
|
|
827
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
830
|
+
], xe);
|
|
831
|
+
var vo = Object.defineProperty, fo = Object.getOwnPropertyDescriptor, B = (e, t, o, r) => {
|
|
832
|
+
for (var i = r > 1 ? void 0 : r ? fo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
828
833
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
829
|
-
return r && i &&
|
|
834
|
+
return r && i && vo(t, o, i), i;
|
|
830
835
|
};
|
|
831
|
-
let
|
|
832
|
-
function
|
|
833
|
-
return
|
|
836
|
+
let Ge = null;
|
|
837
|
+
function mo() {
|
|
838
|
+
return Ge || (Ge = import("./pigeon-brand-tab.js")), Ge;
|
|
834
839
|
}
|
|
835
|
-
let
|
|
836
|
-
function
|
|
837
|
-
return
|
|
840
|
+
let Je = null;
|
|
841
|
+
function yo() {
|
|
842
|
+
return Je || (Je = import("./pigeon-saved-tab.js")), Je;
|
|
838
843
|
}
|
|
839
|
-
const
|
|
844
|
+
const _o = [
|
|
840
845
|
{ labelKey: "palette.layout.1-col", columns: 1, icon: "[=]" },
|
|
841
846
|
{ labelKey: "palette.layout.2-col", columns: 2, icon: "[||]" },
|
|
842
847
|
{ labelKey: "palette.layout.3-col", columns: 3, icon: "[|||]" },
|
|
843
848
|
{ labelKey: "palette.layout.4-col", columns: 4, icon: "[||||]" }
|
|
844
849
|
];
|
|
845
|
-
let
|
|
850
|
+
let $ = class extends d {
|
|
846
851
|
constructor() {
|
|
847
852
|
super(...arguments), this.selection = null, this.brandKit = null, this.rowLibrary = null, this._blockDefs = [], this._activeTab = "content", this._brandTabLoaded = !1, this._savedTabLoaded = !1, this._handleBrandTabClick = async () => {
|
|
848
|
-
this._activeTab = "brand", this._brandTabLoaded || (await
|
|
853
|
+
this._activeTab = "brand", this._brandTabLoaded || (await mo(), this._brandTabLoaded = !0);
|
|
849
854
|
}, this._handleSavedTabClick = async () => {
|
|
850
|
-
this._activeTab = "saved", this._savedTabLoaded || (await
|
|
855
|
+
this._activeTab = "saved", this._savedTabLoaded || (await yo(), this._savedTabLoaded = !0);
|
|
851
856
|
};
|
|
852
857
|
}
|
|
853
858
|
connectedCallback() {
|
|
854
|
-
super.connectedCallback(), this._blockDefs =
|
|
859
|
+
super.connectedCallback(), this._blockDefs = vt();
|
|
860
|
+
}
|
|
861
|
+
// The editor writes the host's list to the registry before passing it here,
|
|
862
|
+
// so re-reading picks up a config change without a reconnect. Done in
|
|
863
|
+
// willUpdate rather than updated so it lands in the same render pass.
|
|
864
|
+
willUpdate(e) {
|
|
865
|
+
e.has("blocks") && (this._blockDefs = vt());
|
|
855
866
|
}
|
|
856
867
|
updated(e) {
|
|
857
868
|
e.has("brandKit") && !this.brandKit && this._activeTab === "brand" && (this._activeTab = "content");
|
|
@@ -925,7 +936,7 @@ let k = class extends d {
|
|
|
925
936
|
<div class="section">
|
|
926
937
|
<div class="section-header">${s("palette.layout.section-layout")}</div>
|
|
927
938
|
<div class="items">
|
|
928
|
-
${
|
|
939
|
+
${_o.map((e) => l`
|
|
929
940
|
<pigeon-palette-item part="palette-item"
|
|
930
941
|
label="${s(e.labelKey)}"
|
|
931
942
|
icon="${e.icon}"
|
|
@@ -952,7 +963,7 @@ let k = class extends d {
|
|
|
952
963
|
return this._savedTabLoaded ? l`<pigeon-saved-tab .storage=${this.rowLibrary}></pigeon-saved-tab>` : l``;
|
|
953
964
|
}
|
|
954
965
|
};
|
|
955
|
-
|
|
966
|
+
$.styles = g`
|
|
956
967
|
:host {
|
|
957
968
|
display: block;
|
|
958
969
|
width: var(--pigeon-palette-width, 240px);
|
|
@@ -1031,34 +1042,37 @@ k.styles = g`
|
|
|
1031
1042
|
gap: 6px;
|
|
1032
1043
|
}
|
|
1033
1044
|
`;
|
|
1034
|
-
|
|
1045
|
+
B([
|
|
1035
1046
|
p({ type: Object })
|
|
1036
|
-
],
|
|
1037
|
-
|
|
1047
|
+
], $.prototype, "doc", 2);
|
|
1048
|
+
B([
|
|
1038
1049
|
p({ type: Object })
|
|
1039
|
-
],
|
|
1040
|
-
|
|
1050
|
+
], $.prototype, "selection", 2);
|
|
1051
|
+
B([
|
|
1041
1052
|
p({ attribute: !1 })
|
|
1042
|
-
],
|
|
1043
|
-
|
|
1053
|
+
], $.prototype, "brandKit", 2);
|
|
1054
|
+
B([
|
|
1044
1055
|
p({ attribute: !1 })
|
|
1045
|
-
],
|
|
1046
|
-
|
|
1056
|
+
], $.prototype, "rowLibrary", 2);
|
|
1057
|
+
B([
|
|
1058
|
+
p({ attribute: !1 })
|
|
1059
|
+
], $.prototype, "blocks", 2);
|
|
1060
|
+
B([
|
|
1047
1061
|
c()
|
|
1048
|
-
],
|
|
1049
|
-
|
|
1062
|
+
], $.prototype, "_blockDefs", 2);
|
|
1063
|
+
B([
|
|
1050
1064
|
c()
|
|
1051
|
-
],
|
|
1052
|
-
|
|
1065
|
+
], $.prototype, "_activeTab", 2);
|
|
1066
|
+
B([
|
|
1053
1067
|
c()
|
|
1054
|
-
],
|
|
1055
|
-
|
|
1068
|
+
], $.prototype, "_brandTabLoaded", 2);
|
|
1069
|
+
B([
|
|
1056
1070
|
c()
|
|
1057
|
-
],
|
|
1058
|
-
|
|
1071
|
+
], $.prototype, "_savedTabLoaded", 2);
|
|
1072
|
+
$ = B([
|
|
1059
1073
|
h("pigeon-palette")
|
|
1060
|
-
],
|
|
1061
|
-
function
|
|
1074
|
+
], $);
|
|
1075
|
+
function xo(e, t) {
|
|
1062
1076
|
if (t.length === 0) return 0;
|
|
1063
1077
|
for (let o = 0; o < t.length; o++) {
|
|
1064
1078
|
const r = t[o].getBoundingClientRect(), i = r.top + r.height / 2;
|
|
@@ -1067,7 +1081,7 @@ function po(e, t) {
|
|
|
1067
1081
|
}
|
|
1068
1082
|
return t.length;
|
|
1069
1083
|
}
|
|
1070
|
-
function
|
|
1084
|
+
function wo(e, t) {
|
|
1071
1085
|
if (t.length === 0) return 0;
|
|
1072
1086
|
for (let o = 0; o < t.length; o++) {
|
|
1073
1087
|
const r = t[o].getBoundingClientRect(), i = r.top + r.height / 2;
|
|
@@ -1076,15 +1090,15 @@ function co(e, t) {
|
|
|
1076
1090
|
}
|
|
1077
1091
|
return t.length;
|
|
1078
1092
|
}
|
|
1079
|
-
function
|
|
1093
|
+
function Et(e, t) {
|
|
1080
1094
|
return e < 0 || t === e || t === e + 1 ? null : t > e ? t - 1 : t;
|
|
1081
1095
|
}
|
|
1082
|
-
var
|
|
1083
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1096
|
+
var $o = Object.defineProperty, ko = Object.getOwnPropertyDescriptor, Bt = (e, t, o, r) => {
|
|
1097
|
+
for (var i = r > 1 ? void 0 : r ? ko(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1084
1098
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1085
|
-
return r && i &&
|
|
1099
|
+
return r && i && $o(t, o, i), i;
|
|
1086
1100
|
};
|
|
1087
|
-
let
|
|
1101
|
+
let Le = class extends d {
|
|
1088
1102
|
constructor() {
|
|
1089
1103
|
super(...arguments), this.visible = !1;
|
|
1090
1104
|
}
|
|
@@ -1097,7 +1111,7 @@ let je = class extends d {
|
|
|
1097
1111
|
`;
|
|
1098
1112
|
}
|
|
1099
1113
|
};
|
|
1100
|
-
|
|
1114
|
+
Le.styles = g`
|
|
1101
1115
|
:host {
|
|
1102
1116
|
display: block;
|
|
1103
1117
|
height: 4px;
|
|
@@ -1141,18 +1155,18 @@ je.styles = g`
|
|
|
1141
1155
|
right: 4px;
|
|
1142
1156
|
}
|
|
1143
1157
|
`;
|
|
1144
|
-
|
|
1158
|
+
Bt([
|
|
1145
1159
|
p({ type: Boolean, reflect: !0 })
|
|
1146
|
-
],
|
|
1147
|
-
|
|
1160
|
+
], Le.prototype, "visible", 2);
|
|
1161
|
+
Le = Bt([
|
|
1148
1162
|
h("pigeon-drop-indicator")
|
|
1149
|
-
],
|
|
1150
|
-
var
|
|
1151
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1163
|
+
], Le);
|
|
1164
|
+
var Co = Object.defineProperty, Io = Object.getOwnPropertyDescriptor, Ae = (e, t, o, r) => {
|
|
1165
|
+
for (var i = r > 1 ? void 0 : r ? Io(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1152
1166
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1153
|
-
return r && i &&
|
|
1167
|
+
return r && i && Co(t, o, i), i;
|
|
1154
1168
|
};
|
|
1155
|
-
let
|
|
1169
|
+
let ae = class extends d {
|
|
1156
1170
|
constructor() {
|
|
1157
1171
|
super(...arguments), this.selected = !1, this.editing = !1, this._editor = null, this._editorHost = null;
|
|
1158
1172
|
}
|
|
@@ -1166,7 +1180,7 @@ let ne = class extends d {
|
|
|
1166
1180
|
@click=${this._handleClick}
|
|
1167
1181
|
@dblclick=${this._handleDblClick}
|
|
1168
1182
|
>
|
|
1169
|
-
${this.editing ? l`<div class="content" style="${o}"></div>` : l`<div class="content" style="${o}" .innerHTML=${e.content}></div>`}
|
|
1183
|
+
${this.editing ? l`<div class="content" style="${o}"></div>` : l`<div class="content" style="${o}" .innerHTML=${Me(e.content)}></div>`}
|
|
1170
1184
|
</div>
|
|
1171
1185
|
`;
|
|
1172
1186
|
}
|
|
@@ -1180,7 +1194,7 @@ let ne = class extends d {
|
|
|
1180
1194
|
const e = this.renderRoot.querySelector(".content");
|
|
1181
1195
|
if (!e) return;
|
|
1182
1196
|
this._editorHost = e;
|
|
1183
|
-
const t = await
|
|
1197
|
+
const t = await it();
|
|
1184
1198
|
!this.editing || !this._editorHost || (this._editor = t.createEditor({
|
|
1185
1199
|
element: this._editorHost,
|
|
1186
1200
|
initialHTML: this.block.values.content,
|
|
@@ -1220,7 +1234,7 @@ let ne = class extends d {
|
|
|
1220
1234
|
}));
|
|
1221
1235
|
}
|
|
1222
1236
|
};
|
|
1223
|
-
|
|
1237
|
+
ae.styles = g`
|
|
1224
1238
|
:host {
|
|
1225
1239
|
display: block;
|
|
1226
1240
|
cursor: pointer;
|
|
@@ -1260,24 +1274,24 @@ ne.styles = g`
|
|
|
1260
1274
|
outline: none;
|
|
1261
1275
|
}
|
|
1262
1276
|
`;
|
|
1263
|
-
|
|
1277
|
+
Ae([
|
|
1264
1278
|
p({ type: Object })
|
|
1265
|
-
],
|
|
1266
|
-
|
|
1279
|
+
], ae.prototype, "block", 2);
|
|
1280
|
+
Ae([
|
|
1267
1281
|
p({ type: Boolean, reflect: !0 })
|
|
1268
|
-
],
|
|
1269
|
-
|
|
1282
|
+
], ae.prototype, "selected", 2);
|
|
1283
|
+
Ae([
|
|
1270
1284
|
p({ type: Boolean, reflect: !0 })
|
|
1271
|
-
],
|
|
1272
|
-
|
|
1285
|
+
], ae.prototype, "editing", 2);
|
|
1286
|
+
ae = Ae([
|
|
1273
1287
|
h("pigeon-text-block")
|
|
1274
|
-
],
|
|
1275
|
-
var
|
|
1276
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1288
|
+
], ae);
|
|
1289
|
+
var Po = Object.defineProperty, To = Object.getOwnPropertyDescriptor, st = (e, t, o, r) => {
|
|
1290
|
+
for (var i = r > 1 ? void 0 : r ? To(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1277
1291
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1278
|
-
return r && i &&
|
|
1292
|
+
return r && i && Po(t, o, i), i;
|
|
1279
1293
|
};
|
|
1280
|
-
let
|
|
1294
|
+
let we = class extends d {
|
|
1281
1295
|
constructor() {
|
|
1282
1296
|
super(...arguments), this.selected = !1;
|
|
1283
1297
|
}
|
|
@@ -1315,7 +1329,7 @@ let xe = class extends d {
|
|
|
1315
1329
|
}));
|
|
1316
1330
|
}
|
|
1317
1331
|
};
|
|
1318
|
-
|
|
1332
|
+
we.styles = g`
|
|
1319
1333
|
:host {
|
|
1320
1334
|
display: block;
|
|
1321
1335
|
cursor: pointer;
|
|
@@ -1363,21 +1377,21 @@ xe.styles = g`
|
|
|
1363
1377
|
opacity: 0.5;
|
|
1364
1378
|
}
|
|
1365
1379
|
`;
|
|
1366
|
-
|
|
1380
|
+
st([
|
|
1367
1381
|
p({ type: Object })
|
|
1368
|
-
],
|
|
1369
|
-
|
|
1382
|
+
], we.prototype, "block", 2);
|
|
1383
|
+
st([
|
|
1370
1384
|
p({ type: Boolean, reflect: !0 })
|
|
1371
|
-
],
|
|
1372
|
-
|
|
1385
|
+
], we.prototype, "selected", 2);
|
|
1386
|
+
we = st([
|
|
1373
1387
|
h("pigeon-image-block")
|
|
1374
|
-
],
|
|
1375
|
-
var
|
|
1376
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1388
|
+
], we);
|
|
1389
|
+
var So = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, Fe = (e, t, o, r) => {
|
|
1390
|
+
for (var i = r > 1 ? void 0 : r ? Oo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1377
1391
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1378
|
-
return r && i &&
|
|
1392
|
+
return r && i && So(t, o, i), i;
|
|
1379
1393
|
};
|
|
1380
|
-
let
|
|
1394
|
+
let se = class extends d {
|
|
1381
1395
|
constructor() {
|
|
1382
1396
|
super(...arguments), this.selected = !1, this.editing = !1, this._editor = null, this._editorHost = null;
|
|
1383
1397
|
}
|
|
@@ -1403,7 +1417,7 @@ let ae = class extends d {
|
|
|
1403
1417
|
href="${e.href}"
|
|
1404
1418
|
style="${i}"
|
|
1405
1419
|
@click=${this._preventNav}
|
|
1406
|
-
>${this.editing ? l`` :
|
|
1420
|
+
>${this.editing ? l`` : Dt(Me(n))}</a>
|
|
1407
1421
|
</div>
|
|
1408
1422
|
`;
|
|
1409
1423
|
}
|
|
@@ -1417,12 +1431,12 @@ let ae = class extends d {
|
|
|
1417
1431
|
const e = this.renderRoot.querySelector(".button");
|
|
1418
1432
|
if (!e) return;
|
|
1419
1433
|
this._editorHost = e;
|
|
1420
|
-
const t = await
|
|
1434
|
+
const t = await it();
|
|
1421
1435
|
!this.editing || !this._editorHost || (this._editor = t.createEditor({
|
|
1422
1436
|
element: this._editorHost,
|
|
1423
1437
|
initialHTML: this.block.values.content,
|
|
1424
1438
|
onBlur: (o) => this._commit(o),
|
|
1425
|
-
onEscape: () => this.
|
|
1439
|
+
onEscape: (o) => this._commit(o)
|
|
1426
1440
|
}));
|
|
1427
1441
|
}
|
|
1428
1442
|
_teardownEditor() {
|
|
@@ -1442,10 +1456,6 @@ let ae = class extends d {
|
|
|
1442
1456
|
composed: !0
|
|
1443
1457
|
}));
|
|
1444
1458
|
}
|
|
1445
|
-
_exit() {
|
|
1446
|
-
const e = this._editor ? this._editor.getHTML() : this.block.values.content;
|
|
1447
|
-
this._commit(e);
|
|
1448
|
-
}
|
|
1449
1459
|
_preventNav(e) {
|
|
1450
1460
|
e.preventDefault();
|
|
1451
1461
|
}
|
|
@@ -1464,7 +1474,7 @@ let ae = class extends d {
|
|
|
1464
1474
|
}));
|
|
1465
1475
|
}
|
|
1466
1476
|
};
|
|
1467
|
-
|
|
1477
|
+
se.styles = g`
|
|
1468
1478
|
:host {
|
|
1469
1479
|
display: block;
|
|
1470
1480
|
cursor: pointer;
|
|
@@ -1515,24 +1525,24 @@ ae.styles = g`
|
|
|
1515
1525
|
display: inline;
|
|
1516
1526
|
}
|
|
1517
1527
|
`;
|
|
1518
|
-
|
|
1528
|
+
Fe([
|
|
1519
1529
|
p({ type: Object })
|
|
1520
|
-
],
|
|
1521
|
-
|
|
1530
|
+
], se.prototype, "block", 2);
|
|
1531
|
+
Fe([
|
|
1522
1532
|
p({ type: Boolean, reflect: !0 })
|
|
1523
|
-
],
|
|
1524
|
-
|
|
1533
|
+
], se.prototype, "selected", 2);
|
|
1534
|
+
Fe([
|
|
1525
1535
|
p({ type: Boolean, reflect: !0 })
|
|
1526
|
-
],
|
|
1527
|
-
|
|
1536
|
+
], se.prototype, "editing", 2);
|
|
1537
|
+
se = Fe([
|
|
1528
1538
|
h("pigeon-button-block")
|
|
1529
|
-
],
|
|
1530
|
-
var
|
|
1531
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1539
|
+
], se);
|
|
1540
|
+
var Do = Object.defineProperty, Eo = Object.getOwnPropertyDescriptor, lt = (e, t, o, r) => {
|
|
1541
|
+
for (var i = r > 1 ? void 0 : r ? Eo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1532
1542
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1533
|
-
return r && i &&
|
|
1543
|
+
return r && i && Do(t, o, i), i;
|
|
1534
1544
|
};
|
|
1535
|
-
let
|
|
1545
|
+
let $e = class extends d {
|
|
1536
1546
|
constructor() {
|
|
1537
1547
|
super(...arguments), this.selected = !1;
|
|
1538
1548
|
}
|
|
@@ -1560,7 +1570,7 @@ let we = class extends d {
|
|
|
1560
1570
|
}));
|
|
1561
1571
|
}
|
|
1562
1572
|
};
|
|
1563
|
-
|
|
1573
|
+
$e.styles = g`
|
|
1564
1574
|
:host {
|
|
1565
1575
|
display: block;
|
|
1566
1576
|
cursor: pointer;
|
|
@@ -1587,21 +1597,21 @@ we.styles = g`
|
|
|
1587
1597
|
margin: 0;
|
|
1588
1598
|
}
|
|
1589
1599
|
`;
|
|
1590
|
-
|
|
1600
|
+
lt([
|
|
1591
1601
|
p({ type: Object })
|
|
1592
|
-
],
|
|
1593
|
-
|
|
1602
|
+
], $e.prototype, "block", 2);
|
|
1603
|
+
lt([
|
|
1594
1604
|
p({ type: Boolean, reflect: !0 })
|
|
1595
|
-
],
|
|
1596
|
-
|
|
1605
|
+
], $e.prototype, "selected", 2);
|
|
1606
|
+
$e = lt([
|
|
1597
1607
|
h("pigeon-divider-block")
|
|
1598
|
-
],
|
|
1599
|
-
var
|
|
1600
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1608
|
+
], $e);
|
|
1609
|
+
var Bo = Object.defineProperty, jo = Object.getOwnPropertyDescriptor, pt = (e, t, o, r) => {
|
|
1610
|
+
for (var i = r > 1 ? void 0 : r ? jo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1601
1611
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1602
|
-
return r && i &&
|
|
1612
|
+
return r && i && Bo(t, o, i), i;
|
|
1603
1613
|
};
|
|
1604
|
-
let
|
|
1614
|
+
let ke = class extends d {
|
|
1605
1615
|
constructor() {
|
|
1606
1616
|
super(...arguments), this.selected = !1;
|
|
1607
1617
|
}
|
|
@@ -1626,7 +1636,7 @@ let $e = class extends d {
|
|
|
1626
1636
|
}));
|
|
1627
1637
|
}
|
|
1628
1638
|
};
|
|
1629
|
-
|
|
1639
|
+
ke.styles = g`
|
|
1630
1640
|
:host {
|
|
1631
1641
|
display: block;
|
|
1632
1642
|
cursor: pointer;
|
|
@@ -1668,21 +1678,21 @@ $e.styles = g`
|
|
|
1668
1678
|
opacity: 1;
|
|
1669
1679
|
}
|
|
1670
1680
|
`;
|
|
1671
|
-
|
|
1681
|
+
pt([
|
|
1672
1682
|
p({ type: Object })
|
|
1673
|
-
],
|
|
1674
|
-
|
|
1683
|
+
], ke.prototype, "block", 2);
|
|
1684
|
+
pt([
|
|
1675
1685
|
p({ type: Boolean, reflect: !0 })
|
|
1676
|
-
],
|
|
1677
|
-
|
|
1686
|
+
], ke.prototype, "selected", 2);
|
|
1687
|
+
ke = pt([
|
|
1678
1688
|
h("pigeon-spacer-block")
|
|
1679
|
-
],
|
|
1680
|
-
var
|
|
1681
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1689
|
+
], ke);
|
|
1690
|
+
var Ro = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, ct = (e, t, o, r) => {
|
|
1691
|
+
for (var i = r > 1 ? void 0 : r ? Lo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1682
1692
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1683
|
-
return r && i &&
|
|
1693
|
+
return r && i && Ro(t, o, i), i;
|
|
1684
1694
|
};
|
|
1685
|
-
const
|
|
1695
|
+
const zo = {
|
|
1686
1696
|
facebook: "f",
|
|
1687
1697
|
twitter: "𝕏",
|
|
1688
1698
|
instagram: "ig",
|
|
@@ -1690,7 +1700,7 @@ const Io = {
|
|
|
1690
1700
|
youtube: "▶",
|
|
1691
1701
|
tiktok: "♪",
|
|
1692
1702
|
custom: "★"
|
|
1693
|
-
},
|
|
1703
|
+
}, Mo = {
|
|
1694
1704
|
facebook: "#1877F2",
|
|
1695
1705
|
twitter: "#000000",
|
|
1696
1706
|
instagram: "#E4405F",
|
|
@@ -1699,7 +1709,7 @@ const Io = {
|
|
|
1699
1709
|
tiktok: "#000000",
|
|
1700
1710
|
custom: "#6b7280"
|
|
1701
1711
|
};
|
|
1702
|
-
let
|
|
1712
|
+
let Ce = class extends d {
|
|
1703
1713
|
constructor() {
|
|
1704
1714
|
super(...arguments), this.selected = !1;
|
|
1705
1715
|
}
|
|
@@ -1719,7 +1729,7 @@ let ke = class extends d {
|
|
|
1719
1729
|
${e.icons.length === 0 ? l`<div class="empty-state">Add social icons in properties</div>` : l`
|
|
1720
1730
|
<div class="icons-container" style="justify-content: ${o[e.alignment]}; gap: ${e.spacing}px;">
|
|
1721
1731
|
${e.icons.map((r) => {
|
|
1722
|
-
const i =
|
|
1732
|
+
const i = Mo[r.type] ?? "#6b7280", n = zo[r.type] ?? "?";
|
|
1723
1733
|
return l`
|
|
1724
1734
|
<a
|
|
1725
1735
|
class="social-icon"
|
|
@@ -1746,7 +1756,7 @@ let ke = class extends d {
|
|
|
1746
1756
|
}));
|
|
1747
1757
|
}
|
|
1748
1758
|
};
|
|
1749
|
-
|
|
1759
|
+
Ce.styles = g`
|
|
1750
1760
|
:host {
|
|
1751
1761
|
display: block;
|
|
1752
1762
|
cursor: pointer;
|
|
@@ -1794,21 +1804,21 @@ ke.styles = g`
|
|
|
1794
1804
|
font-size: 13px;
|
|
1795
1805
|
}
|
|
1796
1806
|
`;
|
|
1797
|
-
|
|
1807
|
+
ct([
|
|
1798
1808
|
p({ type: Object })
|
|
1799
|
-
],
|
|
1800
|
-
|
|
1809
|
+
], Ce.prototype, "block", 2);
|
|
1810
|
+
ct([
|
|
1801
1811
|
p({ type: Boolean, reflect: !0 })
|
|
1802
|
-
],
|
|
1803
|
-
|
|
1812
|
+
], Ce.prototype, "selected", 2);
|
|
1813
|
+
Ce = ct([
|
|
1804
1814
|
h("pigeon-social-block")
|
|
1805
|
-
],
|
|
1806
|
-
var
|
|
1807
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1815
|
+
], Ce);
|
|
1816
|
+
var Ao = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, dt = (e, t, o, r) => {
|
|
1817
|
+
for (var i = r > 1 ? void 0 : r ? Fo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1808
1818
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1809
|
-
return r && i &&
|
|
1819
|
+
return r && i && Ao(t, o, i), i;
|
|
1810
1820
|
};
|
|
1811
|
-
let
|
|
1821
|
+
let Ie = class extends d {
|
|
1812
1822
|
constructor() {
|
|
1813
1823
|
super(...arguments), this.selected = !1;
|
|
1814
1824
|
}
|
|
@@ -1836,7 +1846,9 @@ let Ce = class extends d {
|
|
|
1836
1846
|
var o;
|
|
1837
1847
|
const t = e.target;
|
|
1838
1848
|
(o = this._resizer) == null || o.disconnect(), this._resizer = new ResizeObserver(() => {
|
|
1839
|
-
|
|
1849
|
+
var i;
|
|
1850
|
+
const r = (i = t.contentDocument) == null ? void 0 : i.body;
|
|
1851
|
+
r && (t.style.height = `${r.scrollHeight}px`);
|
|
1840
1852
|
}), this._resizer.observe(t);
|
|
1841
1853
|
}
|
|
1842
1854
|
_handleClick(e) {
|
|
@@ -1847,7 +1859,7 @@ let Ce = class extends d {
|
|
|
1847
1859
|
}));
|
|
1848
1860
|
}
|
|
1849
1861
|
};
|
|
1850
|
-
|
|
1862
|
+
Ie.styles = g`
|
|
1851
1863
|
:host {
|
|
1852
1864
|
display: block;
|
|
1853
1865
|
cursor: pointer;
|
|
@@ -1889,21 +1901,21 @@ Ce.styles = g`
|
|
|
1889
1901
|
font-size: 13px;
|
|
1890
1902
|
}
|
|
1891
1903
|
`;
|
|
1892
|
-
|
|
1904
|
+
dt([
|
|
1893
1905
|
p({ type: Object })
|
|
1894
|
-
],
|
|
1895
|
-
|
|
1906
|
+
], Ie.prototype, "block", 2);
|
|
1907
|
+
dt([
|
|
1896
1908
|
p({ type: Boolean, reflect: !0 })
|
|
1897
|
-
],
|
|
1898
|
-
|
|
1909
|
+
], Ie.prototype, "selected", 2);
|
|
1910
|
+
Ie = dt([
|
|
1899
1911
|
h("pigeon-html-block")
|
|
1900
|
-
],
|
|
1901
|
-
var
|
|
1902
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1912
|
+
], Ie);
|
|
1913
|
+
var Ho = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, He = (e, t, o, r) => {
|
|
1914
|
+
for (var i = r > 1 ? void 0 : r ? Uo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1903
1915
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
1904
|
-
return r && i &&
|
|
1916
|
+
return r && i && Ho(t, o, i), i;
|
|
1905
1917
|
};
|
|
1906
|
-
let
|
|
1918
|
+
let le = class extends d {
|
|
1907
1919
|
constructor() {
|
|
1908
1920
|
super(...arguments), this.selected = !1, this.editing = !1, this._editor = null, this._editorHost = null;
|
|
1909
1921
|
}
|
|
@@ -1921,7 +1933,7 @@ let se = class extends d {
|
|
|
1921
1933
|
@click=${this._handleClick}
|
|
1922
1934
|
@dblclick=${this._handleDblClick}
|
|
1923
1935
|
>
|
|
1924
|
-
${u ? l`<div class="content" style="${o}"></div>` : a ? l`<div class="content" style="${o}" .innerHTML=${e.content}></div>` : l`
|
|
1936
|
+
${u ? l`<div class="content" style="${o}"></div>` : a ? l`<div class="content" style="${o}" .innerHTML=${Me(e.content)}></div>` : l`
|
|
1925
1937
|
<div class="empty-state">
|
|
1926
1938
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
1927
1939
|
<rect x="2" y="2" width="20" height="20" rx="2"/>
|
|
@@ -1944,12 +1956,12 @@ let se = class extends d {
|
|
|
1944
1956
|
const e = this.renderRoot.querySelector(".content");
|
|
1945
1957
|
if (!e) return;
|
|
1946
1958
|
this._editorHost = e;
|
|
1947
|
-
const t = await
|
|
1959
|
+
const t = await it();
|
|
1948
1960
|
!this.editing || !this._editorHost || (this._editor = t.createEditor({
|
|
1949
1961
|
element: this._editorHost,
|
|
1950
1962
|
initialHTML: this.block.values.content || "<p></p>",
|
|
1951
1963
|
onBlur: (o) => this._commit(o),
|
|
1952
|
-
onEscape: () => this.
|
|
1964
|
+
onEscape: (o) => this._commit(o)
|
|
1953
1965
|
}));
|
|
1954
1966
|
}
|
|
1955
1967
|
_teardownEditor() {
|
|
@@ -1969,10 +1981,6 @@ let se = class extends d {
|
|
|
1969
1981
|
composed: !0
|
|
1970
1982
|
}));
|
|
1971
1983
|
}
|
|
1972
|
-
_exit() {
|
|
1973
|
-
const e = this._editor ? this._editor.getHTML() : this.block.values.content;
|
|
1974
|
-
this._commit(e);
|
|
1975
|
-
}
|
|
1976
1984
|
_handleClick(e) {
|
|
1977
1985
|
e.stopPropagation(), e.preventDefault(), !this.editing && this.dispatchEvent(new CustomEvent("block-select", {
|
|
1978
1986
|
detail: { blockId: this.block.id },
|
|
@@ -1988,7 +1996,7 @@ let se = class extends d {
|
|
|
1988
1996
|
}));
|
|
1989
1997
|
}
|
|
1990
1998
|
};
|
|
1991
|
-
|
|
1999
|
+
le.styles = g`
|
|
1992
2000
|
:host {
|
|
1993
2001
|
display: block;
|
|
1994
2002
|
cursor: pointer;
|
|
@@ -2048,24 +2056,24 @@ se.styles = g`
|
|
|
2048
2056
|
outline: none;
|
|
2049
2057
|
}
|
|
2050
2058
|
`;
|
|
2051
|
-
|
|
2059
|
+
He([
|
|
2052
2060
|
p({ type: Object })
|
|
2053
|
-
],
|
|
2054
|
-
|
|
2061
|
+
], le.prototype, "block", 2);
|
|
2062
|
+
He([
|
|
2055
2063
|
p({ type: Boolean, reflect: !0 })
|
|
2056
|
-
],
|
|
2057
|
-
|
|
2064
|
+
], le.prototype, "selected", 2);
|
|
2065
|
+
He([
|
|
2058
2066
|
p({ type: Boolean, reflect: !0 })
|
|
2059
|
-
],
|
|
2060
|
-
|
|
2067
|
+
], le.prototype, "editing", 2);
|
|
2068
|
+
le = He([
|
|
2061
2069
|
h("pigeon-hero-block")
|
|
2062
|
-
],
|
|
2063
|
-
var
|
|
2064
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2070
|
+
], le);
|
|
2071
|
+
var No = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, ht = (e, t, o, r) => {
|
|
2072
|
+
for (var i = r > 1 ? void 0 : r ? Ko(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
2065
2073
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
2066
|
-
return r && i &&
|
|
2074
|
+
return r && i && No(t, o, i), i;
|
|
2067
2075
|
};
|
|
2068
|
-
let
|
|
2076
|
+
let Pe = class extends d {
|
|
2069
2077
|
constructor() {
|
|
2070
2078
|
super(...arguments), this.selected = !1;
|
|
2071
2079
|
}
|
|
@@ -2108,7 +2116,7 @@ let Ie = class extends d {
|
|
|
2108
2116
|
}));
|
|
2109
2117
|
}
|
|
2110
2118
|
};
|
|
2111
|
-
|
|
2119
|
+
Pe.styles = g`
|
|
2112
2120
|
:host {
|
|
2113
2121
|
display: block;
|
|
2114
2122
|
cursor: pointer;
|
|
@@ -2156,23 +2164,49 @@ Ie.styles = g`
|
|
|
2156
2164
|
font-size: 13px;
|
|
2157
2165
|
}
|
|
2158
2166
|
`;
|
|
2159
|
-
|
|
2167
|
+
ht([
|
|
2160
2168
|
p({ type: Object })
|
|
2161
|
-
],
|
|
2162
|
-
|
|
2169
|
+
], Pe.prototype, "block", 2);
|
|
2170
|
+
ht([
|
|
2163
2171
|
p({ type: Boolean, reflect: !0 })
|
|
2164
|
-
],
|
|
2165
|
-
|
|
2172
|
+
], Pe.prototype, "selected", 2);
|
|
2173
|
+
Pe = ht([
|
|
2166
2174
|
h("pigeon-navbar-block")
|
|
2167
|
-
],
|
|
2168
|
-
|
|
2169
|
-
|
|
2175
|
+
], Pe);
|
|
2176
|
+
function tt(e, t) {
|
|
2177
|
+
return !!(t === "mobile" ? e.hideOnMobile : e.hideOnDesktop);
|
|
2178
|
+
}
|
|
2179
|
+
function ot(e) {
|
|
2180
|
+
const t = [e.hideOnMobile && "mobile", e.hideOnDesktop && "desktop"].filter(Boolean).join(" and ");
|
|
2181
|
+
return t ? l`<span class="visibility-badge">Hidden on ${t}</span>` : "";
|
|
2182
|
+
}
|
|
2183
|
+
const jt = g`
|
|
2184
|
+
.device-hidden {
|
|
2185
|
+
display: none !important;
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
.visibility-badge {
|
|
2189
|
+
position: absolute;
|
|
2190
|
+
top: 2px;
|
|
2191
|
+
left: 2px;
|
|
2192
|
+
z-index: 5;
|
|
2193
|
+
padding: 1px 6px;
|
|
2194
|
+
border-radius: 3px;
|
|
2195
|
+
background: var(--pigeon-muted, #f1f5f9);
|
|
2196
|
+
color: var(--pigeon-muted-foreground, #64748b);
|
|
2197
|
+
font-family: var(--pigeon-font);
|
|
2198
|
+
font-size: 10px;
|
|
2199
|
+
pointer-events: none;
|
|
2200
|
+
}
|
|
2201
|
+
`;
|
|
2202
|
+
var Wo = Object.defineProperty, qo = Object.getOwnPropertyDescriptor, j = (e, t, o, r) => {
|
|
2203
|
+
for (var i = r > 1 ? void 0 : r ? qo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
2170
2204
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
2171
|
-
return r && i &&
|
|
2205
|
+
return r && i && Wo(t, o, i), i;
|
|
2172
2206
|
};
|
|
2173
|
-
let
|
|
2207
|
+
let k = class extends d {
|
|
2174
2208
|
constructor() {
|
|
2175
|
-
super(...arguments), this.rowId = "", this.selection = null, this.editingBlockId = null, this._dropIndex = -1, this._isDragOver = !1, this._draggingBlockId = null;
|
|
2209
|
+
super(...arguments), this.rowId = "", this.selection = null, this.editingBlockId = null, this.device = "desktop", this.locked = !1, this._dropIndex = -1, this._isDragOver = !1, this._draggingBlockId = null;
|
|
2176
2210
|
}
|
|
2177
2211
|
render() {
|
|
2178
2212
|
if (!this.column) return l``;
|
|
@@ -2189,8 +2223,11 @@ let O = class extends d {
|
|
|
2189
2223
|
<pigeon-drop-indicator
|
|
2190
2224
|
?visible=${this._isDragOver && this._dropIndex === n}
|
|
2191
2225
|
></pigeon-drop-indicator>
|
|
2192
|
-
<div
|
|
2193
|
-
|
|
2226
|
+
<div
|
|
2227
|
+
class="block-wrapper ${this._draggingBlockId === i.id ? "dragging" : ""} ${tt(i.values, this.device) ? "device-hidden" : ""}"
|
|
2228
|
+
>
|
|
2229
|
+
${ot(i.values)}
|
|
2230
|
+
${this.locked ? "" : l`<button
|
|
2194
2231
|
class="block-drag-handle"
|
|
2195
2232
|
title="Drag to reorder"
|
|
2196
2233
|
draggable="true"
|
|
@@ -2201,7 +2238,7 @@ let O = class extends d {
|
|
|
2201
2238
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
2202
2239
|
<path d="M9 5v14M15 5v14" />
|
|
2203
2240
|
</svg>
|
|
2204
|
-
</button
|
|
2241
|
+
</button>`}
|
|
2205
2242
|
${this._renderBlock(i)}
|
|
2206
2243
|
</div>
|
|
2207
2244
|
`)}
|
|
@@ -2256,7 +2293,7 @@ let O = class extends d {
|
|
|
2256
2293
|
* failing with "Unknown block type".
|
|
2257
2294
|
*/
|
|
2258
2295
|
_renderCustomBlock(e, t) {
|
|
2259
|
-
const o =
|
|
2296
|
+
const o = et(e.type), r = e, i = o != null && o.renderCanvas ? Dt(Me(o.renderCanvas(r))) : l`<span class="custom-block__label"
|
|
2260
2297
|
>${(o == null ? void 0 : o.label) ?? e.type}</span
|
|
2261
2298
|
>`;
|
|
2262
2299
|
return l`<div
|
|
@@ -2280,14 +2317,14 @@ let O = class extends d {
|
|
|
2280
2317
|
}
|
|
2281
2318
|
_onDragOver(e) {
|
|
2282
2319
|
const t = _e();
|
|
2283
|
-
if (!t || t.type !== "palette-block" && t.type !== "existing-block") return;
|
|
2320
|
+
if (!t || this.locked || t.type !== "palette-block" && t.type !== "existing-block") return;
|
|
2284
2321
|
e.preventDefault(), e.stopPropagation(), e.dataTransfer && (e.dataTransfer.dropEffect = t.type === "existing-block" ? "move" : "copy"), this._isDragOver = !0;
|
|
2285
2322
|
const o = Array.from(
|
|
2286
2323
|
this.renderRoot.querySelectorAll(
|
|
2287
2324
|
"pigeon-text-block, pigeon-image-block, pigeon-button-block, pigeon-divider-block, pigeon-spacer-block, pigeon-social-block, pigeon-html-block, pigeon-hero-block, pigeon-navbar-block, .custom-block"
|
|
2288
2325
|
)
|
|
2289
2326
|
);
|
|
2290
|
-
this._dropIndex =
|
|
2327
|
+
this._dropIndex = wo(e.clientY, o);
|
|
2291
2328
|
}
|
|
2292
2329
|
_onDragLeave(e) {
|
|
2293
2330
|
const t = this.getBoundingClientRect();
|
|
@@ -2295,11 +2332,11 @@ let O = class extends d {
|
|
|
2295
2332
|
}
|
|
2296
2333
|
_onDrop(e) {
|
|
2297
2334
|
const t = _e();
|
|
2298
|
-
if (!t || t.type !== "palette-block" && t.type !== "existing-block") return;
|
|
2335
|
+
if (!t || this.locked || t.type !== "palette-block" && t.type !== "existing-block") return;
|
|
2299
2336
|
e.preventDefault(), e.stopPropagation();
|
|
2300
2337
|
let o = this._dropIndex >= 0 ? this._dropIndex : this.column.blocks.length;
|
|
2301
2338
|
if (t.type === "existing-block" && t.rowId === this.rowId && t.columnId === this.column.id) {
|
|
2302
|
-
const r = this.column.blocks.findIndex((n) => n.id === t.blockId), i =
|
|
2339
|
+
const r = this.column.blocks.findIndex((n) => n.id === t.blockId), i = Et(r, o);
|
|
2303
2340
|
if (i === null) {
|
|
2304
2341
|
this._resetDragState();
|
|
2305
2342
|
return;
|
|
@@ -2318,10 +2355,10 @@ let O = class extends d {
|
|
|
2318
2355
|
})), this._resetDragState();
|
|
2319
2356
|
}
|
|
2320
2357
|
_resetDragState() {
|
|
2321
|
-
this._isDragOver = !1, this._dropIndex = -1,
|
|
2358
|
+
this._isDragOver = !1, this._dropIndex = -1, Re();
|
|
2322
2359
|
}
|
|
2323
2360
|
_onBlockDragStart(e, t) {
|
|
2324
|
-
if (
|
|
2361
|
+
if (nt(e, {
|
|
2325
2362
|
type: "existing-block",
|
|
2326
2363
|
blockId: t,
|
|
2327
2364
|
rowId: this.rowId,
|
|
@@ -2333,10 +2370,10 @@ let O = class extends d {
|
|
|
2333
2370
|
this._draggingBlockId = t;
|
|
2334
2371
|
}
|
|
2335
2372
|
_onBlockDragEnd() {
|
|
2336
|
-
this._draggingBlockId = null,
|
|
2373
|
+
this._draggingBlockId = null, Re();
|
|
2337
2374
|
}
|
|
2338
2375
|
};
|
|
2339
|
-
|
|
2376
|
+
k.styles = g`
|
|
2340
2377
|
:host {
|
|
2341
2378
|
display: block;
|
|
2342
2379
|
min-height: 40px;
|
|
@@ -2451,70 +2488,85 @@ O.styles = g`
|
|
|
2451
2488
|
font-size: 12px;
|
|
2452
2489
|
text-align: center;
|
|
2453
2490
|
}
|
|
2491
|
+
|
|
2492
|
+
${jt}
|
|
2454
2493
|
`;
|
|
2455
|
-
|
|
2494
|
+
j([
|
|
2456
2495
|
p({ type: Object })
|
|
2457
|
-
],
|
|
2458
|
-
|
|
2496
|
+
], k.prototype, "column", 2);
|
|
2497
|
+
j([
|
|
2459
2498
|
p({ type: String, attribute: "row-id" })
|
|
2460
|
-
],
|
|
2461
|
-
|
|
2499
|
+
], k.prototype, "rowId", 2);
|
|
2500
|
+
j([
|
|
2462
2501
|
p({ type: Object })
|
|
2463
|
-
],
|
|
2464
|
-
|
|
2502
|
+
], k.prototype, "selection", 2);
|
|
2503
|
+
j([
|
|
2465
2504
|
p({ type: String, attribute: "editing-block-id" })
|
|
2466
|
-
],
|
|
2467
|
-
|
|
2505
|
+
], k.prototype, "editingBlockId", 2);
|
|
2506
|
+
j([
|
|
2507
|
+
p({ type: String })
|
|
2508
|
+
], k.prototype, "device", 2);
|
|
2509
|
+
j([
|
|
2510
|
+
p({ type: Boolean })
|
|
2511
|
+
], k.prototype, "locked", 2);
|
|
2512
|
+
j([
|
|
2468
2513
|
c()
|
|
2469
|
-
],
|
|
2470
|
-
|
|
2514
|
+
], k.prototype, "_dropIndex", 2);
|
|
2515
|
+
j([
|
|
2471
2516
|
c()
|
|
2472
|
-
],
|
|
2473
|
-
|
|
2517
|
+
], k.prototype, "_isDragOver", 2);
|
|
2518
|
+
j([
|
|
2474
2519
|
c()
|
|
2475
|
-
],
|
|
2476
|
-
|
|
2520
|
+
], k.prototype, "_draggingBlockId", 2);
|
|
2521
|
+
k = j([
|
|
2477
2522
|
h("pigeon-column")
|
|
2478
|
-
],
|
|
2479
|
-
var
|
|
2480
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2523
|
+
], k);
|
|
2524
|
+
var Vo = Object.defineProperty, Yo = Object.getOwnPropertyDescriptor, R = (e, t, o, r) => {
|
|
2525
|
+
for (var i = r > 1 ? void 0 : r ? Yo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
2481
2526
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
2482
|
-
return r && i &&
|
|
2527
|
+
return r && i && Vo(t, o, i), i;
|
|
2483
2528
|
};
|
|
2484
|
-
let
|
|
2529
|
+
let C = class extends d {
|
|
2485
2530
|
constructor() {
|
|
2486
|
-
super(...arguments), this.index = 0, this.totalRows = 0, this.selection = null, this.editingBlockId = null, this.showActions = !1, this._dragging = !1;
|
|
2531
|
+
super(...arguments), this.index = 0, this.totalRows = 0, this.selection = null, this.editingBlockId = null, this.showActions = !1, this.device = "desktop", this.readonly = !1, this._dragging = !1;
|
|
2487
2532
|
}
|
|
2488
2533
|
render() {
|
|
2489
|
-
var
|
|
2534
|
+
var u;
|
|
2490
2535
|
if (!this.row) return l``;
|
|
2491
|
-
const e = ((
|
|
2536
|
+
const e = ((u = this.selection) == null ? void 0 : u.type) === "row" && this.selection.rowId === this.row.id, t = this.row.attributes, o = t.backgroundColor ? `background-color: ${t.backgroundColor};` : "", r = Ot(this.row), i = r ? `background-image: url(${r.url}); background-size: ${r.size}; background-repeat: ${r.repeat}; background-position: ${r.position};` : "", n = `padding: ${t.padding.top}px ${t.padding.right}px ${t.padding.bottom}px ${t.padding.left}px;`, a = this.row.locked;
|
|
2492
2537
|
return l`
|
|
2493
2538
|
<div
|
|
2494
|
-
class="row-wrapper ${e ? "selected" : ""} ${this._dragging ? "dragging" : ""}"
|
|
2495
|
-
style="${o} ${
|
|
2539
|
+
class="row-wrapper ${e ? "selected" : ""} ${this._dragging ? "dragging" : ""} ${tt(t, this.device) ? "device-hidden" : ""}"
|
|
2540
|
+
style="${o} ${i} ${n}"
|
|
2496
2541
|
@click=${this._onRowClick}
|
|
2497
2542
|
>
|
|
2498
|
-
|
|
2543
|
+
${this.readonly ? "" : l`<div class="row-label">${a ? "Locked" : "Row"}</div>`}
|
|
2544
|
+
${ot(t)}
|
|
2499
2545
|
|
|
2500
2546
|
<div class="columns">
|
|
2501
|
-
${this.row.columns.map((
|
|
2502
|
-
const
|
|
2547
|
+
${this.row.columns.map((b, _) => {
|
|
2548
|
+
const Ee = (this.row.columnRatios[_] ?? 1) / 12 * 100;
|
|
2503
2549
|
return l`
|
|
2504
|
-
<div
|
|
2550
|
+
<div
|
|
2551
|
+
class="column-wrapper ${tt(b.attributes, this.device) ? "device-hidden" : ""}"
|
|
2552
|
+
style="width: ${Ee}%;"
|
|
2553
|
+
>
|
|
2554
|
+
${ot(b.attributes)}
|
|
2505
2555
|
<pigeon-column
|
|
2506
|
-
.column=${
|
|
2556
|
+
.column=${b}
|
|
2507
2557
|
row-id="${this.row.id}"
|
|
2508
2558
|
.selection=${this.selection}
|
|
2509
2559
|
.editingBlockId=${this.editingBlockId}
|
|
2560
|
+
.device=${this.device}
|
|
2561
|
+
?locked=${a || this.readonly}
|
|
2510
2562
|
></pigeon-column>
|
|
2511
2563
|
</div>
|
|
2512
2564
|
`;
|
|
2513
2565
|
})}
|
|
2514
2566
|
</div>
|
|
2515
2567
|
|
|
2516
|
-
|
|
2517
|
-
|
|
2568
|
+
${this.readonly ? "" : l`<div class="actions">
|
|
2569
|
+
${a ? "" : l`<button
|
|
2518
2570
|
class="action-btn drag-handle"
|
|
2519
2571
|
title="Drag to reorder"
|
|
2520
2572
|
draggable="true"
|
|
@@ -2549,7 +2601,7 @@ let E = class extends d {
|
|
|
2549
2601
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
2550
2602
|
<polyline points="6 9 12 15 18 9"/>
|
|
2551
2603
|
</svg>
|
|
2552
|
-
</button
|
|
2604
|
+
</button>`}
|
|
2553
2605
|
<button
|
|
2554
2606
|
class="action-btn"
|
|
2555
2607
|
title="Save to library"
|
|
@@ -2559,7 +2611,7 @@ let E = class extends d {
|
|
|
2559
2611
|
<path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/>
|
|
2560
2612
|
</svg>
|
|
2561
2613
|
</button>
|
|
2562
|
-
|
|
2614
|
+
${a ? "" : l`<button
|
|
2563
2615
|
class="action-btn"
|
|
2564
2616
|
title="Duplicate"
|
|
2565
2617
|
@click=${this._onDuplicate}
|
|
@@ -2578,8 +2630,8 @@ let E = class extends d {
|
|
|
2578
2630
|
<polyline points="3 6 5 6 21 6"/>
|
|
2579
2631
|
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
|
|
2580
2632
|
</svg>
|
|
2581
|
-
</button
|
|
2582
|
-
</div
|
|
2633
|
+
</button>`}
|
|
2634
|
+
</div>`}
|
|
2583
2635
|
</div>
|
|
2584
2636
|
`;
|
|
2585
2637
|
}
|
|
@@ -2628,7 +2680,7 @@ let E = class extends d {
|
|
|
2628
2680
|
}));
|
|
2629
2681
|
}
|
|
2630
2682
|
_onDragStart(e) {
|
|
2631
|
-
if (
|
|
2683
|
+
if (nt(e, {
|
|
2632
2684
|
type: "existing-row",
|
|
2633
2685
|
rowId: this.row.id
|
|
2634
2686
|
}), e.dataTransfer) {
|
|
@@ -2638,10 +2690,10 @@ let E = class extends d {
|
|
|
2638
2690
|
this._dragging = !0;
|
|
2639
2691
|
}
|
|
2640
2692
|
_onDragEnd() {
|
|
2641
|
-
this._dragging = !1,
|
|
2693
|
+
this._dragging = !1, Re();
|
|
2642
2694
|
}
|
|
2643
2695
|
};
|
|
2644
|
-
|
|
2696
|
+
C.styles = g`
|
|
2645
2697
|
:host {
|
|
2646
2698
|
display: block;
|
|
2647
2699
|
position: relative;
|
|
@@ -2680,6 +2732,7 @@ E.styles = g`
|
|
|
2680
2732
|
}
|
|
2681
2733
|
|
|
2682
2734
|
.column-wrapper {
|
|
2735
|
+
position: relative;
|
|
2683
2736
|
box-sizing: border-box;
|
|
2684
2737
|
}
|
|
2685
2738
|
|
|
@@ -2771,39 +2824,47 @@ E.styles = g`
|
|
|
2771
2824
|
.row-wrapper.selected .row-label {
|
|
2772
2825
|
opacity: 1;
|
|
2773
2826
|
}
|
|
2827
|
+
|
|
2828
|
+
${jt}
|
|
2774
2829
|
`;
|
|
2775
|
-
|
|
2830
|
+
R([
|
|
2776
2831
|
p({ type: Object })
|
|
2777
|
-
],
|
|
2778
|
-
|
|
2832
|
+
], C.prototype, "row", 2);
|
|
2833
|
+
R([
|
|
2779
2834
|
p({ type: Number })
|
|
2780
|
-
],
|
|
2781
|
-
|
|
2835
|
+
], C.prototype, "index", 2);
|
|
2836
|
+
R([
|
|
2782
2837
|
p({ type: Number, attribute: "total-rows" })
|
|
2783
|
-
],
|
|
2784
|
-
|
|
2838
|
+
], C.prototype, "totalRows", 2);
|
|
2839
|
+
R([
|
|
2785
2840
|
p({ type: Object })
|
|
2786
|
-
],
|
|
2787
|
-
|
|
2841
|
+
], C.prototype, "selection", 2);
|
|
2842
|
+
R([
|
|
2788
2843
|
p({ type: String, attribute: "editing-block-id" })
|
|
2789
|
-
],
|
|
2790
|
-
|
|
2844
|
+
], C.prototype, "editingBlockId", 2);
|
|
2845
|
+
R([
|
|
2791
2846
|
p({ type: Boolean, attribute: "show-actions", reflect: !0 })
|
|
2792
|
-
],
|
|
2793
|
-
|
|
2847
|
+
], C.prototype, "showActions", 2);
|
|
2848
|
+
R([
|
|
2849
|
+
p({ type: String })
|
|
2850
|
+
], C.prototype, "device", 2);
|
|
2851
|
+
R([
|
|
2852
|
+
p({ type: Boolean })
|
|
2853
|
+
], C.prototype, "readonly", 2);
|
|
2854
|
+
R([
|
|
2794
2855
|
c()
|
|
2795
|
-
],
|
|
2796
|
-
|
|
2856
|
+
], C.prototype, "_dragging", 2);
|
|
2857
|
+
C = R([
|
|
2797
2858
|
h("pigeon-row")
|
|
2798
|
-
],
|
|
2799
|
-
var
|
|
2800
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
2859
|
+
], C);
|
|
2860
|
+
var Xo = Object.defineProperty, Go = Object.getOwnPropertyDescriptor, L = (e, t, o, r) => {
|
|
2861
|
+
for (var i = r > 1 ? void 0 : r ? Go(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
2801
2862
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
2802
|
-
return r && i &&
|
|
2863
|
+
return r && i && Xo(t, o, i), i;
|
|
2803
2864
|
};
|
|
2804
|
-
let
|
|
2865
|
+
let I = class extends d {
|
|
2805
2866
|
constructor() {
|
|
2806
|
-
super(...arguments), this.selection = null, this.editingBlockId = null, this.previewWidth = 0, this.device = "desktop", this._rowDropIndex = -1, this._isDragOver = !1, this._hoveredRowId = null, this._onPointerOverRow = (e) => {
|
|
2867
|
+
super(...arguments), this.selection = null, this.editingBlockId = null, this.previewWidth = 0, this.device = "desktop", this.readonly = !1, this._rowDropIndex = -1, this._isDragOver = !1, this._hoveredRowId = null, this._onPointerOverRow = (e) => {
|
|
2807
2868
|
var r;
|
|
2808
2869
|
const t = e.composedPath().find(
|
|
2809
2870
|
(i) => i instanceof HTMLElement && i.tagName.toLowerCase() === "pigeon-row"
|
|
@@ -2879,6 +2940,8 @@ let C = class extends d {
|
|
|
2879
2940
|
.totalRows=${o.length}
|
|
2880
2941
|
.selection=${this.selection}
|
|
2881
2942
|
.editingBlockId=${this.editingBlockId}
|
|
2943
|
+
.device=${this.device}
|
|
2944
|
+
?readonly=${this.readonly}
|
|
2882
2945
|
?show-actions=${this._hoveredRowId === a.id || this._hoveredRowId === null && i === a.id}
|
|
2883
2946
|
></pigeon-row>
|
|
2884
2947
|
`
|
|
@@ -2901,11 +2964,11 @@ let C = class extends d {
|
|
|
2901
2964
|
}
|
|
2902
2965
|
_onDragOver(e) {
|
|
2903
2966
|
const t = _e();
|
|
2904
|
-
if (t && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = t.type === "existing-row" ? "move" : "copy"), this._isDragOver = !0, t.type === "palette-row" || t.type === "existing-row" || t.type === "library-row" || this.doc.body.rows.length === 0)) {
|
|
2967
|
+
if (!(!t || this.readonly) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = t.type === "existing-row" ? "move" : "copy"), this._isDragOver = !0, t.type === "palette-row" || t.type === "existing-row" || t.type === "library-row" || this.doc.body.rows.length === 0)) {
|
|
2905
2968
|
const o = Array.from(
|
|
2906
2969
|
this.renderRoot.querySelectorAll("pigeon-row")
|
|
2907
2970
|
);
|
|
2908
|
-
this._rowDropIndex =
|
|
2971
|
+
this._rowDropIndex = xo(e.clientY, o);
|
|
2909
2972
|
}
|
|
2910
2973
|
}
|
|
2911
2974
|
_onDragLeave(e) {
|
|
@@ -2938,7 +3001,7 @@ let C = class extends d {
|
|
|
2938
3001
|
composed: !0
|
|
2939
3002
|
}));
|
|
2940
3003
|
} else if (t.type === "existing-row" && t.rowId) {
|
|
2941
|
-
const o = this.doc.body.rows.findIndex((n) => n.id === t.rowId), r = this._rowDropIndex >= 0 ? this._rowDropIndex : this.doc.body.rows.length, i =
|
|
3004
|
+
const o = this.doc.body.rows.findIndex((n) => n.id === t.rowId), r = this._rowDropIndex >= 0 ? this._rowDropIndex : this.doc.body.rows.length, i = Et(o, r);
|
|
2942
3005
|
i !== null && this.dispatchEvent(new CustomEvent("row-move", {
|
|
2943
3006
|
detail: { rowId: t.rowId, toIndex: i },
|
|
2944
3007
|
bubbles: !0,
|
|
@@ -2955,10 +3018,10 @@ let C = class extends d {
|
|
|
2955
3018
|
this._resetDragState();
|
|
2956
3019
|
}
|
|
2957
3020
|
_resetDragState() {
|
|
2958
|
-
this._isDragOver = !1, this._rowDropIndex = -1,
|
|
3021
|
+
this._isDragOver = !1, this._rowDropIndex = -1, Re();
|
|
2959
3022
|
}
|
|
2960
3023
|
};
|
|
2961
|
-
|
|
3024
|
+
I.styles = g`
|
|
2962
3025
|
:host {
|
|
2963
3026
|
display: block;
|
|
2964
3027
|
flex: 1;
|
|
@@ -3087,34 +3150,37 @@ C.styles = g`
|
|
|
3087
3150
|
border-radius: var(--pigeon-radius, 6px);
|
|
3088
3151
|
}
|
|
3089
3152
|
`;
|
|
3090
|
-
|
|
3153
|
+
L([
|
|
3091
3154
|
p({ type: Object })
|
|
3092
|
-
],
|
|
3093
|
-
|
|
3155
|
+
], I.prototype, "doc", 2);
|
|
3156
|
+
L([
|
|
3094
3157
|
p({ type: Object })
|
|
3095
|
-
],
|
|
3096
|
-
|
|
3158
|
+
], I.prototype, "selection", 2);
|
|
3159
|
+
L([
|
|
3097
3160
|
p({ type: String, attribute: "editing-block-id" })
|
|
3098
|
-
],
|
|
3099
|
-
|
|
3161
|
+
], I.prototype, "editingBlockId", 2);
|
|
3162
|
+
L([
|
|
3100
3163
|
p({ type: Number, attribute: "preview-width" })
|
|
3101
|
-
],
|
|
3102
|
-
|
|
3164
|
+
], I.prototype, "previewWidth", 2);
|
|
3165
|
+
L([
|
|
3103
3166
|
p({ type: String })
|
|
3104
|
-
],
|
|
3105
|
-
|
|
3167
|
+
], I.prototype, "device", 2);
|
|
3168
|
+
L([
|
|
3169
|
+
p({ type: Boolean })
|
|
3170
|
+
], I.prototype, "readonly", 2);
|
|
3171
|
+
L([
|
|
3106
3172
|
c()
|
|
3107
|
-
],
|
|
3108
|
-
|
|
3173
|
+
], I.prototype, "_rowDropIndex", 2);
|
|
3174
|
+
L([
|
|
3109
3175
|
c()
|
|
3110
|
-
],
|
|
3111
|
-
|
|
3176
|
+
], I.prototype, "_isDragOver", 2);
|
|
3177
|
+
L([
|
|
3112
3178
|
c()
|
|
3113
|
-
],
|
|
3114
|
-
|
|
3179
|
+
], I.prototype, "_hoveredRowId", 2);
|
|
3180
|
+
I = L([
|
|
3115
3181
|
h("pigeon-canvas")
|
|
3116
|
-
],
|
|
3117
|
-
const
|
|
3182
|
+
], I);
|
|
3183
|
+
const w = g`
|
|
3118
3184
|
:host {
|
|
3119
3185
|
display: block;
|
|
3120
3186
|
}
|
|
@@ -3330,12 +3396,12 @@ const $ = g`
|
|
|
3330
3396
|
box-shadow: var(--pigeon-ring-shadow);
|
|
3331
3397
|
}
|
|
3332
3398
|
`;
|
|
3333
|
-
var
|
|
3334
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
3399
|
+
var Jo = Object.defineProperty, Zo = Object.getOwnPropertyDescriptor, gt = (e, t, o, r) => {
|
|
3400
|
+
for (var i = r > 1 ? void 0 : r ? Zo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
3335
3401
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
3336
|
-
return r && i &&
|
|
3402
|
+
return r && i && Jo(t, o, i), i;
|
|
3337
3403
|
};
|
|
3338
|
-
let
|
|
3404
|
+
let Te = class extends d {
|
|
3339
3405
|
constructor() {
|
|
3340
3406
|
super(...arguments), this.label = "Alignment", this.value = "left";
|
|
3341
3407
|
}
|
|
@@ -3393,7 +3459,7 @@ let Pe = class extends d {
|
|
|
3393
3459
|
}));
|
|
3394
3460
|
}
|
|
3395
3461
|
};
|
|
3396
|
-
|
|
3462
|
+
Te.styles = g`
|
|
3397
3463
|
:host {
|
|
3398
3464
|
display: block;
|
|
3399
3465
|
margin-bottom: 12px;
|
|
@@ -3456,21 +3522,21 @@ Pe.styles = g`
|
|
|
3456
3522
|
height: 16px;
|
|
3457
3523
|
}
|
|
3458
3524
|
`;
|
|
3459
|
-
|
|
3525
|
+
gt([
|
|
3460
3526
|
p({ type: String })
|
|
3461
|
-
],
|
|
3462
|
-
|
|
3527
|
+
], Te.prototype, "label", 2);
|
|
3528
|
+
gt([
|
|
3463
3529
|
p({ type: String })
|
|
3464
|
-
],
|
|
3465
|
-
|
|
3530
|
+
], Te.prototype, "value", 2);
|
|
3531
|
+
Te = gt([
|
|
3466
3532
|
h("pigeon-alignment-picker")
|
|
3467
|
-
],
|
|
3468
|
-
var
|
|
3469
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
3533
|
+
], Te);
|
|
3534
|
+
var Qo = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, ut = (e, t, o, r) => {
|
|
3535
|
+
for (var i = r > 1 ? void 0 : r ? ei(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
3470
3536
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
3471
|
-
return r && i &&
|
|
3537
|
+
return r && i && Qo(t, o, i), i;
|
|
3472
3538
|
};
|
|
3473
|
-
let
|
|
3539
|
+
let Se = class extends d {
|
|
3474
3540
|
constructor() {
|
|
3475
3541
|
super(...arguments), this.label = "Padding", this.value = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
3476
3542
|
}
|
|
@@ -3528,7 +3594,7 @@ let Te = class extends d {
|
|
|
3528
3594
|
}));
|
|
3529
3595
|
}
|
|
3530
3596
|
};
|
|
3531
|
-
|
|
3597
|
+
Se.styles = g`
|
|
3532
3598
|
:host {
|
|
3533
3599
|
display: block;
|
|
3534
3600
|
margin-bottom: 14px;
|
|
@@ -3613,21 +3679,21 @@ Te.styles = g`
|
|
|
3613
3679
|
-moz-appearance: textfield;
|
|
3614
3680
|
}
|
|
3615
3681
|
`;
|
|
3616
|
-
|
|
3682
|
+
ut([
|
|
3617
3683
|
p({ type: String })
|
|
3618
|
-
],
|
|
3619
|
-
|
|
3684
|
+
], Se.prototype, "label", 2);
|
|
3685
|
+
ut([
|
|
3620
3686
|
p({ type: Object })
|
|
3621
|
-
],
|
|
3622
|
-
|
|
3687
|
+
], Se.prototype, "value", 2);
|
|
3688
|
+
Se = ut([
|
|
3623
3689
|
h("pigeon-spacing-input")
|
|
3624
|
-
],
|
|
3625
|
-
var
|
|
3626
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
3690
|
+
], Se);
|
|
3691
|
+
var ti = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, te = (e, t, o, r) => {
|
|
3692
|
+
for (var i = r > 1 ? void 0 : r ? oi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
3627
3693
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
3628
|
-
return r && i &&
|
|
3694
|
+
return r && i && ti(t, o, i), i;
|
|
3629
3695
|
};
|
|
3630
|
-
let
|
|
3696
|
+
let A = class extends d {
|
|
3631
3697
|
constructor() {
|
|
3632
3698
|
super(...arguments), this.label = "", this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.unit = "px";
|
|
3633
3699
|
}
|
|
@@ -3674,7 +3740,7 @@ let j = class extends d {
|
|
|
3674
3740
|
}));
|
|
3675
3741
|
}
|
|
3676
3742
|
};
|
|
3677
|
-
|
|
3743
|
+
A.styles = g`
|
|
3678
3744
|
:host {
|
|
3679
3745
|
display: block;
|
|
3680
3746
|
margin-bottom: 12px;
|
|
@@ -3774,33 +3840,33 @@ j.styles = g`
|
|
|
3774
3840
|
-moz-appearance: textfield;
|
|
3775
3841
|
}
|
|
3776
3842
|
`;
|
|
3777
|
-
|
|
3843
|
+
te([
|
|
3778
3844
|
p({ type: String })
|
|
3779
|
-
],
|
|
3780
|
-
|
|
3845
|
+
], A.prototype, "label", 2);
|
|
3846
|
+
te([
|
|
3781
3847
|
p({ type: Number })
|
|
3782
|
-
],
|
|
3783
|
-
|
|
3848
|
+
], A.prototype, "value", 2);
|
|
3849
|
+
te([
|
|
3784
3850
|
p({ type: Number })
|
|
3785
|
-
],
|
|
3786
|
-
|
|
3851
|
+
], A.prototype, "min", 2);
|
|
3852
|
+
te([
|
|
3787
3853
|
p({ type: Number })
|
|
3788
|
-
],
|
|
3789
|
-
|
|
3854
|
+
], A.prototype, "max", 2);
|
|
3855
|
+
te([
|
|
3790
3856
|
p({ type: Number })
|
|
3791
|
-
],
|
|
3792
|
-
|
|
3857
|
+
], A.prototype, "step", 2);
|
|
3858
|
+
te([
|
|
3793
3859
|
p({ type: String })
|
|
3794
|
-
],
|
|
3795
|
-
|
|
3860
|
+
], A.prototype, "unit", 2);
|
|
3861
|
+
A = te([
|
|
3796
3862
|
h("pigeon-slider-input")
|
|
3797
|
-
],
|
|
3798
|
-
var
|
|
3799
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
3863
|
+
], A);
|
|
3864
|
+
var ii = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, be = (e, t, o, r) => {
|
|
3865
|
+
for (var i = r > 1 ? void 0 : r ? ri(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
3800
3866
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
3801
|
-
return r && i &&
|
|
3867
|
+
return r && i && ii(t, o, i), i;
|
|
3802
3868
|
};
|
|
3803
|
-
let
|
|
3869
|
+
let q = class extends d {
|
|
3804
3870
|
constructor() {
|
|
3805
3871
|
super(...arguments), this.tags = [], this.open = !1, this.x = 0, this.y = 0, this._search = "";
|
|
3806
3872
|
}
|
|
@@ -3856,7 +3922,7 @@ let K = class extends d {
|
|
|
3856
3922
|
})), this.open = !1, this._search = "";
|
|
3857
3923
|
}
|
|
3858
3924
|
};
|
|
3859
|
-
|
|
3925
|
+
q.styles = g`
|
|
3860
3926
|
:host {
|
|
3861
3927
|
display: none;
|
|
3862
3928
|
}
|
|
@@ -3947,32 +4013,32 @@ K.styles = g`
|
|
|
3947
4013
|
font-size: 13px;
|
|
3948
4014
|
}
|
|
3949
4015
|
`;
|
|
3950
|
-
|
|
4016
|
+
be([
|
|
3951
4017
|
p({ type: Array })
|
|
3952
|
-
],
|
|
3953
|
-
|
|
4018
|
+
], q.prototype, "tags", 2);
|
|
4019
|
+
be([
|
|
3954
4020
|
p({ type: Boolean, reflect: !0 })
|
|
3955
|
-
],
|
|
3956
|
-
|
|
4021
|
+
], q.prototype, "open", 2);
|
|
4022
|
+
be([
|
|
3957
4023
|
p({ type: Number })
|
|
3958
|
-
],
|
|
3959
|
-
|
|
4024
|
+
], q.prototype, "x", 2);
|
|
4025
|
+
be([
|
|
3960
4026
|
p({ type: Number })
|
|
3961
|
-
],
|
|
3962
|
-
|
|
4027
|
+
], q.prototype, "y", 2);
|
|
4028
|
+
be([
|
|
3963
4029
|
c()
|
|
3964
|
-
],
|
|
3965
|
-
|
|
4030
|
+
], q.prototype, "_search", 2);
|
|
4031
|
+
q = be([
|
|
3966
4032
|
h("pigeon-merge-tag-picker")
|
|
3967
|
-
],
|
|
3968
|
-
var
|
|
3969
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
4033
|
+
], q);
|
|
4034
|
+
var ni = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, H = (e, t, o, r) => {
|
|
4035
|
+
for (var i = r > 1 ? void 0 : r ? ai(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
3970
4036
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
3971
|
-
return r && i &&
|
|
4037
|
+
return r && i && ni(t, o, i), i;
|
|
3972
4038
|
};
|
|
3973
|
-
let
|
|
4039
|
+
let T = class extends d {
|
|
3974
4040
|
constructor() {
|
|
3975
|
-
super(...arguments), this.rowId = "", this.columnId = "", this.mergeTags = [], this.requestMergeTags = !1, this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._textareaRef =
|
|
4041
|
+
super(...arguments), this.rowId = "", this.columnId = "", this.mergeTags = [], this.requestMergeTags = !1, this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._textareaRef = re(), this._triggerRef = re();
|
|
3976
4042
|
}
|
|
3977
4043
|
render() {
|
|
3978
4044
|
if (!this.block) return l``;
|
|
@@ -3984,13 +4050,13 @@ let I = class extends d {
|
|
|
3984
4050
|
<div class="label-row">
|
|
3985
4051
|
<label>${s("panel.common.contentHtml")}</label>
|
|
3986
4052
|
${t || this.requestMergeTags ? l`
|
|
3987
|
-
<button class="tag-btn" ${
|
|
4053
|
+
<button class="tag-btn" ${ne(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
|
|
3988
4054
|
${s("panel.common.tagBtn")}
|
|
3989
4055
|
</button>
|
|
3990
4056
|
` : ""}
|
|
3991
4057
|
</div>
|
|
3992
4058
|
<textarea
|
|
3993
|
-
${
|
|
4059
|
+
${ne(this._textareaRef)}
|
|
3994
4060
|
.value=${e.content}
|
|
3995
4061
|
@change=${this._onContentChange}
|
|
3996
4062
|
></textarea>
|
|
@@ -4047,10 +4113,10 @@ let I = class extends d {
|
|
|
4047
4113
|
}
|
|
4048
4114
|
}
|
|
4049
4115
|
_onMergeTagInsert(e) {
|
|
4050
|
-
const t =
|
|
4116
|
+
const t = Lt.getActive();
|
|
4051
4117
|
if (t && !t.isDestroyed) {
|
|
4052
|
-
const
|
|
4053
|
-
t.chain().focus().insertContent({ type: "mergeTag", attrs: { name:
|
|
4118
|
+
const _ = this._extractTagName(e.detail.tag.name);
|
|
4119
|
+
t.chain().focus().insertContent({ type: "mergeTag", attrs: { name: _ } }).run(), this._pickerOpen = !1;
|
|
4054
4120
|
return;
|
|
4055
4121
|
}
|
|
4056
4122
|
const o = this._textareaRef.value;
|
|
@@ -4092,8 +4158,8 @@ let I = class extends d {
|
|
|
4092
4158
|
this._emit({ padding: e.detail.value });
|
|
4093
4159
|
}
|
|
4094
4160
|
};
|
|
4095
|
-
|
|
4096
|
-
|
|
4161
|
+
T.styles = [
|
|
4162
|
+
w,
|
|
4097
4163
|
g`
|
|
4098
4164
|
/* Content textarea uses the monospace face so the HTML payload is
|
|
4099
4165
|
readable to authors editing the raw markup. */
|
|
@@ -4137,47 +4203,47 @@ I.styles = [
|
|
|
4137
4203
|
}
|
|
4138
4204
|
`
|
|
4139
4205
|
];
|
|
4140
|
-
|
|
4206
|
+
H([
|
|
4141
4207
|
p({ type: Object })
|
|
4142
|
-
],
|
|
4143
|
-
|
|
4208
|
+
], T.prototype, "block", 2);
|
|
4209
|
+
H([
|
|
4144
4210
|
p({ type: String })
|
|
4145
|
-
],
|
|
4146
|
-
|
|
4211
|
+
], T.prototype, "rowId", 2);
|
|
4212
|
+
H([
|
|
4147
4213
|
p({ type: String })
|
|
4148
|
-
],
|
|
4149
|
-
|
|
4214
|
+
], T.prototype, "columnId", 2);
|
|
4215
|
+
H([
|
|
4150
4216
|
p({ type: Array })
|
|
4151
|
-
],
|
|
4152
|
-
|
|
4217
|
+
], T.prototype, "mergeTags", 2);
|
|
4218
|
+
H([
|
|
4153
4219
|
p({ attribute: !1 })
|
|
4154
|
-
],
|
|
4155
|
-
|
|
4220
|
+
], T.prototype, "requestMergeTags", 2);
|
|
4221
|
+
H([
|
|
4156
4222
|
c()
|
|
4157
|
-
],
|
|
4158
|
-
|
|
4223
|
+
], T.prototype, "_pickerOpen", 2);
|
|
4224
|
+
H([
|
|
4159
4225
|
c()
|
|
4160
|
-
],
|
|
4161
|
-
|
|
4226
|
+
], T.prototype, "_pickerX", 2);
|
|
4227
|
+
H([
|
|
4162
4228
|
c()
|
|
4163
|
-
],
|
|
4164
|
-
|
|
4229
|
+
], T.prototype, "_pickerY", 2);
|
|
4230
|
+
T = H([
|
|
4165
4231
|
h("pigeon-text-panel")
|
|
4166
|
-
],
|
|
4167
|
-
var
|
|
4168
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
4232
|
+
], T);
|
|
4233
|
+
var si = Object.defineProperty, li = Object.getOwnPropertyDescriptor, y = (e, t, o, r) => {
|
|
4234
|
+
for (var i = r > 1 ? void 0 : r ? li(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
4169
4235
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
4170
|
-
return r && i &&
|
|
4236
|
+
return r && i && si(t, o, i), i;
|
|
4171
4237
|
};
|
|
4172
|
-
let
|
|
4173
|
-
function
|
|
4174
|
-
return
|
|
4238
|
+
let Ze = null;
|
|
4239
|
+
function pi() {
|
|
4240
|
+
return Ze || (Ze = import("./pigeon-stock-tab.js")), Ze;
|
|
4175
4241
|
}
|
|
4176
|
-
const
|
|
4177
|
-
let
|
|
4242
|
+
const ci = 250, je = "__all__";
|
|
4243
|
+
let m = class extends d {
|
|
4178
4244
|
constructor() {
|
|
4179
|
-
super(...arguments), this.config = {}, this.open = !1, this._tab = null, this._stockTabLoaded = !1, this._dragOver = !1, this._uploading = !1, this._progress = 0, this._error = "", this._urlInput = "", this._folder =
|
|
4180
|
-
this._tab = "stock", this._stockTabLoaded || (await
|
|
4245
|
+
super(...arguments), this.config = {}, this.open = !1, this._tab = null, this._stockTabLoaded = !1, this._dragOver = !1, this._uploading = !1, this._progress = 0, this._error = "", this._urlInput = "", this._folder = je, this._search = "", this._selectedTags = [], this._folders = [], this._assets = [], this._libraryLoading = !1, this._libraryError = "", this._searchTimer = null, this._libraryToken = 0, this._handleStockTabClick = async () => {
|
|
4246
|
+
this._tab = "stock", this._stockTabLoaded || (await pi(), this._stockTabLoaded = !0);
|
|
4181
4247
|
};
|
|
4182
4248
|
}
|
|
4183
4249
|
/* ----------------------------------------------------------------- */
|
|
@@ -4207,7 +4273,7 @@ let f = class extends d {
|
|
|
4207
4273
|
<h3>${e ? s("asset.title") : s("asset.title-upload")}</h3>
|
|
4208
4274
|
<button class="close-btn" @click=${this._close} aria-label=${s("asset.close")}>×</button>
|
|
4209
4275
|
</div>
|
|
4210
|
-
${t ? this._renderTabs(e) :
|
|
4276
|
+
${t ? this._renderTabs(e) : G}
|
|
4211
4277
|
<div class="body">
|
|
4212
4278
|
${this._activeTab === "stock" && this._hasStock ? this._renderStock() : e && this._activeTab === "library" ? this._renderLibrary() : this._renderUpload()}
|
|
4213
4279
|
</div>
|
|
@@ -4223,7 +4289,7 @@ let f = class extends d {
|
|
|
4223
4289
|
role="tab"
|
|
4224
4290
|
aria-selected=${t === "library"}
|
|
4225
4291
|
@click=${() => this._tab = "library"}
|
|
4226
|
-
>${s("asset.tab.library")}</button>` :
|
|
4292
|
+
>${s("asset.tab.library")}</button>` : G}
|
|
4227
4293
|
<button
|
|
4228
4294
|
class="tab ${t === "upload" ? "active" : ""}"
|
|
4229
4295
|
role="tab"
|
|
@@ -4237,7 +4303,7 @@ let f = class extends d {
|
|
|
4237
4303
|
role="tab"
|
|
4238
4304
|
aria-selected=${t === "stock"}
|
|
4239
4305
|
@click=${this._handleStockTabClick}
|
|
4240
|
-
>${s("asset.tab.stock")}</button>` :
|
|
4306
|
+
>${s("asset.tab.stock")}</button>` : G}
|
|
4241
4307
|
</div>
|
|
4242
4308
|
`;
|
|
4243
4309
|
}
|
|
@@ -4255,7 +4321,7 @@ let f = class extends d {
|
|
|
4255
4321
|
.value=${this._folder}
|
|
4256
4322
|
@change=${this._onFolderChange}
|
|
4257
4323
|
>
|
|
4258
|
-
<option value=${
|
|
4324
|
+
<option value=${je}>${s("asset.folder.all")}</option>
|
|
4259
4325
|
${this._folders.map(
|
|
4260
4326
|
(e) => l`<option value=${e} ?selected=${this._folder === e}>${e}</option>`
|
|
4261
4327
|
)}
|
|
@@ -4276,10 +4342,10 @@ let f = class extends d {
|
|
|
4276
4342
|
@click=${() => this._toggleTag(e)}
|
|
4277
4343
|
>${e}</button>`
|
|
4278
4344
|
)}
|
|
4279
|
-
</div>` :
|
|
4280
|
-
${this._libraryError ? l`<div class="error">${this._libraryError}</div>` :
|
|
4345
|
+
</div>` : G}
|
|
4346
|
+
${this._libraryError ? l`<div class="error">${this._libraryError}</div>` : G}
|
|
4281
4347
|
${this._libraryLoading ? l`<div class="library-spinner">${s("asset.loading")}</div>` : this._assets.length === 0 ? l`<div class="empty-library">
|
|
4282
|
-
${this._search || this._selectedTags.length > 0 || this._folder !==
|
|
4348
|
+
${this._search || this._selectedTags.length > 0 || this._folder !== je ? s("asset.empty.filtered") : s("asset.empty.no-assets")}
|
|
4283
4349
|
</div>` : l`<div class="asset-grid">
|
|
4284
4350
|
${this._assets.map((e) => this._renderAssetCard(e))}
|
|
4285
4351
|
</div>`}
|
|
@@ -4322,9 +4388,9 @@ let f = class extends d {
|
|
|
4322
4388
|
|
|
4323
4389
|
${this._uploading ? l`<div class="progress-bar">
|
|
4324
4390
|
<div class="progress-fill" style="width: ${this._progress}%"></div>
|
|
4325
|
-
</div>` :
|
|
4391
|
+
</div>` : G}
|
|
4326
4392
|
|
|
4327
|
-
${this._error ? l`<div class="error">${this._error}</div>` :
|
|
4393
|
+
${this._error ? l`<div class="error">${this._error}</div>` : G}
|
|
4328
4394
|
|
|
4329
4395
|
<div class="separator">${s("asset.url.separator")}</div>
|
|
4330
4396
|
|
|
@@ -4357,7 +4423,7 @@ let f = class extends d {
|
|
|
4357
4423
|
this._libraryLoading = !0, this._libraryError = "";
|
|
4358
4424
|
try {
|
|
4359
4425
|
const t = await this.storage.list({
|
|
4360
|
-
folder: this._folder ===
|
|
4426
|
+
folder: this._folder === je ? void 0 : this._folder,
|
|
4361
4427
|
search: this._search.trim() || void 0,
|
|
4362
4428
|
tags: this._selectedTags.length > 0 ? this._selectedTags : void 0
|
|
4363
4429
|
});
|
|
@@ -4382,7 +4448,7 @@ let f = class extends d {
|
|
|
4382
4448
|
this._folder = e.target.value, this._loadAssets();
|
|
4383
4449
|
}
|
|
4384
4450
|
_onSearchInput(e) {
|
|
4385
|
-
this._search = e.target.value, this._searchTimer && clearTimeout(this._searchTimer), this._searchTimer = setTimeout(() => this._loadAssets(),
|
|
4451
|
+
this._search = e.target.value, this._searchTimer && clearTimeout(this._searchTimer), this._searchTimer = setTimeout(() => this._loadAssets(), ci);
|
|
4386
4452
|
}
|
|
4387
4453
|
_toggleTag(e) {
|
|
4388
4454
|
this._selectedTags = this._selectedTags.includes(e) ? this._selectedTags.filter((t) => t !== e) : [...this._selectedTags, e], this._loadAssets();
|
|
@@ -4460,11 +4526,11 @@ let f = class extends d {
|
|
|
4460
4526
|
const n = i.method ?? "PUT", a = { ...i.headers ?? {} };
|
|
4461
4527
|
let u;
|
|
4462
4528
|
if (n === "POST") {
|
|
4463
|
-
const
|
|
4464
|
-
for (const [
|
|
4465
|
-
|
|
4529
|
+
const _ = new FormData();
|
|
4530
|
+
for (const [K, Ee] of Object.entries(i.fields ?? {})) _.append(K, Ee);
|
|
4531
|
+
_.append("file", e), u = _;
|
|
4466
4532
|
} else
|
|
4467
|
-
u = e, Object.keys(a).some((
|
|
4533
|
+
u = e, Object.keys(a).some((K) => K.toLowerCase() === "content-type") || (a["Content-Type"] = e.type);
|
|
4468
4534
|
const b = await fetch(i.uploadUrl, { method: n, headers: a, body: u });
|
|
4469
4535
|
if (this._progress = 90, !b.ok) throw new Error(`Upload failed: ${b.status} ${b.statusText}`);
|
|
4470
4536
|
this._progress = 100, this._selectAsset(i.publicUrl);
|
|
@@ -4514,7 +4580,7 @@ let f = class extends d {
|
|
|
4514
4580
|
), this._close();
|
|
4515
4581
|
}
|
|
4516
4582
|
};
|
|
4517
|
-
|
|
4583
|
+
m.styles = g`
|
|
4518
4584
|
:host {
|
|
4519
4585
|
display: none;
|
|
4520
4586
|
}
|
|
@@ -4845,66 +4911,66 @@ f.styles = g`
|
|
|
4845
4911
|
margin-top: 8px;
|
|
4846
4912
|
}
|
|
4847
4913
|
`;
|
|
4848
|
-
|
|
4914
|
+
y([
|
|
4849
4915
|
p({ type: Object })
|
|
4850
|
-
],
|
|
4851
|
-
|
|
4916
|
+
], m.prototype, "config", 2);
|
|
4917
|
+
y([
|
|
4852
4918
|
p({ attribute: !1 })
|
|
4853
|
-
],
|
|
4854
|
-
|
|
4919
|
+
], m.prototype, "storage", 2);
|
|
4920
|
+
y([
|
|
4855
4921
|
p({ type: Boolean, reflect: !0 })
|
|
4856
|
-
],
|
|
4857
|
-
|
|
4922
|
+
], m.prototype, "open", 2);
|
|
4923
|
+
y([
|
|
4858
4924
|
c()
|
|
4859
|
-
],
|
|
4860
|
-
|
|
4925
|
+
], m.prototype, "_tab", 2);
|
|
4926
|
+
y([
|
|
4861
4927
|
c()
|
|
4862
|
-
],
|
|
4863
|
-
|
|
4928
|
+
], m.prototype, "_stockTabLoaded", 2);
|
|
4929
|
+
y([
|
|
4864
4930
|
c()
|
|
4865
|
-
],
|
|
4866
|
-
|
|
4931
|
+
], m.prototype, "_dragOver", 2);
|
|
4932
|
+
y([
|
|
4867
4933
|
c()
|
|
4868
|
-
],
|
|
4869
|
-
|
|
4934
|
+
], m.prototype, "_uploading", 2);
|
|
4935
|
+
y([
|
|
4870
4936
|
c()
|
|
4871
|
-
],
|
|
4872
|
-
|
|
4937
|
+
], m.prototype, "_progress", 2);
|
|
4938
|
+
y([
|
|
4873
4939
|
c()
|
|
4874
|
-
],
|
|
4875
|
-
|
|
4940
|
+
], m.prototype, "_error", 2);
|
|
4941
|
+
y([
|
|
4876
4942
|
c()
|
|
4877
|
-
],
|
|
4878
|
-
|
|
4943
|
+
], m.prototype, "_urlInput", 2);
|
|
4944
|
+
y([
|
|
4879
4945
|
c()
|
|
4880
|
-
],
|
|
4881
|
-
|
|
4946
|
+
], m.prototype, "_folder", 2);
|
|
4947
|
+
y([
|
|
4882
4948
|
c()
|
|
4883
|
-
],
|
|
4884
|
-
|
|
4949
|
+
], m.prototype, "_search", 2);
|
|
4950
|
+
y([
|
|
4885
4951
|
c()
|
|
4886
|
-
],
|
|
4887
|
-
|
|
4952
|
+
], m.prototype, "_selectedTags", 2);
|
|
4953
|
+
y([
|
|
4888
4954
|
c()
|
|
4889
|
-
],
|
|
4890
|
-
|
|
4955
|
+
], m.prototype, "_folders", 2);
|
|
4956
|
+
y([
|
|
4891
4957
|
c()
|
|
4892
|
-
],
|
|
4893
|
-
|
|
4958
|
+
], m.prototype, "_assets", 2);
|
|
4959
|
+
y([
|
|
4894
4960
|
c()
|
|
4895
|
-
],
|
|
4896
|
-
|
|
4961
|
+
], m.prototype, "_libraryLoading", 2);
|
|
4962
|
+
y([
|
|
4897
4963
|
c()
|
|
4898
|
-
],
|
|
4899
|
-
|
|
4964
|
+
], m.prototype, "_libraryError", 2);
|
|
4965
|
+
m = y([
|
|
4900
4966
|
h("pigeon-asset-manager")
|
|
4901
|
-
],
|
|
4902
|
-
var
|
|
4903
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
4967
|
+
], m);
|
|
4968
|
+
var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, oe = (e, t, o, r) => {
|
|
4969
|
+
for (var i = r > 1 ? void 0 : r ? hi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
4904
4970
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
4905
|
-
return r && i &&
|
|
4971
|
+
return r && i && di(t, o, i), i;
|
|
4906
4972
|
};
|
|
4907
|
-
let
|
|
4973
|
+
let F = class extends d {
|
|
4908
4974
|
constructor() {
|
|
4909
4975
|
super(...arguments), this.rowId = "", this.columnId = "", this._assetManagerOpen = !1;
|
|
4910
4976
|
}
|
|
@@ -5025,41 +5091,41 @@ let R = class extends d {
|
|
|
5025
5091
|
this._emit({ src: e.detail.url }), this._assetManagerOpen = !1;
|
|
5026
5092
|
}
|
|
5027
5093
|
};
|
|
5028
|
-
|
|
5029
|
-
|
|
5094
|
+
F.styles = [
|
|
5095
|
+
w,
|
|
5030
5096
|
g`
|
|
5031
5097
|
.upload-btn {
|
|
5032
5098
|
margin-top: 6px;
|
|
5033
5099
|
}
|
|
5034
5100
|
`
|
|
5035
5101
|
];
|
|
5036
|
-
|
|
5102
|
+
oe([
|
|
5037
5103
|
p({ type: Object })
|
|
5038
|
-
],
|
|
5039
|
-
|
|
5104
|
+
], F.prototype, "block", 2);
|
|
5105
|
+
oe([
|
|
5040
5106
|
p({ type: String })
|
|
5041
|
-
],
|
|
5042
|
-
|
|
5107
|
+
], F.prototype, "rowId", 2);
|
|
5108
|
+
oe([
|
|
5043
5109
|
p({ type: String })
|
|
5044
|
-
],
|
|
5045
|
-
|
|
5110
|
+
], F.prototype, "columnId", 2);
|
|
5111
|
+
oe([
|
|
5046
5112
|
p({ type: Object })
|
|
5047
|
-
],
|
|
5048
|
-
|
|
5113
|
+
], F.prototype, "assetManagerConfig", 2);
|
|
5114
|
+
oe([
|
|
5049
5115
|
p({ attribute: !1 })
|
|
5050
|
-
],
|
|
5051
|
-
|
|
5116
|
+
], F.prototype, "assetStorage", 2);
|
|
5117
|
+
oe([
|
|
5052
5118
|
c()
|
|
5053
|
-
],
|
|
5054
|
-
|
|
5119
|
+
], F.prototype, "_assetManagerOpen", 2);
|
|
5120
|
+
F = oe([
|
|
5055
5121
|
h("pigeon-image-panel")
|
|
5056
|
-
],
|
|
5057
|
-
var
|
|
5058
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
5122
|
+
], F);
|
|
5123
|
+
var gi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, Ue = (e, t, o, r) => {
|
|
5124
|
+
for (var i = r > 1 ? void 0 : r ? ui(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
5059
5125
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
5060
|
-
return r && i &&
|
|
5126
|
+
return r && i && gi(t, o, i), i;
|
|
5061
5127
|
};
|
|
5062
|
-
let
|
|
5128
|
+
let pe = class extends d {
|
|
5063
5129
|
constructor() {
|
|
5064
5130
|
super(...arguments), this.label = s("control.color.label"), this.value = "#000000", this.swatches = [];
|
|
5065
5131
|
}
|
|
@@ -5078,7 +5144,7 @@ let le = class extends d {
|
|
|
5078
5144
|
type="button"
|
|
5079
5145
|
title=${`${e.name} (${e.value})`}
|
|
5080
5146
|
aria-label=${e.name}
|
|
5081
|
-
style=${
|
|
5147
|
+
style=${io({ background: e.value })}
|
|
5082
5148
|
@click=${() => this._applySwatch(e.value)}
|
|
5083
5149
|
></button>`
|
|
5084
5150
|
)}
|
|
@@ -5104,7 +5170,7 @@ let le = class extends d {
|
|
|
5104
5170
|
}));
|
|
5105
5171
|
}
|
|
5106
5172
|
};
|
|
5107
|
-
|
|
5173
|
+
pe.styles = g`
|
|
5108
5174
|
:host {
|
|
5109
5175
|
display: block;
|
|
5110
5176
|
margin-bottom: 12px;
|
|
@@ -5199,28 +5265,29 @@ le.styles = g`
|
|
|
5199
5265
|
box-shadow: var(--pigeon-ring-shadow);
|
|
5200
5266
|
}
|
|
5201
5267
|
`;
|
|
5202
|
-
|
|
5268
|
+
Ue([
|
|
5203
5269
|
p({ type: String })
|
|
5204
|
-
],
|
|
5205
|
-
|
|
5270
|
+
], pe.prototype, "label", 2);
|
|
5271
|
+
Ue([
|
|
5206
5272
|
p({ type: String })
|
|
5207
|
-
],
|
|
5208
|
-
|
|
5273
|
+
], pe.prototype, "value", 2);
|
|
5274
|
+
Ue([
|
|
5209
5275
|
p({ attribute: !1 })
|
|
5210
|
-
],
|
|
5211
|
-
|
|
5276
|
+
], pe.prototype, "swatches", 2);
|
|
5277
|
+
pe = Ue([
|
|
5212
5278
|
h("pigeon-color-picker")
|
|
5213
|
-
],
|
|
5214
|
-
var
|
|
5215
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
5279
|
+
], pe);
|
|
5280
|
+
var bi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, ve = (e, t, o, r) => {
|
|
5281
|
+
for (var i = r > 1 ? void 0 : r ? vi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
5216
5282
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
5217
|
-
return r && i &&
|
|
5283
|
+
return r && i && bi(t, o, i), i;
|
|
5218
5284
|
};
|
|
5219
|
-
let
|
|
5285
|
+
let V = class extends d {
|
|
5220
5286
|
constructor() {
|
|
5221
5287
|
super(...arguments), this.rowId = "", this.columnId = "", this.swatches = [], this.linkTypes = [];
|
|
5222
5288
|
}
|
|
5223
5289
|
render() {
|
|
5290
|
+
var t, o, r;
|
|
5224
5291
|
if (!this.block) return l``;
|
|
5225
5292
|
const e = this.block.values;
|
|
5226
5293
|
return l`
|
|
@@ -5273,6 +5340,35 @@ let N = class extends d {
|
|
|
5273
5340
|
@slider-change=${this._onBorderRadiusChange}
|
|
5274
5341
|
></pigeon-slider-input>
|
|
5275
5342
|
|
|
5343
|
+
<div class="field">
|
|
5344
|
+
<label>${s("panel.button.border")}</label>
|
|
5345
|
+
<select @change=${this._onBorderStyleChange}>
|
|
5346
|
+
<option value="none" ?selected=${!e.border}>${s("panel.button.borderNone")}</option>
|
|
5347
|
+
<option value="solid" ?selected=${((t = e.border) == null ? void 0 : t.style) === "solid"}>${s("panel.button.borderSolid")}</option>
|
|
5348
|
+
<option value="dashed" ?selected=${((o = e.border) == null ? void 0 : o.style) === "dashed"}>${s("panel.button.borderDashed")}</option>
|
|
5349
|
+
<option value="dotted" ?selected=${((r = e.border) == null ? void 0 : r.style) === "dotted"}>${s("panel.button.borderDotted")}</option>
|
|
5350
|
+
</select>
|
|
5351
|
+
</div>
|
|
5352
|
+
|
|
5353
|
+
${e.border ? l`
|
|
5354
|
+
<pigeon-slider-input
|
|
5355
|
+
label=${s("panel.button.borderWidth")}
|
|
5356
|
+
.value=${e.border.width}
|
|
5357
|
+
min=${1}
|
|
5358
|
+
max=${10}
|
|
5359
|
+
step=${1}
|
|
5360
|
+
unit="px"
|
|
5361
|
+
@slider-change=${this._onBorderWidthChange}
|
|
5362
|
+
></pigeon-slider-input>
|
|
5363
|
+
|
|
5364
|
+
<pigeon-color-picker
|
|
5365
|
+
label=${s("panel.button.borderColor")}
|
|
5366
|
+
.value=${e.border.color}
|
|
5367
|
+
.swatches=${this.swatches}
|
|
5368
|
+
@color-change=${this._onBorderColorChange}
|
|
5369
|
+
></pigeon-color-picker>
|
|
5370
|
+
` : ""}
|
|
5371
|
+
|
|
5276
5372
|
<pigeon-slider-input
|
|
5277
5373
|
label=${s("panel.common.fontSize")}
|
|
5278
5374
|
.value=${e.fontSize}
|
|
@@ -5359,6 +5455,35 @@ let N = class extends d {
|
|
|
5359
5455
|
_onBorderRadiusChange(e) {
|
|
5360
5456
|
this._emit({ borderRadius: e.detail.value });
|
|
5361
5457
|
}
|
|
5458
|
+
/**
|
|
5459
|
+
* "None" clears the border rather than storing a zero-width one, so the
|
|
5460
|
+
* renderer leaves the attribute off and MJML's own `border: none` stands.
|
|
5461
|
+
* Turning one on starts from the text colour, which is the edge an outline
|
|
5462
|
+
* button almost always wants.
|
|
5463
|
+
*/
|
|
5464
|
+
_onBorderStyleChange(e) {
|
|
5465
|
+
const t = e.target.value;
|
|
5466
|
+
if (t === "none") {
|
|
5467
|
+
this._emit({ border: void 0 });
|
|
5468
|
+
return;
|
|
5469
|
+
}
|
|
5470
|
+
const o = this.block.values.border;
|
|
5471
|
+
this._emit({
|
|
5472
|
+
border: {
|
|
5473
|
+
width: (o == null ? void 0 : o.width) ?? 1,
|
|
5474
|
+
style: t,
|
|
5475
|
+
color: (o == null ? void 0 : o.color) ?? this.block.values.textColor
|
|
5476
|
+
}
|
|
5477
|
+
});
|
|
5478
|
+
}
|
|
5479
|
+
_onBorderWidthChange(e) {
|
|
5480
|
+
const t = this.block.values.border;
|
|
5481
|
+
t && this._emit({ border: { ...t, width: e.detail.value } });
|
|
5482
|
+
}
|
|
5483
|
+
_onBorderColorChange(e) {
|
|
5484
|
+
const t = this.block.values.border;
|
|
5485
|
+
t && this._emit({ border: { ...t, color: e.detail.value } });
|
|
5486
|
+
}
|
|
5362
5487
|
_onFontSizeChange(e) {
|
|
5363
5488
|
this._emit({ fontSize: e.detail.value });
|
|
5364
5489
|
}
|
|
@@ -5378,31 +5503,31 @@ let N = class extends d {
|
|
|
5378
5503
|
this._emit({ innerPadding: e.detail.value });
|
|
5379
5504
|
}
|
|
5380
5505
|
};
|
|
5381
|
-
|
|
5382
|
-
|
|
5506
|
+
V.styles = w;
|
|
5507
|
+
ve([
|
|
5383
5508
|
p({ type: Object })
|
|
5384
|
-
],
|
|
5385
|
-
|
|
5509
|
+
], V.prototype, "block", 2);
|
|
5510
|
+
ve([
|
|
5386
5511
|
p({ type: String })
|
|
5387
|
-
],
|
|
5388
|
-
|
|
5512
|
+
], V.prototype, "rowId", 2);
|
|
5513
|
+
ve([
|
|
5389
5514
|
p({ type: String })
|
|
5390
|
-
],
|
|
5391
|
-
|
|
5515
|
+
], V.prototype, "columnId", 2);
|
|
5516
|
+
ve([
|
|
5392
5517
|
p({ attribute: !1 })
|
|
5393
|
-
],
|
|
5394
|
-
|
|
5518
|
+
], V.prototype, "swatches", 2);
|
|
5519
|
+
ve([
|
|
5395
5520
|
p({ attribute: !1 })
|
|
5396
|
-
],
|
|
5397
|
-
|
|
5521
|
+
], V.prototype, "linkTypes", 2);
|
|
5522
|
+
V = ve([
|
|
5398
5523
|
h("pigeon-button-panel")
|
|
5399
|
-
],
|
|
5400
|
-
var
|
|
5401
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
5524
|
+
], V);
|
|
5525
|
+
var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, Rt = (e, t, o, r) => {
|
|
5526
|
+
for (var i = r > 1 ? void 0 : r ? mi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
5402
5527
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
5403
|
-
return r && i &&
|
|
5528
|
+
return r && i && fi(t, o, i), i;
|
|
5404
5529
|
};
|
|
5405
|
-
let
|
|
5530
|
+
let ze = class extends d {
|
|
5406
5531
|
get _layouts() {
|
|
5407
5532
|
return [
|
|
5408
5533
|
{ label: s("panel.row.layout1col"), ratios: [12] },
|
|
@@ -5413,21 +5538,21 @@ let Re = class extends d {
|
|
|
5413
5538
|
}
|
|
5414
5539
|
render() {
|
|
5415
5540
|
if (!this.row) return l``;
|
|
5416
|
-
const e = this.row.attributes, t = this.row.columnRatios.join(",");
|
|
5541
|
+
const e = this.row.attributes, t = Ot(this.row), o = this.row.columnRatios.join(",");
|
|
5417
5542
|
return l`
|
|
5418
5543
|
<h3>${s("panel.row.title")}</h3>
|
|
5419
5544
|
|
|
5420
5545
|
<span class="section-label">${s("panel.row.columnLayout")}</span>
|
|
5421
5546
|
<div class="layout-presets">
|
|
5422
|
-
${this._layouts.map((
|
|
5423
|
-
const
|
|
5547
|
+
${this._layouts.map((r) => {
|
|
5548
|
+
const i = r.ratios.join(",") === o;
|
|
5424
5549
|
return l`
|
|
5425
5550
|
<div
|
|
5426
|
-
class="layout-preset ${
|
|
5427
|
-
title="${
|
|
5428
|
-
@click=${() => this._onLayoutSelect(
|
|
5551
|
+
class="layout-preset ${i ? "active" : ""}"
|
|
5552
|
+
title="${r.label}"
|
|
5553
|
+
@click=${() => this._onLayoutSelect(r.ratios)}
|
|
5429
5554
|
>
|
|
5430
|
-
${
|
|
5555
|
+
${r.ratios.map((n) => l`<div class="col-bar" style="flex: ${n};"></div>`)}
|
|
5431
5556
|
</div>
|
|
5432
5557
|
`;
|
|
5433
5558
|
})}
|
|
@@ -5449,6 +5574,35 @@ let Re = class extends d {
|
|
|
5449
5574
|
/>
|
|
5450
5575
|
</div>
|
|
5451
5576
|
|
|
5577
|
+
${e.backgroundImage ? l`
|
|
5578
|
+
<div class="field">
|
|
5579
|
+
<label>${s("panel.row.backgroundRepeat")}</label>
|
|
5580
|
+
<select @change=${this._onBgRepeatChange}>
|
|
5581
|
+
<option value="no-repeat" ?selected=${(t == null ? void 0 : t.repeat) === "no-repeat"}>${s("panel.row.backgroundRepeatNone")}</option>
|
|
5582
|
+
<option value="repeat" ?selected=${(t == null ? void 0 : t.repeat) === "repeat"}>${s("panel.row.backgroundRepeatTile")}</option>
|
|
5583
|
+
</select>
|
|
5584
|
+
</div>
|
|
5585
|
+
|
|
5586
|
+
<div class="field">
|
|
5587
|
+
<label>${s("panel.row.backgroundSize")}</label>
|
|
5588
|
+
<input
|
|
5589
|
+
type="text"
|
|
5590
|
+
.value=${(t == null ? void 0 : t.size) ?? ""}
|
|
5591
|
+
placeholder="cover"
|
|
5592
|
+
@change=${this._onBgSizeChange}
|
|
5593
|
+
/>
|
|
5594
|
+
</div>
|
|
5595
|
+
|
|
5596
|
+
<div class="field">
|
|
5597
|
+
<label>${s("panel.row.backgroundPosition")}</label>
|
|
5598
|
+
<select @change=${this._onBgPositionChange}>
|
|
5599
|
+
${["top center", "center center", "bottom center", "left center", "right center"].map(
|
|
5600
|
+
(r) => l`<option value=${r} ?selected=${(t == null ? void 0 : t.position) === r}>${r}</option>`
|
|
5601
|
+
)}
|
|
5602
|
+
</select>
|
|
5603
|
+
</div>
|
|
5604
|
+
` : ""}
|
|
5605
|
+
|
|
5452
5606
|
<div class="toggle-row">
|
|
5453
5607
|
<span class="toggle-label">${s("panel.row.fullWidth")}</span>
|
|
5454
5608
|
<label class="toggle">
|
|
@@ -5461,6 +5615,18 @@ let Re = class extends d {
|
|
|
5461
5615
|
</label>
|
|
5462
5616
|
</div>
|
|
5463
5617
|
|
|
5618
|
+
<div class="toggle-row">
|
|
5619
|
+
<span class="toggle-label">${s("panel.row.noStackOnMobile")}</span>
|
|
5620
|
+
<label class="toggle">
|
|
5621
|
+
<input
|
|
5622
|
+
type="checkbox"
|
|
5623
|
+
.checked=${e.noStackOnMobile ?? !1}
|
|
5624
|
+
@change=${this._onNoStackChange}
|
|
5625
|
+
/>
|
|
5626
|
+
<span class="toggle-track"></span>
|
|
5627
|
+
</label>
|
|
5628
|
+
</div>
|
|
5629
|
+
|
|
5464
5630
|
<pigeon-spacing-input
|
|
5465
5631
|
label=${s("panel.common.padding")}
|
|
5466
5632
|
.value=${e.padding}
|
|
@@ -5481,6 +5647,21 @@ let Re = class extends d {
|
|
|
5481
5647
|
<code>{{#if …}}</code> for your sending platform.
|
|
5482
5648
|
</p>
|
|
5483
5649
|
</div>
|
|
5650
|
+
|
|
5651
|
+
<div class="field">
|
|
5652
|
+
<label for="row-repeat">${s("panel.row.repeat")}</label>
|
|
5653
|
+
<input
|
|
5654
|
+
id="row-repeat"
|
|
5655
|
+
type="text"
|
|
5656
|
+
.value=${e.repeat ?? ""}
|
|
5657
|
+
placeholder="e.g. order.items"
|
|
5658
|
+
@change=${this._onRepeatChange}
|
|
5659
|
+
/>
|
|
5660
|
+
<p class="hint">
|
|
5661
|
+
Repeat this row once per item of an array merge tag. Exported as
|
|
5662
|
+
<code>{{#each …}}</code>; inside the row, merge tags read from the item.
|
|
5663
|
+
</p>
|
|
5664
|
+
</div>
|
|
5484
5665
|
`;
|
|
5485
5666
|
}
|
|
5486
5667
|
_emitRowUpdate(e) {
|
|
@@ -5510,9 +5691,23 @@ let Re = class extends d {
|
|
|
5510
5691
|
_onBgImageChange(e) {
|
|
5511
5692
|
this._emitRowUpdate({ backgroundImage: e.target.value });
|
|
5512
5693
|
}
|
|
5694
|
+
_onBgRepeatChange(e) {
|
|
5695
|
+
this._emitRowUpdate({ backgroundRepeat: e.target.value });
|
|
5696
|
+
}
|
|
5697
|
+
_onBgSizeChange(e) {
|
|
5698
|
+
const t = e.target.value.trim();
|
|
5699
|
+
this._emitRowUpdate({ backgroundSize: t || void 0 });
|
|
5700
|
+
}
|
|
5701
|
+
_onBgPositionChange(e) {
|
|
5702
|
+
this._emitRowUpdate({ backgroundPosition: e.target.value });
|
|
5703
|
+
}
|
|
5513
5704
|
_onFullWidthChange(e) {
|
|
5514
5705
|
this._emitRowUpdate({ fullWidth: e.target.checked });
|
|
5515
5706
|
}
|
|
5707
|
+
_onNoStackChange(e) {
|
|
5708
|
+
const t = e.target.checked;
|
|
5709
|
+
this._emitRowUpdate({ noStackOnMobile: t || void 0 });
|
|
5710
|
+
}
|
|
5516
5711
|
_onPaddingChange(e) {
|
|
5517
5712
|
this._emitRowUpdate({ padding: e.detail.value });
|
|
5518
5713
|
}
|
|
@@ -5520,9 +5715,13 @@ let Re = class extends d {
|
|
|
5520
5715
|
const t = e.target.value.trim();
|
|
5521
5716
|
this._emitRowUpdate({ condition: t || void 0 });
|
|
5522
5717
|
}
|
|
5718
|
+
_onRepeatChange(e) {
|
|
5719
|
+
const t = e.target.value.trim();
|
|
5720
|
+
this._emitRowUpdate({ repeat: t || void 0 });
|
|
5721
|
+
}
|
|
5523
5722
|
};
|
|
5524
|
-
|
|
5525
|
-
|
|
5723
|
+
ze.styles = [
|
|
5724
|
+
w,
|
|
5526
5725
|
g`
|
|
5527
5726
|
.hint {
|
|
5528
5727
|
margin: 4px 0 0;
|
|
@@ -5592,18 +5791,18 @@ Re.styles = [
|
|
|
5592
5791
|
}
|
|
5593
5792
|
`
|
|
5594
5793
|
];
|
|
5595
|
-
|
|
5794
|
+
Rt([
|
|
5596
5795
|
p({ type: Object })
|
|
5597
|
-
],
|
|
5598
|
-
|
|
5796
|
+
], ze.prototype, "row", 2);
|
|
5797
|
+
ze = Rt([
|
|
5599
5798
|
h("pigeon-row-panel")
|
|
5600
|
-
],
|
|
5601
|
-
var
|
|
5602
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
5799
|
+
], ze);
|
|
5800
|
+
var yi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, Ne = (e, t, o, r) => {
|
|
5801
|
+
for (var i = r > 1 ? void 0 : r ? _i(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
5603
5802
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
5604
|
-
return r && i &&
|
|
5803
|
+
return r && i && yi(t, o, i), i;
|
|
5605
5804
|
};
|
|
5606
|
-
const
|
|
5805
|
+
const Tt = [
|
|
5607
5806
|
{ label: "Arial", value: "Arial, Helvetica, sans-serif" },
|
|
5608
5807
|
{ label: "Georgia", value: "Georgia, Times, serif" },
|
|
5609
5808
|
{ label: "Courier New", value: "'Courier New', Courier, monospace" },
|
|
@@ -5612,13 +5811,13 @@ const xt = [
|
|
|
5612
5811
|
{ label: "Trebuchet MS", value: "'Trebuchet MS', sans-serif" },
|
|
5613
5812
|
{ label: "Times New Roman", value: "'Times New Roman', Times, serif" }
|
|
5614
5813
|
];
|
|
5615
|
-
let
|
|
5814
|
+
let ce = class extends d {
|
|
5616
5815
|
constructor() {
|
|
5617
5816
|
super(...arguments), this.label = s("control.fontPicker.label"), this.value = "", this.brandFonts = [];
|
|
5618
5817
|
}
|
|
5619
5818
|
get _options() {
|
|
5620
|
-
const e = new Set(
|
|
5621
|
-
return [...
|
|
5819
|
+
const e = new Set(Tt.map((o) => o.value)), t = this.brandFonts.filter((o) => !e.has(o.family)).map((o) => ({ label: o.name, value: o.family }));
|
|
5820
|
+
return [...Tt, ...t];
|
|
5622
5821
|
}
|
|
5623
5822
|
render() {
|
|
5624
5823
|
return l`
|
|
@@ -5640,7 +5839,7 @@ let pe = class extends d {
|
|
|
5640
5839
|
);
|
|
5641
5840
|
}
|
|
5642
5841
|
};
|
|
5643
|
-
|
|
5842
|
+
ce.styles = g`
|
|
5644
5843
|
:host {
|
|
5645
5844
|
display: block;
|
|
5646
5845
|
margin-bottom: 12px;
|
|
@@ -5666,28 +5865,29 @@ pe.styles = g`
|
|
|
5666
5865
|
box-sizing: border-box;
|
|
5667
5866
|
}
|
|
5668
5867
|
`;
|
|
5669
|
-
|
|
5868
|
+
Ne([
|
|
5670
5869
|
p({ type: String })
|
|
5671
|
-
],
|
|
5672
|
-
|
|
5870
|
+
], ce.prototype, "label", 2);
|
|
5871
|
+
Ne([
|
|
5673
5872
|
p({ type: String })
|
|
5674
|
-
],
|
|
5675
|
-
|
|
5873
|
+
], ce.prototype, "value", 2);
|
|
5874
|
+
Ne([
|
|
5676
5875
|
p({ attribute: !1 })
|
|
5677
|
-
],
|
|
5678
|
-
|
|
5876
|
+
], ce.prototype, "brandFonts", 2);
|
|
5877
|
+
ce = Ne([
|
|
5679
5878
|
h("pigeon-font-picker")
|
|
5680
|
-
],
|
|
5681
|
-
var
|
|
5682
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
5879
|
+
], ce);
|
|
5880
|
+
var xi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, U = (e, t, o, r) => {
|
|
5881
|
+
for (var i = r > 1 ? void 0 : r ? wi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
5683
5882
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
5684
|
-
return r && i &&
|
|
5883
|
+
return r && i && xi(t, o, i), i;
|
|
5685
5884
|
};
|
|
5686
|
-
let
|
|
5885
|
+
let S = class extends d {
|
|
5687
5886
|
constructor() {
|
|
5688
|
-
super(...arguments), this.mergeTags = [], this.requestMergeTags = !1, this.swatches = [], this.brandFonts = [], this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._previewInputRef =
|
|
5887
|
+
super(...arguments), this.mergeTags = [], this.requestMergeTags = !1, this.swatches = [], this.brandFonts = [], this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._previewInputRef = re(), this._triggerRef = re();
|
|
5689
5888
|
}
|
|
5690
5889
|
render() {
|
|
5890
|
+
var t, o;
|
|
5691
5891
|
if (!this.doc) return l``;
|
|
5692
5892
|
const e = this.doc.body.attributes;
|
|
5693
5893
|
return l`
|
|
@@ -5730,6 +5930,54 @@ let P = class extends d {
|
|
|
5730
5930
|
</div>
|
|
5731
5931
|
</div>
|
|
5732
5932
|
|
|
5933
|
+
<pigeon-color-picker
|
|
5934
|
+
label=${s("panel.body.linkColor")}
|
|
5935
|
+
.value=${((t = e.linkStyle) == null ? void 0 : t.color) ?? ""}
|
|
5936
|
+
.swatches=${this.swatches}
|
|
5937
|
+
@color-change=${this._onLinkColorChange}
|
|
5938
|
+
></pigeon-color-picker>
|
|
5939
|
+
|
|
5940
|
+
<div class="toggle-row">
|
|
5941
|
+
<span class="toggle-label">${s("panel.body.linkUnderline")}</span>
|
|
5942
|
+
<label class="toggle">
|
|
5943
|
+
<input
|
|
5944
|
+
type="checkbox"
|
|
5945
|
+
.checked=${((o = e.linkStyle) == null ? void 0 : o.underline) ?? !1}
|
|
5946
|
+
@change=${this._onLinkUnderlineChange}
|
|
5947
|
+
/>
|
|
5948
|
+
<span class="toggle-track"></span>
|
|
5949
|
+
</label>
|
|
5950
|
+
</div>
|
|
5951
|
+
|
|
5952
|
+
<div class="field">
|
|
5953
|
+
<label>${s("panel.body.language")}</label>
|
|
5954
|
+
<input
|
|
5955
|
+
type="text"
|
|
5956
|
+
.value=${e.language ?? ""}
|
|
5957
|
+
placeholder=${s("panel.body.languagePlaceholder")}
|
|
5958
|
+
@change=${this._onLanguageChange}
|
|
5959
|
+
/>
|
|
5960
|
+
</div>
|
|
5961
|
+
|
|
5962
|
+
<div class="field">
|
|
5963
|
+
<label>${s("panel.body.textDirection")}</label>
|
|
5964
|
+
<div class="alignment-buttons">
|
|
5965
|
+
<button
|
|
5966
|
+
class="${e.direction === void 0 ? "active" : ""}"
|
|
5967
|
+
title=${s(`panel.body.direction${Mt(e.language) === "rtl" ? "Rtl" : "Ltr"}`)}
|
|
5968
|
+
@click=${() => this._onDirectionChange(void 0)}
|
|
5969
|
+
>${s("panel.body.directionAuto")}</button>
|
|
5970
|
+
<button
|
|
5971
|
+
class="${e.direction === "ltr" ? "active" : ""}"
|
|
5972
|
+
@click=${() => this._onDirectionChange("ltr")}
|
|
5973
|
+
>${s("panel.body.directionLtr")}</button>
|
|
5974
|
+
<button
|
|
5975
|
+
class="${e.direction === "rtl" ? "active" : ""}"
|
|
5976
|
+
@click=${() => this._onDirectionChange("rtl")}
|
|
5977
|
+
>${s("panel.body.directionRtl")}</button>
|
|
5978
|
+
</div>
|
|
5979
|
+
</div>
|
|
5980
|
+
|
|
5733
5981
|
<div class="field">
|
|
5734
5982
|
<label>${s("panel.body.emailName")}</label>
|
|
5735
5983
|
<input
|
|
@@ -5743,14 +5991,14 @@ let P = class extends d {
|
|
|
5743
5991
|
<div class="label-row">
|
|
5744
5992
|
<label>${s("panel.body.previewText")}</label>
|
|
5745
5993
|
${this.mergeTags.length > 0 || this.requestMergeTags ? l`
|
|
5746
|
-
<button class="tag-btn" ${
|
|
5994
|
+
<button class="tag-btn" ${ne(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
|
|
5747
5995
|
${s("panel.common.tagBtn")}
|
|
5748
5996
|
</button>
|
|
5749
5997
|
` : ""}
|
|
5750
5998
|
</div>
|
|
5751
5999
|
<input
|
|
5752
6000
|
type="text"
|
|
5753
|
-
${
|
|
6001
|
+
${ne(this._previewInputRef)}
|
|
5754
6002
|
.value=${this.doc.metadata.previewText ?? ""}
|
|
5755
6003
|
placeholder=${s("panel.body.previewTextPlaceholder")}
|
|
5756
6004
|
@change=${this._onPreviewTextChange}
|
|
@@ -5806,9 +6054,33 @@ let P = class extends d {
|
|
|
5806
6054
|
_onFontFamilyChange(e) {
|
|
5807
6055
|
this._emit({ attribute: "fontFamily", value: e.detail.value });
|
|
5808
6056
|
}
|
|
6057
|
+
/**
|
|
6058
|
+
* Each part of `linkStyle` is set on its own, and clearing the colour drops
|
|
6059
|
+
* the whole field when nothing else is set — so a document that never had a
|
|
6060
|
+
* link style renders exactly as it did before anyone opened this panel.
|
|
6061
|
+
*/
|
|
6062
|
+
_onLinkColorChange(e) {
|
|
6063
|
+
this._emitLinkStyle({ color: e.detail.value || void 0 });
|
|
6064
|
+
}
|
|
6065
|
+
_onLinkUnderlineChange(e) {
|
|
6066
|
+
this._emitLinkStyle({ underline: e.target.checked });
|
|
6067
|
+
}
|
|
6068
|
+
_emitLinkStyle(e) {
|
|
6069
|
+
const t = { ...this.doc.body.attributes.linkStyle, ...e };
|
|
6070
|
+
t.color === void 0 && delete t.color, this._emit({
|
|
6071
|
+
attribute: "linkStyle",
|
|
6072
|
+
value: Object.keys(t).length ? t : void 0
|
|
6073
|
+
});
|
|
6074
|
+
}
|
|
5809
6075
|
_onAlignChange(e) {
|
|
5810
6076
|
this._emit({ attribute: "contentAlignment", value: e });
|
|
5811
6077
|
}
|
|
6078
|
+
_onLanguageChange(e) {
|
|
6079
|
+
this._emit({ attribute: "language", value: e.target.value.trim() || void 0 });
|
|
6080
|
+
}
|
|
6081
|
+
_onDirectionChange(e) {
|
|
6082
|
+
this._emit({ attribute: "direction", value: e });
|
|
6083
|
+
}
|
|
5812
6084
|
_onNameChange(e) {
|
|
5813
6085
|
this._emit({ metaField: "name", value: e.target.value });
|
|
5814
6086
|
}
|
|
@@ -5816,8 +6088,8 @@ let P = class extends d {
|
|
|
5816
6088
|
this._emit({ metaField: "previewText", value: e.target.value });
|
|
5817
6089
|
}
|
|
5818
6090
|
};
|
|
5819
|
-
|
|
5820
|
-
|
|
6091
|
+
S.styles = [
|
|
6092
|
+
w,
|
|
5821
6093
|
g`
|
|
5822
6094
|
.alignment-buttons {
|
|
5823
6095
|
display: flex;
|
|
@@ -5890,39 +6162,39 @@ P.styles = [
|
|
|
5890
6162
|
}
|
|
5891
6163
|
`
|
|
5892
6164
|
];
|
|
5893
|
-
|
|
6165
|
+
U([
|
|
5894
6166
|
p({ type: Object })
|
|
5895
|
-
],
|
|
5896
|
-
|
|
6167
|
+
], S.prototype, "doc", 2);
|
|
6168
|
+
U([
|
|
5897
6169
|
p({ type: Array })
|
|
5898
|
-
],
|
|
5899
|
-
|
|
6170
|
+
], S.prototype, "mergeTags", 2);
|
|
6171
|
+
U([
|
|
5900
6172
|
p({ attribute: !1 })
|
|
5901
|
-
],
|
|
5902
|
-
|
|
6173
|
+
], S.prototype, "requestMergeTags", 2);
|
|
6174
|
+
U([
|
|
5903
6175
|
p({ attribute: !1 })
|
|
5904
|
-
],
|
|
5905
|
-
|
|
6176
|
+
], S.prototype, "swatches", 2);
|
|
6177
|
+
U([
|
|
5906
6178
|
p({ attribute: !1 })
|
|
5907
|
-
],
|
|
5908
|
-
|
|
6179
|
+
], S.prototype, "brandFonts", 2);
|
|
6180
|
+
U([
|
|
5909
6181
|
c()
|
|
5910
|
-
],
|
|
5911
|
-
|
|
6182
|
+
], S.prototype, "_pickerOpen", 2);
|
|
6183
|
+
U([
|
|
5912
6184
|
c()
|
|
5913
|
-
],
|
|
5914
|
-
|
|
6185
|
+
], S.prototype, "_pickerX", 2);
|
|
6186
|
+
U([
|
|
5915
6187
|
c()
|
|
5916
|
-
],
|
|
5917
|
-
|
|
6188
|
+
], S.prototype, "_pickerY", 2);
|
|
6189
|
+
S = U([
|
|
5918
6190
|
h("pigeon-body-panel")
|
|
5919
|
-
],
|
|
5920
|
-
var
|
|
5921
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
6191
|
+
], S);
|
|
6192
|
+
var $i = Object.defineProperty, ki = Object.getOwnPropertyDescriptor, X = (e, t, o, r) => {
|
|
6193
|
+
for (var i = r > 1 ? void 0 : r ? ki(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
5922
6194
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
5923
|
-
return r && i &&
|
|
6195
|
+
return r && i && $i(t, o, i), i;
|
|
5924
6196
|
};
|
|
5925
|
-
let
|
|
6197
|
+
let E = class extends d {
|
|
5926
6198
|
constructor() {
|
|
5927
6199
|
super(...arguments), this.rowId = "", this.columnId = "", this.swatches = [], this._assetManagerOpen = !1;
|
|
5928
6200
|
}
|
|
@@ -6075,35 +6347,35 @@ let D = class extends d {
|
|
|
6075
6347
|
this._emit({ backgroundUrl: e.detail.url }), this._assetManagerOpen = !1;
|
|
6076
6348
|
}
|
|
6077
6349
|
};
|
|
6078
|
-
|
|
6079
|
-
|
|
6350
|
+
E.styles = [w];
|
|
6351
|
+
X([
|
|
6080
6352
|
p({ type: Object })
|
|
6081
|
-
],
|
|
6082
|
-
|
|
6353
|
+
], E.prototype, "block", 2);
|
|
6354
|
+
X([
|
|
6083
6355
|
p({ type: String })
|
|
6084
|
-
],
|
|
6085
|
-
|
|
6356
|
+
], E.prototype, "rowId", 2);
|
|
6357
|
+
X([
|
|
6086
6358
|
p({ type: String })
|
|
6087
|
-
],
|
|
6088
|
-
|
|
6359
|
+
], E.prototype, "columnId", 2);
|
|
6360
|
+
X([
|
|
6089
6361
|
p({ type: Object })
|
|
6090
|
-
],
|
|
6091
|
-
|
|
6362
|
+
], E.prototype, "assetManagerConfig", 2);
|
|
6363
|
+
X([
|
|
6092
6364
|
p({ attribute: !1 })
|
|
6093
|
-
],
|
|
6094
|
-
|
|
6365
|
+
], E.prototype, "assetStorage", 2);
|
|
6366
|
+
X([
|
|
6095
6367
|
p({ attribute: !1 })
|
|
6096
|
-
],
|
|
6097
|
-
|
|
6368
|
+
], E.prototype, "swatches", 2);
|
|
6369
|
+
X([
|
|
6098
6370
|
c()
|
|
6099
|
-
],
|
|
6100
|
-
|
|
6371
|
+
], E.prototype, "_assetManagerOpen", 2);
|
|
6372
|
+
E = X([
|
|
6101
6373
|
h("pigeon-hero-panel")
|
|
6102
|
-
],
|
|
6103
|
-
var
|
|
6104
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
6374
|
+
], E);
|
|
6375
|
+
var Ci = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, Oe = (e, t, o, r) => {
|
|
6376
|
+
for (var i = r > 1 ? void 0 : r ? Ii(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
6105
6377
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
6106
|
-
return r && i &&
|
|
6378
|
+
return r && i && Ci(t, o, i), i;
|
|
6107
6379
|
};
|
|
6108
6380
|
let Z = class extends d {
|
|
6109
6381
|
constructor() {
|
|
@@ -6243,7 +6515,7 @@ let Z = class extends d {
|
|
|
6243
6515
|
}
|
|
6244
6516
|
};
|
|
6245
6517
|
Z.styles = [
|
|
6246
|
-
|
|
6518
|
+
w,
|
|
6247
6519
|
g`
|
|
6248
6520
|
h4 {
|
|
6249
6521
|
margin: 0 0 8px;
|
|
@@ -6302,25 +6574,25 @@ Z.styles = [
|
|
|
6302
6574
|
}
|
|
6303
6575
|
`
|
|
6304
6576
|
];
|
|
6305
|
-
|
|
6577
|
+
Oe([
|
|
6306
6578
|
p({ type: Object })
|
|
6307
6579
|
], Z.prototype, "block", 2);
|
|
6308
|
-
|
|
6580
|
+
Oe([
|
|
6309
6581
|
p({ type: String })
|
|
6310
6582
|
], Z.prototype, "rowId", 2);
|
|
6311
|
-
|
|
6583
|
+
Oe([
|
|
6312
6584
|
p({ type: String })
|
|
6313
6585
|
], Z.prototype, "columnId", 2);
|
|
6314
|
-
|
|
6586
|
+
Oe([
|
|
6315
6587
|
p({ attribute: !1 })
|
|
6316
6588
|
], Z.prototype, "swatches", 2);
|
|
6317
|
-
Z =
|
|
6589
|
+
Z = Oe([
|
|
6318
6590
|
h("pigeon-navbar-panel")
|
|
6319
6591
|
], Z);
|
|
6320
|
-
var
|
|
6321
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
6592
|
+
var Pi = Object.defineProperty, Ti = Object.getOwnPropertyDescriptor, De = (e, t, o, r) => {
|
|
6593
|
+
for (var i = r > 1 ? void 0 : r ? Ti(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
6322
6594
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
6323
|
-
return r && i &&
|
|
6595
|
+
return r && i && Pi(t, o, i), i;
|
|
6324
6596
|
};
|
|
6325
6597
|
let Q = class extends d {
|
|
6326
6598
|
constructor() {
|
|
@@ -6403,28 +6675,28 @@ let Q = class extends d {
|
|
|
6403
6675
|
this._emit({ padding: e.detail.value });
|
|
6404
6676
|
}
|
|
6405
6677
|
};
|
|
6406
|
-
Q.styles =
|
|
6407
|
-
|
|
6678
|
+
Q.styles = w;
|
|
6679
|
+
De([
|
|
6408
6680
|
p({ type: Object })
|
|
6409
6681
|
], Q.prototype, "block", 2);
|
|
6410
|
-
|
|
6682
|
+
De([
|
|
6411
6683
|
p({ type: String })
|
|
6412
6684
|
], Q.prototype, "rowId", 2);
|
|
6413
|
-
|
|
6685
|
+
De([
|
|
6414
6686
|
p({ type: String })
|
|
6415
6687
|
], Q.prototype, "columnId", 2);
|
|
6416
|
-
|
|
6688
|
+
De([
|
|
6417
6689
|
p({ attribute: !1 })
|
|
6418
6690
|
], Q.prototype, "swatches", 2);
|
|
6419
|
-
Q =
|
|
6691
|
+
Q = De([
|
|
6420
6692
|
h("pigeon-divider-panel")
|
|
6421
6693
|
], Q);
|
|
6422
|
-
var
|
|
6423
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
6694
|
+
var Si = Object.defineProperty, Oi = Object.getOwnPropertyDescriptor, Ke = (e, t, o, r) => {
|
|
6695
|
+
for (var i = r > 1 ? void 0 : r ? Oi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
6424
6696
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
6425
|
-
return r && i &&
|
|
6697
|
+
return r && i && Si(t, o, i), i;
|
|
6426
6698
|
};
|
|
6427
|
-
let
|
|
6699
|
+
let de = class extends d {
|
|
6428
6700
|
constructor() {
|
|
6429
6701
|
super(...arguments), this.rowId = "", this.columnId = "";
|
|
6430
6702
|
}
|
|
@@ -6461,25 +6733,25 @@ let ce = class extends d {
|
|
|
6461
6733
|
this._emit({ height: e.detail.value });
|
|
6462
6734
|
}
|
|
6463
6735
|
};
|
|
6464
|
-
|
|
6465
|
-
|
|
6736
|
+
de.styles = w;
|
|
6737
|
+
Ke([
|
|
6466
6738
|
p({ type: Object })
|
|
6467
|
-
],
|
|
6468
|
-
|
|
6739
|
+
], de.prototype, "block", 2);
|
|
6740
|
+
Ke([
|
|
6469
6741
|
p({ type: String })
|
|
6470
|
-
],
|
|
6471
|
-
|
|
6742
|
+
], de.prototype, "rowId", 2);
|
|
6743
|
+
Ke([
|
|
6472
6744
|
p({ type: String })
|
|
6473
|
-
],
|
|
6474
|
-
|
|
6745
|
+
], de.prototype, "columnId", 2);
|
|
6746
|
+
de = Ke([
|
|
6475
6747
|
h("pigeon-spacer-panel")
|
|
6476
|
-
],
|
|
6477
|
-
var
|
|
6478
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
6748
|
+
], de);
|
|
6749
|
+
var Di = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, We = (e, t, o, r) => {
|
|
6750
|
+
for (var i = r > 1 ? void 0 : r ? Ei(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
6479
6751
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
6480
|
-
return r && i &&
|
|
6752
|
+
return r && i && Di(t, o, i), i;
|
|
6481
6753
|
};
|
|
6482
|
-
const
|
|
6754
|
+
const Bi = [
|
|
6483
6755
|
"facebook",
|
|
6484
6756
|
"twitter",
|
|
6485
6757
|
"instagram",
|
|
@@ -6488,7 +6760,7 @@ const wi = [
|
|
|
6488
6760
|
"tiktok",
|
|
6489
6761
|
"custom"
|
|
6490
6762
|
];
|
|
6491
|
-
let
|
|
6763
|
+
let he = class extends d {
|
|
6492
6764
|
constructor() {
|
|
6493
6765
|
super(...arguments), this.rowId = "", this.columnId = "";
|
|
6494
6766
|
}
|
|
@@ -6508,7 +6780,7 @@ let de = class extends d {
|
|
|
6508
6780
|
<div class="field">
|
|
6509
6781
|
<label>${s("panel.social.network")}</label>
|
|
6510
6782
|
<select @change=${(r) => this._onIconTypeChange(o, r)}>
|
|
6511
|
-
${
|
|
6783
|
+
${Bi.map((r) => l`
|
|
6512
6784
|
<option value=${r} ?selected=${t.type === r}>${r}</option>
|
|
6513
6785
|
`)}
|
|
6514
6786
|
</select>
|
|
@@ -6632,8 +6904,8 @@ let de = class extends d {
|
|
|
6632
6904
|
this._emit({ padding: e.detail.value });
|
|
6633
6905
|
}
|
|
6634
6906
|
};
|
|
6635
|
-
|
|
6636
|
-
|
|
6907
|
+
he.styles = [
|
|
6908
|
+
w,
|
|
6637
6909
|
g`
|
|
6638
6910
|
h4 {
|
|
6639
6911
|
margin: 0 0 8px;
|
|
@@ -6692,26 +6964,26 @@ de.styles = [
|
|
|
6692
6964
|
}
|
|
6693
6965
|
`
|
|
6694
6966
|
];
|
|
6695
|
-
|
|
6967
|
+
We([
|
|
6696
6968
|
p({ type: Object })
|
|
6697
|
-
],
|
|
6698
|
-
|
|
6969
|
+
], he.prototype, "block", 2);
|
|
6970
|
+
We([
|
|
6699
6971
|
p({ type: String })
|
|
6700
|
-
],
|
|
6701
|
-
|
|
6972
|
+
], he.prototype, "rowId", 2);
|
|
6973
|
+
We([
|
|
6702
6974
|
p({ type: String })
|
|
6703
|
-
],
|
|
6704
|
-
|
|
6975
|
+
], he.prototype, "columnId", 2);
|
|
6976
|
+
he = We([
|
|
6705
6977
|
h("pigeon-social-panel")
|
|
6706
|
-
],
|
|
6707
|
-
var
|
|
6708
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
6978
|
+
], he);
|
|
6979
|
+
var ji = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, N = (e, t, o, r) => {
|
|
6980
|
+
for (var i = r > 1 ? void 0 : r ? Ri(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
6709
6981
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
6710
|
-
return r && i &&
|
|
6982
|
+
return r && i && ji(t, o, i), i;
|
|
6711
6983
|
};
|
|
6712
|
-
let
|
|
6984
|
+
let O = class extends d {
|
|
6713
6985
|
constructor() {
|
|
6714
|
-
super(...arguments), this.rowId = "", this.columnId = "", this.mergeTags = [], this.requestMergeTags = !1, this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._textareaRef =
|
|
6986
|
+
super(...arguments), this.rowId = "", this.columnId = "", this.mergeTags = [], this.requestMergeTags = !1, this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._textareaRef = re(), this._triggerRef = re();
|
|
6715
6987
|
}
|
|
6716
6988
|
render() {
|
|
6717
6989
|
if (!this.block) return l``;
|
|
@@ -6723,13 +6995,13 @@ let T = class extends d {
|
|
|
6723
6995
|
<div class="label-row">
|
|
6724
6996
|
<label>${s("panel.html.rawHtml")}</label>
|
|
6725
6997
|
${t || this.requestMergeTags ? l`
|
|
6726
|
-
<button class="tag-btn" ${
|
|
6998
|
+
<button class="tag-btn" ${ne(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
|
|
6727
6999
|
${s("panel.common.tagBtn")}
|
|
6728
7000
|
</button>
|
|
6729
7001
|
` : ""}
|
|
6730
7002
|
</div>
|
|
6731
7003
|
<textarea
|
|
6732
|
-
${
|
|
7004
|
+
${ne(this._textareaRef)}
|
|
6733
7005
|
.value=${e.content}
|
|
6734
7006
|
@change=${this._onContentChange}
|
|
6735
7007
|
></textarea>
|
|
@@ -6793,8 +7065,8 @@ let T = class extends d {
|
|
|
6793
7065
|
t.setSelectionRange(u, u), t.focus(), this._emit({ content: a }), this._pickerOpen = !1;
|
|
6794
7066
|
}
|
|
6795
7067
|
};
|
|
6796
|
-
|
|
6797
|
-
|
|
7068
|
+
O.styles = [
|
|
7069
|
+
w,
|
|
6798
7070
|
g`
|
|
6799
7071
|
/* HTML payload is raw markup — show in monospace and taller than the
|
|
6800
7072
|
default textarea so authors have room to work. */
|
|
@@ -6838,39 +7110,39 @@ T.styles = [
|
|
|
6838
7110
|
}
|
|
6839
7111
|
`
|
|
6840
7112
|
];
|
|
6841
|
-
|
|
7113
|
+
N([
|
|
6842
7114
|
p({ type: Object })
|
|
6843
|
-
],
|
|
6844
|
-
|
|
7115
|
+
], O.prototype, "block", 2);
|
|
7116
|
+
N([
|
|
6845
7117
|
p({ type: String })
|
|
6846
|
-
],
|
|
6847
|
-
|
|
7118
|
+
], O.prototype, "rowId", 2);
|
|
7119
|
+
N([
|
|
6848
7120
|
p({ type: String })
|
|
6849
|
-
],
|
|
6850
|
-
|
|
7121
|
+
], O.prototype, "columnId", 2);
|
|
7122
|
+
N([
|
|
6851
7123
|
p({ type: Array })
|
|
6852
|
-
],
|
|
6853
|
-
|
|
7124
|
+
], O.prototype, "mergeTags", 2);
|
|
7125
|
+
N([
|
|
6854
7126
|
p({ attribute: !1 })
|
|
6855
|
-
],
|
|
6856
|
-
|
|
7127
|
+
], O.prototype, "requestMergeTags", 2);
|
|
7128
|
+
N([
|
|
6857
7129
|
c()
|
|
6858
|
-
],
|
|
6859
|
-
|
|
7130
|
+
], O.prototype, "_pickerOpen", 2);
|
|
7131
|
+
N([
|
|
6860
7132
|
c()
|
|
6861
|
-
],
|
|
6862
|
-
|
|
7133
|
+
], O.prototype, "_pickerX", 2);
|
|
7134
|
+
N([
|
|
6863
7135
|
c()
|
|
6864
|
-
],
|
|
6865
|
-
|
|
7136
|
+
], O.prototype, "_pickerY", 2);
|
|
7137
|
+
O = N([
|
|
6866
7138
|
h("pigeon-html-panel")
|
|
6867
|
-
],
|
|
6868
|
-
var
|
|
6869
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
7139
|
+
], O);
|
|
7140
|
+
var Li = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, fe = (e, t, o, r) => {
|
|
7141
|
+
for (var i = r > 1 ? void 0 : r ? zi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
6870
7142
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
6871
|
-
return r && i &&
|
|
7143
|
+
return r && i && Li(t, o, i), i;
|
|
6872
7144
|
};
|
|
6873
|
-
let
|
|
7145
|
+
let Y = class extends d {
|
|
6874
7146
|
constructor() {
|
|
6875
7147
|
super(...arguments), this.rowId = "", this.columnId = "", this.label = "Block", this.schema = [];
|
|
6876
7148
|
}
|
|
@@ -6980,31 +7252,106 @@ let W = class extends d {
|
|
|
6980
7252
|
);
|
|
6981
7253
|
}
|
|
6982
7254
|
};
|
|
6983
|
-
|
|
6984
|
-
|
|
7255
|
+
Y.styles = w;
|
|
7256
|
+
fe([
|
|
6985
7257
|
p({ type: Object })
|
|
6986
|
-
],
|
|
6987
|
-
|
|
7258
|
+
], Y.prototype, "block", 2);
|
|
7259
|
+
fe([
|
|
6988
7260
|
p({ type: String })
|
|
6989
|
-
],
|
|
6990
|
-
|
|
7261
|
+
], Y.prototype, "rowId", 2);
|
|
7262
|
+
fe([
|
|
6991
7263
|
p({ type: String })
|
|
6992
|
-
],
|
|
6993
|
-
|
|
7264
|
+
], Y.prototype, "columnId", 2);
|
|
7265
|
+
fe([
|
|
6994
7266
|
p({ type: String })
|
|
6995
|
-
],
|
|
6996
|
-
|
|
7267
|
+
], Y.prototype, "label", 2);
|
|
7268
|
+
fe([
|
|
6997
7269
|
p({ type: Array })
|
|
6998
|
-
],
|
|
6999
|
-
|
|
7270
|
+
], Y.prototype, "schema", 2);
|
|
7271
|
+
Y = fe([
|
|
7000
7272
|
h("pigeon-custom-panel")
|
|
7001
|
-
],
|
|
7002
|
-
var
|
|
7003
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
7273
|
+
], Y);
|
|
7274
|
+
var Mi = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, qe = (e, t, o, r) => {
|
|
7275
|
+
for (var i = r > 1 ? void 0 : r ? Ai(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
7004
7276
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
7005
|
-
return r && i &&
|
|
7277
|
+
return r && i && Mi(t, o, i), i;
|
|
7006
7278
|
};
|
|
7007
|
-
let
|
|
7279
|
+
let ge = class extends d {
|
|
7280
|
+
constructor() {
|
|
7281
|
+
super(...arguments), this.rowId = "", this.columnId = "";
|
|
7282
|
+
}
|
|
7283
|
+
render() {
|
|
7284
|
+
if (!this.block) return l``;
|
|
7285
|
+
const e = this.block.values.condition;
|
|
7286
|
+
return l`
|
|
7287
|
+
<div class="field">
|
|
7288
|
+
<label for="block-condition">${s("panel.common.displayCondition")}</label>
|
|
7289
|
+
<input
|
|
7290
|
+
id="block-condition"
|
|
7291
|
+
type="text"
|
|
7292
|
+
.value=${typeof e == "string" ? e : ""}
|
|
7293
|
+
placeholder="e.g. user.premium"
|
|
7294
|
+
@change=${this._onChange}
|
|
7295
|
+
/>
|
|
7296
|
+
<p class="hint">
|
|
7297
|
+
Show this block only when the expression is truthy. Exported as
|
|
7298
|
+
<code>{{#if …}}</code> for your sending platform.
|
|
7299
|
+
</p>
|
|
7300
|
+
</div>
|
|
7301
|
+
`;
|
|
7302
|
+
}
|
|
7303
|
+
_onChange(e) {
|
|
7304
|
+
const t = e.target.value.trim();
|
|
7305
|
+
this.dispatchEvent(new CustomEvent("property-change", {
|
|
7306
|
+
detail: {
|
|
7307
|
+
rowId: this.rowId,
|
|
7308
|
+
columnId: this.columnId,
|
|
7309
|
+
blockId: this.block.id,
|
|
7310
|
+
values: { condition: t || void 0 }
|
|
7311
|
+
},
|
|
7312
|
+
bubbles: !0,
|
|
7313
|
+
composed: !0
|
|
7314
|
+
}));
|
|
7315
|
+
}
|
|
7316
|
+
};
|
|
7317
|
+
ge.styles = [
|
|
7318
|
+
w,
|
|
7319
|
+
g`
|
|
7320
|
+
.hint {
|
|
7321
|
+
margin: 4px 0 0;
|
|
7322
|
+
font-size: 11px;
|
|
7323
|
+
line-height: 1.4;
|
|
7324
|
+
color: var(--pigeon-muted-foreground, #64748b);
|
|
7325
|
+
font-family: var(--pigeon-font);
|
|
7326
|
+
}
|
|
7327
|
+
|
|
7328
|
+
.hint code {
|
|
7329
|
+
font-family: var(--pigeon-font-mono);
|
|
7330
|
+
font-size: 10px;
|
|
7331
|
+
background: var(--pigeon-muted, #f1f5f9);
|
|
7332
|
+
padding: 1px 4px;
|
|
7333
|
+
border-radius: 3px;
|
|
7334
|
+
}
|
|
7335
|
+
`
|
|
7336
|
+
];
|
|
7337
|
+
qe([
|
|
7338
|
+
p({ type: Object })
|
|
7339
|
+
], ge.prototype, "block", 2);
|
|
7340
|
+
qe([
|
|
7341
|
+
p({ type: String })
|
|
7342
|
+
], ge.prototype, "rowId", 2);
|
|
7343
|
+
qe([
|
|
7344
|
+
p({ type: String })
|
|
7345
|
+
], ge.prototype, "columnId", 2);
|
|
7346
|
+
ge = qe([
|
|
7347
|
+
h("pigeon-block-condition")
|
|
7348
|
+
], ge);
|
|
7349
|
+
var Fi = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, z = (e, t, o, r) => {
|
|
7350
|
+
for (var i = r > 1 ? void 0 : r ? Hi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
7351
|
+
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
7352
|
+
return r && i && Fi(t, o, i), i;
|
|
7353
|
+
};
|
|
7354
|
+
let P = class extends d {
|
|
7008
7355
|
constructor() {
|
|
7009
7356
|
super(...arguments), this.selection = null, this.mergeTags = [], this.requestMergeTags = !1, this.brandKit = null, this.fontConfig = [], this.linkTypes = [];
|
|
7010
7357
|
}
|
|
@@ -7018,6 +7365,7 @@ let w = class extends d {
|
|
|
7018
7365
|
return e.filter((r) => t.has(r.family) ? !1 : (t.add(r.family), !0));
|
|
7019
7366
|
}
|
|
7020
7367
|
render() {
|
|
7368
|
+
var e;
|
|
7021
7369
|
if (!this.doc) return l``;
|
|
7022
7370
|
if (!this.selection || this.selection.type === "body")
|
|
7023
7371
|
return l`
|
|
@@ -7032,32 +7380,63 @@ let w = class extends d {
|
|
|
7032
7380
|
</div>
|
|
7033
7381
|
`;
|
|
7034
7382
|
if (this.selection.type === "row" && this.selection.rowId) {
|
|
7035
|
-
const
|
|
7036
|
-
if (
|
|
7383
|
+
const t = this._findRow(this.selection.rowId);
|
|
7384
|
+
if (t)
|
|
7037
7385
|
return l`
|
|
7038
7386
|
<div class="panel-wrapper" part="panel">
|
|
7039
|
-
|
|
7387
|
+
${this._lockGuard(
|
|
7388
|
+
t.id,
|
|
7389
|
+
l`<pigeon-row-panel .row=${t}></pigeon-row-panel>
|
|
7390
|
+
${this._renderVisibility(
|
|
7391
|
+
t.attributes,
|
|
7392
|
+
(o) => this._emit("row-property-change", { rowId: t.id, attributes: o })
|
|
7393
|
+
)}`
|
|
7394
|
+
)}
|
|
7040
7395
|
</div>
|
|
7041
7396
|
`;
|
|
7042
7397
|
}
|
|
7043
7398
|
if (this.selection.type === "block" && this.selection.rowId && this.selection.columnId && this.selection.blockId) {
|
|
7044
|
-
const
|
|
7045
|
-
if (
|
|
7399
|
+
const t = this._findBlock(this.selection.rowId, this.selection.columnId, this.selection.blockId);
|
|
7400
|
+
if (t)
|
|
7046
7401
|
return l`
|
|
7047
7402
|
<div class="panel-wrapper" part="panel">
|
|
7048
|
-
${this._renderBreadcrumb(this.selection.rowId, this.selection.columnId, this._blockLabel(
|
|
7049
|
-
${this.
|
|
7403
|
+
${this._renderBreadcrumb(this.selection.rowId, this.selection.columnId, this._blockLabel(t))}
|
|
7404
|
+
${this._lockGuard(
|
|
7405
|
+
this.selection.rowId,
|
|
7406
|
+
l`${this._renderBlockPanel(t, this.selection.rowId, this.selection.columnId)}
|
|
7407
|
+
<pigeon-block-condition .block=${t} .rowId=${this.selection.rowId} .columnId=${this.selection.columnId}></pigeon-block-condition>
|
|
7408
|
+
${this._renderVisibility(
|
|
7409
|
+
t.values,
|
|
7410
|
+
(o) => this._emit("property-change", {
|
|
7411
|
+
rowId: this.selection.rowId,
|
|
7412
|
+
columnId: this.selection.columnId,
|
|
7413
|
+
blockId: t.id,
|
|
7414
|
+
values: o
|
|
7415
|
+
})
|
|
7416
|
+
)}`
|
|
7417
|
+
)}
|
|
7050
7418
|
</div>
|
|
7051
7419
|
`;
|
|
7052
7420
|
}
|
|
7053
|
-
|
|
7421
|
+
if (this.selection.type === "column") {
|
|
7422
|
+
const { rowId: t, columnId: o } = this.selection, r = (e = this._findRow(t ?? "")) == null ? void 0 : e.columns.find((i) => i.id === o);
|
|
7423
|
+
return l`
|
|
7054
7424
|
<div class="panel-wrapper" part="panel">
|
|
7055
|
-
${
|
|
7425
|
+
${t && o ? this._renderBreadcrumb(t, o) : ""}
|
|
7056
7426
|
<div class="empty-state">
|
|
7057
7427
|
<p>Column selected. Select a block within the column to edit its properties.</p>
|
|
7058
7428
|
</div>
|
|
7429
|
+
${r && t ? this._lockGuard(
|
|
7430
|
+
t,
|
|
7431
|
+
this._renderVisibility(
|
|
7432
|
+
r.attributes,
|
|
7433
|
+
(i) => this._emit("column-property-change", { rowId: t, columnId: o, attributes: i })
|
|
7434
|
+
)
|
|
7435
|
+
) : ""}
|
|
7059
7436
|
</div>
|
|
7060
|
-
|
|
7437
|
+
`;
|
|
7438
|
+
}
|
|
7439
|
+
return l`
|
|
7061
7440
|
<div class="panel-wrapper" part="panel">
|
|
7062
7441
|
<div class="empty-state">
|
|
7063
7442
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
@@ -7095,9 +7474,39 @@ let w = class extends d {
|
|
|
7095
7474
|
</nav>
|
|
7096
7475
|
`;
|
|
7097
7476
|
}
|
|
7477
|
+
/** A locked row's panels stay readable but inert, with a note saying why. */
|
|
7478
|
+
_lockGuard(e, t) {
|
|
7479
|
+
var o;
|
|
7480
|
+
return (o = this._findRow(e)) != null && o.locked ? l`
|
|
7481
|
+
<p class="locked-note" role="note">This row is locked, so it can't be moved, deleted or edited.</p>
|
|
7482
|
+
<div class="locked" inert>${t}</div>
|
|
7483
|
+
` : t;
|
|
7484
|
+
}
|
|
7098
7485
|
_select(e, t) {
|
|
7486
|
+
this._emit(e, t);
|
|
7487
|
+
}
|
|
7488
|
+
_emit(e, t) {
|
|
7099
7489
|
this.dispatchEvent(new CustomEvent(e, { detail: t, bubbles: !0, composed: !0 }));
|
|
7100
7490
|
}
|
|
7491
|
+
/** Hide-on-mobile / hide-on-desktop toggles shared by every block and column. */
|
|
7492
|
+
_renderVisibility(e, t) {
|
|
7493
|
+
const o = (r, i) => l`
|
|
7494
|
+
<label>
|
|
7495
|
+
<input
|
|
7496
|
+
type="checkbox"
|
|
7497
|
+
.checked=${!!e[r]}
|
|
7498
|
+
@change=${(n) => t({ [r]: n.target.checked })}
|
|
7499
|
+
/>
|
|
7500
|
+
${i}
|
|
7501
|
+
</label>
|
|
7502
|
+
`;
|
|
7503
|
+
return l`
|
|
7504
|
+
<fieldset class="visibility">
|
|
7505
|
+
<legend>Visibility</legend>
|
|
7506
|
+
${o("hideOnMobile", "Hide on mobile")} ${o("hideOnDesktop", "Hide on desktop")}
|
|
7507
|
+
</fieldset>
|
|
7508
|
+
`;
|
|
7509
|
+
}
|
|
7101
7510
|
_blockLabel(e) {
|
|
7102
7511
|
var r;
|
|
7103
7512
|
const t = {
|
|
@@ -7111,7 +7520,7 @@ let w = class extends d {
|
|
|
7111
7520
|
hero: "Hero",
|
|
7112
7521
|
navbar: "Navbar"
|
|
7113
7522
|
}, o = e.type;
|
|
7114
|
-
return t[o] ?? ((r =
|
|
7523
|
+
return t[o] ?? ((r = et(o)) == null ? void 0 : r.label) ?? o;
|
|
7115
7524
|
}
|
|
7116
7525
|
_renderBlockPanel(e, t, o) {
|
|
7117
7526
|
switch (e.type) {
|
|
@@ -7147,7 +7556,7 @@ let w = class extends d {
|
|
|
7147
7556
|
case "html":
|
|
7148
7557
|
return l`<pigeon-html-panel .block=${e} .rowId=${t} .columnId=${o} .mergeTags=${this.mergeTags} .requestMergeTags=${this.requestMergeTags}></pigeon-html-panel>`;
|
|
7149
7558
|
default: {
|
|
7150
|
-
const r = e.type ?? "unknown", i =
|
|
7559
|
+
const r = e.type ?? "unknown", i = et(r);
|
|
7151
7560
|
return i != null && i.propertySchema && i.propertySchema.length > 0 ? l`<pigeon-custom-panel
|
|
7152
7561
|
.block=${e}
|
|
7153
7562
|
.rowId=${t}
|
|
@@ -7176,7 +7585,7 @@ let w = class extends d {
|
|
|
7176
7585
|
return i.blocks.find((n) => n.id === o);
|
|
7177
7586
|
}
|
|
7178
7587
|
};
|
|
7179
|
-
|
|
7588
|
+
P.styles = g`
|
|
7180
7589
|
:host {
|
|
7181
7590
|
display: block;
|
|
7182
7591
|
width: var(--pigeon-properties-width, 300px);
|
|
@@ -7234,6 +7643,46 @@ w.styles = g`
|
|
|
7234
7643
|
font-size: 10px;
|
|
7235
7644
|
}
|
|
7236
7645
|
|
|
7646
|
+
.visibility {
|
|
7647
|
+
display: flex;
|
|
7648
|
+
flex-direction: column;
|
|
7649
|
+
gap: 6px;
|
|
7650
|
+
margin: 16px 0 0;
|
|
7651
|
+
padding: 12px 0 0;
|
|
7652
|
+
border: none;
|
|
7653
|
+
border-top: 1px solid var(--pigeon-border, #e2e8f0);
|
|
7654
|
+
font-family: var(--pigeon-font);
|
|
7655
|
+
font-size: 12px;
|
|
7656
|
+
color: var(--pigeon-text, #1e293b);
|
|
7657
|
+
}
|
|
7658
|
+
|
|
7659
|
+
.visibility legend {
|
|
7660
|
+
float: left;
|
|
7661
|
+
margin-bottom: 4px;
|
|
7662
|
+
padding: 0;
|
|
7663
|
+
font-weight: 600;
|
|
7664
|
+
}
|
|
7665
|
+
|
|
7666
|
+
.visibility label {
|
|
7667
|
+
display: flex;
|
|
7668
|
+
align-items: center;
|
|
7669
|
+
gap: 6px;
|
|
7670
|
+
}
|
|
7671
|
+
|
|
7672
|
+
.locked-note {
|
|
7673
|
+
margin: 0 0 12px;
|
|
7674
|
+
padding: 8px 10px;
|
|
7675
|
+
border-radius: var(--pigeon-radius-sm, 4px);
|
|
7676
|
+
background: var(--pigeon-surface, #f8fafc);
|
|
7677
|
+
color: var(--pigeon-text-secondary, #64748b);
|
|
7678
|
+
font-family: var(--pigeon-font);
|
|
7679
|
+
font-size: 12px;
|
|
7680
|
+
}
|
|
7681
|
+
|
|
7682
|
+
.locked {
|
|
7683
|
+
opacity: 0.6;
|
|
7684
|
+
}
|
|
7685
|
+
|
|
7237
7686
|
.empty-state {
|
|
7238
7687
|
display: flex;
|
|
7239
7688
|
flex-direction: column;
|
|
@@ -7259,40 +7708,40 @@ w.styles = g`
|
|
|
7259
7708
|
line-height: 1.5;
|
|
7260
7709
|
}
|
|
7261
7710
|
`;
|
|
7262
|
-
|
|
7711
|
+
z([
|
|
7263
7712
|
p({ type: Object })
|
|
7264
|
-
],
|
|
7265
|
-
|
|
7713
|
+
], P.prototype, "doc", 2);
|
|
7714
|
+
z([
|
|
7266
7715
|
p({ type: Object })
|
|
7267
|
-
],
|
|
7268
|
-
|
|
7716
|
+
], P.prototype, "selection", 2);
|
|
7717
|
+
z([
|
|
7269
7718
|
p({ type: Array })
|
|
7270
|
-
],
|
|
7271
|
-
|
|
7719
|
+
], P.prototype, "mergeTags", 2);
|
|
7720
|
+
z([
|
|
7272
7721
|
p({ attribute: !1 })
|
|
7273
|
-
],
|
|
7274
|
-
|
|
7722
|
+
], P.prototype, "requestMergeTags", 2);
|
|
7723
|
+
z([
|
|
7275
7724
|
p({ attribute: !1 })
|
|
7276
|
-
],
|
|
7277
|
-
|
|
7725
|
+
], P.prototype, "assetManagerConfig", 2);
|
|
7726
|
+
z([
|
|
7278
7727
|
p({ attribute: !1 })
|
|
7279
|
-
],
|
|
7280
|
-
|
|
7728
|
+
], P.prototype, "assetStorage", 2);
|
|
7729
|
+
z([
|
|
7281
7730
|
p({ attribute: !1 })
|
|
7282
|
-
],
|
|
7283
|
-
|
|
7731
|
+
], P.prototype, "brandKit", 2);
|
|
7732
|
+
z([
|
|
7284
7733
|
p({ attribute: !1 })
|
|
7285
|
-
],
|
|
7286
|
-
|
|
7734
|
+
], P.prototype, "fontConfig", 2);
|
|
7735
|
+
z([
|
|
7287
7736
|
p({ attribute: !1 })
|
|
7288
|
-
],
|
|
7289
|
-
|
|
7737
|
+
], P.prototype, "linkTypes", 2);
|
|
7738
|
+
P = z([
|
|
7290
7739
|
h("pigeon-properties")
|
|
7291
|
-
],
|
|
7292
|
-
var
|
|
7293
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
7740
|
+
], P);
|
|
7741
|
+
var Ui = Object.defineProperty, Ni = Object.getOwnPropertyDescriptor, D = (e, t, o, r) => {
|
|
7742
|
+
for (var i = r > 1 ? void 0 : r ? Ni(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
7294
7743
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
7295
|
-
return r && i &&
|
|
7744
|
+
return r && i && Ui(t, o, i), i;
|
|
7296
7745
|
};
|
|
7297
7746
|
let x = class extends d {
|
|
7298
7747
|
constructor() {
|
|
@@ -7378,13 +7827,13 @@ let x = class extends d {
|
|
|
7378
7827
|
_renderContent() {
|
|
7379
7828
|
switch (this._viewMode) {
|
|
7380
7829
|
case "preview":
|
|
7381
|
-
return l`
|
|
7830
|
+
return ro(this._htmlContent, l`
|
|
7382
7831
|
<iframe
|
|
7383
7832
|
style="width: ${this._device === "mobile" ? "375px" : "100%"}; height: 100%;"
|
|
7384
7833
|
sandbox="allow-popups allow-popups-to-escape-sandbox"
|
|
7385
7834
|
srcdoc=${this._htmlContent}
|
|
7386
7835
|
></iframe>
|
|
7387
|
-
|
|
7836
|
+
`);
|
|
7388
7837
|
case "html":
|
|
7389
7838
|
return l`<div class="source-view">${this._htmlContent}</div>`;
|
|
7390
7839
|
case "mjml":
|
|
@@ -7409,7 +7858,7 @@ let x = class extends d {
|
|
|
7409
7858
|
this._viewMode = e;
|
|
7410
7859
|
}
|
|
7411
7860
|
_close() {
|
|
7412
|
-
this.open = !1;
|
|
7861
|
+
this.open = !1, this.dispatchEvent(new CustomEvent("preview-close", { bubbles: !0, composed: !0 }));
|
|
7413
7862
|
}
|
|
7414
7863
|
};
|
|
7415
7864
|
x.styles = g`
|
|
@@ -7589,54 +8038,54 @@ x.styles = g`
|
|
|
7589
8038
|
font-size: 14px;
|
|
7590
8039
|
}
|
|
7591
8040
|
`;
|
|
7592
|
-
|
|
8041
|
+
D([
|
|
7593
8042
|
p({ type: Object })
|
|
7594
8043
|
], x.prototype, "renderer", 2);
|
|
7595
|
-
|
|
8044
|
+
D([
|
|
7596
8045
|
p({ type: Object })
|
|
7597
8046
|
], x.prototype, "doc", 2);
|
|
7598
|
-
|
|
8047
|
+
D([
|
|
7599
8048
|
p({ attribute: !1 })
|
|
7600
8049
|
], x.prototype, "documentToMjml", 2);
|
|
7601
|
-
|
|
8050
|
+
D([
|
|
7602
8051
|
p({ attribute: !1 })
|
|
7603
8052
|
], x.prototype, "fonts", 2);
|
|
7604
|
-
|
|
8053
|
+
D([
|
|
7605
8054
|
p({ type: Boolean, reflect: !0 })
|
|
7606
8055
|
], x.prototype, "open", 2);
|
|
7607
|
-
|
|
8056
|
+
D([
|
|
7608
8057
|
c()
|
|
7609
8058
|
], x.prototype, "_viewMode", 2);
|
|
7610
|
-
|
|
8059
|
+
D([
|
|
7611
8060
|
c()
|
|
7612
8061
|
], x.prototype, "_device", 2);
|
|
7613
|
-
|
|
8062
|
+
D([
|
|
7614
8063
|
c()
|
|
7615
8064
|
], x.prototype, "_htmlContent", 2);
|
|
7616
|
-
|
|
8065
|
+
D([
|
|
7617
8066
|
c()
|
|
7618
8067
|
], x.prototype, "_mjmlContent", 2);
|
|
7619
|
-
|
|
8068
|
+
D([
|
|
7620
8069
|
c()
|
|
7621
8070
|
], x.prototype, "_loading", 2);
|
|
7622
|
-
x =
|
|
8071
|
+
x = D([
|
|
7623
8072
|
h("pigeon-preview")
|
|
7624
8073
|
], x);
|
|
7625
|
-
var
|
|
7626
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
8074
|
+
var Ki = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, f = (e, t, o, r) => {
|
|
8075
|
+
for (var i = r > 1 ? void 0 : r ? Wi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
|
|
7627
8076
|
(a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
|
|
7628
|
-
return r && i &&
|
|
8077
|
+
return r && i && Ki(t, o, i), i;
|
|
7629
8078
|
};
|
|
7630
|
-
let
|
|
7631
|
-
function
|
|
7632
|
-
return
|
|
8079
|
+
let Qe = null;
|
|
8080
|
+
function qi() {
|
|
8081
|
+
return Qe || (Qe = import("./templates.js")), Qe;
|
|
7633
8082
|
}
|
|
7634
|
-
function
|
|
8083
|
+
function St(e) {
|
|
7635
8084
|
return e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || `template-${Date.now()}`;
|
|
7636
8085
|
}
|
|
7637
8086
|
let v = class extends d {
|
|
7638
8087
|
constructor() {
|
|
7639
|
-
super(...arguments), this.theme = "light", this.themeOverrides = {}, this.config = {}, this._canUndo = !1, this._canRedo = !1, this._device = "desktop", this._fullscreen = !1, this._previewOpen = !1, this._templatePickerOpen = !1, this._templatePickerLoaded = !1, this._editingBlockId = null, this._clipboard = null, this._activeBrandKit = null, this._brandKitStorage = null, this._handleBrandKitEdit = async (e) => {
|
|
8088
|
+
super(...arguments), this.theme = "light", this.themeOverrides = {}, this.config = {}, this.readonly = !1, this._canUndo = !1, this._canRedo = !1, this._device = "desktop", this._fullscreen = !1, this._previewOpen = !1, this._templatePickerOpen = !1, this._templatePickerLoaded = !1, this._editingBlockId = null, this._clipboard = null, this._activeBrandKit = null, this._brandKitStorage = null, this._handleBrandKitEdit = async (e) => {
|
|
7640
8089
|
e.stopPropagation();
|
|
7641
8090
|
const t = e.detail.kit;
|
|
7642
8091
|
if (this._activeBrandKit = t, this.dispatchEvent(
|
|
@@ -7656,7 +8105,7 @@ let v = class extends d {
|
|
|
7656
8105
|
const t = e.detail.value, o = this._state.selection;
|
|
7657
8106
|
if ((o == null ? void 0 : o.type) === "block" && o.rowId && o.columnId && o.blockId) {
|
|
7658
8107
|
const r = this._findBlock(o.rowId, o.columnId, o.blockId);
|
|
7659
|
-
(r == null ? void 0 : r.type) === "button" &&
|
|
8108
|
+
(r == null ? void 0 : r.type) === "button" && Ve(o.rowId, o.columnId, o.blockId, { backgroundColor: t })(this._state, this._dispatch);
|
|
7660
8109
|
return;
|
|
7661
8110
|
}
|
|
7662
8111
|
this._applyBodyAttribute("backgroundColor", t);
|
|
@@ -7664,30 +8113,30 @@ let v = class extends d {
|
|
|
7664
8113
|
e.stopPropagation(), this._applyBodyAttribute("fontFamily", e.detail.family);
|
|
7665
8114
|
}, this._handleBrandLogoInsert = (e) => {
|
|
7666
8115
|
e.stopPropagation();
|
|
7667
|
-
const { logo: t } = e.detail, o =
|
|
8116
|
+
const { logo: t } = e.detail, o = Be("image");
|
|
7668
8117
|
o.values.src = t.src, o.values.alt = t.name, t.width && (o.values.width = t.width);
|
|
7669
8118
|
const r = this._state.selection;
|
|
7670
8119
|
if (r != null && r.rowId && (r != null && r.columnId)) {
|
|
7671
|
-
|
|
8120
|
+
ie(r.rowId, r.columnId, o)(this._state, this._dispatch);
|
|
7672
8121
|
return;
|
|
7673
8122
|
}
|
|
7674
8123
|
const i = this._state.doc.body.rows;
|
|
7675
8124
|
if (i.length > 0) {
|
|
7676
8125
|
const n = i[i.length - 1], a = n.columns[0];
|
|
7677
|
-
|
|
8126
|
+
ie(n.id, a.id, o, a.blocks.length)(this._state, this._dispatch);
|
|
7678
8127
|
} else {
|
|
7679
|
-
const n =
|
|
7680
|
-
|
|
8128
|
+
const n = me([o]);
|
|
8129
|
+
J(ye([n]), 0)(this._state, this._dispatch);
|
|
7681
8130
|
}
|
|
7682
8131
|
}, this._dispatch = (e) => {
|
|
7683
|
-
this._state = this._state.apply(e), this._syncHistoryFlags(), this.requestUpdate(), this._fireChange(), this._fireSelect();
|
|
8132
|
+
this.readonly && e.steps.length || (this._state = this._state.apply(e), this._syncHistoryFlags(), this.requestUpdate(), this._fireChange(), this._fireSelect());
|
|
7684
8133
|
}, this._handleRowSave = async (e) => {
|
|
7685
8134
|
const t = this._state.doc.body.rows.find((n) => n.id === e.detail.rowId);
|
|
7686
8135
|
if (!t) return;
|
|
7687
8136
|
const o = window.prompt("Name this saved row");
|
|
7688
8137
|
if (!o || !o.trim()) return;
|
|
7689
8138
|
const r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
7690
|
-
id:
|
|
8139
|
+
id: St(o),
|
|
7691
8140
|
name: o.trim(),
|
|
7692
8141
|
kind: "row",
|
|
7693
8142
|
node: structuredClone(t),
|
|
@@ -7700,11 +8149,11 @@ let v = class extends d {
|
|
|
7700
8149
|
this._emitRowLibraryError(n, "save");
|
|
7701
8150
|
}
|
|
7702
8151
|
}, this._handleRowInsertSaved = (e) => {
|
|
7703
|
-
const t =
|
|
7704
|
-
|
|
8152
|
+
const t = ft(e.detail.node);
|
|
8153
|
+
J(t, e.detail.index)(this._state, this._dispatch);
|
|
7705
8154
|
}, this._handleLibraryInsert = (e) => {
|
|
7706
|
-
const t =
|
|
7707
|
-
|
|
8155
|
+
const t = ft(e.detail.node);
|
|
8156
|
+
J(t, this._state.doc.body.rows.length)(this._state, this._dispatch);
|
|
7708
8157
|
}, this._handleLibraryDelete = async (e) => {
|
|
7709
8158
|
try {
|
|
7710
8159
|
await this._resolveRowLibrary().delete(e.detail.id), await this._refreshSavedTab();
|
|
@@ -7724,16 +8173,16 @@ let v = class extends d {
|
|
|
7724
8173
|
}
|
|
7725
8174
|
if (e.key === "Escape") {
|
|
7726
8175
|
const r = this._state.createTransaction();
|
|
7727
|
-
r.setSelection(
|
|
8176
|
+
r.setSelection(mt()), this._dispatch(r);
|
|
7728
8177
|
return;
|
|
7729
8178
|
}
|
|
7730
8179
|
if (o) {
|
|
7731
8180
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
7732
|
-
o.type === "block" && o.rowId && o.columnId && o.blockId ? (e.preventDefault(),
|
|
8181
|
+
o.type === "block" && o.rowId && o.columnId && o.blockId ? (e.preventDefault(), At(o.rowId, o.columnId, o.blockId)(this._state, this._dispatch)) : o.type === "row" && o.rowId && (e.preventDefault(), yt(o.rowId)(this._state, this._dispatch));
|
|
7733
8182
|
return;
|
|
7734
8183
|
}
|
|
7735
8184
|
if (t && e.key.toLowerCase() === "d") {
|
|
7736
|
-
o.type === "block" && o.rowId && o.columnId && o.blockId ? (e.preventDefault(),
|
|
8185
|
+
o.type === "block" && o.rowId && o.columnId && o.blockId ? (e.preventDefault(), Ft(o.rowId, o.columnId, o.blockId)(this._state, this._dispatch)) : o.type === "row" && o.rowId && (e.preventDefault(), _t(o.rowId)(this._state, this._dispatch));
|
|
7737
8186
|
return;
|
|
7738
8187
|
}
|
|
7739
8188
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
@@ -7753,13 +8202,13 @@ let v = class extends d {
|
|
|
7753
8202
|
if (o.type === "block" && o.rowId && o.columnId && o.blockId) {
|
|
7754
8203
|
e.preventDefault();
|
|
7755
8204
|
const r = structuredClone(this._clipboard);
|
|
7756
|
-
r.id =
|
|
8205
|
+
r.id = xt();
|
|
7757
8206
|
const i = this._findBlockIndex(o.rowId, o.columnId, o.blockId), n = i >= 0 ? i + 1 : void 0;
|
|
7758
|
-
|
|
8207
|
+
ie(o.rowId, o.columnId, r, n)(this._state, this._dispatch);
|
|
7759
8208
|
} else if (o.type === "column" && o.rowId && o.columnId) {
|
|
7760
8209
|
e.preventDefault();
|
|
7761
8210
|
const r = structuredClone(this._clipboard);
|
|
7762
|
-
r.id =
|
|
8211
|
+
r.id = xt(), ie(o.rowId, o.columnId, r)(this._state, this._dispatch);
|
|
7763
8212
|
}
|
|
7764
8213
|
return;
|
|
7765
8214
|
}
|
|
@@ -7770,13 +8219,13 @@ let v = class extends d {
|
|
|
7770
8219
|
/* Lifecycle */
|
|
7771
8220
|
/* ------------------------------------------------------------------ */
|
|
7772
8221
|
connectedCallback() {
|
|
7773
|
-
super.connectedCallback(),
|
|
8222
|
+
super.connectedCallback(), bt(this.config.locale, this.config.messages), wt(this.config.blocks), this._state || this._initState(), this._applyDir(), this._resolveBrandKit(), this._applyTheme(), document.addEventListener("keydown", this._handleKeyDown), this.addEventListener("brand-kit-edit", this._handleBrandKitEdit), this.addEventListener("brand-color-apply", this._handleBrandColorApply), this.addEventListener("brand-font-apply", this._handleBrandFontApply), this.addEventListener("brand-logo-insert", this._handleBrandLogoInsert);
|
|
7774
8223
|
}
|
|
7775
8224
|
disconnectedCallback() {
|
|
7776
8225
|
super.disconnectedCallback(), document.removeEventListener("keydown", this._handleKeyDown), this.removeEventListener("brand-kit-edit", this._handleBrandKitEdit), this.removeEventListener("brand-color-apply", this._handleBrandColorApply), this.removeEventListener("brand-font-apply", this._handleBrandFontApply), this.removeEventListener("brand-logo-insert", this._handleBrandLogoInsert);
|
|
7777
8226
|
}
|
|
7778
8227
|
updated(e) {
|
|
7779
|
-
e.has("document") && this._state && this.document && this.document !== this._state.doc && this.loadDocument(this.document), e.has("_fullscreen") && (this._fullscreen ? this.setAttribute("fullscreen", "") : this.removeAttribute("fullscreen")), (e.has("theme") || e.has("themeOverrides")) && this._applyTheme(), e.has("config") && (
|
|
8228
|
+
e.has("document") && this._state && this.document && this.document !== this._state.doc && this.loadDocument(this.document), e.has("_fullscreen") && (this._fullscreen ? this.setAttribute("fullscreen", "") : this.removeAttribute("fullscreen")), (e.has("theme") || e.has("themeOverrides")) && this._applyTheme(), e.has("config") && (bt(this.config.locale, this.config.messages), wt(this.config.blocks), this._applyDir(), this._resolveBrandKit());
|
|
7780
8229
|
}
|
|
7781
8230
|
/**
|
|
7782
8231
|
* Set the host `dir` attribute based on `config.locale` and `config.dir`.
|
|
@@ -7785,7 +8234,7 @@ let v = class extends d {
|
|
|
7785
8234
|
* bidirectional layout support.
|
|
7786
8235
|
*/
|
|
7787
8236
|
_applyDir() {
|
|
7788
|
-
this.setAttribute("dir",
|
|
8237
|
+
this.setAttribute("dir", zt(this.config.locale, this.config.dir));
|
|
7789
8238
|
}
|
|
7790
8239
|
/**
|
|
7791
8240
|
* Sync the active `theme` to the host classes the token sheet keys off, and
|
|
@@ -7811,19 +8260,39 @@ let v = class extends d {
|
|
|
7811
8260
|
}
|
|
7812
8261
|
/** Replaces the document entirely (resets history). */
|
|
7813
8262
|
loadDocument(e) {
|
|
7814
|
-
this._state =
|
|
8263
|
+
this._state = $t.create({
|
|
7815
8264
|
doc: e,
|
|
7816
|
-
plugins: [
|
|
8265
|
+
plugins: [kt()],
|
|
7817
8266
|
...this.config
|
|
7818
8267
|
}), this._syncHistoryFlags(), this.requestUpdate(), this._fireChange();
|
|
7819
8268
|
}
|
|
7820
8269
|
/** Undo the last change. */
|
|
7821
8270
|
undo() {
|
|
7822
|
-
return
|
|
8271
|
+
return !this.readonly && Ht(this._state, this._dispatch);
|
|
7823
8272
|
}
|
|
7824
8273
|
/** Redo the last undone change. */
|
|
7825
8274
|
redo() {
|
|
7826
|
-
return
|
|
8275
|
+
return !this.readonly && Ut(this._state, this._dispatch);
|
|
8276
|
+
}
|
|
8277
|
+
/** Whether {@link undo} would change anything, for a host rendering its own toolbar. */
|
|
8278
|
+
canUndo() {
|
|
8279
|
+
return !this.readonly && this._canUndo;
|
|
8280
|
+
}
|
|
8281
|
+
/** Whether {@link redo} would change anything, for a host rendering its own toolbar. */
|
|
8282
|
+
canRedo() {
|
|
8283
|
+
return !this.readonly && this._canRedo;
|
|
8284
|
+
}
|
|
8285
|
+
/**
|
|
8286
|
+
* Open the built-in preview panel, as the toolbar's own preview button does:
|
|
8287
|
+
* without a `renderer` there is nothing to preview, so it dispatches
|
|
8288
|
+
* `pigeon:preview` for the host to handle and returns false.
|
|
8289
|
+
*/
|
|
8290
|
+
showPreview() {
|
|
8291
|
+
return this._handlePreview(), this._previewOpen;
|
|
8292
|
+
}
|
|
8293
|
+
/** Close the built-in preview panel. */
|
|
8294
|
+
hidePreview() {
|
|
8295
|
+
this._setPreviewOpen(!1);
|
|
7827
8296
|
}
|
|
7828
8297
|
/** Export the document as JSON. */
|
|
7829
8298
|
exportJson() {
|
|
@@ -7833,6 +8302,10 @@ let v = class extends d {
|
|
|
7833
8302
|
exportMjml() {
|
|
7834
8303
|
return this.documentToMjml ? this.documentToMjml(this._state.doc, { fonts: this._renderFonts() }) : null;
|
|
7835
8304
|
}
|
|
8305
|
+
/** Export the document as plain text. Requires documentToPlainText to be set. */
|
|
8306
|
+
exportPlainText() {
|
|
8307
|
+
return this.documentToPlainText ? this.documentToPlainText(this._state.doc) : null;
|
|
8308
|
+
}
|
|
7836
8309
|
/** Export the document as HTML. Requires renderer to be set. */
|
|
7837
8310
|
async exportHtml() {
|
|
7838
8311
|
return this.renderer ? (await this.renderer.render(this._state.doc, { fonts: this._renderFonts() })).html : null;
|
|
@@ -7852,6 +8325,7 @@ let v = class extends d {
|
|
|
7852
8325
|
<pigeon-toolbar
|
|
7853
8326
|
part="toolbar"
|
|
7854
8327
|
exportparts="toolbar-button, toolbar-button-undo, toolbar-button-redo, toolbar-button-fullscreen, toolbar-button-templates, toolbar-button-preview, toolbar-button-export"
|
|
8328
|
+
?readonly=${this.readonly}
|
|
7855
8329
|
?can-undo=${this._canUndo}
|
|
7856
8330
|
?can-redo=${this._canRedo}
|
|
7857
8331
|
.device=${this._device}
|
|
@@ -7869,7 +8343,7 @@ let v = class extends d {
|
|
|
7869
8343
|
></pigeon-toolbar>
|
|
7870
8344
|
|
|
7871
8345
|
<div class="editor-body">
|
|
7872
|
-
|
|
8346
|
+
${this.readonly ? "" : l`<pigeon-palette
|
|
7873
8347
|
part="palette"
|
|
7874
8348
|
role="complementary"
|
|
7875
8349
|
aria-label="Content blocks and layers"
|
|
@@ -7878,12 +8352,13 @@ let v = class extends d {
|
|
|
7878
8352
|
.selection=${t}
|
|
7879
8353
|
.brandKit=${this._activeBrandKit}
|
|
7880
8354
|
.rowLibrary=${this._resolveRowLibrary()}
|
|
8355
|
+
.blocks=${this.config.blocks}
|
|
7881
8356
|
@row-select=${this._handleRowSelect}
|
|
7882
8357
|
@block-select=${this._handleBlockSelect}
|
|
7883
8358
|
@palette-item-activate=${this._handlePaletteActivate}
|
|
7884
8359
|
@library-delete=${this._handleLibraryDelete}
|
|
7885
8360
|
@library-insert=${this._handleLibraryInsert}
|
|
7886
|
-
></pigeon-palette
|
|
8361
|
+
></pigeon-palette>`}
|
|
7887
8362
|
|
|
7888
8363
|
<pigeon-canvas
|
|
7889
8364
|
part="canvas"
|
|
@@ -7895,6 +8370,7 @@ let v = class extends d {
|
|
|
7895
8370
|
.editingBlockId=${this._editingBlockId}
|
|
7896
8371
|
.device=${this._device}
|
|
7897
8372
|
.previewWidth=${o}
|
|
8373
|
+
?readonly=${this.readonly}
|
|
7898
8374
|
@block-select=${this._handleBlockSelect}
|
|
7899
8375
|
@row-select=${this._handleRowSelect}
|
|
7900
8376
|
@canvas-select-body=${this._handleBodySelect}
|
|
@@ -7910,7 +8386,7 @@ let v = class extends d {
|
|
|
7910
8386
|
@block-exit-edit=${this._handleBlockExitEdit}
|
|
7911
8387
|
></pigeon-canvas>
|
|
7912
8388
|
|
|
7913
|
-
|
|
8389
|
+
${this.readonly ? "" : l`<pigeon-properties
|
|
7914
8390
|
part="properties"
|
|
7915
8391
|
role="complementary"
|
|
7916
8392
|
aria-label="Element properties"
|
|
@@ -7927,10 +8403,11 @@ let v = class extends d {
|
|
|
7927
8403
|
@property-change=${this._handlePropertyChange}
|
|
7928
8404
|
@row-property-change=${this._handleRowPropertyChange}
|
|
7929
8405
|
@row-layout-change=${this._handleRowLayoutChange}
|
|
8406
|
+
@column-property-change=${this._handleColumnPropertyChange}
|
|
7930
8407
|
@body-property-change=${this._handleBodyPropertyChange}
|
|
7931
8408
|
@row-select=${this._handleRowSelect}
|
|
7932
8409
|
@column-select=${this._handleColumnSelect}
|
|
7933
|
-
></pigeon-properties
|
|
8410
|
+
></pigeon-properties>`}
|
|
7934
8411
|
</div>
|
|
7935
8412
|
|
|
7936
8413
|
<pigeon-preview
|
|
@@ -7939,9 +8416,10 @@ let v = class extends d {
|
|
|
7939
8416
|
.renderer=${this.renderer}
|
|
7940
8417
|
.documentToMjml=${this.documentToMjml}
|
|
7941
8418
|
.fonts=${this._renderFonts()}
|
|
8419
|
+
@preview-close=${() => this._setPreviewOpen(!1)}
|
|
7942
8420
|
@click=${(n) => {
|
|
7943
8421
|
var a;
|
|
7944
|
-
(a = n.target.classList) != null && a.contains("overlay") &&
|
|
8422
|
+
(a = n.target.classList) != null && a.contains("overlay") && this._setPreviewOpen(!1);
|
|
7945
8423
|
}}
|
|
7946
8424
|
></pigeon-preview>
|
|
7947
8425
|
|
|
@@ -7959,13 +8437,13 @@ let v = class extends d {
|
|
|
7959
8437
|
/* Templates */
|
|
7960
8438
|
/* ------------------------------------------------------------------ */
|
|
7961
8439
|
_resolveTemplateStorage() {
|
|
7962
|
-
return this.templateStorage ? this.templateStorage : (this._defaultTemplateStorage || (this._defaultTemplateStorage = new
|
|
8440
|
+
return this.templateStorage ? this.templateStorage : (this._defaultTemplateStorage || (this._defaultTemplateStorage = new Nt()), this._defaultTemplateStorage);
|
|
7963
8441
|
}
|
|
7964
8442
|
_resolveRowLibrary() {
|
|
7965
|
-
return this.config.rowLibrary ? this.config.rowLibrary : (this._defaultRowLibrary || (this._defaultRowLibrary = new
|
|
8443
|
+
return this.config.rowLibrary ? this.config.rowLibrary : (this._defaultRowLibrary || (this._defaultRowLibrary = new Kt()), this._defaultRowLibrary);
|
|
7966
8444
|
}
|
|
7967
8445
|
_linkTypes() {
|
|
7968
|
-
return [...
|
|
8446
|
+
return [...Wt, ...this.config.linkTypes ?? []];
|
|
7969
8447
|
}
|
|
7970
8448
|
/**
|
|
7971
8449
|
* Resolve `config.brandKit` into a single active kit. A plain `BrandKit` is
|
|
@@ -8006,7 +8484,7 @@ let v = class extends d {
|
|
|
8006
8484
|
}
|
|
8007
8485
|
/** Apply a single body attribute through an undoable transaction. */
|
|
8008
8486
|
_applyBodyAttribute(e, t) {
|
|
8009
|
-
const o = this._state.createTransaction(), i = this._state.doc.body.attributes[e], n =
|
|
8487
|
+
const o = this._state.createTransaction(), i = this._state.doc.body.attributes[e], n = Ye(
|
|
8010
8488
|
"updateBodyAttribute",
|
|
8011
8489
|
`body.attributes.${e}`,
|
|
8012
8490
|
(a) => {
|
|
@@ -8019,7 +8497,7 @@ let v = class extends d {
|
|
|
8019
8497
|
o.addStep(n), this._dispatch(o);
|
|
8020
8498
|
}
|
|
8021
8499
|
async _handleTemplatesOpen() {
|
|
8022
|
-
this._templatePickerLoaded || (await
|
|
8500
|
+
this._templatePickerLoaded || (await qi(), this._templatePickerLoaded = !0), this._templatePickerOpen = !0;
|
|
8023
8501
|
}
|
|
8024
8502
|
_handleTemplateLoad(e) {
|
|
8025
8503
|
var o;
|
|
@@ -8030,7 +8508,7 @@ let v = class extends d {
|
|
|
8030
8508
|
async _handleTemplateSave(e) {
|
|
8031
8509
|
e.stopPropagation();
|
|
8032
8510
|
const { name: t, description: o, category: r } = e.detail, i = this._resolveTemplateStorage(), n = (/* @__PURE__ */ new Date()).toISOString(), a = {
|
|
8033
|
-
id:
|
|
8511
|
+
id: St(t),
|
|
8034
8512
|
name: t,
|
|
8035
8513
|
description: o,
|
|
8036
8514
|
category: r,
|
|
@@ -8048,12 +8526,12 @@ let v = class extends d {
|
|
|
8048
8526
|
/* Internal: state init & dispatch */
|
|
8049
8527
|
/* ------------------------------------------------------------------ */
|
|
8050
8528
|
_initState() {
|
|
8051
|
-
const e = this.document ?? this.config.doc ??
|
|
8052
|
-
t.some((r) => r.name ===
|
|
8529
|
+
const e = this.document ?? this.config.doc ?? qt(), t = this.config.plugins ?? [];
|
|
8530
|
+
t.some((r) => r.name === Ct) || t.unshift(kt()), this._state = $t.create({ doc: e, plugins: t }), this._syncHistoryFlags();
|
|
8053
8531
|
}
|
|
8054
8532
|
_syncHistoryFlags() {
|
|
8055
|
-
const e = this._state.getPluginState(
|
|
8056
|
-
this._canUndo = e ?
|
|
8533
|
+
const e = this._state.getPluginState(Ct);
|
|
8534
|
+
this._canUndo = e ? Vt(e) : !1, this._canRedo = e ? Yt(e) : !1;
|
|
8057
8535
|
}
|
|
8058
8536
|
/* ------------------------------------------------------------------ */
|
|
8059
8537
|
/* Internal: event emitters */
|
|
@@ -8087,8 +8565,19 @@ let v = class extends d {
|
|
|
8087
8565
|
_handleFullscreen() {
|
|
8088
8566
|
this._fullscreen = !this._fullscreen;
|
|
8089
8567
|
}
|
|
8090
|
-
|
|
8091
|
-
|
|
8568
|
+
/**
|
|
8569
|
+
* The single point every preview open/close goes through, so `pigeon:preview-open`
|
|
8570
|
+
* and `pigeon:preview-close` fire whether the toolbar, the overlay or a host
|
|
8571
|
+
* method moved it, and a host's own button can stay in sync with the built-in one.
|
|
8572
|
+
*/
|
|
8573
|
+
_setPreviewOpen(e) {
|
|
8574
|
+
this._previewOpen !== e && (this._previewOpen = e, this.dispatchEvent(new CustomEvent(e ? "pigeon:preview-open" : "pigeon:preview-close", {
|
|
8575
|
+
bubbles: !0,
|
|
8576
|
+
composed: !0
|
|
8577
|
+
})));
|
|
8578
|
+
}
|
|
8579
|
+
_handlePreview(e) {
|
|
8580
|
+
e == null || e.stopPropagation(), this.renderer && this._setPreviewOpen(!0), (e || !this.renderer) && this.dispatchEvent(new CustomEvent("pigeon:preview", {
|
|
8092
8581
|
bubbles: !0,
|
|
8093
8582
|
composed: !0
|
|
8094
8583
|
}));
|
|
@@ -8134,7 +8623,7 @@ let v = class extends d {
|
|
|
8134
8623
|
for (const r of o.columns)
|
|
8135
8624
|
if (r.blocks.find((n) => n.id === t)) {
|
|
8136
8625
|
const n = this._state.createTransaction();
|
|
8137
|
-
n.setSelection(
|
|
8626
|
+
n.setSelection(Xe(o.id, r.id, t)), this._dispatch(n), !this.readonly && !o.locked && (this._editingBlockId = t);
|
|
8138
8627
|
return;
|
|
8139
8628
|
}
|
|
8140
8629
|
}
|
|
@@ -8145,7 +8634,7 @@ let v = class extends d {
|
|
|
8145
8634
|
const r = o.blocks.find((n) => n.id === e.detail.blockId);
|
|
8146
8635
|
if (!r) continue;
|
|
8147
8636
|
const i = r.values.content;
|
|
8148
|
-
typeof i == "string" && i !== e.detail.content &&
|
|
8637
|
+
typeof i == "string" && i !== e.detail.content && Ve(t.id, o.id, r.id, { content: e.detail.content })(this._state, this._dispatch), this._editingBlockId = null;
|
|
8149
8638
|
return;
|
|
8150
8639
|
}
|
|
8151
8640
|
this._editingBlockId = null;
|
|
@@ -8158,36 +8647,36 @@ let v = class extends d {
|
|
|
8158
8647
|
for (const r of o.columns)
|
|
8159
8648
|
if (r.blocks.find((n) => n.id === t)) {
|
|
8160
8649
|
const n = this._state.createTransaction();
|
|
8161
|
-
n.setSelection(
|
|
8650
|
+
n.setSelection(Xe(o.id, r.id, t)), this._dispatch(n);
|
|
8162
8651
|
return;
|
|
8163
8652
|
}
|
|
8164
8653
|
}
|
|
8165
8654
|
_handleRowSelect(e) {
|
|
8166
8655
|
this._editingBlockId = null;
|
|
8167
8656
|
const t = this._state.createTransaction();
|
|
8168
|
-
t.setSelection(
|
|
8657
|
+
t.setSelection(It(e.detail.rowId)), this._dispatch(t);
|
|
8169
8658
|
}
|
|
8170
8659
|
_handleColumnSelect(e) {
|
|
8171
8660
|
this._editingBlockId = null;
|
|
8172
8661
|
const t = this._state.createTransaction();
|
|
8173
|
-
t.setSelection(
|
|
8662
|
+
t.setSelection(Xt(e.detail.rowId, e.detail.columnId)), this._dispatch(t);
|
|
8174
8663
|
}
|
|
8175
8664
|
_handleBodySelect() {
|
|
8176
8665
|
this._editingBlockId = null;
|
|
8177
8666
|
const e = this._state.createTransaction();
|
|
8178
|
-
e.setSelection(
|
|
8667
|
+
e.setSelection(mt()), this._dispatch(e);
|
|
8179
8668
|
}
|
|
8180
8669
|
/* ------------------------------------------------------------------ */
|
|
8181
8670
|
/* Row action handlers */
|
|
8182
8671
|
/* ------------------------------------------------------------------ */
|
|
8183
8672
|
_handleRowMove(e) {
|
|
8184
|
-
|
|
8673
|
+
Gt(e.detail.rowId, e.detail.toIndex)(this._state, this._dispatch);
|
|
8185
8674
|
}
|
|
8186
8675
|
_handleRowDuplicate(e) {
|
|
8187
|
-
|
|
8676
|
+
_t(e.detail.rowId)(this._state, this._dispatch);
|
|
8188
8677
|
}
|
|
8189
8678
|
_handleRowDelete(e) {
|
|
8190
|
-
|
|
8679
|
+
yt(e.detail.rowId)(this._state, this._dispatch);
|
|
8191
8680
|
}
|
|
8192
8681
|
async _refreshSavedTab() {
|
|
8193
8682
|
var o;
|
|
@@ -8239,7 +8728,7 @@ let v = class extends d {
|
|
|
8239
8728
|
const i = r + e;
|
|
8240
8729
|
if (i < 0 || i >= o.length) return;
|
|
8241
8730
|
const n = o[i], a = this._state.createTransaction();
|
|
8242
|
-
a.setSelection(
|
|
8731
|
+
a.setSelection(Xe(n.rowId, n.columnId, n.blockId)), this._dispatch(a);
|
|
8243
8732
|
}
|
|
8244
8733
|
_moveRowSelection(e) {
|
|
8245
8734
|
const t = this._state.selection;
|
|
@@ -8249,7 +8738,7 @@ let v = class extends d {
|
|
|
8249
8738
|
const i = r + e;
|
|
8250
8739
|
if (i < 0 || i >= o.length) return;
|
|
8251
8740
|
const n = this._state.createTransaction();
|
|
8252
|
-
n.setSelection(
|
|
8741
|
+
n.setSelection(It(o[i].id)), this._dispatch(n);
|
|
8253
8742
|
}
|
|
8254
8743
|
_findBlock(e, t, o) {
|
|
8255
8744
|
const r = this._state.doc.body.rows.find((n) => n.id === e);
|
|
@@ -8268,15 +8757,15 @@ let v = class extends d {
|
|
|
8268
8757
|
/* DnD handlers */
|
|
8269
8758
|
/* ------------------------------------------------------------------ */
|
|
8270
8759
|
_handleRowDrop(e) {
|
|
8271
|
-
const { index: t, columnCount: o } = e.detail, r = Array.from({ length: o }, () =>
|
|
8272
|
-
|
|
8760
|
+
const { index: t, columnCount: o } = e.detail, r = Array.from({ length: o }, () => me()), i = ye(r);
|
|
8761
|
+
J(i, t)(this._state, this._dispatch);
|
|
8273
8762
|
}
|
|
8274
8763
|
_handleBlockDrop(e) {
|
|
8275
8764
|
const { rowId: t, columnId: o, index: r, dragData: i } = e.detail;
|
|
8276
8765
|
if (i.type === "palette-block" && i.blockType) {
|
|
8277
|
-
const n =
|
|
8278
|
-
|
|
8279
|
-
} else i.type === "existing-block" && i.blockId && i.rowId && i.columnId &&
|
|
8766
|
+
const n = Be(i.blockType);
|
|
8767
|
+
ie(t, o, n, r)(this._state, this._dispatch);
|
|
8768
|
+
} else i.type === "existing-block" && i.blockId && i.rowId && i.columnId && Jt(
|
|
8280
8769
|
i.rowId,
|
|
8281
8770
|
i.columnId,
|
|
8282
8771
|
i.blockId,
|
|
@@ -8286,8 +8775,8 @@ let v = class extends d {
|
|
|
8286
8775
|
)(this._state, this._dispatch);
|
|
8287
8776
|
}
|
|
8288
8777
|
_handleBlockDropNewRow(e) {
|
|
8289
|
-
const { blockType: t, rowIndex: o } = e.detail, r =
|
|
8290
|
-
|
|
8778
|
+
const { blockType: t, rowIndex: o } = e.detail, r = Be(t), i = me([r]), n = ye([i]);
|
|
8779
|
+
J(n, o)(this._state, this._dispatch);
|
|
8291
8780
|
}
|
|
8292
8781
|
/**
|
|
8293
8782
|
* Keyboard equivalent of dragging a palette item onto the canvas: append the
|
|
@@ -8297,21 +8786,21 @@ let v = class extends d {
|
|
|
8297
8786
|
_handlePaletteActivate(e) {
|
|
8298
8787
|
const { type: t, blockType: o, columnCount: r } = e.detail, i = this._state.doc.body.rows;
|
|
8299
8788
|
if (t === "palette-row") {
|
|
8300
|
-
const a = Array.from({ length: r }, () =>
|
|
8301
|
-
|
|
8789
|
+
const a = Array.from({ length: r }, () => me());
|
|
8790
|
+
J(ye(a), i.length)(this._state, this._dispatch);
|
|
8302
8791
|
return;
|
|
8303
8792
|
}
|
|
8304
8793
|
if (!o) return;
|
|
8305
|
-
const n =
|
|
8794
|
+
const n = Be(o);
|
|
8306
8795
|
if (i.length > 0) {
|
|
8307
8796
|
const a = i[i.length - 1], u = a.columns[0];
|
|
8308
|
-
|
|
8797
|
+
ie(a.id, u.id, n, u.blocks.length)(
|
|
8309
8798
|
this._state,
|
|
8310
8799
|
this._dispatch
|
|
8311
8800
|
);
|
|
8312
8801
|
} else {
|
|
8313
|
-
const a =
|
|
8314
|
-
|
|
8802
|
+
const a = me([n]);
|
|
8803
|
+
J(ye([a]), 0)(this._state, this._dispatch);
|
|
8315
8804
|
}
|
|
8316
8805
|
}
|
|
8317
8806
|
/* ------------------------------------------------------------------ */
|
|
@@ -8319,11 +8808,15 @@ let v = class extends d {
|
|
|
8319
8808
|
/* ------------------------------------------------------------------ */
|
|
8320
8809
|
_handlePropertyChange(e) {
|
|
8321
8810
|
const { rowId: t, columnId: o, blockId: r, values: i } = e.detail;
|
|
8322
|
-
|
|
8811
|
+
Ve(t, o, r, i)(this._state, this._dispatch);
|
|
8323
8812
|
}
|
|
8324
8813
|
_handleRowPropertyChange(e) {
|
|
8325
8814
|
const { rowId: t, attributes: o } = e.detail;
|
|
8326
|
-
|
|
8815
|
+
Zt(t, o)(this._state, this._dispatch);
|
|
8816
|
+
}
|
|
8817
|
+
_handleColumnPropertyChange(e) {
|
|
8818
|
+
const { rowId: t, columnId: o, attributes: r } = e.detail;
|
|
8819
|
+
Qt(t, o, r)(this._state, this._dispatch);
|
|
8327
8820
|
}
|
|
8328
8821
|
_handleRowLayoutChange(e) {
|
|
8329
8822
|
const { rowId: t, ratios: o, columnCount: r } = e.detail, i = this._state.doc.body.rows.find((b) => b.id === t);
|
|
@@ -8331,22 +8824,22 @@ let v = class extends d {
|
|
|
8331
8824
|
const n = i.columns.length, a = r;
|
|
8332
8825
|
if (a > n)
|
|
8333
8826
|
for (let b = 0; b < a - n; b++)
|
|
8334
|
-
|
|
8827
|
+
eo(t)(this._state, this._dispatch);
|
|
8335
8828
|
else if (a < n)
|
|
8336
8829
|
for (let b = 0; b < n - a; b++) {
|
|
8337
|
-
const
|
|
8338
|
-
if (
|
|
8339
|
-
const
|
|
8340
|
-
|
|
8830
|
+
const _ = this._state.doc.body.rows.find((K) => K.id === t);
|
|
8831
|
+
if (_ && _.columns.length > 1) {
|
|
8832
|
+
const K = _.columns[_.columns.length - 1];
|
|
8833
|
+
to(t, K.id)(this._state, this._dispatch);
|
|
8341
8834
|
}
|
|
8342
8835
|
}
|
|
8343
8836
|
const u = this._state.doc.body.rows.find((b) => b.id === t);
|
|
8344
|
-
u && u.columns.length === o.length &&
|
|
8837
|
+
u && u.columns.length === o.length && oo(t, o)(this._state, this._dispatch);
|
|
8345
8838
|
}
|
|
8346
8839
|
_handleBodyPropertyChange(e) {
|
|
8347
8840
|
const { attribute: t, metaField: o, value: r } = e.detail, i = this._state.createTransaction();
|
|
8348
8841
|
if (t) {
|
|
8349
|
-
const a = this._state.doc.body.attributes[t], u =
|
|
8842
|
+
const a = this._state.doc.body.attributes[t], u = Ye(
|
|
8350
8843
|
"updateBodyAttribute",
|
|
8351
8844
|
`body.attributes.${t}`,
|
|
8352
8845
|
(b) => {
|
|
@@ -8359,7 +8852,7 @@ let v = class extends d {
|
|
|
8359
8852
|
i.addStep(u);
|
|
8360
8853
|
}
|
|
8361
8854
|
if (o) {
|
|
8362
|
-
const a = this._state.doc.metadata[o], u =
|
|
8855
|
+
const a = this._state.doc.metadata[o], u = Ye(
|
|
8363
8856
|
"updateMetadata",
|
|
8364
8857
|
`metadata.${o}`,
|
|
8365
8858
|
(b) => {
|
|
@@ -8375,7 +8868,7 @@ let v = class extends d {
|
|
|
8375
8868
|
}
|
|
8376
8869
|
};
|
|
8377
8870
|
v.styles = [
|
|
8378
|
-
|
|
8871
|
+
no,
|
|
8379
8872
|
g`
|
|
8380
8873
|
:host {
|
|
8381
8874
|
display: flex;
|
|
@@ -8402,103 +8895,111 @@ v.styles = [
|
|
|
8402
8895
|
}
|
|
8403
8896
|
`
|
|
8404
8897
|
];
|
|
8405
|
-
|
|
8898
|
+
f([
|
|
8406
8899
|
p({ type: Object })
|
|
8407
8900
|
], v.prototype, "document", 2);
|
|
8408
|
-
|
|
8901
|
+
f([
|
|
8409
8902
|
p({ type: String, reflect: !0 })
|
|
8410
8903
|
], v.prototype, "theme", 2);
|
|
8411
|
-
|
|
8904
|
+
f([
|
|
8412
8905
|
p({ attribute: !1 })
|
|
8413
8906
|
], v.prototype, "themeOverrides", 2);
|
|
8414
|
-
|
|
8907
|
+
f([
|
|
8415
8908
|
p({ type: Object })
|
|
8416
8909
|
], v.prototype, "config", 2);
|
|
8417
|
-
|
|
8910
|
+
f([
|
|
8911
|
+
p({ type: Boolean, reflect: !0 })
|
|
8912
|
+
], v.prototype, "readonly", 2);
|
|
8913
|
+
f([
|
|
8418
8914
|
p({ type: Object })
|
|
8419
8915
|
], v.prototype, "renderer", 2);
|
|
8420
|
-
|
|
8916
|
+
f([
|
|
8421
8917
|
p({ type: Object })
|
|
8422
8918
|
], v.prototype, "documentToMjml", 2);
|
|
8423
|
-
|
|
8919
|
+
f([
|
|
8920
|
+
p({ type: Object })
|
|
8921
|
+
], v.prototype, "documentToPlainText", 2);
|
|
8922
|
+
f([
|
|
8424
8923
|
p({ attribute: !1 })
|
|
8425
8924
|
], v.prototype, "templateStorage", 2);
|
|
8426
|
-
|
|
8925
|
+
f([
|
|
8427
8926
|
p({ attribute: !1 })
|
|
8428
8927
|
], v.prototype, "assetStorage", 2);
|
|
8429
|
-
|
|
8928
|
+
f([
|
|
8430
8929
|
c()
|
|
8431
8930
|
], v.prototype, "_state", 2);
|
|
8432
|
-
|
|
8931
|
+
f([
|
|
8433
8932
|
c()
|
|
8434
8933
|
], v.prototype, "_canUndo", 2);
|
|
8435
|
-
|
|
8934
|
+
f([
|
|
8436
8935
|
c()
|
|
8437
8936
|
], v.prototype, "_canRedo", 2);
|
|
8438
|
-
|
|
8937
|
+
f([
|
|
8439
8938
|
c()
|
|
8440
8939
|
], v.prototype, "_device", 2);
|
|
8441
|
-
|
|
8940
|
+
f([
|
|
8442
8941
|
c()
|
|
8443
8942
|
], v.prototype, "_fullscreen", 2);
|
|
8444
|
-
|
|
8943
|
+
f([
|
|
8445
8944
|
c()
|
|
8446
8945
|
], v.prototype, "_previewOpen", 2);
|
|
8447
|
-
|
|
8946
|
+
f([
|
|
8448
8947
|
c()
|
|
8449
8948
|
], v.prototype, "_templatePickerOpen", 2);
|
|
8450
|
-
|
|
8949
|
+
f([
|
|
8451
8950
|
c()
|
|
8452
8951
|
], v.prototype, "_templatePickerLoaded", 2);
|
|
8453
|
-
|
|
8952
|
+
f([
|
|
8454
8953
|
c()
|
|
8455
8954
|
], v.prototype, "_editingBlockId", 2);
|
|
8456
|
-
|
|
8955
|
+
f([
|
|
8457
8956
|
c()
|
|
8458
8957
|
], v.prototype, "_activeBrandKit", 2);
|
|
8459
|
-
v =
|
|
8958
|
+
v = f([
|
|
8460
8959
|
h("pigeon-editor")
|
|
8461
8960
|
], v);
|
|
8462
8961
|
export {
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8962
|
+
rr as BUILT_IN_LOCALES,
|
|
8963
|
+
Te as PigeonAlignmentPicker,
|
|
8964
|
+
m as PigeonAssetManager,
|
|
8965
|
+
S as PigeonBodyPanel,
|
|
8966
|
+
se as PigeonButtonBlock,
|
|
8967
|
+
V as PigeonButtonPanel,
|
|
8968
|
+
I as PigeonCanvas,
|
|
8969
|
+
pe as PigeonColorPicker,
|
|
8970
|
+
k as PigeonColumn,
|
|
8971
|
+
$e as PigeonDividerBlock,
|
|
8972
|
+
Le as PigeonDropIndicator,
|
|
8473
8973
|
v as PigeonEditor,
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8974
|
+
le as PigeonHeroBlock,
|
|
8975
|
+
E as PigeonHeroPanel,
|
|
8976
|
+
Ie as PigeonHtmlBlock,
|
|
8977
|
+
we as PigeonImageBlock,
|
|
8978
|
+
F as PigeonImagePanel,
|
|
8979
|
+
xe as PigeonLayers,
|
|
8980
|
+
q as PigeonMergeTagPicker,
|
|
8981
|
+
Pe as PigeonNavBarBlock,
|
|
8482
8982
|
Z as PigeonNavBarPanel,
|
|
8483
|
-
|
|
8484
|
-
|
|
8983
|
+
$ as PigeonPalette,
|
|
8984
|
+
W as PigeonPaletteItem,
|
|
8485
8985
|
x as PigeonPreview,
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8986
|
+
P as PigeonProperties,
|
|
8987
|
+
C as PigeonRow,
|
|
8988
|
+
ze as PigeonRowPanel,
|
|
8989
|
+
A as PigeonSliderInput,
|
|
8990
|
+
Ce as PigeonSocialBlock,
|
|
8991
|
+
ke as PigeonSpacerBlock,
|
|
8992
|
+
Se as PigeonSpacingInput,
|
|
8993
|
+
sr as PigeonTemplatePicker,
|
|
8994
|
+
ae as PigeonTextBlock,
|
|
8995
|
+
T as PigeonTextPanel,
|
|
8996
|
+
M as PigeonToolbar,
|
|
8997
|
+
wo as calculateBlockDropIndex,
|
|
8998
|
+
xo as calculateRowDropIndex,
|
|
8999
|
+
Re as clearDragData,
|
|
8500
9000
|
_e as getDragData,
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
9001
|
+
nr as loadLocale,
|
|
9002
|
+
tr as readDragTransfer,
|
|
9003
|
+
lo as setDragData,
|
|
9004
|
+
nt as writeDragTransfer
|
|
8504
9005
|
};
|