@yorab/react-paint 0.11.4 → 0.11.5
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/README.md +382 -382
- package/dist/react-paint.js +88 -88
- package/dist/react-paint.umd.cjs +1 -1
- package/package.json +2 -1
- package/dist/canvas/utils/string.d.ts +0 -2
package/dist/react-paint.js
CHANGED
|
@@ -50,8 +50,8 @@ const Ii = '<svg><path d="M5.146 17.5Q4.146 17.5 3.208 17Q2.271 16.5 1.667 15.70
|
|
|
50
50
|
if (c.length === 1) d.rect(...Qe(c[0], l, h, n.scaleX, n.scaleY), 1, 1);
|
|
51
51
|
else if (d.moveTo(...Qe(c[0], l, h, n.scaleX, n.scaleY)), s === "quadratic") {
|
|
52
52
|
for (let u = 0; u < c.slice(1).length - 2; u++) {
|
|
53
|
-
const g = Qe(c[u], l, h, n.scaleX, n.scaleY), f = Qe(c[u + 1], l, h, n.scaleX, n.scaleY),
|
|
54
|
-
d.quadraticCurveTo(...g,
|
|
53
|
+
const g = Qe(c[u], l, h, n.scaleX, n.scaleY), f = Qe(c[u + 1], l, h, n.scaleX, n.scaleY), x = (g[0] + f[0]) / 2, w = (g[1] + f[1]) / 2;
|
|
54
|
+
d.quadraticCurveTo(...g, x, w);
|
|
55
55
|
}
|
|
56
56
|
d.quadraticCurveTo(...Qe(c[c.length - 2], l, h, n.scaleX, n.scaleY), ...Qe(c[c.length - 1], l, h, n.scaleX, n.scaleY));
|
|
57
57
|
} else for (const u of c.slice(1)) d.lineTo(...Qe(u, l, h, n.scaleX, n.scaleY));
|
|
@@ -120,16 +120,16 @@ const Ii = '<svg><path d="M5.146 17.5Q4.146 17.5 3.208 17Q2.271 16.5 1.667 15.70
|
|
|
120
120
|
const r = [e + i / 2 - s[0], t + n / 2 - s[1]], [o, l] = ve({ point: r, rotation: -a.rotation });
|
|
121
121
|
return { borderX: De(e + o - r[0]), borderWidth: De(i), borderY: De(t + l - r[1]), borderHeight: De(n) };
|
|
122
122
|
}, Be = (e, i, t, n, s = !1) => {
|
|
123
|
-
const { center: a, borders: r } = _(i, n), o = ve({ origin: a, point: e, rotation: i.rotation }), l = t.anchor[0] === 0 && o[0] >= r.x + r.width || t.anchor[0] === 1 && o[0] <= r.x, h = t.anchor[1] === 0 && o[1] >= r.y + r.height || t.anchor[1] === 1 && o[1] <= r.y, d = [O(o[0], n, t.anchor[0] === 0 && !l || t.anchor[0] === 1 && l ? n.selectionPadding : -n.selectionPadding), O(o[1], n, t.anchor[1] === 0 && !h || t.anchor[1] === 1 && h ? n.selectionPadding : -n.selectionPadding)], c = n.gridGap ? [t.anchor[0] === 0 ? r.x : t.anchor[0] === 0.5 ? r.x + r.width / 2 : r.x + r.width, t.anchor[1] === 0 ? r.y : t.anchor[1] === 0.5 ? r.y + r.height / 2 : r.y + r.height] : ve({ origin: a, point: t.cursorStartPosition, rotation: i.rotation }), u = [d[0] - c[0], d[1] - c[1]], [g, f] = di({ borderStart: r.x, borderSize: r.width, vector: u[0], settings: n, invertedAxe: l, anchor: t.anchor[0] }), [
|
|
123
|
+
const { center: a, borders: r } = _(i, n), o = ve({ origin: a, point: e, rotation: i.rotation }), l = t.anchor[0] === 0 && o[0] >= r.x + r.width || t.anchor[0] === 1 && o[0] <= r.x, h = t.anchor[1] === 0 && o[1] >= r.y + r.height || t.anchor[1] === 1 && o[1] <= r.y, d = [O(o[0], n, t.anchor[0] === 0 && !l || t.anchor[0] === 1 && l ? n.selectionPadding : -n.selectionPadding), O(o[1], n, t.anchor[1] === 0 && !h || t.anchor[1] === 1 && h ? n.selectionPadding : -n.selectionPadding)], c = n.gridGap ? [t.anchor[0] === 0 ? r.x : t.anchor[0] === 0.5 ? r.x + r.width / 2 : r.x + r.width, t.anchor[1] === 0 ? r.y : t.anchor[1] === 0.5 ? r.y + r.height / 2 : r.y + r.height] : ve({ origin: a, point: t.cursorStartPosition, rotation: i.rotation }), u = [d[0] - c[0], d[1] - c[1]], [g, f] = di({ borderStart: r.x, borderSize: r.width, vector: u[0], settings: n, invertedAxe: l, anchor: t.anchor[0] }), [x, w] = di({ borderStart: r.y, borderSize: r.height, vector: u[1], settings: n, invertedAxe: h, anchor: t.anchor[1] });
|
|
124
124
|
if (s) {
|
|
125
125
|
const S = ((L, b, k, P, E, H, T, C, V, W) => {
|
|
126
126
|
const { selectionPadding: y } = W, N = (b.width - 2 * y || 1) / (b.height - 2 * y || 1), M = (E - 2 * y) / (T - 2 * y);
|
|
127
127
|
let A, Z, v, m;
|
|
128
128
|
return V.anchor[0] !== 0.5 && V.anchor[1] !== 0.5 ? M < N ? (Z = H, m = T, v = (T - 2 * y) * N + 2 * y, A = V.anchor[0] === 0 ? b.width - L[0] > y ? b.x + (b.width - v) : b.x + b.width - 2 * y : b.width + L[0] > y ? b.x : b.x - v + 2 * y) : (A = P, v = E, m = (E - 2 * y) / N + 2 * y, Z = V.anchor[1] === 0 ? b.height - L[1] > y ? b.y + (b.height - m) : b.y + b.height - 2 * y : b.height + L[1] > y ? b.y : b.y - m + 2 * y) : V.anchor[0] !== 0.5 ? (A = P, v = E, m = (E - 2 * y) / N + 2 * y, Z = b.y + (b.height - m) / 2) : (Z = H, m = T, v = (T - 2 * y) * N + 2 * y, A = b.x + (b.width - v) / 2), { borderX: A, borderWidth: v, borderY: Z, borderHeight: m, center: k, originalShape: C };
|
|
129
|
-
})(u, r, a, g, f,
|
|
129
|
+
})(u, r, a, g, f, x, w, i, t, n);
|
|
130
130
|
return ci(S);
|
|
131
131
|
}
|
|
132
|
-
return ci({ borderX: g, borderWidth: f, borderY:
|
|
132
|
+
return ci({ borderX: g, borderWidth: f, borderY: x, borderHeight: w, center: a, originalShape: i });
|
|
133
133
|
}, ft = (e, i) => {
|
|
134
134
|
const t = vt(e);
|
|
135
135
|
return { ...e, path: t, selection: Je(t, e, i) };
|
|
@@ -243,8 +243,8 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
243
243
|
const f = u1(g);
|
|
244
244
|
o.onload = async () => {
|
|
245
245
|
URL.revokeObjectURL(o.src);
|
|
246
|
-
const
|
|
247
|
-
l(
|
|
246
|
+
const x = Ht(o, g, d, c, u);
|
|
247
|
+
l(x);
|
|
248
248
|
}, o.src = f;
|
|
249
249
|
}) : (o.onload = async () => {
|
|
250
250
|
URL.revokeObjectURL(o.src);
|
|
@@ -267,9 +267,9 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
267
267
|
const r = i.map((o) => t / e.measureText(o).width);
|
|
268
268
|
return Math.min(...r) || 36;
|
|
269
269
|
}, I1 = (e, i, t, n) => {
|
|
270
|
-
const s = { ...i, value: t }, a = ((f,
|
|
271
|
-
f.font = `${L ? "italic" : ""} ${S ? "bold" : ""} ${
|
|
272
|
-
const k =
|
|
270
|
+
const s = { ...i, value: t }, a = ((f, x, w, S, L, b = rt) => {
|
|
271
|
+
f.font = `${L ? "italic" : ""} ${S ? "bold" : ""} ${w}px ${b}`;
|
|
272
|
+
const k = x.map((P) => f.measureText(P).width);
|
|
273
273
|
return Math.max(...k) || 20;
|
|
274
274
|
})(e, s.value, s.fontSize, s.style?.fontBold ?? !1, s.style?.fontItalic ?? !1, s.style?.fontFamily), r = s.fontSize * s.value.length, o = { ...s, width: a, height: r }, { center: l } = _(i, n), { center: h } = _(o, n), [d, c] = mi([1, 1], l, i, n), [u, g] = mi([1, 1], h, o, n, [!1, !1]);
|
|
275
275
|
return { ...o, x: o.x - (u - d), y: o.y - (g - c) };
|
|
@@ -410,9 +410,9 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
410
410
|
})(t, n, s, a);
|
|
411
411
|
case "brush":
|
|
412
412
|
return ((o, l, h, d, c) => {
|
|
413
|
-
const { borders: u } = _({ ...l, scaleX: 1, scaleY: 1 }, d), { borders: g } = _(l, d), { borderX: f, borderHeight:
|
|
413
|
+
const { borders: u } = _({ ...l, scaleX: 1, scaleY: 1 }, d), { borders: g } = _(l, d), { borderX: f, borderHeight: x, borderY: w, borderWidth: S } = Be(o, l, h, d, c), L = Math.max(0, u.width - 2 * d.selectionPadding), b = Math.max(0, u.height - 2 * d.selectionPadding), k = Math.max(0, S - 2 * d.selectionPadding), P = Math.max(0, x - 2 * d.selectionPadding), E = L ? k / L : 1, H = b ? P / b : 1;
|
|
414
414
|
if (!L || !b) return l;
|
|
415
|
-
const T = De(f - g.x), C = De(
|
|
415
|
+
const T = De(f - g.x), C = De(w - g.y);
|
|
416
416
|
return qe({ ...l, points: l.points.map((V) => V.map(([W, y]) => [W + T, y + C])), scaleX: E, scaleY: H }, d);
|
|
417
417
|
})(t, n, s, a, r);
|
|
418
418
|
case "circle":
|
|
@@ -422,24 +422,24 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
422
422
|
})(t, n, s, a);
|
|
423
423
|
case "ellipse":
|
|
424
424
|
return ((o, l, h, d, c = !1) => {
|
|
425
|
-
const { borderX: u, borderHeight: g, borderY: f, borderWidth:
|
|
426
|
-
return mt({ ...l, radiusX: Math.max(0,
|
|
425
|
+
const { borderX: u, borderHeight: g, borderY: f, borderWidth: x } = Be(o, l, h, d, c);
|
|
426
|
+
return mt({ ...l, radiusX: Math.max(0, x / 2 - d.selectionPadding), radiusY: Math.max(0, g / 2 - d.selectionPadding), x: u + x / 2, y: f + g / 2 }, d);
|
|
427
427
|
})(t, n, s, a, r);
|
|
428
428
|
case "rect":
|
|
429
429
|
case "square":
|
|
430
430
|
return ((o, l, h, d, c = !1) => {
|
|
431
|
-
const { borderX: u, borderHeight: g, borderY: f, borderWidth:
|
|
432
|
-
return Qt({ ...l, width: Math.max(0,
|
|
431
|
+
const { borderX: u, borderHeight: g, borderY: f, borderWidth: x } = Be(o, l, h, d, c);
|
|
432
|
+
return Qt({ ...l, width: Math.max(0, x - 2 * d.selectionPadding), height: Math.max(0, g - 2 * d.selectionPadding), x: u + d.selectionPadding, y: f + d.selectionPadding }, d);
|
|
433
433
|
})(t, n, s, a, i.type === "square" || r);
|
|
434
434
|
case "text":
|
|
435
435
|
return ((o, l, h, d, c) => {
|
|
436
|
-
const { borderX: u, borderHeight: g, borderY: f, borderWidth:
|
|
437
|
-
return { ...
|
|
436
|
+
const { borderX: u, borderHeight: g, borderY: f, borderWidth: x } = Be(l, h, d, c, !0), w = bt({ ...h, width: Math.max(0, x - 2 * c.selectionPadding), height: Math.max(0, g - 2 * c.selectionPadding), x: u + c.selectionPadding, y: f + c.selectionPadding }, c);
|
|
437
|
+
return { ...w, fontSize: Gt(o, w.value, w.width, w.style?.fontBold ?? !1, w.style?.fontItalic ?? !1, w.style?.fontFamily) };
|
|
438
438
|
})(e, t, n, s, a);
|
|
439
439
|
case "picture":
|
|
440
|
-
return ((o, l, h, d
|
|
441
|
-
const { borderX:
|
|
442
|
-
return St({ ...l, width: Math.max(0,
|
|
440
|
+
return ((o, l, h, d) => {
|
|
441
|
+
const { borderX: c, borderHeight: u, borderY: g, borderWidth: f } = Be(o, l, h, d, !0);
|
|
442
|
+
return St({ ...l, width: Math.max(0, f - 2 * d.selectionPadding), height: Math.max(0, u - 2 * d.selectionPadding), x: c + d.selectionPadding, y: g + d.selectionPadding }, d);
|
|
443
443
|
})(t, n, s, a);
|
|
444
444
|
default:
|
|
445
445
|
return n;
|
|
@@ -566,7 +566,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
566
566
|
const i = ["img", "id", "selection", "path", "arrows"];
|
|
567
567
|
return e.map((t) => t.type !== "picture" || t.src.startsWith("http") ? Zt(i, t) : Zt(i, { ...t, src: U1(t) }));
|
|
568
568
|
}, Xt = (e, i, t) => ({ shapes: G1(e), config: { width: i, height: t } }), Ci = (e, i) => ot({ ...e, id: oe(`${e.type}_`) }, i), X1 = (e, i, t) => {
|
|
569
|
-
const n = q([]), s = q({ dataChanged: [] }), [a, r] = z(void 0), [o, l] = z(void 0), [h, d] = z(void 0), [c, u] = z({ states: [{ shapes: [], selectedShape: void 0, source: "remote" }], cursor: 0 }), g = c.cursor > 0, f = c.cursor < c.states.length - 1,
|
|
569
|
+
const n = q([]), s = q({ dataChanged: [] }), [a, r] = z(void 0), [o, l] = z(void 0), [h, d] = z(void 0), [c, u] = z({ states: [{ shapes: [], selectedShape: void 0, source: "remote" }], cursor: 0 }), g = c.cursor > 0, f = c.cursor < c.states.length - 1, x = n.current.length > 0, w = F(() => {
|
|
570
570
|
u((v) => r1(v.states[v.cursor].shapes, n.current) ? v : { states: [...v.states.slice(0, v.cursor + 1), { shapes: n.current, selectedShape: o, source: "user" }], cursor: v.cursor + 1 });
|
|
571
571
|
}, [o]), S = F((v) => {
|
|
572
572
|
n.current = [v, ...n.current];
|
|
@@ -576,15 +576,15 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
576
576
|
d(D);
|
|
577
577
|
}, [e, o]), b = F(async (v, m = 300, Q = 300) => {
|
|
578
578
|
const D = await N1(v, m, Q, e);
|
|
579
|
-
return S(D),
|
|
580
|
-
}, [S,
|
|
581
|
-
n.current = n.current.map((Q) => Q.id === o?.id ? v : Q), l((Q) => Q?.id === v.id ? v : Q), m &&
|
|
582
|
-
}, [o,
|
|
579
|
+
return S(D), w(), D;
|
|
580
|
+
}, [S, w, e]), k = F((v, m = !1) => {
|
|
581
|
+
n.current = n.current.map((Q) => Q.id === o?.id ? v : Q), l((Q) => Q?.id === v.id ? v : Q), m && w();
|
|
582
|
+
}, [o, w]), P = F((v) => {
|
|
583
583
|
const m = v.map((Q) => Zt(["chosen"], Q));
|
|
584
|
-
n.current = m,
|
|
585
|
-
}, [
|
|
586
|
-
l((m) => m?.id === v.id ? void 0 : m), n.current = n.current.filter((m) => m.id !== v.id),
|
|
587
|
-
}, [
|
|
584
|
+
n.current = m, w();
|
|
585
|
+
}, [w]), E = F((v) => {
|
|
586
|
+
l((m) => m?.id === v.id ? void 0 : m), n.current = n.current.filter((m) => m.id !== v.id), w();
|
|
587
|
+
}, [w]), H = F((v) => {
|
|
588
588
|
u((m) => {
|
|
589
589
|
const Q = v(m);
|
|
590
590
|
return n.current = m.states[Q].shapes, l(m.states[Q].selectedShape), le("cursor", Q, m);
|
|
@@ -652,7 +652,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
652
652
|
return l(R?.[0]), D;
|
|
653
653
|
});
|
|
654
654
|
}, [e]);
|
|
655
|
-
return { registerEvent: M, unregisterEvent: A, shapesRef: n, selectedShape: o, hoveredShape: h, selectionFrame: a, setSelectionFrame: r, refreshSelectedShapes: Z, addShape: S, addPictureShape: b, moveShapes: W, saveShapes:
|
|
655
|
+
return { registerEvent: M, unregisterEvent: A, shapesRef: n, selectedShape: o, hoveredShape: h, selectionFrame: a, setSelectionFrame: r, refreshSelectedShapes: Z, addShape: S, addPictureShape: b, moveShapes: W, saveShapes: w, setSelectedShape: l, refreshHoveredShape: L, toggleShapeVisibility: y, toggleShapeLock: N, removeShape: E, updateShape: k, backwardShape: T, forwardShape: C, clearShapes: V, canGoBackward: g, canGoForward: f, canClear: x };
|
|
656
656
|
}, wi = (e, i = !1) => {
|
|
657
657
|
const t = (s, a) => {
|
|
658
658
|
if (Array.isArray(s)) return a;
|
|
@@ -682,9 +682,9 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
682
682
|
});
|
|
683
683
|
return $t(i ? [...n, Ot] : n);
|
|
684
684
|
}, Tn = ({ width: e = 1e3, height: i = 600, shapes: t, mode: n = "editor", disabled: s = !1, options: a = oi }) => {
|
|
685
|
-
const { layersManipulation: r, brushAlgo: o, isBrushShapeDoneOnMouseUp: l, grid: h, canGrow: d, canShrink: c, withExport: u, withLoadAndSave: g, withUploadPicture: f, withUrlPicture:
|
|
685
|
+
const { layersManipulation: r, brushAlgo: o, isBrushShapeDoneOnMouseUp: l, grid: h, canGrow: d, canShrink: c, withExport: u, withLoadAndSave: g, withUploadPicture: f, withUrlPicture: x, withSkeleton: w, withFrameSelection: S, clearCallback: L, availableTools: b, canvasSelectionPadding: k } = { ...oi, ...a }, P = n !== "viewer", E = s || !P, H = q(null), T = q(null), C = q(!1), V = F((Y) => {
|
|
686
686
|
H.current = Y;
|
|
687
|
-
}, []), [W, y] = z(Ae), [N, M] = z(h), [A, Z] = z({ width: e, height: i, scaleRatio: 1 }), [v, m] = z([0, 0]), Q = Ni(() => ({ brushAlgo: o, isBrushShapeDoneOnMouseUp: l, canvasSize: A, canvasOffset: v, gridGap: N, selectionPadding: k }), [k, N, o, l, v, A]), [D, R] = z(wi(b, f ||
|
|
687
|
+
}, []), [W, y] = z(Ae), [N, M] = z(h), [A, Z] = z({ width: e, height: i, scaleRatio: 1 }), [v, m] = z([0, 0]), Q = Ni(() => ({ brushAlgo: o, isBrushShapeDoneOnMouseUp: l, canvasSize: A, canvasOffset: v, gridGap: N, selectionPadding: k }), [k, N, o, l, v, A]), [D, R] = z(wi(b, f || x)), { isInsideComponent: X } = (({ disabled: Y, componentRef: Ce }) => {
|
|
688
688
|
const [it, Ie] = z(!1);
|
|
689
689
|
return B(() => {
|
|
690
690
|
if (!Y) {
|
|
@@ -749,7 +749,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
749
749
|
const Re = F((Y = [], Ce = !0) => {
|
|
750
750
|
et.current?.(Y, { clearHistory: Ce, source: "remote" });
|
|
751
751
|
}, []);
|
|
752
|
-
C.current || (C.current = !0, t && K(t, { clearHistory: !0, source: "remote" }));
|
|
752
|
+
C.current || typeof Image > "u" || (C.current = !0, t && K(t, { clearHistory: !0, source: "remote" }));
|
|
753
753
|
const tt = F(async (Y) => {
|
|
754
754
|
const Ce = await (async (it) => new Promise((Ie, He) => {
|
|
755
755
|
const We = new FileReader();
|
|
@@ -765,10 +765,10 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
765
765
|
typeof L != "string" ? K(L(), { clearHistory: !1, source: "user" }) : L === "defaultShapes" && t !== void 0 ? K(t, { clearHistory: !1, source: "user" }) : Ue([], { clearHistory: !1, source: "user" });
|
|
766
766
|
}, [Ue, K, t, L]);
|
|
767
767
|
B(() => {
|
|
768
|
-
R(wi(b, f ||
|
|
769
|
-
}, [b, f,
|
|
768
|
+
R(wi(b, f || x));
|
|
769
|
+
}, [b, f, x]);
|
|
770
770
|
const _t = { canvas: T, editor: H, setEditor: V };
|
|
771
|
-
return { editorProps: { shapesRef: U, addPictureShape: Me, moveShapes: ne, toggleShapeVisibility: he, toggleShapeLock: ye, canGoBackward: ae, canGoForward: Ve, canClear: $e, selectedShape: re, removeShape: me, updateShape: be, backwardShape: Ee, forwardShape: se, refs: _t, width: e, height: i, canvasSize: A, selectTool: Pe, selectShape: lt, activeTool: W, setActiveTool: y, setAvailableTools: R, isEditMode: P, isDisabled: E, availableTools: D, gridGap: N, setGridGap: M, loadFile: tt, exportPicture: wt, exportData: Ct, clearCanvas: f1, settings: Q, canvas: { canGrow: d, canShrink: c, layersManipulation: r, withExport: u, withLoadAndSave: g, withUploadPicture: f, withUrlPicture:
|
|
771
|
+
return { editorProps: { shapesRef: U, addPictureShape: Me, moveShapes: ne, toggleShapeVisibility: he, toggleShapeLock: ye, canGoBackward: ae, canGoForward: Ve, canClear: $e, selectedShape: re, removeShape: me, updateShape: be, backwardShape: Ee, forwardShape: se, refs: _t, width: e, height: i, canvasSize: A, selectTool: Pe, selectShape: lt, activeTool: W, setActiveTool: y, setAvailableTools: R, isEditMode: P, isDisabled: E, availableTools: D, gridGap: N, setGridGap: M, loadFile: tt, exportPicture: wt, exportData: Ct, clearCanvas: f1, settings: Q, canvas: { canGrow: d, canShrink: c, layersManipulation: r, withExport: u, withLoadAndSave: g, withUploadPicture: f, withUrlPicture: x } }, canvasProps: { shapesRef: U, selectedShape: re, selectionFrame: te, hoveredShape: ie, addShape: fe, setSelectedShape: j, setSelectionFrame: Se, refreshSelectedShapes: Ze, refreshHoveredShape: ke, removeShape: me, updateShape: be, backwardShape: Ee, forwardShape: se, saveShapes: Ne, refs: _t, width: e, height: i, settings: Q, canvasSize: A, setCanvasSize: Z, setCanvasOffset: m, selectShape: lt, activeTool: W, setActiveTool: y, isInsideComponent: X, isEditMode: P, isDisabled: E, canvas: { withSkeleton: w, withFrameSelection: S, canGrow: d, canShrink: c } }, registerEvent: ce, unregisterEvent: $, resetCanvas: Re, getCurrentImage: xt, getCurrentData: J };
|
|
772
772
|
}, Y1 = (e, i, t, n, s, a, r) => {
|
|
773
773
|
let o = !1;
|
|
774
774
|
if (s) {
|
|
@@ -785,7 +785,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
785
785
|
}
|
|
786
786
|
const l = i.find((h) => h.id === s?.id ? !!o : !!c1(e, h, t, n));
|
|
787
787
|
return l ? { shape: l, mode: { mode: "translate", cursorStartPosition: t, originalShape: l } } : { shape: void 0, mode: { mode: r ? "selectionFrame" : "default" } };
|
|
788
|
-
}, j1 = ({ disabled: e = !1, addShape: i, drawCanvasRef: t, setActiveTool: n, refreshHoveredShape: s, shapes: a, selectionMode: r, activeTool: o, isInsideComponent: l, setCanvasOffset: h, selectedShape: d, selectionCanvasRef: c, canvasOffsetStartPosition: u, refreshSelectedShapes: g, setSelectedShape: f, setSelectionFrame:
|
|
788
|
+
}, j1 = ({ disabled: e = !1, addShape: i, drawCanvasRef: t, setActiveTool: n, refreshHoveredShape: s, shapes: a, selectionMode: r, activeTool: o, isInsideComponent: l, setCanvasOffset: h, selectedShape: d, selectionCanvasRef: c, canvasOffsetStartPosition: u, refreshSelectedShapes: g, setSelectedShape: f, setSelectionFrame: x, setCanvasOffsetStartPosition: w, updateSingleShape: S, saveShapes: L, setSelectionMode: b, settings: k, isShiftPressed: P, withFrameSelection: E }) => {
|
|
789
789
|
const [H, T] = z({ mode: "default" }), { registerDoubleClickEvent: C, unRegisterDoubleClickEvent: V } = (() => {
|
|
790
790
|
const y = q(void 0), N = q(void 0), M = (A) => {
|
|
791
791
|
const Z = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -819,12 +819,12 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
819
819
|
const { isBrushShapeDoneOnMouseUp: W } = k;
|
|
820
820
|
return B(() => {
|
|
821
821
|
const y = () => {
|
|
822
|
-
r.mode !== "textedition" && r.mode !== "default" && (r.mode === "brush" && W && f(void 0), b({ mode: "default" }),
|
|
822
|
+
r.mode !== "textedition" && r.mode !== "default" && (r.mode === "brush" && W && f(void 0), b({ mode: "default" }), x(void 0), L());
|
|
823
823
|
};
|
|
824
824
|
return l && (document.addEventListener("mouseup", y), document.addEventListener("touchend", y)), () => {
|
|
825
825
|
l && (document.removeEventListener("mouseup", y), document.removeEventListener("touchend", y));
|
|
826
826
|
};
|
|
827
|
-
}, [l, r, W, L,
|
|
827
|
+
}, [l, r, W, L, x, b, f]), B(() => {
|
|
828
828
|
const y = c.current;
|
|
829
829
|
if (!y) return;
|
|
830
830
|
const N = y.getContext("2d");
|
|
@@ -834,8 +834,8 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
834
834
|
const Z = Pt(A, c.current, k);
|
|
835
835
|
if (o.type === "selection") {
|
|
836
836
|
const { shape: v, mode: m } = Y1(N, a, Z, k, d, hi(A), E);
|
|
837
|
-
f(v), b(m), m.mode === "selectionFrame" &&
|
|
838
|
-
} else if (o.type === "move")
|
|
837
|
+
f(v), b(m), m.mode === "selectionFrame" && x([[Z[0], Z[1]], [Z[0], Z[1]]]);
|
|
838
|
+
} else if (o.type === "move") w(Z);
|
|
839
839
|
else if (n1.some((v) => v === o.type)) {
|
|
840
840
|
const v = t.current?.getContext("2d");
|
|
841
841
|
if (!v) return;
|
|
@@ -861,7 +861,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
861
861
|
return y.addEventListener("mousedown", M, { passive: !1 }), y.addEventListener("touchstart", M, { passive: !1 }), () => {
|
|
862
862
|
y.removeEventListener("mousedown", M), y.removeEventListener("touchstart", M);
|
|
863
863
|
};
|
|
864
|
-
}, [e, c, t, d, o,
|
|
864
|
+
}, [e, c, t, d, o, w, a, S, i, n, f, b, x, k, E]), B(() => {
|
|
865
865
|
const y = c.current;
|
|
866
866
|
if (y)
|
|
867
867
|
return l ? (C(y, (N) => {
|
|
@@ -909,16 +909,16 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
909
909
|
e.clearRect(0, 0, a, r), l1(e), t.gridGap && ((o, l, h, d) => {
|
|
910
910
|
const { gridGap: c, canvasOffset: u, canvasSize: { scaleRatio: g } } = d;
|
|
911
911
|
o.strokeStyle = "rgb(220,220,220)", o.lineWidth = 1, o.save(), o.scale(g, g), o.beginPath();
|
|
912
|
-
const f = -u[0] % c,
|
|
913
|
-
for (let L = 0; L <
|
|
914
|
-
for (let L = 0; L < S; L++) o.moveTo(f,
|
|
912
|
+
const f = -u[0] % c, x = -u[1] % c, w = Math.ceil(l / g / c), S = Math.ceil(h / g / c);
|
|
913
|
+
for (let L = 0; L < w; L++) o.moveTo(f + (L + 1) * c, x), o.lineTo(f + (L + 1) * c, x + h / g);
|
|
914
|
+
for (let L = 0; L < S; L++) o.moveTo(f, x + (L + 1) * c), o.lineTo(f + l / g, x + (L + 1) * c);
|
|
915
915
|
o.stroke(), o.restore();
|
|
916
916
|
})(e, a, r, t);
|
|
917
917
|
for (let o = n.length - 1; o >= 0; o--) i.mode === "textedition" && n[o] === s || p1(e, n[o], t);
|
|
918
|
-
}, J1 = Fi.forwardRef(({ canGrow: e, disabled: i = !1, canvasSize: t, shapes: n, addShape: s, updateSingleShape: a, selectedShape: r, setSelectedShape: o, setSelectionFrame: l, hoveredShape: h, selectionFrame: d, refreshHoveredShape: c, refreshSelectedShapes: u, saveShapes: g, activeTool: f, setActiveTool:
|
|
918
|
+
}, J1 = Fi.forwardRef(({ canGrow: e, disabled: i = !1, canvasSize: t, shapes: n, addShape: s, updateSingleShape: a, selectedShape: r, setSelectedShape: o, setSelectionFrame: l, hoveredShape: h, selectionFrame: d, refreshHoveredShape: c, refreshSelectedShapes: u, saveShapes: g, activeTool: f, setActiveTool: x, canvasOffsetStartPosition: w, setCanvasOffsetStartPosition: S, setCanvasOffset: L, isInsideComponent: b, selectionMode: k, setSelectionMode: P, selectionWidth: E, selectionColor: H, settings: T, isEditMode: C, isShiftPressed: V, withFrameSelection: W, withSkeleton: y }, N) => {
|
|
919
919
|
const M = q(null), A = q(null);
|
|
920
920
|
Q1(N, () => M.current);
|
|
921
|
-
const { hoverMode: Z } = j1({ disabled: i, addShape: s, drawCanvasRef: M, setActiveTool:
|
|
921
|
+
const { hoverMode: Z } = j1({ disabled: i, addShape: s, drawCanvasRef: M, setActiveTool: x, shapes: n, selectionMode: k, activeTool: f, isInsideComponent: b, setCanvasOffset: L, selectedShape: r, selectionCanvasRef: A, canvasOffsetStartPosition: w, setSelectedShape: o, setSelectionFrame: l, refreshHoveredShape: c, refreshSelectedShapes: u, setCanvasOffsetStartPosition: S, updateSingleShape: a, saveShapes: g, setSelectionMode: P, isShiftPressed: V, withFrameSelection: W, settings: T }), v = F((m) => {
|
|
922
922
|
if (r?.type !== "text") return;
|
|
923
923
|
const Q = M.current?.getContext("2d");
|
|
924
924
|
if (!Q) return;
|
|
@@ -941,9 +941,9 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
941
941
|
i && (t || (S.preventDefault(), u({ ...i })));
|
|
942
942
|
}, f = (S) => {
|
|
943
943
|
c && (t || (S.preventDefault(), r(((L, b) => ({ ...Nt([20, 20], L, [0, 0], b), id: oe(`${L.type}_`) }))(c, n))));
|
|
944
|
-
}, w = (S) => {
|
|
945
|
-
S.key === Vi && d(!1);
|
|
946
944
|
}, x = (S) => {
|
|
945
|
+
S.key === Vi && d(!1);
|
|
946
|
+
}, w = (S) => {
|
|
947
947
|
if (S.metaKey || S.ctrlKey) {
|
|
948
948
|
if (S.key === an || S.key === nn) return S.preventDefault(), S.stopPropagation(), void l();
|
|
949
949
|
if (S.key === on || S.key === sn) return S.preventDefault(), S.stopPropagation(), void h();
|
|
@@ -965,18 +965,18 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
965
965
|
S.preventDefault(), S.stopPropagation(), a(i);
|
|
966
966
|
}
|
|
967
967
|
};
|
|
968
|
-
if (e) return document.addEventListener("keydown",
|
|
969
|
-
document.removeEventListener("keydown",
|
|
968
|
+
if (e) return document.addEventListener("keydown", w), document.addEventListener("keyup", x), document.addEventListener(Pi, g), document.addEventListener(Hi, f), () => {
|
|
969
|
+
document.removeEventListener("keydown", w), document.removeEventListener("keyup", x), document.removeEventListener(Pi, g), document.removeEventListener(Hi, f);
|
|
970
970
|
};
|
|
971
971
|
}, [e, c, t, i, n, o, a, s, r, l, h, d]), {};
|
|
972
972
|
}, An = ({ options: e, className: i, style: t, canvasProps: n }) => {
|
|
973
|
-
const { shapesRef: s, selectedShape: a, selectionFrame: r, hoveredShape: o, addShape: l, setSelectedShape: h, setSelectionFrame: d, refreshSelectedShapes: c, refreshHoveredShape: u, removeShape: g, updateShape: f, backwardShape:
|
|
973
|
+
const { shapesRef: s, selectedShape: a, selectionFrame: r, hoveredShape: o, addShape: l, setSelectedShape: h, setSelectionFrame: d, refreshSelectedShapes: c, refreshHoveredShape: u, removeShape: g, updateShape: f, backwardShape: x, forwardShape: w, saveShapes: S, refs: L, width: b, height: k, settings: P, canvasSize: E, setCanvasSize: H, setCanvasOffset: T, selectShape: C, activeTool: V, setActiveTool: W, isInsideComponent: y, isEditMode: N, isDisabled: M, canvas: { withSkeleton: A, withFrameSelection: Z, canGrow: v, canShrink: m } } = n, { canvasBackgroundColor: Q, canvasSelectionColor: D, canvasSelectionWidth: R } = { ...C1, ...e }, X = q(null), [ce, $] = z(void 0), [U, re] = z({ mode: "default" }), [te, ie] = z(!1), fe = F((ne) => {
|
|
974
974
|
l(ne), C(ne);
|
|
975
975
|
}, [l, C]), Me = F((ne) => {
|
|
976
976
|
const j = ne / b;
|
|
977
977
|
H({ width: ne, height: k * j, scaleRatio: j });
|
|
978
978
|
}, [b, k, H]);
|
|
979
|
-
return rn({ isInsideComponent: y, isEditingText: U.mode === "textedition", settings: P, selectedShape: a, setSelectedShape: h, removeShape: g, pasteShape: fe, updateShape: f, backwardShape:
|
|
979
|
+
return rn({ isInsideComponent: y, isEditingText: U.mode === "textedition", settings: P, selectedShape: a, setSelectedShape: h, removeShape: g, pasteShape: fe, updateShape: f, backwardShape: x, forwardShape: w, setShiftPressed: ie }), (({ onResized: ne, element: j }) => {
|
|
980
980
|
B(() => {
|
|
981
981
|
const Se = j.current;
|
|
982
982
|
if (!Se) return;
|
|
@@ -1015,8 +1015,8 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1015
1015
|
}, [t]), p("div", { className: "react-paint-editor-snackbar", "data-is-shown": +n, "data-type": e, style: { "--react-paint-editor-panel-transition-duration": "500ms" }, children: i });
|
|
1016
1016
|
}, pn = ({ snackbarList: e }) => p("div", { className: "react-paint-editor-snackbar-container", style: { "--react-paint-editor-snackbar-zindex": b1 }, children: e.map((i) => p(hn, { ...i }, i.id)) }), G = Fi.forwardRef((e, i) => {
|
|
1017
1017
|
if (e.type === "file" || e.type === "color") {
|
|
1018
|
-
const { hidden: d = !1, disabled: c = !1, selected: u = !1, icon: g, children: f, className:
|
|
1019
|
-
return I("label", { className: `react-paint-editor-button ${
|
|
1018
|
+
const { hidden: d = !1, disabled: c = !1, selected: u = !1, icon: g, children: f, className: x = "", title: w, onClick: S, ...L } = e;
|
|
1019
|
+
return I("label", { className: `react-paint-editor-button ${x}`, title: w, onClick: S, "data-disabled": +c, "data-selected": +u, "data-hidden": +d, children: [p("input", { ref: i, disabled: c, ...L }), I("span", { className: "react-paint-editor-button-content", children: [f && p("span", { className: "react-paint-editor-button-children", children: f }), g && p("span", { className: "react-paint-editor-button-icon", dangerouslySetInnerHTML: { __html: g } })] })] });
|
|
1020
1020
|
}
|
|
1021
1021
|
const { hidden: t = !1, disabled: n = !1, selected: s = !1, icon: a, children: r, type: o = "button", className: l = "", ...h } = e;
|
|
1022
1022
|
return p("button", { className: `react-paint-editor-button ${l}`, ref: i, disabled: n, "data-disabled": +n, "data-selected": +s, "data-hidden": +t, type: o, ...h, children: I("span", { className: "react-paint-editor-button-content", children: [r && p("span", { className: "react-paint-editor-button-children", children: r }), a && p("span", { className: "react-paint-editor-button-icon", dangerouslySetInnerHTML: { __html: a } })] }) });
|
|
@@ -1044,26 +1044,26 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1044
1044
|
return "";
|
|
1045
1045
|
}
|
|
1046
1046
|
}, gn = ({ disabled: e = !1, shape: i, selected: t, layoutDragging: n, toggleShapeVisibility: s, toggleShapeLock: a, setLayoutDragging: r, handleRemove: o, handleSelect: l, onMoveShapes: h }) => {
|
|
1047
|
-
const d = q(null), { isOver: c } = (({ disabled: u = !1, ref: g, shape: f, layoutDragging:
|
|
1047
|
+
const d = q(null), { isOver: c } = (({ disabled: u = !1, ref: g, shape: f, layoutDragging: x, setLayoutDragging: w, handleSelect: S, onMoveShapes: L }) => {
|
|
1048
1048
|
const [b, k] = z(!1);
|
|
1049
1049
|
return B(() => {
|
|
1050
|
-
|
|
1051
|
-
}, [
|
|
1050
|
+
x || k(!1);
|
|
1051
|
+
}, [x]), B(() => {
|
|
1052
1052
|
const P = g.current;
|
|
1053
1053
|
if (!P) return;
|
|
1054
1054
|
const E = () => {
|
|
1055
|
-
|
|
1055
|
+
w(void 0);
|
|
1056
1056
|
}, H = (y) => (y.preventDefault && y.preventDefault(), !1), T = (y) => {
|
|
1057
|
-
S(f), y.dataTransfer && (y.dataTransfer.effectAllowed = "move", y.dataTransfer.setData("draggableShapeId", f.id),
|
|
1057
|
+
S(f), y.dataTransfer && (y.dataTransfer.effectAllowed = "move", y.dataTransfer.setData("draggableShapeId", f.id), w(f.id));
|
|
1058
1058
|
}, C = () => {
|
|
1059
|
-
|
|
1059
|
+
x !== f.id && k(!0);
|
|
1060
1060
|
}, V = () => {
|
|
1061
1061
|
k(!1);
|
|
1062
1062
|
}, W = (y) => (y.stopPropagation(), y.dataTransfer && L(y.dataTransfer.getData("draggableShapeId"), f.id), !1);
|
|
1063
1063
|
return u || (P.addEventListener("dragstart", T), P.addEventListener("dragend", E), P.addEventListener("dragover", H), P.addEventListener("dragenter", C), P.addEventListener("dragleave", V), P.addEventListener("drop", W)), () => {
|
|
1064
1064
|
u || (P.removeEventListener("dragstart", T), P.removeEventListener("dragend", E), P.removeEventListener("dragover", H), P.removeEventListener("dragenter", C), P.removeEventListener("dragleave", V), P.removeEventListener("drop", W));
|
|
1065
1065
|
};
|
|
1066
|
-
}, [u, g, f,
|
|
1066
|
+
}, [u, g, f, w, S, L, x]), { isOver: b };
|
|
1067
1067
|
})({ disabled: e, ref: d, shape: i, layoutDragging: n, setLayoutDragging: r, handleSelect: l, onMoveShapes: h });
|
|
1068
1068
|
return I("div", { className: "react-paint-editor-layout", "data-disabled": +e, draggable: !e, "data-is-dragging": +(n === i.id), "data-is-over": +c, onClick: (u) => {
|
|
1069
1069
|
e || (u.preventDefault(), u.stopPropagation(), l(i));
|
|
@@ -1101,13 +1101,13 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1101
1101
|
B(() => () => {
|
|
1102
1102
|
f.current && clearTimeout(f.current);
|
|
1103
1103
|
}, []);
|
|
1104
|
-
const
|
|
1105
|
-
return o === l ? null : I(pe, { children: [p(G, { selected:
|
|
1106
|
-
i((
|
|
1107
|
-
} }),
|
|
1108
|
-
const S = +
|
|
1109
|
-
c(a, Number.isNaN(S) ?
|
|
1110
|
-
c(a, Number.isNaN(S) ?
|
|
1104
|
+
const x = e === g;
|
|
1105
|
+
return o === l ? null : I(pe, { children: [p(G, { selected: x, title: t, disabled: s, icon: n, onClick: () => {
|
|
1106
|
+
i((w) => w === g ? void 0 : g);
|
|
1107
|
+
} }), x && p(Ke, { title: t, alignment: "left", fitContainer: !0, children: p("div", { children: I("label", { className: "react-paint-editor-rangefield", children: [p("input", { type: "range", min: o, max: l, step: h, value: r, onChange: (w) => {
|
|
1108
|
+
const S = +w.target.value;
|
|
1109
|
+
c(a, Number.isNaN(S) ? w.target.value : S, !1), f.current && clearTimeout(f.current), f.current = setTimeout(() => {
|
|
1110
|
+
c(a, Number.isNaN(S) ? w.target.value : S, !0);
|
|
1111
1111
|
}, 1e3);
|
|
1112
1112
|
} }), I("span", { children: [u, d] })] }) }) })] });
|
|
1113
1113
|
}, Ei = ({ selectedSettings: e, setSelectedSettings: i, disabled: t = !1, min: n, max: s, step: a, value: r, valueChanged: o }) => n === s ? null : p(at, { selectedSettings: e, setSelectedSettings: i, icon: Wt, title: "Nombre de points", disabled: t, field: "pointsCount", min: n, max: s, step: a, unity: "", value: r, valueChanged: o }), ht = ({ setSelectedSettings: e, disabled: i = !1, field: t, icon: n, values: s, value: a = !1, valueChanged: r }) => {
|
|
@@ -1116,8 +1116,8 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1116
1116
|
e((l) => l === o ? void 0 : o), r(t, !a);
|
|
1117
1117
|
}, selected: a, disabled: i, icon: n });
|
|
1118
1118
|
}, At = ({ activeTool: e, selectedShape: i, selectedShapeTool: t, disabled: n, selectedSettings: s, setSelectedSettings: a, handleShapeStyleChange: r, handlePolygonLinesCount: o, handleShapeFontFamilyChange: l }) => i ? p(pe, { children: t && I(pe, { children: ["strokeColor" in t.settings && !t.settings.strokeColor.hidden && p(ct, { selectedSettings: s, setSelectedSettings: a, title: "Couleur du trait", mode: "stroke", disabled: n, field: "strokeColor", value: i.style?.strokeColor, valueChanged: r, values: t.settings.strokeColor.values }), "fillColor" in t.settings && !t.settings.fillColor.hidden && p(ct, { selectedSettings: s, setSelectedSettings: a, title: "Couleur de fond", disabled: n, field: "fillColor", value: i.style?.fillColor, valueChanged: r, values: t.settings.fillColor.values }), "lineWidth" in t.settings && !t.settings.lineWidth.hidden && p(at, { selectedSettings: s, setSelectedSettings: a, title: "Epaisseur du trait", icon: ei, disabled: n, field: "lineWidth", value: i.style?.lineWidth, valueChanged: r, unity: "px", min: t.settings.lineWidth.min, max: t.settings.lineWidth.max, step: t.settings.lineWidth.step }), "lineDash" in t.settings && !t.settings.lineDash.hidden && p(Zi, { selectedSettings: s, setSelectedSettings: a, disabled: n, defaultValue: i.style?.lineDash, valueChanged: r, values: t.settings.lineDash.values }), "lineArrow" in t.settings && !t.settings.lineArrow.hidden && p(Ai, { selectedSettings: s, setSelectedSettings: a, disabled: n, defaultValue: i.style?.lineArrow, valueChanged: r, values: t.settings.lineArrow.values }), "pointsCount" in t.settings && !t.settings.pointsCount.hidden && p(Ei, { selectedSettings: s, setSelectedSettings: a, disabled: n, valueChanged: o, min: t.settings.pointsCount.min, max: t.settings.pointsCount.max, step: t.settings.pointsCount.step, value: i.style?.pointsCount }), "fontFamily" in t.settings && !t.settings.fontFamily.hidden && p(Ti, { selectedSettings: s, setSelectedSettings: a, disabled: n, valueChanged: l, values: t.settings.fontFamily.values, defaultValue: i.style?.fontFamily }), "fontBold" in t.settings && !t.settings.fontBold.hidden && p(ht, { setSelectedSettings: a, disabled: n, field: "fontBold", icon: Jt, valueChanged: l, values: t.settings.fontBold.values, value: i.style?.fontBold }), "fontItalic" in t.settings && !t.settings.fontItalic.hidden && p(ht, { setSelectedSettings: a, disabled: n, field: "fontItalic", icon: Kt, valueChanged: l, values: t.settings.fontItalic.values, value: i.style?.fontItalic }), "opacity" in t.settings && !t.settings.opacity.hidden && p(at, { selectedSettings: s, setSelectedSettings: a, title: "Opacité", icon: qt, min: t.settings.opacity.min, max: t.settings.opacity.max, step: t.settings.opacity.step, unity: "%", disabled: n, field: "opacity", value: i.style?.opacity ?? 100, valueChanged: r })] }) }) : "settings" in e ? I(pe, { children: ["strokeColor" in e.settings && !e.settings.strokeColor.hidden && p(ct, { selectedSettings: s, setSelectedSettings: a, title: "Couleur du trait", mode: "stroke", disabled: n, field: "strokeColor", value: e.settings.strokeColor.default, valueChanged: r, values: e.settings.strokeColor.values }), "fillColor" in e.settings && !e.settings.fillColor.hidden && p(ct, { selectedSettings: s, setSelectedSettings: a, title: "Couleur de fond", disabled: n, field: "fillColor", value: e.settings.fillColor.default, valueChanged: r, values: e.settings.fillColor.values }), "lineWidth" in e.settings && !e.settings.lineWidth.hidden && p(at, { selectedSettings: s, setSelectedSettings: a, title: "Epaisseur du trait", disabled: n, field: "lineWidth", icon: ei, value: e.settings.lineWidth.default, valueChanged: r, unity: "px", min: e.settings.lineWidth.min, max: e.settings.lineWidth.max, step: e.settings.lineWidth.step }), "lineDash" in e.settings && !e.settings.lineDash.hidden && p(Zi, { selectedSettings: s, setSelectedSettings: a, disabled: n, defaultValue: e.settings.lineDash.default, valueChanged: r, values: e.settings.lineDash.values }), "lineArrow" in e.settings && !e.settings.lineArrow.hidden && p(Ai, { selectedSettings: s, setSelectedSettings: a, disabled: n, defaultValue: e.settings.lineArrow.default, valueChanged: r, values: e.settings.lineArrow.values }), "pointsCount" in e.settings && !e.settings.pointsCount.hidden && p(Ei, { selectedSettings: s, setSelectedSettings: a, disabled: n, valueChanged: o, min: e.settings.pointsCount.min, max: e.settings.pointsCount.max, step: e.settings.pointsCount.step, value: e.settings.pointsCount.default }), "fontFamily" in e.settings && !e.settings.fontFamily.hidden && p(Ti, { selectedSettings: s, setSelectedSettings: a, disabled: n, valueChanged: l, values: e.settings.fontFamily.values, defaultValue: e.settings.fontFamily.default }), "fontBold" in e.settings && !e.settings.fontBold.hidden && p(ht, { setSelectedSettings: a, disabled: n, field: "fontBold", icon: Jt, valueChanged: l, values: e.settings.fontBold.values, value: e.settings.fontBold.default }), "fontItalic" in e.settings && !e.settings.fontItalic.hidden && p(ht, { setSelectedSettings: a, disabled: n, field: "fontItalic", icon: Kt, valueChanged: l, values: e.settings.fontItalic.values, value: e.settings.fontItalic.default }), "opacity" in e.settings && !e.settings.opacity.hidden && p(at, { selectedSettings: s, setSelectedSettings: a, title: "Opacité", icon: qt, min: e.settings.opacity.min, max: e.settings.opacity.max, step: e.settings.opacity.step, unity: "%", disabled: n, field: "opacity", value: e.settings.opacity.default, valueChanged: r })] }) : null, bn = ({ width: e, disabled: i = !1, availableTools: t, updateToolSettings: n, layersManipulation: s, toggleLayoutPanel: a, activeTool: r, selectedShape: o, canvas: l, settings: h, updateShape: d, removeShape: c }) => {
|
|
1119
|
-
const [u, g] = z(void 0), [f,
|
|
1120
|
-
|
|
1119
|
+
const [u, g] = z(void 0), [f, x] = z(!1), w = () => {
|
|
1120
|
+
x((H) => !H);
|
|
1121
1121
|
}, S = o ? t.find((H) => H.id === o.toolId) || t.find((H) => H.type === o.type) : void 0, L = (S ? Object.keys(S.settings).length + 1 : "settings" in r ? Object.keys(r.settings).length : 0) + (s ? 1 : 0), b = e < 40 * L, k = (H, T, C = !0) => {
|
|
1122
1122
|
o ? (d(ot(le(["style", H], T, o), h), C), S && n(S.id, H, T)) : n(r.id, H, T);
|
|
1123
1123
|
}, P = (H, T) => {
|
|
@@ -1152,7 +1152,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1152
1152
|
})(o, T, h), !0), S && n(S.id, H, T);
|
|
1153
1153
|
} else n(r.id, H, T);
|
|
1154
1154
|
};
|
|
1155
|
-
return I(pe, { children: [I("div", { className: "react-paint-editor-settings-bar", children: [I("div", { className: "react-paint-editor-settings-shrinkable", children: [b && L > 2 && p(G, { disabled: i, onClick:
|
|
1155
|
+
return I(pe, { children: [I("div", { className: "react-paint-editor-settings-bar", children: [I("div", { className: "react-paint-editor-settings-shrinkable", children: [b && L > 2 && p(G, { disabled: i, onClick: w, title: "Toggle settings", icon: '<svg><path d="M2.5 15.833V14.083H7.667V15.833ZM2.5 5.917V4.167H10.771V5.917ZM9.208 17.5V12.438H10.958V14.083H17.5V15.833H10.958V17.5ZM5.917 12.542V10.875H2.5V9.125H5.917V7.479H7.667V12.542ZM9.208 10.875V9.125H17.5V10.875ZM12.333 7.562V2.5H14.083V4.167H17.5V5.917H14.083V7.562Z"/></svg>' }), o ? p(pe, { children: S && I(pe, { children: [!b && p(At, { activeTool: r, selectedShape: o, selectedShapeTool: S, disabled: i, selectedSettings: u, setSelectedSettings: g, handleShapeStyleChange: k, handlePolygonLinesCount: E, handleShapeFontFamilyChange: P }), r.type === "selection" && p(fn, { disabled: i, selectedShape: o, removeShape: c })] }) }) : !b && p(At, { activeTool: r, selectedShape: o, selectedShapeTool: S, disabled: i, selectedSettings: u, setSelectedSettings: g, handleShapeStyleChange: k, handlePolygonLinesCount: E, handleShapeFontFamilyChange: P })] }), p("div", { className: "react-paint-editor-settings-separator" }), s && p(yn, { disabled: i, toggleLayoutPanel: a })] }), f && p(Yt, { className: "react-paint-editor-settings-modal", onClose: w, position: "bottom", children: p(At, { activeTool: r, selectedShape: o, selectedShapeTool: S, disabled: i, selectedSettings: u, setSelectedSettings: g, handleShapeStyleChange: k, handlePolygonLinesCount: E, handleShapeFontFamilyChange: P }) })] });
|
|
1156
1156
|
}, Di = ({ disabled: e = !1, withText: i = !1, loadFile: t, type: n, img: s, accept: a }) => {
|
|
1157
1157
|
const r = q(null);
|
|
1158
1158
|
return p(G, { ref: r, type: "file", onClick: (o) => {
|
|
@@ -1163,7 +1163,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1163
1163
|
}, accept: a, title: n.label ?? n.type, icon: s, disabled: e, children: i ? n.label : void 0 });
|
|
1164
1164
|
}, ge = ({ type: e, img: i, isActive: t, withText: n = !1, disabled: s = !1, setActive: a }) => p(G, { disabled: s, selected: t, onClick: () => {
|
|
1165
1165
|
a(e);
|
|
1166
|
-
}, title: e.label ?? e.type, icon: i, children: n ? e.label : void 0 }), Cn = ({ activeTool: e, withActionsInMenu: i, hasActionToUndo: t = !1, hasActionToRedo: n = !1, hasActionToClear: s = !1, undoAction: a, redoAction: r, clearCanvas: o, alignment: l, group: h, vertical: d = !1, disabled: c = !1, withLoadAndSave: u, withExport: g, addPicture: f, loadFile:
|
|
1166
|
+
}, title: e.label ?? e.type, icon: i, children: n ? e.label : void 0 }), Cn = ({ activeTool: e, withActionsInMenu: i, hasActionToUndo: t = !1, hasActionToRedo: n = !1, hasActionToClear: s = !1, undoAction: a, redoAction: r, clearCanvas: o, alignment: l, group: h, vertical: d = !1, disabled: c = !1, withLoadAndSave: u, withExport: g, addPicture: f, loadFile: x, togglePictureUrlModal: w, saveFile: S, exportCanvasInFile: L, withUploadPicture: b, withUrlPicture: k }) => {
|
|
1167
1167
|
const [P, E] = z(!1), [, H] = Ri(), T = h?.tools?.some((V) => V === e.type), C = (T ? e.icon : h.img) ?? h.title;
|
|
1168
1168
|
return B(() => {
|
|
1169
1169
|
if (!P) return;
|
|
@@ -1179,8 +1179,8 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1179
1179
|
});
|
|
1180
1180
|
}, icon: C }), P && p(Ke, { alignment: l, position: "top", children: I("div", { className: "react-paint-editor-toolbox-panel-content", "data-vertical": +d, children: [i && I(pe, { children: [p(ge, { withText: !0, type: Ge, disabled: c || !t, img: Ge.icon, isActive: e.id === Ge.id, setActive: a }), p(ge, { withText: !0, type: Xe, disabled: c || !n, img: Xe.icon, isActive: e.id === Xe.id, setActive: r }), p(ge, { withText: !0, type: Ye, disabled: c || !s, img: Ye.icon, isActive: e.id === Ye.id, setActive: o }), (b || k || u) && p("hr", {})] }), b && p(Di, { withText: !0, type: si, disabled: c, loadFile: async (V) => {
|
|
1181
1181
|
E(!1), await f(V);
|
|
1182
|
-
}, img: si.icon, accept: "image/png, image/gif, image/jpeg, image/svg+xml" }), k && p(G, { disabled: c, selected: !1, onClick:
|
|
1183
|
-
E(!1),
|
|
1182
|
+
}, img: si.icon, accept: "image/png, image/gif, image/jpeg, image/svg+xml" }), k && p(G, { disabled: c, selected: !1, onClick: w, title: "Add picture from URL", icon: '<svg><path d="M9.188 16.542V14.938Q8.5 14.938 8.021 14.458Q7.542 13.979 7.542 13.292V12.458L3.583 8.5Q3.5 8.875 3.458 9.25Q3.417 9.625 3.417 10Q3.417 12.5 5.062 14.365Q6.708 16.229 9.188 16.542ZM14.854 14.438Q15.708 13.521 16.146 12.385Q16.583 11.25 16.583 10Q16.583 7.979 15.469 6.313Q14.354 4.646 12.479 3.917V4.229Q12.479 4.917 12 5.396Q11.521 5.875 10.833 5.875H9.188V7.521Q9.188 7.875 8.948 8.115Q8.708 8.354 8.354 8.354H6.708V10H11.646Q12 10 12.24 10.229Q12.479 10.458 12.479 10.812V13.292H13.292Q13.833 13.292 14.26 13.604Q14.688 13.917 14.854 14.438ZM10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.271 2.323 6.75Q2.979 5.229 4.104 4.104Q5.229 2.979 6.75 2.323Q8.271 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.729 17.677 13.25Q17.021 14.771 15.896 15.896Q14.771 17.021 13.25 17.677Q11.729 18.333 10 18.333Z"/></svg>', children: "Add picture from URL" }), (b || k) && u && p("hr", {}), u && I(pe, { children: [p(Di, { withText: !0, type: ai, disabled: c, loadFile: (V) => {
|
|
1183
|
+
E(!1), x(V);
|
|
1184
1184
|
}, img: ai.icon, accept: "application/JSON" }), p(ge, { withText: !0, disabled: c, type: Lt, img: Lt.icon, isActive: e.id === Lt.id, setActive: S })] }), g && p(ge, { withText: !0, disabled: c, type: kt, img: kt.icon, isActive: e.id === kt.id, setActive: L })] }) })] }) : null;
|
|
1185
1185
|
}, wn = ({ togglePictureUrlModal: e, addPicture: i }) => {
|
|
1186
1186
|
const t = q(null);
|
|
@@ -1197,8 +1197,8 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1197
1197
|
};
|
|
1198
1198
|
if (B(() => {
|
|
1199
1199
|
if (!r) return;
|
|
1200
|
-
const f = (
|
|
1201
|
-
!o1(
|
|
1200
|
+
const f = (x) => {
|
|
1201
|
+
!o1(x, a.current) && o(!1);
|
|
1202
1202
|
};
|
|
1203
1203
|
return document.addEventListener("mousedown", f, { passive: !1 }), document.addEventListener("touchstart", f, { passive: !1 }), () => {
|
|
1204
1204
|
document.removeEventListener("mousedown", f), document.removeEventListener("touchstart", f);
|
|
@@ -1211,8 +1211,8 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1211
1211
|
h ? s(h.id) : t.toolsType?.[0] && c(t.toolsType[0]), l(() => {
|
|
1212
1212
|
o(!0);
|
|
1213
1213
|
});
|
|
1214
|
-
}, icon: g }), r && p(Ke, { alignment: i, position: "top", children: p("div", { className: "react-paint-editor-toolbargroup-panel-content", "data-vertical": +t.vertical, ref: a, children: t.toolsType.map((f,
|
|
1215
|
-
}, Mn = [{ title: "brush", toolsType: ["brush"], vertical: !1 }, { title: "lines", toolsType: ["line", "curve", "polygon"], vertical: !1 }, { title: "shapes", toolsType: ["rect", "square", "circle", "ellipse"], vertical: !1 }, "text"], kn = ({ width: e, disabled: i = !1, activeTool: t, hasActionToUndo: n = !1, hasActionToRedo: s = !1, hasActionToClear: a = !1, withLoadAndSave: r, withExport: o, clearCanvas: l, setActiveTool: h, undoAction: d, redoAction: c, addPicture: u, loadFile: g, saveFile: f, exportCanvasInFile:
|
|
1214
|
+
}, icon: g }), r && p(Ke, { alignment: i, position: "top", children: p("div", { className: "react-paint-editor-toolbargroup-panel-content", "data-vertical": +t.vertical, ref: a, children: t.toolsType.map((f, x) => p(ge, { disabled: n, type: f, img: f.icon, isActive: e.id === f.id, setActive: c }, f.id)) }) })] });
|
|
1215
|
+
}, Mn = [{ title: "brush", toolsType: ["brush"], vertical: !1 }, { title: "lines", toolsType: ["line", "curve", "polygon"], vertical: !1 }, { title: "shapes", toolsType: ["rect", "square", "circle", "ellipse"], vertical: !1 }, "text"], kn = ({ width: e, disabled: i = !1, activeTool: t, hasActionToUndo: n = !1, hasActionToRedo: s = !1, hasActionToClear: a = !1, withLoadAndSave: r, withExport: o, clearCanvas: l, setActiveTool: h, undoAction: d, redoAction: c, addPicture: u, loadFile: g, saveFile: f, exportCanvasInFile: x, availableTools: w, withUrlPicture: S, withUploadPicture: L }) => {
|
|
1216
1216
|
const b = ((M, A) => {
|
|
1217
1217
|
const Z = A.flatMap((v) => {
|
|
1218
1218
|
if (typeof v != "object") return M.filter((Q) => Q.type === v);
|
|
@@ -1220,16 +1220,16 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1220
1220
|
return m ? { ...v, toolsType: m } : null;
|
|
1221
1221
|
});
|
|
1222
1222
|
return $t(Z);
|
|
1223
|
-
})(
|
|
1223
|
+
})(w, Mn), k = e < 40 * (5 + b.length), P = e < 40 * (2 + b.length), [E, H] = z(!1), [T, C] = z(!1), V = () => {
|
|
1224
1224
|
H((M) => !M);
|
|
1225
1225
|
}, W = (M) => {
|
|
1226
1226
|
h(M), H(!1);
|
|
1227
1227
|
}, y = (M) => {
|
|
1228
|
-
W(
|
|
1229
|
-
}, N =
|
|
1228
|
+
W(w.find((A) => A.id === M) ?? t);
|
|
1229
|
+
}, N = w.find((M) => M.type === t.type) !== void 0;
|
|
1230
1230
|
return I(pe, { children: [I("div", { className: "react-paint-editor-toolbar-toolbox", children: [I("div", { className: "react-paint-editor-toolbar-shrinkable", children: [p(ge, { type: Ae, disabled: i, img: Ae.icon, isActive: t.id === Ae.id, setActive: W }), P ? p(G, { disabled: i, onClick: V, title: "Toggle tools", icon: '<svg><path d="M5.333 9.292 10.021 1.646 14.708 9.292ZM14.562 18.333Q13 18.333 11.896 17.229Q10.792 16.125 10.792 14.562Q10.792 13 11.896 11.896Q13 10.792 14.562 10.792Q16.125 10.792 17.229 11.896Q18.333 13 18.333 14.562Q18.333 16.125 17.229 17.229Q16.125 18.333 14.562 18.333ZM2.5 17.917V11.188H9.229V17.917ZM14.562 16.583Q15.438 16.583 16.01 16.01Q16.583 15.438 16.583 14.562Q16.583 13.688 16.01 13.115Q15.438 12.542 14.562 12.542Q13.688 12.542 13.115 13.115Q12.542 13.688 12.542 14.562Q12.542 15.438 13.115 16.01Q13.688 16.583 14.562 16.583ZM4.25 16.167H7.479V12.938H4.25ZM8.458 7.542H11.583L10.021 5ZM10.021 7.542ZM7.479 12.938ZM14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Q14.562 14.562 14.562 14.562Z"/></svg>', selected: N }) : b.map((M, A) => p(xn, { disabled: i, activeTool: t, group: M, setActiveToolFromId: y }, "id" in M ? M.id : M.title))] }), !k && I(pe, { children: [p(ge, { type: Ge, disabled: i || !n, img: Ge.icon, isActive: t.id === Ge.id, setActive: d }), p(ge, { type: Xe, disabled: i || !s, img: Xe.icon, isActive: t.id === Xe.id, setActive: c }), p(ge, { type: Ye, disabled: i || !a, img: Ye.icon, isActive: t.id === Ye.id, setActive: l })] }), p(Cn, { withActionsInMenu: k, disabled: i, vertical: !0, alignment: "right", group: { title: "Menu", img: '<svg><path d="M2.5 15V13.25H17.5V15ZM2.5 10.875V9.125H17.5V10.875ZM2.5 6.75V5H17.5V6.75Z"/></svg>' }, activeTool: t, addPicture: u, loadFile: g, saveFile: f, togglePictureUrlModal: () => {
|
|
1231
1231
|
C(!0);
|
|
1232
|
-
}, exportCanvasInFile:
|
|
1232
|
+
}, exportCanvasInFile: x, withUploadPicture: L, withUrlPicture: S, withLoadAndSave: r, withExport: o, hasActionToUndo: n, hasActionToRedo: s, hasActionToClear: a, undoAction: d, redoAction: c, clearCanvas: l })] }), E && p(Yt, { className: "react-paint-editor-toolbar-modal", onClose: V, children: w.map((M, A) => M.type === "picture" ? null : p(ge, { disabled: i, type: M, img: M.icon, withText: !1, isActive: t.id === M.id, setActive: W }, M.id)) }), T && p(wn, { togglePictureUrlModal: () => {
|
|
1233
1233
|
C((M) => !M);
|
|
1234
1234
|
}, addPicture: u })] });
|
|
1235
1235
|
}, pt = { none: 0, small: 10, medium: 20, large: 40 }, Ln = { toolbarBackgroundColor: "white", dividerColor: "#36418129", fontRadius: 8, fontDisabledColor: "#3641812b", fontDisabledBackgroundColor: "transparent", fontColor: "#364181", fontBackgroundColor: "transparent", fontSelectedColor: "white", fontSelectedBackgroundColor: "#364181", fontHoverColor: "#364181", fontHoverBackgroundColor: "#afd8d8" }, Vn = () => {
|
|
@@ -1244,11 +1244,11 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1244
1244
|
}, s)];
|
|
1245
1245
|
} };
|
|
1246
1246
|
}, Zn = ({ editorProps: e, className: i, style: t, options: n, children: s }) => {
|
|
1247
|
-
const { shapesRef: a, addPictureShape: r, moveShapes: o, toggleShapeVisibility: l, toggleShapeLock: h, canGoBackward: d, canGoForward: c, canClear: u, selectedShape: g, removeShape: f, updateShape:
|
|
1247
|
+
const { shapesRef: a, addPictureShape: r, moveShapes: o, toggleShapeVisibility: l, toggleShapeLock: h, canGoBackward: d, canGoForward: c, canClear: u, selectedShape: g, removeShape: f, updateShape: x, backwardShape: w, forwardShape: S, refs: L, width: b, height: k, canvasSize: P, selectTool: E, selectShape: H, activeTool: T, setActiveTool: C, setAvailableTools: V, isEditMode: W, isDisabled: y, availableTools: N, gridGap: M, setGridGap: A, loadFile: Z, exportPicture: v, exportData: m, clearCanvas: Q, settings: D, canvas: { canGrow: R, layersManipulation: X, withExport: ce, withLoadAndSave: $, withUploadPicture: U, withUrlPicture: re } } = e, { toolbarBackgroundColor: te, dividerColor: ie, fontRadius: fe, fontDisabledColor: Me, fontDisabledBackgroundColor: ne, fontColor: j, fontBackgroundColor: Se, fontSelectedColor: Ze, fontSelectedBackgroundColor: ke, fontHoverColor: me, fontHoverBackgroundColor: be } = { ...Ln, ...n }, [Ee, se] = z(!1), [Le, Ne] = z(!1), he = M >= pt.large ? "large" : M >= pt.medium ? "medium" : M >= pt.small ? "small" : "none", { snackbarList: ye, addSnackbar: ae } = Vn(), Ve = F((J, K, et) => {
|
|
1248
1248
|
V((Re) => Re.map((tt) => tt.id === J ? le(["settings", K, "default"], et, tt) : tt)), C((Re) => Re.id === J ? le(["settings", K, "default"], et, Re) : Re);
|
|
1249
1249
|
}, [C, V]), $e = F(() => {
|
|
1250
|
-
E(Ae),
|
|
1251
|
-
}, [E,
|
|
1250
|
+
E(Ae), w();
|
|
1251
|
+
}, [E, w]), Pe = F(() => {
|
|
1252
1252
|
E(Ae), S();
|
|
1253
1253
|
}, [E, S]), Ue = F(() => {
|
|
1254
1254
|
se(!0);
|
|
@@ -1290,7 +1290,7 @@ const ui = ({ ctx: e, path: i, rect: t, offset: n, checkFill: s }) => {
|
|
|
1290
1290
|
}, [r, H, ae, b, k]), xt = `${i ? `${i} ` : ""}${Le ? "react-paint-editor-layout-opened " : ""}react-paint-editor-app`;
|
|
1291
1291
|
return I("div", { ref: L.setEditor, className: xt, style: { "--react-paint-editor-app-maxWidth": R ? "100%" : `${b}px`, "--react-paint-editor-app-toolbar-bg": te, "--react-paint-editor-app-divider-color": ie, "--react-paint-editor-app-font-radius": fe, "--react-paint-editor-app-font-disabled-color": Me, "--react-paint-editor-app-font-disabled-bg": ne, "--react-paint-editor-app-font-color": j, "--react-paint-editor-app-font-bg": Se, "--react-paint-editor-app-font-selected-color": Ze, "--react-paint-editor-app-font-selected-bg": ke, "--react-paint-editor-app-font-hover-color": me, "--react-paint-editor-app-font-hover-bg": be, ...t }, children: [W && p(kn, { width: P.width, disabled: y, activeTool: T, clearCanvas: Q, setActiveTool: E, exportCanvasInFile: Ue, saveFile: lt, loadFile: Ct, addPicture: wt, hasActionToUndo: d, hasActionToRedo: c, hasActionToClear: u, undoAction: $e, redoAction: Pe, availableTools: N, withExport: ce, withLoadAndSave: $, withUploadPicture: U, withUrlPicture: re }), s, W && X && p(vn, { gridFormat: he, setGridFormat: (J) => {
|
|
1292
1292
|
A(pt[J]);
|
|
1293
|
-
}, disabled: y, shapes: a.current, moveShapes: o, selectedShape: g, removeShape: f, selectShape: H, toggleShapeVisibility: l, toggleShapeLock: h, isLayoutPanelShown: Le }), W && I(pe, { children: [p(bn, { width: P.width, disabled: y, activeTool: T, availableTools: N, selectedShape: g, settings: D, removeShape: f, updateShape:
|
|
1293
|
+
}, disabled: y, shapes: a.current, moveShapes: o, selectedShape: g, removeShape: f, selectShape: H, toggleShapeVisibility: l, toggleShapeLock: h, isLayoutPanelShown: Le }), W && I(pe, { children: [p(bn, { width: P.width, disabled: y, activeTool: T, availableTools: N, selectedShape: g, settings: D, removeShape: f, updateShape: x, canvas: L.canvas.current, layersManipulation: X, toggleLayoutPanel: () => {
|
|
1294
1294
|
Ne((J) => !J);
|
|
1295
1295
|
}, updateToolSettings: Ve }), p(ln, { isLoading: Ee }), p(pn, { snackbarList: ye })] })] });
|
|
1296
1296
|
};
|