@mypixia/simplex-designer 2.0.7 → 2.0.8
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.js +6 -6
- package/dist/index.es.js +95 -95
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -70,11 +70,11 @@ function Ve() {
|
|
|
70
70
|
switch (typeof y.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
72
|
), y.$$typeof) {
|
|
73
|
-
case
|
|
73
|
+
case T:
|
|
74
74
|
return "Portal";
|
|
75
75
|
case O:
|
|
76
76
|
return (y.displayName || "Context") + ".Provider";
|
|
77
|
-
case
|
|
77
|
+
case j:
|
|
78
78
|
return (y._context.displayName || "Context") + ".Consumer";
|
|
79
79
|
case k:
|
|
80
80
|
var D = y.render;
|
|
@@ -238,7 +238,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
function E(y) {
|
|
239
239
|
typeof y == "object" && y !== null && y.$$typeof === B && y._store && (y._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var m = Qe, B = Symbol.for("react.transitional.element"),
|
|
241
|
+
var m = Qe, B = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), X = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), O = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), xt = Symbol.for("react.memo"), Q = Symbol.for("react.lazy"), ft = Symbol.for("react.activity"), _ = Symbol.for("react.client.reference"), st = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, nt = Array.isArray, tt = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
m = {
|
|
@@ -394,7 +394,7 @@ const Ut = {
|
|
|
394
394
|
let m = ne();
|
|
395
395
|
if (s.trim() && (m = Je(s)), h !== "all") {
|
|
396
396
|
const B = Ut[h];
|
|
397
|
-
B && (m = m.filter((
|
|
397
|
+
B && (m = m.filter((T) => T.category === B.name));
|
|
398
398
|
}
|
|
399
399
|
return m;
|
|
400
400
|
})();
|
|
@@ -493,19 +493,19 @@ const Ut = {
|
|
|
493
493
|
y: 100,
|
|
494
494
|
imageObject: p
|
|
495
495
|
// Store the loaded image object
|
|
496
|
-
}),
|
|
496
|
+
}), T();
|
|
497
497
|
}, p.src = h;
|
|
498
|
-
},
|
|
498
|
+
}, T = () => {
|
|
499
499
|
g(""), n(""), o();
|
|
500
500
|
};
|
|
501
|
-
return f ? /* @__PURE__ */ i.jsx("div", { className: "qr-modal-overlay", onClick:
|
|
501
|
+
return f ? /* @__PURE__ */ i.jsx("div", { className: "qr-modal-overlay", onClick: T, children: /* @__PURE__ */ i.jsxs("div", { className: "qr-modal-content", onClick: (p) => p.stopPropagation(), children: [
|
|
502
502
|
/* @__PURE__ */ i.jsxs("div", { className: "qr-modal-header", children: [
|
|
503
503
|
/* @__PURE__ */ i.jsx("h3", { children: "Generate QR Code" }),
|
|
504
504
|
/* @__PURE__ */ i.jsx(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
507
507
|
className: "qr-modal-close",
|
|
508
|
-
onClick:
|
|
508
|
+
onClick: T,
|
|
509
509
|
"aria-label": "Close",
|
|
510
510
|
children: "×"
|
|
511
511
|
}
|
|
@@ -586,7 +586,7 @@ const Ut = {
|
|
|
586
586
|
] })
|
|
587
587
|
] }) }) : null;
|
|
588
588
|
}, ti = ({ isOpen: f, onClose: o, onAddBarcode: a, theme: l }) => {
|
|
589
|
-
const [s, g] = N(""), [h, n] = N("CODE128"), [c, F] = N(null), [I, E] = N(2), [m, B] = N(100), [
|
|
589
|
+
const [s, g] = N(""), [h, n] = N("CODE128"), [c, F] = N(null), [I, E] = N(2), [m, B] = N(100), [T, p] = N(20), [v, X] = N("center"), [j, O] = N("bottom"), [k, Z] = N(10), W = gt(null), xt = [
|
|
590
590
|
{ value: "CODE128", label: "CODE128 (Most Common)" },
|
|
591
591
|
{ value: "EAN13", label: "EAN-13 (European Article Number)" },
|
|
592
592
|
{ value: "EAN8", label: "EAN-8 (Short EAN)" },
|
|
@@ -606,9 +606,9 @@ const Ut = {
|
|
|
606
606
|
format: h,
|
|
607
607
|
width: I,
|
|
608
608
|
height: m,
|
|
609
|
-
fontSize:
|
|
609
|
+
fontSize: T,
|
|
610
610
|
textAlign: v,
|
|
611
|
-
textPosition:
|
|
611
|
+
textPosition: j,
|
|
612
612
|
margin: k,
|
|
613
613
|
background: "#ffffff",
|
|
614
614
|
lineColor: "#000000"
|
|
@@ -749,12 +749,12 @@ const Ut = {
|
|
|
749
749
|
id: "barcode-fontsize",
|
|
750
750
|
min: "10",
|
|
751
751
|
max: "30",
|
|
752
|
-
value:
|
|
752
|
+
value: T,
|
|
753
753
|
onChange: (M) => p(parseInt(M.target.value))
|
|
754
754
|
}
|
|
755
755
|
),
|
|
756
756
|
/* @__PURE__ */ i.jsxs("span", { className: "range-value", children: [
|
|
757
|
-
|
|
757
|
+
T,
|
|
758
758
|
"px"
|
|
759
759
|
] })
|
|
760
760
|
] }),
|
|
@@ -764,7 +764,7 @@ const Ut = {
|
|
|
764
764
|
"select",
|
|
765
765
|
{
|
|
766
766
|
id: "text-position",
|
|
767
|
-
value:
|
|
767
|
+
value: j,
|
|
768
768
|
onChange: (M) => O(M.target.value),
|
|
769
769
|
children: [
|
|
770
770
|
/* @__PURE__ */ i.jsx("option", { value: "bottom", children: "Bottom" }),
|
|
@@ -865,9 +865,9 @@ const Ut = {
|
|
|
865
865
|
}
|
|
866
866
|
` })
|
|
867
867
|
] }), ii = ({ isOpen: f, onClose: o, onAddSticker: a, theme: l, apiKey: s, apiEndpoint: g }) => {
|
|
868
|
-
const [h, n] = N([]), [c, F] = N(!1), [I, E] = N(null), [m, B] = N(""), [
|
|
868
|
+
const [h, n] = N([]), [c, F] = N(!1), [I, E] = N(null), [m, B] = N(""), [T, p] = N(""), [v, X] = N({});
|
|
869
869
|
gt(null);
|
|
870
|
-
const [
|
|
870
|
+
const [j, O] = N(!1), [k, Z] = N(!1), [W, xt] = N(!1), Q = `${g}/api/v1/designer`;
|
|
871
871
|
rt(() => {
|
|
872
872
|
f && s && ft();
|
|
873
873
|
}, [f, s]);
|
|
@@ -936,7 +936,7 @@ const Ut = {
|
|
|
936
936
|
}), C;
|
|
937
937
|
}, ct = (P, C = "", et = 0) => /* @__PURE__ */ i.jsx("div", { className: "sticker-tree-level", style: { paddingLeft: `${et * 15}px` }, children: Object.keys(P).map((y) => {
|
|
938
938
|
const D = `${C}/${y}`, L = v[D];
|
|
939
|
-
return P[y].type === "image" ? !
|
|
939
|
+
return P[y].type === "image" ? !T || y.toLowerCase().includes(T.toLowerCase()) ? /* @__PURE__ */ i.jsx(
|
|
940
940
|
"div",
|
|
941
941
|
{
|
|
942
942
|
className: "sticker-item",
|
|
@@ -969,7 +969,7 @@ const Ut = {
|
|
|
969
969
|
L && ct(P[y], D, et + 1)
|
|
970
970
|
] }, D);
|
|
971
971
|
}) }), Y = h.filter(
|
|
972
|
-
(P) => !
|
|
972
|
+
(P) => !T || P.name.toLowerCase().includes(T.toLowerCase())
|
|
973
973
|
);
|
|
974
974
|
return f ? /* @__PURE__ */ i.jsx("div", { className: "sticker-modal-overlay", onClick: o, children: /* @__PURE__ */ i.jsxs("div", { className: "sticker-modal-content", onClick: (P) => P.stopPropagation(), children: [
|
|
975
975
|
/* @__PURE__ */ i.jsxs("div", { className: "sticker-modal-header", children: [
|
|
@@ -986,14 +986,14 @@ const Ut = {
|
|
|
986
986
|
] }),
|
|
987
987
|
/* @__PURE__ */ i.jsxs("div", { className: "sticker-modal-body", children: [
|
|
988
988
|
W && /* @__PURE__ */ i.jsx(le, {}),
|
|
989
|
-
!
|
|
990
|
-
|
|
989
|
+
!j && !W && k && /* @__PURE__ */ i.jsx(ei, { theme: l }),
|
|
990
|
+
j && k && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
991
991
|
/* @__PURE__ */ i.jsx("div", { className: "sticker-modal-controls", children: /* @__PURE__ */ i.jsx("div", { className: "search-container", children: /* @__PURE__ */ i.jsx(
|
|
992
992
|
"input",
|
|
993
993
|
{
|
|
994
994
|
type: "text",
|
|
995
995
|
placeholder: "Search stickers...",
|
|
996
|
-
value:
|
|
996
|
+
value: T,
|
|
997
997
|
onChange: (P) => p(P.target.value),
|
|
998
998
|
className: "sticker-search"
|
|
999
999
|
}
|
|
@@ -2560,11 +2560,11 @@ const Ut = {
|
|
|
2560
2560
|
description: "Complex mandala flower pattern"
|
|
2561
2561
|
}
|
|
2562
2562
|
], ri = ({ isOpen: f, onClose: o, onAddEmbroidery: a, theme: l, apiKey: s, apiEndpoint: g }) => {
|
|
2563
|
-
const [h, n] = N([]), [c, F] = N(!1), [I, E] = N(null), [m, B] = N(""), [
|
|
2563
|
+
const [h, n] = N([]), [c, F] = N(!1), [I, E] = N(null), [m, B] = N(""), [T, p] = N("All"), v = gt(null), X = ["All", "Floral", "Nature", "Geometric", "Traditional", "Sports", "Hobbies", "Food", "Symbols", "Holiday", "Text"];
|
|
2564
2564
|
rt(() => {
|
|
2565
2565
|
f && n(oi);
|
|
2566
2566
|
}, [f]);
|
|
2567
|
-
const
|
|
2567
|
+
const j = (k) => {
|
|
2568
2568
|
a({
|
|
2569
2569
|
type: "embroidery",
|
|
2570
2570
|
src: k.url,
|
|
@@ -2577,7 +2577,7 @@ const Ut = {
|
|
|
2577
2577
|
y: 100
|
|
2578
2578
|
}), o();
|
|
2579
2579
|
}, O = h.filter((k) => {
|
|
2580
|
-
const Z = !m || k.name.toLowerCase().includes(m.toLowerCase()) || k.description.toLowerCase().includes(m.toLowerCase()), W =
|
|
2580
|
+
const Z = !m || k.name.toLowerCase().includes(m.toLowerCase()) || k.description.toLowerCase().includes(m.toLowerCase()), W = T === "All" || k.category === T;
|
|
2581
2581
|
return Z && W;
|
|
2582
2582
|
});
|
|
2583
2583
|
return f ? /* @__PURE__ */ i.jsx("div", { className: "embroidery-modal-overlay", onClick: o, children: /* @__PURE__ */ i.jsxs(
|
|
@@ -2615,7 +2615,7 @@ const Ut = {
|
|
|
2615
2615
|
/* @__PURE__ */ i.jsx(
|
|
2616
2616
|
"select",
|
|
2617
2617
|
{
|
|
2618
|
-
value:
|
|
2618
|
+
value: T,
|
|
2619
2619
|
onChange: (k) => p(k.target.value),
|
|
2620
2620
|
className: "category-select",
|
|
2621
2621
|
children: X.map((k) => /* @__PURE__ */ i.jsx("option", { value: k, children: k }, k))
|
|
@@ -2633,7 +2633,7 @@ const Ut = {
|
|
|
2633
2633
|
"div",
|
|
2634
2634
|
{
|
|
2635
2635
|
className: "embroidery-item",
|
|
2636
|
-
onClick: () =>
|
|
2636
|
+
onClick: () => j(k),
|
|
2637
2637
|
title: k.description,
|
|
2638
2638
|
children: [
|
|
2639
2639
|
/* @__PURE__ */ i.jsx("div", { className: "embroidery-preview", children: /* @__PURE__ */ i.jsx(
|
|
@@ -4603,14 +4603,14 @@ const Ut = {
|
|
|
4603
4603
|
}
|
|
4604
4604
|
], ai = ({ isOpen: f, onClose: o, onAddText: a, theme: l }) => {
|
|
4605
4605
|
const [s, g] = N(""), [h, n] = N("All"), c = ie(() => {
|
|
4606
|
-
const m = Nt.reduce((B,
|
|
4606
|
+
const m = Nt.reduce((B, T) => (B[T.category] = (B[T.category] || 0) + 1, B), {});
|
|
4607
4607
|
return [
|
|
4608
4608
|
{ name: "All", count: Nt.length },
|
|
4609
|
-
...Object.entries(m).map(([B,
|
|
4609
|
+
...Object.entries(m).map(([B, T]) => ({ name: B, count: T }))
|
|
4610
4610
|
];
|
|
4611
4611
|
}, [Nt]), F = ie(() => Nt.filter((m) => {
|
|
4612
|
-
const B = !s || m.text.toLowerCase().includes(s.toLowerCase()) || m.category.toLowerCase().includes(s.toLowerCase()),
|
|
4613
|
-
return B &&
|
|
4612
|
+
const B = !s || m.text.toLowerCase().includes(s.toLowerCase()) || m.category.toLowerCase().includes(s.toLowerCase()), T = h === "All" || m.category === h;
|
|
4613
|
+
return B && T;
|
|
4614
4614
|
}), [Nt, s, h]), I = (m) => {
|
|
4615
4615
|
const B = {
|
|
4616
4616
|
...m,
|
|
@@ -4722,11 +4722,11 @@ const Ut = {
|
|
|
4722
4722
|
showGrid: E,
|
|
4723
4723
|
showRulers: m,
|
|
4724
4724
|
snapToGrid: B,
|
|
4725
|
-
selectedElement:
|
|
4725
|
+
selectedElement: T,
|
|
4726
4726
|
theme: p,
|
|
4727
4727
|
readOnly: v,
|
|
4728
4728
|
apiKey: X,
|
|
4729
|
-
apiEndpoint:
|
|
4729
|
+
apiEndpoint: j
|
|
4730
4730
|
}) => {
|
|
4731
4731
|
const [O, k] = N(!1), [Z, W] = N(!1), [xt, Q] = N(!1), [ft, _] = N(!1), [st, M] = N(!1), [nt, tt] = N(!1), [ct, Y] = N(!1), P = (U) => {
|
|
4732
4732
|
const K = U.target.files[0];
|
|
@@ -4952,7 +4952,7 @@ const Ut = {
|
|
|
4952
4952
|
]
|
|
4953
4953
|
}
|
|
4954
4954
|
) }),
|
|
4955
|
-
|
|
4955
|
+
T && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4956
4956
|
/* @__PURE__ */ i.jsx("div", { className: "toolbar-separator" }),
|
|
4957
4957
|
/* @__PURE__ */ i.jsxs("div", { className: "toolbar-group", children: [
|
|
4958
4958
|
/* @__PURE__ */ i.jsxs(
|
|
@@ -5049,7 +5049,7 @@ const Ut = {
|
|
|
5049
5049
|
onAddSticker: D,
|
|
5050
5050
|
theme: p,
|
|
5051
5051
|
apiKey: X,
|
|
5052
|
-
apiEndpoint:
|
|
5052
|
+
apiEndpoint: j
|
|
5053
5053
|
}
|
|
5054
5054
|
),
|
|
5055
5055
|
/* @__PURE__ */ i.jsx(
|
|
@@ -5060,7 +5060,7 @@ const Ut = {
|
|
|
5060
5060
|
onAddEmbroidery: L,
|
|
5061
5061
|
theme: p,
|
|
5062
5062
|
apiKey: X,
|
|
5063
|
-
apiEndpoint:
|
|
5063
|
+
apiEndpoint: j
|
|
5064
5064
|
}
|
|
5065
5065
|
),
|
|
5066
5066
|
/* @__PURE__ */ i.jsx(
|
|
@@ -5098,7 +5098,7 @@ const Ut = {
|
|
|
5098
5098
|
"textarea",
|
|
5099
5099
|
{
|
|
5100
5100
|
value: f.text || "",
|
|
5101
|
-
onChange: (
|
|
5101
|
+
onChange: (j) => n("text", j.target.value),
|
|
5102
5102
|
rows: 3,
|
|
5103
5103
|
placeholder: "Enter your text here..."
|
|
5104
5104
|
}
|
|
@@ -5110,8 +5110,8 @@ const Ut = {
|
|
|
5110
5110
|
"select",
|
|
5111
5111
|
{
|
|
5112
5112
|
value: f.fontFamily || "Arial",
|
|
5113
|
-
onChange: (
|
|
5114
|
-
children: l.map((
|
|
5113
|
+
onChange: (j) => n("fontFamily", j.target.value),
|
|
5114
|
+
children: l.map((j) => /* @__PURE__ */ i.jsx("option", { value: j, children: j }, j))
|
|
5115
5115
|
}
|
|
5116
5116
|
)
|
|
5117
5117
|
] }),
|
|
@@ -5123,7 +5123,7 @@ const Ut = {
|
|
|
5123
5123
|
{
|
|
5124
5124
|
type: "number",
|
|
5125
5125
|
value: f.fontSize || 20,
|
|
5126
|
-
onChange: (
|
|
5126
|
+
onChange: (j) => n("fontSize", parseInt(j.target.value)),
|
|
5127
5127
|
min: "8",
|
|
5128
5128
|
max: "200"
|
|
5129
5129
|
}
|
|
@@ -5137,7 +5137,7 @@ const Ut = {
|
|
|
5137
5137
|
type: "number",
|
|
5138
5138
|
step: "0.1",
|
|
5139
5139
|
value: f.lineHeight || 1.2,
|
|
5140
|
-
onChange: (
|
|
5140
|
+
onChange: (j) => n("lineHeight", parseFloat(j.target.value)),
|
|
5141
5141
|
min: "0.5",
|
|
5142
5142
|
max: "3"
|
|
5143
5143
|
}
|
|
@@ -5193,8 +5193,8 @@ const Ut = {
|
|
|
5193
5193
|
{
|
|
5194
5194
|
className: (p = f.textDecoration) != null && p.includes("underline") ? "active" : "",
|
|
5195
5195
|
onClick: () => {
|
|
5196
|
-
const
|
|
5197
|
-
|
|
5196
|
+
const j = f.textDecoration || "", O = j.split(" ").filter((k) => k && k !== "underline");
|
|
5197
|
+
j.includes("underline") || O.push("underline"), n("textDecoration", O.join(" ").trim());
|
|
5198
5198
|
},
|
|
5199
5199
|
title: "Underline",
|
|
5200
5200
|
children: /* @__PURE__ */ i.jsx("u", { children: "U" })
|
|
@@ -5205,8 +5205,8 @@ const Ut = {
|
|
|
5205
5205
|
{
|
|
5206
5206
|
className: (v = f.textDecoration) != null && v.includes("overline") ? "active" : "",
|
|
5207
5207
|
onClick: () => {
|
|
5208
|
-
const
|
|
5209
|
-
|
|
5208
|
+
const j = f.textDecoration || "", O = j.split(" ").filter((k) => k && k !== "overline");
|
|
5209
|
+
j.includes("overline") || O.push("overline"), n("textDecoration", O.join(" ").trim());
|
|
5210
5210
|
},
|
|
5211
5211
|
title: "Overline",
|
|
5212
5212
|
children: /* @__PURE__ */ i.jsx("span", { style: { textDecoration: "overline" }, children: "O" })
|
|
@@ -5217,8 +5217,8 @@ const Ut = {
|
|
|
5217
5217
|
{
|
|
5218
5218
|
className: (X = f.textDecoration) != null && X.includes("line-through") ? "active" : "",
|
|
5219
5219
|
onClick: () => {
|
|
5220
|
-
const
|
|
5221
|
-
|
|
5220
|
+
const j = f.textDecoration || "", O = j.split(" ").filter((k) => k && k !== "line-through");
|
|
5221
|
+
j.includes("line-through") || O.push("line-through"), n("textDecoration", O.join(" ").trim());
|
|
5222
5222
|
},
|
|
5223
5223
|
title: "Strikethrough",
|
|
5224
5224
|
children: /* @__PURE__ */ i.jsx("s", { children: "S" })
|
|
@@ -5316,7 +5316,7 @@ const Ut = {
|
|
|
5316
5316
|
{
|
|
5317
5317
|
type: "color",
|
|
5318
5318
|
value: f.fill || "#000000",
|
|
5319
|
-
onChange: (
|
|
5319
|
+
onChange: (j) => n("fill", j.target.value)
|
|
5320
5320
|
}
|
|
5321
5321
|
)
|
|
5322
5322
|
] }),
|
|
@@ -5328,7 +5328,7 @@ const Ut = {
|
|
|
5328
5328
|
{
|
|
5329
5329
|
type: "color",
|
|
5330
5330
|
value: f.backgroundColor || "#ffffff",
|
|
5331
|
-
onChange: (
|
|
5331
|
+
onChange: (j) => n("backgroundColor", j.target.value),
|
|
5332
5332
|
disabled: !f.hasBackground
|
|
5333
5333
|
}
|
|
5334
5334
|
),
|
|
@@ -5354,7 +5354,7 @@ const Ut = {
|
|
|
5354
5354
|
type: "number",
|
|
5355
5355
|
step: "0.1",
|
|
5356
5356
|
value: f.letterSpacing || 0,
|
|
5357
|
-
onChange: (
|
|
5357
|
+
onChange: (j) => n("letterSpacing", parseFloat(j.target.value)),
|
|
5358
5358
|
min: "-5",
|
|
5359
5359
|
max: "10"
|
|
5360
5360
|
}
|
|
@@ -5368,7 +5368,7 @@ const Ut = {
|
|
|
5368
5368
|
type: "number",
|
|
5369
5369
|
step: "0.1",
|
|
5370
5370
|
value: f.wordSpacing || 0,
|
|
5371
|
-
onChange: (
|
|
5371
|
+
onChange: (j) => n("wordSpacing", parseFloat(j.target.value)),
|
|
5372
5372
|
min: "-10",
|
|
5373
5373
|
max: "20"
|
|
5374
5374
|
}
|
|
@@ -5394,7 +5394,7 @@ const Ut = {
|
|
|
5394
5394
|
{
|
|
5395
5395
|
type: "number",
|
|
5396
5396
|
value: f.textShadowX || 2,
|
|
5397
|
-
onChange: (
|
|
5397
|
+
onChange: (j) => n("textShadowX", parseInt(j.target.value)),
|
|
5398
5398
|
min: "-20",
|
|
5399
5399
|
max: "20"
|
|
5400
5400
|
}
|
|
@@ -5407,7 +5407,7 @@ const Ut = {
|
|
|
5407
5407
|
{
|
|
5408
5408
|
type: "number",
|
|
5409
5409
|
value: f.textShadowY || 2,
|
|
5410
|
-
onChange: (
|
|
5410
|
+
onChange: (j) => n("textShadowY", parseInt(j.target.value)),
|
|
5411
5411
|
min: "-20",
|
|
5412
5412
|
max: "20"
|
|
5413
5413
|
}
|
|
@@ -5420,7 +5420,7 @@ const Ut = {
|
|
|
5420
5420
|
{
|
|
5421
5421
|
type: "number",
|
|
5422
5422
|
value: f.textShadowBlur || 4,
|
|
5423
|
-
onChange: (
|
|
5423
|
+
onChange: (j) => n("textShadowBlur", parseInt(j.target.value)),
|
|
5424
5424
|
min: "0",
|
|
5425
5425
|
max: "20"
|
|
5426
5426
|
}
|
|
@@ -5433,7 +5433,7 @@ const Ut = {
|
|
|
5433
5433
|
{
|
|
5434
5434
|
type: "color",
|
|
5435
5435
|
value: f.textShadowColor || "#000000",
|
|
5436
|
-
onChange: (
|
|
5436
|
+
onChange: (j) => n("textShadowColor", j.target.value)
|
|
5437
5437
|
}
|
|
5438
5438
|
)
|
|
5439
5439
|
] })
|
|
@@ -5448,7 +5448,7 @@ const Ut = {
|
|
|
5448
5448
|
{
|
|
5449
5449
|
type: "color",
|
|
5450
5450
|
value: f.stroke || "#000000",
|
|
5451
|
-
onChange: (
|
|
5451
|
+
onChange: (j) => n("stroke", j.target.value)
|
|
5452
5452
|
}
|
|
5453
5453
|
)
|
|
5454
5454
|
] }),
|
|
@@ -5459,7 +5459,7 @@ const Ut = {
|
|
|
5459
5459
|
{
|
|
5460
5460
|
type: "number",
|
|
5461
5461
|
value: f.strokeWidth || 0,
|
|
5462
|
-
onChange: (
|
|
5462
|
+
onChange: (j) => n("strokeWidth", parseInt(j.target.value)),
|
|
5463
5463
|
min: "0",
|
|
5464
5464
|
max: "20"
|
|
5465
5465
|
}
|
|
@@ -5476,7 +5476,7 @@ const Ut = {
|
|
|
5476
5476
|
max: "1",
|
|
5477
5477
|
step: "0.1",
|
|
5478
5478
|
value: f.opacity || 1,
|
|
5479
|
-
onChange: (
|
|
5479
|
+
onChange: (j) => n("opacity", parseFloat(j.target.value))
|
|
5480
5480
|
}
|
|
5481
5481
|
),
|
|
5482
5482
|
/* @__PURE__ */ i.jsxs("span", { children: [
|
|
@@ -5490,7 +5490,7 @@ const Ut = {
|
|
|
5490
5490
|
"select",
|
|
5491
5491
|
{
|
|
5492
5492
|
value: f.fontVariant || "normal",
|
|
5493
|
-
onChange: (
|
|
5493
|
+
onChange: (j) => n("fontVariant", j.target.value),
|
|
5494
5494
|
children: [
|
|
5495
5495
|
/* @__PURE__ */ i.jsx("option", { value: "normal", children: "Normal" }),
|
|
5496
5496
|
/* @__PURE__ */ i.jsx("option", { value: "small-caps", children: "Small Caps" })
|
|
@@ -5504,7 +5504,7 @@ const Ut = {
|
|
|
5504
5504
|
"select",
|
|
5505
5505
|
{
|
|
5506
5506
|
value: f.writingMode || "horizontal-tb",
|
|
5507
|
-
onChange: (
|
|
5507
|
+
onChange: (j) => n("writingMode", j.target.value),
|
|
5508
5508
|
children: [
|
|
5509
5509
|
/* @__PURE__ */ i.jsx("option", { value: "horizontal-tb", children: "Horizontal" }),
|
|
5510
5510
|
/* @__PURE__ */ i.jsx("option", { value: "vertical-rl", children: "Vertical Right-to-Left" }),
|
|
@@ -5543,7 +5543,7 @@ const Ut = {
|
|
|
5543
5543
|
{
|
|
5544
5544
|
type: "number",
|
|
5545
5545
|
value: f.backgroundPadding || 5,
|
|
5546
|
-
onChange: (
|
|
5546
|
+
onChange: (j) => n("backgroundPadding", parseInt(j.target.value)),
|
|
5547
5547
|
min: "0",
|
|
5548
5548
|
max: "50",
|
|
5549
5549
|
disabled: !f.hasBackground
|
|
@@ -5784,7 +5784,7 @@ const Ut = {
|
|
|
5784
5784
|
/* @__PURE__ */ i.jsx("button", { onClick: () => a(f.id, "down"), children: "Send Backward" }),
|
|
5785
5785
|
/* @__PURE__ */ i.jsx("button", { onClick: () => a(f.id, "bottom"), children: "Send to Back" })
|
|
5786
5786
|
] })
|
|
5787
|
-
] }),
|
|
5787
|
+
] }), T = [
|
|
5788
5788
|
"rectangle",
|
|
5789
5789
|
"circle",
|
|
5790
5790
|
"triangle",
|
|
@@ -5804,7 +5804,7 @@ const Ut = {
|
|
|
5804
5804
|
] }),
|
|
5805
5805
|
/* @__PURE__ */ i.jsxs("div", { className: "panel-content", children: [
|
|
5806
5806
|
f.type === "text" && c(),
|
|
5807
|
-
|
|
5807
|
+
T.includes(f.type) && F(),
|
|
5808
5808
|
f.type === "image" && I(),
|
|
5809
5809
|
f.type === "horizontalLine" && m(),
|
|
5810
5810
|
E(),
|
|
@@ -5958,10 +5958,10 @@ class ci {
|
|
|
5958
5958
|
let B = F.image || F.sectionImage;
|
|
5959
5959
|
if (n && n.sectionImage && (F.sectionName === "Front" || n.sections && Object.keys(n.sections).includes(F.sectionName)) && (B = n.sectionImage), B)
|
|
5960
5960
|
try {
|
|
5961
|
-
const
|
|
5962
|
-
await this.processImageColor(
|
|
5963
|
-
} catch (
|
|
5964
|
-
console.warn("Failed to load background image:",
|
|
5961
|
+
const T = await this.loadImage(B);
|
|
5962
|
+
await this.processImageColor(T, E.selectedColor || "#FFFFFF"), this.ctx.drawImage(this.processedImage, 0, 0, l, s);
|
|
5963
|
+
} catch (T) {
|
|
5964
|
+
console.warn("Failed to load background image:", T);
|
|
5965
5965
|
}
|
|
5966
5966
|
} else
|
|
5967
5967
|
this.ctx.clearRect(0, 0, l, s);
|
|
@@ -6324,15 +6324,15 @@ class ci {
|
|
|
6324
6324
|
async exportAllSectionsAsJSON(o, a, l, s, g = "png", h = null) {
|
|
6325
6325
|
var m, B;
|
|
6326
6326
|
const n = [], c = [], F = {};
|
|
6327
|
-
for (const
|
|
6328
|
-
const p =
|
|
6327
|
+
for (const T of a) {
|
|
6328
|
+
const p = T.sectionName, v = o[p];
|
|
6329
6329
|
if (!v || !v.elements || v.elements.length === 0) {
|
|
6330
6330
|
console.log(`Skipping section ${p} - no elements`);
|
|
6331
6331
|
continue;
|
|
6332
6332
|
}
|
|
6333
|
-
let X =
|
|
6334
|
-
h && h.sectionImage && (
|
|
6335
|
-
const
|
|
6333
|
+
let X = T.image || T.sectionImage;
|
|
6334
|
+
h && h.sectionImage && (T.sectionName === "Front" || h.sections && Object.keys(h.sections).includes(T.sectionName)) && (X = h.sectionImage);
|
|
6335
|
+
const j = {
|
|
6336
6336
|
...v,
|
|
6337
6337
|
// Include background information using the determined image
|
|
6338
6338
|
backgroundImage: X,
|
|
@@ -6344,10 +6344,10 @@ class ci {
|
|
|
6344
6344
|
canvasWidth: l,
|
|
6345
6345
|
canvasHeight: s
|
|
6346
6346
|
};
|
|
6347
|
-
F[p] =
|
|
6347
|
+
F[p] = j;
|
|
6348
6348
|
const O = await this.exportSectionAsBlob(
|
|
6349
6349
|
v,
|
|
6350
|
-
|
|
6350
|
+
T,
|
|
6351
6351
|
l,
|
|
6352
6352
|
s,
|
|
6353
6353
|
g,
|
|
@@ -6368,7 +6368,7 @@ class ci {
|
|
|
6368
6368
|
}
|
|
6369
6369
|
const k = await this.exportSectionAsBlob(
|
|
6370
6370
|
v,
|
|
6371
|
-
|
|
6371
|
+
T,
|
|
6372
6372
|
l,
|
|
6373
6373
|
s,
|
|
6374
6374
|
g,
|
|
@@ -6390,8 +6390,8 @@ class ci {
|
|
|
6390
6390
|
}
|
|
6391
6391
|
let I = ((m = a[0]) == null ? void 0 : m.image) || ((B = a[0]) == null ? void 0 : B.sectionImage);
|
|
6392
6392
|
if (h && h.sectionImage) {
|
|
6393
|
-
const
|
|
6394
|
-
|
|
6393
|
+
const T = a[0];
|
|
6394
|
+
T && (T.sectionName === "Front" || h.sections && Object.keys(h.sections).includes(T.sectionName)) && (I = h.sectionImage);
|
|
6395
6395
|
}
|
|
6396
6396
|
const E = {
|
|
6397
6397
|
sections: F,
|
|
@@ -6410,10 +6410,10 @@ class ci {
|
|
|
6410
6410
|
},
|
|
6411
6411
|
// Include product information for complete context
|
|
6412
6412
|
product: {
|
|
6413
|
-
sections: a.map((
|
|
6414
|
-
sectionName:
|
|
6415
|
-
sectionImage:
|
|
6416
|
-
id:
|
|
6413
|
+
sections: a.map((T) => ({
|
|
6414
|
+
sectionName: T.sectionName || T.id,
|
|
6415
|
+
sectionImage: T.image || T.sectionImage,
|
|
6416
|
+
id: T.id || T.sectionName
|
|
6417
6417
|
}))
|
|
6418
6418
|
}
|
|
6419
6419
|
};
|
|
@@ -6447,9 +6447,9 @@ class ci {
|
|
|
6447
6447
|
}
|
|
6448
6448
|
}
|
|
6449
6449
|
async exportCurrentSectionAsJSON(o, a = "png", l = null) {
|
|
6450
|
-
var B,
|
|
6450
|
+
var B, T, p;
|
|
6451
6451
|
const s = ((B = o.activeSection) == null ? void 0 : B.sectionName) || "main";
|
|
6452
|
-
let g = ((
|
|
6452
|
+
let g = ((T = o.activeSection) == null ? void 0 : T.sectionImage) || ((p = o.activeSection) == null ? void 0 : p.image);
|
|
6453
6453
|
l && l.sectionImage && (s === "Front" || l.sections && Object.keys(l.sections).includes(s)) && (g = l.sectionImage);
|
|
6454
6454
|
const h = {
|
|
6455
6455
|
elements: o.elements,
|
|
@@ -6764,7 +6764,7 @@ const fi = $e((f, o) => {
|
|
|
6764
6764
|
]
|
|
6765
6765
|
},
|
|
6766
6766
|
initFile: g
|
|
6767
|
-
} = f, [h, n] = N([]), [c, F] = N(null), [I, E] = N(!1), [m, B] = N(!1), [
|
|
6767
|
+
} = f, [h, n] = N([]), [c, F] = N(null), [I, E] = N(!1), [m, B] = N(!1), [T, p] = N(!1), [v, X] = N({ x: 0, y: 0 }), [j, O] = N(null), [k, Z] = N(800), [W, xt] = N(600), [Q, ft] = N(1), [_, st] = N(s.colorSettings[0]), [M, nt] = N(!1), [tt, ct] = N(!0), [Y, P] = N(!0), [C, et] = N(s.sections[0]), [y, D] = N(!1), [L, H] = N({}), [G, it] = N([]), [J, q] = N(-1), [U] = N(new di("localStorage")), K = gt(null), kt = gt(null), pt = gt(null), wt = gt(null), Ot = gt(null), Bt = gt(new ci()), zt = gt(!1), [yt, ce] = N(null), lt = at(() => {
|
|
6768
6768
|
const e = {
|
|
6769
6769
|
elements: JSON.parse(JSON.stringify(h)),
|
|
6770
6770
|
selectedElement: c ? { ...c } : null,
|
|
@@ -7346,10 +7346,10 @@ const fi = $e((f, o) => {
|
|
|
7346
7346
|
const d = r.x + r.width / 2, x = r.y + r.height / 2, u = e - d, w = t - x, S = -(r.rotation || 0) * Math.PI / 180, b = Math.cos(S), R = Math.sin(S), A = u * b - w * R, z = u * R + w * b, $ = r.width / 2, dt = r.height / 2;
|
|
7347
7347
|
return A >= -$ && A <= $ && z >= -dt && z <= dt;
|
|
7348
7348
|
}, Be = at(() => {
|
|
7349
|
-
(I || m ||
|
|
7349
|
+
(I || m || T) && lt(), E(!1), B(!1), p(!1), O(null);
|
|
7350
7350
|
const e = K.current;
|
|
7351
7351
|
e && (e.style.cursor = "default");
|
|
7352
|
-
}, [I, m,
|
|
7352
|
+
}, [I, m, T, lt]);
|
|
7353
7353
|
rt(() => {
|
|
7354
7354
|
const e = (t) => {
|
|
7355
7355
|
if (l) return;
|
|
@@ -7537,11 +7537,11 @@ const fi = $e((f, o) => {
|
|
|
7537
7537
|
mt.current && cancelAnimationFrame(mt.current);
|
|
7538
7538
|
}, []);
|
|
7539
7539
|
const Pt = at(() => {
|
|
7540
|
-
V(), (I || m ||
|
|
7541
|
-
}, [V, I, m,
|
|
7540
|
+
V(), (I || m || T) && (mt.current = requestAnimationFrame(Pt));
|
|
7541
|
+
}, [V, I, m, T]);
|
|
7542
7542
|
rt(() => {
|
|
7543
|
-
I || m ||
|
|
7544
|
-
}, [I, m,
|
|
7543
|
+
I || m || T ? Pt() : (mt.current && (cancelAnimationFrame(mt.current), mt.current = null), vt());
|
|
7544
|
+
}, [I, m, T, Pt, vt]);
|
|
7545
7545
|
const Me = at((e) => {
|
|
7546
7546
|
if (l) return;
|
|
7547
7547
|
const r = K.current.getBoundingClientRect(), d = (e.clientX - r.left) / Q, x = (e.clientY - r.top) / Q;
|
|
@@ -7584,12 +7584,12 @@ const fi = $e((f, o) => {
|
|
|
7584
7584
|
}, [l, Q, c, h, V]), Le = at((e) => {
|
|
7585
7585
|
if (l) return;
|
|
7586
7586
|
const t = K.current, r = t.getBoundingClientRect(), d = (e.clientX - r.left) / Q, x = (e.clientY - r.top) / Q;
|
|
7587
|
-
if (c && !I && !m && !
|
|
7587
|
+
if (c && !I && !m && !T) {
|
|
7588
7588
|
const u = $t(d, x, c);
|
|
7589
7589
|
u ? u === "rotate" ? t.style.cursor = "grab" : t.style.cursor = u : Ht(d, x, c) ? t.style.cursor = "move" : t.style.cursor = "default";
|
|
7590
7590
|
} else
|
|
7591
7591
|
t.style.cursor = I ? "grabbing" : "default";
|
|
7592
|
-
if (
|
|
7592
|
+
if (T && c) {
|
|
7593
7593
|
const u = c.x + c.width / 2, w = c.y + c.height / 2, b = Math.atan2(x - w, d - u) * 180 / Math.PI - v.initialAngle;
|
|
7594
7594
|
let R = v.initialRotation + b;
|
|
7595
7595
|
e.shiftKey && (R = Math.round(R / 15) * 15), R = (R % 360 + 360) % 360, n(
|
|
@@ -7599,10 +7599,10 @@ const fi = $e((f, o) => {
|
|
|
7599
7599
|
), F((A) => ({ ...A, rotation: R })), V();
|
|
7600
7600
|
return;
|
|
7601
7601
|
}
|
|
7602
|
-
if (m && c &&
|
|
7602
|
+
if (m && c && j) {
|
|
7603
7603
|
const u = d - v.x, w = x - v.y;
|
|
7604
7604
|
let S = v.initialWidth, b = v.initialHeight, R = v.initialX, A = v.initialY;
|
|
7605
|
-
switch (
|
|
7605
|
+
switch (j) {
|
|
7606
7606
|
case "se-resize":
|
|
7607
7607
|
S = Math.max(20, v.initialWidth + u), b = Math.max(20, v.initialHeight + w);
|
|
7608
7608
|
break;
|
|
@@ -7618,7 +7618,7 @@ const fi = $e((f, o) => {
|
|
|
7618
7618
|
}
|
|
7619
7619
|
if (e.shiftKey && c.type !== "text") {
|
|
7620
7620
|
const $ = v.initialWidth / v.initialHeight;
|
|
7621
|
-
|
|
7621
|
+
j.includes("e"), b = S / $, j.includes("n") && (A = v.initialY + (v.initialHeight - b));
|
|
7622
7622
|
}
|
|
7623
7623
|
Y && (R = ut(R), A = ut(A), S = ut(S), b = ut(b));
|
|
7624
7624
|
const z = {
|
|
@@ -7649,7 +7649,7 @@ const fi = $e((f, o) => {
|
|
|
7649
7649
|
)
|
|
7650
7650
|
), F(S), V();
|
|
7651
7651
|
}
|
|
7652
|
-
}, [l, Q, c, I, m,
|
|
7652
|
+
}, [l, Q, c, I, m, T, j, v, Y, k, W, h, V]), qt = at((e) => {
|
|
7653
7653
|
C && H((r) => ({
|
|
7654
7654
|
...r,
|
|
7655
7655
|
[C.sectionName]: {
|