react-edit-to-html 1.2.7 → 1.2.9
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.cjs +128 -28
- package/dist/index.js +325 -272
- package/dist/react-edit-to-html.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19106,64 +19106,87 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19106
19106
|
}),
|
|
19107
19107
|
/* @__PURE__ */ d("div", {
|
|
19108
19108
|
className: "space-y-3 pt-3 border-t border-gray-100",
|
|
19109
|
-
children: [
|
|
19110
|
-
|
|
19111
|
-
children: [/* @__PURE__ */ d("div", {
|
|
19112
|
-
className: "flex items-center justify-between",
|
|
19113
|
-
children: [/* @__PURE__ */ u("label", {
|
|
19114
|
-
className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider",
|
|
19115
|
-
children: "Block Width (%)"
|
|
19116
|
-
}), /* @__PURE__ */ d("span", {
|
|
19117
|
-
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
19118
|
-
children: [vx(j.style.width), "%"]
|
|
19119
|
-
})]
|
|
19120
|
-
}), /* @__PURE__ */ d("div", {
|
|
19121
|
-
className: "flex items-center space-x-2",
|
|
19122
|
-
children: [/* @__PURE__ */ u("input", {
|
|
19123
|
-
type: "range",
|
|
19124
|
-
min: "10",
|
|
19125
|
-
max: "100",
|
|
19126
|
-
step: "5",
|
|
19127
|
-
value: vx(j.style.width),
|
|
19128
|
-
onChange: (e) => n("width", `${Math.min(100, Math.max(10, parseInt(e.target.value, 10)))}%`),
|
|
19129
|
-
className: "w-full accent-slate-800 h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
19130
|
-
}), /* @__PURE__ */ d("span", {
|
|
19131
|
-
className: "text-[10px] font-mono text-slate-500 w-10 text-right",
|
|
19132
|
-
children: [vx(j.style.width), "%"]
|
|
19133
|
-
})]
|
|
19134
|
-
})]
|
|
19135
|
-
}), /* @__PURE__ */ d("div", {
|
|
19136
|
-
className: "grid grid-cols-2 gap-3",
|
|
19137
|
-
children: [/* @__PURE__ */ d("div", {
|
|
19109
|
+
children: [
|
|
19110
|
+
/* @__PURE__ */ d("div", {
|
|
19138
19111
|
className: "space-y-1",
|
|
19139
|
-
children: [/* @__PURE__ */
|
|
19140
|
-
className: "
|
|
19141
|
-
children: "
|
|
19142
|
-
|
|
19143
|
-
|
|
19144
|
-
|
|
19145
|
-
|
|
19146
|
-
|
|
19147
|
-
|
|
19148
|
-
|
|
19149
|
-
className: "
|
|
19112
|
+
children: [/* @__PURE__ */ d("div", {
|
|
19113
|
+
className: "flex items-center justify-between",
|
|
19114
|
+
children: [/* @__PURE__ */ u("label", {
|
|
19115
|
+
className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider",
|
|
19116
|
+
children: "Block Width (%)"
|
|
19117
|
+
}), /* @__PURE__ */ d("span", {
|
|
19118
|
+
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
19119
|
+
children: [vx(j.style.width), "%"]
|
|
19120
|
+
})]
|
|
19121
|
+
}), /* @__PURE__ */ d("div", {
|
|
19122
|
+
className: "flex items-center space-x-2",
|
|
19123
|
+
children: [/* @__PURE__ */ u("input", {
|
|
19124
|
+
type: "range",
|
|
19125
|
+
min: "10",
|
|
19126
|
+
max: "100",
|
|
19127
|
+
step: "5",
|
|
19128
|
+
value: vx(j.style.width),
|
|
19129
|
+
onChange: (e) => n("width", `${Math.min(100, Math.max(10, parseInt(e.target.value, 10)))}%`),
|
|
19130
|
+
className: "w-full accent-slate-800 h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
19131
|
+
}), /* @__PURE__ */ d("span", {
|
|
19132
|
+
className: "text-[10px] font-mono text-slate-500 w-10 text-right",
|
|
19133
|
+
children: [vx(j.style.width), "%"]
|
|
19134
|
+
})]
|
|
19150
19135
|
})]
|
|
19151
|
-
}),
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
|
|
19155
|
-
|
|
19156
|
-
|
|
19157
|
-
|
|
19158
|
-
|
|
19159
|
-
|
|
19160
|
-
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
|
|
19136
|
+
}),
|
|
19137
|
+
/* @__PURE__ */ d("div", {
|
|
19138
|
+
className: "grid grid-cols-2 gap-3",
|
|
19139
|
+
children: [/* @__PURE__ */ d("div", {
|
|
19140
|
+
className: "space-y-1",
|
|
19141
|
+
children: [/* @__PURE__ */ u("label", {
|
|
19142
|
+
className: "text-[10px] font-bold text-slate-400 uppercase block",
|
|
19143
|
+
children: "Bottom Margin"
|
|
19144
|
+
}), /* @__PURE__ */ u("input", {
|
|
19145
|
+
type: "range",
|
|
19146
|
+
min: "0",
|
|
19147
|
+
max: "40",
|
|
19148
|
+
step: "2",
|
|
19149
|
+
value: parseInt(j.style.marginBottom || "0px"),
|
|
19150
|
+
onChange: (e) => n("marginBottom", `${e.target.value}px`),
|
|
19151
|
+
className: "w-full accent-slate-800 h-1 bg-gray-200 rounded-lg"
|
|
19152
|
+
})]
|
|
19153
|
+
}), /* @__PURE__ */ d("div", {
|
|
19154
|
+
className: "space-y-1",
|
|
19155
|
+
children: [/* @__PURE__ */ u("label", {
|
|
19156
|
+
className: "text-[10px] font-bold text-slate-400 uppercase block",
|
|
19157
|
+
children: "Padding"
|
|
19158
|
+
}), /* @__PURE__ */ u("input", {
|
|
19159
|
+
type: "range",
|
|
19160
|
+
min: "0",
|
|
19161
|
+
max: "40",
|
|
19162
|
+
step: "2",
|
|
19163
|
+
value: parseInt(j.style.padding || "0px"),
|
|
19164
|
+
onChange: (e) => n("padding", `${e.target.value}px`),
|
|
19165
|
+
className: "w-full accent-slate-800 h-1 bg-gray-200 rounded-lg"
|
|
19166
|
+
})]
|
|
19164
19167
|
})]
|
|
19165
|
-
})
|
|
19166
|
-
|
|
19168
|
+
}),
|
|
19169
|
+
/* @__PURE__ */ d("div", {
|
|
19170
|
+
className: "flex items-center justify-between p-3 bg-slate-50 border border-gray-200 rounded-xl select-none mt-2",
|
|
19171
|
+
children: [/* @__PURE__ */ d("div", {
|
|
19172
|
+
className: "space-y-0.5",
|
|
19173
|
+
children: [/* @__PURE__ */ u("span", {
|
|
19174
|
+
className: "text-xs font-bold text-slate-700 block",
|
|
19175
|
+
children: "Page Break Before"
|
|
19176
|
+
}), /* @__PURE__ */ u("span", {
|
|
19177
|
+
className: "text-[9px] text-slate-400",
|
|
19178
|
+
children: "Force new page before this block"
|
|
19179
|
+
})]
|
|
19180
|
+
}), /* @__PURE__ */ u("button", {
|
|
19181
|
+
type: "button",
|
|
19182
|
+
onClick: () => {
|
|
19183
|
+
n("pageBreakBefore", j.style.pageBreakBefore === "always" || j.style.pageBreakBefore === !0 ? "auto" : "always");
|
|
19184
|
+
},
|
|
19185
|
+
className: `w-10 h-6 flex items-center rounded-full p-1 transition-colors duration-150 ${j.style.pageBreakBefore === "always" || j.style.pageBreakBefore === !0 ? "bg-orange-600 justify-end" : "bg-slate-300 justify-start"}`,
|
|
19186
|
+
children: /* @__PURE__ */ u("span", { className: "bg-white w-4 h-4 rounded-full shadow-md" })
|
|
19187
|
+
})]
|
|
19188
|
+
})
|
|
19189
|
+
]
|
|
19167
19190
|
}),
|
|
19168
19191
|
oe && j.tableInfo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
19169
19192
|
className: "space-y-3 pt-3 border-t border-gray-100",
|
|
@@ -19675,7 +19698,7 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19675
19698
|
a.splice(s, 0, o), t(a);
|
|
19676
19699
|
}
|
|
19677
19700
|
c(null);
|
|
19678
|
-
};
|
|
19701
|
+
}, ne = 1123, re = Math.max(1, Math.ceil(g / ne));
|
|
19679
19702
|
return /* @__PURE__ */ u("div", {
|
|
19680
19703
|
ref: _,
|
|
19681
19704
|
className: `flex-1 overflow-auto p-8 flex justify-center items-start outline-none transition-all ${h ? "cursor-grab active:cursor-grabbing" : "cursor-default"}`,
|
|
@@ -19691,8 +19714,8 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19691
19714
|
className: "transition-transform duration-75 ease-out select-none",
|
|
19692
19715
|
children: /* @__PURE__ */ d("div", {
|
|
19693
19716
|
ref: v,
|
|
19694
|
-
style: {
|
|
19695
|
-
className: "w-[794px]
|
|
19717
|
+
style: { minHeight: `${Math.max(1123, re * ne)}px` },
|
|
19718
|
+
className: "w-[794px] bg-white shadow-lg border border-gray-300/80 px-[60px] py-[60px] flex flex-col relative canvas-editor-area",
|
|
19696
19719
|
onDragOver: (e) => e.preventDefault(),
|
|
19697
19720
|
onDrop: (n) => {
|
|
19698
19721
|
if (n.preventDefault(), n.stopPropagation(), l) E(e.length);
|
|
@@ -19705,192 +19728,224 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19705
19728
|
}
|
|
19706
19729
|
}
|
|
19707
19730
|
},
|
|
19708
|
-
children: [
|
|
19709
|
-
|
|
19710
|
-
|
|
19711
|
-
/* @__PURE__ */ u(
|
|
19712
|
-
|
|
19713
|
-
className: "
|
|
19714
|
-
children:
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
|
|
19724
|
-
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19728
|
-
|
|
19729
|
-
|
|
19730
|
-
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
|
|
19739
|
-
|
|
19740
|
-
|
|
19741
|
-
|
|
19742
|
-
|
|
19743
|
-
|
|
19744
|
-
|
|
19745
|
-
|
|
19746
|
-
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
|
|
19750
|
-
|
|
19751
|
-
|
|
19752
|
-
|
|
19753
|
-
|
|
19754
|
-
|
|
19755
|
-
|
|
19756
|
-
|
|
19757
|
-
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19775
|
-
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19785
|
-
|
|
19786
|
-
|
|
19787
|
-
|
|
19788
|
-
|
|
19789
|
-
|
|
19790
|
-
|
|
19791
|
-
|
|
19792
|
-
|
|
19793
|
-
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
|
|
19800
|
-
|
|
19801
|
-
|
|
19802
|
-
|
|
19803
|
-
|
|
19804
|
-
|
|
19805
|
-
|
|
19806
|
-
|
|
19807
|
-
|
|
19808
|
-
|
|
19809
|
-
|
|
19810
|
-
|
|
19811
|
-
|
|
19731
|
+
children: [
|
|
19732
|
+
Array.from({ length: Math.max(0, re - 1) }).map((e, t) => {
|
|
19733
|
+
let n = t + 2, r = (t + 1) * ne;
|
|
19734
|
+
return /* @__PURE__ */ u("div", {
|
|
19735
|
+
style: { top: `${r}px` },
|
|
19736
|
+
className: "absolute left-0 right-0 z-30 pointer-events-none flex items-center justify-center border-b-2 border-dashed border-orange-400/80 bg-orange-50/10 text-orange-600 text-[10px] font-bold py-1 select-none",
|
|
19737
|
+
children: /* @__PURE__ */ u("span", {
|
|
19738
|
+
className: "bg-orange-100/90 text-orange-700 border border-orange-300/80 px-2.5 py-0.5 rounded-full shadow-xs flex items-center space-x-1 font-mono",
|
|
19739
|
+
children: /* @__PURE__ */ d("span", { children: [
|
|
19740
|
+
"📄 Page ",
|
|
19741
|
+
n,
|
|
19742
|
+
" Break (A4 - ",
|
|
19743
|
+
r,
|
|
19744
|
+
"px)"
|
|
19745
|
+
] })
|
|
19746
|
+
})
|
|
19747
|
+
}, t);
|
|
19748
|
+
}),
|
|
19749
|
+
e.length === 0 ? /* @__PURE__ */ d("div", {
|
|
19750
|
+
className: "flex-1 border-2 border-dashed border-gray-200 rounded-2xl flex flex-col items-center justify-center p-8 text-center text-slate-400",
|
|
19751
|
+
children: [
|
|
19752
|
+
/* @__PURE__ */ u(ex, { className: "h-10 w-10 mb-3 animate-bounce text-slate-350" }),
|
|
19753
|
+
/* @__PURE__ */ u("span", {
|
|
19754
|
+
className: "font-bold text-sm text-slate-600 block",
|
|
19755
|
+
children: "Drag & Drop Editor Canvas"
|
|
19756
|
+
}),
|
|
19757
|
+
/* @__PURE__ */ u("p", {
|
|
19758
|
+
className: "text-xs text-slate-400 mt-1 max-w-sm",
|
|
19759
|
+
children: "Select elements from the sidebar tabs (Text, Tables, Images) and drag them here to assemble your template structure."
|
|
19760
|
+
})
|
|
19761
|
+
]
|
|
19762
|
+
}) : wx(e).map((a) => {
|
|
19763
|
+
var o;
|
|
19764
|
+
let s = a.blocks.length > 1;
|
|
19765
|
+
return /* @__PURE__ */ u("div", {
|
|
19766
|
+
style: D({
|
|
19767
|
+
pageBreakInside: "avoid",
|
|
19768
|
+
breakInside: "avoid"
|
|
19769
|
+
}, a.blocks.some((e) => e.style.pageBreakBefore === "always" || e.style.pageBreakBefore === !0) ? {
|
|
19770
|
+
pageBreakBefore: "always",
|
|
19771
|
+
breakBefore: "page"
|
|
19772
|
+
} : {}),
|
|
19773
|
+
className: `group/row ${a.blocks.some((e) => e.style.position === "absolute") ? "" : "relative"} border border-transparent rounded-lg hover:border-slate-200/60 p-1 mb-2 ${s ? ((o = a.blocks[0]) == null || (o = o.style) == null ? void 0 : o.flexDirection) === "column" ? "flex flex-col gap-2" : "flex flex-row gap-4" : ""}`,
|
|
19774
|
+
children: a.blocks.map((a) => {
|
|
19775
|
+
var o, l, f, p;
|
|
19776
|
+
let m = n === a.id, h = D(D({}, a.style), yb(a.style.customCss || ""));
|
|
19777
|
+
return /* @__PURE__ */ d("div", {
|
|
19778
|
+
draggable: !0,
|
|
19779
|
+
onDragStart: (t) => {
|
|
19780
|
+
let n = e.findIndex((e) => e.id === a.id);
|
|
19781
|
+
te(t, n);
|
|
19782
|
+
},
|
|
19783
|
+
onDragOver: (t) => {
|
|
19784
|
+
t.preventDefault(), c(e.findIndex((e) => e.id === a.id));
|
|
19785
|
+
},
|
|
19786
|
+
onDrop: (t) => {
|
|
19787
|
+
let n = e.findIndex((e) => e.id === a.id);
|
|
19788
|
+
A(t, n);
|
|
19789
|
+
},
|
|
19790
|
+
onClick: (e) => {
|
|
19791
|
+
e.stopPropagation(), r(a.id), i("styles");
|
|
19792
|
+
},
|
|
19793
|
+
style: D({
|
|
19794
|
+
pageBreakInside: "avoid",
|
|
19795
|
+
breakInside: "avoid",
|
|
19796
|
+
width: a.style.position === "absolute" ? "100%" : a.style.width || (s ? "48%" : "100%"),
|
|
19797
|
+
height: a.style.position === "absolute" ? a.style.height || "100%" : void 0,
|
|
19798
|
+
position: a.style.position,
|
|
19799
|
+
top: a.style.top,
|
|
19800
|
+
left: a.style.left,
|
|
19801
|
+
zIndex: a.style.zIndex ? parseInt(a.style.zIndex) : void 0
|
|
19802
|
+
}, a.style.pageBreakBefore === "always" || a.style.pageBreakBefore === !0 ? {
|
|
19803
|
+
pageBreakBefore: "always",
|
|
19804
|
+
breakBefore: "page"
|
|
19805
|
+
} : {}),
|
|
19806
|
+
className: `group/block relative p-0.5 rounded-xl border border-transparent transition-all duration-150 cursor-pointer ${m ? "bg-orange-50/20 border-orange-500 shadow-sm ring-2 ring-orange-500/10" : "hover:bg-slate-50/30 hover:border-gray-200"} ${a.style.position === "absolute" ? "!absolute !inset-0 !m-auto" : ""}`,
|
|
19807
|
+
children: [m && /* @__PURE__ */ d("div", {
|
|
19808
|
+
className: "absolute -top-3.5 right-3 bg-orange-600 text-white rounded-lg px-2 py-0.5 text-[10px] font-bold flex items-center space-x-1.5 shadow-md z-30 select-none",
|
|
19809
|
+
children: [
|
|
19810
|
+
/* @__PURE__ */ u("button", {
|
|
19811
|
+
onClick: () => {
|
|
19812
|
+
w(e.findIndex((e) => e.id === a.id), "up");
|
|
19813
|
+
},
|
|
19814
|
+
className: "hover:text-slate-350",
|
|
19815
|
+
title: "Move Up",
|
|
19816
|
+
children: /* @__PURE__ */ u(Hb, { className: "h-3 w-3" })
|
|
19817
|
+
}),
|
|
19818
|
+
/* @__PURE__ */ u("button", {
|
|
19819
|
+
onClick: () => {
|
|
19820
|
+
w(e.findIndex((e) => e.id === a.id), "down");
|
|
19821
|
+
},
|
|
19822
|
+
className: "hover:text-slate-350",
|
|
19823
|
+
title: "Move Down",
|
|
19824
|
+
children: /* @__PURE__ */ u(Vb, { className: "h-3 w-3" })
|
|
19825
|
+
}),
|
|
19826
|
+
/* @__PURE__ */ u("div", { className: "h-3 w-[1px] bg-slate-700" }),
|
|
19827
|
+
/* @__PURE__ */ u("button", {
|
|
19828
|
+
onClick: (e) => C(a.id, e),
|
|
19829
|
+
className: "hover:text-slate-350",
|
|
19830
|
+
title: "Duplicate block",
|
|
19831
|
+
children: /* @__PURE__ */ u(Gb, { className: "h-3 w-3" })
|
|
19832
|
+
}),
|
|
19833
|
+
/* @__PURE__ */ u("button", {
|
|
19834
|
+
onClick: (e) => T(a.id, e),
|
|
19835
|
+
className: "hover:text-red-400 text-red-300",
|
|
19836
|
+
title: "Delete block",
|
|
19837
|
+
children: /* @__PURE__ */ u(lx, { className: "h-3 w-3" })
|
|
19838
|
+
})
|
|
19839
|
+
]
|
|
19840
|
+
}), a.type === "table" ? /* @__PURE__ */ u("div", {
|
|
19841
|
+
className: "overflow-x-auto w-full select-none",
|
|
19842
|
+
children: /* @__PURE__ */ d("table", {
|
|
19843
|
+
style: h,
|
|
19844
|
+
className: "w-full border-collapse",
|
|
19845
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: (o = a.tableInfo) == null ? void 0 : o.columns.filter((e) => e.enabled !== !1).map((e, t) => /* @__PURE__ */ u("th", {
|
|
19846
|
+
className: "border border-slate-200 px-2.5 py-1 text-slate-700 text-left bg-slate-50 font-sans",
|
|
19847
|
+
children: e.columnName || ""
|
|
19848
|
+
}, t)) }) }), /* @__PURE__ */ u("tbody", { children: ((l = a.tableInfo) != null && l.mockRows && a.tableInfo.mockRows.length > 0 ? a.tableInfo.mockRows : [{}]).map((e, t) => {
|
|
19849
|
+
var n;
|
|
19850
|
+
return /* @__PURE__ */ u("tr", {
|
|
19851
|
+
className: "bg-slate-50/10 border-b border-slate-100 hover:bg-slate-50/20",
|
|
19852
|
+
children: (n = a.tableInfo) == null ? void 0 : n.columns.filter((e) => e.enabled !== !1).map((t, n) => {
|
|
19853
|
+
let r = e && typeof e == "object" && e[t.columnName] || t.placeholder;
|
|
19854
|
+
if (t.loop && t.columns && t.columns.length > 0) {
|
|
19855
|
+
let e = t.columns.filter((e) => e.enabled !== !1);
|
|
19856
|
+
return /* @__PURE__ */ u("td", {
|
|
19857
|
+
className: "border border-slate-200 p-2 align-top bg-slate-50/20",
|
|
19858
|
+
children: /* @__PURE__ */ d("div", {
|
|
19859
|
+
className: "w-full overflow-x-auto space-y-1",
|
|
19860
|
+
children: [/* @__PURE__ */ d("div", {
|
|
19861
|
+
className: "flex items-center justify-between text-[9px] font-semibold text-slate-500",
|
|
19862
|
+
children: [/* @__PURE__ */ d("span", { children: ["Sub-table: ", t.columnName] }), /* @__PURE__ */ u("span", {
|
|
19863
|
+
className: "px-1.5 py-0.5 bg-slate-200 text-slate-600 rounded text-[8px]",
|
|
19864
|
+
children: "loop = true"
|
|
19865
|
+
})]
|
|
19866
|
+
}), /* @__PURE__ */ d("table", {
|
|
19867
|
+
className: "w-full border-collapse border border-slate-200 rounded text-xs bg-white",
|
|
19868
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
|
|
19869
|
+
className: "border border-slate-200 px-2 py-1 text-slate-700 text-left bg-slate-100/80 font-sans font-semibold text-[10px]",
|
|
19870
|
+
children: e.columnName
|
|
19871
|
+
}, t)) }) }), /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", {
|
|
19872
|
+
className: "bg-slate-50/30",
|
|
19873
|
+
children: e.map((e, t) => /* @__PURE__ */ u(Cx, {
|
|
19874
|
+
blockId: a.id,
|
|
19875
|
+
colIdx: t,
|
|
19876
|
+
placeholder: e.placeholder,
|
|
19877
|
+
onUpdate: (e) => O(a.id, n, e, t),
|
|
19878
|
+
onDrop: (e) => ee(e, a.id, n, t)
|
|
19879
|
+
}, t))
|
|
19880
|
+
}) })]
|
|
19812
19881
|
})]
|
|
19813
|
-
})
|
|
19814
|
-
|
|
19815
|
-
|
|
19816
|
-
|
|
19817
|
-
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
19822
|
-
colIdx: t,
|
|
19823
|
-
placeholder: e.placeholder,
|
|
19824
|
-
onUpdate: (e) => O(a.id, n, e, t),
|
|
19825
|
-
onDrop: (e) => ee(e, a.id, n, t)
|
|
19826
|
-
}, t))
|
|
19827
|
-
}) })]
|
|
19828
|
-
})]
|
|
19829
|
-
})
|
|
19882
|
+
})
|
|
19883
|
+
}, n);
|
|
19884
|
+
}
|
|
19885
|
+
return /* @__PURE__ */ u(Cx, {
|
|
19886
|
+
blockId: a.id,
|
|
19887
|
+
colIdx: n,
|
|
19888
|
+
placeholder: r,
|
|
19889
|
+
onUpdate: (e) => O(a.id, n, e),
|
|
19890
|
+
onDrop: (e) => ee(e, a.id, n)
|
|
19830
19891
|
}, n);
|
|
19831
|
-
}
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
onUpdate: (e) => O(a.id, n, e),
|
|
19837
|
-
onDrop: (e) => ee(e, a.id, n)
|
|
19838
|
-
}, n);
|
|
19839
|
-
})
|
|
19840
|
-
}, t);
|
|
19841
|
-
}) })]
|
|
19842
|
-
})
|
|
19843
|
-
}) : a.type === "image" ? /* @__PURE__ */ u("div", {
|
|
19844
|
-
style: {
|
|
19845
|
-
textAlign: h.textAlign || "left",
|
|
19846
|
-
width: "100%",
|
|
19847
|
-
marginBottom: h.marginBottom,
|
|
19848
|
-
padding: h.padding,
|
|
19849
|
-
backgroundColor: h.backgroundColor
|
|
19850
|
-
},
|
|
19851
|
-
className: "w-full select-none",
|
|
19852
|
-
children: /* @__PURE__ */ u("div", {
|
|
19892
|
+
})
|
|
19893
|
+
}, t);
|
|
19894
|
+
}) })]
|
|
19895
|
+
})
|
|
19896
|
+
}) : a.type === "image" ? /* @__PURE__ */ u("div", {
|
|
19853
19897
|
style: {
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19898
|
+
textAlign: h.textAlign || "left",
|
|
19899
|
+
width: "100%",
|
|
19900
|
+
marginBottom: h.marginBottom,
|
|
19901
|
+
padding: h.padding,
|
|
19902
|
+
backgroundColor: h.backgroundColor
|
|
19857
19903
|
},
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
width: a.style.imageWidth || (a.style.width && a.style.width.endsWith("px") ? a.style.width : "100%"),
|
|
19861
|
-
height: a.style.height || a.style.minHeight || "70px",
|
|
19862
|
-
marginLeft: h.textAlign === "center" || h.textAlign === "right" ? "auto" : "0",
|
|
19863
|
-
marginRight: h.textAlign === "center" ? "auto" : h.textAlign === "right" ? "0" : "auto"
|
|
19864
|
-
},
|
|
19865
|
-
className: "border border-dashed border-slate-200 p-2 bg-slate-50/5 rounded-lg flex items-center justify-center overflow-hidden",
|
|
19866
|
-
dangerouslySetInnerHTML: { __html: bb(a.imageInfo.barcodeValue || "SHIP-99201") }
|
|
19867
|
-
}) : /* @__PURE__ */ u("img", {
|
|
19868
|
-
src: ((p = a.imageInfo) == null ? void 0 : p.url) || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg==",
|
|
19904
|
+
className: "w-full select-none",
|
|
19905
|
+
children: /* @__PURE__ */ u("div", {
|
|
19869
19906
|
style: {
|
|
19870
|
-
width:
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
objectFit: a.style.objectFit || "contain",
|
|
19874
|
-
opacity: a.style.opacity || "1",
|
|
19875
|
-
display: "block",
|
|
19876
|
-
marginLeft: h.textAlign === "center" || h.textAlign === "right" ? "auto" : "0",
|
|
19877
|
-
marginRight: h.textAlign === "center" ? "auto" : h.textAlign === "right" ? "0" : "auto"
|
|
19907
|
+
width: s ? "100%" : a.style.width && a.style.width.endsWith("%") ? a.style.width : "100%",
|
|
19908
|
+
display: "inline-block",
|
|
19909
|
+
textAlign: h.textAlign || "left"
|
|
19878
19910
|
},
|
|
19879
|
-
|
|
19911
|
+
children: ((f = a.imageInfo) == null ? void 0 : f.imageType) === "barcode" ? /* @__PURE__ */ u("div", {
|
|
19912
|
+
style: {
|
|
19913
|
+
width: a.style.imageWidth || (a.style.width && a.style.width.endsWith("px") ? a.style.width : "100%"),
|
|
19914
|
+
height: a.style.height || a.style.minHeight || "70px",
|
|
19915
|
+
marginLeft: h.textAlign === "center" || h.textAlign === "right" ? "auto" : "0",
|
|
19916
|
+
marginRight: h.textAlign === "center" ? "auto" : h.textAlign === "right" ? "0" : "auto"
|
|
19917
|
+
},
|
|
19918
|
+
className: "border border-dashed border-slate-200 p-2 bg-slate-50/5 rounded-lg flex items-center justify-center overflow-hidden",
|
|
19919
|
+
dangerouslySetInnerHTML: { __html: bb(a.imageInfo.barcodeValue || "SHIP-99201") }
|
|
19920
|
+
}) : /* @__PURE__ */ u("img", {
|
|
19921
|
+
src: ((p = a.imageInfo) == null ? void 0 : p.url) || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg==",
|
|
19922
|
+
style: {
|
|
19923
|
+
width: a.style.imageWidth || (a.style.width && a.style.width.endsWith("px") ? a.style.width : "100%"),
|
|
19924
|
+
height: "auto",
|
|
19925
|
+
maxHeight: a.style.height || "300px",
|
|
19926
|
+
objectFit: a.style.objectFit || "contain",
|
|
19927
|
+
opacity: a.style.opacity || "1",
|
|
19928
|
+
display: "block",
|
|
19929
|
+
marginLeft: h.textAlign === "center" || h.textAlign === "right" ? "auto" : "0",
|
|
19930
|
+
marginRight: h.textAlign === "center" ? "auto" : h.textAlign === "right" ? "0" : "auto"
|
|
19931
|
+
},
|
|
19932
|
+
alt: "graphic content"
|
|
19933
|
+
})
|
|
19880
19934
|
})
|
|
19881
|
-
})
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
19887
|
-
|
|
19888
|
-
|
|
19889
|
-
})
|
|
19890
|
-
}
|
|
19891
|
-
})
|
|
19892
|
-
},
|
|
19893
|
-
|
|
19935
|
+
}) : /* @__PURE__ */ u(Sx, {
|
|
19936
|
+
block: a,
|
|
19937
|
+
onUpdate: (e) => {
|
|
19938
|
+
t((t) => t.map((t) => t.id === a.id ? D(D({}, t), {}, { content: e }) : t));
|
|
19939
|
+
},
|
|
19940
|
+
onSelect: () => r(a.id),
|
|
19941
|
+
onDrop: (e) => k(e, a.id)
|
|
19942
|
+
})]
|
|
19943
|
+
}, a.id);
|
|
19944
|
+
})
|
|
19945
|
+
}, a.id);
|
|
19946
|
+
}),
|
|
19947
|
+
s !== null && /* @__PURE__ */ u("div", { className: "h-[2px] bg-orange-500 rounded my-1 shadow-md animate-pulse" })
|
|
19948
|
+
]
|
|
19894
19949
|
})
|
|
19895
19950
|
})
|
|
19896
19951
|
});
|
|
@@ -20396,7 +20451,7 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20396
20451
|
end: Se
|
|
20397
20452
|
};
|
|
20398
20453
|
}, Ct = (e = !1) => {
|
|
20399
|
-
let t = "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Exported HTML Template</title>\n <style>\n body { font-family: 'Outfit', 'Inter', sans-serif
|
|
20454
|
+
let t = "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Exported HTML Template</title>\n <style>\n @page {\n size: A4 portrait;\n margin: 0;\n }\n * {\n box-sizing: border-box;\n }\n html, body {\n margin: 0;\n padding: 0;\n background-color: #f8fafc;\n font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n color: #1e293b;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n .paper-sheet {\n width: 794px;\n min-height: 1123px;\n margin: 20px auto;\n padding: 60px;\n background-color: #ffffff;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n box-sizing: border-box;\n position: relative;\n }\n .row-container {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n align-items: stretch;\n margin-bottom: 8px;\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n break-inside: avoid-page !important;\n }\n .block-container {\n box-sizing: border-box;\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n break-inside: avoid-page !important;\n }\n h1, h2, h3, h4, h5, h6, p {\n margin: 0;\n padding: 0;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n page-break-inside: auto;\n }\n tr {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n break-inside: avoid-page !important;\n }\n th {\n background-color: #f1f5f9;\n color: #334155;\n border: 1px solid #e2e8f0;\n padding: 6px 8px;\n font-weight: 600;\n text-align: left;\n }\n td {\n border: 1px solid #e2e8f0;\n padding: 6px 8px;\n color: #475569;\n }\n tr:nth-child(even) {\n background-color: #f8fafc;\n }\n img, svg {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n break-inside: avoid-page !important;\n }\n .page-break-before {\n page-break-before: always !important;\n break-before: page !important;\n }\n span[data-placeholder] {\n background-color: #f1f5f9;\n color: #1e293b;\n border: 1px solid #e2e8f0;\n padding: 1px 4px;\n border-radius: 3px;\n font-weight: 600;\n display: inline-flex;\n font-size: inherit;\n }\n @media print {\n html, body {\n background-color: #ffffff !important;\n }\n .paper-sheet {\n width: 100% !important;\n max-width: 100% !important;\n min-height: 100% !important;\n margin: 0 !important;\n padding: 60px !important;\n box-shadow: none !important;\n border: none !important;\n background-color: #ffffff !important;\n }\n }\n </style>\n</head>\n<body>\n <div class=\"paper-sheet\">\n";
|
|
20400
20455
|
return kx(L).forEach((n) => {
|
|
20401
20456
|
let r = n.blocks.length > 1;
|
|
20402
20457
|
if (r) {
|
|
@@ -20418,23 +20473,23 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20418
20473
|
}), t += " </tr>\n", t += " </thead>\n", t += " <tbody>\n";
|
|
20419
20474
|
let s = (t, n) => {
|
|
20420
20475
|
let r = (t.columns || []).filter((e) => e.enabled !== !1), i = " <table style=\"width: 100%; border-collapse: collapse; margin: 4px 0;\">\n";
|
|
20421
|
-
|
|
20476
|
+
i += " <thead>\n", i += " <tr>\n", r.forEach((e) => {
|
|
20422
20477
|
i += ` <th>${e.columnName || ""}</th>\n`;
|
|
20423
|
-
}), i += " </tr>\n", i += " </thead>\n", i += " <tbody>\n"
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20478
|
+
}), i += " </tr>\n", i += " </thead>\n", i += " <tbody>\n";
|
|
20479
|
+
let a = t.columnName, o = n && Array.isArray(n[a]) && n[a].length > 0 ? n[a] : [{}];
|
|
20480
|
+
if (e || o.length > 1 || !t.loop) o.forEach((e) => {
|
|
20481
|
+
i += " <tr>\n", r.forEach((t) => {
|
|
20482
|
+
let n = Ax(t.placeholder);
|
|
20483
|
+
typeof e == "object" && e && Object.keys(e).forEach((t) => {
|
|
20484
|
+
let r = RegExp(`\\{\\{(item\\.|package\\.)?${t}\\}\\}`, "g");
|
|
20485
|
+
n = n.replace(r, e[t]);
|
|
20486
|
+
}), Object.keys(yt).forEach((e) => {
|
|
20487
|
+
let t = yt[e];
|
|
20488
|
+
n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
|
|
20489
|
+
}), n = n.replace(/\{\{[^}]+\}\}/g, ""), i += ` <td>${n}</td>\n`;
|
|
20490
|
+
}), i += " </tr>\n";
|
|
20491
|
+
});
|
|
20492
|
+
else {
|
|
20438
20493
|
let e = t.columnName || "items", n = St(e);
|
|
20439
20494
|
vt ? i += ` <!-- ${n.start} --><tr>\n` : i += ` ${n.start}<tr>\n`, r.forEach((e) => {
|
|
20440
20495
|
i += ` <td>${e.placeholder}</td>\n`;
|
|
@@ -20443,25 +20498,23 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20443
20498
|
return i += " </tbody>\n", i += " </table>", i;
|
|
20444
20499
|
}, c = (t) => {
|
|
20445
20500
|
let n = " <tr>\n";
|
|
20446
|
-
return a.forEach((
|
|
20447
|
-
if (
|
|
20501
|
+
return a.forEach((i) => {
|
|
20502
|
+
if (i.loop && i.columns && i.columns.length > 0) n += ` <td>\n${s(i, t)}\n </td>\n`;
|
|
20448
20503
|
else {
|
|
20449
|
-
let
|
|
20450
|
-
e &&
|
|
20451
|
-
|
|
20504
|
+
let a = Ax(i.placeholder);
|
|
20505
|
+
(e || r.mockRows && r.mockRows.length > 1) && (t && typeof t == "object" && Object.keys(t).forEach((e) => {
|
|
20506
|
+
a.includes(`{{${e}}}`) && (a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t[e])), a.includes(`{{item.${e}}}`) && (a = a.replace(RegExp(`\\{\\{item\\.${e}\\}\\}`, "g"), t[e])), a.includes(`{{package.${e}}}`) && (a = a.replace(RegExp(`\\{\\{package\\.${e}\\}\\}`, "g"), t[e]));
|
|
20452
20507
|
}), Object.keys(yt).forEach((e) => {
|
|
20453
20508
|
let t = yt[e];
|
|
20454
|
-
|
|
20455
|
-
}),
|
|
20509
|
+
a.includes(`{{${e}}}`) && (a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
|
|
20510
|
+
}), e && (a = a.replace(/\{\{[^}]+\}\}/g, ""))), n += ` <td>${a}</td>\n`;
|
|
20456
20511
|
}
|
|
20457
20512
|
}), n += " </tr>\n", n;
|
|
20458
|
-
};
|
|
20459
|
-
if (e
|
|
20460
|
-
|
|
20461
|
-
|
|
20462
|
-
|
|
20463
|
-
});
|
|
20464
|
-
} else {
|
|
20513
|
+
}, u = r.mockRows && r.mockRows.length > 0 ? r.mockRows : [{}];
|
|
20514
|
+
if (e || u.length > 1 || !r.loop) u.forEach((e) => {
|
|
20515
|
+
t += c(e);
|
|
20516
|
+
});
|
|
20517
|
+
else {
|
|
20465
20518
|
let e = r.tableName === "package" ? "shipment.packages" : r.tableName === "article" ? "package.articles" : r.tableName, n = St(e);
|
|
20466
20519
|
vt ? t += ` <!-- ${n.start} --><tr>\n` : t += ` ${n.start}<tr>\n`, a.forEach((e) => {
|
|
20467
20520
|
e.loop && e.columns && e.columns.length > 0 ? t += ` <td>\n${s(e)}\n </td>\n` : t += ` <td>${e.placeholder}</td>\n`;
|
|
@@ -20470,7 +20523,7 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20470
20523
|
t += " </tbody>\n", t += " </table>\n", t += " </div>\n";
|
|
20471
20524
|
} else if (n.type === "image") {
|
|
20472
20525
|
let i = n.imageInfo || { imageType: "logo" }, a = "", s = n.style.height || n.style.minHeight || "auto", c = n.style.imageWidth || (n.style.width && n.style.width.endsWith("px") ? n.style.width : "100%"), l = n.style.textAlign || "left", u = l === "center" ? "margin-left: auto; margin-right: auto;" : l === "right" ? "margin-left: auto; margin-right: 0;" : "margin-left: 0; margin-right: auto;";
|
|
20473
|
-
a = i.imageType === "barcode" ? e
|
|
20526
|
+
a = i.imageType === "barcode" ? e || ft ? `<div style="width: ${c}; height: ${s}; display: block; ${u}">${bb(i.barcodeValue || "SHIP-99201")}</div>` : `<img src="${i.barcodePlaceholder || "{{barcode}}"}" style="width: ${c}; height: ${s}; display: block; ${u}" alt="Barcode" />` : `<img src="${i.url || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg=="}" style="width: ${c}; height: auto; max-height: ${s === "auto" ? "300px" : s}; object-fit: ${n.style.objectFit || "contain"}; ${n.style.opacity ? `opacity: ${n.style.opacity};` : ""} display: block; ${u}" alt="${i.imageType}" />`;
|
|
20474
20527
|
let d = r ? "100%" : n.style.width && n.style.width.endsWith("%") ? n.style.width : "100%";
|
|
20475
20528
|
t += ` <div class="block-container" style="display: block; width: ${o}; text-align: ${l}; border: none; background-color: transparent; ${n.style.marginBottom ? `margin-bottom: ${n.style.marginBottom};` : ""}">\n`, t += ` <div style="width: ${d}; text-align: ${l}; display: block;">\n`, t += ` ${a}\n`, t += " </div>\n", t += " </div>\n";
|
|
20476
20529
|
} else {
|
|
@@ -20484,13 +20537,13 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20484
20537
|
"h6"
|
|
20485
20538
|
].includes(n.type) ? r = n.type : n.type === "title" ? r = "h1" : n.type === "subtitle" ? r = "h2" : n.type === "caption" && (r = "span");
|
|
20486
20539
|
let a = Ax(n.content);
|
|
20487
|
-
e
|
|
20540
|
+
(e || ft) && (Object.keys(yt).forEach((e) => {
|
|
20488
20541
|
let t = yt[e];
|
|
20489
20542
|
a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t);
|
|
20490
|
-
}), a = a.replace(/\{\{[^}]+\}\}/g, "")), t += ` <div class="block-container" style="${l} text-align: ${n.style.textAlign};">\n`, t += ` <${r} style="${i}">${a}</${r}>\n`, t += " </div>\n";
|
|
20543
|
+
}), e && (a = a.replace(/\{\{[^}]+\}\}/g, ""))), t += ` <div class="block-container" style="${l} text-align: ${n.style.textAlign};">\n`, t += ` <${r} style="${i}">${a}</${r}>\n`, t += " </div>\n";
|
|
20491
20544
|
}
|
|
20492
20545
|
}), r && (t += " </div>\n");
|
|
20493
|
-
}), t += "</body>\n</html>", t;
|
|
20546
|
+
}), t += " </div>\n", t += "</body>\n</html>", t;
|
|
20494
20547
|
}, wt = () => {
|
|
20495
20548
|
let e = Ct(!1);
|
|
20496
20549
|
if (_) _(e);
|