@lit-pigeon/editor 0.3.3 → 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/dist/index.js CHANGED
@@ -1,13 +1,14 @@
1
- import { css as b, LitElement as g, html as l, nothing as te } from "lit";
2
- import { property as p, state as d, customElement as u } from "lit/decorators.js";
3
- import { t as s, c as Bt, r as po } from "./templates.js";
4
- import { P as Kr } from "./templates.js";
5
- import { getAllBlockDefinitions as co, getBlockDefinition as yt, updateBlock as ct, createBlock as Ve, insertBlock as ce, createColumn as Ie, insertRow as oe, createRow as Te, cloneRowWithNewIds as jt, createBodySelection as Mt, deleteBlock as ho, deleteRow as Rt, duplicateBlock as go, duplicateRow as Lt, generateId as zt, EditorState as Ht, createHistoryPlugin as Ft, undo as uo, redo as bo, InMemoryTemplateStorage as vo, InMemoryRowLibraryStorage as fo, SYSTEM_LINK_TYPES as mo, createDocStep as dt, createDefaultDocument as _o, HISTORY_PLUGIN_NAME as Nt, canUndo as yo, canRedo as xo, createBlockSelection as ht, createRowSelection as Ut, createColumnSelection as $o, moveRow as wo, moveBlock as ko, updateRowAttributes as Co, addColumn as Io, removeColumn as To, resizeColumns as Po } from "@lit-pigeon/core";
6
- import { unsafeHTML as eo } from "lit/directives/unsafe-html.js";
7
- import { l as xt, r as So } from "./rich-text-bridge.js";
8
- import { styleMap as Oo } from "lit/directives/style-map.js";
9
- import "./rich-text.js";
10
- const Kt = b`
1
+ import { css as g, LitElement as d, html as l, nothing as G } from "lit";
2
+ import { property as p, state as c, customElement as h } from "lit/decorators.js";
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`
11
12
  /* base palette */
12
13
  --pigeon-bg: #0f172a; /* slate-900 */
13
14
  --pigeon-surface: #1e293b; /* slate-800 */
@@ -43,7 +44,7 @@ const Kt = b`
43
44
  0 2px 4px -2px rgb(0 0 0 / 0.4);
44
45
  --pigeon-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5),
45
46
  0 4px 6px -4px rgb(0 0 0 / 0.5);
46
- `, Eo = b`
47
+ `, no = g`
47
48
  :host {
48
49
  /* base palette */
49
50
  --pigeon-bg: #ffffff;
@@ -104,23 +105,23 @@ const Kt = b`
104
105
  }
105
106
 
106
107
  :host(.pigeon-dark) {
107
- ${Kt}
108
+ ${Pt}
108
109
  }
109
110
 
110
111
  @media (prefers-color-scheme: dark) {
111
112
  :host(.pigeon-auto) {
112
- ${Kt}
113
+ ${Pt}
113
114
  }
114
115
  }
115
116
  `;
116
- var Do = Object.defineProperty, Ao = Object.getOwnPropertyDescriptor, xe = (e, t, o, r) => {
117
- for (var i = r > 1 ? void 0 : r ? Ao(t, o) : t, n = e.length - 1, a; n >= 0; n--)
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--)
118
119
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
119
- return r && i && Do(t, o, i), i;
120
+ return r && i && ao(t, o, i), i;
120
121
  };
121
- let V = class extends g {
122
+ let M = class extends d {
122
123
  constructor() {
123
- 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;
124
125
  }
125
126
  connectedCallback() {
126
127
  super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "toolbar"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", "Editor toolbar");
@@ -128,7 +129,7 @@ let V = class extends g {
128
129
  render() {
129
130
  return l`
130
131
  <!-- Undo/Redo -->
131
- <button
132
+ ${this.readonly ? "" : l`<button
132
133
  class="icon-btn"
133
134
  part="toolbar-button toolbar-button-undo"
134
135
  title=${s("toolbar.undo")}
@@ -156,7 +157,7 @@ let V = class extends g {
156
157
  </svg>
157
158
  </button>
158
159
 
159
- <div class="separator"></div>
160
+ <div class="separator"></div>`}
160
161
 
161
162
  <!-- Device toggle -->
162
163
  <div class="device-group" role="group" aria-label=${s("toolbar.preview-device")}>
@@ -230,7 +231,7 @@ let V = class extends g {
230
231
  <div class="separator"></div>
231
232
 
232
233
  <!-- Actions -->
233
- <button
234
+ ${this.readonly ? "" : l`<button
234
235
  data-action="templates"
235
236
  part="toolbar-button toolbar-button-templates"
236
237
  title=${s("toolbar.templates")}
@@ -243,7 +244,7 @@ let V = class extends g {
243
244
  <rect x="14" y="14" width="7" height="7" rx="1"/>
244
245
  </svg>
245
246
  ${s("toolbar.templates")}
246
- </button>
247
+ </button>`}
247
248
 
248
249
  <button part="toolbar-button toolbar-button-preview" @click=${this._onPreview}>
249
250
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
@@ -343,7 +344,7 @@ let V = class extends g {
343
344
  }));
344
345
  }
345
346
  };
346
- V.styles = b`
347
+ M.styles = g`
347
348
  :host {
348
349
  display: flex;
349
350
  align-items: center;
@@ -473,52 +474,55 @@ V.styles = b`
473
474
  font-weight: 400;
474
475
  }
475
476
  `;
476
- xe([
477
+ ee([
477
478
  p({ type: Boolean, attribute: "can-undo" })
478
- ], V.prototype, "canUndo", 2);
479
- xe([
479
+ ], M.prototype, "canUndo", 2);
480
+ ee([
480
481
  p({ type: Boolean, attribute: "can-redo" })
481
- ], V.prototype, "canRedo", 2);
482
- xe([
482
+ ], M.prototype, "canRedo", 2);
483
+ ee([
483
484
  p({ type: String })
484
- ], V.prototype, "device", 2);
485
- xe([
485
+ ], M.prototype, "device", 2);
486
+ ee([
486
487
  p({ type: Boolean })
487
- ], V.prototype, "fullscreen", 2);
488
- xe([
489
- d()
490
- ], V.prototype, "_exportMenuOpen", 2);
491
- V = xe([
492
- u("pigeon-toolbar")
493
- ], V);
494
- let $t = null;
495
- function Bo(e) {
496
- $t = e;
488
+ ], M.prototype, "fullscreen", 2);
489
+ ee([
490
+ p({ type: Boolean })
491
+ ], M.prototype, "readonly", 2);
492
+ ee([
493
+ c()
494
+ ], M.prototype, "_exportMenuOpen", 2);
495
+ M = ee([
496
+ h("pigeon-toolbar")
497
+ ], M);
498
+ let rt = null;
499
+ function lo(e) {
500
+ rt = e;
497
501
  }
498
- function Ee() {
499
- return $t;
502
+ function _e() {
503
+ return rt;
500
504
  }
501
- function Xe() {
502
- $t = null;
505
+ function Re() {
506
+ rt = null;
503
507
  }
504
- function wt(e, t) {
505
- e.dataTransfer && (e.dataTransfer.setData("application/json", JSON.stringify(t)), e.dataTransfer.effectAllowed = "move"), Bo(t);
508
+ function nt(e, t) {
509
+ e.dataTransfer && (e.dataTransfer.setData("application/json", JSON.stringify(t)), e.dataTransfer.effectAllowed = "move"), lo(t);
506
510
  }
507
- function Fr(e) {
511
+ function tr(e) {
508
512
  if (e.dataTransfer)
509
513
  try {
510
514
  const t = e.dataTransfer.getData("application/json");
511
515
  if (t) return JSON.parse(t);
512
516
  } catch {
513
517
  }
514
- return Ee();
518
+ return _e();
515
519
  }
516
- var jo = Object.defineProperty, Mo = Object.getOwnPropertyDescriptor, $e = (e, t, o, r) => {
517
- for (var i = r > 1 ? void 0 : r ? Mo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
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--)
518
522
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
519
- return r && i && jo(t, o, i), i;
523
+ return r && i && po(t, o, i), i;
520
524
  };
521
- const Ro = {
525
+ const ho = {
522
526
  text: "T",
523
527
  image: "[]",
524
528
  button: "[B]",
@@ -527,12 +531,12 @@ const Ro = {
527
531
  social: "@",
528
532
  html: "</>"
529
533
  };
530
- let Y = class extends g {
534
+ let W = class extends d {
531
535
  constructor() {
532
536
  super(...arguments), this.label = "", this.icon = "", this.dragType = "palette-block", this.blockType = "", this.columnCount = 1, this._didDrag = !1;
533
537
  }
534
538
  render() {
535
- const e = Ro[this.icon] ?? this.icon ?? "?", t = this.dragType === "palette-row" ? "Add layout" : "Add block";
539
+ const e = ho[this.icon] ?? this.icon ?? "?", t = this.dragType === "palette-row" ? "Add layout" : "Add block";
536
540
  return l`
537
541
  <div
538
542
  class="item"
@@ -575,7 +579,7 @@ let Y = class extends g {
575
579
  );
576
580
  }
577
581
  _onDragStart(e) {
578
- this._didDrag = !0, wt(e, {
582
+ this._didDrag = !0, nt(e, {
579
583
  type: this.dragType,
580
584
  blockType: this.blockType || void 0,
581
585
  columnCount: this.columnCount
@@ -600,7 +604,7 @@ let Y = class extends g {
600
604
  }));
601
605
  }
602
606
  };
603
- Y.styles = b`
607
+ W.styles = g`
604
608
  :host {
605
609
  display: block;
606
610
  }
@@ -658,30 +662,30 @@ Y.styles = b`
658
662
  color: var(--pigeon-text, #1e293b);
659
663
  }
660
664
  `;
661
- $e([
665
+ ue([
662
666
  p({ type: String })
663
- ], Y.prototype, "label", 2);
664
- $e([
667
+ ], W.prototype, "label", 2);
668
+ ue([
665
669
  p({ type: String })
666
- ], Y.prototype, "icon", 2);
667
- $e([
670
+ ], W.prototype, "icon", 2);
671
+ ue([
668
672
  p({ type: String, attribute: "drag-type" })
669
- ], Y.prototype, "dragType", 2);
670
- $e([
673
+ ], W.prototype, "dragType", 2);
674
+ ue([
671
675
  p({ type: String, attribute: "block-type" })
672
- ], Y.prototype, "blockType", 2);
673
- $e([
676
+ ], W.prototype, "blockType", 2);
677
+ ue([
674
678
  p({ type: Number, attribute: "column-count" })
675
- ], Y.prototype, "columnCount", 2);
676
- Y = $e([
677
- u("pigeon-palette-item")
678
- ], Y);
679
- var Lo = Object.defineProperty, zo = Object.getOwnPropertyDescriptor, kt = (e, t, o, r) => {
680
- for (var i = r > 1 ? void 0 : r ? zo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
679
+ ], W.prototype, "columnCount", 2);
680
+ W = ue([
681
+ h("pigeon-palette-item")
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--)
681
685
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
682
- return r && i && Lo(t, o, i), i;
686
+ return r && i && go(t, o, i), i;
683
687
  };
684
- const Ho = {
688
+ const bo = {
685
689
  text: "T",
686
690
  image: "Img",
687
691
  button: "Btn",
@@ -692,7 +696,7 @@ const Ho = {
692
696
  hero: "H",
693
697
  navbar: "Nav"
694
698
  };
695
- let De = class extends g {
699
+ let xe = class extends d {
696
700
  constructor() {
697
701
  super(...arguments), this.selection = null;
698
702
  }
@@ -725,7 +729,7 @@ let De = class extends g {
725
729
  }
726
730
  _renderBlock(e, t, o) {
727
731
  var a;
728
- const r = ((a = this.selection) == null ? void 0 : a.type) === "block" && this.selection.blockId === e.id, i = Ho[e.type] ?? "?", n = e.type.charAt(0).toUpperCase() + e.type.slice(1);
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);
729
733
  return l`
730
734
  <div
731
735
  class="tree-item indent-3 ${r ? "selected" : ""}"
@@ -751,7 +755,7 @@ let De = class extends g {
751
755
  }));
752
756
  }
753
757
  };
754
- De.styles = b`
758
+ xe.styles = g`
755
759
  :host {
756
760
  display: block;
757
761
  font-family: var(--pigeon-font);
@@ -815,44 +819,50 @@ De.styles = b`
815
819
  padding: 8px 8px 4px;
816
820
  }
817
821
  `;
818
- kt([
822
+ at([
819
823
  p({ type: Object })
820
- ], De.prototype, "doc", 2);
821
- kt([
824
+ ], xe.prototype, "doc", 2);
825
+ at([
822
826
  p({ type: Object })
823
- ], De.prototype, "selection", 2);
824
- De = kt([
825
- u("pigeon-layers")
826
- ], De);
827
- var Fo = Object.defineProperty, No = Object.getOwnPropertyDescriptor, H = (e, t, o, r) => {
828
- for (var i = r > 1 ? void 0 : r ? No(t, o) : t, n = e.length - 1, a; n >= 0; n--)
827
+ ], xe.prototype, "selection", 2);
828
+ xe = at([
829
+ h("pigeon-layers")
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--)
829
833
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
830
- return r && i && Fo(t, o, i), i;
834
+ return r && i && vo(t, o, i), i;
831
835
  };
832
- let gt = null;
833
- function Uo() {
834
- return gt || (gt = import("./pigeon-brand-tab.js")), gt;
836
+ let Ge = null;
837
+ function mo() {
838
+ return Ge || (Ge = import("./pigeon-brand-tab.js")), Ge;
835
839
  }
836
- let ut = null;
837
- function Ko() {
838
- return ut || (ut = import("./pigeon-saved-tab.js")), ut;
840
+ let Je = null;
841
+ function yo() {
842
+ return Je || (Je = import("./pigeon-saved-tab.js")), Je;
839
843
  }
840
- const Wo = [
844
+ const _o = [
841
845
  { labelKey: "palette.layout.1-col", columns: 1, icon: "[=]" },
842
846
  { labelKey: "palette.layout.2-col", columns: 2, icon: "[||]" },
843
847
  { labelKey: "palette.layout.3-col", columns: 3, icon: "[|||]" },
844
848
  { labelKey: "palette.layout.4-col", columns: 4, icon: "[||||]" }
845
849
  ];
846
- let T = class extends g {
850
+ let $ = class extends d {
847
851
  constructor() {
848
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 () => {
849
- this._activeTab = "brand", this._brandTabLoaded || (await Uo(), this._brandTabLoaded = !0);
853
+ this._activeTab = "brand", this._brandTabLoaded || (await mo(), this._brandTabLoaded = !0);
850
854
  }, this._handleSavedTabClick = async () => {
851
- this._activeTab = "saved", this._savedTabLoaded || (await Ko(), this._savedTabLoaded = !0);
855
+ this._activeTab = "saved", this._savedTabLoaded || (await yo(), this._savedTabLoaded = !0);
852
856
  };
853
857
  }
854
858
  connectedCallback() {
855
- super.connectedCallback(), this._blockDefs = co();
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());
856
866
  }
857
867
  updated(e) {
858
868
  e.has("brandKit") && !this.brandKit && this._activeTab === "brand" && (this._activeTab = "content");
@@ -926,7 +936,7 @@ let T = class extends g {
926
936
  <div class="section">
927
937
  <div class="section-header">${s("palette.layout.section-layout")}</div>
928
938
  <div class="items">
929
- ${Wo.map((e) => l`
939
+ ${_o.map((e) => l`
930
940
  <pigeon-palette-item part="palette-item"
931
941
  label="${s(e.labelKey)}"
932
942
  icon="${e.icon}"
@@ -953,7 +963,7 @@ let T = class extends g {
953
963
  return this._savedTabLoaded ? l`<pigeon-saved-tab .storage=${this.rowLibrary}></pigeon-saved-tab>` : l``;
954
964
  }
955
965
  };
956
- T.styles = b`
966
+ $.styles = g`
957
967
  :host {
958
968
  display: block;
959
969
  width: var(--pigeon-palette-width, 240px);
@@ -1032,34 +1042,37 @@ T.styles = b`
1032
1042
  gap: 6px;
1033
1043
  }
1034
1044
  `;
1035
- H([
1045
+ B([
1036
1046
  p({ type: Object })
1037
- ], T.prototype, "doc", 2);
1038
- H([
1047
+ ], $.prototype, "doc", 2);
1048
+ B([
1039
1049
  p({ type: Object })
1040
- ], T.prototype, "selection", 2);
1041
- H([
1050
+ ], $.prototype, "selection", 2);
1051
+ B([
1042
1052
  p({ attribute: !1 })
1043
- ], T.prototype, "brandKit", 2);
1044
- H([
1053
+ ], $.prototype, "brandKit", 2);
1054
+ B([
1045
1055
  p({ attribute: !1 })
1046
- ], T.prototype, "rowLibrary", 2);
1047
- H([
1048
- d()
1049
- ], T.prototype, "_blockDefs", 2);
1050
- H([
1051
- d()
1052
- ], T.prototype, "_activeTab", 2);
1053
- H([
1054
- d()
1055
- ], T.prototype, "_brandTabLoaded", 2);
1056
- H([
1057
- d()
1058
- ], T.prototype, "_savedTabLoaded", 2);
1059
- T = H([
1060
- u("pigeon-palette")
1061
- ], T);
1062
- function qo(e, t) {
1056
+ ], $.prototype, "rowLibrary", 2);
1057
+ B([
1058
+ p({ attribute: !1 })
1059
+ ], $.prototype, "blocks", 2);
1060
+ B([
1061
+ c()
1062
+ ], $.prototype, "_blockDefs", 2);
1063
+ B([
1064
+ c()
1065
+ ], $.prototype, "_activeTab", 2);
1066
+ B([
1067
+ c()
1068
+ ], $.prototype, "_brandTabLoaded", 2);
1069
+ B([
1070
+ c()
1071
+ ], $.prototype, "_savedTabLoaded", 2);
1072
+ $ = B([
1073
+ h("pigeon-palette")
1074
+ ], $);
1075
+ function xo(e, t) {
1063
1076
  if (t.length === 0) return 0;
1064
1077
  for (let o = 0; o < t.length; o++) {
1065
1078
  const r = t[o].getBoundingClientRect(), i = r.top + r.height / 2;
@@ -1068,7 +1081,7 @@ function qo(e, t) {
1068
1081
  }
1069
1082
  return t.length;
1070
1083
  }
1071
- function Vo(e, t) {
1084
+ function wo(e, t) {
1072
1085
  if (t.length === 0) return 0;
1073
1086
  for (let o = 0; o < t.length; o++) {
1074
1087
  const r = t[o].getBoundingClientRect(), i = r.top + r.height / 2;
@@ -1077,15 +1090,15 @@ function Vo(e, t) {
1077
1090
  }
1078
1091
  return t.length;
1079
1092
  }
1080
- function to(e, t) {
1093
+ function Et(e, t) {
1081
1094
  return e < 0 || t === e || t === e + 1 ? null : t > e ? t - 1 : t;
1082
1095
  }
1083
- var Yo = Object.defineProperty, Xo = Object.getOwnPropertyDescriptor, oo = (e, t, o, r) => {
1084
- for (var i = r > 1 ? void 0 : r ? Xo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
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--)
1085
1098
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1086
- return r && i && Yo(t, o, i), i;
1099
+ return r && i && $o(t, o, i), i;
1087
1100
  };
1088
- let Ge = class extends g {
1101
+ let Le = class extends d {
1089
1102
  constructor() {
1090
1103
  super(...arguments), this.visible = !1;
1091
1104
  }
@@ -1098,7 +1111,7 @@ let Ge = class extends g {
1098
1111
  `;
1099
1112
  }
1100
1113
  };
1101
- Ge.styles = b`
1114
+ Le.styles = g`
1102
1115
  :host {
1103
1116
  display: block;
1104
1117
  height: 4px;
@@ -1142,18 +1155,18 @@ Ge.styles = b`
1142
1155
  right: 4px;
1143
1156
  }
1144
1157
  `;
1145
- oo([
1158
+ Bt([
1146
1159
  p({ type: Boolean, reflect: !0 })
1147
- ], Ge.prototype, "visible", 2);
1148
- Ge = oo([
1149
- u("pigeon-drop-indicator")
1150
- ], Ge);
1151
- var Go = Object.defineProperty, Jo = Object.getOwnPropertyDescriptor, tt = (e, t, o, r) => {
1152
- for (var i = r > 1 ? void 0 : r ? Jo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1160
+ ], Le.prototype, "visible", 2);
1161
+ Le = Bt([
1162
+ h("pigeon-drop-indicator")
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--)
1153
1166
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1154
- return r && i && Go(t, o, i), i;
1167
+ return r && i && Co(t, o, i), i;
1155
1168
  };
1156
- let de = class extends g {
1169
+ let ae = class extends d {
1157
1170
  constructor() {
1158
1171
  super(...arguments), this.selected = !1, this.editing = !1, this._editor = null, this._editorHost = null;
1159
1172
  }
@@ -1167,7 +1180,7 @@ let de = class extends g {
1167
1180
  @click=${this._handleClick}
1168
1181
  @dblclick=${this._handleDblClick}
1169
1182
  >
1170
- ${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>`}
1171
1184
  </div>
1172
1185
  `;
1173
1186
  }
@@ -1181,7 +1194,7 @@ let de = class extends g {
1181
1194
  const e = this.renderRoot.querySelector(".content");
1182
1195
  if (!e) return;
1183
1196
  this._editorHost = e;
1184
- const t = await xt();
1197
+ const t = await it();
1185
1198
  !this.editing || !this._editorHost || (this._editor = t.createEditor({
1186
1199
  element: this._editorHost,
1187
1200
  initialHTML: this.block.values.content,
@@ -1221,7 +1234,7 @@ let de = class extends g {
1221
1234
  }));
1222
1235
  }
1223
1236
  };
1224
- de.styles = b`
1237
+ ae.styles = g`
1225
1238
  :host {
1226
1239
  display: block;
1227
1240
  cursor: pointer;
@@ -1261,24 +1274,24 @@ de.styles = b`
1261
1274
  outline: none;
1262
1275
  }
1263
1276
  `;
1264
- tt([
1277
+ Ae([
1265
1278
  p({ type: Object })
1266
- ], de.prototype, "block", 2);
1267
- tt([
1279
+ ], ae.prototype, "block", 2);
1280
+ Ae([
1268
1281
  p({ type: Boolean, reflect: !0 })
1269
- ], de.prototype, "selected", 2);
1270
- tt([
1282
+ ], ae.prototype, "selected", 2);
1283
+ Ae([
1271
1284
  p({ type: Boolean, reflect: !0 })
1272
- ], de.prototype, "editing", 2);
1273
- de = tt([
1274
- u("pigeon-text-block")
1275
- ], de);
1276
- var Zo = Object.defineProperty, Qo = Object.getOwnPropertyDescriptor, Ct = (e, t, o, r) => {
1277
- for (var i = r > 1 ? void 0 : r ? Qo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1285
+ ], ae.prototype, "editing", 2);
1286
+ ae = Ae([
1287
+ h("pigeon-text-block")
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--)
1278
1291
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1279
- return r && i && Zo(t, o, i), i;
1292
+ return r && i && Po(t, o, i), i;
1280
1293
  };
1281
- let Ae = class extends g {
1294
+ let we = class extends d {
1282
1295
  constructor() {
1283
1296
  super(...arguments), this.selected = !1;
1284
1297
  }
@@ -1316,7 +1329,7 @@ let Ae = class extends g {
1316
1329
  }));
1317
1330
  }
1318
1331
  };
1319
- Ae.styles = b`
1332
+ we.styles = g`
1320
1333
  :host {
1321
1334
  display: block;
1322
1335
  cursor: pointer;
@@ -1364,21 +1377,21 @@ Ae.styles = b`
1364
1377
  opacity: 0.5;
1365
1378
  }
1366
1379
  `;
1367
- Ct([
1380
+ st([
1368
1381
  p({ type: Object })
1369
- ], Ae.prototype, "block", 2);
1370
- Ct([
1382
+ ], we.prototype, "block", 2);
1383
+ st([
1371
1384
  p({ type: Boolean, reflect: !0 })
1372
- ], Ae.prototype, "selected", 2);
1373
- Ae = Ct([
1374
- u("pigeon-image-block")
1375
- ], Ae);
1376
- var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ot = (e, t, o, r) => {
1377
- for (var i = r > 1 ? void 0 : r ? ti(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1385
+ ], we.prototype, "selected", 2);
1386
+ we = st([
1387
+ h("pigeon-image-block")
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--)
1378
1391
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1379
- return r && i && ei(t, o, i), i;
1392
+ return r && i && So(t, o, i), i;
1380
1393
  };
1381
- let he = class extends g {
1394
+ let se = class extends d {
1382
1395
  constructor() {
1383
1396
  super(...arguments), this.selected = !1, this.editing = !1, this._editor = null, this._editorHost = null;
1384
1397
  }
@@ -1404,7 +1417,7 @@ let he = class extends g {
1404
1417
  href="${e.href}"
1405
1418
  style="${i}"
1406
1419
  @click=${this._preventNav}
1407
- >${this.editing ? l`` : eo(n)}</a>
1420
+ >${this.editing ? l`` : Dt(Me(n))}</a>
1408
1421
  </div>
1409
1422
  `;
1410
1423
  }
@@ -1418,12 +1431,12 @@ let he = class extends g {
1418
1431
  const e = this.renderRoot.querySelector(".button");
1419
1432
  if (!e) return;
1420
1433
  this._editorHost = e;
1421
- const t = await xt();
1434
+ const t = await it();
1422
1435
  !this.editing || !this._editorHost || (this._editor = t.createEditor({
1423
1436
  element: this._editorHost,
1424
1437
  initialHTML: this.block.values.content,
1425
1438
  onBlur: (o) => this._commit(o),
1426
- onEscape: () => this._exit()
1439
+ onEscape: (o) => this._commit(o)
1427
1440
  }));
1428
1441
  }
1429
1442
  _teardownEditor() {
@@ -1443,10 +1456,6 @@ let he = class extends g {
1443
1456
  composed: !0
1444
1457
  }));
1445
1458
  }
1446
- _exit() {
1447
- const e = this._editor ? this._editor.getHTML() : this.block.values.content;
1448
- this._commit(e);
1449
- }
1450
1459
  _preventNav(e) {
1451
1460
  e.preventDefault();
1452
1461
  }
@@ -1465,7 +1474,7 @@ let he = class extends g {
1465
1474
  }));
1466
1475
  }
1467
1476
  };
1468
- he.styles = b`
1477
+ se.styles = g`
1469
1478
  :host {
1470
1479
  display: block;
1471
1480
  cursor: pointer;
@@ -1516,24 +1525,24 @@ he.styles = b`
1516
1525
  display: inline;
1517
1526
  }
1518
1527
  `;
1519
- ot([
1528
+ Fe([
1520
1529
  p({ type: Object })
1521
- ], he.prototype, "block", 2);
1522
- ot([
1530
+ ], se.prototype, "block", 2);
1531
+ Fe([
1523
1532
  p({ type: Boolean, reflect: !0 })
1524
- ], he.prototype, "selected", 2);
1525
- ot([
1533
+ ], se.prototype, "selected", 2);
1534
+ Fe([
1526
1535
  p({ type: Boolean, reflect: !0 })
1527
- ], he.prototype, "editing", 2);
1528
- he = ot([
1529
- u("pigeon-button-block")
1530
- ], he);
1531
- var oi = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, It = (e, t, o, r) => {
1532
- for (var i = r > 1 ? void 0 : r ? ii(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1536
+ ], se.prototype, "editing", 2);
1537
+ se = Fe([
1538
+ h("pigeon-button-block")
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--)
1533
1542
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1534
- return r && i && oi(t, o, i), i;
1543
+ return r && i && Do(t, o, i), i;
1535
1544
  };
1536
- let Be = class extends g {
1545
+ let $e = class extends d {
1537
1546
  constructor() {
1538
1547
  super(...arguments), this.selected = !1;
1539
1548
  }
@@ -1561,7 +1570,7 @@ let Be = class extends g {
1561
1570
  }));
1562
1571
  }
1563
1572
  };
1564
- Be.styles = b`
1573
+ $e.styles = g`
1565
1574
  :host {
1566
1575
  display: block;
1567
1576
  cursor: pointer;
@@ -1588,21 +1597,21 @@ Be.styles = b`
1588
1597
  margin: 0;
1589
1598
  }
1590
1599
  `;
1591
- It([
1600
+ lt([
1592
1601
  p({ type: Object })
1593
- ], Be.prototype, "block", 2);
1594
- It([
1602
+ ], $e.prototype, "block", 2);
1603
+ lt([
1595
1604
  p({ type: Boolean, reflect: !0 })
1596
- ], Be.prototype, "selected", 2);
1597
- Be = It([
1598
- u("pigeon-divider-block")
1599
- ], Be);
1600
- var ri = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, Tt = (e, t, o, r) => {
1601
- for (var i = r > 1 ? void 0 : r ? ni(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1605
+ ], $e.prototype, "selected", 2);
1606
+ $e = lt([
1607
+ h("pigeon-divider-block")
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--)
1602
1611
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1603
- return r && i && ri(t, o, i), i;
1612
+ return r && i && Bo(t, o, i), i;
1604
1613
  };
1605
- let je = class extends g {
1614
+ let ke = class extends d {
1606
1615
  constructor() {
1607
1616
  super(...arguments), this.selected = !1;
1608
1617
  }
@@ -1627,7 +1636,7 @@ let je = class extends g {
1627
1636
  }));
1628
1637
  }
1629
1638
  };
1630
- je.styles = b`
1639
+ ke.styles = g`
1631
1640
  :host {
1632
1641
  display: block;
1633
1642
  cursor: pointer;
@@ -1669,21 +1678,21 @@ je.styles = b`
1669
1678
  opacity: 1;
1670
1679
  }
1671
1680
  `;
1672
- Tt([
1681
+ pt([
1673
1682
  p({ type: Object })
1674
- ], je.prototype, "block", 2);
1675
- Tt([
1683
+ ], ke.prototype, "block", 2);
1684
+ pt([
1676
1685
  p({ type: Boolean, reflect: !0 })
1677
- ], je.prototype, "selected", 2);
1678
- je = Tt([
1679
- u("pigeon-spacer-block")
1680
- ], je);
1681
- var ai = Object.defineProperty, si = Object.getOwnPropertyDescriptor, Pt = (e, t, o, r) => {
1682
- for (var i = r > 1 ? void 0 : r ? si(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1686
+ ], ke.prototype, "selected", 2);
1687
+ ke = pt([
1688
+ h("pigeon-spacer-block")
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--)
1683
1692
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1684
- return r && i && ai(t, o, i), i;
1693
+ return r && i && Ro(t, o, i), i;
1685
1694
  };
1686
- const li = {
1695
+ const zo = {
1687
1696
  facebook: "f",
1688
1697
  twitter: "𝕏",
1689
1698
  instagram: "ig",
@@ -1691,7 +1700,7 @@ const li = {
1691
1700
  youtube: "▶",
1692
1701
  tiktok: "♪",
1693
1702
  custom: "★"
1694
- }, pi = {
1703
+ }, Mo = {
1695
1704
  facebook: "#1877F2",
1696
1705
  twitter: "#000000",
1697
1706
  instagram: "#E4405F",
@@ -1700,7 +1709,7 @@ const li = {
1700
1709
  tiktok: "#000000",
1701
1710
  custom: "#6b7280"
1702
1711
  };
1703
- let Me = class extends g {
1712
+ let Ce = class extends d {
1704
1713
  constructor() {
1705
1714
  super(...arguments), this.selected = !1;
1706
1715
  }
@@ -1720,7 +1729,7 @@ let Me = class extends g {
1720
1729
  ${e.icons.length === 0 ? l`<div class="empty-state">Add social icons in properties</div>` : l`
1721
1730
  <div class="icons-container" style="justify-content: ${o[e.alignment]}; gap: ${e.spacing}px;">
1722
1731
  ${e.icons.map((r) => {
1723
- const i = pi[r.type] ?? "#6b7280", n = li[r.type] ?? "?";
1732
+ const i = Mo[r.type] ?? "#6b7280", n = zo[r.type] ?? "?";
1724
1733
  return l`
1725
1734
  <a
1726
1735
  class="social-icon"
@@ -1747,7 +1756,7 @@ let Me = class extends g {
1747
1756
  }));
1748
1757
  }
1749
1758
  };
1750
- Me.styles = b`
1759
+ Ce.styles = g`
1751
1760
  :host {
1752
1761
  display: block;
1753
1762
  cursor: pointer;
@@ -1795,21 +1804,21 @@ Me.styles = b`
1795
1804
  font-size: 13px;
1796
1805
  }
1797
1806
  `;
1798
- Pt([
1807
+ ct([
1799
1808
  p({ type: Object })
1800
- ], Me.prototype, "block", 2);
1801
- Pt([
1809
+ ], Ce.prototype, "block", 2);
1810
+ ct([
1802
1811
  p({ type: Boolean, reflect: !0 })
1803
- ], Me.prototype, "selected", 2);
1804
- Me = Pt([
1805
- u("pigeon-social-block")
1806
- ], Me);
1807
- var ci = Object.defineProperty, di = Object.getOwnPropertyDescriptor, St = (e, t, o, r) => {
1808
- for (var i = r > 1 ? void 0 : r ? di(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1812
+ ], Ce.prototype, "selected", 2);
1813
+ Ce = ct([
1814
+ h("pigeon-social-block")
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--)
1809
1818
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1810
- return r && i && ci(t, o, i), i;
1819
+ return r && i && Ao(t, o, i), i;
1811
1820
  };
1812
- let Re = class extends g {
1821
+ let Ie = class extends d {
1813
1822
  constructor() {
1814
1823
  super(...arguments), this.selected = !1;
1815
1824
  }
@@ -1837,7 +1846,9 @@ let Re = class extends g {
1837
1846
  var o;
1838
1847
  const t = e.target;
1839
1848
  (o = this._resizer) == null || o.disconnect(), this._resizer = new ResizeObserver(() => {
1840
- t.style.height = `${t.contentDocument.body.scrollHeight}px`;
1849
+ var i;
1850
+ const r = (i = t.contentDocument) == null ? void 0 : i.body;
1851
+ r && (t.style.height = `${r.scrollHeight}px`);
1841
1852
  }), this._resizer.observe(t);
1842
1853
  }
1843
1854
  _handleClick(e) {
@@ -1848,7 +1859,7 @@ let Re = class extends g {
1848
1859
  }));
1849
1860
  }
1850
1861
  };
1851
- Re.styles = b`
1862
+ Ie.styles = g`
1852
1863
  :host {
1853
1864
  display: block;
1854
1865
  cursor: pointer;
@@ -1890,21 +1901,21 @@ Re.styles = b`
1890
1901
  font-size: 13px;
1891
1902
  }
1892
1903
  `;
1893
- St([
1904
+ dt([
1894
1905
  p({ type: Object })
1895
- ], Re.prototype, "block", 2);
1896
- St([
1906
+ ], Ie.prototype, "block", 2);
1907
+ dt([
1897
1908
  p({ type: Boolean, reflect: !0 })
1898
- ], Re.prototype, "selected", 2);
1899
- Re = St([
1900
- u("pigeon-html-block")
1901
- ], Re);
1902
- var hi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, it = (e, t, o, r) => {
1903
- for (var i = r > 1 ? void 0 : r ? gi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1909
+ ], Ie.prototype, "selected", 2);
1910
+ Ie = dt([
1911
+ h("pigeon-html-block")
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--)
1904
1915
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
1905
- return r && i && hi(t, o, i), i;
1916
+ return r && i && Ho(t, o, i), i;
1906
1917
  };
1907
- let ge = class extends g {
1918
+ let le = class extends d {
1908
1919
  constructor() {
1909
1920
  super(...arguments), this.selected = !1, this.editing = !1, this._editor = null, this._editorHost = null;
1910
1921
  }
@@ -1914,7 +1925,7 @@ let ge = class extends g {
1914
1925
  top: "flex-start",
1915
1926
  middle: "center",
1916
1927
  bottom: "flex-end"
1917
- }, i = e.backgroundUrl ? `background-image: url(${e.backgroundUrl}); background-position: ${e.backgroundPosition};` : `background-color: ${e.backgroundColor};`, n = e.mode === "fixed-height" ? `height: ${e.height}px;` : `min-height: ${e.height}px;`, a = e.backgroundUrl || e.content, h = this.editing;
1928
+ }, i = e.backgroundUrl ? `background-image: url(${e.backgroundUrl}); background-position: ${e.backgroundPosition};` : `background-color: ${e.backgroundColor};`, n = e.mode === "fixed-height" ? `height: ${e.height}px;` : `min-height: ${e.height}px;`, a = e.backgroundUrl || e.content, u = this.editing;
1918
1929
  return l`
1919
1930
  <div
1920
1931
  class="wrapper"
@@ -1922,7 +1933,7 @@ let ge = class extends g {
1922
1933
  @click=${this._handleClick}
1923
1934
  @dblclick=${this._handleDblClick}
1924
1935
  >
1925
- ${h ? 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`
1926
1937
  <div class="empty-state">
1927
1938
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
1928
1939
  <rect x="2" y="2" width="20" height="20" rx="2"/>
@@ -1945,12 +1956,12 @@ let ge = class extends g {
1945
1956
  const e = this.renderRoot.querySelector(".content");
1946
1957
  if (!e) return;
1947
1958
  this._editorHost = e;
1948
- const t = await xt();
1959
+ const t = await it();
1949
1960
  !this.editing || !this._editorHost || (this._editor = t.createEditor({
1950
1961
  element: this._editorHost,
1951
1962
  initialHTML: this.block.values.content || "<p></p>",
1952
1963
  onBlur: (o) => this._commit(o),
1953
- onEscape: () => this._exit()
1964
+ onEscape: (o) => this._commit(o)
1954
1965
  }));
1955
1966
  }
1956
1967
  _teardownEditor() {
@@ -1970,10 +1981,6 @@ let ge = class extends g {
1970
1981
  composed: !0
1971
1982
  }));
1972
1983
  }
1973
- _exit() {
1974
- const e = this._editor ? this._editor.getHTML() : this.block.values.content;
1975
- this._commit(e);
1976
- }
1977
1984
  _handleClick(e) {
1978
1985
  e.stopPropagation(), e.preventDefault(), !this.editing && this.dispatchEvent(new CustomEvent("block-select", {
1979
1986
  detail: { blockId: this.block.id },
@@ -1989,7 +1996,7 @@ let ge = class extends g {
1989
1996
  }));
1990
1997
  }
1991
1998
  };
1992
- ge.styles = b`
1999
+ le.styles = g`
1993
2000
  :host {
1994
2001
  display: block;
1995
2002
  cursor: pointer;
@@ -2049,24 +2056,24 @@ ge.styles = b`
2049
2056
  outline: none;
2050
2057
  }
2051
2058
  `;
2052
- it([
2059
+ He([
2053
2060
  p({ type: Object })
2054
- ], ge.prototype, "block", 2);
2055
- it([
2061
+ ], le.prototype, "block", 2);
2062
+ He([
2056
2063
  p({ type: Boolean, reflect: !0 })
2057
- ], ge.prototype, "selected", 2);
2058
- it([
2064
+ ], le.prototype, "selected", 2);
2065
+ He([
2059
2066
  p({ type: Boolean, reflect: !0 })
2060
- ], ge.prototype, "editing", 2);
2061
- ge = it([
2062
- u("pigeon-hero-block")
2063
- ], ge);
2064
- var ui = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ot = (e, t, o, r) => {
2065
- for (var i = r > 1 ? void 0 : r ? bi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
2067
+ ], le.prototype, "editing", 2);
2068
+ le = He([
2069
+ h("pigeon-hero-block")
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--)
2066
2073
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
2067
- return r && i && ui(t, o, i), i;
2074
+ return r && i && No(t, o, i), i;
2068
2075
  };
2069
- let Le = class extends g {
2076
+ let Pe = class extends d {
2070
2077
  constructor() {
2071
2078
  super(...arguments), this.selected = !1;
2072
2079
  }
@@ -2109,7 +2116,7 @@ let Le = class extends g {
2109
2116
  }));
2110
2117
  }
2111
2118
  };
2112
- Le.styles = b`
2119
+ Pe.styles = g`
2113
2120
  :host {
2114
2121
  display: block;
2115
2122
  cursor: pointer;
@@ -2157,23 +2164,49 @@ Le.styles = b`
2157
2164
  font-size: 13px;
2158
2165
  }
2159
2166
  `;
2160
- Ot([
2167
+ ht([
2161
2168
  p({ type: Object })
2162
- ], Le.prototype, "block", 2);
2163
- Ot([
2169
+ ], Pe.prototype, "block", 2);
2170
+ ht([
2164
2171
  p({ type: Boolean, reflect: !0 })
2165
- ], Le.prototype, "selected", 2);
2166
- Le = Ot([
2167
- u("pigeon-navbar-block")
2168
- ], Le);
2169
- var vi = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, Z = (e, t, o, r) => {
2170
- for (var i = r > 1 ? void 0 : r ? fi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
2172
+ ], Pe.prototype, "selected", 2);
2173
+ Pe = ht([
2174
+ h("pigeon-navbar-block")
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--)
2171
2204
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
2172
- return r && i && vi(t, o, i), i;
2205
+ return r && i && Wo(t, o, i), i;
2173
2206
  };
2174
- let A = class extends g {
2207
+ let k = class extends d {
2175
2208
  constructor() {
2176
- 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;
2177
2210
  }
2178
2211
  render() {
2179
2212
  if (!this.column) return l``;
@@ -2190,8 +2223,11 @@ let A = class extends g {
2190
2223
  <pigeon-drop-indicator
2191
2224
  ?visible=${this._isDragOver && this._dropIndex === n}
2192
2225
  ></pigeon-drop-indicator>
2193
- <div class="block-wrapper ${this._draggingBlockId === i.id ? "dragging" : ""}">
2194
- <button
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
2195
2231
  class="block-drag-handle"
2196
2232
  title="Drag to reorder"
2197
2233
  draggable="true"
@@ -2202,7 +2238,7 @@ let A = class extends g {
2202
2238
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
2203
2239
  <path d="M9 5v14M15 5v14" />
2204
2240
  </svg>
2205
- </button>
2241
+ </button>`}
2206
2242
  ${this._renderBlock(i)}
2207
2243
  </div>
2208
2244
  `)}
@@ -2257,7 +2293,7 @@ let A = class extends g {
2257
2293
  * failing with "Unknown block type".
2258
2294
  */
2259
2295
  _renderCustomBlock(e, t) {
2260
- const o = yt(e.type), r = e, i = o != null && o.renderCanvas ? eo(o.renderCanvas(r)) : l`<span class="custom-block__label"
2296
+ const o = et(e.type), r = e, i = o != null && o.renderCanvas ? Dt(Me(o.renderCanvas(r))) : l`<span class="custom-block__label"
2261
2297
  >${(o == null ? void 0 : o.label) ?? e.type}</span
2262
2298
  >`;
2263
2299
  return l`<div
@@ -2280,27 +2316,27 @@ let A = class extends g {
2280
2316
  );
2281
2317
  }
2282
2318
  _onDragOver(e) {
2283
- const t = Ee();
2284
- if (!t || t.type !== "palette-block" && t.type !== "existing-block") return;
2319
+ const t = _e();
2320
+ if (!t || this.locked || t.type !== "palette-block" && t.type !== "existing-block") return;
2285
2321
  e.preventDefault(), e.stopPropagation(), e.dataTransfer && (e.dataTransfer.dropEffect = t.type === "existing-block" ? "move" : "copy"), this._isDragOver = !0;
2286
2322
  const o = Array.from(
2287
2323
  this.renderRoot.querySelectorAll(
2288
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"
2289
2325
  )
2290
2326
  );
2291
- this._dropIndex = Vo(e.clientY, o);
2327
+ this._dropIndex = wo(e.clientY, o);
2292
2328
  }
2293
2329
  _onDragLeave(e) {
2294
2330
  const t = this.getBoundingClientRect();
2295
2331
  e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom || (this._isDragOver = !1, this._dropIndex = -1);
2296
2332
  }
2297
2333
  _onDrop(e) {
2298
- const t = Ee();
2299
- if (!t || t.type !== "palette-block" && t.type !== "existing-block") return;
2334
+ const t = _e();
2335
+ if (!t || this.locked || t.type !== "palette-block" && t.type !== "existing-block") return;
2300
2336
  e.preventDefault(), e.stopPropagation();
2301
2337
  let o = this._dropIndex >= 0 ? this._dropIndex : this.column.blocks.length;
2302
2338
  if (t.type === "existing-block" && t.rowId === this.rowId && t.columnId === this.column.id) {
2303
- const r = this.column.blocks.findIndex((n) => n.id === t.blockId), i = to(r, o);
2339
+ const r = this.column.blocks.findIndex((n) => n.id === t.blockId), i = Et(r, o);
2304
2340
  if (i === null) {
2305
2341
  this._resetDragState();
2306
2342
  return;
@@ -2319,10 +2355,10 @@ let A = class extends g {
2319
2355
  })), this._resetDragState();
2320
2356
  }
2321
2357
  _resetDragState() {
2322
- this._isDragOver = !1, this._dropIndex = -1, Xe();
2358
+ this._isDragOver = !1, this._dropIndex = -1, Re();
2323
2359
  }
2324
2360
  _onBlockDragStart(e, t) {
2325
- if (wt(e, {
2361
+ if (nt(e, {
2326
2362
  type: "existing-block",
2327
2363
  blockId: t,
2328
2364
  rowId: this.rowId,
@@ -2334,10 +2370,10 @@ let A = class extends g {
2334
2370
  this._draggingBlockId = t;
2335
2371
  }
2336
2372
  _onBlockDragEnd() {
2337
- this._draggingBlockId = null, Xe();
2373
+ this._draggingBlockId = null, Re();
2338
2374
  }
2339
2375
  };
2340
- A.styles = b`
2376
+ k.styles = g`
2341
2377
  :host {
2342
2378
  display: block;
2343
2379
  min-height: 40px;
@@ -2452,70 +2488,85 @@ A.styles = b`
2452
2488
  font-size: 12px;
2453
2489
  text-align: center;
2454
2490
  }
2491
+
2492
+ ${jt}
2455
2493
  `;
2456
- Z([
2494
+ j([
2457
2495
  p({ type: Object })
2458
- ], A.prototype, "column", 2);
2459
- Z([
2496
+ ], k.prototype, "column", 2);
2497
+ j([
2460
2498
  p({ type: String, attribute: "row-id" })
2461
- ], A.prototype, "rowId", 2);
2462
- Z([
2499
+ ], k.prototype, "rowId", 2);
2500
+ j([
2463
2501
  p({ type: Object })
2464
- ], A.prototype, "selection", 2);
2465
- Z([
2502
+ ], k.prototype, "selection", 2);
2503
+ j([
2466
2504
  p({ type: String, attribute: "editing-block-id" })
2467
- ], A.prototype, "editingBlockId", 2);
2468
- Z([
2469
- d()
2470
- ], A.prototype, "_dropIndex", 2);
2471
- Z([
2472
- d()
2473
- ], A.prototype, "_isDragOver", 2);
2474
- Z([
2475
- d()
2476
- ], A.prototype, "_draggingBlockId", 2);
2477
- A = Z([
2478
- u("pigeon-column")
2479
- ], A);
2480
- var mi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, Q = (e, t, o, r) => {
2481
- for (var i = r > 1 ? void 0 : r ? _i(t, o) : t, n = e.length - 1, a; n >= 0; n--)
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([
2513
+ c()
2514
+ ], k.prototype, "_dropIndex", 2);
2515
+ j([
2516
+ c()
2517
+ ], k.prototype, "_isDragOver", 2);
2518
+ j([
2519
+ c()
2520
+ ], k.prototype, "_draggingBlockId", 2);
2521
+ k = j([
2522
+ h("pigeon-column")
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--)
2482
2526
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
2483
- return r && i && mi(t, o, i), i;
2527
+ return r && i && Vo(t, o, i), i;
2484
2528
  };
2485
- let B = class extends g {
2529
+ let C = class extends d {
2486
2530
  constructor() {
2487
- 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;
2488
2532
  }
2489
2533
  render() {
2490
- var n;
2534
+ var u;
2491
2535
  if (!this.row) return l``;
2492
- const e = ((n = this.selection) == null ? void 0 : n.type) === "row" && this.selection.rowId === this.row.id, t = this.row.attributes, o = t.backgroundColor ? `background-color: ${t.backgroundColor};` : "", r = t.backgroundImage ? `background-image: url(${t.backgroundImage}); background-size: cover; background-position: center;` : "", i = `padding: ${t.padding.top}px ${t.padding.right}px ${t.padding.bottom}px ${t.padding.left}px;`;
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;
2493
2537
  return l`
2494
2538
  <div
2495
- class="row-wrapper ${e ? "selected" : ""} ${this._dragging ? "dragging" : ""}"
2496
- style="${o} ${r} ${i}"
2539
+ class="row-wrapper ${e ? "selected" : ""} ${this._dragging ? "dragging" : ""} ${tt(t, this.device) ? "device-hidden" : ""}"
2540
+ style="${o} ${i} ${n}"
2497
2541
  @click=${this._onRowClick}
2498
2542
  >
2499
- <div class="row-label">Row</div>
2543
+ ${this.readonly ? "" : l`<div class="row-label">${a ? "Locked" : "Row"}</div>`}
2544
+ ${ot(t)}
2500
2545
 
2501
2546
  <div class="columns">
2502
- ${this.row.columns.map((a, h) => {
2503
- const v = (this.row.columnRatios[h] ?? 1) / 12 * 100;
2547
+ ${this.row.columns.map((b, _) => {
2548
+ const Ee = (this.row.columnRatios[_] ?? 1) / 12 * 100;
2504
2549
  return l`
2505
- <div class="column-wrapper" style="width: ${v}%;">
2550
+ <div
2551
+ class="column-wrapper ${tt(b.attributes, this.device) ? "device-hidden" : ""}"
2552
+ style="width: ${Ee}%;"
2553
+ >
2554
+ ${ot(b.attributes)}
2506
2555
  <pigeon-column
2507
- .column=${a}
2556
+ .column=${b}
2508
2557
  row-id="${this.row.id}"
2509
2558
  .selection=${this.selection}
2510
2559
  .editingBlockId=${this.editingBlockId}
2560
+ .device=${this.device}
2561
+ ?locked=${a || this.readonly}
2511
2562
  ></pigeon-column>
2512
2563
  </div>
2513
2564
  `;
2514
2565
  })}
2515
2566
  </div>
2516
2567
 
2517
- <div class="actions">
2518
- <button
2568
+ ${this.readonly ? "" : l`<div class="actions">
2569
+ ${a ? "" : l`<button
2519
2570
  class="action-btn drag-handle"
2520
2571
  title="Drag to reorder"
2521
2572
  draggable="true"
@@ -2550,7 +2601,7 @@ let B = class extends g {
2550
2601
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2551
2602
  <polyline points="6 9 12 15 18 9"/>
2552
2603
  </svg>
2553
- </button>
2604
+ </button>`}
2554
2605
  <button
2555
2606
  class="action-btn"
2556
2607
  title="Save to library"
@@ -2560,7 +2611,7 @@ let B = class extends g {
2560
2611
  <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/>
2561
2612
  </svg>
2562
2613
  </button>
2563
- <button
2614
+ ${a ? "" : l`<button
2564
2615
  class="action-btn"
2565
2616
  title="Duplicate"
2566
2617
  @click=${this._onDuplicate}
@@ -2579,8 +2630,8 @@ let B = class extends g {
2579
2630
  <polyline points="3 6 5 6 21 6"/>
2580
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"/>
2581
2632
  </svg>
2582
- </button>
2583
- </div>
2633
+ </button>`}
2634
+ </div>`}
2584
2635
  </div>
2585
2636
  `;
2586
2637
  }
@@ -2629,7 +2680,7 @@ let B = class extends g {
2629
2680
  }));
2630
2681
  }
2631
2682
  _onDragStart(e) {
2632
- if (wt(e, {
2683
+ if (nt(e, {
2633
2684
  type: "existing-row",
2634
2685
  rowId: this.row.id
2635
2686
  }), e.dataTransfer) {
@@ -2639,10 +2690,10 @@ let B = class extends g {
2639
2690
  this._dragging = !0;
2640
2691
  }
2641
2692
  _onDragEnd() {
2642
- this._dragging = !1, Xe();
2693
+ this._dragging = !1, Re();
2643
2694
  }
2644
2695
  };
2645
- B.styles = b`
2696
+ C.styles = g`
2646
2697
  :host {
2647
2698
  display: block;
2648
2699
  position: relative;
@@ -2681,6 +2732,7 @@ B.styles = b`
2681
2732
  }
2682
2733
 
2683
2734
  .column-wrapper {
2735
+ position: relative;
2684
2736
  box-sizing: border-box;
2685
2737
  }
2686
2738
 
@@ -2772,39 +2824,47 @@ B.styles = b`
2772
2824
  .row-wrapper.selected .row-label {
2773
2825
  opacity: 1;
2774
2826
  }
2827
+
2828
+ ${jt}
2775
2829
  `;
2776
- Q([
2830
+ R([
2777
2831
  p({ type: Object })
2778
- ], B.prototype, "row", 2);
2779
- Q([
2832
+ ], C.prototype, "row", 2);
2833
+ R([
2780
2834
  p({ type: Number })
2781
- ], B.prototype, "index", 2);
2782
- Q([
2835
+ ], C.prototype, "index", 2);
2836
+ R([
2783
2837
  p({ type: Number, attribute: "total-rows" })
2784
- ], B.prototype, "totalRows", 2);
2785
- Q([
2838
+ ], C.prototype, "totalRows", 2);
2839
+ R([
2786
2840
  p({ type: Object })
2787
- ], B.prototype, "selection", 2);
2788
- Q([
2841
+ ], C.prototype, "selection", 2);
2842
+ R([
2789
2843
  p({ type: String, attribute: "editing-block-id" })
2790
- ], B.prototype, "editingBlockId", 2);
2791
- Q([
2844
+ ], C.prototype, "editingBlockId", 2);
2845
+ R([
2792
2846
  p({ type: Boolean, attribute: "show-actions", reflect: !0 })
2793
- ], B.prototype, "showActions", 2);
2794
- Q([
2795
- d()
2796
- ], B.prototype, "_dragging", 2);
2797
- B = Q([
2798
- u("pigeon-row")
2799
- ], B);
2800
- var yi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, F = (e, t, o, r) => {
2801
- for (var i = r > 1 ? void 0 : r ? xi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
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([
2855
+ c()
2856
+ ], C.prototype, "_dragging", 2);
2857
+ C = R([
2858
+ h("pigeon-row")
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--)
2802
2862
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
2803
- return r && i && yi(t, o, i), i;
2863
+ return r && i && Xo(t, o, i), i;
2804
2864
  };
2805
- let P = class extends g {
2865
+ let I = class extends d {
2806
2866
  constructor() {
2807
- 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) => {
2808
2868
  var r;
2809
2869
  const t = e.composedPath().find(
2810
2870
  (i) => i instanceof HTMLElement && i.tagName.toLowerCase() === "pigeon-row"
@@ -2870,16 +2930,18 @@ let P = class extends g {
2870
2930
  ` : l`
2871
2931
  <div class="rows-container">
2872
2932
  ${o.map(
2873
- (a, h) => l`
2933
+ (a, u) => l`
2874
2934
  <pigeon-drop-indicator
2875
- ?visible=${this._isDragOver && this._rowDropIndex === h}
2935
+ ?visible=${this._isDragOver && this._rowDropIndex === u}
2876
2936
  ></pigeon-drop-indicator>
2877
2937
  <pigeon-row
2878
2938
  .row=${a}
2879
- .index=${h}
2939
+ .index=${u}
2880
2940
  .totalRows=${o.length}
2881
2941
  .selection=${this.selection}
2882
2942
  .editingBlockId=${this.editingBlockId}
2943
+ .device=${this.device}
2944
+ ?readonly=${this.readonly}
2883
2945
  ?show-actions=${this._hoveredRowId === a.id || this._hoveredRowId === null && i === a.id}
2884
2946
  ></pigeon-row>
2885
2947
  `
@@ -2901,12 +2963,12 @@ let P = class extends g {
2901
2963
  }));
2902
2964
  }
2903
2965
  _onDragOver(e) {
2904
- const t = Ee();
2905
- 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)) {
2966
+ const t = _e();
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)) {
2906
2968
  const o = Array.from(
2907
2969
  this.renderRoot.querySelectorAll("pigeon-row")
2908
2970
  );
2909
- this._rowDropIndex = qo(e.clientY, o);
2971
+ this._rowDropIndex = xo(e.clientY, o);
2910
2972
  }
2911
2973
  }
2912
2974
  _onDragLeave(e) {
@@ -2916,7 +2978,7 @@ let P = class extends g {
2916
2978
  }
2917
2979
  _onDrop(e) {
2918
2980
  e.preventDefault();
2919
- const t = Ee();
2981
+ const t = _e();
2920
2982
  if (!t) {
2921
2983
  this._resetDragState();
2922
2984
  return;
@@ -2939,7 +3001,7 @@ let P = class extends g {
2939
3001
  composed: !0
2940
3002
  }));
2941
3003
  } else if (t.type === "existing-row" && t.rowId) {
2942
- const o = this.doc.body.rows.findIndex((n) => n.id === t.rowId), r = this._rowDropIndex >= 0 ? this._rowDropIndex : this.doc.body.rows.length, i = to(o, r);
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);
2943
3005
  i !== null && this.dispatchEvent(new CustomEvent("row-move", {
2944
3006
  detail: { rowId: t.rowId, toIndex: i },
2945
3007
  bubbles: !0,
@@ -2956,10 +3018,10 @@ let P = class extends g {
2956
3018
  this._resetDragState();
2957
3019
  }
2958
3020
  _resetDragState() {
2959
- this._isDragOver = !1, this._rowDropIndex = -1, Xe();
3021
+ this._isDragOver = !1, this._rowDropIndex = -1, Re();
2960
3022
  }
2961
3023
  };
2962
- P.styles = b`
3024
+ I.styles = g`
2963
3025
  :host {
2964
3026
  display: block;
2965
3027
  flex: 1;
@@ -3088,383 +3150,37 @@ P.styles = b`
3088
3150
  border-radius: var(--pigeon-radius, 6px);
3089
3151
  }
3090
3152
  `;
3091
- F([
3153
+ L([
3092
3154
  p({ type: Object })
3093
- ], P.prototype, "doc", 2);
3094
- F([
3155
+ ], I.prototype, "doc", 2);
3156
+ L([
3095
3157
  p({ type: Object })
3096
- ], P.prototype, "selection", 2);
3097
- F([
3158
+ ], I.prototype, "selection", 2);
3159
+ L([
3098
3160
  p({ type: String, attribute: "editing-block-id" })
3099
- ], P.prototype, "editingBlockId", 2);
3100
- F([
3161
+ ], I.prototype, "editingBlockId", 2);
3162
+ L([
3101
3163
  p({ type: Number, attribute: "preview-width" })
3102
- ], P.prototype, "previewWidth", 2);
3103
- F([
3164
+ ], I.prototype, "previewWidth", 2);
3165
+ L([
3104
3166
  p({ type: String })
3105
- ], P.prototype, "device", 2);
3106
- F([
3107
- d()
3108
- ], P.prototype, "_rowDropIndex", 2);
3109
- F([
3110
- d()
3111
- ], P.prototype, "_isDragOver", 2);
3112
- F([
3113
- d()
3114
- ], P.prototype, "_hoveredRowId", 2);
3115
- P = F([
3116
- u("pigeon-canvas")
3117
- ], P);
3118
- /**
3119
- * @license
3120
- * Copyright 2017 Google LLC
3121
- * SPDX-License-Identifier: BSD-3-Clause
3122
- */
3123
- const Se = globalThis, Wt = (e) => e, Je = Se.trustedTypes, qt = Je ? Je.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, io = "$lit$", q = `lit$${Math.random().toFixed(9).slice(2)}$`, ro = "?" + q, $i = `<${ro}>`, ne = document, Ze = () => ne.createComment(""), ze = (e) => e === null || typeof e != "object" && typeof e != "function", Et = Array.isArray, wi = (e) => Et(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", bt = `[
3124
- \f\r]`, Pe = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Vt = /-->/g, Yt = />/g, ie = RegExp(`>|${bt}(?:([^\\s"'>=/]+)(${bt}*=${bt}*(?:[^
3125
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Xt = /'/g, Gt = /"/g, no = /^(?:script|style|textarea|title)$/i, He = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), Jt = /* @__PURE__ */ new WeakMap(), re = ne.createTreeWalker(ne, 129);
3126
- function ao(e, t) {
3127
- if (!Et(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
3128
- return qt !== void 0 ? qt.createHTML(t) : t;
3129
- }
3130
- const ki = (e, t) => {
3131
- const o = e.length - 1, r = [];
3132
- let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = Pe;
3133
- for (let h = 0; h < o; h++) {
3134
- const c = e[h];
3135
- let v, m, f = -1, R = 0;
3136
- for (; R < c.length && (a.lastIndex = R, m = a.exec(c), m !== null); ) R = a.lastIndex, a === Pe ? m[1] === "!--" ? a = Vt : m[1] !== void 0 ? a = Yt : m[2] !== void 0 ? (no.test(m[2]) && (i = RegExp("</" + m[2], "g")), a = ie) : m[3] !== void 0 && (a = ie) : a === ie ? m[0] === ">" ? (a = i ?? Pe, f = -1) : m[1] === void 0 ? f = -2 : (f = a.lastIndex - m[2].length, v = m[1], a = m[3] === void 0 ? ie : m[3] === '"' ? Gt : Xt) : a === Gt || a === Xt ? a = ie : a === Vt || a === Yt ? a = Pe : (a = ie, i = void 0);
3137
- const W = a === ie && e[h + 1].startsWith("/>") ? " " : "";
3138
- n += a === Pe ? c + $i : f >= 0 ? (r.push(v), c.slice(0, f) + io + c.slice(f) + q + W) : c + q + (f === -2 ? h : W);
3139
- }
3140
- return [ao(e, n + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
3141
- };
3142
- class Fe {
3143
- constructor({ strings: t, _$litType$: o }, r) {
3144
- let i;
3145
- this.parts = [];
3146
- let n = 0, a = 0;
3147
- const h = t.length - 1, c = this.parts, [v, m] = ki(t, o);
3148
- if (this.el = Fe.createElement(v, r), re.currentNode = this.el.content, o === 2 || o === 3) {
3149
- const f = this.el.content.firstChild;
3150
- f.replaceWith(...f.childNodes);
3151
- }
3152
- for (; (i = re.nextNode()) !== null && c.length < h; ) {
3153
- if (i.nodeType === 1) {
3154
- if (i.hasAttributes()) for (const f of i.getAttributeNames()) if (f.endsWith(io)) {
3155
- const R = m[a++], W = i.getAttribute(f).split(q), qe = /([.?@])?(.*)/.exec(R);
3156
- c.push({ type: 1, index: n, name: qe[2], strings: W, ctor: qe[1] === "." ? Ii : qe[1] === "?" ? Ti : qe[1] === "@" ? Pi : nt }), i.removeAttribute(f);
3157
- } else f.startsWith(q) && (c.push({ type: 6, index: n }), i.removeAttribute(f));
3158
- if (no.test(i.tagName)) {
3159
- const f = i.textContent.split(q), R = f.length - 1;
3160
- if (R > 0) {
3161
- i.textContent = Je ? Je.emptyScript : "";
3162
- for (let W = 0; W < R; W++) i.append(f[W], Ze()), re.nextNode(), c.push({ type: 2, index: ++n });
3163
- i.append(f[R], Ze());
3164
- }
3165
- }
3166
- } else if (i.nodeType === 8) if (i.data === ro) c.push({ type: 2, index: n });
3167
- else {
3168
- let f = -1;
3169
- for (; (f = i.data.indexOf(q, f + 1)) !== -1; ) c.push({ type: 7, index: n }), f += q.length - 1;
3170
- }
3171
- n++;
3172
- }
3173
- }
3174
- static createElement(t, o) {
3175
- const r = ne.createElement("template");
3176
- return r.innerHTML = t, r;
3177
- }
3178
- }
3179
- function ue(e, t, o = e, r) {
3180
- var a, h;
3181
- if (t === He) return t;
3182
- let i = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
3183
- const n = ze(t) ? void 0 : t._$litDirective$;
3184
- return (i == null ? void 0 : i.constructor) !== n && ((h = i == null ? void 0 : i._$AO) == null || h.call(i, !1), n === void 0 ? i = void 0 : (i = new n(e), i._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = i : o._$Cl = i), i !== void 0 && (t = ue(e, i._$AS(e, t.values), i, r)), t;
3185
- }
3186
- class Ci {
3187
- constructor(t, o) {
3188
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
3189
- }
3190
- get parentNode() {
3191
- return this._$AM.parentNode;
3192
- }
3193
- get _$AU() {
3194
- return this._$AM._$AU;
3195
- }
3196
- u(t) {
3197
- const { el: { content: o }, parts: r } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? ne).importNode(o, !0);
3198
- re.currentNode = i;
3199
- let n = re.nextNode(), a = 0, h = 0, c = r[0];
3200
- for (; c !== void 0; ) {
3201
- if (a === c.index) {
3202
- let v;
3203
- c.type === 2 ? v = new rt(n, n.nextSibling, this, t) : c.type === 1 ? v = new c.ctor(n, c.name, c.strings, this, t) : c.type === 6 && (v = new Si(n, this, t)), this._$AV.push(v), c = r[++h];
3204
- }
3205
- a !== (c == null ? void 0 : c.index) && (n = re.nextNode(), a++);
3206
- }
3207
- return re.currentNode = ne, i;
3208
- }
3209
- p(t) {
3210
- let o = 0;
3211
- for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, o), o += r.strings.length - 2) : r._$AI(t[o])), o++;
3212
- }
3213
- }
3214
- class rt {
3215
- get _$AU() {
3216
- var t;
3217
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
3218
- }
3219
- constructor(t, o, r, i) {
3220
- this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = o, this._$AM = r, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
3221
- }
3222
- get parentNode() {
3223
- let t = this._$AA.parentNode;
3224
- const o = this._$AM;
3225
- return o !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = o.parentNode), t;
3226
- }
3227
- get startNode() {
3228
- return this._$AA;
3229
- }
3230
- get endNode() {
3231
- return this._$AB;
3232
- }
3233
- _$AI(t, o = this) {
3234
- t = ue(this, t, o), ze(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== He && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : wi(t) ? this.k(t) : this._(t);
3235
- }
3236
- O(t) {
3237
- return this._$AA.parentNode.insertBefore(t, this._$AB);
3238
- }
3239
- T(t) {
3240
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
3241
- }
3242
- _(t) {
3243
- this._$AH !== y && ze(this._$AH) ? this._$AA.nextSibling.data = t : this.T(ne.createTextNode(t)), this._$AH = t;
3244
- }
3245
- $(t) {
3246
- var n;
3247
- const { values: o, _$litType$: r } = t, i = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Fe.createElement(ao(r.h, r.h[0]), this.options)), r);
3248
- if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(o);
3249
- else {
3250
- const a = new Ci(i, this), h = a.u(this.options);
3251
- a.p(o), this.T(h), this._$AH = a;
3252
- }
3253
- }
3254
- _$AC(t) {
3255
- let o = Jt.get(t.strings);
3256
- return o === void 0 && Jt.set(t.strings, o = new Fe(t)), o;
3257
- }
3258
- k(t) {
3259
- Et(this._$AH) || (this._$AH = [], this._$AR());
3260
- const o = this._$AH;
3261
- let r, i = 0;
3262
- for (const n of t) i === o.length ? o.push(r = new rt(this.O(Ze()), this.O(Ze()), this, this.options)) : r = o[i], r._$AI(n), i++;
3263
- i < o.length && (this._$AR(r && r._$AB.nextSibling, i), o.length = i);
3264
- }
3265
- _$AR(t = this._$AA.nextSibling, o) {
3266
- var r;
3267
- for ((r = this._$AP) == null ? void 0 : r.call(this, !1, !0, o); t !== this._$AB; ) {
3268
- const i = Wt(t).nextSibling;
3269
- Wt(t).remove(), t = i;
3270
- }
3271
- }
3272
- setConnected(t) {
3273
- var o;
3274
- this._$AM === void 0 && (this._$Cv = t, (o = this._$AP) == null || o.call(this, t));
3275
- }
3276
- }
3277
- class nt {
3278
- get tagName() {
3279
- return this.element.tagName;
3280
- }
3281
- get _$AU() {
3282
- return this._$AM._$AU;
3283
- }
3284
- constructor(t, o, r, i, n) {
3285
- this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = o, this._$AM = i, this.options = n, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = y;
3286
- }
3287
- _$AI(t, o = this, r, i) {
3288
- const n = this.strings;
3289
- let a = !1;
3290
- if (n === void 0) t = ue(this, t, o, 0), a = !ze(t) || t !== this._$AH && t !== He, a && (this._$AH = t);
3291
- else {
3292
- const h = t;
3293
- let c, v;
3294
- for (t = n[0], c = 0; c < n.length - 1; c++) v = ue(this, h[r + c], o, c), v === He && (v = this._$AH[c]), a || (a = !ze(v) || v !== this._$AH[c]), v === y ? t = y : t !== y && (t += (v ?? "") + n[c + 1]), this._$AH[c] = v;
3295
- }
3296
- a && !i && this.j(t);
3297
- }
3298
- j(t) {
3299
- t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
3300
- }
3301
- }
3302
- class Ii extends nt {
3303
- constructor() {
3304
- super(...arguments), this.type = 3;
3305
- }
3306
- j(t) {
3307
- this.element[this.name] = t === y ? void 0 : t;
3308
- }
3309
- }
3310
- class Ti extends nt {
3311
- constructor() {
3312
- super(...arguments), this.type = 4;
3313
- }
3314
- j(t) {
3315
- this.element.toggleAttribute(this.name, !!t && t !== y);
3316
- }
3317
- }
3318
- class Pi extends nt {
3319
- constructor(t, o, r, i, n) {
3320
- super(t, o, r, i, n), this.type = 5;
3321
- }
3322
- _$AI(t, o = this) {
3323
- if ((t = ue(this, t, o, 0) ?? y) === He) return;
3324
- const r = this._$AH, i = t === y && r !== y || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, n = t !== y && (r === y || i);
3325
- i && this.element.removeEventListener(this.name, this, r), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
3326
- }
3327
- handleEvent(t) {
3328
- var o;
3329
- typeof this._$AH == "function" ? this._$AH.call(((o = this.options) == null ? void 0 : o.host) ?? this.element, t) : this._$AH.handleEvent(t);
3330
- }
3331
- }
3332
- class Si {
3333
- constructor(t, o, r) {
3334
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = r;
3335
- }
3336
- get _$AU() {
3337
- return this._$AM._$AU;
3338
- }
3339
- _$AI(t) {
3340
- ue(this, t);
3341
- }
3342
- }
3343
- const vt = Se.litHtmlPolyfillSupport;
3344
- vt == null || vt(Fe, rt), (Se.litHtmlVersions ?? (Se.litHtmlVersions = [])).push("3.3.3");
3345
- /**
3346
- * @license
3347
- * Copyright 2020 Google LLC
3348
- * SPDX-License-Identifier: BSD-3-Clause
3349
- */
3350
- const Oi = (e) => e.strings === void 0;
3351
- /**
3352
- * @license
3353
- * Copyright 2017 Google LLC
3354
- * SPDX-License-Identifier: BSD-3-Clause
3355
- */
3356
- const Ei = { CHILD: 2 }, Di = (e) => (...t) => ({ _$litDirective$: e, values: t });
3357
- class Ai {
3358
- constructor(t) {
3359
- }
3360
- get _$AU() {
3361
- return this._$AM._$AU;
3362
- }
3363
- _$AT(t, o, r) {
3364
- this._$Ct = t, this._$AM = o, this._$Ci = r;
3365
- }
3366
- _$AS(t, o) {
3367
- return this.update(t, o);
3368
- }
3369
- update(t, o) {
3370
- return this.render(...o);
3371
- }
3372
- }
3373
- /**
3374
- * @license
3375
- * Copyright 2017 Google LLC
3376
- * SPDX-License-Identifier: BSD-3-Clause
3377
- */
3378
- const Oe = (e, t) => {
3379
- var r;
3380
- const o = e._$AN;
3381
- if (o === void 0) return !1;
3382
- for (const i of o) (r = i._$AO) == null || r.call(i, t, !1), Oe(i, t);
3383
- return !0;
3384
- }, Qe = (e) => {
3385
- let t, o;
3386
- do {
3387
- if ((t = e._$AM) === void 0) break;
3388
- o = t._$AN, o.delete(e), e = t;
3389
- } while ((o == null ? void 0 : o.size) === 0);
3390
- }, so = (e) => {
3391
- for (let t; t = e._$AM; e = t) {
3392
- let o = t._$AN;
3393
- if (o === void 0) t._$AN = o = /* @__PURE__ */ new Set();
3394
- else if (o.has(e)) break;
3395
- o.add(e), Mi(t);
3396
- }
3397
- };
3398
- function Bi(e) {
3399
- this._$AN !== void 0 ? (Qe(this), this._$AM = e, so(this)) : this._$AM = e;
3400
- }
3401
- function ji(e, t = !1, o = 0) {
3402
- const r = this._$AH, i = this._$AN;
3403
- if (i !== void 0 && i.size !== 0) if (t) if (Array.isArray(r)) for (let n = o; n < r.length; n++) Oe(r[n], !1), Qe(r[n]);
3404
- else r != null && (Oe(r, !1), Qe(r));
3405
- else Oe(this, e);
3406
- }
3407
- const Mi = (e) => {
3408
- e.type == Ei.CHILD && (e._$AP ?? (e._$AP = ji), e._$AQ ?? (e._$AQ = Bi));
3409
- };
3410
- class Ri extends Ai {
3411
- constructor() {
3412
- super(...arguments), this._$AN = void 0;
3413
- }
3414
- _$AT(t, o, r) {
3415
- super._$AT(t, o, r), so(this), this.isConnected = t._$AU;
3416
- }
3417
- _$AO(t, o = !0) {
3418
- var r, i;
3419
- t !== this.isConnected && (this.isConnected = t, t ? (r = this.reconnected) == null || r.call(this) : (i = this.disconnected) == null || i.call(this)), o && (Oe(this, t), Qe(this));
3420
- }
3421
- setValue(t) {
3422
- if (Oi(this._$Ct)) this._$Ct._$AI(t, this);
3423
- else {
3424
- const o = [...this._$Ct._$AH];
3425
- o[this._$Ci] = t, this._$Ct._$AI(o, this, 0);
3426
- }
3427
- }
3428
- disconnected() {
3429
- }
3430
- reconnected() {
3431
- }
3432
- }
3433
- /**
3434
- * @license
3435
- * Copyright 2020 Google LLC
3436
- * SPDX-License-Identifier: BSD-3-Clause
3437
- */
3438
- const be = () => new Li();
3439
- class Li {
3440
- }
3441
- const ft = /* @__PURE__ */ new WeakMap(), ve = Di(class extends Ri {
3442
- render(e) {
3443
- return y;
3444
- }
3445
- update(e, [t]) {
3446
- var r;
3447
- const o = t !== this.G;
3448
- return o && this.rt(void 0), (o || this.lt !== this.ct) && (this.G = t, this.ht = (r = e.options) == null ? void 0 : r.host, this.rt(this.ct = e.element)), y;
3449
- }
3450
- rt(e) {
3451
- if (this.G !== void 0) if (this.isConnected || (e = void 0), typeof this.G == "function") {
3452
- const t = this.ht ?? globalThis;
3453
- let o = ft.get(t);
3454
- o === void 0 && (o = /* @__PURE__ */ new WeakMap(), ft.set(t, o)), o.get(this.G) !== void 0 && this.G.call(this.ht, void 0), o.set(this.G, e), e !== void 0 && this.G.call(this.ht, e);
3455
- } else this.G.value = e;
3456
- }
3457
- get lt() {
3458
- var e, t;
3459
- return typeof this.G == "function" ? (e = ft.get(this.ht ?? globalThis)) == null ? void 0 : e.get(this.G) : (t = this.G) == null ? void 0 : t.value;
3460
- }
3461
- disconnected() {
3462
- this.lt === this.ct && this.rt(void 0);
3463
- }
3464
- reconnected() {
3465
- this.rt(this.ct);
3466
- }
3467
- }), I = b`
3167
+ ], I.prototype, "device", 2);
3168
+ L([
3169
+ p({ type: Boolean })
3170
+ ], I.prototype, "readonly", 2);
3171
+ L([
3172
+ c()
3173
+ ], I.prototype, "_rowDropIndex", 2);
3174
+ L([
3175
+ c()
3176
+ ], I.prototype, "_isDragOver", 2);
3177
+ L([
3178
+ c()
3179
+ ], I.prototype, "_hoveredRowId", 2);
3180
+ I = L([
3181
+ h("pigeon-canvas")
3182
+ ], I);
3183
+ const w = g`
3468
3184
  :host {
3469
3185
  display: block;
3470
3186
  }
@@ -3680,12 +3396,12 @@ const ft = /* @__PURE__ */ new WeakMap(), ve = Di(class extends Ri {
3680
3396
  box-shadow: var(--pigeon-ring-shadow);
3681
3397
  }
3682
3398
  `;
3683
- var zi = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, Dt = (e, t, o, r) => {
3684
- for (var i = r > 1 ? void 0 : r ? Hi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
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--)
3685
3401
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
3686
- return r && i && zi(t, o, i), i;
3402
+ return r && i && Jo(t, o, i), i;
3687
3403
  };
3688
- let Ne = class extends g {
3404
+ let Te = class extends d {
3689
3405
  constructor() {
3690
3406
  super(...arguments), this.label = "Alignment", this.value = "left";
3691
3407
  }
@@ -3743,7 +3459,7 @@ let Ne = class extends g {
3743
3459
  }));
3744
3460
  }
3745
3461
  };
3746
- Ne.styles = b`
3462
+ Te.styles = g`
3747
3463
  :host {
3748
3464
  display: block;
3749
3465
  margin-bottom: 12px;
@@ -3806,21 +3522,21 @@ Ne.styles = b`
3806
3522
  height: 16px;
3807
3523
  }
3808
3524
  `;
3809
- Dt([
3525
+ gt([
3810
3526
  p({ type: String })
3811
- ], Ne.prototype, "label", 2);
3812
- Dt([
3527
+ ], Te.prototype, "label", 2);
3528
+ gt([
3813
3529
  p({ type: String })
3814
- ], Ne.prototype, "value", 2);
3815
- Ne = Dt([
3816
- u("pigeon-alignment-picker")
3817
- ], Ne);
3818
- var Fi = Object.defineProperty, Ni = Object.getOwnPropertyDescriptor, At = (e, t, o, r) => {
3819
- for (var i = r > 1 ? void 0 : r ? Ni(t, o) : t, n = e.length - 1, a; n >= 0; n--)
3530
+ ], Te.prototype, "value", 2);
3531
+ Te = gt([
3532
+ h("pigeon-alignment-picker")
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--)
3820
3536
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
3821
- return r && i && Fi(t, o, i), i;
3537
+ return r && i && Qo(t, o, i), i;
3822
3538
  };
3823
- let Ue = class extends g {
3539
+ let Se = class extends d {
3824
3540
  constructor() {
3825
3541
  super(...arguments), this.label = "Padding", this.value = { top: 0, right: 0, bottom: 0, left: 0 };
3826
3542
  }
@@ -3878,7 +3594,7 @@ let Ue = class extends g {
3878
3594
  }));
3879
3595
  }
3880
3596
  };
3881
- Ue.styles = b`
3597
+ Se.styles = g`
3882
3598
  :host {
3883
3599
  display: block;
3884
3600
  margin-bottom: 14px;
@@ -3963,21 +3679,21 @@ Ue.styles = b`
3963
3679
  -moz-appearance: textfield;
3964
3680
  }
3965
3681
  `;
3966
- At([
3682
+ ut([
3967
3683
  p({ type: String })
3968
- ], Ue.prototype, "label", 2);
3969
- At([
3684
+ ], Se.prototype, "label", 2);
3685
+ ut([
3970
3686
  p({ type: Object })
3971
- ], Ue.prototype, "value", 2);
3972
- Ue = At([
3973
- u("pigeon-spacing-input")
3974
- ], Ue);
3975
- var Ui = Object.defineProperty, Ki = Object.getOwnPropertyDescriptor, le = (e, t, o, r) => {
3976
- for (var i = r > 1 ? void 0 : r ? Ki(t, o) : t, n = e.length - 1, a; n >= 0; n--)
3687
+ ], Se.prototype, "value", 2);
3688
+ Se = ut([
3689
+ h("pigeon-spacing-input")
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--)
3977
3693
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
3978
- return r && i && Ui(t, o, i), i;
3694
+ return r && i && ti(t, o, i), i;
3979
3695
  };
3980
- let L = class extends g {
3696
+ let A = class extends d {
3981
3697
  constructor() {
3982
3698
  super(...arguments), this.label = "", this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.unit = "px";
3983
3699
  }
@@ -4024,7 +3740,7 @@ let L = class extends g {
4024
3740
  }));
4025
3741
  }
4026
3742
  };
4027
- L.styles = b`
3743
+ A.styles = g`
4028
3744
  :host {
4029
3745
  display: block;
4030
3746
  margin-bottom: 12px;
@@ -4124,33 +3840,33 @@ L.styles = b`
4124
3840
  -moz-appearance: textfield;
4125
3841
  }
4126
3842
  `;
4127
- le([
3843
+ te([
4128
3844
  p({ type: String })
4129
- ], L.prototype, "label", 2);
4130
- le([
3845
+ ], A.prototype, "label", 2);
3846
+ te([
4131
3847
  p({ type: Number })
4132
- ], L.prototype, "value", 2);
4133
- le([
3848
+ ], A.prototype, "value", 2);
3849
+ te([
4134
3850
  p({ type: Number })
4135
- ], L.prototype, "min", 2);
4136
- le([
3851
+ ], A.prototype, "min", 2);
3852
+ te([
4137
3853
  p({ type: Number })
4138
- ], L.prototype, "max", 2);
4139
- le([
3854
+ ], A.prototype, "max", 2);
3855
+ te([
4140
3856
  p({ type: Number })
4141
- ], L.prototype, "step", 2);
4142
- le([
3857
+ ], A.prototype, "step", 2);
3858
+ te([
4143
3859
  p({ type: String })
4144
- ], L.prototype, "unit", 2);
4145
- L = le([
4146
- u("pigeon-slider-input")
4147
- ], L);
4148
- var Wi = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, we = (e, t, o, r) => {
4149
- for (var i = r > 1 ? void 0 : r ? qi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
3860
+ ], A.prototype, "unit", 2);
3861
+ A = te([
3862
+ h("pigeon-slider-input")
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--)
4150
3866
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
4151
- return r && i && Wi(t, o, i), i;
3867
+ return r && i && ii(t, o, i), i;
4152
3868
  };
4153
- let X = class extends g {
3869
+ let q = class extends d {
4154
3870
  constructor() {
4155
3871
  super(...arguments), this.tags = [], this.open = !1, this.x = 0, this.y = 0, this._search = "";
4156
3872
  }
@@ -4206,7 +3922,7 @@ let X = class extends g {
4206
3922
  })), this.open = !1, this._search = "";
4207
3923
  }
4208
3924
  };
4209
- X.styles = b`
3925
+ q.styles = g`
4210
3926
  :host {
4211
3927
  display: none;
4212
3928
  }
@@ -4297,32 +4013,32 @@ X.styles = b`
4297
4013
  font-size: 13px;
4298
4014
  }
4299
4015
  `;
4300
- we([
4016
+ be([
4301
4017
  p({ type: Array })
4302
- ], X.prototype, "tags", 2);
4303
- we([
4018
+ ], q.prototype, "tags", 2);
4019
+ be([
4304
4020
  p({ type: Boolean, reflect: !0 })
4305
- ], X.prototype, "open", 2);
4306
- we([
4021
+ ], q.prototype, "open", 2);
4022
+ be([
4307
4023
  p({ type: Number })
4308
- ], X.prototype, "x", 2);
4309
- we([
4024
+ ], q.prototype, "x", 2);
4025
+ be([
4310
4026
  p({ type: Number })
4311
- ], X.prototype, "y", 2);
4312
- we([
4313
- d()
4314
- ], X.prototype, "_search", 2);
4315
- X = we([
4316
- u("pigeon-merge-tag-picker")
4317
- ], X);
4318
- var Vi = Object.defineProperty, Yi = Object.getOwnPropertyDescriptor, N = (e, t, o, r) => {
4319
- for (var i = r > 1 ? void 0 : r ? Yi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
4027
+ ], q.prototype, "y", 2);
4028
+ be([
4029
+ c()
4030
+ ], q.prototype, "_search", 2);
4031
+ q = be([
4032
+ h("pigeon-merge-tag-picker")
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--)
4320
4036
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
4321
- return r && i && Vi(t, o, i), i;
4037
+ return r && i && ni(t, o, i), i;
4322
4038
  };
4323
- let S = class extends g {
4039
+ let T = class extends d {
4324
4040
  constructor() {
4325
- super(...arguments), this.rowId = "", this.columnId = "", this.mergeTags = [], this.requestMergeTags = !1, this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._textareaRef = be(), this._triggerRef = be();
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();
4326
4042
  }
4327
4043
  render() {
4328
4044
  if (!this.block) return l``;
@@ -4334,13 +4050,13 @@ let S = class extends g {
4334
4050
  <div class="label-row">
4335
4051
  <label>${s("panel.common.contentHtml")}</label>
4336
4052
  ${t || this.requestMergeTags ? l`
4337
- <button class="tag-btn" ${ve(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
4053
+ <button class="tag-btn" ${ne(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
4338
4054
  ${s("panel.common.tagBtn")}
4339
4055
  </button>
4340
4056
  ` : ""}
4341
4057
  </div>
4342
4058
  <textarea
4343
- ${ve(this._textareaRef)}
4059
+ ${ne(this._textareaRef)}
4344
4060
  .value=${e.content}
4345
4061
  @change=${this._onContentChange}
4346
4062
  ></textarea>
@@ -4397,18 +4113,18 @@ let S = class extends g {
4397
4113
  }
4398
4114
  }
4399
4115
  _onMergeTagInsert(e) {
4400
- const t = So.getActive();
4116
+ const t = Lt.getActive();
4401
4117
  if (t && !t.isDestroyed) {
4402
- const v = this._extractTagName(e.detail.tag.name);
4403
- t.chain().focus().insertContent({ type: "mergeTag", attrs: { name: v } }).run(), this._pickerOpen = !1;
4118
+ const _ = this._extractTagName(e.detail.tag.name);
4119
+ t.chain().focus().insertContent({ type: "mergeTag", attrs: { name: _ } }).run(), this._pickerOpen = !1;
4404
4120
  return;
4405
4121
  }
4406
4122
  const o = this._textareaRef.value;
4407
4123
  if (!o) return;
4408
- const r = o.selectionStart, i = o.selectionEnd, n = o.value, a = e.detail.tag.name, h = n.substring(0, r) + a + n.substring(i);
4409
- o.value = h;
4410
- const c = r + a.length;
4411
- o.setSelectionRange(c, c), o.focus(), this._emit({ content: h }), this._pickerOpen = !1;
4124
+ const r = o.selectionStart, i = o.selectionEnd, n = o.value, a = e.detail.tag.name, u = n.substring(0, r) + a + n.substring(i);
4125
+ o.value = u;
4126
+ const b = r + a.length;
4127
+ o.setSelectionRange(b, b), o.focus(), this._emit({ content: u }), this._pickerOpen = !1;
4412
4128
  }
4413
4129
  /** Strip `{{` and `}}` from a tag name string. */
4414
4130
  _extractTagName(e) {
@@ -4442,9 +4158,9 @@ let S = class extends g {
4442
4158
  this._emit({ padding: e.detail.value });
4443
4159
  }
4444
4160
  };
4445
- S.styles = [
4446
- I,
4447
- b`
4161
+ T.styles = [
4162
+ w,
4163
+ g`
4448
4164
  /* Content textarea uses the monospace face so the HTML payload is
4449
4165
  readable to authors editing the raw markup. */
4450
4166
  textarea {
@@ -4487,47 +4203,47 @@ S.styles = [
4487
4203
  }
4488
4204
  `
4489
4205
  ];
4490
- N([
4206
+ H([
4491
4207
  p({ type: Object })
4492
- ], S.prototype, "block", 2);
4493
- N([
4208
+ ], T.prototype, "block", 2);
4209
+ H([
4494
4210
  p({ type: String })
4495
- ], S.prototype, "rowId", 2);
4496
- N([
4211
+ ], T.prototype, "rowId", 2);
4212
+ H([
4497
4213
  p({ type: String })
4498
- ], S.prototype, "columnId", 2);
4499
- N([
4214
+ ], T.prototype, "columnId", 2);
4215
+ H([
4500
4216
  p({ type: Array })
4501
- ], S.prototype, "mergeTags", 2);
4502
- N([
4217
+ ], T.prototype, "mergeTags", 2);
4218
+ H([
4503
4219
  p({ attribute: !1 })
4504
- ], S.prototype, "requestMergeTags", 2);
4505
- N([
4506
- d()
4507
- ], S.prototype, "_pickerOpen", 2);
4508
- N([
4509
- d()
4510
- ], S.prototype, "_pickerX", 2);
4511
- N([
4512
- d()
4513
- ], S.prototype, "_pickerY", 2);
4514
- S = N([
4515
- u("pigeon-text-panel")
4516
- ], S);
4517
- var Xi = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, w = (e, t, o, r) => {
4518
- for (var i = r > 1 ? void 0 : r ? Gi(t, o) : t, n = e.length - 1, a; n >= 0; n--)
4220
+ ], T.prototype, "requestMergeTags", 2);
4221
+ H([
4222
+ c()
4223
+ ], T.prototype, "_pickerOpen", 2);
4224
+ H([
4225
+ c()
4226
+ ], T.prototype, "_pickerX", 2);
4227
+ H([
4228
+ c()
4229
+ ], T.prototype, "_pickerY", 2);
4230
+ T = H([
4231
+ h("pigeon-text-panel")
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--)
4519
4235
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
4520
- return r && i && Xi(t, o, i), i;
4236
+ return r && i && si(t, o, i), i;
4521
4237
  };
4522
- let mt = null;
4523
- function Ji() {
4524
- return mt || (mt = import("./pigeon-stock-tab.js")), mt;
4238
+ let Ze = null;
4239
+ function pi() {
4240
+ return Ze || (Ze = import("./pigeon-stock-tab.js")), Ze;
4525
4241
  }
4526
- const Zi = 250, Ye = "__all__";
4527
- let x = class extends g {
4242
+ const ci = 250, je = "__all__";
4243
+ let m = class extends d {
4528
4244
  constructor() {
4529
- 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 = Ye, this._search = "", this._selectedTags = [], this._folders = [], this._assets = [], this._libraryLoading = !1, this._libraryError = "", this._searchTimer = null, this._libraryToken = 0, this._handleStockTabClick = async () => {
4530
- this._tab = "stock", this._stockTabLoaded || (await Ji(), this._stockTabLoaded = !0);
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);
4531
4247
  };
4532
4248
  }
4533
4249
  /* ----------------------------------------------------------------- */
@@ -4557,7 +4273,7 @@ let x = class extends g {
4557
4273
  <h3>${e ? s("asset.title") : s("asset.title-upload")}</h3>
4558
4274
  <button class="close-btn" @click=${this._close} aria-label=${s("asset.close")}>&times;</button>
4559
4275
  </div>
4560
- ${t ? this._renderTabs(e) : te}
4276
+ ${t ? this._renderTabs(e) : G}
4561
4277
  <div class="body">
4562
4278
  ${this._activeTab === "stock" && this._hasStock ? this._renderStock() : e && this._activeTab === "library" ? this._renderLibrary() : this._renderUpload()}
4563
4279
  </div>
@@ -4573,7 +4289,7 @@ let x = class extends g {
4573
4289
  role="tab"
4574
4290
  aria-selected=${t === "library"}
4575
4291
  @click=${() => this._tab = "library"}
4576
- >${s("asset.tab.library")}</button>` : te}
4292
+ >${s("asset.tab.library")}</button>` : G}
4577
4293
  <button
4578
4294
  class="tab ${t === "upload" ? "active" : ""}"
4579
4295
  role="tab"
@@ -4587,7 +4303,7 @@ let x = class extends g {
4587
4303
  role="tab"
4588
4304
  aria-selected=${t === "stock"}
4589
4305
  @click=${this._handleStockTabClick}
4590
- >${s("asset.tab.stock")}</button>` : te}
4306
+ >${s("asset.tab.stock")}</button>` : G}
4591
4307
  </div>
4592
4308
  `;
4593
4309
  }
@@ -4605,7 +4321,7 @@ let x = class extends g {
4605
4321
  .value=${this._folder}
4606
4322
  @change=${this._onFolderChange}
4607
4323
  >
4608
- <option value=${Ye}>${s("asset.folder.all")}</option>
4324
+ <option value=${je}>${s("asset.folder.all")}</option>
4609
4325
  ${this._folders.map(
4610
4326
  (e) => l`<option value=${e} ?selected=${this._folder === e}>${e}</option>`
4611
4327
  )}
@@ -4626,10 +4342,10 @@ let x = class extends g {
4626
4342
  @click=${() => this._toggleTag(e)}
4627
4343
  >${e}</button>`
4628
4344
  )}
4629
- </div>` : te}
4630
- ${this._libraryError ? l`<div class="error">${this._libraryError}</div>` : te}
4345
+ </div>` : G}
4346
+ ${this._libraryError ? l`<div class="error">${this._libraryError}</div>` : G}
4631
4347
  ${this._libraryLoading ? l`<div class="library-spinner">${s("asset.loading")}</div>` : this._assets.length === 0 ? l`<div class="empty-library">
4632
- ${this._search || this._selectedTags.length > 0 || this._folder !== Ye ? s("asset.empty.filtered") : s("asset.empty.no-assets")}
4348
+ ${this._search || this._selectedTags.length > 0 || this._folder !== je ? s("asset.empty.filtered") : s("asset.empty.no-assets")}
4633
4349
  </div>` : l`<div class="asset-grid">
4634
4350
  ${this._assets.map((e) => this._renderAssetCard(e))}
4635
4351
  </div>`}
@@ -4672,9 +4388,9 @@ let x = class extends g {
4672
4388
 
4673
4389
  ${this._uploading ? l`<div class="progress-bar">
4674
4390
  <div class="progress-fill" style="width: ${this._progress}%"></div>
4675
- </div>` : te}
4391
+ </div>` : G}
4676
4392
 
4677
- ${this._error ? l`<div class="error">${this._error}</div>` : te}
4393
+ ${this._error ? l`<div class="error">${this._error}</div>` : G}
4678
4394
 
4679
4395
  <div class="separator">${s("asset.url.separator")}</div>
4680
4396
 
@@ -4707,7 +4423,7 @@ let x = class extends g {
4707
4423
  this._libraryLoading = !0, this._libraryError = "";
4708
4424
  try {
4709
4425
  const t = await this.storage.list({
4710
- folder: this._folder === Ye ? void 0 : this._folder,
4426
+ folder: this._folder === je ? void 0 : this._folder,
4711
4427
  search: this._search.trim() || void 0,
4712
4428
  tags: this._selectedTags.length > 0 ? this._selectedTags : void 0
4713
4429
  });
@@ -4732,7 +4448,7 @@ let x = class extends g {
4732
4448
  this._folder = e.target.value, this._loadAssets();
4733
4449
  }
4734
4450
  _onSearchInput(e) {
4735
- this._search = e.target.value, this._searchTimer && clearTimeout(this._searchTimer), this._searchTimer = setTimeout(() => this._loadAssets(), Zi);
4451
+ this._search = e.target.value, this._searchTimer && clearTimeout(this._searchTimer), this._searchTimer = setTimeout(() => this._loadAssets(), ci);
4736
4452
  }
4737
4453
  _toggleTag(e) {
4738
4454
  this._selectedTags = this._selectedTags.includes(e) ? this._selectedTags.filter((t) => t !== e) : [...this._selectedTags, e], this._loadAssets();
@@ -4808,15 +4524,15 @@ let x = class extends g {
4808
4524
  const i = await this.config.presignedUpload.getUploadParams(e);
4809
4525
  this._progress = 40;
4810
4526
  const n = i.method ?? "PUT", a = { ...i.headers ?? {} };
4811
- let h;
4527
+ let u;
4812
4528
  if (n === "POST") {
4813
- const v = new FormData();
4814
- for (const [m, f] of Object.entries(i.fields ?? {})) v.append(m, f);
4815
- v.append("file", e), h = v;
4529
+ const _ = new FormData();
4530
+ for (const [K, Ee] of Object.entries(i.fields ?? {})) _.append(K, Ee);
4531
+ _.append("file", e), u = _;
4816
4532
  } else
4817
- h = e, Object.keys(a).some((m) => m.toLowerCase() === "content-type") || (a["Content-Type"] = e.type);
4818
- const c = await fetch(i.uploadUrl, { method: n, headers: a, body: h });
4819
- if (this._progress = 90, !c.ok) throw new Error(`Upload failed: ${c.status} ${c.statusText}`);
4533
+ u = e, Object.keys(a).some((K) => K.toLowerCase() === "content-type") || (a["Content-Type"] = e.type);
4534
+ const b = await fetch(i.uploadUrl, { method: n, headers: a, body: u });
4535
+ if (this._progress = 90, !b.ok) throw new Error(`Upload failed: ${b.status} ${b.statusText}`);
4820
4536
  this._progress = 100, this._selectAsset(i.publicUrl);
4821
4537
  } catch (i) {
4822
4538
  this._error = i instanceof Error ? i.message : "Upload failed";
@@ -4836,9 +4552,9 @@ let x = class extends g {
4836
4552
  body: i
4837
4553
  });
4838
4554
  if (this._progress = 80, !n.ok) throw new Error(`Upload failed: ${n.statusText}`);
4839
- const a = await n.json(), h = a.url || a.src || a.location;
4840
- if (!h) throw new Error("No URL in upload response");
4841
- this._progress = 100, this._selectAsset(h);
4555
+ const a = await n.json(), u = a.url || a.src || a.location;
4556
+ if (!u) throw new Error("No URL in upload response");
4557
+ this._progress = 100, this._selectAsset(u);
4842
4558
  } catch (i) {
4843
4559
  this._error = i instanceof Error ? i.message : "Upload failed";
4844
4560
  } finally {
@@ -4864,7 +4580,7 @@ let x = class extends g {
4864
4580
  ), this._close();
4865
4581
  }
4866
4582
  };
4867
- x.styles = b`
4583
+ m.styles = g`
4868
4584
  :host {
4869
4585
  display: none;
4870
4586
  }
@@ -5195,66 +4911,66 @@ x.styles = b`
5195
4911
  margin-top: 8px;
5196
4912
  }
5197
4913
  `;
5198
- w([
4914
+ y([
5199
4915
  p({ type: Object })
5200
- ], x.prototype, "config", 2);
5201
- w([
4916
+ ], m.prototype, "config", 2);
4917
+ y([
5202
4918
  p({ attribute: !1 })
5203
- ], x.prototype, "storage", 2);
5204
- w([
4919
+ ], m.prototype, "storage", 2);
4920
+ y([
5205
4921
  p({ type: Boolean, reflect: !0 })
5206
- ], x.prototype, "open", 2);
5207
- w([
5208
- d()
5209
- ], x.prototype, "_tab", 2);
5210
- w([
5211
- d()
5212
- ], x.prototype, "_stockTabLoaded", 2);
5213
- w([
5214
- d()
5215
- ], x.prototype, "_dragOver", 2);
5216
- w([
5217
- d()
5218
- ], x.prototype, "_uploading", 2);
5219
- w([
5220
- d()
5221
- ], x.prototype, "_progress", 2);
5222
- w([
5223
- d()
5224
- ], x.prototype, "_error", 2);
5225
- w([
5226
- d()
5227
- ], x.prototype, "_urlInput", 2);
5228
- w([
5229
- d()
5230
- ], x.prototype, "_folder", 2);
5231
- w([
5232
- d()
5233
- ], x.prototype, "_search", 2);
5234
- w([
5235
- d()
5236
- ], x.prototype, "_selectedTags", 2);
5237
- w([
5238
- d()
5239
- ], x.prototype, "_folders", 2);
5240
- w([
5241
- d()
5242
- ], x.prototype, "_assets", 2);
5243
- w([
5244
- d()
5245
- ], x.prototype, "_libraryLoading", 2);
5246
- w([
5247
- d()
5248
- ], x.prototype, "_libraryError", 2);
5249
- x = w([
5250
- u("pigeon-asset-manager")
5251
- ], x);
5252
- var Qi = Object.defineProperty, er = Object.getOwnPropertyDescriptor, pe = (e, t, o, r) => {
5253
- for (var i = r > 1 ? void 0 : r ? er(t, o) : t, n = e.length - 1, a; n >= 0; n--)
4922
+ ], m.prototype, "open", 2);
4923
+ y([
4924
+ c()
4925
+ ], m.prototype, "_tab", 2);
4926
+ y([
4927
+ c()
4928
+ ], m.prototype, "_stockTabLoaded", 2);
4929
+ y([
4930
+ c()
4931
+ ], m.prototype, "_dragOver", 2);
4932
+ y([
4933
+ c()
4934
+ ], m.prototype, "_uploading", 2);
4935
+ y([
4936
+ c()
4937
+ ], m.prototype, "_progress", 2);
4938
+ y([
4939
+ c()
4940
+ ], m.prototype, "_error", 2);
4941
+ y([
4942
+ c()
4943
+ ], m.prototype, "_urlInput", 2);
4944
+ y([
4945
+ c()
4946
+ ], m.prototype, "_folder", 2);
4947
+ y([
4948
+ c()
4949
+ ], m.prototype, "_search", 2);
4950
+ y([
4951
+ c()
4952
+ ], m.prototype, "_selectedTags", 2);
4953
+ y([
4954
+ c()
4955
+ ], m.prototype, "_folders", 2);
4956
+ y([
4957
+ c()
4958
+ ], m.prototype, "_assets", 2);
4959
+ y([
4960
+ c()
4961
+ ], m.prototype, "_libraryLoading", 2);
4962
+ y([
4963
+ c()
4964
+ ], m.prototype, "_libraryError", 2);
4965
+ m = y([
4966
+ h("pigeon-asset-manager")
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--)
5254
4970
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
5255
- return r && i && Qi(t, o, i), i;
4971
+ return r && i && di(t, o, i), i;
5256
4972
  };
5257
- let z = class extends g {
4973
+ let F = class extends d {
5258
4974
  constructor() {
5259
4975
  super(...arguments), this.rowId = "", this.columnId = "", this._assetManagerOpen = !1;
5260
4976
  }
@@ -5375,41 +5091,41 @@ let z = class extends g {
5375
5091
  this._emit({ src: e.detail.url }), this._assetManagerOpen = !1;
5376
5092
  }
5377
5093
  };
5378
- z.styles = [
5379
- I,
5380
- b`
5094
+ F.styles = [
5095
+ w,
5096
+ g`
5381
5097
  .upload-btn {
5382
5098
  margin-top: 6px;
5383
5099
  }
5384
5100
  `
5385
5101
  ];
5386
- pe([
5102
+ oe([
5387
5103
  p({ type: Object })
5388
- ], z.prototype, "block", 2);
5389
- pe([
5104
+ ], F.prototype, "block", 2);
5105
+ oe([
5390
5106
  p({ type: String })
5391
- ], z.prototype, "rowId", 2);
5392
- pe([
5107
+ ], F.prototype, "rowId", 2);
5108
+ oe([
5393
5109
  p({ type: String })
5394
- ], z.prototype, "columnId", 2);
5395
- pe([
5110
+ ], F.prototype, "columnId", 2);
5111
+ oe([
5396
5112
  p({ type: Object })
5397
- ], z.prototype, "assetManagerConfig", 2);
5398
- pe([
5113
+ ], F.prototype, "assetManagerConfig", 2);
5114
+ oe([
5399
5115
  p({ attribute: !1 })
5400
- ], z.prototype, "assetStorage", 2);
5401
- pe([
5402
- d()
5403
- ], z.prototype, "_assetManagerOpen", 2);
5404
- z = pe([
5405
- u("pigeon-image-panel")
5406
- ], z);
5407
- var tr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, at = (e, t, o, r) => {
5408
- for (var i = r > 1 ? void 0 : r ? or(t, o) : t, n = e.length - 1, a; n >= 0; n--)
5116
+ ], F.prototype, "assetStorage", 2);
5117
+ oe([
5118
+ c()
5119
+ ], F.prototype, "_assetManagerOpen", 2);
5120
+ F = oe([
5121
+ h("pigeon-image-panel")
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--)
5409
5125
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
5410
- return r && i && tr(t, o, i), i;
5126
+ return r && i && gi(t, o, i), i;
5411
5127
  };
5412
- let fe = class extends g {
5128
+ let pe = class extends d {
5413
5129
  constructor() {
5414
5130
  super(...arguments), this.label = s("control.color.label"), this.value = "#000000", this.swatches = [];
5415
5131
  }
@@ -5428,7 +5144,7 @@ let fe = class extends g {
5428
5144
  type="button"
5429
5145
  title=${`${e.name} (${e.value})`}
5430
5146
  aria-label=${e.name}
5431
- style=${Oo({ background: e.value })}
5147
+ style=${io({ background: e.value })}
5432
5148
  @click=${() => this._applySwatch(e.value)}
5433
5149
  ></button>`
5434
5150
  )}
@@ -5454,7 +5170,7 @@ let fe = class extends g {
5454
5170
  }));
5455
5171
  }
5456
5172
  };
5457
- fe.styles = b`
5173
+ pe.styles = g`
5458
5174
  :host {
5459
5175
  display: block;
5460
5176
  margin-bottom: 12px;
@@ -5549,28 +5265,29 @@ fe.styles = b`
5549
5265
  box-shadow: var(--pigeon-ring-shadow);
5550
5266
  }
5551
5267
  `;
5552
- at([
5268
+ Ue([
5553
5269
  p({ type: String })
5554
- ], fe.prototype, "label", 2);
5555
- at([
5270
+ ], pe.prototype, "label", 2);
5271
+ Ue([
5556
5272
  p({ type: String })
5557
- ], fe.prototype, "value", 2);
5558
- at([
5273
+ ], pe.prototype, "value", 2);
5274
+ Ue([
5559
5275
  p({ attribute: !1 })
5560
- ], fe.prototype, "swatches", 2);
5561
- fe = at([
5562
- u("pigeon-color-picker")
5563
- ], fe);
5564
- var ir = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, ke = (e, t, o, r) => {
5565
- for (var i = r > 1 ? void 0 : r ? rr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
5276
+ ], pe.prototype, "swatches", 2);
5277
+ pe = Ue([
5278
+ h("pigeon-color-picker")
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--)
5566
5282
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
5567
- return r && i && ir(t, o, i), i;
5283
+ return r && i && bi(t, o, i), i;
5568
5284
  };
5569
- let G = class extends g {
5285
+ let V = class extends d {
5570
5286
  constructor() {
5571
5287
  super(...arguments), this.rowId = "", this.columnId = "", this.swatches = [], this.linkTypes = [];
5572
5288
  }
5573
5289
  render() {
5290
+ var t, o, r;
5574
5291
  if (!this.block) return l``;
5575
5292
  const e = this.block.values;
5576
5293
  return l`
@@ -5623,6 +5340,35 @@ let G = class extends g {
5623
5340
  @slider-change=${this._onBorderRadiusChange}
5624
5341
  ></pigeon-slider-input>
5625
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
+
5626
5372
  <pigeon-slider-input
5627
5373
  label=${s("panel.common.fontSize")}
5628
5374
  .value=${e.fontSize}
@@ -5709,6 +5455,35 @@ let G = class extends g {
5709
5455
  _onBorderRadiusChange(e) {
5710
5456
  this._emit({ borderRadius: e.detail.value });
5711
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
+ }
5712
5487
  _onFontSizeChange(e) {
5713
5488
  this._emit({ fontSize: e.detail.value });
5714
5489
  }
@@ -5728,31 +5503,31 @@ let G = class extends g {
5728
5503
  this._emit({ innerPadding: e.detail.value });
5729
5504
  }
5730
5505
  };
5731
- G.styles = I;
5732
- ke([
5506
+ V.styles = w;
5507
+ ve([
5733
5508
  p({ type: Object })
5734
- ], G.prototype, "block", 2);
5735
- ke([
5509
+ ], V.prototype, "block", 2);
5510
+ ve([
5736
5511
  p({ type: String })
5737
- ], G.prototype, "rowId", 2);
5738
- ke([
5512
+ ], V.prototype, "rowId", 2);
5513
+ ve([
5739
5514
  p({ type: String })
5740
- ], G.prototype, "columnId", 2);
5741
- ke([
5515
+ ], V.prototype, "columnId", 2);
5516
+ ve([
5742
5517
  p({ attribute: !1 })
5743
- ], G.prototype, "swatches", 2);
5744
- ke([
5518
+ ], V.prototype, "swatches", 2);
5519
+ ve([
5745
5520
  p({ attribute: !1 })
5746
- ], G.prototype, "linkTypes", 2);
5747
- G = ke([
5748
- u("pigeon-button-panel")
5749
- ], G);
5750
- var nr = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, lo = (e, t, o, r) => {
5751
- for (var i = r > 1 ? void 0 : r ? ar(t, o) : t, n = e.length - 1, a; n >= 0; n--)
5521
+ ], V.prototype, "linkTypes", 2);
5522
+ V = ve([
5523
+ h("pigeon-button-panel")
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--)
5752
5527
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
5753
- return r && i && nr(t, o, i), i;
5528
+ return r && i && fi(t, o, i), i;
5754
5529
  };
5755
- let et = class extends g {
5530
+ let ze = class extends d {
5756
5531
  get _layouts() {
5757
5532
  return [
5758
5533
  { label: s("panel.row.layout1col"), ratios: [12] },
@@ -5763,21 +5538,21 @@ let et = class extends g {
5763
5538
  }
5764
5539
  render() {
5765
5540
  if (!this.row) return l``;
5766
- 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(",");
5767
5542
  return l`
5768
5543
  <h3>${s("panel.row.title")}</h3>
5769
5544
 
5770
5545
  <span class="section-label">${s("panel.row.columnLayout")}</span>
5771
5546
  <div class="layout-presets">
5772
- ${this._layouts.map((o) => {
5773
- const r = o.ratios.join(",") === t;
5547
+ ${this._layouts.map((r) => {
5548
+ const i = r.ratios.join(",") === o;
5774
5549
  return l`
5775
5550
  <div
5776
- class="layout-preset ${r ? "active" : ""}"
5777
- title="${o.label}"
5778
- @click=${() => this._onLayoutSelect(o.ratios)}
5551
+ class="layout-preset ${i ? "active" : ""}"
5552
+ title="${r.label}"
5553
+ @click=${() => this._onLayoutSelect(r.ratios)}
5779
5554
  >
5780
- ${o.ratios.map((i) => l`<div class="col-bar" style="flex: ${i};"></div>`)}
5555
+ ${r.ratios.map((n) => l`<div class="col-bar" style="flex: ${n};"></div>`)}
5781
5556
  </div>
5782
5557
  `;
5783
5558
  })}
@@ -5799,6 +5574,35 @@ let et = class extends g {
5799
5574
  />
5800
5575
  </div>
5801
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
+
5802
5606
  <div class="toggle-row">
5803
5607
  <span class="toggle-label">${s("panel.row.fullWidth")}</span>
5804
5608
  <label class="toggle">
@@ -5811,6 +5615,18 @@ let et = class extends g {
5811
5615
  </label>
5812
5616
  </div>
5813
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
+
5814
5630
  <pigeon-spacing-input
5815
5631
  label=${s("panel.common.padding")}
5816
5632
  .value=${e.padding}
@@ -5831,6 +5647,21 @@ let et = class extends g {
5831
5647
  <code>{{#if …}}</code> for your sending platform.
5832
5648
  </p>
5833
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>
5834
5665
  `;
5835
5666
  }
5836
5667
  _emitRowUpdate(e) {
@@ -5860,9 +5691,23 @@ let et = class extends g {
5860
5691
  _onBgImageChange(e) {
5861
5692
  this._emitRowUpdate({ backgroundImage: e.target.value });
5862
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
+ }
5863
5704
  _onFullWidthChange(e) {
5864
5705
  this._emitRowUpdate({ fullWidth: e.target.checked });
5865
5706
  }
5707
+ _onNoStackChange(e) {
5708
+ const t = e.target.checked;
5709
+ this._emitRowUpdate({ noStackOnMobile: t || void 0 });
5710
+ }
5866
5711
  _onPaddingChange(e) {
5867
5712
  this._emitRowUpdate({ padding: e.detail.value });
5868
5713
  }
@@ -5870,10 +5715,14 @@ let et = class extends g {
5870
5715
  const t = e.target.value.trim();
5871
5716
  this._emitRowUpdate({ condition: t || void 0 });
5872
5717
  }
5718
+ _onRepeatChange(e) {
5719
+ const t = e.target.value.trim();
5720
+ this._emitRowUpdate({ repeat: t || void 0 });
5721
+ }
5873
5722
  };
5874
- et.styles = [
5875
- I,
5876
- b`
5723
+ ze.styles = [
5724
+ w,
5725
+ g`
5877
5726
  .hint {
5878
5727
  margin: 4px 0 0;
5879
5728
  font-size: 11px;
@@ -5942,18 +5791,18 @@ et.styles = [
5942
5791
  }
5943
5792
  `
5944
5793
  ];
5945
- lo([
5794
+ Rt([
5946
5795
  p({ type: Object })
5947
- ], et.prototype, "row", 2);
5948
- et = lo([
5949
- u("pigeon-row-panel")
5950
- ], et);
5951
- var sr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, st = (e, t, o, r) => {
5952
- for (var i = r > 1 ? void 0 : r ? lr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
5796
+ ], ze.prototype, "row", 2);
5797
+ ze = Rt([
5798
+ h("pigeon-row-panel")
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--)
5953
5802
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
5954
- return r && i && sr(t, o, i), i;
5803
+ return r && i && yi(t, o, i), i;
5955
5804
  };
5956
- const Zt = [
5805
+ const Tt = [
5957
5806
  { label: "Arial", value: "Arial, Helvetica, sans-serif" },
5958
5807
  { label: "Georgia", value: "Georgia, Times, serif" },
5959
5808
  { label: "Courier New", value: "'Courier New', Courier, monospace" },
@@ -5962,13 +5811,13 @@ const Zt = [
5962
5811
  { label: "Trebuchet MS", value: "'Trebuchet MS', sans-serif" },
5963
5812
  { label: "Times New Roman", value: "'Times New Roman', Times, serif" }
5964
5813
  ];
5965
- let me = class extends g {
5814
+ let ce = class extends d {
5966
5815
  constructor() {
5967
5816
  super(...arguments), this.label = s("control.fontPicker.label"), this.value = "", this.brandFonts = [];
5968
5817
  }
5969
5818
  get _options() {
5970
- const e = new Set(Zt.map((o) => o.value)), t = this.brandFonts.filter((o) => !e.has(o.family)).map((o) => ({ label: o.name, value: o.family }));
5971
- return [...Zt, ...t];
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];
5972
5821
  }
5973
5822
  render() {
5974
5823
  return l`
@@ -5990,7 +5839,7 @@ let me = class extends g {
5990
5839
  );
5991
5840
  }
5992
5841
  };
5993
- me.styles = b`
5842
+ ce.styles = g`
5994
5843
  :host {
5995
5844
  display: block;
5996
5845
  margin-bottom: 12px;
@@ -6016,28 +5865,29 @@ me.styles = b`
6016
5865
  box-sizing: border-box;
6017
5866
  }
6018
5867
  `;
6019
- st([
5868
+ Ne([
6020
5869
  p({ type: String })
6021
- ], me.prototype, "label", 2);
6022
- st([
5870
+ ], ce.prototype, "label", 2);
5871
+ Ne([
6023
5872
  p({ type: String })
6024
- ], me.prototype, "value", 2);
6025
- st([
5873
+ ], ce.prototype, "value", 2);
5874
+ Ne([
6026
5875
  p({ attribute: !1 })
6027
- ], me.prototype, "brandFonts", 2);
6028
- me = st([
6029
- u("pigeon-font-picker")
6030
- ], me);
6031
- var pr = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, U = (e, t, o, r) => {
6032
- for (var i = r > 1 ? void 0 : r ? cr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
5876
+ ], ce.prototype, "brandFonts", 2);
5877
+ ce = Ne([
5878
+ h("pigeon-font-picker")
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--)
6033
5882
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
6034
- return r && i && pr(t, o, i), i;
5883
+ return r && i && xi(t, o, i), i;
6035
5884
  };
6036
- let O = class extends g {
5885
+ let S = class extends d {
6037
5886
  constructor() {
6038
- super(...arguments), this.mergeTags = [], this.requestMergeTags = !1, this.swatches = [], this.brandFonts = [], this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._previewInputRef = be(), this._triggerRef = be();
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();
6039
5888
  }
6040
5889
  render() {
5890
+ var t, o;
6041
5891
  if (!this.doc) return l``;
6042
5892
  const e = this.doc.body.attributes;
6043
5893
  return l`
@@ -6080,6 +5930,54 @@ let O = class extends g {
6080
5930
  </div>
6081
5931
  </div>
6082
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
+
6083
5981
  <div class="field">
6084
5982
  <label>${s("panel.body.emailName")}</label>
6085
5983
  <input
@@ -6093,14 +5991,14 @@ let O = class extends g {
6093
5991
  <div class="label-row">
6094
5992
  <label>${s("panel.body.previewText")}</label>
6095
5993
  ${this.mergeTags.length > 0 || this.requestMergeTags ? l`
6096
- <button class="tag-btn" ${ve(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
5994
+ <button class="tag-btn" ${ne(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
6097
5995
  ${s("panel.common.tagBtn")}
6098
5996
  </button>
6099
5997
  ` : ""}
6100
5998
  </div>
6101
5999
  <input
6102
6000
  type="text"
6103
- ${ve(this._previewInputRef)}
6001
+ ${ne(this._previewInputRef)}
6104
6002
  .value=${this.doc.metadata.previewText ?? ""}
6105
6003
  placeholder=${s("panel.body.previewTextPlaceholder")}
6106
6004
  @change=${this._onPreviewTextChange}
@@ -6156,9 +6054,33 @@ let O = class extends g {
6156
6054
  _onFontFamilyChange(e) {
6157
6055
  this._emit({ attribute: "fontFamily", value: e.detail.value });
6158
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
+ }
6159
6075
  _onAlignChange(e) {
6160
6076
  this._emit({ attribute: "contentAlignment", value: e });
6161
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
+ }
6162
6084
  _onNameChange(e) {
6163
6085
  this._emit({ metaField: "name", value: e.target.value });
6164
6086
  }
@@ -6166,9 +6088,9 @@ let O = class extends g {
6166
6088
  this._emit({ metaField: "previewText", value: e.target.value });
6167
6089
  }
6168
6090
  };
6169
- O.styles = [
6170
- I,
6171
- b`
6091
+ S.styles = [
6092
+ w,
6093
+ g`
6172
6094
  .alignment-buttons {
6173
6095
  display: flex;
6174
6096
  gap: 0;
@@ -6242,37 +6164,37 @@ O.styles = [
6242
6164
  ];
6243
6165
  U([
6244
6166
  p({ type: Object })
6245
- ], O.prototype, "doc", 2);
6167
+ ], S.prototype, "doc", 2);
6246
6168
  U([
6247
6169
  p({ type: Array })
6248
- ], O.prototype, "mergeTags", 2);
6170
+ ], S.prototype, "mergeTags", 2);
6249
6171
  U([
6250
6172
  p({ attribute: !1 })
6251
- ], O.prototype, "requestMergeTags", 2);
6173
+ ], S.prototype, "requestMergeTags", 2);
6252
6174
  U([
6253
6175
  p({ attribute: !1 })
6254
- ], O.prototype, "swatches", 2);
6176
+ ], S.prototype, "swatches", 2);
6255
6177
  U([
6256
6178
  p({ attribute: !1 })
6257
- ], O.prototype, "brandFonts", 2);
6179
+ ], S.prototype, "brandFonts", 2);
6258
6180
  U([
6259
- d()
6260
- ], O.prototype, "_pickerOpen", 2);
6181
+ c()
6182
+ ], S.prototype, "_pickerOpen", 2);
6261
6183
  U([
6262
- d()
6263
- ], O.prototype, "_pickerX", 2);
6184
+ c()
6185
+ ], S.prototype, "_pickerX", 2);
6264
6186
  U([
6265
- d()
6266
- ], O.prototype, "_pickerY", 2);
6267
- O = U([
6268
- u("pigeon-body-panel")
6269
- ], O);
6270
- var dr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, ee = (e, t, o, r) => {
6271
- for (var i = r > 1 ? void 0 : r ? hr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
6187
+ c()
6188
+ ], S.prototype, "_pickerY", 2);
6189
+ S = U([
6190
+ h("pigeon-body-panel")
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--)
6272
6194
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
6273
- return r && i && dr(t, o, i), i;
6195
+ return r && i && $i(t, o, i), i;
6274
6196
  };
6275
- let j = class extends g {
6197
+ let E = class extends d {
6276
6198
  constructor() {
6277
6199
  super(...arguments), this.rowId = "", this.columnId = "", this.swatches = [], this._assetManagerOpen = !1;
6278
6200
  }
@@ -6425,37 +6347,37 @@ let j = class extends g {
6425
6347
  this._emit({ backgroundUrl: e.detail.url }), this._assetManagerOpen = !1;
6426
6348
  }
6427
6349
  };
6428
- j.styles = [I];
6429
- ee([
6350
+ E.styles = [w];
6351
+ X([
6430
6352
  p({ type: Object })
6431
- ], j.prototype, "block", 2);
6432
- ee([
6353
+ ], E.prototype, "block", 2);
6354
+ X([
6433
6355
  p({ type: String })
6434
- ], j.prototype, "rowId", 2);
6435
- ee([
6356
+ ], E.prototype, "rowId", 2);
6357
+ X([
6436
6358
  p({ type: String })
6437
- ], j.prototype, "columnId", 2);
6438
- ee([
6359
+ ], E.prototype, "columnId", 2);
6360
+ X([
6439
6361
  p({ type: Object })
6440
- ], j.prototype, "assetManagerConfig", 2);
6441
- ee([
6362
+ ], E.prototype, "assetManagerConfig", 2);
6363
+ X([
6442
6364
  p({ attribute: !1 })
6443
- ], j.prototype, "assetStorage", 2);
6444
- ee([
6365
+ ], E.prototype, "assetStorage", 2);
6366
+ X([
6445
6367
  p({ attribute: !1 })
6446
- ], j.prototype, "swatches", 2);
6447
- ee([
6448
- d()
6449
- ], j.prototype, "_assetManagerOpen", 2);
6450
- j = ee([
6451
- u("pigeon-hero-panel")
6452
- ], j);
6453
- var gr = Object.defineProperty, ur = Object.getOwnPropertyDescriptor, Ke = (e, t, o, r) => {
6454
- for (var i = r > 1 ? void 0 : r ? ur(t, o) : t, n = e.length - 1, a; n >= 0; n--)
6368
+ ], E.prototype, "swatches", 2);
6369
+ X([
6370
+ c()
6371
+ ], E.prototype, "_assetManagerOpen", 2);
6372
+ E = X([
6373
+ h("pigeon-hero-panel")
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--)
6455
6377
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
6456
- return r && i && gr(t, o, i), i;
6378
+ return r && i && Ci(t, o, i), i;
6457
6379
  };
6458
- let ae = class extends g {
6380
+ let Z = class extends d {
6459
6381
  constructor() {
6460
6382
  super(...arguments), this.rowId = "", this.columnId = "", this.swatches = [];
6461
6383
  }
@@ -6592,9 +6514,9 @@ let ae = class extends g {
6592
6514
  this._emit({ padding: e.detail.value });
6593
6515
  }
6594
6516
  };
6595
- ae.styles = [
6596
- I,
6597
- b`
6517
+ Z.styles = [
6518
+ w,
6519
+ g`
6598
6520
  h4 {
6599
6521
  margin: 0 0 8px;
6600
6522
  font-size: 12px;
@@ -6652,27 +6574,27 @@ ae.styles = [
6652
6574
  }
6653
6575
  `
6654
6576
  ];
6655
- Ke([
6577
+ Oe([
6656
6578
  p({ type: Object })
6657
- ], ae.prototype, "block", 2);
6658
- Ke([
6579
+ ], Z.prototype, "block", 2);
6580
+ Oe([
6659
6581
  p({ type: String })
6660
- ], ae.prototype, "rowId", 2);
6661
- Ke([
6582
+ ], Z.prototype, "rowId", 2);
6583
+ Oe([
6662
6584
  p({ type: String })
6663
- ], ae.prototype, "columnId", 2);
6664
- Ke([
6585
+ ], Z.prototype, "columnId", 2);
6586
+ Oe([
6665
6587
  p({ attribute: !1 })
6666
- ], ae.prototype, "swatches", 2);
6667
- ae = Ke([
6668
- u("pigeon-navbar-panel")
6669
- ], ae);
6670
- var br = Object.defineProperty, vr = Object.getOwnPropertyDescriptor, We = (e, t, o, r) => {
6671
- for (var i = r > 1 ? void 0 : r ? vr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
6588
+ ], Z.prototype, "swatches", 2);
6589
+ Z = Oe([
6590
+ h("pigeon-navbar-panel")
6591
+ ], Z);
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--)
6672
6594
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
6673
- return r && i && br(t, o, i), i;
6595
+ return r && i && Pi(t, o, i), i;
6674
6596
  };
6675
- let se = class extends g {
6597
+ let Q = class extends d {
6676
6598
  constructor() {
6677
6599
  super(...arguments), this.rowId = "", this.columnId = "", this.swatches = [];
6678
6600
  }
@@ -6753,28 +6675,28 @@ let se = class extends g {
6753
6675
  this._emit({ padding: e.detail.value });
6754
6676
  }
6755
6677
  };
6756
- se.styles = I;
6757
- We([
6678
+ Q.styles = w;
6679
+ De([
6758
6680
  p({ type: Object })
6759
- ], se.prototype, "block", 2);
6760
- We([
6681
+ ], Q.prototype, "block", 2);
6682
+ De([
6761
6683
  p({ type: String })
6762
- ], se.prototype, "rowId", 2);
6763
- We([
6684
+ ], Q.prototype, "rowId", 2);
6685
+ De([
6764
6686
  p({ type: String })
6765
- ], se.prototype, "columnId", 2);
6766
- We([
6687
+ ], Q.prototype, "columnId", 2);
6688
+ De([
6767
6689
  p({ attribute: !1 })
6768
- ], se.prototype, "swatches", 2);
6769
- se = We([
6770
- u("pigeon-divider-panel")
6771
- ], se);
6772
- var fr = Object.defineProperty, mr = Object.getOwnPropertyDescriptor, lt = (e, t, o, r) => {
6773
- for (var i = r > 1 ? void 0 : r ? mr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
6690
+ ], Q.prototype, "swatches", 2);
6691
+ Q = De([
6692
+ h("pigeon-divider-panel")
6693
+ ], Q);
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--)
6774
6696
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
6775
- return r && i && fr(t, o, i), i;
6697
+ return r && i && Si(t, o, i), i;
6776
6698
  };
6777
- let _e = class extends g {
6699
+ let de = class extends d {
6778
6700
  constructor() {
6779
6701
  super(...arguments), this.rowId = "", this.columnId = "";
6780
6702
  }
@@ -6811,25 +6733,25 @@ let _e = class extends g {
6811
6733
  this._emit({ height: e.detail.value });
6812
6734
  }
6813
6735
  };
6814
- _e.styles = I;
6815
- lt([
6736
+ de.styles = w;
6737
+ Ke([
6816
6738
  p({ type: Object })
6817
- ], _e.prototype, "block", 2);
6818
- lt([
6739
+ ], de.prototype, "block", 2);
6740
+ Ke([
6819
6741
  p({ type: String })
6820
- ], _e.prototype, "rowId", 2);
6821
- lt([
6742
+ ], de.prototype, "rowId", 2);
6743
+ Ke([
6822
6744
  p({ type: String })
6823
- ], _e.prototype, "columnId", 2);
6824
- _e = lt([
6825
- u("pigeon-spacer-panel")
6826
- ], _e);
6827
- var _r = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, pt = (e, t, o, r) => {
6828
- for (var i = r > 1 ? void 0 : r ? yr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
6745
+ ], de.prototype, "columnId", 2);
6746
+ de = Ke([
6747
+ h("pigeon-spacer-panel")
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--)
6829
6751
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
6830
- return r && i && _r(t, o, i), i;
6752
+ return r && i && Di(t, o, i), i;
6831
6753
  };
6832
- const xr = [
6754
+ const Bi = [
6833
6755
  "facebook",
6834
6756
  "twitter",
6835
6757
  "instagram",
@@ -6838,7 +6760,7 @@ const xr = [
6838
6760
  "tiktok",
6839
6761
  "custom"
6840
6762
  ];
6841
- let ye = class extends g {
6763
+ let he = class extends d {
6842
6764
  constructor() {
6843
6765
  super(...arguments), this.rowId = "", this.columnId = "";
6844
6766
  }
@@ -6858,7 +6780,7 @@ let ye = class extends g {
6858
6780
  <div class="field">
6859
6781
  <label>${s("panel.social.network")}</label>
6860
6782
  <select @change=${(r) => this._onIconTypeChange(o, r)}>
6861
- ${xr.map((r) => l`
6783
+ ${Bi.map((r) => l`
6862
6784
  <option value=${r} ?selected=${t.type === r}>${r}</option>
6863
6785
  `)}
6864
6786
  </select>
@@ -6982,9 +6904,9 @@ let ye = class extends g {
6982
6904
  this._emit({ padding: e.detail.value });
6983
6905
  }
6984
6906
  };
6985
- ye.styles = [
6986
- I,
6987
- b`
6907
+ he.styles = [
6908
+ w,
6909
+ g`
6988
6910
  h4 {
6989
6911
  margin: 0 0 8px;
6990
6912
  font-size: 12px;
@@ -7042,26 +6964,26 @@ ye.styles = [
7042
6964
  }
7043
6965
  `
7044
6966
  ];
7045
- pt([
6967
+ We([
7046
6968
  p({ type: Object })
7047
- ], ye.prototype, "block", 2);
7048
- pt([
6969
+ ], he.prototype, "block", 2);
6970
+ We([
7049
6971
  p({ type: String })
7050
- ], ye.prototype, "rowId", 2);
7051
- pt([
6972
+ ], he.prototype, "rowId", 2);
6973
+ We([
7052
6974
  p({ type: String })
7053
- ], ye.prototype, "columnId", 2);
7054
- ye = pt([
7055
- u("pigeon-social-panel")
7056
- ], ye);
7057
- var $r = Object.defineProperty, wr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
7058
- for (var i = r > 1 ? void 0 : r ? wr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
6975
+ ], he.prototype, "columnId", 2);
6976
+ he = We([
6977
+ h("pigeon-social-panel")
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--)
7059
6981
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
7060
- return r && i && $r(t, o, i), i;
6982
+ return r && i && ji(t, o, i), i;
7061
6983
  };
7062
- let E = class extends g {
6984
+ let O = class extends d {
7063
6985
  constructor() {
7064
- super(...arguments), this.rowId = "", this.columnId = "", this.mergeTags = [], this.requestMergeTags = !1, this._pickerOpen = !1, this._pickerX = 0, this._pickerY = 0, this._textareaRef = be(), this._triggerRef = be();
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();
7065
6987
  }
7066
6988
  render() {
7067
6989
  if (!this.block) return l``;
@@ -7073,13 +6995,13 @@ let E = class extends g {
7073
6995
  <div class="label-row">
7074
6996
  <label>${s("panel.html.rawHtml")}</label>
7075
6997
  ${t || this.requestMergeTags ? l`
7076
- <button class="tag-btn" ${ve(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
6998
+ <button class="tag-btn" ${ne(this._triggerRef)} @click=${this._togglePicker} title=${s("panel.common.insertMergeTag")}>
7077
6999
  ${s("panel.common.tagBtn")}
7078
7000
  </button>
7079
7001
  ` : ""}
7080
7002
  </div>
7081
7003
  <textarea
7082
- ${ve(this._textareaRef)}
7004
+ ${ne(this._textareaRef)}
7083
7005
  .value=${e.content}
7084
7006
  @change=${this._onContentChange}
7085
7007
  ></textarea>
@@ -7139,13 +7061,13 @@ let E = class extends g {
7139
7061
  if (!t) return;
7140
7062
  const o = t.selectionStart, r = t.selectionEnd, i = t.value, n = e.detail.tag.name, a = i.substring(0, o) + n + i.substring(r);
7141
7063
  t.value = a;
7142
- const h = o + n.length;
7143
- t.setSelectionRange(h, h), t.focus(), this._emit({ content: a }), this._pickerOpen = !1;
7064
+ const u = o + n.length;
7065
+ t.setSelectionRange(u, u), t.focus(), this._emit({ content: a }), this._pickerOpen = !1;
7144
7066
  }
7145
7067
  };
7146
- E.styles = [
7147
- I,
7148
- b`
7068
+ O.styles = [
7069
+ w,
7070
+ g`
7149
7071
  /* HTML payload is raw markup — show in monospace and taller than the
7150
7072
  default textarea so authors have room to work. */
7151
7073
  textarea {
@@ -7188,39 +7110,39 @@ E.styles = [
7188
7110
  }
7189
7111
  `
7190
7112
  ];
7191
- K([
7113
+ N([
7192
7114
  p({ type: Object })
7193
- ], E.prototype, "block", 2);
7194
- K([
7115
+ ], O.prototype, "block", 2);
7116
+ N([
7195
7117
  p({ type: String })
7196
- ], E.prototype, "rowId", 2);
7197
- K([
7118
+ ], O.prototype, "rowId", 2);
7119
+ N([
7198
7120
  p({ type: String })
7199
- ], E.prototype, "columnId", 2);
7200
- K([
7121
+ ], O.prototype, "columnId", 2);
7122
+ N([
7201
7123
  p({ type: Array })
7202
- ], E.prototype, "mergeTags", 2);
7203
- K([
7124
+ ], O.prototype, "mergeTags", 2);
7125
+ N([
7204
7126
  p({ attribute: !1 })
7205
- ], E.prototype, "requestMergeTags", 2);
7206
- K([
7207
- d()
7208
- ], E.prototype, "_pickerOpen", 2);
7209
- K([
7210
- d()
7211
- ], E.prototype, "_pickerX", 2);
7212
- K([
7213
- d()
7214
- ], E.prototype, "_pickerY", 2);
7215
- E = K([
7216
- u("pigeon-html-panel")
7217
- ], E);
7218
- var kr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Ce = (e, t, o, r) => {
7219
- for (var i = r > 1 ? void 0 : r ? Cr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
7127
+ ], O.prototype, "requestMergeTags", 2);
7128
+ N([
7129
+ c()
7130
+ ], O.prototype, "_pickerOpen", 2);
7131
+ N([
7132
+ c()
7133
+ ], O.prototype, "_pickerX", 2);
7134
+ N([
7135
+ c()
7136
+ ], O.prototype, "_pickerY", 2);
7137
+ O = N([
7138
+ h("pigeon-html-panel")
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--)
7220
7142
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
7221
- return r && i && kr(t, o, i), i;
7143
+ return r && i && Li(t, o, i), i;
7222
7144
  };
7223
- let J = class extends g {
7145
+ let Y = class extends d {
7224
7146
  constructor() {
7225
7147
  super(...arguments), this.rowId = "", this.columnId = "", this.label = "Block", this.schema = [];
7226
7148
  }
@@ -7330,31 +7252,106 @@ let J = class extends g {
7330
7252
  );
7331
7253
  }
7332
7254
  };
7333
- J.styles = I;
7334
- Ce([
7255
+ Y.styles = w;
7256
+ fe([
7335
7257
  p({ type: Object })
7336
- ], J.prototype, "block", 2);
7337
- Ce([
7258
+ ], Y.prototype, "block", 2);
7259
+ fe([
7338
7260
  p({ type: String })
7339
- ], J.prototype, "rowId", 2);
7340
- Ce([
7261
+ ], Y.prototype, "rowId", 2);
7262
+ fe([
7341
7263
  p({ type: String })
7342
- ], J.prototype, "columnId", 2);
7343
- Ce([
7264
+ ], Y.prototype, "columnId", 2);
7265
+ fe([
7344
7266
  p({ type: String })
7345
- ], J.prototype, "label", 2);
7346
- Ce([
7267
+ ], Y.prototype, "label", 2);
7268
+ fe([
7347
7269
  p({ type: Array })
7348
- ], J.prototype, "schema", 2);
7349
- J = Ce([
7350
- u("pigeon-custom-panel")
7351
- ], J);
7352
- var Ir = Object.defineProperty, Tr = Object.getOwnPropertyDescriptor, M = (e, t, o, r) => {
7353
- for (var i = r > 1 ? void 0 : r ? Tr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
7270
+ ], Y.prototype, "schema", 2);
7271
+ Y = fe([
7272
+ h("pigeon-custom-panel")
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--)
7276
+ (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
7277
+ return r && i && Mi(t, o, i), i;
7278
+ };
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--)
7354
7351
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
7355
- return r && i && Ir(t, o, i), i;
7352
+ return r && i && Fi(t, o, i), i;
7356
7353
  };
7357
- let C = class extends g {
7354
+ let P = class extends d {
7358
7355
  constructor() {
7359
7356
  super(...arguments), this.selection = null, this.mergeTags = [], this.requestMergeTags = !1, this.brandKit = null, this.fontConfig = [], this.linkTypes = [];
7360
7357
  }
@@ -7368,6 +7365,7 @@ let C = class extends g {
7368
7365
  return e.filter((r) => t.has(r.family) ? !1 : (t.add(r.family), !0));
7369
7366
  }
7370
7367
  render() {
7368
+ var e;
7371
7369
  if (!this.doc) return l``;
7372
7370
  if (!this.selection || this.selection.type === "body")
7373
7371
  return l`
@@ -7382,32 +7380,63 @@ let C = class extends g {
7382
7380
  </div>
7383
7381
  `;
7384
7382
  if (this.selection.type === "row" && this.selection.rowId) {
7385
- const e = this._findRow(this.selection.rowId);
7386
- if (e)
7383
+ const t = this._findRow(this.selection.rowId);
7384
+ if (t)
7387
7385
  return l`
7388
7386
  <div class="panel-wrapper" part="panel">
7389
- <pigeon-row-panel .row=${e}></pigeon-row-panel>
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
+ )}
7390
7395
  </div>
7391
7396
  `;
7392
7397
  }
7393
7398
  if (this.selection.type === "block" && this.selection.rowId && this.selection.columnId && this.selection.blockId) {
7394
- const e = this._findBlock(this.selection.rowId, this.selection.columnId, this.selection.blockId);
7395
- if (e)
7399
+ const t = this._findBlock(this.selection.rowId, this.selection.columnId, this.selection.blockId);
7400
+ if (t)
7396
7401
  return l`
7397
7402
  <div class="panel-wrapper" part="panel">
7398
- ${this._renderBreadcrumb(this.selection.rowId, this.selection.columnId, this._blockLabel(e))}
7399
- ${this._renderBlockPanel(e, this.selection.rowId, this.selection.columnId)}
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
+ )}
7400
7418
  </div>
7401
7419
  `;
7402
7420
  }
7403
- return this.selection.type === "column" ? l`
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`
7404
7424
  <div class="panel-wrapper" part="panel">
7405
- ${this.selection.rowId && this.selection.columnId ? this._renderBreadcrumb(this.selection.rowId, this.selection.columnId) : ""}
7425
+ ${t && o ? this._renderBreadcrumb(t, o) : ""}
7406
7426
  <div class="empty-state">
7407
7427
  <p>Column selected. Select a block within the column to edit its properties.</p>
7408
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
+ ) : ""}
7409
7436
  </div>
7410
- ` : l`
7437
+ `;
7438
+ }
7439
+ return l`
7411
7440
  <div class="panel-wrapper" part="panel">
7412
7441
  <div class="empty-state">
7413
7442
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
@@ -7445,9 +7474,39 @@ let C = class extends g {
7445
7474
  </nav>
7446
7475
  `;
7447
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
+ }
7448
7485
  _select(e, t) {
7486
+ this._emit(e, t);
7487
+ }
7488
+ _emit(e, t) {
7449
7489
  this.dispatchEvent(new CustomEvent(e, { detail: t, bubbles: !0, composed: !0 }));
7450
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
+ }
7451
7510
  _blockLabel(e) {
7452
7511
  var r;
7453
7512
  const t = {
@@ -7461,7 +7520,7 @@ let C = class extends g {
7461
7520
  hero: "Hero",
7462
7521
  navbar: "Navbar"
7463
7522
  }, o = e.type;
7464
- return t[o] ?? ((r = yt(o)) == null ? void 0 : r.label) ?? o;
7523
+ return t[o] ?? ((r = et(o)) == null ? void 0 : r.label) ?? o;
7465
7524
  }
7466
7525
  _renderBlockPanel(e, t, o) {
7467
7526
  switch (e.type) {
@@ -7497,7 +7556,7 @@ let C = class extends g {
7497
7556
  case "html":
7498
7557
  return l`<pigeon-html-panel .block=${e} .rowId=${t} .columnId=${o} .mergeTags=${this.mergeTags} .requestMergeTags=${this.requestMergeTags}></pigeon-html-panel>`;
7499
7558
  default: {
7500
- const r = e.type ?? "unknown", i = yt(r);
7559
+ const r = e.type ?? "unknown", i = et(r);
7501
7560
  return i != null && i.propertySchema && i.propertySchema.length > 0 ? l`<pigeon-custom-panel
7502
7561
  .block=${e}
7503
7562
  .rowId=${t}
@@ -7526,7 +7585,7 @@ let C = class extends g {
7526
7585
  return i.blocks.find((n) => n.id === o);
7527
7586
  }
7528
7587
  };
7529
- C.styles = b`
7588
+ P.styles = g`
7530
7589
  :host {
7531
7590
  display: block;
7532
7591
  width: var(--pigeon-properties-width, 300px);
@@ -7584,6 +7643,46 @@ C.styles = b`
7584
7643
  font-size: 10px;
7585
7644
  }
7586
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
+
7587
7686
  .empty-state {
7588
7687
  display: flex;
7589
7688
  flex-direction: column;
@@ -7609,42 +7708,42 @@ C.styles = b`
7609
7708
  line-height: 1.5;
7610
7709
  }
7611
7710
  `;
7612
- M([
7711
+ z([
7613
7712
  p({ type: Object })
7614
- ], C.prototype, "doc", 2);
7615
- M([
7713
+ ], P.prototype, "doc", 2);
7714
+ z([
7616
7715
  p({ type: Object })
7617
- ], C.prototype, "selection", 2);
7618
- M([
7716
+ ], P.prototype, "selection", 2);
7717
+ z([
7619
7718
  p({ type: Array })
7620
- ], C.prototype, "mergeTags", 2);
7621
- M([
7719
+ ], P.prototype, "mergeTags", 2);
7720
+ z([
7622
7721
  p({ attribute: !1 })
7623
- ], C.prototype, "requestMergeTags", 2);
7624
- M([
7722
+ ], P.prototype, "requestMergeTags", 2);
7723
+ z([
7625
7724
  p({ attribute: !1 })
7626
- ], C.prototype, "assetManagerConfig", 2);
7627
- M([
7725
+ ], P.prototype, "assetManagerConfig", 2);
7726
+ z([
7628
7727
  p({ attribute: !1 })
7629
- ], C.prototype, "assetStorage", 2);
7630
- M([
7728
+ ], P.prototype, "assetStorage", 2);
7729
+ z([
7631
7730
  p({ attribute: !1 })
7632
- ], C.prototype, "brandKit", 2);
7633
- M([
7731
+ ], P.prototype, "brandKit", 2);
7732
+ z([
7634
7733
  p({ attribute: !1 })
7635
- ], C.prototype, "fontConfig", 2);
7636
- M([
7734
+ ], P.prototype, "fontConfig", 2);
7735
+ z([
7637
7736
  p({ attribute: !1 })
7638
- ], C.prototype, "linkTypes", 2);
7639
- C = M([
7640
- u("pigeon-properties")
7641
- ], C);
7642
- var Pr = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, D = (e, t, o, r) => {
7643
- for (var i = r > 1 ? void 0 : r ? Sr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
7737
+ ], P.prototype, "linkTypes", 2);
7738
+ P = z([
7739
+ h("pigeon-properties")
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--)
7644
7743
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
7645
- return r && i && Pr(t, o, i), i;
7744
+ return r && i && Ui(t, o, i), i;
7646
7745
  };
7647
- let k = class extends g {
7746
+ let x = class extends d {
7648
7747
  constructor() {
7649
7748
  super(...arguments), this.fonts = [], this.open = !1, this._viewMode = "preview", this._device = "desktop", this._htmlContent = "", this._mjmlContent = "", this._loading = !1, this._previouslyFocused = null, this._onKeyDown = (e) => {
7650
7749
  this.open && (e.key === "Escape" ? (e.stopPropagation(), this._close()) : e.key === "Tab" && this._trapTab(e));
@@ -7728,13 +7827,13 @@ let k = class extends g {
7728
7827
  _renderContent() {
7729
7828
  switch (this._viewMode) {
7730
7829
  case "preview":
7731
- return l`
7830
+ return ro(this._htmlContent, l`
7732
7831
  <iframe
7733
7832
  style="width: ${this._device === "mobile" ? "375px" : "100%"}; height: 100%;"
7734
7833
  sandbox="allow-popups allow-popups-to-escape-sandbox"
7735
7834
  srcdoc=${this._htmlContent}
7736
7835
  ></iframe>
7737
- `;
7836
+ `);
7738
7837
  case "html":
7739
7838
  return l`<div class="source-view">${this._htmlContent}</div>`;
7740
7839
  case "mjml":
@@ -7759,10 +7858,10 @@ let k = class extends g {
7759
7858
  this._viewMode = e;
7760
7859
  }
7761
7860
  _close() {
7762
- this.open = !1;
7861
+ this.open = !1, this.dispatchEvent(new CustomEvent("preview-close", { bubbles: !0, composed: !0 }));
7763
7862
  }
7764
7863
  };
7765
- k.styles = b`
7864
+ x.styles = g`
7766
7865
  :host {
7767
7866
  display: none;
7768
7867
  }
@@ -7941,52 +8040,52 @@ k.styles = b`
7941
8040
  `;
7942
8041
  D([
7943
8042
  p({ type: Object })
7944
- ], k.prototype, "renderer", 2);
8043
+ ], x.prototype, "renderer", 2);
7945
8044
  D([
7946
8045
  p({ type: Object })
7947
- ], k.prototype, "doc", 2);
8046
+ ], x.prototype, "doc", 2);
7948
8047
  D([
7949
8048
  p({ attribute: !1 })
7950
- ], k.prototype, "documentToMjml", 2);
8049
+ ], x.prototype, "documentToMjml", 2);
7951
8050
  D([
7952
8051
  p({ attribute: !1 })
7953
- ], k.prototype, "fonts", 2);
8052
+ ], x.prototype, "fonts", 2);
7954
8053
  D([
7955
8054
  p({ type: Boolean, reflect: !0 })
7956
- ], k.prototype, "open", 2);
8055
+ ], x.prototype, "open", 2);
7957
8056
  D([
7958
- d()
7959
- ], k.prototype, "_viewMode", 2);
8057
+ c()
8058
+ ], x.prototype, "_viewMode", 2);
7960
8059
  D([
7961
- d()
7962
- ], k.prototype, "_device", 2);
8060
+ c()
8061
+ ], x.prototype, "_device", 2);
7963
8062
  D([
7964
- d()
7965
- ], k.prototype, "_htmlContent", 2);
8063
+ c()
8064
+ ], x.prototype, "_htmlContent", 2);
7966
8065
  D([
7967
- d()
7968
- ], k.prototype, "_mjmlContent", 2);
8066
+ c()
8067
+ ], x.prototype, "_mjmlContent", 2);
7969
8068
  D([
7970
- d()
7971
- ], k.prototype, "_loading", 2);
7972
- k = D([
7973
- u("pigeon-preview")
7974
- ], k);
7975
- var Or = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, $ = (e, t, o, r) => {
7976
- for (var i = r > 1 ? void 0 : r ? Er(t, o) : t, n = e.length - 1, a; n >= 0; n--)
8069
+ c()
8070
+ ], x.prototype, "_loading", 2);
8071
+ x = D([
8072
+ h("pigeon-preview")
8073
+ ], x);
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--)
7977
8076
  (a = e[n]) && (i = (r ? a(t, o, i) : a(i)) || i);
7978
- return r && i && Or(t, o, i), i;
8077
+ return r && i && Ki(t, o, i), i;
7979
8078
  };
7980
- let _t = null;
7981
- function Dr() {
7982
- return _t || (_t = import("./templates.js").then((e) => e.p)), _t;
8079
+ let Qe = null;
8080
+ function qi() {
8081
+ return Qe || (Qe = import("./templates.js")), Qe;
7983
8082
  }
7984
- function Qt(e) {
8083
+ function St(e) {
7985
8084
  return e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || `template-${Date.now()}`;
7986
8085
  }
7987
- let _ = class extends g {
8086
+ let v = class extends d {
7988
8087
  constructor() {
7989
- 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) => {
7990
8089
  e.stopPropagation();
7991
8090
  const t = e.detail.kit;
7992
8091
  if (this._activeBrandKit = t, this.dispatchEvent(
@@ -8006,7 +8105,7 @@ let _ = class extends g {
8006
8105
  const t = e.detail.value, o = this._state.selection;
8007
8106
  if ((o == null ? void 0 : o.type) === "block" && o.rowId && o.columnId && o.blockId) {
8008
8107
  const r = this._findBlock(o.rowId, o.columnId, o.blockId);
8009
- (r == null ? void 0 : r.type) === "button" && ct(o.rowId, o.columnId, o.blockId, { backgroundColor: t })(this._state, this._dispatch);
8108
+ (r == null ? void 0 : r.type) === "button" && Ve(o.rowId, o.columnId, o.blockId, { backgroundColor: t })(this._state, this._dispatch);
8010
8109
  return;
8011
8110
  }
8012
8111
  this._applyBodyAttribute("backgroundColor", t);
@@ -8014,30 +8113,30 @@ let _ = class extends g {
8014
8113
  e.stopPropagation(), this._applyBodyAttribute("fontFamily", e.detail.family);
8015
8114
  }, this._handleBrandLogoInsert = (e) => {
8016
8115
  e.stopPropagation();
8017
- const { logo: t } = e.detail, o = Ve("image");
8116
+ const { logo: t } = e.detail, o = Be("image");
8018
8117
  o.values.src = t.src, o.values.alt = t.name, t.width && (o.values.width = t.width);
8019
8118
  const r = this._state.selection;
8020
8119
  if (r != null && r.rowId && (r != null && r.columnId)) {
8021
- ce(r.rowId, r.columnId, o)(this._state, this._dispatch);
8120
+ ie(r.rowId, r.columnId, o)(this._state, this._dispatch);
8022
8121
  return;
8023
8122
  }
8024
8123
  const i = this._state.doc.body.rows;
8025
8124
  if (i.length > 0) {
8026
8125
  const n = i[i.length - 1], a = n.columns[0];
8027
- ce(n.id, a.id, o, a.blocks.length)(this._state, this._dispatch);
8126
+ ie(n.id, a.id, o, a.blocks.length)(this._state, this._dispatch);
8028
8127
  } else {
8029
- const n = Ie([o]);
8030
- oe(Te([n]), 0)(this._state, this._dispatch);
8128
+ const n = me([o]);
8129
+ J(ye([n]), 0)(this._state, this._dispatch);
8031
8130
  }
8032
8131
  }, this._dispatch = (e) => {
8033
- 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());
8034
8133
  }, this._handleRowSave = async (e) => {
8035
8134
  const t = this._state.doc.body.rows.find((n) => n.id === e.detail.rowId);
8036
8135
  if (!t) return;
8037
8136
  const o = window.prompt("Name this saved row");
8038
8137
  if (!o || !o.trim()) return;
8039
8138
  const r = (/* @__PURE__ */ new Date()).toISOString(), i = {
8040
- id: Qt(o),
8139
+ id: St(o),
8041
8140
  name: o.trim(),
8042
8141
  kind: "row",
8043
8142
  node: structuredClone(t),
@@ -8050,11 +8149,11 @@ let _ = class extends g {
8050
8149
  this._emitRowLibraryError(n, "save");
8051
8150
  }
8052
8151
  }, this._handleRowInsertSaved = (e) => {
8053
- const t = jt(e.detail.node);
8054
- oe(t, e.detail.index)(this._state, this._dispatch);
8152
+ const t = ft(e.detail.node);
8153
+ J(t, e.detail.index)(this._state, this._dispatch);
8055
8154
  }, this._handleLibraryInsert = (e) => {
8056
- const t = jt(e.detail.node);
8057
- oe(t, this._state.doc.body.rows.length)(this._state, this._dispatch);
8155
+ const t = ft(e.detail.node);
8156
+ J(t, this._state.doc.body.rows.length)(this._state, this._dispatch);
8058
8157
  }, this._handleLibraryDelete = async (e) => {
8059
8158
  try {
8060
8159
  await this._resolveRowLibrary().delete(e.detail.id), await this._refreshSavedTab();
@@ -8074,16 +8173,16 @@ let _ = class extends g {
8074
8173
  }
8075
8174
  if (e.key === "Escape") {
8076
8175
  const r = this._state.createTransaction();
8077
- r.setSelection(Mt()), this._dispatch(r);
8176
+ r.setSelection(mt()), this._dispatch(r);
8078
8177
  return;
8079
8178
  }
8080
8179
  if (o) {
8081
8180
  if (e.key === "Delete" || e.key === "Backspace") {
8082
- o.type === "block" && o.rowId && o.columnId && o.blockId ? (e.preventDefault(), ho(o.rowId, o.columnId, o.blockId)(this._state, this._dispatch)) : o.type === "row" && o.rowId && (e.preventDefault(), Rt(o.rowId)(this._state, this._dispatch));
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));
8083
8182
  return;
8084
8183
  }
8085
8184
  if (t && e.key.toLowerCase() === "d") {
8086
- o.type === "block" && o.rowId && o.columnId && o.blockId ? (e.preventDefault(), go(o.rowId, o.columnId, o.blockId)(this._state, this._dispatch)) : o.type === "row" && o.rowId && (e.preventDefault(), Lt(o.rowId)(this._state, this._dispatch));
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));
8087
8186
  return;
8088
8187
  }
8089
8188
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
@@ -8103,13 +8202,13 @@ let _ = class extends g {
8103
8202
  if (o.type === "block" && o.rowId && o.columnId && o.blockId) {
8104
8203
  e.preventDefault();
8105
8204
  const r = structuredClone(this._clipboard);
8106
- r.id = zt();
8205
+ r.id = xt();
8107
8206
  const i = this._findBlockIndex(o.rowId, o.columnId, o.blockId), n = i >= 0 ? i + 1 : void 0;
8108
- ce(o.rowId, o.columnId, r, n)(this._state, this._dispatch);
8207
+ ie(o.rowId, o.columnId, r, n)(this._state, this._dispatch);
8109
8208
  } else if (o.type === "column" && o.rowId && o.columnId) {
8110
8209
  e.preventDefault();
8111
8210
  const r = structuredClone(this._clipboard);
8112
- r.id = zt(), ce(o.rowId, o.columnId, r)(this._state, this._dispatch);
8211
+ r.id = xt(), ie(o.rowId, o.columnId, r)(this._state, this._dispatch);
8113
8212
  }
8114
8213
  return;
8115
8214
  }
@@ -8120,13 +8219,13 @@ let _ = class extends g {
8120
8219
  /* Lifecycle */
8121
8220
  /* ------------------------------------------------------------------ */
8122
8221
  connectedCallback() {
8123
- super.connectedCallback(), Bt(this.config.locale, this.config.messages), 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);
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);
8124
8223
  }
8125
8224
  disconnectedCallback() {
8126
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);
8127
8226
  }
8128
8227
  updated(e) {
8129
- 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), this._applyDir(), this._resolveBrandKit());
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());
8130
8229
  }
8131
8230
  /**
8132
8231
  * Set the host `dir` attribute based on `config.locale` and `config.dir`.
@@ -8135,7 +8234,7 @@ let _ = class extends g {
8135
8234
  * bidirectional layout support.
8136
8235
  */
8137
8236
  _applyDir() {
8138
- this.setAttribute("dir", po(this.config.locale, this.config.dir));
8237
+ this.setAttribute("dir", zt(this.config.locale, this.config.dir));
8139
8238
  }
8140
8239
  /**
8141
8240
  * Sync the active `theme` to the host classes the token sheet keys off, and
@@ -8161,19 +8260,39 @@ let _ = class extends g {
8161
8260
  }
8162
8261
  /** Replaces the document entirely (resets history). */
8163
8262
  loadDocument(e) {
8164
- this._state = Ht.create({
8263
+ this._state = $t.create({
8165
8264
  doc: e,
8166
- plugins: [Ft()],
8265
+ plugins: [kt()],
8167
8266
  ...this.config
8168
8267
  }), this._syncHistoryFlags(), this.requestUpdate(), this._fireChange();
8169
8268
  }
8170
8269
  /** Undo the last change. */
8171
8270
  undo() {
8172
- return uo(this._state, this._dispatch);
8271
+ return !this.readonly && Ht(this._state, this._dispatch);
8173
8272
  }
8174
8273
  /** Redo the last undone change. */
8175
8274
  redo() {
8176
- return bo(this._state, this._dispatch);
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);
8177
8296
  }
8178
8297
  /** Export the document as JSON. */
8179
8298
  exportJson() {
@@ -8183,6 +8302,10 @@ let _ = class extends g {
8183
8302
  exportMjml() {
8184
8303
  return this.documentToMjml ? this.documentToMjml(this._state.doc, { fonts: this._renderFonts() }) : null;
8185
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
+ }
8186
8309
  /** Export the document as HTML. Requires renderer to be set. */
8187
8310
  async exportHtml() {
8188
8311
  return this.renderer ? (await this.renderer.render(this._state.doc, { fonts: this._renderFonts() })).html : null;
@@ -8202,6 +8325,7 @@ let _ = class extends g {
8202
8325
  <pigeon-toolbar
8203
8326
  part="toolbar"
8204
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}
8205
8329
  ?can-undo=${this._canUndo}
8206
8330
  ?can-redo=${this._canRedo}
8207
8331
  .device=${this._device}
@@ -8219,7 +8343,7 @@ let _ = class extends g {
8219
8343
  ></pigeon-toolbar>
8220
8344
 
8221
8345
  <div class="editor-body">
8222
- <pigeon-palette
8346
+ ${this.readonly ? "" : l`<pigeon-palette
8223
8347
  part="palette"
8224
8348
  role="complementary"
8225
8349
  aria-label="Content blocks and layers"
@@ -8228,12 +8352,13 @@ let _ = class extends g {
8228
8352
  .selection=${t}
8229
8353
  .brandKit=${this._activeBrandKit}
8230
8354
  .rowLibrary=${this._resolveRowLibrary()}
8355
+ .blocks=${this.config.blocks}
8231
8356
  @row-select=${this._handleRowSelect}
8232
8357
  @block-select=${this._handleBlockSelect}
8233
8358
  @palette-item-activate=${this._handlePaletteActivate}
8234
8359
  @library-delete=${this._handleLibraryDelete}
8235
8360
  @library-insert=${this._handleLibraryInsert}
8236
- ></pigeon-palette>
8361
+ ></pigeon-palette>`}
8237
8362
 
8238
8363
  <pigeon-canvas
8239
8364
  part="canvas"
@@ -8245,6 +8370,7 @@ let _ = class extends g {
8245
8370
  .editingBlockId=${this._editingBlockId}
8246
8371
  .device=${this._device}
8247
8372
  .previewWidth=${o}
8373
+ ?readonly=${this.readonly}
8248
8374
  @block-select=${this._handleBlockSelect}
8249
8375
  @row-select=${this._handleRowSelect}
8250
8376
  @canvas-select-body=${this._handleBodySelect}
@@ -8260,7 +8386,7 @@ let _ = class extends g {
8260
8386
  @block-exit-edit=${this._handleBlockExitEdit}
8261
8387
  ></pigeon-canvas>
8262
8388
 
8263
- <pigeon-properties
8389
+ ${this.readonly ? "" : l`<pigeon-properties
8264
8390
  part="properties"
8265
8391
  role="complementary"
8266
8392
  aria-label="Element properties"
@@ -8277,10 +8403,11 @@ let _ = class extends g {
8277
8403
  @property-change=${this._handlePropertyChange}
8278
8404
  @row-property-change=${this._handleRowPropertyChange}
8279
8405
  @row-layout-change=${this._handleRowLayoutChange}
8406
+ @column-property-change=${this._handleColumnPropertyChange}
8280
8407
  @body-property-change=${this._handleBodyPropertyChange}
8281
8408
  @row-select=${this._handleRowSelect}
8282
8409
  @column-select=${this._handleColumnSelect}
8283
- ></pigeon-properties>
8410
+ ></pigeon-properties>`}
8284
8411
  </div>
8285
8412
 
8286
8413
  <pigeon-preview
@@ -8289,9 +8416,10 @@ let _ = class extends g {
8289
8416
  .renderer=${this.renderer}
8290
8417
  .documentToMjml=${this.documentToMjml}
8291
8418
  .fonts=${this._renderFonts()}
8419
+ @preview-close=${() => this._setPreviewOpen(!1)}
8292
8420
  @click=${(n) => {
8293
8421
  var a;
8294
- (a = n.target.classList) != null && a.contains("overlay") && (this._previewOpen = !1);
8422
+ (a = n.target.classList) != null && a.contains("overlay") && this._setPreviewOpen(!1);
8295
8423
  }}
8296
8424
  ></pigeon-preview>
8297
8425
 
@@ -8309,13 +8437,13 @@ let _ = class extends g {
8309
8437
  /* Templates */
8310
8438
  /* ------------------------------------------------------------------ */
8311
8439
  _resolveTemplateStorage() {
8312
- return this.templateStorage ? this.templateStorage : (this._defaultTemplateStorage || (this._defaultTemplateStorage = new vo()), this._defaultTemplateStorage);
8440
+ return this.templateStorage ? this.templateStorage : (this._defaultTemplateStorage || (this._defaultTemplateStorage = new Nt()), this._defaultTemplateStorage);
8313
8441
  }
8314
8442
  _resolveRowLibrary() {
8315
- return this.config.rowLibrary ? this.config.rowLibrary : (this._defaultRowLibrary || (this._defaultRowLibrary = new fo()), this._defaultRowLibrary);
8443
+ return this.config.rowLibrary ? this.config.rowLibrary : (this._defaultRowLibrary || (this._defaultRowLibrary = new Kt()), this._defaultRowLibrary);
8316
8444
  }
8317
8445
  _linkTypes() {
8318
- return [...mo, ...this.config.linkTypes ?? []];
8446
+ return [...Wt, ...this.config.linkTypes ?? []];
8319
8447
  }
8320
8448
  /**
8321
8449
  * Resolve `config.brandKit` into a single active kit. A plain `BrandKit` is
@@ -8356,7 +8484,7 @@ let _ = class extends g {
8356
8484
  }
8357
8485
  /** Apply a single body attribute through an undoable transaction. */
8358
8486
  _applyBodyAttribute(e, t) {
8359
- const o = this._state.createTransaction(), i = this._state.doc.body.attributes[e], n = dt(
8487
+ const o = this._state.createTransaction(), i = this._state.doc.body.attributes[e], n = Ye(
8360
8488
  "updateBodyAttribute",
8361
8489
  `body.attributes.${e}`,
8362
8490
  (a) => {
@@ -8369,7 +8497,7 @@ let _ = class extends g {
8369
8497
  o.addStep(n), this._dispatch(o);
8370
8498
  }
8371
8499
  async _handleTemplatesOpen() {
8372
- this._templatePickerLoaded || (await Dr(), this._templatePickerLoaded = !0), this._templatePickerOpen = !0;
8500
+ this._templatePickerLoaded || (await qi(), this._templatePickerLoaded = !0), this._templatePickerOpen = !0;
8373
8501
  }
8374
8502
  _handleTemplateLoad(e) {
8375
8503
  var o;
@@ -8380,7 +8508,7 @@ let _ = class extends g {
8380
8508
  async _handleTemplateSave(e) {
8381
8509
  e.stopPropagation();
8382
8510
  const { name: t, description: o, category: r } = e.detail, i = this._resolveTemplateStorage(), n = (/* @__PURE__ */ new Date()).toISOString(), a = {
8383
- id: Qt(t),
8511
+ id: St(t),
8384
8512
  name: t,
8385
8513
  description: o,
8386
8514
  category: r,
@@ -8389,21 +8517,21 @@ let _ = class extends g {
8389
8517
  updatedAt: n
8390
8518
  };
8391
8519
  await i.save(a);
8392
- const h = this.renderRoot.querySelector(
8520
+ const u = this.renderRoot.querySelector(
8393
8521
  "pigeon-template-picker"
8394
8522
  );
8395
- h && await h.refresh(), this._templatePickerOpen = !1;
8523
+ u && await u.refresh(), this._templatePickerOpen = !1;
8396
8524
  }
8397
8525
  /* ------------------------------------------------------------------ */
8398
8526
  /* Internal: state init & dispatch */
8399
8527
  /* ------------------------------------------------------------------ */
8400
8528
  _initState() {
8401
- const e = this.document ?? this.config.doc ?? _o(), t = this.config.plugins ?? [];
8402
- t.some((r) => r.name === Nt) || t.unshift(Ft()), this._state = Ht.create({ doc: e, plugins: t }), this._syncHistoryFlags();
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();
8403
8531
  }
8404
8532
  _syncHistoryFlags() {
8405
- const e = this._state.getPluginState(Nt);
8406
- this._canUndo = e ? yo(e) : !1, this._canRedo = e ? xo(e) : !1;
8533
+ const e = this._state.getPluginState(Ct);
8534
+ this._canUndo = e ? Vt(e) : !1, this._canRedo = e ? Yt(e) : !1;
8407
8535
  }
8408
8536
  /* ------------------------------------------------------------------ */
8409
8537
  /* Internal: event emitters */
@@ -8437,8 +8565,19 @@ let _ = class extends g {
8437
8565
  _handleFullscreen() {
8438
8566
  this._fullscreen = !this._fullscreen;
8439
8567
  }
8440
- _handlePreview() {
8441
- this.renderer ? this._previewOpen = !0 : this.dispatchEvent(new CustomEvent("pigeon:preview", {
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", {
8442
8581
  bubbles: !0,
8443
8582
  composed: !0
8444
8583
  }));
@@ -8484,7 +8623,7 @@ let _ = class extends g {
8484
8623
  for (const r of o.columns)
8485
8624
  if (r.blocks.find((n) => n.id === t)) {
8486
8625
  const n = this._state.createTransaction();
8487
- n.setSelection(ht(o.id, r.id, t)), this._dispatch(n), this._editingBlockId = t;
8626
+ n.setSelection(Xe(o.id, r.id, t)), this._dispatch(n), !this.readonly && !o.locked && (this._editingBlockId = t);
8488
8627
  return;
8489
8628
  }
8490
8629
  }
@@ -8495,7 +8634,7 @@ let _ = class extends g {
8495
8634
  const r = o.blocks.find((n) => n.id === e.detail.blockId);
8496
8635
  if (!r) continue;
8497
8636
  const i = r.values.content;
8498
- typeof i == "string" && i !== e.detail.content && ct(t.id, o.id, r.id, { content: e.detail.content })(this._state, this._dispatch), this._editingBlockId = null;
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;
8499
8638
  return;
8500
8639
  }
8501
8640
  this._editingBlockId = null;
@@ -8508,36 +8647,36 @@ let _ = class extends g {
8508
8647
  for (const r of o.columns)
8509
8648
  if (r.blocks.find((n) => n.id === t)) {
8510
8649
  const n = this._state.createTransaction();
8511
- n.setSelection(ht(o.id, r.id, t)), this._dispatch(n);
8650
+ n.setSelection(Xe(o.id, r.id, t)), this._dispatch(n);
8512
8651
  return;
8513
8652
  }
8514
8653
  }
8515
8654
  _handleRowSelect(e) {
8516
8655
  this._editingBlockId = null;
8517
8656
  const t = this._state.createTransaction();
8518
- t.setSelection(Ut(e.detail.rowId)), this._dispatch(t);
8657
+ t.setSelection(It(e.detail.rowId)), this._dispatch(t);
8519
8658
  }
8520
8659
  _handleColumnSelect(e) {
8521
8660
  this._editingBlockId = null;
8522
8661
  const t = this._state.createTransaction();
8523
- t.setSelection($o(e.detail.rowId, e.detail.columnId)), this._dispatch(t);
8662
+ t.setSelection(Xt(e.detail.rowId, e.detail.columnId)), this._dispatch(t);
8524
8663
  }
8525
8664
  _handleBodySelect() {
8526
8665
  this._editingBlockId = null;
8527
8666
  const e = this._state.createTransaction();
8528
- e.setSelection(Mt()), this._dispatch(e);
8667
+ e.setSelection(mt()), this._dispatch(e);
8529
8668
  }
8530
8669
  /* ------------------------------------------------------------------ */
8531
8670
  /* Row action handlers */
8532
8671
  /* ------------------------------------------------------------------ */
8533
8672
  _handleRowMove(e) {
8534
- wo(e.detail.rowId, e.detail.toIndex)(this._state, this._dispatch);
8673
+ Gt(e.detail.rowId, e.detail.toIndex)(this._state, this._dispatch);
8535
8674
  }
8536
8675
  _handleRowDuplicate(e) {
8537
- Lt(e.detail.rowId)(this._state, this._dispatch);
8676
+ _t(e.detail.rowId)(this._state, this._dispatch);
8538
8677
  }
8539
8678
  _handleRowDelete(e) {
8540
- Rt(e.detail.rowId)(this._state, this._dispatch);
8679
+ yt(e.detail.rowId)(this._state, this._dispatch);
8541
8680
  }
8542
8681
  async _refreshSavedTab() {
8543
8682
  var o;
@@ -8584,12 +8723,12 @@ let _ = class extends g {
8584
8723
  _moveBlockSelection(e) {
8585
8724
  const t = this._state.selection;
8586
8725
  if (!t || t.type !== "block" || !t.blockId) return;
8587
- const o = this._flattenBlockLocations(), r = o.findIndex((h) => h.blockId === t.blockId);
8726
+ const o = this._flattenBlockLocations(), r = o.findIndex((u) => u.blockId === t.blockId);
8588
8727
  if (r === -1) return;
8589
8728
  const i = r + e;
8590
8729
  if (i < 0 || i >= o.length) return;
8591
8730
  const n = o[i], a = this._state.createTransaction();
8592
- a.setSelection(ht(n.rowId, n.columnId, n.blockId)), this._dispatch(a);
8731
+ a.setSelection(Xe(n.rowId, n.columnId, n.blockId)), this._dispatch(a);
8593
8732
  }
8594
8733
  _moveRowSelection(e) {
8595
8734
  const t = this._state.selection;
@@ -8599,7 +8738,7 @@ let _ = class extends g {
8599
8738
  const i = r + e;
8600
8739
  if (i < 0 || i >= o.length) return;
8601
8740
  const n = this._state.createTransaction();
8602
- n.setSelection(Ut(o[i].id)), this._dispatch(n);
8741
+ n.setSelection(It(o[i].id)), this._dispatch(n);
8603
8742
  }
8604
8743
  _findBlock(e, t, o) {
8605
8744
  const r = this._state.doc.body.rows.find((n) => n.id === e);
@@ -8618,15 +8757,15 @@ let _ = class extends g {
8618
8757
  /* DnD handlers */
8619
8758
  /* ------------------------------------------------------------------ */
8620
8759
  _handleRowDrop(e) {
8621
- const { index: t, columnCount: o } = e.detail, r = Array.from({ length: o }, () => Ie()), i = Te(r);
8622
- oe(i, t)(this._state, this._dispatch);
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);
8623
8762
  }
8624
8763
  _handleBlockDrop(e) {
8625
8764
  const { rowId: t, columnId: o, index: r, dragData: i } = e.detail;
8626
8765
  if (i.type === "palette-block" && i.blockType) {
8627
- const n = Ve(i.blockType);
8628
- ce(t, o, n, r)(this._state, this._dispatch);
8629
- } else i.type === "existing-block" && i.blockId && i.rowId && i.columnId && ko(
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(
8630
8769
  i.rowId,
8631
8770
  i.columnId,
8632
8771
  i.blockId,
@@ -8636,8 +8775,8 @@ let _ = class extends g {
8636
8775
  )(this._state, this._dispatch);
8637
8776
  }
8638
8777
  _handleBlockDropNewRow(e) {
8639
- const { blockType: t, rowIndex: o } = e.detail, r = Ve(t), i = Ie([r]), n = Te([i]);
8640
- oe(n, o)(this._state, this._dispatch);
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);
8641
8780
  }
8642
8781
  /**
8643
8782
  * Keyboard equivalent of dragging a palette item onto the canvas: append the
@@ -8647,21 +8786,21 @@ let _ = class extends g {
8647
8786
  _handlePaletteActivate(e) {
8648
8787
  const { type: t, blockType: o, columnCount: r } = e.detail, i = this._state.doc.body.rows;
8649
8788
  if (t === "palette-row") {
8650
- const a = Array.from({ length: r }, () => Ie());
8651
- oe(Te(a), i.length)(this._state, this._dispatch);
8789
+ const a = Array.from({ length: r }, () => me());
8790
+ J(ye(a), i.length)(this._state, this._dispatch);
8652
8791
  return;
8653
8792
  }
8654
8793
  if (!o) return;
8655
- const n = Ve(o);
8794
+ const n = Be(o);
8656
8795
  if (i.length > 0) {
8657
- const a = i[i.length - 1], h = a.columns[0];
8658
- ce(a.id, h.id, n, h.blocks.length)(
8796
+ const a = i[i.length - 1], u = a.columns[0];
8797
+ ie(a.id, u.id, n, u.blocks.length)(
8659
8798
  this._state,
8660
8799
  this._dispatch
8661
8800
  );
8662
8801
  } else {
8663
- const a = Ie([n]);
8664
- oe(Te([a]), 0)(this._state, this._dispatch);
8802
+ const a = me([n]);
8803
+ J(ye([a]), 0)(this._state, this._dispatch);
8665
8804
  }
8666
8805
  }
8667
8806
  /* ------------------------------------------------------------------ */
@@ -8669,64 +8808,68 @@ let _ = class extends g {
8669
8808
  /* ------------------------------------------------------------------ */
8670
8809
  _handlePropertyChange(e) {
8671
8810
  const { rowId: t, columnId: o, blockId: r, values: i } = e.detail;
8672
- ct(t, o, r, i)(this._state, this._dispatch);
8811
+ Ve(t, o, r, i)(this._state, this._dispatch);
8673
8812
  }
8674
8813
  _handleRowPropertyChange(e) {
8675
8814
  const { rowId: t, attributes: o } = e.detail;
8676
- Co(t, o)(this._state, this._dispatch);
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);
8677
8820
  }
8678
8821
  _handleRowLayoutChange(e) {
8679
- const { rowId: t, ratios: o, columnCount: r } = e.detail, i = this._state.doc.body.rows.find((c) => c.id === t);
8822
+ const { rowId: t, ratios: o, columnCount: r } = e.detail, i = this._state.doc.body.rows.find((b) => b.id === t);
8680
8823
  if (!i) return;
8681
8824
  const n = i.columns.length, a = r;
8682
8825
  if (a > n)
8683
- for (let c = 0; c < a - n; c++)
8684
- Io(t)(this._state, this._dispatch);
8826
+ for (let b = 0; b < a - n; b++)
8827
+ eo(t)(this._state, this._dispatch);
8685
8828
  else if (a < n)
8686
- for (let c = 0; c < n - a; c++) {
8687
- const v = this._state.doc.body.rows.find((m) => m.id === t);
8688
- if (v && v.columns.length > 1) {
8689
- const m = v.columns[v.columns.length - 1];
8690
- To(t, m.id)(this._state, this._dispatch);
8829
+ for (let b = 0; b < n - a; b++) {
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);
8691
8834
  }
8692
8835
  }
8693
- const h = this._state.doc.body.rows.find((c) => c.id === t);
8694
- h && h.columns.length === o.length && Po(t, o)(this._state, this._dispatch);
8836
+ const u = this._state.doc.body.rows.find((b) => b.id === t);
8837
+ u && u.columns.length === o.length && oo(t, o)(this._state, this._dispatch);
8695
8838
  }
8696
8839
  _handleBodyPropertyChange(e) {
8697
8840
  const { attribute: t, metaField: o, value: r } = e.detail, i = this._state.createTransaction();
8698
8841
  if (t) {
8699
- const a = this._state.doc.body.attributes[t], h = dt(
8842
+ const a = this._state.doc.body.attributes[t], u = Ye(
8700
8843
  "updateBodyAttribute",
8701
8844
  `body.attributes.${t}`,
8702
- (c) => {
8703
- c.body.attributes[t] = r;
8845
+ (b) => {
8846
+ b.body.attributes[t] = r;
8704
8847
  },
8705
- (c) => {
8706
- c.body.attributes[t] = a;
8848
+ (b) => {
8849
+ b.body.attributes[t] = a;
8707
8850
  }
8708
8851
  );
8709
- i.addStep(h);
8852
+ i.addStep(u);
8710
8853
  }
8711
8854
  if (o) {
8712
- const a = this._state.doc.metadata[o], h = dt(
8855
+ const a = this._state.doc.metadata[o], u = Ye(
8713
8856
  "updateMetadata",
8714
8857
  `metadata.${o}`,
8715
- (c) => {
8716
- c.metadata[o] = r;
8858
+ (b) => {
8859
+ b.metadata[o] = r;
8717
8860
  },
8718
- (c) => {
8719
- c.metadata[o] = a;
8861
+ (b) => {
8862
+ b.metadata[o] = a;
8720
8863
  }
8721
8864
  );
8722
- i.addStep(h);
8865
+ i.addStep(u);
8723
8866
  }
8724
8867
  this._dispatch(i);
8725
8868
  }
8726
8869
  };
8727
- _.styles = [
8728
- Eo,
8729
- b`
8870
+ v.styles = [
8871
+ no,
8872
+ g`
8730
8873
  :host {
8731
8874
  display: flex;
8732
8875
  flex-direction: column;
@@ -8752,103 +8895,111 @@ _.styles = [
8752
8895
  }
8753
8896
  `
8754
8897
  ];
8755
- $([
8898
+ f([
8756
8899
  p({ type: Object })
8757
- ], _.prototype, "document", 2);
8758
- $([
8900
+ ], v.prototype, "document", 2);
8901
+ f([
8759
8902
  p({ type: String, reflect: !0 })
8760
- ], _.prototype, "theme", 2);
8761
- $([
8903
+ ], v.prototype, "theme", 2);
8904
+ f([
8762
8905
  p({ attribute: !1 })
8763
- ], _.prototype, "themeOverrides", 2);
8764
- $([
8906
+ ], v.prototype, "themeOverrides", 2);
8907
+ f([
8908
+ p({ type: Object })
8909
+ ], v.prototype, "config", 2);
8910
+ f([
8911
+ p({ type: Boolean, reflect: !0 })
8912
+ ], v.prototype, "readonly", 2);
8913
+ f([
8765
8914
  p({ type: Object })
8766
- ], _.prototype, "config", 2);
8767
- $([
8915
+ ], v.prototype, "renderer", 2);
8916
+ f([
8768
8917
  p({ type: Object })
8769
- ], _.prototype, "renderer", 2);
8770
- $([
8918
+ ], v.prototype, "documentToMjml", 2);
8919
+ f([
8771
8920
  p({ type: Object })
8772
- ], _.prototype, "documentToMjml", 2);
8773
- $([
8921
+ ], v.prototype, "documentToPlainText", 2);
8922
+ f([
8774
8923
  p({ attribute: !1 })
8775
- ], _.prototype, "templateStorage", 2);
8776
- $([
8924
+ ], v.prototype, "templateStorage", 2);
8925
+ f([
8777
8926
  p({ attribute: !1 })
8778
- ], _.prototype, "assetStorage", 2);
8779
- $([
8780
- d()
8781
- ], _.prototype, "_state", 2);
8782
- $([
8783
- d()
8784
- ], _.prototype, "_canUndo", 2);
8785
- $([
8786
- d()
8787
- ], _.prototype, "_canRedo", 2);
8788
- $([
8789
- d()
8790
- ], _.prototype, "_device", 2);
8791
- $([
8792
- d()
8793
- ], _.prototype, "_fullscreen", 2);
8794
- $([
8795
- d()
8796
- ], _.prototype, "_previewOpen", 2);
8797
- $([
8798
- d()
8799
- ], _.prototype, "_templatePickerOpen", 2);
8800
- $([
8801
- d()
8802
- ], _.prototype, "_templatePickerLoaded", 2);
8803
- $([
8804
- d()
8805
- ], _.prototype, "_editingBlockId", 2);
8806
- $([
8807
- d()
8808
- ], _.prototype, "_activeBrandKit", 2);
8809
- _ = $([
8810
- u("pigeon-editor")
8811
- ], _);
8927
+ ], v.prototype, "assetStorage", 2);
8928
+ f([
8929
+ c()
8930
+ ], v.prototype, "_state", 2);
8931
+ f([
8932
+ c()
8933
+ ], v.prototype, "_canUndo", 2);
8934
+ f([
8935
+ c()
8936
+ ], v.prototype, "_canRedo", 2);
8937
+ f([
8938
+ c()
8939
+ ], v.prototype, "_device", 2);
8940
+ f([
8941
+ c()
8942
+ ], v.prototype, "_fullscreen", 2);
8943
+ f([
8944
+ c()
8945
+ ], v.prototype, "_previewOpen", 2);
8946
+ f([
8947
+ c()
8948
+ ], v.prototype, "_templatePickerOpen", 2);
8949
+ f([
8950
+ c()
8951
+ ], v.prototype, "_templatePickerLoaded", 2);
8952
+ f([
8953
+ c()
8954
+ ], v.prototype, "_editingBlockId", 2);
8955
+ f([
8956
+ c()
8957
+ ], v.prototype, "_activeBrandKit", 2);
8958
+ v = f([
8959
+ h("pigeon-editor")
8960
+ ], v);
8812
8961
  export {
8813
- Ne as PigeonAlignmentPicker,
8814
- x as PigeonAssetManager,
8815
- O as PigeonBodyPanel,
8816
- he as PigeonButtonBlock,
8817
- G as PigeonButtonPanel,
8818
- P as PigeonCanvas,
8819
- fe as PigeonColorPicker,
8820
- A as PigeonColumn,
8821
- Be as PigeonDividerBlock,
8822
- Ge as PigeonDropIndicator,
8823
- _ as PigeonEditor,
8824
- ge as PigeonHeroBlock,
8825
- j as PigeonHeroPanel,
8826
- Re as PigeonHtmlBlock,
8827
- Ae as PigeonImageBlock,
8828
- z as PigeonImagePanel,
8829
- De as PigeonLayers,
8830
- X as PigeonMergeTagPicker,
8831
- Le as PigeonNavBarBlock,
8832
- ae as PigeonNavBarPanel,
8833
- T as PigeonPalette,
8834
- Y as PigeonPaletteItem,
8835
- k as PigeonPreview,
8836
- C as PigeonProperties,
8837
- B as PigeonRow,
8838
- et as PigeonRowPanel,
8839
- L as PigeonSliderInput,
8840
- Me as PigeonSocialBlock,
8841
- je as PigeonSpacerBlock,
8842
- Ue as PigeonSpacingInput,
8843
- Kr as PigeonTemplatePicker,
8844
- de as PigeonTextBlock,
8845
- S as PigeonTextPanel,
8846
- V as PigeonToolbar,
8847
- Vo as calculateBlockDropIndex,
8848
- qo as calculateRowDropIndex,
8849
- Xe as clearDragData,
8850
- Ee as getDragData,
8851
- Fr as readDragTransfer,
8852
- Bo as setDragData,
8853
- wt as writeDragTransfer
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,
8973
+ v as PigeonEditor,
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,
8982
+ Z as PigeonNavBarPanel,
8983
+ $ as PigeonPalette,
8984
+ W as PigeonPaletteItem,
8985
+ x as PigeonPreview,
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,
9000
+ _e as getDragData,
9001
+ nr as loadLocale,
9002
+ tr as readDragTransfer,
9003
+ lo as setDragData,
9004
+ nt as writeDragTransfer
8854
9005
  };