react-edit-to-html 1.2.8 → 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.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: [/* @__PURE__ */ d("div", {
19110
- className: "space-y-1",
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__ */ u("label", {
19140
- className: "text-[10px] font-bold text-slate-400 uppercase block",
19141
- children: "Bottom Margin"
19142
- }), /* @__PURE__ */ u("input", {
19143
- type: "range",
19144
- min: "0",
19145
- max: "40",
19146
- step: "2",
19147
- value: parseInt(j.style.marginBottom || "0px"),
19148
- onChange: (e) => n("marginBottom", `${e.target.value}px`),
19149
- className: "w-full accent-slate-800 h-1 bg-gray-200 rounded-lg"
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
- }), /* @__PURE__ */ d("div", {
19152
- className: "space-y-1",
19153
- children: [/* @__PURE__ */ u("label", {
19154
- className: "text-[10px] font-bold text-slate-400 uppercase block",
19155
- children: "Padding"
19156
- }), /* @__PURE__ */ u("input", {
19157
- type: "range",
19158
- min: "0",
19159
- max: "40",
19160
- step: "2",
19161
- value: parseInt(j.style.padding || "0px"),
19162
- onChange: (e) => n("padding", `${e.target.value}px`),
19163
- className: "w-full accent-slate-800 h-1 bg-gray-200 rounded-lg"
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: { height: `${g}px` },
19695
- className: "w-[794px] min-h-[1123px] bg-white shadow-lg border border-gray-300/80 px-[60px] py-[60px] flex flex-col relative canvas-editor-area",
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: [e.length === 0 ? /* @__PURE__ */ d("div", {
19709
- 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",
19710
- children: [
19711
- /* @__PURE__ */ u(ex, { className: "h-10 w-10 mb-3 animate-bounce text-slate-350" }),
19712
- /* @__PURE__ */ u("span", {
19713
- className: "font-bold text-sm text-slate-600 block",
19714
- children: "Drag & Drop Editor Canvas"
19715
- }),
19716
- /* @__PURE__ */ u("p", {
19717
- className: "text-xs text-slate-400 mt-1 max-w-sm",
19718
- children: "Select elements from the sidebar tabs (Text, Tables, Images) and drag them here to assemble your template structure."
19719
- })
19720
- ]
19721
- }) : wx(e).map((a) => {
19722
- var o;
19723
- let s = a.blocks.length > 1;
19724
- return /* @__PURE__ */ u("div", {
19725
- 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" : ""}`,
19726
- children: a.blocks.map((a) => {
19727
- var o, l, f, p;
19728
- let m = n === a.id, h = D(D({}, a.style), yb(a.style.customCss || ""));
19729
- return /* @__PURE__ */ d("div", {
19730
- draggable: !0,
19731
- onDragStart: (t) => {
19732
- let n = e.findIndex((e) => e.id === a.id);
19733
- te(t, n);
19734
- },
19735
- onDragOver: (t) => {
19736
- t.preventDefault(), c(e.findIndex((e) => e.id === a.id));
19737
- },
19738
- onDrop: (t) => {
19739
- let n = e.findIndex((e) => e.id === a.id);
19740
- A(t, n);
19741
- },
19742
- onClick: (e) => {
19743
- e.stopPropagation(), r(a.id), i("styles");
19744
- },
19745
- style: {
19746
- width: a.style.position === "absolute" ? "100%" : a.style.width || (s ? "48%" : "100%"),
19747
- height: a.style.position === "absolute" ? a.style.height || "100%" : void 0,
19748
- position: a.style.position,
19749
- top: a.style.top,
19750
- left: a.style.left,
19751
- zIndex: a.style.zIndex ? parseInt(a.style.zIndex) : void 0
19752
- },
19753
- 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" : ""}`,
19754
- children: [m && /* @__PURE__ */ d("div", {
19755
- 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",
19756
- children: [
19757
- /* @__PURE__ */ u("button", {
19758
- onClick: () => {
19759
- w(e.findIndex((e) => e.id === a.id), "up");
19760
- },
19761
- className: "hover:text-slate-350",
19762
- title: "Move Up",
19763
- children: /* @__PURE__ */ u(Hb, { className: "h-3 w-3" })
19764
- }),
19765
- /* @__PURE__ */ u("button", {
19766
- onClick: () => {
19767
- w(e.findIndex((e) => e.id === a.id), "down");
19768
- },
19769
- className: "hover:text-slate-350",
19770
- title: "Move Down",
19771
- children: /* @__PURE__ */ u(Vb, { className: "h-3 w-3" })
19772
- }),
19773
- /* @__PURE__ */ u("div", { className: "h-3 w-[1px] bg-slate-700" }),
19774
- /* @__PURE__ */ u("button", {
19775
- onClick: (e) => C(a.id, e),
19776
- className: "hover:text-slate-350",
19777
- title: "Duplicate block",
19778
- children: /* @__PURE__ */ u(Gb, { className: "h-3 w-3" })
19779
- }),
19780
- /* @__PURE__ */ u("button", {
19781
- onClick: (e) => T(a.id, e),
19782
- className: "hover:text-red-400 text-red-300",
19783
- title: "Delete block",
19784
- children: /* @__PURE__ */ u(lx, { className: "h-3 w-3" })
19785
- })
19786
- ]
19787
- }), a.type === "table" ? /* @__PURE__ */ u("div", {
19788
- className: "overflow-x-auto w-full select-none",
19789
- children: /* @__PURE__ */ d("table", {
19790
- style: h,
19791
- className: "w-full border-collapse",
19792
- 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", {
19793
- className: "border border-slate-200 px-2.5 py-1 text-slate-700 text-left bg-slate-50 font-sans",
19794
- children: e.columnName || ""
19795
- }, t)) }) }), /* @__PURE__ */ u("tbody", { children: ((l = a.tableInfo) != null && l.mockRows && a.tableInfo.mockRows.length > 0 ? a.tableInfo.mockRows : [{}]).map((e, t) => {
19796
- var n;
19797
- return /* @__PURE__ */ u("tr", {
19798
- className: "bg-slate-50/10 border-b border-slate-100 hover:bg-slate-50/20",
19799
- children: (n = a.tableInfo) == null ? void 0 : n.columns.filter((e) => e.enabled !== !1).map((t, n) => {
19800
- let r = e && typeof e == "object" && e[t.columnName] || t.placeholder;
19801
- if (t.loop && t.columns && t.columns.length > 0) {
19802
- let e = t.columns.filter((e) => e.enabled !== !1);
19803
- return /* @__PURE__ */ u("td", {
19804
- className: "border border-slate-200 p-2 align-top bg-slate-50/20",
19805
- children: /* @__PURE__ */ d("div", {
19806
- className: "w-full overflow-x-auto space-y-1",
19807
- children: [/* @__PURE__ */ d("div", {
19808
- className: "flex items-center justify-between text-[9px] font-semibold text-slate-500",
19809
- children: [/* @__PURE__ */ d("span", { children: ["Sub-table: ", t.columnName] }), /* @__PURE__ */ u("span", {
19810
- className: "px-1.5 py-0.5 bg-slate-200 text-slate-600 rounded text-[8px]",
19811
- children: "loop = true"
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
- }), /* @__PURE__ */ d("table", {
19814
- className: "w-full border-collapse border border-slate-200 rounded text-xs bg-white",
19815
- children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
19816
- className: "border border-slate-200 px-2 py-1 text-slate-700 text-left bg-slate-100/80 font-sans font-semibold text-[10px]",
19817
- children: e.columnName
19818
- }, t)) }) }), /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", {
19819
- className: "bg-slate-50/30",
19820
- children: e.map((e, t) => /* @__PURE__ */ u(Cx, {
19821
- blockId: a.id,
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
- return /* @__PURE__ */ u(Cx, {
19833
- blockId: a.id,
19834
- colIdx: n,
19835
- placeholder: r,
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
- width: s ? "100%" : a.style.width && a.style.width.endsWith("%") ? a.style.width : "100%",
19855
- display: "inline-block",
19856
- textAlign: h.textAlign || "left"
19898
+ textAlign: h.textAlign || "left",
19899
+ width: "100%",
19900
+ marginBottom: h.marginBottom,
19901
+ padding: h.padding,
19902
+ backgroundColor: h.backgroundColor
19857
19903
  },
19858
- children: ((f = a.imageInfo) == null ? void 0 : f.imageType) === "barcode" ? /* @__PURE__ */ u("div", {
19859
- style: {
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: a.style.imageWidth || (a.style.width && a.style.width.endsWith("px") ? a.style.width : "100%"),
19871
- height: "auto",
19872
- maxHeight: a.style.height || "300px",
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
- alt: "graphic content"
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
- }) : /* @__PURE__ */ u(Sx, {
19883
- block: a,
19884
- onUpdate: (e) => {
19885
- t((t) => t.map((t) => t.id === a.id ? D(D({}, t), {}, { content: e }) : t));
19886
- },
19887
- onSelect: () => r(a.id),
19888
- onDrop: (e) => k(e, a.id)
19889
- })]
19890
- }, a.id);
19891
- })
19892
- }, a.id);
19893
- }), s !== null && /* @__PURE__ */ u("div", { className: "h-[2px] bg-orange-500 rounded my-1 shadow-md animate-pulse" })]
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 @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 }\n .block-container {\n box-sizing: border-box;\n page-break-inside: avoid;\n break-inside: avoid;\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 }\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 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";
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) {