react-edit-to-html 1.3.11 → 1.3.12
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 +19 -19
- package/dist/index.js +270 -228
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16946,7 +16946,33 @@ var gb = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw
|
|
|
16946
16946
|
minHeight: "auto"
|
|
16947
16947
|
}
|
|
16948
16948
|
};
|
|
16949
|
-
}, Cb = (e) => {
|
|
16949
|
+
}, Cb = (e, t) => {
|
|
16950
|
+
let n = [], r = [];
|
|
16951
|
+
if (e.querySelector("thead")) r = Array.from(e.querySelectorAll("tbody tr"));
|
|
16952
|
+
else {
|
|
16953
|
+
let t = Array.from(e.querySelectorAll("tr"));
|
|
16954
|
+
t.length > 1 && (r = t.slice(1));
|
|
16955
|
+
}
|
|
16956
|
+
return r.forEach((e) => {
|
|
16957
|
+
let r = {}, i = Array.from(e.querySelectorAll("td")), a = 0;
|
|
16958
|
+
i.forEach((e) => {
|
|
16959
|
+
let n = t[a];
|
|
16960
|
+
if (n) {
|
|
16961
|
+
var i;
|
|
16962
|
+
r[n.columnName] = e.innerHTML.trim() || ((i = e.textContent) == null ? void 0 : i.trim()) || "";
|
|
16963
|
+
let t = e.getAttribute("colspan");
|
|
16964
|
+
if (t) {
|
|
16965
|
+
let e = parseInt(t, 10);
|
|
16966
|
+
if (!isNaN(e) && e > 1) {
|
|
16967
|
+
r[`${n.columnName}_colspan`] = e, a += e;
|
|
16968
|
+
return;
|
|
16969
|
+
}
|
|
16970
|
+
}
|
|
16971
|
+
}
|
|
16972
|
+
a += 1;
|
|
16973
|
+
}), Object.keys(r).length > 0 && n.push(r);
|
|
16974
|
+
}), n.length > 0 ? n : [{}];
|
|
16975
|
+
}, wb = (e) => {
|
|
16950
16976
|
let t = new DOMParser().parseFromString(e, "text/html"), n = [], r = Array.from(t.body.children), i = t.querySelector(".paper-sheet");
|
|
16951
16977
|
if (i && i.children.length > 0 && (r = Array.from(i.children)), r.length === 0) {
|
|
16952
16978
|
let e = t.body.innerText || t.body.textContent || "";
|
|
@@ -17000,21 +17026,24 @@ var gb = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw
|
|
|
17000
17026
|
let t = e.tagName.toLowerCase(), n = a(e);
|
|
17001
17027
|
if (t === "table") {
|
|
17002
17028
|
let t = Array.from(e.querySelectorAll("thead th"));
|
|
17003
|
-
t.length === 0 && (t = Array.from(e.querySelectorAll("tr:first-child th, tr:first-child td")))
|
|
17029
|
+
t.length === 0 && (t = Array.from(e.querySelectorAll("tr:first-child th, tr:first-child td")));
|
|
17030
|
+
let r = t.map((e) => {
|
|
17031
|
+
var t, n;
|
|
17032
|
+
return {
|
|
17033
|
+
columnName: ((t = e.textContent) == null ? void 0 : t.trim()) || "Header",
|
|
17034
|
+
placeholder: `{{item.${((n = e.textContent) == null ? void 0 : n.trim().toLowerCase().replace(/\s+/g, "_")) || "field"}}}`,
|
|
17035
|
+
enabled: !0
|
|
17036
|
+
};
|
|
17037
|
+
}), i = Cb(e, r);
|
|
17038
|
+
o.push({
|
|
17004
17039
|
id: `block-${Math.random().toString(36).substr(2, 9)}`,
|
|
17005
17040
|
type: "table",
|
|
17006
17041
|
content: "",
|
|
17007
17042
|
style: n,
|
|
17008
17043
|
tableInfo: {
|
|
17009
17044
|
tableName: "imported_table",
|
|
17010
|
-
columns:
|
|
17011
|
-
|
|
17012
|
-
return {
|
|
17013
|
-
columnName: ((t = e.textContent) == null ? void 0 : t.trim()) || "Header",
|
|
17014
|
-
placeholder: `{{item.${((n = e.textContent) == null ? void 0 : n.trim().toLowerCase().replace(/\s+/g, "_")) || "field"}}}`,
|
|
17015
|
-
enabled: !0
|
|
17016
|
-
};
|
|
17017
|
-
}),
|
|
17045
|
+
columns: r,
|
|
17046
|
+
mockRows: i,
|
|
17018
17047
|
loop: !0,
|
|
17019
17048
|
isNestable: !1,
|
|
17020
17049
|
parentPath: "items",
|
|
@@ -17092,7 +17121,7 @@ var gb = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw
|
|
|
17092
17121
|
placeholder: `{{item.${((n = e.textContent) == null ? void 0 : n.trim().toLowerCase().replace(/\s+/g, "_")) || "field"}}}`,
|
|
17093
17122
|
enabled: !0
|
|
17094
17123
|
};
|
|
17095
|
-
});
|
|
17124
|
+
}), r = Cb(i, t);
|
|
17096
17125
|
n.push({
|
|
17097
17126
|
id: `block-${Math.random().toString(36).substr(2, 9)}`,
|
|
17098
17127
|
type: "table",
|
|
@@ -17101,6 +17130,7 @@ var gb = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw
|
|
|
17101
17130
|
tableInfo: {
|
|
17102
17131
|
tableName: "imported_table",
|
|
17103
17132
|
columns: t,
|
|
17133
|
+
mockRows: r,
|
|
17104
17134
|
loop: !0,
|
|
17105
17135
|
isNestable: !1,
|
|
17106
17136
|
parentPath: "items",
|
|
@@ -17149,7 +17179,7 @@ var gb = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw
|
|
|
17149
17179
|
});
|
|
17150
17180
|
}
|
|
17151
17181
|
return n;
|
|
17152
|
-
},
|
|
17182
|
+
}, Tb = function() {
|
|
17153
17183
|
var e = b(function* (e, t) {
|
|
17154
17184
|
let n = yield t.getDocument({ data: new Uint8Array(e) }).promise, r = [], i = Math.min(n.numPages, 3);
|
|
17155
17185
|
for (let e = 1; e <= i; e++) {
|
|
@@ -17214,7 +17244,7 @@ var gb = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw
|
|
|
17214
17244
|
}();
|
|
17215
17245
|
//#endregion
|
|
17216
17246
|
//#region src/hooks/useCanvasBlocks.ts
|
|
17217
|
-
function
|
|
17247
|
+
function Eb({ initialBlocks: e, defaultStyles: t, defaultLogo: n, defaultBanner: r, onChange: i } = {}) {
|
|
17218
17248
|
let [o, c] = s(e || []), [l, u] = s(null);
|
|
17219
17249
|
a(() => {
|
|
17220
17250
|
i && i(o);
|
|
@@ -17622,7 +17652,7 @@ function Tb({ initialBlocks: e, defaultStyles: t, defaultLogo: n, defaultBanner:
|
|
|
17622
17652
|
}
|
|
17623
17653
|
//#endregion
|
|
17624
17654
|
//#region src/hooks/useZoomPan.ts
|
|
17625
|
-
function
|
|
17655
|
+
function Db() {
|
|
17626
17656
|
let [e, t] = s(.7), [n, r] = s({
|
|
17627
17657
|
x: 0,
|
|
17628
17658
|
y: 0
|
|
@@ -17708,7 +17738,7 @@ function Eb() {
|
|
|
17708
17738
|
}
|
|
17709
17739
|
//#endregion
|
|
17710
17740
|
//#region src/hooks/useSidebarState.ts
|
|
17711
|
-
function
|
|
17741
|
+
function Ob({ tableSchemas: e } = {}) {
|
|
17712
17742
|
let [t, n] = s("invoice_items"), [r, i] = s("{% for item in invoice.items %}"), [o, c] = s("{% endfor %}"), [l, u] = s(""), [d, f] = s(""), [p, m] = s(null), [h, g] = s([]), [_, v] = s(!1), [y, b] = s(""), [x, S] = s(null), [C, w] = s(""), [T, E] = s(null), [ee, O] = s(null), [k, te] = s(""), [A, ne] = s([]), re = (e) => ({
|
|
17713
17743
|
columnName: e.columnName || e.columnNameEn || e.columnNameDe || "",
|
|
17714
17744
|
placeholder: e.placeholder || "",
|
|
@@ -17806,10 +17836,10 @@ function Db({ tableSchemas: e } = {}) {
|
|
|
17806
17836
|
}
|
|
17807
17837
|
//#endregion
|
|
17808
17838
|
//#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
17809
|
-
var
|
|
17810
|
-
let t =
|
|
17839
|
+
var kb = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), Ab = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), jb = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), Mb = (e) => {
|
|
17840
|
+
let t = jb(e);
|
|
17811
17841
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
17812
|
-
},
|
|
17842
|
+
}, Nb = {
|
|
17813
17843
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17814
17844
|
width: 24,
|
|
17815
17845
|
height: 24,
|
|
@@ -17819,13 +17849,13 @@ var Ob = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
17819
17849
|
strokeWidth: 2,
|
|
17820
17850
|
strokeLinecap: "round",
|
|
17821
17851
|
strokeLinejoin: "round"
|
|
17822
|
-
},
|
|
17852
|
+
}, Pb = (e) => {
|
|
17823
17853
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
17824
17854
|
return !1;
|
|
17825
|
-
},
|
|
17855
|
+
}, Fb = t({}), Ib = () => i(Fb);
|
|
17826
17856
|
//#endregion
|
|
17827
17857
|
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
17828
|
-
function
|
|
17858
|
+
function Lb(e, t) {
|
|
17829
17859
|
if (e == null) return {};
|
|
17830
17860
|
var n = {};
|
|
17831
17861
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -17836,9 +17866,9 @@ function Ib(e, t) {
|
|
|
17836
17866
|
}
|
|
17837
17867
|
//#endregion
|
|
17838
17868
|
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/objectWithoutProperties.js
|
|
17839
|
-
function
|
|
17869
|
+
function Rb(e, t) {
|
|
17840
17870
|
if (e == null) return {};
|
|
17841
|
-
var n, r, i =
|
|
17871
|
+
var n, r, i = Lb(e, t);
|
|
17842
17872
|
if (Object.getOwnPropertySymbols) {
|
|
17843
17873
|
var a = Object.getOwnPropertySymbols(e);
|
|
17844
17874
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -17847,7 +17877,7 @@ function Lb(e, t) {
|
|
|
17847
17877
|
}
|
|
17848
17878
|
//#endregion
|
|
17849
17879
|
//#region node_modules/lucide-react/dist/esm/Icon.mjs
|
|
17850
|
-
var
|
|
17880
|
+
var zb = [
|
|
17851
17881
|
"color",
|
|
17852
17882
|
"size",
|
|
17853
17883
|
"strokeWidth",
|
|
@@ -17855,39 +17885,39 @@ var Rb = [
|
|
|
17855
17885
|
"className",
|
|
17856
17886
|
"children",
|
|
17857
17887
|
"iconNode"
|
|
17858
|
-
],
|
|
17888
|
+
], Bb = r((e, t) => {
|
|
17859
17889
|
var r, i, a;
|
|
17860
|
-
let { color: o, size: s, strokeWidth: c, absoluteStrokeWidth: l, className: u = "", children: d, iconNode: f } = e, p =
|
|
17861
|
-
return n("svg", D(D(D({ ref: t },
|
|
17862
|
-
width: (i = s == null ? m : s) == null ?
|
|
17863
|
-
height: (a = s == null ? m : s) == null ?
|
|
17890
|
+
let { color: o, size: s, strokeWidth: c, absoluteStrokeWidth: l, className: u = "", children: d, iconNode: f } = e, p = Rb(e, zb), { size: m = 24, strokeWidth: h = 2, absoluteStrokeWidth: g = !1, color: _ = "currentColor", className: v = "" } = (r = Ib()) == null ? {} : r, y = (l == null ? g : l) ? Number(c == null ? h : c) * 24 / Number(s == null ? m : s) : c == null ? h : c;
|
|
17891
|
+
return n("svg", D(D(D({ ref: t }, Nb), {}, {
|
|
17892
|
+
width: (i = s == null ? m : s) == null ? Nb.width : i,
|
|
17893
|
+
height: (a = s == null ? m : s) == null ? Nb.height : a,
|
|
17864
17894
|
stroke: o == null ? _ : o,
|
|
17865
17895
|
strokeWidth: y,
|
|
17866
|
-
className:
|
|
17867
|
-
}, !d && !
|
|
17868
|
-
}),
|
|
17896
|
+
className: kb("lucide", v, u)
|
|
17897
|
+
}, !d && !Pb(p) && { "aria-hidden": "true" }), p), [...f.map(([e, t]) => n(e, t)), ...Array.isArray(d) ? d : [d]]);
|
|
17898
|
+
}), Vb = ["className"], $ = (e, t) => {
|
|
17869
17899
|
let i = r((r, i) => {
|
|
17870
|
-
let { className: a } = r, o =
|
|
17871
|
-
return n(
|
|
17900
|
+
let { className: a } = r, o = Rb(r, Vb);
|
|
17901
|
+
return n(Bb, D({
|
|
17872
17902
|
ref: i,
|
|
17873
17903
|
iconNode: t,
|
|
17874
|
-
className:
|
|
17904
|
+
className: kb(`lucide-${Ab(Mb(e))}`, `lucide-${e}`, a)
|
|
17875
17905
|
}, o));
|
|
17876
17906
|
});
|
|
17877
|
-
return i.displayName =
|
|
17878
|
-
},
|
|
17907
|
+
return i.displayName = Mb(e), i;
|
|
17908
|
+
}, Hb = $("arrow-down", [["path", {
|
|
17879
17909
|
d: "M12 5v14",
|
|
17880
17910
|
key: "s699le"
|
|
17881
17911
|
}], ["path", {
|
|
17882
17912
|
d: "m19 12-7 7-7-7",
|
|
17883
17913
|
key: "1idqje"
|
|
17884
|
-
}]]),
|
|
17914
|
+
}]]), Ub = $("arrow-up", [["path", {
|
|
17885
17915
|
d: "m5 12 7-7 7 7",
|
|
17886
17916
|
key: "hav0vg"
|
|
17887
17917
|
}], ["path", {
|
|
17888
17918
|
d: "M12 19V5",
|
|
17889
17919
|
key: "x0mq9r"
|
|
17890
|
-
}]]),
|
|
17920
|
+
}]]), Wb = $("barcode", [
|
|
17891
17921
|
["path", {
|
|
17892
17922
|
d: "M3 5v14",
|
|
17893
17923
|
key: "1nt18q"
|
|
@@ -17908,10 +17938,10 @@ var Rb = [
|
|
|
17908
17938
|
d: "M21 5v14",
|
|
17909
17939
|
key: "nzette"
|
|
17910
17940
|
}]
|
|
17911
|
-
]),
|
|
17941
|
+
]), Gb = $("check", [["path", {
|
|
17912
17942
|
d: "M20 6 9 17l-5-5",
|
|
17913
17943
|
key: "1gmf2c"
|
|
17914
|
-
}]]),
|
|
17944
|
+
}]]), Kb = $("columns-2", [["rect", {
|
|
17915
17945
|
width: "18",
|
|
17916
17946
|
height: "18",
|
|
17917
17947
|
x: "3",
|
|
@@ -17921,7 +17951,7 @@ var Rb = [
|
|
|
17921
17951
|
}], ["path", {
|
|
17922
17952
|
d: "M12 3v18",
|
|
17923
17953
|
key: "108xh3"
|
|
17924
|
-
}]]),
|
|
17954
|
+
}]]), qb = $("columns-4", [
|
|
17925
17955
|
["rect", {
|
|
17926
17956
|
width: "18",
|
|
17927
17957
|
height: "18",
|
|
@@ -17942,7 +17972,7 @@ var Rb = [
|
|
|
17942
17972
|
d: "M16.5 3v18",
|
|
17943
17973
|
key: "10tjh1"
|
|
17944
17974
|
}]
|
|
17945
|
-
]),
|
|
17975
|
+
]), Jb = $("columns-3", [
|
|
17946
17976
|
["rect", {
|
|
17947
17977
|
width: "18",
|
|
17948
17978
|
height: "18",
|
|
@@ -17959,7 +17989,7 @@ var Rb = [
|
|
|
17959
17989
|
d: "M15 3v18",
|
|
17960
17990
|
key: "14nvp0"
|
|
17961
17991
|
}]
|
|
17962
|
-
]),
|
|
17992
|
+
]), Yb = $("copy", [["rect", {
|
|
17963
17993
|
width: "14",
|
|
17964
17994
|
height: "14",
|
|
17965
17995
|
x: "8",
|
|
@@ -17970,7 +18000,7 @@ var Rb = [
|
|
|
17970
18000
|
}], ["path", {
|
|
17971
18001
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
17972
18002
|
key: "zix9uf"
|
|
17973
|
-
}]]),
|
|
18003
|
+
}]]), Xb = $("download", [
|
|
17974
18004
|
["path", {
|
|
17975
18005
|
d: "M12 15V3",
|
|
17976
18006
|
key: "m9g1x1"
|
|
@@ -17983,7 +18013,7 @@ var Rb = [
|
|
|
17983
18013
|
d: "m7 10 5 5 5-5",
|
|
17984
18014
|
key: "brsn70"
|
|
17985
18015
|
}]
|
|
17986
|
-
]),
|
|
18016
|
+
]), Zb = $("eye", [["path", {
|
|
17987
18017
|
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
|
|
17988
18018
|
key: "1nclc0"
|
|
17989
18019
|
}], ["circle", {
|
|
@@ -17991,7 +18021,7 @@ var Rb = [
|
|
|
17991
18021
|
cy: "12",
|
|
17992
18022
|
r: "3",
|
|
17993
18023
|
key: "1v7zrd"
|
|
17994
|
-
}]]),
|
|
18024
|
+
}]]), Qb = $("file-text", [
|
|
17995
18025
|
["path", {
|
|
17996
18026
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
17997
18027
|
key: "1oefj6"
|
|
@@ -18012,7 +18042,7 @@ var Rb = [
|
|
|
18012
18042
|
d: "M16 17H8",
|
|
18013
18043
|
key: "z1uh3a"
|
|
18014
18044
|
}]
|
|
18015
|
-
]),
|
|
18045
|
+
]), $b = $("image", [
|
|
18016
18046
|
["rect", {
|
|
18017
18047
|
width: "18",
|
|
18018
18048
|
height: "18",
|
|
@@ -18032,7 +18062,7 @@ var Rb = [
|
|
|
18032
18062
|
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
18033
18063
|
key: "1xmnt7"
|
|
18034
18064
|
}]
|
|
18035
|
-
]),
|
|
18065
|
+
]), ex = $("layout-grid", [
|
|
18036
18066
|
["rect", {
|
|
18037
18067
|
width: "7",
|
|
18038
18068
|
height: "7",
|
|
@@ -18065,7 +18095,7 @@ var Rb = [
|
|
|
18065
18095
|
rx: "1",
|
|
18066
18096
|
key: "1bb6yr"
|
|
18067
18097
|
}]
|
|
18068
|
-
]),
|
|
18098
|
+
]), tx = $("merge", [
|
|
18069
18099
|
["path", {
|
|
18070
18100
|
d: "m8 6 4-4 4 4",
|
|
18071
18101
|
key: "ybng9g"
|
|
@@ -18078,19 +18108,19 @@ var Rb = [
|
|
|
18078
18108
|
d: "m20 22-5-5",
|
|
18079
18109
|
key: "1m27yz"
|
|
18080
18110
|
}]
|
|
18081
|
-
]),
|
|
18111
|
+
]), nx = $("pencil", [["path", {
|
|
18082
18112
|
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
18083
18113
|
key: "1a8usu"
|
|
18084
18114
|
}], ["path", {
|
|
18085
18115
|
d: "m15 5 4 4",
|
|
18086
18116
|
key: "1mk7zo"
|
|
18087
|
-
}]]),
|
|
18117
|
+
}]]), rx = $("plus", [["path", {
|
|
18088
18118
|
d: "M5 12h14",
|
|
18089
18119
|
key: "1ays0h"
|
|
18090
18120
|
}], ["path", {
|
|
18091
18121
|
d: "M12 5v14",
|
|
18092
18122
|
key: "s699le"
|
|
18093
|
-
}]]),
|
|
18123
|
+
}]]), ix = $("printer", [
|
|
18094
18124
|
["path", {
|
|
18095
18125
|
d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",
|
|
18096
18126
|
key: "143wyd"
|
|
@@ -18107,7 +18137,7 @@ var Rb = [
|
|
|
18107
18137
|
rx: "1",
|
|
18108
18138
|
key: "1ue0tg"
|
|
18109
18139
|
}]
|
|
18110
|
-
]),
|
|
18140
|
+
]), ax = $("search", [["path", {
|
|
18111
18141
|
d: "m21 21-4.34-4.34",
|
|
18112
18142
|
key: "14j7rj"
|
|
18113
18143
|
}], ["circle", {
|
|
@@ -18115,7 +18145,7 @@ var Rb = [
|
|
|
18115
18145
|
cy: "11",
|
|
18116
18146
|
r: "8",
|
|
18117
18147
|
key: "4ej97u"
|
|
18118
|
-
}]]),
|
|
18148
|
+
}]]), ox = $("sliders-vertical", [
|
|
18119
18149
|
["path", {
|
|
18120
18150
|
d: "M10 8h4",
|
|
18121
18151
|
key: "1sr2af"
|
|
@@ -18152,7 +18182,7 @@ var Rb = [
|
|
|
18152
18182
|
d: "M5 21v-7",
|
|
18153
18183
|
key: "1w1uti"
|
|
18154
18184
|
}]
|
|
18155
|
-
]),
|
|
18185
|
+
]), sx = $("sparkles", [
|
|
18156
18186
|
["path", {
|
|
18157
18187
|
d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",
|
|
18158
18188
|
key: "1s2grr"
|
|
@@ -18171,20 +18201,20 @@ var Rb = [
|
|
|
18171
18201
|
r: "2",
|
|
18172
18202
|
key: "6kqj1y"
|
|
18173
18203
|
}]
|
|
18174
|
-
]),
|
|
18204
|
+
]), cx = $("square-check-big", [["path", {
|
|
18175
18205
|
d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",
|
|
18176
18206
|
key: "2acyp4"
|
|
18177
18207
|
}], ["path", {
|
|
18178
18208
|
d: "m9 11 3 3L22 4",
|
|
18179
18209
|
key: "1pflzl"
|
|
18180
|
-
}]]),
|
|
18210
|
+
}]]), lx = $("square", [["rect", {
|
|
18181
18211
|
width: "18",
|
|
18182
18212
|
height: "18",
|
|
18183
18213
|
x: "3",
|
|
18184
18214
|
y: "3",
|
|
18185
18215
|
rx: "2",
|
|
18186
18216
|
key: "afitv7"
|
|
18187
|
-
}]]),
|
|
18217
|
+
}]]), ux = $("table", [
|
|
18188
18218
|
["path", {
|
|
18189
18219
|
d: "M12 3v18",
|
|
18190
18220
|
key: "108xh3"
|
|
@@ -18205,7 +18235,7 @@ var Rb = [
|
|
|
18205
18235
|
d: "M3 15h18",
|
|
18206
18236
|
key: "5xshup"
|
|
18207
18237
|
}]
|
|
18208
|
-
]),
|
|
18238
|
+
]), dx = $("text-align-center", [
|
|
18209
18239
|
["path", {
|
|
18210
18240
|
d: "M21 5H3",
|
|
18211
18241
|
key: "1fi0y6"
|
|
@@ -18218,7 +18248,7 @@ var Rb = [
|
|
|
18218
18248
|
d: "M19 19H5",
|
|
18219
18249
|
key: "vjpgq2"
|
|
18220
18250
|
}]
|
|
18221
|
-
]),
|
|
18251
|
+
]), fx = $("text-align-end", [
|
|
18222
18252
|
["path", {
|
|
18223
18253
|
d: "M21 5H3",
|
|
18224
18254
|
key: "1fi0y6"
|
|
@@ -18231,7 +18261,7 @@ var Rb = [
|
|
|
18231
18261
|
d: "M21 19H7",
|
|
18232
18262
|
key: "4cu937"
|
|
18233
18263
|
}]
|
|
18234
|
-
]),
|
|
18264
|
+
]), px = $("text-align-justify", [
|
|
18235
18265
|
["path", {
|
|
18236
18266
|
d: "M3 5h18",
|
|
18237
18267
|
key: "1u36vt"
|
|
@@ -18244,7 +18274,7 @@ var Rb = [
|
|
|
18244
18274
|
d: "M3 19h18",
|
|
18245
18275
|
key: "awlh7x"
|
|
18246
18276
|
}]
|
|
18247
|
-
]),
|
|
18277
|
+
]), mx = $("text-align-start", [
|
|
18248
18278
|
["path", {
|
|
18249
18279
|
d: "M21 5H3",
|
|
18250
18280
|
key: "1fi0y6"
|
|
@@ -18257,7 +18287,7 @@ var Rb = [
|
|
|
18257
18287
|
d: "M17 19H3",
|
|
18258
18288
|
key: "z6ezky"
|
|
18259
18289
|
}]
|
|
18260
|
-
]),
|
|
18290
|
+
]), hx = $("trash-2", [
|
|
18261
18291
|
["path", {
|
|
18262
18292
|
d: "M10 11v6",
|
|
18263
18293
|
key: "nco0om"
|
|
@@ -18278,7 +18308,7 @@ var Rb = [
|
|
|
18278
18308
|
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
18279
18309
|
key: "e791ji"
|
|
18280
18310
|
}]
|
|
18281
|
-
]),
|
|
18311
|
+
]), gx = $("type", [
|
|
18282
18312
|
["path", {
|
|
18283
18313
|
d: "M12 4v16",
|
|
18284
18314
|
key: "1654pz"
|
|
@@ -18291,7 +18321,7 @@ var Rb = [
|
|
|
18291
18321
|
d: "M9 20h6",
|
|
18292
18322
|
key: "s66wpe"
|
|
18293
18323
|
}]
|
|
18294
|
-
]),
|
|
18324
|
+
]), _x = $("upload", [
|
|
18295
18325
|
["path", {
|
|
18296
18326
|
d: "M12 3v12",
|
|
18297
18327
|
key: "1x0j5s"
|
|
@@ -18304,7 +18334,7 @@ var Rb = [
|
|
|
18304
18334
|
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
|
|
18305
18335
|
key: "ih7n3h"
|
|
18306
18336
|
}]
|
|
18307
|
-
]),
|
|
18337
|
+
]), vx = $("x", [["path", {
|
|
18308
18338
|
d: "M18 6 6 18",
|
|
18309
18339
|
key: "1bl5f8"
|
|
18310
18340
|
}], ["path", {
|
|
@@ -18313,7 +18343,7 @@ var Rb = [
|
|
|
18313
18343
|
}]]);
|
|
18314
18344
|
//#endregion
|
|
18315
18345
|
//#region src/components/WorkspaceHeader.tsx
|
|
18316
|
-
function
|
|
18346
|
+
function yx({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, isParsing: i, parseStatusText: a, themeColor: o = "#ea580c" }) {
|
|
18317
18347
|
return /* @__PURE__ */ d("header", {
|
|
18318
18348
|
className: "bg-white border-b border-gray-200 px-6 py-3.5 flex items-center justify-between sticky top-0 z-10 shadow-xs gap-4",
|
|
18319
18349
|
children: [/* @__PURE__ */ d("div", {
|
|
@@ -18321,7 +18351,7 @@ function vx({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, i
|
|
|
18321
18351
|
children: [e || /* @__PURE__ */ u("div", {
|
|
18322
18352
|
style: { backgroundColor: o },
|
|
18323
18353
|
className: "h-9 w-9 rounded-xl flex items-center justify-center text-white shadow-md",
|
|
18324
|
-
children: /* @__PURE__ */ u(
|
|
18354
|
+
children: /* @__PURE__ */ u(sx, { className: "h-5 w-5" })
|
|
18325
18355
|
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h1", {
|
|
18326
18356
|
className: "text-lg font-bold tracking-tight text-slate-800",
|
|
18327
18357
|
children: t
|
|
@@ -18348,7 +18378,7 @@ function vx({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, i
|
|
|
18348
18378
|
}
|
|
18349
18379
|
//#endregion
|
|
18350
18380
|
//#region src/components/sidebar/TextTab.tsx
|
|
18351
|
-
function
|
|
18381
|
+
function bx({ handleSidebarDragStart: e, createTextBlock: t, setBlocks: n, setSelectedBlockId: r, setActiveTab: i, defaultStyles: a }) {
|
|
18352
18382
|
return /* @__PURE__ */ d("div", {
|
|
18353
18383
|
className: "space-y-5",
|
|
18354
18384
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
|
|
@@ -18423,13 +18453,13 @@ function yx({ handleSidebarDragStart: e, createTextBlock: t, setBlocks: n, setSe
|
|
|
18423
18453
|
}
|
|
18424
18454
|
//#endregion
|
|
18425
18455
|
//#region src/components/sidebar/LayoutsTab.tsx
|
|
18426
|
-
function
|
|
18456
|
+
function xx({ handleSidebarDragStart: e, createLayoutBlock: t, setBlocks: n, setSelectedBlockId: r, setActiveTab: i, themeColor: a = "#ea580c" }) {
|
|
18427
18457
|
let [o, c] = s(null), [l, f] = s(null);
|
|
18428
18458
|
return /* @__PURE__ */ d("div", {
|
|
18429
18459
|
className: "space-y-5",
|
|
18430
18460
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("h3", {
|
|
18431
18461
|
className: "text-sm font-bold text-slate-800 flex items-center gap-1.5",
|
|
18432
|
-
children: [/* @__PURE__ */ u(
|
|
18462
|
+
children: [/* @__PURE__ */ u(ex, {
|
|
18433
18463
|
className: "h-4 w-4",
|
|
18434
18464
|
style: { color: a }
|
|
18435
18465
|
}), /* @__PURE__ */ u("span", { children: "Multi-Column Layouts" })]
|
|
@@ -18443,7 +18473,7 @@ function bx({ handleSidebarDragStart: e, createLayoutBlock: t, setBlocks: n, set
|
|
|
18443
18473
|
columnsCount: 1,
|
|
18444
18474
|
title: "1 Column",
|
|
18445
18475
|
description: "Single column container layout (100%)",
|
|
18446
|
-
icon: /* @__PURE__ */ u(
|
|
18476
|
+
icon: /* @__PURE__ */ u(lx, {
|
|
18447
18477
|
className: "h-5 w-5",
|
|
18448
18478
|
style: { color: a }
|
|
18449
18479
|
}),
|
|
@@ -18454,7 +18484,7 @@ function bx({ handleSidebarDragStart: e, createLayoutBlock: t, setBlocks: n, set
|
|
|
18454
18484
|
columnsCount: 2,
|
|
18455
18485
|
title: "2 Columns",
|
|
18456
18486
|
description: "Side-by-side split layout (50% / 50%)",
|
|
18457
|
-
icon: /* @__PURE__ */ u(
|
|
18487
|
+
icon: /* @__PURE__ */ u(Kb, {
|
|
18458
18488
|
className: "h-5 w-5",
|
|
18459
18489
|
style: { color: a }
|
|
18460
18490
|
}),
|
|
@@ -18465,7 +18495,7 @@ function bx({ handleSidebarDragStart: e, createLayoutBlock: t, setBlocks: n, set
|
|
|
18465
18495
|
columnsCount: 3,
|
|
18466
18496
|
title: "3 Columns",
|
|
18467
18497
|
description: "Triple column layout (33% / 33% / 33%)",
|
|
18468
|
-
icon: /* @__PURE__ */ u(
|
|
18498
|
+
icon: /* @__PURE__ */ u(Jb, {
|
|
18469
18499
|
className: "h-5 w-5",
|
|
18470
18500
|
style: { color: a }
|
|
18471
18501
|
}),
|
|
@@ -18476,7 +18506,7 @@ function bx({ handleSidebarDragStart: e, createLayoutBlock: t, setBlocks: n, set
|
|
|
18476
18506
|
columnsCount: 4,
|
|
18477
18507
|
title: "4 Columns",
|
|
18478
18508
|
description: "Quad column layout (25% / 25% / 25% / 25%)",
|
|
18479
|
-
icon: /* @__PURE__ */ u(
|
|
18509
|
+
icon: /* @__PURE__ */ u(qb, {
|
|
18480
18510
|
className: "h-5 w-5",
|
|
18481
18511
|
style: { color: a }
|
|
18482
18512
|
}),
|
|
@@ -18547,7 +18577,7 @@ function bx({ handleSidebarDragStart: e, createLayoutBlock: t, setBlocks: n, set
|
|
|
18547
18577
|
color: "#ffffff"
|
|
18548
18578
|
},
|
|
18549
18579
|
className: "w-full py-1.5 rounded-lg text-[10px] font-bold transition-all flex items-center justify-center space-x-1 shadow-xs cursor-pointer active:scale-[0.99]",
|
|
18550
|
-
children: [/* @__PURE__ */ u(
|
|
18580
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3 w-3" }), /* @__PURE__ */ d("span", { children: [
|
|
18551
18581
|
"Add ",
|
|
18552
18582
|
s.title,
|
|
18553
18583
|
" to Editor"
|
|
@@ -18561,7 +18591,7 @@ function bx({ handleSidebarDragStart: e, createLayoutBlock: t, setBlocks: n, set
|
|
|
18561
18591
|
}
|
|
18562
18592
|
//#endregion
|
|
18563
18593
|
//#region src/components/sidebar/TablesTab.tsx
|
|
18564
|
-
function
|
|
18594
|
+
function Sx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTableName: r, customLoopStart: i, setCustomLoopStart: a, customLoopEnd: o, setCustomLoopEnd: s, handleAddCustomTable: c, handleSidebarDragStart: l, setBlocks: f, setSelectedBlockId: p, setActiveTab: m, defaultStyles: h, isTablesLoading: g, tablesLoading: _, themeColor: v = "#ea580c" }) {
|
|
18565
18595
|
return g || _ ? /* @__PURE__ */ d("div", {
|
|
18566
18596
|
className: "space-y-6",
|
|
18567
18597
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
|
|
@@ -18609,7 +18639,7 @@ function xx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18609
18639
|
className: "flex items-center justify-between",
|
|
18610
18640
|
children: [/* @__PURE__ */ d("div", {
|
|
18611
18641
|
className: "flex items-center space-x-2",
|
|
18612
|
-
children: [/* @__PURE__ */ u(
|
|
18642
|
+
children: [/* @__PURE__ */ u(ux, { className: "h-4 w-4 text-slate-650" }), /* @__PURE__ */ u("h4", {
|
|
18613
18643
|
className: "font-bold text-xs uppercase text-slate-700 tracking-wider",
|
|
18614
18644
|
children: e.tableName
|
|
18615
18645
|
})]
|
|
@@ -18626,7 +18656,7 @@ function xx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18626
18656
|
className: "flex items-center space-x-2",
|
|
18627
18657
|
children: [/* @__PURE__ */ u("div", {
|
|
18628
18658
|
className: "h-5 w-5 bg-slate-200 rounded flex items-center justify-center",
|
|
18629
|
-
children: /* @__PURE__ */ u(
|
|
18659
|
+
children: /* @__PURE__ */ u(rx, { className: "h-3 w-3 text-slate-600" })
|
|
18630
18660
|
}), /* @__PURE__ */ u("span", {
|
|
18631
18661
|
className: "text-xs font-bold text-slate-700",
|
|
18632
18662
|
children: "Drag to Canvas"
|
|
@@ -18650,7 +18680,7 @@ function xx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18650
18680
|
children: [/* @__PURE__ */ d("button", {
|
|
18651
18681
|
onClick: () => t(n, r),
|
|
18652
18682
|
className: "flex items-center space-x-2 w-full text-left py-0.5 text-xs text-slate-600 hover:text-slate-800 transition-colors font-medium",
|
|
18653
|
-
children: [e.enabled === !1 ? /* @__PURE__ */ u(
|
|
18683
|
+
children: [e.enabled === !1 ? /* @__PURE__ */ u(lx, { className: "h-3.5 w-3.5 text-slate-300 flex-shrink-0" }) : /* @__PURE__ */ u(cx, { className: "h-3.5 w-3.5 text-slate-700 flex-shrink-0" }), /* @__PURE__ */ d("span", {
|
|
18654
18684
|
className: "truncate flex items-center gap-1",
|
|
18655
18685
|
children: [/* @__PURE__ */ u("span", { children: e.columnName }), i && /* @__PURE__ */ u("span", {
|
|
18656
18686
|
className: "px-1 bg-slate-200 text-slate-600 rounded text-[8px] font-mono",
|
|
@@ -18665,7 +18695,7 @@ function xx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18665
18695
|
}), e.columns.map((e, i) => /* @__PURE__ */ d("button", {
|
|
18666
18696
|
onClick: () => t(n, r, i),
|
|
18667
18697
|
className: "flex items-center space-x-2 w-full text-left py-0.5 text-[11px] text-slate-500 hover:text-slate-800 transition-colors",
|
|
18668
|
-
children: [e.enabled === !1 ? /* @__PURE__ */ u(
|
|
18698
|
+
children: [e.enabled === !1 ? /* @__PURE__ */ u(lx, { className: "h-3 w-3 text-slate-300 flex-shrink-0" }) : /* @__PURE__ */ u(cx, { className: "h-3 w-3 text-slate-600 flex-shrink-0" }), /* @__PURE__ */ d("span", {
|
|
18669
18699
|
className: "truncate",
|
|
18670
18700
|
children: [
|
|
18671
18701
|
e.columnName,
|
|
@@ -18720,7 +18750,7 @@ function xx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18720
18750
|
className: "border border-gray-200 rounded-2xl p-4 bg-slate-50/20 border-dashed space-y-4 mt-6",
|
|
18721
18751
|
children: [/* @__PURE__ */ d("div", {
|
|
18722
18752
|
className: "flex items-center space-x-2 pb-2 border-b border-gray-150",
|
|
18723
|
-
children: [/* @__PURE__ */ u(
|
|
18753
|
+
children: [/* @__PURE__ */ u(sx, { className: "h-4 w-4 text-slate-655" }), /* @__PURE__ */ u("h4", {
|
|
18724
18754
|
className: "font-bold text-xs uppercase text-slate-800 tracking-wider",
|
|
18725
18755
|
children: "Custom Table Builder"
|
|
18726
18756
|
})]
|
|
@@ -18761,7 +18791,7 @@ function xx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18761
18791
|
onClick: c,
|
|
18762
18792
|
style: { backgroundColor: v },
|
|
18763
18793
|
className: "w-full py-2 text-white rounded-xl text-xs font-bold transition-all shadow-sm flex items-center justify-center space-x-1.5",
|
|
18764
|
-
children: [/* @__PURE__ */ u(
|
|
18794
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-4 w-4" }), /* @__PURE__ */ u("span", { children: "Add Custom Loop Table" })]
|
|
18765
18795
|
})
|
|
18766
18796
|
]
|
|
18767
18797
|
})]
|
|
@@ -18771,37 +18801,37 @@ function xx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18771
18801
|
}
|
|
18772
18802
|
//#endregion
|
|
18773
18803
|
//#region src/components/sidebar/ImagesTab.tsx
|
|
18774
|
-
function
|
|
18804
|
+
function Cx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, handleAddCustomImageType: r, handleSidebarDragStart: i, createImageBlock: a, setBlocks: o, setSelectedBlockId: s, setActiveTab: c, themeColor: l = "#ea580c" }) {
|
|
18775
18805
|
let f = [
|
|
18776
18806
|
{
|
|
18777
18807
|
label: "Brand Logo",
|
|
18778
18808
|
imageType: "logo",
|
|
18779
18809
|
description: "Standard document vector logo",
|
|
18780
|
-
icon: /* @__PURE__ */ u(
|
|
18810
|
+
icon: /* @__PURE__ */ u($b, { className: "h-4 w-4 text-slate-550" })
|
|
18781
18811
|
},
|
|
18782
18812
|
{
|
|
18783
18813
|
label: "Campaign Banner",
|
|
18784
18814
|
imageType: "banner",
|
|
18785
18815
|
description: "Wide horizontal graphics banner",
|
|
18786
|
-
icon: /* @__PURE__ */ u(
|
|
18816
|
+
icon: /* @__PURE__ */ u($b, { className: "h-4 w-4 text-slate-550" })
|
|
18787
18817
|
},
|
|
18788
18818
|
{
|
|
18789
18819
|
label: "Dynamic Barcode",
|
|
18790
18820
|
imageType: "barcode",
|
|
18791
18821
|
description: "Barcode replaced dynamically",
|
|
18792
|
-
icon: /* @__PURE__ */ u(
|
|
18822
|
+
icon: /* @__PURE__ */ u(Wb, { className: "h-4 w-4 text-slate-550" })
|
|
18793
18823
|
},
|
|
18794
18824
|
{
|
|
18795
18825
|
label: "Watermark",
|
|
18796
18826
|
imageType: "watermark",
|
|
18797
18827
|
description: "Background graphic with low opacity",
|
|
18798
|
-
icon: /* @__PURE__ */ u(
|
|
18828
|
+
icon: /* @__PURE__ */ u($b, { className: "h-4 w-4 text-slate-550" })
|
|
18799
18829
|
},
|
|
18800
18830
|
...e.map((e) => ({
|
|
18801
18831
|
label: e.label,
|
|
18802
18832
|
imageType: e.imageType,
|
|
18803
18833
|
description: e.description,
|
|
18804
|
-
icon: /* @__PURE__ */ u(
|
|
18834
|
+
icon: /* @__PURE__ */ u($b, { className: "h-4 w-4 text-slate-550" })
|
|
18805
18835
|
}))
|
|
18806
18836
|
];
|
|
18807
18837
|
return /* @__PURE__ */ d("div", {
|
|
@@ -18840,7 +18870,7 @@ function Sx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, hand
|
|
|
18840
18870
|
className: "flex items-center space-x-2",
|
|
18841
18871
|
children: [/* @__PURE__ */ u("div", {
|
|
18842
18872
|
className: "h-5 w-5 bg-slate-200 rounded flex items-center justify-center",
|
|
18843
|
-
children: /* @__PURE__ */ u(
|
|
18873
|
+
children: /* @__PURE__ */ u(rx, { className: "h-3 w-3 text-slate-750" })
|
|
18844
18874
|
}), /* @__PURE__ */ u("span", {
|
|
18845
18875
|
className: "text-[11px] font-bold text-slate-700",
|
|
18846
18876
|
children: "Drag to Canvas"
|
|
@@ -18879,7 +18909,7 @@ function Sx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, hand
|
|
|
18879
18909
|
onClick: r,
|
|
18880
18910
|
style: { backgroundColor: l },
|
|
18881
18911
|
className: "w-full py-1.5 text-white rounded-lg text-xs font-bold transition-all flex items-center justify-center space-x-1",
|
|
18882
|
-
children: [/* @__PURE__ */ u(
|
|
18912
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Add Custom Category" })]
|
|
18883
18913
|
})
|
|
18884
18914
|
]
|
|
18885
18915
|
})
|
|
@@ -18888,7 +18918,7 @@ function Sx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, hand
|
|
|
18888
18918
|
}
|
|
18889
18919
|
//#endregion
|
|
18890
18920
|
//#region src/components/sidebar/PlaceholdersTab.tsx
|
|
18891
|
-
function
|
|
18921
|
+
function wx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceholder: r, selectedBlockId: i, setBlocks: a, isPlaceholdersLoading: o, placeholdersLoading: s }) {
|
|
18892
18922
|
if (o || s) return /* @__PURE__ */ d("div", {
|
|
18893
18923
|
className: "space-y-4 flex-1 flex flex-col min-h-0",
|
|
18894
18924
|
children: [
|
|
@@ -18944,7 +18974,7 @@ function Cx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceh
|
|
|
18944
18974
|
})] }),
|
|
18945
18975
|
/* @__PURE__ */ d("div", {
|
|
18946
18976
|
className: "relative",
|
|
18947
|
-
children: [/* @__PURE__ */ u(
|
|
18977
|
+
children: [/* @__PURE__ */ u(ax, { className: "absolute left-3 top-2.5 h-4 w-4 text-slate-400" }), /* @__PURE__ */ u("input", {
|
|
18948
18978
|
type: "text",
|
|
18949
18979
|
value: n,
|
|
18950
18980
|
onChange: (e) => r(e.target.value),
|
|
@@ -18985,7 +19015,7 @@ function Cx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceh
|
|
|
18985
19015
|
}
|
|
18986
19016
|
//#endregion
|
|
18987
19017
|
//#region src/components/sidebar/StylesTab.tsx
|
|
18988
|
-
var
|
|
19018
|
+
var Tx = (e) => {
|
|
18989
19019
|
if (!e) return 100;
|
|
18990
19020
|
if (e.endsWith("%")) {
|
|
18991
19021
|
let t = parseInt(e, 10);
|
|
@@ -18993,7 +19023,7 @@ var wx = (e) => {
|
|
|
18993
19023
|
}
|
|
18994
19024
|
return 100;
|
|
18995
19025
|
};
|
|
18996
|
-
function
|
|
19026
|
+
function Ex({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, updateSelectedImageInfo: r, fontSizesState: i, fontFamiliesState: a, fontWeightsState: o, handleDeleteBlock: c, newColName: f, setNewColName: p, newColPlaceholder: m, setNewColPlaceholder: h, handleAddTableColumn: g, handleRemoveTableColumn: _, handleUpdateTableColumn: v, handleReorderTableColumn: y, handleAddTableRow: b, handleRemoveTableRow: x, addColumnToLayout: S, deleteColumnFromLayout: C, mergeColumns: w, updateColumnStyle: T, updateColumnWidth: E, setBlocks: ee, themeColor: O = "#ea580c" }) {
|
|
18997
19027
|
var k;
|
|
18998
19028
|
let [te, A] = s(null), [ne, re] = s(""), [ie, ae] = s(""), [oe, se] = s(null), [ce, le] = s(""), [ue, de] = s(""), [fe, pe] = s(0), j = t();
|
|
18999
19029
|
if (!e || !j) return /* @__PURE__ */ d("div", {
|
|
@@ -19007,7 +19037,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19007
19037
|
})] }), /* @__PURE__ */ d("div", {
|
|
19008
19038
|
className: "border border-dashed border-gray-200 rounded-xl p-6 text-center bg-slate-50/50",
|
|
19009
19039
|
children: [
|
|
19010
|
-
/* @__PURE__ */ u(
|
|
19040
|
+
/* @__PURE__ */ u(ox, { className: "h-8 w-8 text-slate-350 mx-auto mb-2" }),
|
|
19011
19041
|
/* @__PURE__ */ u("span", {
|
|
19012
19042
|
className: "text-xs font-semibold text-slate-500 block",
|
|
19013
19043
|
children: "No block selected"
|
|
@@ -19041,7 +19071,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19041
19071
|
children: [
|
|
19042
19072
|
/* @__PURE__ */ d("h4", {
|
|
19043
19073
|
className: "text-xs font-bold text-slate-700 flex items-center gap-1.5",
|
|
19044
|
-
children: [/* @__PURE__ */ u(
|
|
19074
|
+
children: [/* @__PURE__ */ u(ex, { className: "h-4 w-4 text-indigo-600" }), /* @__PURE__ */ d("span", { children: [
|
|
19045
19075
|
"Layout Container (",
|
|
19046
19076
|
e.columns.length,
|
|
19047
19077
|
" Column",
|
|
@@ -19056,14 +19086,14 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19056
19086
|
S && S(j.id, t);
|
|
19057
19087
|
},
|
|
19058
19088
|
className: "flex-1 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-[10px] font-bold transition-all flex items-center justify-center space-x-1 shadow-xs cursor-pointer",
|
|
19059
|
-
children: [/* @__PURE__ */ u(
|
|
19089
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Add Column to Right" })]
|
|
19060
19090
|
}), e.columns.length > 1 && /* @__PURE__ */ d("button", {
|
|
19061
19091
|
onClick: () => {
|
|
19062
19092
|
C && C(j.id, t);
|
|
19063
19093
|
},
|
|
19064
19094
|
className: "py-1.5 px-3 bg-red-50 hover:bg-red-100 text-red-600 border border-red-200 rounded-lg text-[10px] font-bold transition-all flex items-center justify-center space-x-1 cursor-pointer",
|
|
19065
19095
|
title: "Delete Selected Column",
|
|
19066
|
-
children: [/* @__PURE__ */ u(
|
|
19096
|
+
children: [/* @__PURE__ */ u(hx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Delete Col" })]
|
|
19067
19097
|
})]
|
|
19068
19098
|
}),
|
|
19069
19099
|
/* @__PURE__ */ d("div", {
|
|
@@ -19093,7 +19123,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19093
19123
|
className: "space-y-4 border border-slate-200 rounded-xl p-3.5 bg-white shadow-xs",
|
|
19094
19124
|
children: [/* @__PURE__ */ d("h4", {
|
|
19095
19125
|
className: "text-xs font-bold text-slate-700 flex items-center gap-1.5",
|
|
19096
|
-
children: [/* @__PURE__ */ u(
|
|
19126
|
+
children: [/* @__PURE__ */ u(Kb, { className: "h-4 w-4 text-indigo-600" }), /* @__PURE__ */ u("span", { children: "Column Styling" })]
|
|
19097
19127
|
}), /* @__PURE__ */ d("div", {
|
|
19098
19128
|
className: "space-y-3",
|
|
19099
19129
|
children: [
|
|
@@ -19254,7 +19284,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19254
19284
|
w && w(j.id, t, t + 1);
|
|
19255
19285
|
},
|
|
19256
19286
|
className: "w-full py-1.5 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 rounded-lg text-[10px] font-bold transition-all flex items-center justify-center space-x-1",
|
|
19257
|
-
children: [/* @__PURE__ */ u(
|
|
19287
|
+
children: [/* @__PURE__ */ u(tx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ d("span", { children: [
|
|
19258
19288
|
"Merge Column ",
|
|
19259
19289
|
t + 1,
|
|
19260
19290
|
" with Column ",
|
|
@@ -19268,7 +19298,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19268
19298
|
/* @__PURE__ */ d("button", {
|
|
19269
19299
|
onClick: () => c(j.id),
|
|
19270
19300
|
className: "w-full py-2 bg-red-50 hover:bg-red-100 text-red-600 rounded-xl text-xs font-bold transition-all flex items-center justify-center space-x-1.5 border border-red-200",
|
|
19271
|
-
children: [/* @__PURE__ */ u(
|
|
19301
|
+
children: [/* @__PURE__ */ u(hx, { className: "h-4 w-4" }), /* @__PURE__ */ u("span", { children: "Delete Layout Block" })]
|
|
19272
19302
|
})
|
|
19273
19303
|
]
|
|
19274
19304
|
});
|
|
@@ -19293,7 +19323,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19293
19323
|
className: "flex items-center space-x-2 pb-3 border-b border-gray-100",
|
|
19294
19324
|
children: [/* @__PURE__ */ u("div", {
|
|
19295
19325
|
className: "h-6 w-6 bg-slate-100 rounded flex items-center justify-center text-slate-700",
|
|
19296
|
-
children: /* @__PURE__ */ u(
|
|
19326
|
+
children: /* @__PURE__ */ u($b, { className: "h-3.5 w-3.5" })
|
|
19297
19327
|
}), /* @__PURE__ */ u("span", {
|
|
19298
19328
|
className: "text-xs font-bold text-slate-700 capitalize",
|
|
19299
19329
|
children: "Editing Image Element"
|
|
@@ -19352,15 +19382,15 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19352
19382
|
children: [
|
|
19353
19383
|
{
|
|
19354
19384
|
value: "left",
|
|
19355
|
-
icon: /* @__PURE__ */ u(
|
|
19385
|
+
icon: /* @__PURE__ */ u(mx, { className: "h-3.5 w-3.5" })
|
|
19356
19386
|
},
|
|
19357
19387
|
{
|
|
19358
19388
|
value: "center",
|
|
19359
|
-
icon: /* @__PURE__ */ u(
|
|
19389
|
+
icon: /* @__PURE__ */ u(dx, { className: "h-3.5 w-3.5" })
|
|
19360
19390
|
},
|
|
19361
19391
|
{
|
|
19362
19392
|
value: "right",
|
|
19363
|
-
icon: /* @__PURE__ */ u(
|
|
19393
|
+
icon: /* @__PURE__ */ u(fx, { className: "h-3.5 w-3.5" })
|
|
19364
19394
|
}
|
|
19365
19395
|
].map((e) => /* @__PURE__ */ u("button", {
|
|
19366
19396
|
onClick: () => n("textAlign", e.value),
|
|
@@ -19379,7 +19409,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19379
19409
|
children: "Block Width (%)"
|
|
19380
19410
|
}), /* @__PURE__ */ d("span", {
|
|
19381
19411
|
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
19382
|
-
children: [
|
|
19412
|
+
children: [Tx(j.style.width), "%"]
|
|
19383
19413
|
})]
|
|
19384
19414
|
}), /* @__PURE__ */ d("div", {
|
|
19385
19415
|
className: "flex items-center space-x-2",
|
|
@@ -19388,13 +19418,13 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19388
19418
|
min: "10",
|
|
19389
19419
|
max: "100",
|
|
19390
19420
|
step: "5",
|
|
19391
|
-
value:
|
|
19421
|
+
value: Tx(j.style.width),
|
|
19392
19422
|
onChange: (e) => n("width", `${Math.min(100, Math.max(10, parseInt(e.target.value, 10)))}%`),
|
|
19393
19423
|
style: { accentColor: O },
|
|
19394
19424
|
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
19395
19425
|
}), /* @__PURE__ */ d("span", {
|
|
19396
19426
|
className: "text-[10px] font-mono text-slate-500 w-10 text-right",
|
|
19397
|
-
children: [
|
|
19427
|
+
children: [Tx(j.style.width), "%"]
|
|
19398
19428
|
})]
|
|
19399
19429
|
})]
|
|
19400
19430
|
}),
|
|
@@ -19522,7 +19552,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19522
19552
|
}), /* @__PURE__ */ d("div", {
|
|
19523
19553
|
className: "flex flex-col items-center p-3 border border-dashed border-gray-200 rounded-lg bg-slate-50/50 hover:bg-slate-50 transition-all cursor-pointer relative",
|
|
19524
19554
|
children: [
|
|
19525
|
-
/* @__PURE__ */ u(
|
|
19555
|
+
/* @__PURE__ */ u(_x, { className: "h-5 w-5 text-slate-400 mb-1" }),
|
|
19526
19556
|
/* @__PURE__ */ u("span", {
|
|
19527
19557
|
className: "text-[10px] font-bold text-slate-650",
|
|
19528
19558
|
children: "Choose local image file"
|
|
@@ -19587,7 +19617,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19587
19617
|
children: /* @__PURE__ */ d("button", {
|
|
19588
19618
|
onClick: () => c(j.id),
|
|
19589
19619
|
className: "w-full py-2 bg-red-50 hover:bg-red-100 border border-red-200 text-red-650 rounded-xl text-xs font-bold transition-all flex items-center justify-center space-x-1 shadow-xs cursor-pointer",
|
|
19590
|
-
children: [/* @__PURE__ */ u(
|
|
19620
|
+
children: [/* @__PURE__ */ u(hx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Delete Element" })]
|
|
19591
19621
|
})
|
|
19592
19622
|
})
|
|
19593
19623
|
]
|
|
@@ -19733,19 +19763,19 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19733
19763
|
children: [
|
|
19734
19764
|
{
|
|
19735
19765
|
value: "left",
|
|
19736
|
-
icon: /* @__PURE__ */ u(
|
|
19766
|
+
icon: /* @__PURE__ */ u(mx, { className: "h-3.5 w-3.5" })
|
|
19737
19767
|
},
|
|
19738
19768
|
{
|
|
19739
19769
|
value: "center",
|
|
19740
|
-
icon: /* @__PURE__ */ u(
|
|
19770
|
+
icon: /* @__PURE__ */ u(dx, { className: "h-3.5 w-3.5" })
|
|
19741
19771
|
},
|
|
19742
19772
|
{
|
|
19743
19773
|
value: "right",
|
|
19744
|
-
icon: /* @__PURE__ */ u(
|
|
19774
|
+
icon: /* @__PURE__ */ u(fx, { className: "h-3.5 w-3.5" })
|
|
19745
19775
|
},
|
|
19746
19776
|
{
|
|
19747
19777
|
value: "justify",
|
|
19748
|
-
icon: /* @__PURE__ */ u(
|
|
19778
|
+
icon: /* @__PURE__ */ u(px, { className: "h-3.5 w-3.5" })
|
|
19749
19779
|
}
|
|
19750
19780
|
].map((e) => /* @__PURE__ */ u("button", {
|
|
19751
19781
|
onClick: () => n("textAlign", e.value),
|
|
@@ -19848,7 +19878,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19848
19878
|
children: "Block Width (%)"
|
|
19849
19879
|
}), /* @__PURE__ */ d("span", {
|
|
19850
19880
|
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
19851
|
-
children: [
|
|
19881
|
+
children: [Tx(j.style.width), "%"]
|
|
19852
19882
|
})]
|
|
19853
19883
|
}), /* @__PURE__ */ d("div", {
|
|
19854
19884
|
className: "flex items-center space-x-2",
|
|
@@ -19857,13 +19887,13 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19857
19887
|
min: "10",
|
|
19858
19888
|
max: "100",
|
|
19859
19889
|
step: "5",
|
|
19860
|
-
value:
|
|
19890
|
+
value: Tx(j.style.width),
|
|
19861
19891
|
onChange: (e) => n("width", `${Math.min(100, Math.max(10, parseInt(e.target.value, 10)))}%`),
|
|
19862
19892
|
style: { accentColor: O },
|
|
19863
19893
|
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
19864
19894
|
}), /* @__PURE__ */ d("span", {
|
|
19865
19895
|
className: "text-[10px] font-mono text-slate-500 w-10 text-right",
|
|
19866
|
-
children: [
|
|
19896
|
+
children: [Tx(j.style.width), "%"]
|
|
19867
19897
|
})]
|
|
19868
19898
|
})]
|
|
19869
19899
|
}),
|
|
@@ -19940,7 +19970,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19940
19970
|
style: { backgroundColor: O },
|
|
19941
19971
|
className: "px-3 py-1.5 text-white rounded-lg text-xs font-bold transition-all flex items-center space-x-1 shadow-xs cursor-pointer",
|
|
19942
19972
|
title: "Add a new row to table",
|
|
19943
|
-
children: [/* @__PURE__ */ u(
|
|
19973
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Add Row" })]
|
|
19944
19974
|
})]
|
|
19945
19975
|
}), /* @__PURE__ */ u("div", {
|
|
19946
19976
|
className: "space-y-1.5 max-h-[140px] overflow-y-auto pr-1",
|
|
@@ -19957,7 +19987,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19957
19987
|
disabled: (((n = j.tableInfo) == null || (n = n.mockRows) == null ? void 0 : n.length) || 1) <= 1,
|
|
19958
19988
|
className: "p-1 text-slate-400 hover:text-red-600 hover:bg-red-50 disabled:opacity-30 disabled:hover:bg-transparent rounded transition-colors",
|
|
19959
19989
|
title: "Remove row",
|
|
19960
|
-
children: /* @__PURE__ */ u(
|
|
19990
|
+
children: /* @__PURE__ */ u(hx, { className: "h-3.5 w-3.5" })
|
|
19961
19991
|
})]
|
|
19962
19992
|
}, t);
|
|
19963
19993
|
})
|
|
@@ -20005,11 +20035,11 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20005
20035
|
},
|
|
20006
20036
|
style: { backgroundColor: O },
|
|
20007
20037
|
className: "p-1 px-2 text-white rounded text-[10px] flex items-center gap-1 font-bold cursor-pointer",
|
|
20008
|
-
children: [/* @__PURE__ */ u(
|
|
20038
|
+
children: [/* @__PURE__ */ u(Gb, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", { children: "Save" })]
|
|
20009
20039
|
}), /* @__PURE__ */ d("button", {
|
|
20010
20040
|
onClick: () => A(null),
|
|
20011
20041
|
className: "p-1 px-2 bg-gray-200 text-slate-700 hover:bg-gray-300 rounded text-[10px] flex items-center gap-1",
|
|
20012
|
-
children: [/* @__PURE__ */ u(
|
|
20042
|
+
children: [/* @__PURE__ */ u(vx, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", { children: "Cancel" })]
|
|
20013
20043
|
})]
|
|
20014
20044
|
})
|
|
20015
20045
|
]
|
|
@@ -20035,14 +20065,14 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20035
20065
|
disabled: t === 0,
|
|
20036
20066
|
className: "p-1 text-slate-400 hover:text-slate-700 hover:bg-slate-200 disabled:opacity-30 disabled:hover:bg-transparent rounded transition-colors",
|
|
20037
20067
|
title: "Move Up",
|
|
20038
|
-
children: /* @__PURE__ */ u(
|
|
20068
|
+
children: /* @__PURE__ */ u(Ub, { className: "h-3.5 w-3.5" })
|
|
20039
20069
|
}),
|
|
20040
20070
|
/* @__PURE__ */ u("button", {
|
|
20041
20071
|
onClick: () => y && y(t, "down"),
|
|
20042
20072
|
disabled: t === (((n = j.tableInfo) == null ? void 0 : n.columns.length) || 0) - 1,
|
|
20043
20073
|
className: "p-1 text-slate-400 hover:text-slate-700 hover:bg-slate-200 disabled:opacity-30 disabled:hover:bg-transparent rounded transition-colors",
|
|
20044
20074
|
title: "Move Down",
|
|
20045
|
-
children: /* @__PURE__ */ u(
|
|
20075
|
+
children: /* @__PURE__ */ u(Hb, { className: "h-3.5 w-3.5" })
|
|
20046
20076
|
}),
|
|
20047
20077
|
/* @__PURE__ */ u("button", {
|
|
20048
20078
|
onClick: () => {
|
|
@@ -20050,14 +20080,14 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20050
20080
|
},
|
|
20051
20081
|
className: "p-1 text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded transition-colors",
|
|
20052
20082
|
title: "Edit column",
|
|
20053
|
-
children: /* @__PURE__ */ u(
|
|
20083
|
+
children: /* @__PURE__ */ u(nx, { className: "h-3.5 w-3.5" })
|
|
20054
20084
|
}),
|
|
20055
20085
|
/* @__PURE__ */ u("button", {
|
|
20056
20086
|
onClick: () => _(t),
|
|
20057
20087
|
className: "p-1 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors border border-transparent",
|
|
20058
20088
|
disabled: !j.tableInfo || j.tableInfo.columns.length <= 1,
|
|
20059
20089
|
title: "Delete column",
|
|
20060
|
-
children: /* @__PURE__ */ u(
|
|
20090
|
+
children: /* @__PURE__ */ u(hx, { className: "h-3.5 w-3.5" })
|
|
20061
20091
|
})
|
|
20062
20092
|
]
|
|
20063
20093
|
})]
|
|
@@ -20105,11 +20135,11 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20105
20135
|
v && v(t, ne, ie, r), A(null);
|
|
20106
20136
|
},
|
|
20107
20137
|
className: "p-0.5 px-1.5 bg-blue-600 text-white hover:bg-blue-700 rounded text-[9px] flex items-center gap-1 font-bold",
|
|
20108
|
-
children: [/* @__PURE__ */ u(
|
|
20138
|
+
children: [/* @__PURE__ */ u(Gb, { className: "h-2.5 w-2.5" }), /* @__PURE__ */ u("span", { children: "Save" })]
|
|
20109
20139
|
}), /* @__PURE__ */ d("button", {
|
|
20110
20140
|
onClick: () => A(null),
|
|
20111
20141
|
className: "p-0.5 px-1.5 bg-gray-200 text-slate-700 hover:bg-gray-300 rounded text-[9px] flex items-center gap-1",
|
|
20112
|
-
children: [/* @__PURE__ */ u(
|
|
20142
|
+
children: [/* @__PURE__ */ u(vx, { className: "h-2.5 w-2.5" }), /* @__PURE__ */ u("span", { children: "Cancel" })]
|
|
20113
20143
|
})]
|
|
20114
20144
|
})
|
|
20115
20145
|
]
|
|
@@ -20132,14 +20162,14 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20132
20162
|
disabled: r === 0,
|
|
20133
20163
|
className: "p-0.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 disabled:opacity-30 disabled:hover:bg-transparent rounded",
|
|
20134
20164
|
title: "Move Sub-Column Up",
|
|
20135
|
-
children: /* @__PURE__ */ u(
|
|
20165
|
+
children: /* @__PURE__ */ u(Ub, { className: "h-3 w-3" })
|
|
20136
20166
|
}),
|
|
20137
20167
|
/* @__PURE__ */ u("button", {
|
|
20138
20168
|
onClick: () => y && y(t, "down", r),
|
|
20139
20169
|
disabled: r === e.columns.length - 1,
|
|
20140
20170
|
className: "p-0.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 disabled:opacity-30 disabled:hover:bg-transparent rounded",
|
|
20141
20171
|
title: "Move Sub-Column Down",
|
|
20142
|
-
children: /* @__PURE__ */ u(
|
|
20172
|
+
children: /* @__PURE__ */ u(Hb, { className: "h-3 w-3" })
|
|
20143
20173
|
}),
|
|
20144
20174
|
/* @__PURE__ */ u("button", {
|
|
20145
20175
|
onClick: () => {
|
|
@@ -20147,13 +20177,13 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20147
20177
|
},
|
|
20148
20178
|
className: "p-0.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded",
|
|
20149
20179
|
title: "Edit sub-column",
|
|
20150
|
-
children: /* @__PURE__ */ u(
|
|
20180
|
+
children: /* @__PURE__ */ u(nx, { className: "h-3 w-3" })
|
|
20151
20181
|
}),
|
|
20152
20182
|
/* @__PURE__ */ u("button", {
|
|
20153
20183
|
onClick: () => _(t, r),
|
|
20154
20184
|
className: "p-0.5 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded",
|
|
20155
20185
|
title: "Delete sub-column",
|
|
20156
|
-
children: /* @__PURE__ */ u(
|
|
20186
|
+
children: /* @__PURE__ */ u(hx, { className: "h-3 w-3" })
|
|
20157
20187
|
})
|
|
20158
20188
|
]
|
|
20159
20189
|
})]
|
|
@@ -20200,7 +20230,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20200
20230
|
}) : /* @__PURE__ */ d("button", {
|
|
20201
20231
|
onClick: () => se(t),
|
|
20202
20232
|
className: "w-full py-1 text-[10px] font-bold text-blue-600 hover:bg-blue-50 border border-dashed border-blue-200 rounded flex items-center justify-center space-x-1 transition-colors mt-1",
|
|
20203
|
-
children: [/* @__PURE__ */ u(
|
|
20233
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", { children: "Add Sub-Column" })]
|
|
20204
20234
|
})
|
|
20205
20235
|
]
|
|
20206
20236
|
})]
|
|
@@ -20234,14 +20264,14 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20234
20264
|
onClick: ve,
|
|
20235
20265
|
style: { backgroundColor: O },
|
|
20236
20266
|
className: "flex-1 py-1.5 text-white rounded-lg text-xs font-bold transition-all flex items-center justify-center space-x-1 cursor-pointer",
|
|
20237
|
-
children: [/* @__PURE__ */ u(
|
|
20267
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Column" })]
|
|
20238
20268
|
}), /* @__PURE__ */ d("button", {
|
|
20239
20269
|
onClick: () => {
|
|
20240
20270
|
f.trim() && (g(f, m || "{{item.price}}", !0), p(""), h(""));
|
|
20241
20271
|
},
|
|
20242
20272
|
className: "flex-1 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-xs font-bold transition-all flex items-center justify-center space-x-1",
|
|
20243
20273
|
title: "Add column as nested sub-table",
|
|
20244
|
-
children: [/* @__PURE__ */ u(
|
|
20274
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Sub-Table" })]
|
|
20245
20275
|
})]
|
|
20246
20276
|
})
|
|
20247
20277
|
]
|
|
@@ -20253,7 +20283,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20253
20283
|
children: /* @__PURE__ */ d("button", {
|
|
20254
20284
|
onClick: () => c(j.id),
|
|
20255
20285
|
className: "w-full py-2 bg-red-50 hover:bg-red-100 border border-red-200 text-red-650 rounded-xl text-xs font-bold transition-all flex items-center justify-center space-x-1 shadow-xs cursor-pointer",
|
|
20256
|
-
children: [/* @__PURE__ */ u(
|
|
20286
|
+
children: [/* @__PURE__ */ u(hx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Delete Element" })]
|
|
20257
20287
|
})
|
|
20258
20288
|
})
|
|
20259
20289
|
]
|
|
@@ -20262,7 +20292,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
20262
20292
|
}
|
|
20263
20293
|
//#endregion
|
|
20264
20294
|
//#region src/components/SidebarPanel.tsx
|
|
20265
|
-
function
|
|
20295
|
+
function Dx({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlocks: r, selectedBlockId: i, setSelectedBlockId: a, getSelectedBlock: o, defaultStyles: s, createTextBlock: c, createImageBlock: l, createLayoutBlock: f, addColumnToLayout: p, deleteColumnFromLayout: m, mergeColumns: h, updateColumnStyle: g, updateColumnWidth: _, updateSelectedStyle: v, updateSelectedImageInfo: y, handleDeleteBlock: b, handleRemoveTableColumn: x, handleAddTableColumn: S, handleUpdateTableColumn: C, handleReorderTableColumn: w, handleAddTableRow: T, handleRemoveTableRow: E, schemas: D, toggleSchemaColumn: ee, customTableName: O, setCustomTableName: k, customLoopStart: te, setCustomLoopStart: A, customLoopEnd: ne, setCustomLoopEnd: re, handleAddCustomTable: ie, newColName: ae, setNewColName: oe, newColPlaceholder: se, setNewColPlaceholder: ce, customImageTypes: le, newImgTypeName: ue, setNewImgTypeName: de, handleAddCustomImageType: fe, placeholders: pe, searchPlaceholder: j, setSearchPlaceholder: me, handleSidebarDragStart: he, isTablesLoading: ge, tablesLoading: _e, isPlaceholdersLoading: ve, placeholdersLoading: ye, fontSizesState: be, fontFamiliesState: xe, fontWeightsState: Se, sidebarPosition: Ce = "left" }) {
|
|
20266
20296
|
return /* @__PURE__ */ d("aside", {
|
|
20267
20297
|
className: `w-full lg:col-span-4 h-full max-h-full min-h-0 flex flex-col bg-white border-t lg:border-t-0 ${Ce === "left" ? "lg:border-r lg:order-1" : "lg:border-l lg:order-2"} border-gray-200 overflow-hidden shrink-0`,
|
|
20268
20298
|
children: [/* @__PURE__ */ u("div", {
|
|
@@ -20270,27 +20300,27 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20270
20300
|
children: [
|
|
20271
20301
|
{
|
|
20272
20302
|
value: "text",
|
|
20273
|
-
icon: /* @__PURE__ */ u(
|
|
20303
|
+
icon: /* @__PURE__ */ u(gx, { className: "h-4 w-4" })
|
|
20274
20304
|
},
|
|
20275
20305
|
{
|
|
20276
20306
|
value: "layouts",
|
|
20277
|
-
icon: /* @__PURE__ */ u(
|
|
20307
|
+
icon: /* @__PURE__ */ u(ex, { className: "h-4 w-4" })
|
|
20278
20308
|
},
|
|
20279
20309
|
{
|
|
20280
20310
|
value: "tables",
|
|
20281
|
-
icon: /* @__PURE__ */ u(
|
|
20311
|
+
icon: /* @__PURE__ */ u(ux, { className: "h-4 w-4" })
|
|
20282
20312
|
},
|
|
20283
20313
|
{
|
|
20284
20314
|
value: "images",
|
|
20285
|
-
icon: /* @__PURE__ */ u(
|
|
20315
|
+
icon: /* @__PURE__ */ u($b, { className: "h-4 w-4" })
|
|
20286
20316
|
},
|
|
20287
20317
|
{
|
|
20288
20318
|
value: "placeholders",
|
|
20289
|
-
icon: /* @__PURE__ */ u(
|
|
20319
|
+
icon: /* @__PURE__ */ u(sx, { className: "h-4 w-4" })
|
|
20290
20320
|
},
|
|
20291
20321
|
{
|
|
20292
20322
|
value: "styles",
|
|
20293
|
-
icon: /* @__PURE__ */ u(
|
|
20323
|
+
icon: /* @__PURE__ */ u(ox, { className: "h-4 w-4" })
|
|
20294
20324
|
}
|
|
20295
20325
|
].map((r) => /* @__PURE__ */ d("button", {
|
|
20296
20326
|
onClick: () => t(r.value),
|
|
@@ -20304,7 +20334,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20304
20334
|
}), /* @__PURE__ */ d("div", {
|
|
20305
20335
|
className: "p-4 flex-1 flex flex-col min-h-0 max-h-[80%] h-[80%] overflow-y-auto custom-scrollbar",
|
|
20306
20336
|
children: [
|
|
20307
|
-
e === "text" && /* @__PURE__ */ u(
|
|
20337
|
+
e === "text" && /* @__PURE__ */ u(bx, {
|
|
20308
20338
|
handleSidebarDragStart: he,
|
|
20309
20339
|
createTextBlock: c,
|
|
20310
20340
|
setBlocks: r,
|
|
@@ -20312,7 +20342,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20312
20342
|
setActiveTab: t,
|
|
20313
20343
|
defaultStyles: s
|
|
20314
20344
|
}),
|
|
20315
|
-
e === "layouts" && /* @__PURE__ */ u(
|
|
20345
|
+
e === "layouts" && /* @__PURE__ */ u(xx, {
|
|
20316
20346
|
handleSidebarDragStart: he,
|
|
20317
20347
|
createLayoutBlock: f || (() => c("p", "Layout")),
|
|
20318
20348
|
setBlocks: r,
|
|
@@ -20320,7 +20350,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20320
20350
|
setActiveTab: t,
|
|
20321
20351
|
themeColor: n
|
|
20322
20352
|
}),
|
|
20323
|
-
e === "tables" && /* @__PURE__ */ u(
|
|
20353
|
+
e === "tables" && /* @__PURE__ */ u(Sx, {
|
|
20324
20354
|
schemas: D,
|
|
20325
20355
|
toggleSchemaColumn: ee,
|
|
20326
20356
|
customTableName: O,
|
|
@@ -20339,7 +20369,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20339
20369
|
tablesLoading: _e,
|
|
20340
20370
|
themeColor: n
|
|
20341
20371
|
}),
|
|
20342
|
-
e === "images" && /* @__PURE__ */ u(
|
|
20372
|
+
e === "images" && /* @__PURE__ */ u(Cx, {
|
|
20343
20373
|
customImageTypes: le,
|
|
20344
20374
|
newImgTypeName: ue,
|
|
20345
20375
|
setNewImgTypeName: de,
|
|
@@ -20351,7 +20381,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20351
20381
|
setActiveTab: t,
|
|
20352
20382
|
themeColor: n
|
|
20353
20383
|
}),
|
|
20354
|
-
e === "placeholders" && /* @__PURE__ */ u(
|
|
20384
|
+
e === "placeholders" && /* @__PURE__ */ u(wx, {
|
|
20355
20385
|
placeholders: pe,
|
|
20356
20386
|
schemas: D,
|
|
20357
20387
|
searchPlaceholder: j,
|
|
@@ -20361,7 +20391,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20361
20391
|
isPlaceholdersLoading: ve,
|
|
20362
20392
|
placeholdersLoading: ye
|
|
20363
20393
|
}),
|
|
20364
|
-
e === "styles" && /* @__PURE__ */ u(
|
|
20394
|
+
e === "styles" && /* @__PURE__ */ u(Ex, {
|
|
20365
20395
|
selectedBlockId: i,
|
|
20366
20396
|
getSelectedBlock: o,
|
|
20367
20397
|
updateSelectedStyle: v,
|
|
@@ -20394,18 +20424,18 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
|
|
|
20394
20424
|
}
|
|
20395
20425
|
//#endregion
|
|
20396
20426
|
//#region src/components/EditableBlock.tsx
|
|
20397
|
-
var
|
|
20427
|
+
var Ox = [
|
|
20398
20428
|
"bold",
|
|
20399
20429
|
"italic",
|
|
20400
20430
|
"underline",
|
|
20401
20431
|
"strikethrough",
|
|
20402
20432
|
"width"
|
|
20403
|
-
],
|
|
20433
|
+
], kx = ({ block: e, onUpdate: t, onSelect: n, onDrop: r }) => {
|
|
20404
20434
|
let i = o(null);
|
|
20405
20435
|
a(() => {
|
|
20406
20436
|
i.current && i.current.innerHTML !== e.content && document.activeElement !== i.current && (i.current.innerHTML = e.content || "<br/>");
|
|
20407
20437
|
}, [e.id, e.content]);
|
|
20408
|
-
let s = e.style, { bold: c, italic: l, underline: d, strikethrough: f, width: p } = s, m = D({},
|
|
20438
|
+
let s = e.style, { bold: c, italic: l, underline: d, strikethrough: f, width: p } = s, m = D({}, Rb(s, Ox));
|
|
20409
20439
|
c && (m.fontWeight = "bold"), l && (m.fontStyle = "italic");
|
|
20410
20440
|
let h = [];
|
|
20411
20441
|
return d && h.push("underline"), f && h.push("line-through"), h.length > 0 && (m.textDecoration = h.join(" ")), /* @__PURE__ */ u("div", {
|
|
@@ -20420,7 +20450,7 @@ var Dx = [
|
|
|
20420
20450
|
onDrop: r,
|
|
20421
20451
|
onDragOver: (e) => e.preventDefault()
|
|
20422
20452
|
});
|
|
20423
|
-
},
|
|
20453
|
+
}, Ax = ({ blockId: e, colIdx: t, placeholder: n, onUpdate: r, onDrop: i, colSpan: c = 1, onColSpanChange: l, themeColor: f }) => {
|
|
20424
20454
|
let p = o(null), [m, h] = s(!1);
|
|
20425
20455
|
a(() => {
|
|
20426
20456
|
p.current && g(p.current) !== n && document.activeElement !== p.current && (p.current.innerHTML = n);
|
|
@@ -20470,7 +20500,7 @@ var Dx = [
|
|
|
20470
20500
|
})]
|
|
20471
20501
|
})
|
|
20472
20502
|
});
|
|
20473
|
-
},
|
|
20503
|
+
}, jx = (e) => {
|
|
20474
20504
|
let t = [];
|
|
20475
20505
|
return e.forEach((e) => {
|
|
20476
20506
|
e.style.sameRow && t.length > 0 ? t[t.length - 1].blocks.push(e) : t.push({
|
|
@@ -20479,7 +20509,7 @@ var Dx = [
|
|
|
20479
20509
|
});
|
|
20480
20510
|
}), t;
|
|
20481
20511
|
};
|
|
20482
|
-
function
|
|
20512
|
+
function Mx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r, setActiveTab: i, showMockData: o, placeholderMockData: c, dragOverIndex: l, setDragOverIndex: f, draggedSidebarItem: p, defaultStyles: m, zoom: h, panOffset: g, spacePressed: _, canvasHeight: v, setCanvasHeight: y, viewportRef: b, canvasContainerRef: x, contentRef: S, handleMouseDown: C, handleMouseMove: w, handleMouseUp: T, createTextBlock: E, createImageBlock: ee, createLayoutBlock: O, addColumnToLayout: k, deleteColumnFromLayout: te, mergeColumns: A, duplicateBlock: ne, reorderBlock: re, handleDeleteBlock: ie, handleSidebarDrop: ae, handleTableCellDrop: oe, updateTableCell: se, updateTableCellColspan: ce, handleTextDrop: le, themeColor: ue = "#ea580c" }) {
|
|
20483
20513
|
let [de, fe] = s(null), [pe, j] = s(null), [me, he] = s([]);
|
|
20484
20514
|
a(() => {
|
|
20485
20515
|
let e = () => {
|
|
@@ -20736,7 +20766,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20736
20766
|
},
|
|
20737
20767
|
className: "flex items-center space-x-1 bg-red-500 hover:bg-red-600 text-white px-2.5 py-1 rounded-full text-[10px] font-bold shadow-md hover:shadow-lg transition-all duration-150 cursor-pointer active:scale-95 z-40",
|
|
20738
20768
|
title: `Delete empty Page ${n}`,
|
|
20739
|
-
children: [/* @__PURE__ */ u(
|
|
20769
|
+
children: [/* @__PURE__ */ u(hx, { className: "h-3 w-3" }), /* @__PURE__ */ d("span", { children: ["Delete Page ", n] })]
|
|
20740
20770
|
})]
|
|
20741
20771
|
})
|
|
20742
20772
|
}, t);
|
|
@@ -20747,7 +20777,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20747
20777
|
children: e.length === 0 ? /* @__PURE__ */ d("div", {
|
|
20748
20778
|
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",
|
|
20749
20779
|
children: [
|
|
20750
|
-
/* @__PURE__ */ u(
|
|
20780
|
+
/* @__PURE__ */ u(ox, { className: "h-10 w-10 mb-3 animate-bounce text-slate-350" }),
|
|
20751
20781
|
/* @__PURE__ */ u("span", {
|
|
20752
20782
|
className: "font-bold text-sm text-slate-600 block",
|
|
20753
20783
|
children: "Drag & Drop Editor Canvas"
|
|
@@ -20757,7 +20787,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20757
20787
|
children: "Select elements from sidebar (Text, Layouts, Tables, Images) and drag them here to assemble your template structure."
|
|
20758
20788
|
})
|
|
20759
20789
|
]
|
|
20760
|
-
}) :
|
|
20790
|
+
}) : jx(e).map((a) => {
|
|
20761
20791
|
var o;
|
|
20762
20792
|
let s = a.blocks.length > 1, c = a.blocks.some((e) => e.type === "table"), l = a.blocks.some((e) => e.style.pageBreakBefore === "always" || e.style.pageBreakBefore === !0);
|
|
20763
20793
|
return /* @__PURE__ */ u("div", {
|
|
@@ -20813,7 +20843,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20813
20843
|
},
|
|
20814
20844
|
className: "hover:text-slate-200 flex items-center gap-1 border-r border-white/30 pr-1.5",
|
|
20815
20845
|
title: "Add Column to Right",
|
|
20816
|
-
children: [/* @__PURE__ */ u(
|
|
20846
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", {
|
|
20817
20847
|
className: "text-[9px]",
|
|
20818
20848
|
children: "Add Col"
|
|
20819
20849
|
})]
|
|
@@ -20824,7 +20854,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20824
20854
|
},
|
|
20825
20855
|
className: "hover:text-slate-200",
|
|
20826
20856
|
title: "Move Up",
|
|
20827
|
-
children: /* @__PURE__ */ u(
|
|
20857
|
+
children: /* @__PURE__ */ u(Ub, { className: "h-3 w-3" })
|
|
20828
20858
|
}),
|
|
20829
20859
|
/* @__PURE__ */ u("button", {
|
|
20830
20860
|
onClick: (t) => {
|
|
@@ -20832,19 +20862,19 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20832
20862
|
},
|
|
20833
20863
|
className: "hover:text-slate-200",
|
|
20834
20864
|
title: "Move Down",
|
|
20835
|
-
children: /* @__PURE__ */ u(
|
|
20865
|
+
children: /* @__PURE__ */ u(Hb, { className: "h-3 w-3" })
|
|
20836
20866
|
}),
|
|
20837
20867
|
/* @__PURE__ */ u("button", {
|
|
20838
20868
|
onClick: (e) => ne(a.id, e),
|
|
20839
20869
|
className: "hover:text-slate-200",
|
|
20840
20870
|
title: "Duplicate",
|
|
20841
|
-
children: /* @__PURE__ */ u(
|
|
20871
|
+
children: /* @__PURE__ */ u(Yb, { className: "h-3 w-3" })
|
|
20842
20872
|
}),
|
|
20843
20873
|
/* @__PURE__ */ u("button", {
|
|
20844
20874
|
onClick: (e) => ie(a.id, e),
|
|
20845
20875
|
className: "text-red-200 hover:text-red-300 ml-1",
|
|
20846
20876
|
title: "Delete",
|
|
20847
|
-
children: /* @__PURE__ */ u(
|
|
20877
|
+
children: /* @__PURE__ */ u(hx, { className: "h-3 w-3" })
|
|
20848
20878
|
})
|
|
20849
20879
|
]
|
|
20850
20880
|
}), a.type === "layout" ? /* @__PURE__ */ u("div", {
|
|
@@ -20905,7 +20935,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20905
20935
|
className: "flex items-center justify-between mb-1.5 text-[9px] font-bold text-slate-400 border-b border-slate-100 pb-1 select-none",
|
|
20906
20936
|
children: [/* @__PURE__ */ d("span", {
|
|
20907
20937
|
className: "flex items-center space-x-1",
|
|
20908
|
-
children: [/* @__PURE__ */ u(
|
|
20938
|
+
children: [/* @__PURE__ */ u(Kb, { className: "h-3 w-3 text-slate-400" }), /* @__PURE__ */ d("span", { children: ["Col ", t + 1] })]
|
|
20909
20939
|
}), /* @__PURE__ */ d("div", {
|
|
20910
20940
|
className: "flex items-center space-x-1 opacity-0 group-hover/col:opacity-100 transition-opacity",
|
|
20911
20941
|
children: [
|
|
@@ -20915,7 +20945,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20915
20945
|
},
|
|
20916
20946
|
className: "px-1.5 py-0.5 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 rounded text-[8px] font-bold flex items-center gap-0.5 transition-all",
|
|
20917
20947
|
title: "Add Column to Right",
|
|
20918
|
-
children: [/* @__PURE__ */ u(
|
|
20948
|
+
children: [/* @__PURE__ */ u(rx, { className: "h-2.5 w-2.5" }), /* @__PURE__ */ u("span", { children: "+ Col" })]
|
|
20919
20949
|
}),
|
|
20920
20950
|
t < (((m = a.layoutInfo) == null ? void 0 : m.columns.length) || 0) - 1 && /* @__PURE__ */ d("button", {
|
|
20921
20951
|
onClick: (e) => {
|
|
@@ -20923,7 +20953,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20923
20953
|
},
|
|
20924
20954
|
className: "px-1.5 py-0.5 bg-slate-100 hover:bg-indigo-100 text-slate-600 hover:text-indigo-700 rounded text-[8px] font-bold flex items-center gap-1 transition-all",
|
|
20925
20955
|
title: "Merge with next column",
|
|
20926
|
-
children: [/* @__PURE__ */ u(
|
|
20956
|
+
children: [/* @__PURE__ */ u(tx, { className: "h-2.5 w-2.5" }), /* @__PURE__ */ u("span", { children: "Merge Next" })]
|
|
20927
20957
|
}),
|
|
20928
20958
|
(((h = a.layoutInfo) == null ? void 0 : h.columns.length) || 0) > 1 && /* @__PURE__ */ u("button", {
|
|
20929
20959
|
onClick: (e) => {
|
|
@@ -20931,7 +20961,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20931
20961
|
},
|
|
20932
20962
|
className: "px-1 py-0.5 bg-red-50 hover:bg-red-100 text-red-600 rounded text-[8px] font-bold flex items-center gap-0.5 transition-all",
|
|
20933
20963
|
title: "Delete Column",
|
|
20934
|
-
children: /* @__PURE__ */ u(
|
|
20964
|
+
children: /* @__PURE__ */ u(hx, { className: "h-2.5 w-2.5" })
|
|
20935
20965
|
})
|
|
20936
20966
|
]
|
|
20937
20967
|
})]
|
|
@@ -20960,14 +20990,14 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20960
20990
|
e.stopPropagation(), xe(a.id, t, o, "up");
|
|
20961
20991
|
},
|
|
20962
20992
|
title: "Move Up",
|
|
20963
|
-
children: /* @__PURE__ */ u(
|
|
20993
|
+
children: /* @__PURE__ */ u(Ub, { className: "h-2.5 w-2.5" })
|
|
20964
20994
|
}),
|
|
20965
20995
|
/* @__PURE__ */ u("button", {
|
|
20966
20996
|
onClick: (e) => {
|
|
20967
20997
|
e.stopPropagation(), xe(a.id, t, o, "down");
|
|
20968
20998
|
},
|
|
20969
20999
|
title: "Move Down",
|
|
20970
|
-
children: /* @__PURE__ */ u(
|
|
21000
|
+
children: /* @__PURE__ */ u(Hb, { className: "h-2.5 w-2.5" })
|
|
20971
21001
|
}),
|
|
20972
21002
|
/* @__PURE__ */ u("button", {
|
|
20973
21003
|
onClick: (t) => {
|
|
@@ -20975,7 +21005,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
20975
21005
|
},
|
|
20976
21006
|
className: "text-red-300 hover:text-red-400",
|
|
20977
21007
|
title: "Delete item",
|
|
20978
|
-
children: /* @__PURE__ */ u(
|
|
21008
|
+
children: /* @__PURE__ */ u(hx, { className: "h-2.5 w-2.5" })
|
|
20979
21009
|
})
|
|
20980
21010
|
]
|
|
20981
21011
|
}), e.type === "table" ? /* @__PURE__ */ u("div", {
|
|
@@ -21021,7 +21051,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
21021
21051
|
children: e.columnName
|
|
21022
21052
|
}, t)) }) }), /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", {
|
|
21023
21053
|
className: "bg-slate-50/10",
|
|
21024
|
-
children: t.map((t, r) => /* @__PURE__ */ u(
|
|
21054
|
+
children: t.map((t, r) => /* @__PURE__ */ u(Ax, {
|
|
21025
21055
|
blockId: e.id,
|
|
21026
21056
|
colIdx: r,
|
|
21027
21057
|
placeholder: t.placeholder,
|
|
@@ -21036,7 +21066,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
21036
21066
|
})
|
|
21037
21067
|
}, a);
|
|
21038
21068
|
}
|
|
21039
|
-
return /* @__PURE__ */ u(
|
|
21069
|
+
return /* @__PURE__ */ u(Ax, {
|
|
21040
21070
|
blockId: e.id,
|
|
21041
21071
|
colIdx: a,
|
|
21042
21072
|
colSpan: s,
|
|
@@ -21069,7 +21099,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
21069
21099
|
},
|
|
21070
21100
|
alt: "Column graphic"
|
|
21071
21101
|
})
|
|
21072
|
-
}) : /* @__PURE__ */ u(
|
|
21102
|
+
}) : /* @__PURE__ */ u(kx, {
|
|
21073
21103
|
block: e,
|
|
21074
21104
|
onUpdate: (n) => be(a.id, t, e.id, n),
|
|
21075
21105
|
onSelect: () => r(e.id),
|
|
@@ -21132,7 +21162,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
21132
21162
|
children: e.columnName
|
|
21133
21163
|
}, t)) }) }), /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", {
|
|
21134
21164
|
className: "bg-slate-50/30",
|
|
21135
|
-
children: e.map((e, n) => /* @__PURE__ */ u(
|
|
21165
|
+
children: e.map((e, n) => /* @__PURE__ */ u(Ax, {
|
|
21136
21166
|
blockId: a.id,
|
|
21137
21167
|
colIdx: n,
|
|
21138
21168
|
placeholder: e.placeholder,
|
|
@@ -21148,7 +21178,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
21148
21178
|
})
|
|
21149
21179
|
}, i);
|
|
21150
21180
|
}
|
|
21151
|
-
return /* @__PURE__ */ u(
|
|
21181
|
+
return /* @__PURE__ */ u(Ax, {
|
|
21152
21182
|
blockId: a.id,
|
|
21153
21183
|
colIdx: i,
|
|
21154
21184
|
colSpan: s,
|
|
@@ -21205,7 +21235,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
21205
21235
|
alt: "Uploaded content graphic"
|
|
21206
21236
|
})
|
|
21207
21237
|
})
|
|
21208
|
-
}) : /* @__PURE__ */ u(
|
|
21238
|
+
}) : /* @__PURE__ */ u(kx, {
|
|
21209
21239
|
block: a,
|
|
21210
21240
|
onUpdate: (e) => {
|
|
21211
21241
|
t((t) => t.map((t) => t.id === a.id ? D(D({}, t), {}, { content: e }) : t));
|
|
@@ -21229,7 +21259,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
21229
21259
|
}
|
|
21230
21260
|
//#endregion
|
|
21231
21261
|
//#region src/components/CanvasToolbar.tsx
|
|
21232
|
-
function
|
|
21262
|
+
function Nx({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0, showExport: r = !0, showExportPdf: i = !0, showClearCanvas: a, customButtonStyles: s, customButtonClassNames: c, customActionComponents: f, handleHtmlImport: p, handlePdfImport: m, setPreviewOpen: h, handleExport: g, handleExportPdf: _, handleClearCanvas: v, zoom: y, setZoom: b, setPanOffset: x, themeColor: S = "#ea580c" }) {
|
|
21233
21263
|
let C = o(null), w = o(null);
|
|
21234
21264
|
return /* @__PURE__ */ d("div", {
|
|
21235
21265
|
className: "bg-white border-b border-gray-200 px-4 py-2 flex flex-wrap items-center justify-between shadow-xs sticky top-0 z-20 gap-2",
|
|
@@ -21247,7 +21277,7 @@ function Mx({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
21247
21277
|
style: s == null ? void 0 : s.importHtml,
|
|
21248
21278
|
className: (c == null ? void 0 : c.importHtml) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-2xs cursor-pointer",
|
|
21249
21279
|
title: "Import local HTML file",
|
|
21250
|
-
children: [/* @__PURE__ */ u(
|
|
21280
|
+
children: [/* @__PURE__ */ u(_x, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ u("span", { children: "Import HTML" })]
|
|
21251
21281
|
}), /* @__PURE__ */ u("input", {
|
|
21252
21282
|
type: "file",
|
|
21253
21283
|
ref: C,
|
|
@@ -21266,7 +21296,7 @@ function Mx({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
21266
21296
|
style: s == null ? void 0 : s.importPdf,
|
|
21267
21297
|
className: (c == null ? void 0 : c.importPdf) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-2xs cursor-pointer",
|
|
21268
21298
|
title: "Import PDF layout structure",
|
|
21269
|
-
children: [/* @__PURE__ */ u(
|
|
21299
|
+
children: [/* @__PURE__ */ u(Qb, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ u("span", { children: "Import PDF" })]
|
|
21270
21300
|
}), /* @__PURE__ */ u("input", {
|
|
21271
21301
|
type: "file",
|
|
21272
21302
|
ref: w,
|
|
@@ -21278,26 +21308,26 @@ function Mx({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
21278
21308
|
onClick: () => h(!0),
|
|
21279
21309
|
style: s == null ? void 0 : s.preview,
|
|
21280
21310
|
className: (c == null ? void 0 : c.preview) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-slate-200 rounded-lg text-xs font-semibold bg-slate-50 text-slate-700 hover:bg-slate-100 transition-colors shadow-2xs cursor-pointer",
|
|
21281
|
-
children: [/* @__PURE__ */ u(
|
|
21311
|
+
children: [/* @__PURE__ */ u(Zb, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ u("span", { children: "Live Preview" })]
|
|
21282
21312
|
})),
|
|
21283
21313
|
i && (f != null && f.exportPdf ? f.exportPdf({ onClick: _ }) : /* @__PURE__ */ d("button", {
|
|
21284
21314
|
onClick: _,
|
|
21285
21315
|
style: s == null ? void 0 : s.exportPdf,
|
|
21286
21316
|
className: (c == null ? void 0 : c.exportPdf) || "inline-flex items-center space-x-1 px-2.5 py-1 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-semibold transition-colors shadow-2xs shadow-indigo-600/10 cursor-pointer",
|
|
21287
|
-
children: [/* @__PURE__ */ u(
|
|
21317
|
+
children: [/* @__PURE__ */ u(ix, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Download PDF" })]
|
|
21288
21318
|
})),
|
|
21289
21319
|
r && (f != null && f.export ? f.export({ onClick: g }) : /* @__PURE__ */ d("button", {
|
|
21290
21320
|
onClick: g,
|
|
21291
21321
|
style: D({ backgroundColor: S }, s == null ? void 0 : s.export),
|
|
21292
21322
|
className: (c == null ? void 0 : c.export) || "inline-flex items-center space-x-1 px-2.5 py-1 text-white rounded-lg text-xs font-semibold transition-colors shadow-2xs cursor-pointer",
|
|
21293
|
-
children: [/* @__PURE__ */ u(
|
|
21323
|
+
children: [/* @__PURE__ */ u(Xb, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Export Template" })]
|
|
21294
21324
|
})),
|
|
21295
21325
|
a && /* @__PURE__ */ d("button", {
|
|
21296
21326
|
onClick: v,
|
|
21297
21327
|
style: s == null ? void 0 : s.clearCanvas,
|
|
21298
21328
|
className: (c == null ? void 0 : c.clearCanvas) || "inline-flex items-center space-x-1 px-2.5 py-1 text-xs font-semibold border border-red-200 text-red-650 bg-red-50 hover:bg-red-100 rounded-lg transition-colors cursor-pointer",
|
|
21299
21329
|
title: "Clear all canvas elements",
|
|
21300
|
-
children: [/* @__PURE__ */ u(
|
|
21330
|
+
children: [/* @__PURE__ */ u(hx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Clear Canvas" })]
|
|
21301
21331
|
})
|
|
21302
21332
|
]
|
|
21303
21333
|
}), /* @__PURE__ */ d("div", {
|
|
@@ -21351,7 +21381,7 @@ function Mx({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
21351
21381
|
}
|
|
21352
21382
|
//#endregion
|
|
21353
21383
|
//#region src/components/PreviewModal.tsx
|
|
21354
|
-
function
|
|
21384
|
+
function Px({ previewOpen: e, setPreviewOpen: t, generateExportHtml: n }) {
|
|
21355
21385
|
return e ? /* @__PURE__ */ u("div", {
|
|
21356
21386
|
className: "fixed inset-0 bg-slate-950/65 backdrop-blur-xs flex items-center justify-center z-50 p-6",
|
|
21357
21387
|
children: /* @__PURE__ */ d("div", {
|
|
@@ -21361,14 +21391,14 @@ function Nx({ previewOpen: e, setPreviewOpen: t, generateExportHtml: n }) {
|
|
|
21361
21391
|
className: "bg-slate-50 border-b border-gray-200 px-6 py-4 flex items-center justify-between",
|
|
21362
21392
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("h3", {
|
|
21363
21393
|
className: "text-sm font-bold text-slate-800 flex items-center space-x-2",
|
|
21364
|
-
children: [/* @__PURE__ */ u(
|
|
21394
|
+
children: [/* @__PURE__ */ u(Zb, { className: "h-4 w-4 text-slate-655" }), /* @__PURE__ */ u("span", { children: "HTML Document Render Output" })]
|
|
21365
21395
|
}), /* @__PURE__ */ u("p", {
|
|
21366
21396
|
className: "text-[10px] text-slate-400 mt-0.5",
|
|
21367
21397
|
children: "Sandboxed iframe preview of final template markup"
|
|
21368
21398
|
})] }), /* @__PURE__ */ u("button", {
|
|
21369
21399
|
onClick: () => t(!1),
|
|
21370
21400
|
className: "p-1.5 bg-slate-100 hover:bg-slate-200 text-slate-500 hover:text-slate-800 rounded-lg transition-colors",
|
|
21371
|
-
children: /* @__PURE__ */ u(
|
|
21401
|
+
children: /* @__PURE__ */ u(vx, { className: "h-4 w-4" })
|
|
21372
21402
|
})]
|
|
21373
21403
|
}),
|
|
21374
21404
|
/* @__PURE__ */ u("div", {
|
|
@@ -21402,7 +21432,7 @@ function Nx({ previewOpen: e, setPreviewOpen: t, generateExportHtml: n }) {
|
|
|
21402
21432
|
}
|
|
21403
21433
|
//#endregion
|
|
21404
21434
|
//#region src/components/SelectionBubble.tsx
|
|
21405
|
-
function
|
|
21435
|
+
function Fx({ bubbleCoords: e, applySelectionFormat: t }) {
|
|
21406
21436
|
return e ? /* @__PURE__ */ d("div", {
|
|
21407
21437
|
className: "fixed bg-slate-900 border border-slate-800 text-white rounded-xl shadow-xl py-1 px-1.5 flex items-center space-x-1.5 z-50 select-none -translate-x-1/2",
|
|
21408
21438
|
style: {
|
|
@@ -21513,7 +21543,7 @@ function Px({ bubbleCoords: e, applySelectionFormat: t }) {
|
|
|
21513
21543
|
//#endregion
|
|
21514
21544
|
//#region src/App.tsx
|
|
21515
21545
|
Hu.workerSrc = "https://cdn.jsdelivr.net/npm/pdfjs-dist@6.1.200/build/pdf.worker.min.mjs";
|
|
21516
|
-
var
|
|
21546
|
+
var Ix = (e) => {
|
|
21517
21547
|
let t = [];
|
|
21518
21548
|
return e.forEach((e) => {
|
|
21519
21549
|
e.style.sameRow && t.length > 0 ? t[t.length - 1].blocks.push(e) : t.push({
|
|
@@ -21521,9 +21551,9 @@ var Fx = (e) => {
|
|
|
21521
21551
|
blocks: [e]
|
|
21522
21552
|
});
|
|
21523
21553
|
}), t;
|
|
21524
|
-
},
|
|
21525
|
-
function
|
|
21526
|
-
let de = ne || re || "#ea580c", { zoom: fe, setZoom: pe, panOffset: j, setPanOffset: me, spacePressed: he, canvasHeight: ge, setCanvasHeight: _e, viewportRef: ve, canvasContainerRef: ye, contentRef: be, handleMouseDown: xe, handleMouseMove: Se, handleMouseUp: Ce } =
|
|
21554
|
+
}, Lx = (e) => e ? e.replace(/contenteditable="[^"]*"/g, "").replace(/class="[^"]*"/g, "").replace(/data-placeholder="[^"]*"/g, "").replace(/ /g, " ").trim() : "";
|
|
21555
|
+
function Rx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r, headerTitle: i = "HTML Template Builder", headerSubtitle: o = "Design and export templates dynamically", headerLogo: c, typographySizes: l, typographyWeights: f, typographyFonts: p, templatingLanguage: m = "csharp", loopSyntax: h = "foreach", onChange: g, onExport: _, onExportPdf: v, getHTMLOutput: y, initialBlocks: x, defaultStyles: S, showImportHtml: C = !0, showImportPdf: w = !0, showClearCanvas: T = !0, showPreview: E = !0, showExport: ee = !0, showExportPdf: O = !0, showHeader: k = !0, sidebarPosition: A = "left", themeColor: ne, primaryColor: re, isTablesLoading: ie, tablesLoading: ae, isPlaceholdersLoading: oe, placeholdersLoading: se, customButtonStyles: ce, customButtonClassNames: le, customActionComponents: ue } = {}) {
|
|
21556
|
+
let de = ne || re || "#ea580c", { zoom: fe, setZoom: pe, panOffset: j, setPanOffset: me, spacePressed: he, canvasHeight: ge, setCanvasHeight: _e, viewportRef: ve, canvasContainerRef: ye, contentRef: be, handleMouseDown: xe, handleMouseMove: Se, handleMouseUp: Ce } = Db(), { customTableName: we, setCustomTableName: Te, customLoopStart: Ee, setCustomLoopStart: De, customLoopEnd: Oe, setCustomLoopEnd: M, newColName: N, setNewColName: ke, newColPlaceholder: Ae, setNewColPlaceholder: je, bubbleCoords: Me, setBubbleCoords: Ne, schemas: Pe, isParsing: Fe, setIsParsing: Ie, parseStatusText: Le, setParseStatusText: Re, parseError: ze, setParseError: Be, draggedSidebarItem: Ve, setDraggedSidebarItem: P, dragOverIndex: F, setDragOverIndex: He, newImgTypeName: Ue, setNewImgTypeName: We, customImageTypes: Ge, searchPlaceholder: Ke, setSearchPlaceholder: I, handleAddCustomTable: qe, handleAddCustomImageType: Je, toggleSchemaColumn: Ye, applySelectionFormat: Xe, setSavedRange: Ze } = Ob({ tableSchemas: e }), { blocks: Qe, setBlocks: $e, selectedBlockId: et, setSelectedBlockId: tt, getSelectedBlock: L, createTextBlock: R, createTableBlock: nt, createImageBlock: rt, createLayoutBlock: it, addColumnToLayout: at, deleteColumnFromLayout: ot, mergeColumns: st, updateColumnStyle: ct, updateColumnWidth: lt, handleDeleteBlock: ut, handleDuplicateBlock: dt, handleMoveBlockUp: ft, handleMoveBlockDown: z, updateSelectedStyle: pt, updateSelectedImageInfo: mt, handleRemoveTableColumn: ht, handleAddTableColumn: gt, handleUpdateTableColumn: _t, handleReorderTableColumn: vt, handleAddTableRow: yt, handleRemoveTableRow: bt } = Eb({
|
|
21527
21557
|
initialBlocks: x,
|
|
21528
21558
|
defaultStyles: S,
|
|
21529
21559
|
defaultLogo: n,
|
|
@@ -21682,7 +21712,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21682
21712
|
r.onload = (t) => {
|
|
21683
21713
|
try {
|
|
21684
21714
|
var n;
|
|
21685
|
-
let e =
|
|
21715
|
+
let e = wb((n = t.target) == null ? void 0 : n.result);
|
|
21686
21716
|
e.length > 0 && $e(e);
|
|
21687
21717
|
} catch (e) {
|
|
21688
21718
|
console.error(e), Be(e.message || "Failed to parse HTML");
|
|
@@ -21698,7 +21728,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21698
21728
|
let r = new FileReader();
|
|
21699
21729
|
r.onload = b(function* () {
|
|
21700
21730
|
try {
|
|
21701
|
-
let e = r.result, t = yield
|
|
21731
|
+
let e = r.result, t = yield Tb(e, te);
|
|
21702
21732
|
t.length > 0 && $e((e) => [...e, ...t]);
|
|
21703
21733
|
} catch (e) {
|
|
21704
21734
|
console.error(e), Be(e.message || "Failed to read PDF");
|
|
@@ -21737,7 +21767,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21737
21767
|
let a = t.columnName, o = n && Array.isArray(n[a]) && n[a].length > 0 ? n[a] : [{}];
|
|
21738
21768
|
if (e || o.length > 1 || !t.loop) o.forEach((e) => {
|
|
21739
21769
|
i += " <tr>\n", r.forEach((t) => {
|
|
21740
|
-
let n =
|
|
21770
|
+
let n = Lx(t.placeholder);
|
|
21741
21771
|
typeof e == "object" && e && Object.keys(e).forEach((t) => {
|
|
21742
21772
|
let r = RegExp(`\\{\\{(item\\.|package\\.)?${t}\\}\\}`, "g");
|
|
21743
21773
|
n = n.replace(r, e[t]);
|
|
@@ -21755,7 +21785,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21755
21785
|
}
|
|
21756
21786
|
return i += " </tbody>\n", i += " </table>", i;
|
|
21757
21787
|
};
|
|
21758
|
-
return
|
|
21788
|
+
return Ix(Qe).forEach((r) => {
|
|
21759
21789
|
let i = r.blocks.length > 1, a = r.blocks.some((e) => e.type === "table");
|
|
21760
21790
|
if (i) {
|
|
21761
21791
|
var o;
|
|
@@ -21770,23 +21800,26 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21770
21800
|
let o = i.columns.filter((e) => e.enabled !== !1);
|
|
21771
21801
|
t += ` <div class="block-container table-container" style="${u}">\n`;
|
|
21772
21802
|
let s = a;
|
|
21773
|
-
a.includes("font-size") || (s += " font-size: 10px;"), a.includes("color") || (s += " color: #334155;"), a.includes("text-align") || (s += " text-align: left;"), a.includes("font-weight") || (s += " font-weight: 400;"), t += ` <table style="${s}">\n`, t += " <thead>\n", t += " <tr>\n", t += o.map((e) => {
|
|
21774
|
-
let t = e.columnName || "";
|
|
21775
|
-
return ` <th${e.colspan && e.colspan > 1 ? ` colspan="${e.colspan}"` : ""}>${t}</th>\n`;
|
|
21776
|
-
}).join(""), t += " </tr>\n", t += " </thead>\n", t += " <tbody>\n";
|
|
21803
|
+
a.includes("font-size") || (s += " font-size: 10px;"), a.includes("color") || (s += " color: #334155;"), a.includes("text-align") || (s += " text-align: left;"), a.includes("font-weight") || (s += " font-weight: 400;"), t += ` <table style="${s}">\n`, t += " <thead>\n", t += " <tr>\n", t += o.map((e) => ` <th>${e.columnName || ""}</th>\n`).join(""), t += " </tr>\n", t += " </thead>\n", t += " <tbody>\n";
|
|
21777
21804
|
let c = (t) => {
|
|
21778
|
-
let r = " <tr>\n";
|
|
21779
|
-
return o.forEach((
|
|
21780
|
-
|
|
21781
|
-
|
|
21805
|
+
let r = " <tr>\n", a = 0;
|
|
21806
|
+
return o.forEach((o) => {
|
|
21807
|
+
if (a > 0) {
|
|
21808
|
+
a--;
|
|
21809
|
+
return;
|
|
21810
|
+
}
|
|
21811
|
+
let s = t && t[`${o.columnName}_colspan`] || 1;
|
|
21812
|
+
s > 1 && (a = s - 1);
|
|
21813
|
+
let c = s > 1 ? ` colspan="${s}"` : "";
|
|
21814
|
+
if (o.loop && o.columns && o.columns.length > 0) r += ` <td${c}>\n${n(o, t)}\n </td>\n`;
|
|
21782
21815
|
else {
|
|
21783
|
-
let n =
|
|
21784
|
-
|
|
21816
|
+
let n = Lx(o.placeholder);
|
|
21817
|
+
t && typeof t == "object" && t[o.columnName] !== void 0 ? n = Lx(String(t[o.columnName])) : t && typeof t == "object" && Object.keys(t).forEach((e) => {
|
|
21785
21818
|
n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t[e])), n.includes(`{{item.${e}}}`) && (n = n.replace(RegExp(`\\{\\{item\\.${e}\\}\\}`, "g"), t[e])), n.includes(`{{package.${e}}}`) && (n = n.replace(RegExp(`\\{\\{package\\.${e}\\}\\}`, "g"), t[e]));
|
|
21786
|
-
}), Object.keys(Mt).forEach((e) => {
|
|
21819
|
+
}), (e || i.mockRows && i.mockRows.length > 1) && (Object.keys(Mt).forEach((e) => {
|
|
21787
21820
|
let t = Mt[e];
|
|
21788
21821
|
n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
|
|
21789
|
-
}), e && (n = n.replace(/\{\{[^}]+\}\}/g, ""))), r += ` <td${
|
|
21822
|
+
}), e && (n = n.replace(/\{\{[^}]+\}\}/g, ""))), r += ` <td${c}>${n}</td>\n`;
|
|
21790
21823
|
}
|
|
21791
21824
|
}), r += " </tr>\n", r;
|
|
21792
21825
|
}, l = i.mockRows && i.mockRows.length > 0 ? i.mockRows : [{}];
|
|
@@ -21795,9 +21828,18 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21795
21828
|
});
|
|
21796
21829
|
else {
|
|
21797
21830
|
let e = i.tableName === "package" ? "shipment.packages" : i.tableName === "article" ? "package.articles" : i.tableName, r = Pt(e);
|
|
21798
|
-
jt ? t += ` <!-- ${r.start} --><tr>\n` : t += ` ${r.start}<tr>\n
|
|
21799
|
-
|
|
21800
|
-
|
|
21831
|
+
jt ? t += ` <!-- ${r.start} --><tr>\n` : t += ` ${r.start}<tr>\n`;
|
|
21832
|
+
let a = 0;
|
|
21833
|
+
o.forEach((e) => {
|
|
21834
|
+
var r;
|
|
21835
|
+
if (a > 0) {
|
|
21836
|
+
a--;
|
|
21837
|
+
return;
|
|
21838
|
+
}
|
|
21839
|
+
let o = ((r = i.mockRows) == null || (r = r[0]) == null ? void 0 : r[`${e.columnName}_colspan`]) || 1;
|
|
21840
|
+
o > 1 && (a = o - 1);
|
|
21841
|
+
let s = o > 1 ? ` colspan="${o}"` : "";
|
|
21842
|
+
e.loop && e.columns && e.columns.length > 0 ? t += ` <td${s}>\n${n(e)}\n </td>\n` : t += ` <td${s}>${e.placeholder}</td>\n`;
|
|
21801
21843
|
}), jt ? t += ` </tr><!-- ${r.end} -->\n` : t += ` </tr>${r.end}\n`;
|
|
21802
21844
|
}
|
|
21803
21845
|
t += " </tbody>\n", t += " </table>\n", t += " </div>\n";
|
|
@@ -21825,7 +21867,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21825
21867
|
}), t += " </tr></thead>\n", t += " <tbody><tr>\n", a.forEach((r) => {
|
|
21826
21868
|
if (r.loop || Array.isArray(r.columns)) t += ` <td style="border: 1px solid #e2e8f0; padding: 4px 6px; font-size: 10px;">\n${n(r)}\n </td>\n`;
|
|
21827
21869
|
else {
|
|
21828
|
-
let n =
|
|
21870
|
+
let n = Lx(r.placeholder);
|
|
21829
21871
|
(e || Tt) && (Object.keys(Mt).forEach((e) => {
|
|
21830
21872
|
n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), Mt[e]);
|
|
21831
21873
|
}), e && (n = n.replace(/\{\{[^}]+\}\}/g, ""))), t += ` <td style="border: 1px solid #e2e8f0; padding: 6px 8px; font-size: 10px; color: #475569;">${n}</td>\n`;
|
|
@@ -21844,7 +21886,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21844
21886
|
"h5",
|
|
21845
21887
|
"h6"
|
|
21846
21888
|
].includes(r.type) ? n = r.type : r.type === "title" ? n = "h1" : r.type === "subtitle" ? n = "h2" : r.type === "caption" && (n = "span");
|
|
21847
|
-
let i = yb(r.style), a =
|
|
21889
|
+
let i = yb(r.style), a = Lx(r.content);
|
|
21848
21890
|
(e || Tt) && (Object.keys(Mt).forEach((e) => {
|
|
21849
21891
|
a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), Mt[e]);
|
|
21850
21892
|
}), e && (a = a.replace(/\{\{[^}]+\}\}/g, ""))), t += ` <div class="block-container" style="width: 100%; margin-bottom: ${r.style.marginBottom || "8px"}; text-align: ${r.style.textAlign || "left"};">\n`, t += ` <${n} style="${i}">${a}</${n}>\n`, t += " </div>\n";
|
|
@@ -21861,7 +21903,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21861
21903
|
"h5",
|
|
21862
21904
|
"h6"
|
|
21863
21905
|
].includes(r.type) ? n = r.type : r.type === "title" ? n = "h1" : r.type === "subtitle" ? n = "h2" : r.type === "caption" && (n = "span");
|
|
21864
|
-
let i =
|
|
21906
|
+
let i = Lx(r.content);
|
|
21865
21907
|
(e || Tt) && (Object.keys(Mt).forEach((e) => {
|
|
21866
21908
|
let t = Mt[e];
|
|
21867
21909
|
i = i.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t);
|
|
@@ -21929,7 +21971,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21929
21971
|
return /* @__PURE__ */ d("div", {
|
|
21930
21972
|
className: "reth-editor h-screen max-h-screen bg-slate-50 flex flex-col font-sans overflow-hidden",
|
|
21931
21973
|
children: [
|
|
21932
|
-
k && /* @__PURE__ */ u(
|
|
21974
|
+
k && /* @__PURE__ */ u(yx, {
|
|
21933
21975
|
headerLogo: c,
|
|
21934
21976
|
headerTitle: i,
|
|
21935
21977
|
headerSubtitle: o,
|
|
@@ -21942,7 +21984,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21942
21984
|
className: "flex-1 min-h-0 h-full grid grid-cols-1 lg:grid-cols-12 overflow-hidden",
|
|
21943
21985
|
children: [/* @__PURE__ */ d("main", {
|
|
21944
21986
|
className: `w-full lg:col-span-8 h-full min-h-0 flex flex-col bg-slate-100 border-b lg:border-b-0 ${A === "left" ? "lg:border-l lg:order-2" : "lg:border-r lg:order-1"} border-gray-200 overflow-hidden relative`,
|
|
21945
|
-
children: [/* @__PURE__ */ u(
|
|
21987
|
+
children: [/* @__PURE__ */ u(Nx, {
|
|
21946
21988
|
showImportHtml: C,
|
|
21947
21989
|
showImportPdf: w,
|
|
21948
21990
|
showPreview: E,
|
|
@@ -21962,7 +22004,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
21962
22004
|
setZoom: pe,
|
|
21963
22005
|
setPanOffset: me,
|
|
21964
22006
|
themeColor: de
|
|
21965
|
-
}), /* @__PURE__ */ u(
|
|
22007
|
+
}), /* @__PURE__ */ u(Mx, {
|
|
21966
22008
|
blocks: Qe,
|
|
21967
22009
|
setBlocks: $e,
|
|
21968
22010
|
selectedBlockId: et,
|
|
@@ -22032,7 +22074,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
22032
22074
|
handleTextDrop: zt,
|
|
22033
22075
|
themeColor: de
|
|
22034
22076
|
})]
|
|
22035
|
-
}), /* @__PURE__ */ u(
|
|
22077
|
+
}), /* @__PURE__ */ u(Dx, {
|
|
22036
22078
|
activeTab: xt,
|
|
22037
22079
|
setActiveTab: St,
|
|
22038
22080
|
themeColor: de,
|
|
@@ -22096,11 +22138,11 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
22096
22138
|
sidebarPosition: A
|
|
22097
22139
|
})]
|
|
22098
22140
|
}),
|
|
22099
|
-
/* @__PURE__ */ u(
|
|
22141
|
+
/* @__PURE__ */ u(Fx, {
|
|
22100
22142
|
bubbleCoords: Me,
|
|
22101
22143
|
applySelectionFormat: Xe
|
|
22102
22144
|
}),
|
|
22103
|
-
/* @__PURE__ */ u(
|
|
22145
|
+
/* @__PURE__ */ u(Px, {
|
|
22104
22146
|
previewOpen: Ct,
|
|
22105
22147
|
setPreviewOpen: wt,
|
|
22106
22148
|
generateExportHtml: Ft
|
|
@@ -22110,14 +22152,14 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
22110
22152
|
}
|
|
22111
22153
|
//#endregion
|
|
22112
22154
|
//#region src/index.ts
|
|
22113
|
-
var
|
|
22114
|
-
function
|
|
22115
|
-
let r =
|
|
22116
|
-
return r || (r = c(t),
|
|
22155
|
+
var zx = Rx, Bx = /* @__PURE__ */ new WeakMap();
|
|
22156
|
+
function Vx(t, n) {
|
|
22157
|
+
let r = Bx.get(t);
|
|
22158
|
+
return r || (r = c(t), Bx.set(t, r)), r.render(e.createElement(Rx, n)), r;
|
|
22117
22159
|
}
|
|
22118
|
-
function
|
|
22119
|
-
let t =
|
|
22120
|
-
return t ? (t.unmount(),
|
|
22160
|
+
function Hx(e) {
|
|
22161
|
+
let t = Bx.get(e);
|
|
22162
|
+
return t ? (t.unmount(), Bx.delete(e), !0) : !1;
|
|
22121
22163
|
}
|
|
22122
22164
|
//#endregion
|
|
22123
|
-
export {
|
|
22165
|
+
export { Rx as HtmlEditor, zx as default, Vx as mountHtmlEditor, Hx as unmountHtmlEditor };
|