wacomm 2.24.0 → 2.25.1
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/icons/CloseIcon.stories.d.ts +7 -0
- package/dist/icons/EditIcon.stories.d.ts +8 -0
- package/dist/icons/SendIcon.stories.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/success/SuccessMessage.d.ts +6 -0
- package/dist/success/SuccessMessage.stories.d.ts +7 -0
- package/dist/success/index.d.ts +1 -0
- package/dist/toaster/Toaster.d.ts +11 -0
- package/dist/toaster/Toaster.stories.d.ts +8 -0
- package/dist/toaster/index.d.ts +1 -0
- package/dist/wacomm.cjs.js +8 -8
- package/dist/wacomm.css +1 -1
- package/dist/wacomm.es.js +168 -137
- package/package.json +2 -2
package/dist/wacomm.es.js
CHANGED
|
@@ -14649,7 +14649,6 @@ function _a({ className: e = "", size: t = q.md }) {
|
|
|
14649
14649
|
strokeLinecap: "butt",
|
|
14650
14650
|
strokeLinejoin: "miter",
|
|
14651
14651
|
strokeMiterlimit: 10,
|
|
14652
|
-
fill: e,
|
|
14653
14652
|
fillRule: "nonzero",
|
|
14654
14653
|
opacity: 1
|
|
14655
14654
|
},
|
|
@@ -14663,7 +14662,6 @@ function _a({ className: e = "", size: t = q.md }) {
|
|
|
14663
14662
|
strokeLinecap: "butt",
|
|
14664
14663
|
strokeLinejoin: "miter",
|
|
14665
14664
|
strokeMiterlimit: 10,
|
|
14666
|
-
fill: e,
|
|
14667
14665
|
fillRule: "nonzero",
|
|
14668
14666
|
opacity: 1
|
|
14669
14667
|
},
|
|
@@ -34573,41 +34571,74 @@ function Ek({ children: e, lazyFallback: t = null, errorFallback: n = null }) {
|
|
|
34573
34571
|
});
|
|
34574
34572
|
}
|
|
34575
34573
|
//#endregion
|
|
34574
|
+
//#region src/success/SuccessMessage.tsx
|
|
34575
|
+
function Dk({ label: e = "Success" }) {
|
|
34576
|
+
return /* @__PURE__ */ C("div", {
|
|
34577
|
+
className: "text-green-600",
|
|
34578
|
+
children: e
|
|
34579
|
+
});
|
|
34580
|
+
}
|
|
34581
|
+
//#endregion
|
|
34582
|
+
//#region src/toaster/Toaster.tsx
|
|
34583
|
+
var Ok = 1e3;
|
|
34584
|
+
function kk({ message: e, isOpen: t, onClose: n = Yt, duration: r = 2e3, className: i = "" }) {
|
|
34585
|
+
let [a, o] = x("hidden");
|
|
34586
|
+
return g(() => {
|
|
34587
|
+
if (!t) return;
|
|
34588
|
+
o("entering");
|
|
34589
|
+
let e = requestAnimationFrame(() => o("visible"));
|
|
34590
|
+
return () => cancelAnimationFrame(e);
|
|
34591
|
+
}, [t]), g(() => {
|
|
34592
|
+
if (a !== "visible") return;
|
|
34593
|
+
let e = setTimeout(() => o("exiting"), r);
|
|
34594
|
+
return () => clearTimeout(e);
|
|
34595
|
+
}, [a, r]), g(() => {
|
|
34596
|
+
if (a !== "exiting") return;
|
|
34597
|
+
let e = setTimeout(() => {
|
|
34598
|
+
o("hidden"), n();
|
|
34599
|
+
}, Ok);
|
|
34600
|
+
return () => clearTimeout(e);
|
|
34601
|
+
}, [a, n]), a === "hidden" ? null : /* @__PURE__ */ C("div", {
|
|
34602
|
+
className: `fixed bottom-6 left-1/2 -translate-x-1/2 z-[100] px-4 py-2 rounded-md shadow-lg transition-all ease-out ${a === "visible" ? "duration-300 opacity-100 translate-y-0" : a === "exiting" ? "duration-1000 opacity-0 translate-y-4" : "duration-300 opacity-0 translate-y-4"} ${i}`,
|
|
34603
|
+
children: e
|
|
34604
|
+
});
|
|
34605
|
+
}
|
|
34606
|
+
//#endregion
|
|
34576
34607
|
//#region src/tags/Tag.tsx
|
|
34577
|
-
var
|
|
34608
|
+
var Ak = [
|
|
34578
34609
|
"text-lime-700 border border-lime-700 bg-white",
|
|
34579
34610
|
"text-violet-600 border border-violet-600 bg-white",
|
|
34580
34611
|
"text-blue-500 border border-blue-500 bg-white",
|
|
34581
34612
|
"text-slate-300 border border-slate-300 bg-white",
|
|
34582
34613
|
"text-cyan-600 border border-cyan-600 bg-white",
|
|
34583
34614
|
"text-yellow-700 border border-yellow-700 bg-white"
|
|
34584
|
-
],
|
|
34615
|
+
], jk = [
|
|
34585
34616
|
"bg-lime-700 text-white",
|
|
34586
34617
|
"bg-violet-600 text-white",
|
|
34587
34618
|
"bg-blue-500 text-white",
|
|
34588
34619
|
"bg-slate-300 text-white",
|
|
34589
34620
|
"bg-cyan-600 text-white",
|
|
34590
34621
|
"bg-yellow-700 text-white"
|
|
34591
|
-
],
|
|
34592
|
-
let n =
|
|
34593
|
-
return t ?
|
|
34622
|
+
], Mk = 6, Nk = (e) => (typeof e == "string" && (e = sn(e)), Math.abs(Math.floor(e)) % Mk), Pk = (e, t) => {
|
|
34623
|
+
let n = Nk(e);
|
|
34624
|
+
return t ? jk[n] : Ak[n];
|
|
34594
34625
|
};
|
|
34595
|
-
function
|
|
34626
|
+
function Fk({ label: e, onClick: t = Yt, className: n = "", labelSize: r = "base", isHighlighted: i = !1, color: a = 0 }) {
|
|
34596
34627
|
return /* @__PURE__ */ C(Va, {
|
|
34597
34628
|
onClick: t,
|
|
34598
|
-
className: G("Tag w-fit h-fit px-1 rounded-full", n, `text-${r}`,
|
|
34629
|
+
className: G("Tag w-fit h-fit px-1 rounded-full", n, `text-${r}`, Pk(a, i)),
|
|
34599
34630
|
children: e
|
|
34600
34631
|
});
|
|
34601
34632
|
}
|
|
34602
34633
|
//#endregion
|
|
34603
34634
|
//#region src/tags/Tags.tsx
|
|
34604
|
-
function
|
|
34635
|
+
function Ik({ tags: e, highlightedTagIndex: t, className: n = "" }) {
|
|
34605
34636
|
return /* @__PURE__ */ C(Ya, {
|
|
34606
34637
|
className: G("Tags flex flex-wrap gap-1", n),
|
|
34607
34638
|
items: e,
|
|
34608
34639
|
itemRenderer: (e, n) => {
|
|
34609
34640
|
let r = typeof t == "number" ? n === t : void 0;
|
|
34610
|
-
return /* @__PURE__ */ C(
|
|
34641
|
+
return /* @__PURE__ */ C(Fk, {
|
|
34611
34642
|
...e,
|
|
34612
34643
|
...r === void 0 ? {} : { isHighlighted: r }
|
|
34613
34644
|
}, n);
|
|
@@ -34616,7 +34647,7 @@ function Nk({ tags: e, highlightedTagIndex: t, className: n = "" }) {
|
|
|
34616
34647
|
}
|
|
34617
34648
|
//#endregion
|
|
34618
34649
|
//#region src/Text.tsx
|
|
34619
|
-
function
|
|
34650
|
+
function Lk({ text: e, onClick: t = Yt, className: n = "", isHighlighted: r = !1 }) {
|
|
34620
34651
|
return /* @__PURE__ */ C(Va, {
|
|
34621
34652
|
onClick: t,
|
|
34622
34653
|
className: G("Text", r ? "text-blue-500" : "text-gray-500", n),
|
|
@@ -34625,7 +34656,7 @@ function Pk({ text: e, onClick: t = Yt, className: n = "", isHighlighted: r = !1
|
|
|
34625
34656
|
}
|
|
34626
34657
|
//#endregion
|
|
34627
34658
|
//#region src/ShowMore.tsx
|
|
34628
|
-
function
|
|
34659
|
+
function Rk({ onClick: e = Yt, className: t = "" }) {
|
|
34629
34660
|
return /* @__PURE__ */ C(Va, {
|
|
34630
34661
|
onClick: e,
|
|
34631
34662
|
className: G("ShowMore font-bold text-gray-700", t),
|
|
@@ -34634,7 +34665,7 @@ function Fk({ onClick: e = Yt, className: t = "" }) {
|
|
|
34634
34665
|
}
|
|
34635
34666
|
//#endregion
|
|
34636
34667
|
//#region src/carousel/Carousel.tsx
|
|
34637
|
-
function
|
|
34668
|
+
function zk({ children: e, className: t = "w-50" }) {
|
|
34638
34669
|
return /* @__PURE__ */ C("div", {
|
|
34639
34670
|
className: G("Carousel", t),
|
|
34640
34671
|
children: /* @__PURE__ */ C(Te, {
|
|
@@ -34654,7 +34685,7 @@ function Ik({ children: e, className: t = "w-50" }) {
|
|
|
34654
34685
|
}
|
|
34655
34686
|
//#endregion
|
|
34656
34687
|
//#region src/avatar/LetterAvatar.tsx
|
|
34657
|
-
function
|
|
34688
|
+
function Bk({ letter: e, className: t = "", onClick: n }) {
|
|
34658
34689
|
return /* @__PURE__ */ C(Va, {
|
|
34659
34690
|
onClick: n,
|
|
34660
34691
|
className: G("LetterAvatar flex items-center justify-center rounded-full w-full h-full bg-blue-300 text-white font-bold", t),
|
|
@@ -34682,14 +34713,14 @@ function Lk({ letter: e, className: t = "", onClick: n }) {
|
|
|
34682
34713
|
}
|
|
34683
34714
|
//#endregion
|
|
34684
34715
|
//#region src/avatar/Avatar.tsx
|
|
34685
|
-
function
|
|
34716
|
+
function Vk({ label: e = "N", className: t = "w-full h-full", imgSrc: n = "", fallbackImgSrc: r = "", onClick: i = Yt }) {
|
|
34686
34717
|
return n || r ? /* @__PURE__ */ C(Vo, {
|
|
34687
34718
|
className: G("Avatar rounded-full w-full h-full", t),
|
|
34688
34719
|
src: n,
|
|
34689
34720
|
fallbackSrc: r,
|
|
34690
34721
|
alt: e,
|
|
34691
34722
|
onClick: i
|
|
34692
|
-
}) : /* @__PURE__ */ C(
|
|
34723
|
+
}) : /* @__PURE__ */ C(Bk, {
|
|
34693
34724
|
className: `LetterAvatar ${t}`,
|
|
34694
34725
|
onClick: i,
|
|
34695
34726
|
letter: e
|
|
@@ -34697,10 +34728,10 @@ function Rk({ label: e = "N", className: t = "w-full h-full", imgSrc: n = "", fa
|
|
|
34697
34728
|
}
|
|
34698
34729
|
//#endregion
|
|
34699
34730
|
//#region src/avatar/AvatarTag.tsx
|
|
34700
|
-
function
|
|
34731
|
+
function Hk({ label: e = "N", onClick: t = Yt, className: n = "", imgSrc: r = "", fallbackImgSrc: i = "", avatarClassName: a = "w-8 h-8" }) {
|
|
34701
34732
|
return /* @__PURE__ */ w(Wo, {
|
|
34702
34733
|
className: G("AvatarTag bg-white rounded-lg py-1", n),
|
|
34703
|
-
children: [/* @__PURE__ */ C(
|
|
34734
|
+
children: [/* @__PURE__ */ C(Vk, {
|
|
34704
34735
|
className: a,
|
|
34705
34736
|
onClick: t,
|
|
34706
34737
|
label: e?.charAt(0).toUpperCase(),
|
|
@@ -34714,12 +34745,12 @@ function zk({ label: e = "N", onClick: t = Yt, className: n = "", imgSrc: r = ""
|
|
|
34714
34745
|
}
|
|
34715
34746
|
//#endregion
|
|
34716
34747
|
//#region src/avatar/AvatarTimeTag.tsx
|
|
34717
|
-
function
|
|
34748
|
+
function Uk({ label: e = "N", time: t, onClick: n = Yt, className: r = "", avatarClassName: i = "h-11 w-11", imgSrc: a = "", fallbackImgSrc: o }) {
|
|
34718
34749
|
return /* @__PURE__ */ w(Wo, {
|
|
34719
34750
|
className: G("AvatarTimeTag bg-white rounded-lg py-1", r),
|
|
34720
34751
|
children: [/* @__PURE__ */ C("div", {
|
|
34721
34752
|
className: G("rounded-full overflow-hidden", i),
|
|
34722
|
-
children: /* @__PURE__ */ C(
|
|
34753
|
+
children: /* @__PURE__ */ C(Vk, {
|
|
34723
34754
|
className: "w-full h-full",
|
|
34724
34755
|
onClick: n,
|
|
34725
34756
|
label: e?.charAt(0).toUpperCase(),
|
|
@@ -34741,7 +34772,7 @@ function Bk({ label: e = "N", time: t, onClick: n = Yt, className: r = "", avata
|
|
|
34741
34772
|
}
|
|
34742
34773
|
//#endregion
|
|
34743
34774
|
//#region src/images/mediaUpload/MediaUploadPreview.tsx
|
|
34744
|
-
function
|
|
34775
|
+
function Wk({ file: e, objectUrl: t, onRemove: n, className: r = "", imgClassName: i = "" }) {
|
|
34745
34776
|
return /* @__PURE__ */ w("div", {
|
|
34746
34777
|
className: G("relative flex-shrink-0", r),
|
|
34747
34778
|
children: [/* @__PURE__ */ C(Bo, {
|
|
@@ -34759,15 +34790,15 @@ function Vk({ file: e, objectUrl: t, onRemove: n, className: r = "", imgClassNam
|
|
|
34759
34790
|
}
|
|
34760
34791
|
//#endregion
|
|
34761
34792
|
//#region src/images/useFileInput.tsx
|
|
34762
|
-
var
|
|
34793
|
+
var Gk = "image/jpeg,image/png,image/webp,image/avif,image/bmp,image/svg+xml,image/tiff,image/heic,image/heif", Kk = [
|
|
34763
34794
|
"video/",
|
|
34764
34795
|
"image/gif",
|
|
34765
34796
|
"image/apng"
|
|
34766
34797
|
];
|
|
34767
|
-
function
|
|
34768
|
-
return !
|
|
34798
|
+
function qk(e) {
|
|
34799
|
+
return !Kk.some((t) => e.type === t || e.type.startsWith(t));
|
|
34769
34800
|
}
|
|
34770
|
-
function
|
|
34801
|
+
function Jk({ onChange: e, accept: t = Gk, multiple: n = !1 }) {
|
|
34771
34802
|
let r = b(null), i = b(e);
|
|
34772
34803
|
return i.current = e, {
|
|
34773
34804
|
inputElement: /* @__PURE__ */ C("input", {
|
|
@@ -34777,7 +34808,7 @@ function Gk({ onChange: e, accept: t = Hk, multiple: n = !1 }) {
|
|
|
34777
34808
|
multiple: n,
|
|
34778
34809
|
className: "hidden",
|
|
34779
34810
|
onChange: (e) => {
|
|
34780
|
-
let t = Array.from(e.target.files ?? []).filter(
|
|
34811
|
+
let t = Array.from(e.target.files ?? []).filter(qk);
|
|
34781
34812
|
e.target.value = "", t.length > 0 && i.current(t);
|
|
34782
34813
|
}
|
|
34783
34814
|
}),
|
|
@@ -34786,12 +34817,12 @@ function Gk({ onChange: e, accept: t = Hk, multiple: n = !1 }) {
|
|
|
34786
34817
|
}
|
|
34787
34818
|
//#endregion
|
|
34788
34819
|
//#region src/images/mediaUpload/MediaUpload.tsx
|
|
34789
|
-
function
|
|
34820
|
+
function Yk({ onChange: e, multiple: t = !0, maxFiles: n = 9, className: r = "", accept: i = Gk, loading: a = !1 }) {
|
|
34790
34821
|
let [o, s] = x([]), [c, l] = x("");
|
|
34791
34822
|
g(() => () => {
|
|
34792
34823
|
o.forEach((e) => URL.revokeObjectURL(e.objectUrl));
|
|
34793
34824
|
}, []);
|
|
34794
|
-
let { inputElement: u, trigger: d } =
|
|
34825
|
+
let { inputElement: u, trigger: d } = Jk({
|
|
34795
34826
|
onChange: (e) => f(e),
|
|
34796
34827
|
accept: i,
|
|
34797
34828
|
multiple: t
|
|
@@ -34818,7 +34849,7 @@ function Kk({ onChange: e, multiple: t = !0, maxFiles: n = 9, className: r = "",
|
|
|
34818
34849
|
children: [
|
|
34819
34850
|
/* @__PURE__ */ w(Wo, {
|
|
34820
34851
|
className: "gap-2 items-end overflow-x-auto",
|
|
34821
|
-
children: [o.map((e, t) => /* @__PURE__ */ C(
|
|
34852
|
+
children: [o.map((e, t) => /* @__PURE__ */ C(Wk, {
|
|
34822
34853
|
file: e.file,
|
|
34823
34854
|
objectUrl: e.objectUrl,
|
|
34824
34855
|
onRemove: () => p(t)
|
|
@@ -34839,7 +34870,7 @@ function Kk({ onChange: e, multiple: t = !0, maxFiles: n = 9, className: r = "",
|
|
|
34839
34870
|
}
|
|
34840
34871
|
//#endregion
|
|
34841
34872
|
//#region src/images/imageGrid/ImageGridBase.tsx
|
|
34842
|
-
var
|
|
34873
|
+
var Xk = 500, Zk = {
|
|
34843
34874
|
background: "transparent",
|
|
34844
34875
|
border: "none",
|
|
34845
34876
|
boxShadow: "none",
|
|
@@ -34847,13 +34878,13 @@ var qk = 500, Jk = {
|
|
|
34847
34878
|
width: "fit-content",
|
|
34848
34879
|
height: "fit-content"
|
|
34849
34880
|
};
|
|
34850
|
-
function
|
|
34881
|
+
function Qk({ onSelect: e, selectedSrc: t, srcs: n, onDelete: r, className: i = "", isMobile: a = !1, extraCell: o }) {
|
|
34851
34882
|
let [s, c] = x(null), l = b(null), u = b(!1), d = () => {
|
|
34852
34883
|
l.current &&= (clearTimeout(l.current), null);
|
|
34853
34884
|
}, f = (e) => {
|
|
34854
34885
|
u.current = !1, d(), l.current = setTimeout(() => {
|
|
34855
34886
|
u.current = !0, c(e);
|
|
34856
|
-
},
|
|
34887
|
+
}, Xk);
|
|
34857
34888
|
}, p = (t) => {
|
|
34858
34889
|
if (u.current) {
|
|
34859
34890
|
u.current = !1;
|
|
@@ -34863,13 +34894,13 @@ function Yk({ onSelect: e, selectedSrc: t, srcs: n, onDelete: r, className: i =
|
|
|
34863
34894
|
}, m = {
|
|
34864
34895
|
overlay: { backgroundColor: "rgba(0, 0, 0, 0.75)" },
|
|
34865
34896
|
content: a ? {
|
|
34866
|
-
...
|
|
34897
|
+
...Zk,
|
|
34867
34898
|
top: "0",
|
|
34868
34899
|
left: "0",
|
|
34869
34900
|
transform: "none",
|
|
34870
34901
|
width: "100vw"
|
|
34871
34902
|
} : {
|
|
34872
|
-
...
|
|
34903
|
+
...Zk,
|
|
34873
34904
|
top: "50%",
|
|
34874
34905
|
left: "50%",
|
|
34875
34906
|
transform: "translate(-50%, -50%)"
|
|
@@ -34965,37 +34996,37 @@ function Yk({ onSelect: e, selectedSrc: t, srcs: n, onDelete: r, className: i =
|
|
|
34965
34996
|
}
|
|
34966
34997
|
//#endregion
|
|
34967
34998
|
//#region src/images/imageGrid/ImageGrid.tsx
|
|
34968
|
-
function
|
|
34969
|
-
return /* @__PURE__ */ C(
|
|
34999
|
+
function $k(e) {
|
|
35000
|
+
return /* @__PURE__ */ C(Qk, { ...e });
|
|
34970
35001
|
}
|
|
34971
35002
|
//#endregion
|
|
34972
35003
|
//#region src/images/imageGrid/ImageGridUpload.tsx
|
|
34973
|
-
var
|
|
35004
|
+
var eA = (e) => e.map((e) => ({
|
|
34974
35005
|
file: e,
|
|
34975
35006
|
objectUrl: URL.createObjectURL(e)
|
|
34976
|
-
})),
|
|
34977
|
-
function
|
|
35007
|
+
})), tA = (e) => e.forEach((e) => URL.revokeObjectURL(e.objectUrl));
|
|
35008
|
+
function nA({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImages: i = 9, uploadLabel: a = "Upload", loading: o = !1, isUploaded: s = !1, ...c }) {
|
|
34978
35009
|
let [l, u] = x([]), [d, f] = x(!1), [p, m] = x(""), h = b(l);
|
|
34979
|
-
h.current = l, g(() => () =>
|
|
34980
|
-
let _ = () => i - c.srcs.length - h.current.length, { inputElement: v, trigger: y } =
|
|
35010
|
+
h.current = l, g(() => () => tA(h.current), []);
|
|
35011
|
+
let _ = () => i - c.srcs.length - h.current.length, { inputElement: v, trigger: y } = Jk({
|
|
34981
35012
|
onChange: (e) => {
|
|
34982
|
-
|
|
35013
|
+
tA(h.current);
|
|
34983
35014
|
let n = i - c.srcs.length, r = e.slice(0, n);
|
|
34984
|
-
m(e.length > n ? `You can only add ${i} images in total.` : ""), u(
|
|
35015
|
+
m(e.length > n ? `You can only add ${i} images in total.` : ""), u(eA(r)), t?.(r), f(!0);
|
|
34985
35016
|
},
|
|
34986
35017
|
multiple: !0
|
|
34987
|
-
}), { inputElement: T, trigger: E } =
|
|
35018
|
+
}), { inputElement: T, trigger: E } = Jk({
|
|
34988
35019
|
onChange: (e) => {
|
|
34989
35020
|
let n = _(), r = e.slice(0, n);
|
|
34990
|
-
m(e.length > n ? `You can only add ${i} images in total.` : ""), u((e) => [...e, ...
|
|
35021
|
+
m(e.length > n ? `You can only add ${i} images in total.` : ""), u((e) => [...e, ...eA(r)]), t?.(r), f(!0);
|
|
34991
35022
|
},
|
|
34992
35023
|
multiple: !0
|
|
34993
35024
|
}), D = (e) => {
|
|
34994
35025
|
u((t) => (URL.revokeObjectURL(t[e].objectUrl), t.filter((t, n) => n !== e))), m("");
|
|
34995
35026
|
}, O = () => {
|
|
34996
|
-
e(l.map((e) => e.file)),
|
|
35027
|
+
e(l.map((e) => e.file)), tA(l), u([]), m("");
|
|
34997
35028
|
}, k = () => {
|
|
34998
|
-
|
|
35029
|
+
tA(l), u([]), f(!1), m("");
|
|
34999
35030
|
};
|
|
35000
35031
|
g(() => {
|
|
35001
35032
|
s && k();
|
|
@@ -35014,7 +35045,7 @@ function $k({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImag
|
|
|
35014
35045
|
return /* @__PURE__ */ w(S, { children: [
|
|
35015
35046
|
v,
|
|
35016
35047
|
T,
|
|
35017
|
-
/* @__PURE__ */ C(
|
|
35048
|
+
/* @__PURE__ */ C(Qk, {
|
|
35018
35049
|
...c,
|
|
35019
35050
|
onDelete: r ? n : void 0,
|
|
35020
35051
|
extraCell: A
|
|
@@ -35030,7 +35061,7 @@ function $k({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImag
|
|
|
35030
35061
|
children: [
|
|
35031
35062
|
/* @__PURE__ */ C(Wo, {
|
|
35032
35063
|
className: "overflow-x-auto gap-2",
|
|
35033
|
-
children: l.map((e, t) => /* @__PURE__ */ C(
|
|
35064
|
+
children: l.map((e, t) => /* @__PURE__ */ C(Wk, {
|
|
35034
35065
|
file: e.file,
|
|
35035
35066
|
objectUrl: e.objectUrl,
|
|
35036
35067
|
onRemove: () => D(t),
|
|
@@ -35063,37 +35094,37 @@ function $k({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImag
|
|
|
35063
35094
|
}
|
|
35064
35095
|
//#endregion
|
|
35065
35096
|
//#region node_modules/tslib/tslib.es6.mjs
|
|
35066
|
-
var
|
|
35067
|
-
return
|
|
35097
|
+
var rA = function(e, t) {
|
|
35098
|
+
return rA = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
|
|
35068
35099
|
e.__proto__ = t;
|
|
35069
35100
|
} || function(e, t) {
|
|
35070
35101
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
35071
|
-
},
|
|
35102
|
+
}, rA(e, t);
|
|
35072
35103
|
};
|
|
35073
|
-
function
|
|
35104
|
+
function iA(e, t) {
|
|
35074
35105
|
if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
35075
|
-
|
|
35106
|
+
rA(e, t);
|
|
35076
35107
|
function n() {
|
|
35077
35108
|
this.constructor = e;
|
|
35078
35109
|
}
|
|
35079
35110
|
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
35080
35111
|
}
|
|
35081
|
-
var
|
|
35082
|
-
return
|
|
35112
|
+
var aA = function() {
|
|
35113
|
+
return aA = Object.assign || function(e) {
|
|
35083
35114
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
35084
35115
|
return e;
|
|
35085
|
-
},
|
|
35116
|
+
}, aA.apply(this, arguments);
|
|
35086
35117
|
};
|
|
35087
|
-
function
|
|
35088
|
-
return this instanceof
|
|
35118
|
+
function oA(e) {
|
|
35119
|
+
return this instanceof oA ? (this.v = e, this) : new oA(e);
|
|
35089
35120
|
}
|
|
35090
|
-
var
|
|
35091
|
-
return
|
|
35121
|
+
var sA = function(e) {
|
|
35122
|
+
return sA = Object.getOwnPropertyNames || function(e) {
|
|
35092
35123
|
var t = [];
|
|
35093
35124
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[t.length] = n);
|
|
35094
35125
|
return t;
|
|
35095
|
-
},
|
|
35096
|
-
},
|
|
35126
|
+
}, sA(e);
|
|
35127
|
+
}, cA = /* @__PURE__ */ t(((e, t) => {
|
|
35097
35128
|
var n = !1, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _;
|
|
35098
35129
|
function v() {
|
|
35099
35130
|
if (!n) {
|
|
@@ -35164,7 +35195,7 @@ var iA = function(e) {
|
|
|
35164
35195
|
}
|
|
35165
35196
|
};
|
|
35166
35197
|
t.exports = y;
|
|
35167
|
-
})),
|
|
35198
|
+
})), lA = /* @__PURE__ */ t(((e, t) => {
|
|
35168
35199
|
var n = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
35169
35200
|
t.exports = {
|
|
35170
35201
|
canUseDOM: n,
|
|
@@ -35173,8 +35204,8 @@ var iA = function(e) {
|
|
|
35173
35204
|
canUseViewport: n && !!window.screen,
|
|
35174
35205
|
isInWorker: !n
|
|
35175
35206
|
};
|
|
35176
|
-
})),
|
|
35177
|
-
var n =
|
|
35207
|
+
})), uA = /* @__PURE__ */ t(((e, t) => {
|
|
35208
|
+
var n = lA(), r;
|
|
35178
35209
|
n.canUseDOM && (r = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== !0);
|
|
35179
35210
|
function i(e, t) {
|
|
35180
35211
|
if (!n.canUseDOM || t && !("addEventListener" in document)) return !1;
|
|
@@ -35186,8 +35217,8 @@ var iA = function(e) {
|
|
|
35186
35217
|
return !a && r && e === "wheel" && (a = document.implementation.hasFeature("Events.wheel", "3.0")), a;
|
|
35187
35218
|
}
|
|
35188
35219
|
t.exports = i;
|
|
35189
|
-
})),
|
|
35190
|
-
var n =
|
|
35220
|
+
})), dA = /* @__PURE__ */ t(((e, t) => {
|
|
35221
|
+
var n = cA(), r = uA(), i = 10, a = 40, o = 800;
|
|
35191
35222
|
function s(e) {
|
|
35192
35223
|
var t = 0, n = 0, r = 0, s = 0;
|
|
35193
35224
|
return "detail" in e && (n = e.detail), "wheelDelta" in e && (n = -e.wheelDelta / 120), "wheelDeltaY" in e && (n = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (t = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = n, n = 0), r = t * i, s = n * i, "deltaY" in e && (s = e.deltaY), "deltaX" in e && (r = e.deltaX), (r || s) && e.deltaMode && (e.deltaMode == 1 ? (r *= a, s *= a) : (r *= o, s *= o)), r && !t && (t = r < 1 ? -1 : 1), s && !n && (n = s < 1 ? -1 : 1), {
|
|
@@ -35200,12 +35231,12 @@ var iA = function(e) {
|
|
|
35200
35231
|
s.getEventType = function() {
|
|
35201
35232
|
return n.firefox() ? "DOMMouseScroll" : r("wheel") ? "wheel" : "mousewheel";
|
|
35202
35233
|
}, t.exports = s;
|
|
35203
|
-
})),
|
|
35204
|
-
t.exports =
|
|
35234
|
+
})), fA = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
35235
|
+
t.exports = dA();
|
|
35205
35236
|
})))(), 1);
|
|
35206
|
-
function
|
|
35237
|
+
function pA(e, t, n, r, i, a) {
|
|
35207
35238
|
a === void 0 && (a = 0);
|
|
35208
|
-
var o =
|
|
35239
|
+
var o = DA(e, t, a), s = o.width, c = o.height, l = Math.min(s, n), u = Math.min(c, r);
|
|
35209
35240
|
return l > u * i ? {
|
|
35210
35241
|
width: u * i,
|
|
35211
35242
|
height: u
|
|
@@ -35214,30 +35245,30 @@ function uA(e, t, n, r, i, a) {
|
|
|
35214
35245
|
height: l / i
|
|
35215
35246
|
};
|
|
35216
35247
|
}
|
|
35217
|
-
function
|
|
35248
|
+
function mA(e) {
|
|
35218
35249
|
return e.width > e.height ? e.width / e.naturalWidth : e.height / e.naturalHeight;
|
|
35219
35250
|
}
|
|
35220
|
-
function
|
|
35251
|
+
function hA(e, t, n, r, i) {
|
|
35221
35252
|
i === void 0 && (i = 0);
|
|
35222
|
-
var a =
|
|
35253
|
+
var a = DA(t.width, t.height, i), o = a.width, s = a.height;
|
|
35223
35254
|
return {
|
|
35224
|
-
x:
|
|
35225
|
-
y:
|
|
35255
|
+
x: gA(e.x, o, n.width, r),
|
|
35256
|
+
y: gA(e.y, s, n.height, r)
|
|
35226
35257
|
};
|
|
35227
35258
|
}
|
|
35228
|
-
function
|
|
35259
|
+
function gA(e, t, n, r) {
|
|
35229
35260
|
var i = Math.abs(t * r / 2 - n / 2);
|
|
35230
|
-
return
|
|
35261
|
+
return OA(e, -i, i);
|
|
35231
35262
|
}
|
|
35232
|
-
function
|
|
35263
|
+
function _A(e, t) {
|
|
35233
35264
|
return Math.sqrt((e.y - t.y) ** 2 + (e.x - t.x) ** 2);
|
|
35234
35265
|
}
|
|
35235
|
-
function
|
|
35266
|
+
function vA(e, t) {
|
|
35236
35267
|
return Math.atan2(t.y - e.y, t.x - e.x) * 180 / Math.PI;
|
|
35237
35268
|
}
|
|
35238
|
-
function
|
|
35269
|
+
function yA(e, t, n, r, i, a, o) {
|
|
35239
35270
|
a === void 0 && (a = 0), o === void 0 && (o = !0);
|
|
35240
|
-
var s = o ?
|
|
35271
|
+
var s = o ? bA : xA, c = DA(t.width, t.height, a), l = DA(t.naturalWidth, t.naturalHeight, a), u = {
|
|
35241
35272
|
x: s(100, ((c.width - n.width / i) / 2 - e.x / i) / c.width * 100),
|
|
35242
35273
|
y: s(100, ((c.height - n.height / i) / 2 - e.y / i) / c.height * 100),
|
|
35243
35274
|
width: s(100, n.width / c.width * 100 / i),
|
|
@@ -35251,20 +35282,20 @@ function gA(e, t, n, r, i, a, o) {
|
|
|
35251
35282
|
};
|
|
35252
35283
|
return {
|
|
35253
35284
|
croppedAreaPercentages: u,
|
|
35254
|
-
croppedAreaPixels:
|
|
35285
|
+
croppedAreaPixels: aA(aA({}, p), {
|
|
35255
35286
|
x: Math.round(s(l.width - p.width, u.x * l.width / 100)),
|
|
35256
35287
|
y: Math.round(s(l.height - p.height, u.y * l.height / 100))
|
|
35257
35288
|
})
|
|
35258
35289
|
};
|
|
35259
35290
|
}
|
|
35260
|
-
function
|
|
35291
|
+
function bA(e, t) {
|
|
35261
35292
|
return Math.min(e, Math.max(0, t));
|
|
35262
35293
|
}
|
|
35263
|
-
function
|
|
35294
|
+
function xA(e, t) {
|
|
35264
35295
|
return t;
|
|
35265
35296
|
}
|
|
35266
|
-
function
|
|
35267
|
-
var o =
|
|
35297
|
+
function SA(e, t, n, r, i, a) {
|
|
35298
|
+
var o = DA(t.width, t.height, n), s = OA(r.width / o.width * (100 / e.width), i, a);
|
|
35268
35299
|
return {
|
|
35269
35300
|
crop: {
|
|
35270
35301
|
x: s * o.width / 2 - r.width / 2 - o.width * s * (e.x / 100),
|
|
@@ -35273,13 +35304,13 @@ function yA(e, t, n, r, i, a) {
|
|
|
35273
35304
|
zoom: s
|
|
35274
35305
|
};
|
|
35275
35306
|
}
|
|
35276
|
-
function
|
|
35277
|
-
var r =
|
|
35307
|
+
function CA(e, t, n) {
|
|
35308
|
+
var r = mA(t);
|
|
35278
35309
|
return n.height > n.width ? n.height / (e.height * r) : n.width / (e.width * r);
|
|
35279
35310
|
}
|
|
35280
|
-
function
|
|
35311
|
+
function wA(e, t, n, r, i, a) {
|
|
35281
35312
|
n === void 0 && (n = 0);
|
|
35282
|
-
var o =
|
|
35313
|
+
var o = DA(t.naturalWidth, t.naturalHeight, n), s = OA(CA(e, t, r), i, a), c = r.height > r.width ? r.height / e.height : r.width / e.width;
|
|
35283
35314
|
return {
|
|
35284
35315
|
crop: {
|
|
35285
35316
|
x: ((o.width - e.width) / 2 - e.x) * c,
|
|
@@ -35288,32 +35319,32 @@ function xA(e, t, n, r, i, a) {
|
|
|
35288
35319
|
zoom: s
|
|
35289
35320
|
};
|
|
35290
35321
|
}
|
|
35291
|
-
function
|
|
35322
|
+
function TA(e, t) {
|
|
35292
35323
|
return {
|
|
35293
35324
|
x: (t.x + e.x) / 2,
|
|
35294
35325
|
y: (t.y + e.y) / 2
|
|
35295
35326
|
};
|
|
35296
35327
|
}
|
|
35297
|
-
function
|
|
35328
|
+
function EA(e) {
|
|
35298
35329
|
return e * Math.PI / 180;
|
|
35299
35330
|
}
|
|
35300
|
-
function
|
|
35301
|
-
var r =
|
|
35331
|
+
function DA(e, t, n) {
|
|
35332
|
+
var r = EA(n);
|
|
35302
35333
|
return {
|
|
35303
35334
|
width: Math.abs(Math.cos(r) * e) + Math.abs(Math.sin(r) * t),
|
|
35304
35335
|
height: Math.abs(Math.sin(r) * e) + Math.abs(Math.cos(r) * t)
|
|
35305
35336
|
};
|
|
35306
35337
|
}
|
|
35307
|
-
function
|
|
35338
|
+
function OA(e, t, n) {
|
|
35308
35339
|
return Math.min(Math.max(e, t), n);
|
|
35309
35340
|
}
|
|
35310
|
-
function
|
|
35341
|
+
function kA() {
|
|
35311
35342
|
return [...arguments].filter(function(e) {
|
|
35312
35343
|
return typeof e == "string" && e.length > 0;
|
|
35313
35344
|
}).join(" ").trim();
|
|
35314
35345
|
}
|
|
35315
|
-
var
|
|
35316
|
-
|
|
35346
|
+
var AA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n", jA = 1, MA = 3, NA = 1, PA = function(e) {
|
|
35347
|
+
iA(t, e);
|
|
35317
35348
|
function t() {
|
|
35318
35349
|
var r = e !== null && e.apply(this, arguments) || this;
|
|
35319
35350
|
return r.cropperRef = n.createRef(), r.imageRef = n.createRef(), r.videoRef = n.createRef(), r.containerPosition = {
|
|
@@ -35356,10 +35387,10 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35356
35387
|
e && (r.previousCropSize = e, r.emitCropData(), r.setInitialCrop(e), r.isInitialized = !0), r.props.onMediaLoaded && r.props.onMediaLoaded(r.mediaSize);
|
|
35357
35388
|
}, r.setInitialCrop = function(e) {
|
|
35358
35389
|
if (r.props.initialCroppedAreaPercentages) {
|
|
35359
|
-
var t =
|
|
35390
|
+
var t = SA(r.props.initialCroppedAreaPercentages, r.mediaSize, r.props.rotation, e, r.props.minZoom, r.props.maxZoom), n = t.crop, i = t.zoom;
|
|
35360
35391
|
r.props.onCropChange(n), r.props.onZoomChange && r.props.onZoomChange(i);
|
|
35361
35392
|
} else if (r.props.initialCroppedAreaPixels) {
|
|
35362
|
-
var a =
|
|
35393
|
+
var a = wA(r.props.initialCroppedAreaPixels, r.mediaSize, r.props.rotation, e, r.props.minZoom, r.props.maxZoom), n = a.crop, i = a.zoom;
|
|
35363
35394
|
r.props.onCropChange(n), r.props.onZoomChange && r.props.onZoomChange(i);
|
|
35364
35395
|
}
|
|
35365
35396
|
}, r.computeSizes = function() {
|
|
@@ -35395,11 +35426,11 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35395
35426
|
width: e.offsetWidth,
|
|
35396
35427
|
height: e.offsetHeight
|
|
35397
35428
|
};
|
|
35398
|
-
r.mediaSize =
|
|
35429
|
+
r.mediaSize = aA(aA({}, s), {
|
|
35399
35430
|
naturalWidth: n,
|
|
35400
35431
|
naturalHeight: i
|
|
35401
35432
|
}), r.props.setMediaSize && r.props.setMediaSize(r.mediaSize);
|
|
35402
|
-
var c = r.props.cropSize ? r.props.cropSize :
|
|
35433
|
+
var c = r.props.cropSize ? r.props.cropSize : pA(r.mediaSize.width, r.mediaSize.height, r.containerRect.width, r.containerRect.height, r.props.aspect, r.props.rotation);
|
|
35403
35434
|
return (r.state.cropSize?.height !== c.height || r.state.cropSize?.width !== c.width) && r.props.onCropSizeChange && r.props.onCropSizeChange(c), r.setState({ cropSize: c }, r.recomputeCropPosition), r.props.setCropSize && r.props.setCropSize(c), c;
|
|
35404
35435
|
}
|
|
35405
35436
|
}, r.saveContainerPosition = function() {
|
|
@@ -35437,7 +35468,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35437
35468
|
r.dragStartPosition = {
|
|
35438
35469
|
x: e.x,
|
|
35439
35470
|
y: e.y
|
|
35440
|
-
}, r.dragStartCrop =
|
|
35471
|
+
}, r.dragStartCrop = aA({}, r.props.crop), (t = r.props).onInteractionStart?.call(t);
|
|
35441
35472
|
}, r.onDrag = function(e) {
|
|
35442
35473
|
var t = e.x, n = e.y;
|
|
35443
35474
|
r.currentWindow && (r.rafDragTimeout && r.currentWindow.cancelAnimationFrame(r.rafDragTimeout), r.rafDragTimeout = r.currentWindow.requestAnimationFrame(function() {
|
|
@@ -35445,7 +35476,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35445
35476
|
var e = t - r.dragStartPosition.x, i = n - r.dragStartPosition.y, a = {
|
|
35446
35477
|
x: r.dragStartCrop.x + e,
|
|
35447
35478
|
y: r.dragStartCrop.y + i
|
|
35448
|
-
}, o = r.props.restrictPosition ?
|
|
35479
|
+
}, o = r.props.restrictPosition ? hA(a, r.mediaSize, r.state.cropSize, r.props.zoom, r.props.rotation) : a;
|
|
35449
35480
|
r.props.onCropChange(o);
|
|
35450
35481
|
}
|
|
35451
35482
|
}));
|
|
@@ -35455,7 +35486,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35455
35486
|
}, r.onWheel = function(e) {
|
|
35456
35487
|
if (r.currentWindow && !(r.props.onWheelRequest && !r.props.onWheelRequest(e))) {
|
|
35457
35488
|
e.preventDefault();
|
|
35458
|
-
var n = t.getMousePoint(e), i = (0,
|
|
35489
|
+
var n = t.getMousePoint(e), i = (0, fA.default)(e).pixelY, a = r.props.zoom - i * r.props.zoomSpeed / 200;
|
|
35459
35490
|
r.setNewZoom(a, n, { shouldUpdatePosition: !0 }), r.state.hasWheelJustStarted || r.setState({ hasWheelJustStarted: !0 }, function() {
|
|
35460
35491
|
var e;
|
|
35461
35492
|
return (e = r.props).onInteractionStart?.call(e);
|
|
@@ -35482,18 +35513,18 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35482
35513
|
}, r.setNewZoom = function(e, t, n) {
|
|
35483
35514
|
var i = (n === void 0 ? {} : n).shouldUpdatePosition, a = i === void 0 || i;
|
|
35484
35515
|
if (!(!r.state.cropSize || !r.props.onZoomChange)) {
|
|
35485
|
-
var o =
|
|
35516
|
+
var o = OA(e, r.props.minZoom, r.props.maxZoom);
|
|
35486
35517
|
if (a) {
|
|
35487
35518
|
var s = r.getPointOnContainer(t, r.containerPosition), c = r.getPointOnMedia(s), l = {
|
|
35488
35519
|
x: c.x * o - s.x,
|
|
35489
35520
|
y: c.y * o - s.y
|
|
35490
|
-
}, u = r.props.restrictPosition ?
|
|
35521
|
+
}, u = r.props.restrictPosition ? hA(l, r.mediaSize, r.state.cropSize, o, r.props.rotation) : l;
|
|
35491
35522
|
r.props.onCropChange(u);
|
|
35492
35523
|
}
|
|
35493
35524
|
r.props.onZoomChange(o);
|
|
35494
35525
|
}
|
|
35495
35526
|
}, r.getCropData = function() {
|
|
35496
|
-
return r.state.cropSize ?
|
|
35527
|
+
return r.state.cropSize ? yA(r.props.restrictPosition ? hA(r.props.crop, r.mediaSize, r.state.cropSize, r.props.zoom, r.props.rotation) : r.props.crop, r.mediaSize, r.state.cropSize, r.getAspect(), r.props.zoom, r.props.rotation, r.props.restrictPosition) : null;
|
|
35497
35528
|
}, r.emitCropData = function() {
|
|
35498
35529
|
var e = r.getCropData();
|
|
35499
35530
|
if (e) {
|
|
@@ -35516,14 +35547,14 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35516
35547
|
y: r.props.crop.y * n
|
|
35517
35548
|
};
|
|
35518
35549
|
}
|
|
35519
|
-
var i = r.props.restrictPosition ?
|
|
35550
|
+
var i = r.props.restrictPosition ? hA(e, r.mediaSize, r.state.cropSize, r.props.zoom, r.props.rotation) : e;
|
|
35520
35551
|
r.previousCropSize = r.state.cropSize, r.props.onCropChange(i), r.emitCropData();
|
|
35521
35552
|
}
|
|
35522
35553
|
}, r.onKeyDown = function(e) {
|
|
35523
35554
|
var t, n = r.props, i = n.crop, a = n.onCropChange, o = n.keyboardStep, s = n.zoom, c = n.rotation, l = o;
|
|
35524
35555
|
if (r.state.cropSize) {
|
|
35525
35556
|
e.shiftKey && (l *= .2);
|
|
35526
|
-
var u =
|
|
35557
|
+
var u = aA({}, i);
|
|
35527
35558
|
switch (e.key) {
|
|
35528
35559
|
case "ArrowUp":
|
|
35529
35560
|
u.y -= l, e.preventDefault();
|
|
@@ -35539,7 +35570,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35539
35570
|
break;
|
|
35540
35571
|
default: return;
|
|
35541
35572
|
}
|
|
35542
|
-
r.props.restrictPosition && (u =
|
|
35573
|
+
r.props.restrictPosition && (u = hA(u, r.mediaSize, r.state.cropSize, s, c)), e.repeat || (t = r.props).onInteractionStart?.call(t), a(u);
|
|
35543
35574
|
}
|
|
35544
35575
|
}, r.onKeyUp = function(e) {
|
|
35545
35576
|
var t;
|
|
@@ -35556,7 +35587,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35556
35587
|
}, r;
|
|
35557
35588
|
}
|
|
35558
35589
|
return t.prototype.componentDidMount = function() {
|
|
35559
|
-
!this.currentDoc || !this.currentWindow || (this.containerRef && (this.containerRef.ownerDocument && (this.currentDoc = this.containerRef.ownerDocument), this.currentDoc.defaultView && (this.currentWindow = this.currentDoc.defaultView), this.initResizeObserver(), window.ResizeObserver === void 0 && this.currentWindow.addEventListener("resize", this.computeSizes), this.props.zoomWithScroll && this.containerRef.addEventListener("wheel", this.onWheel, { passive: !1 }), this.containerRef.addEventListener("gesturestart", this.onGestureStart)), this.currentDoc.addEventListener("scroll", this.onScroll), this.props.disableAutomaticStylesInjection || (this.styleRef = this.currentDoc.createElement("style"), this.styleRef.setAttribute("type", "text/css"), this.props.nonce && this.styleRef.setAttribute("nonce", this.props.nonce), this.styleRef.innerHTML =
|
|
35590
|
+
!this.currentDoc || !this.currentWindow || (this.containerRef && (this.containerRef.ownerDocument && (this.currentDoc = this.containerRef.ownerDocument), this.currentDoc.defaultView && (this.currentWindow = this.currentDoc.defaultView), this.initResizeObserver(), window.ResizeObserver === void 0 && this.currentWindow.addEventListener("resize", this.computeSizes), this.props.zoomWithScroll && this.containerRef.addEventListener("wheel", this.onWheel, { passive: !1 }), this.containerRef.addEventListener("gesturestart", this.onGestureStart)), this.currentDoc.addEventListener("scroll", this.onScroll), this.props.disableAutomaticStylesInjection || (this.styleRef = this.currentDoc.createElement("style"), this.styleRef.setAttribute("type", "text/css"), this.props.nonce && this.styleRef.setAttribute("nonce", this.props.nonce), this.styleRef.innerHTML = AA, this.currentDoc.head.appendChild(this.styleRef)), this.imageRef.current && this.imageRef.current.complete && this.onMediaLoad(), this.props.setImageRef && this.props.setImageRef(this.imageRef), this.props.setVideoRef && this.props.setVideoRef(this.videoRef), this.props.setCropperRef && this.props.setCropperRef(this.cropperRef));
|
|
35560
35591
|
}, t.prototype.componentWillUnmount = function() {
|
|
35561
35592
|
!this.currentDoc || !this.currentWindow || (window.ResizeObserver === void 0 && this.currentWindow.removeEventListener("resize", this.computeSizes), this.resizeObserver?.disconnect(), this.containerRef && this.containerRef.removeEventListener("gesturestart", this.preventZoomSafari), this.styleRef && this.styleRef.parentNode?.removeChild(this.styleRef), this.cleanEvents(), this.props.zoomWithScroll && this.clearScrollEvent());
|
|
35562
35593
|
}, t.prototype.componentDidUpdate = function(e) {
|
|
@@ -35578,15 +35609,15 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35578
35609
|
return this.props.objectFit;
|
|
35579
35610
|
}, t.prototype.onPinchStart = function(e) {
|
|
35580
35611
|
var n = t.getTouchPoint(e.touches[0]), r = t.getTouchPoint(e.touches[1]);
|
|
35581
|
-
this.lastPinchDistance =
|
|
35612
|
+
this.lastPinchDistance = _A(n, r), this.lastPinchRotation = vA(n, r), this.onDragStart(TA(n, r));
|
|
35582
35613
|
}, t.prototype.onPinchMove = function(e) {
|
|
35583
35614
|
var n = this;
|
|
35584
35615
|
if (!(!this.currentDoc || !this.currentWindow)) {
|
|
35585
|
-
var r = t.getTouchPoint(e.touches[0]), i = t.getTouchPoint(e.touches[1]), a =
|
|
35616
|
+
var r = t.getTouchPoint(e.touches[0]), i = t.getTouchPoint(e.touches[1]), a = TA(r, i);
|
|
35586
35617
|
this.onDrag(a), this.rafPinchTimeout && this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout), this.rafPinchTimeout = this.currentWindow.requestAnimationFrame(function() {
|
|
35587
|
-
var e =
|
|
35618
|
+
var e = _A(r, i), t = n.props.zoom * (e / n.lastPinchDistance);
|
|
35588
35619
|
n.setNewZoom(t, a, { shouldUpdatePosition: !1 }), n.lastPinchDistance = e;
|
|
35589
|
-
var o =
|
|
35620
|
+
var o = vA(r, i), s = n.props.rotation + (o - n.lastPinchRotation);
|
|
35590
35621
|
n.props.onRotationChange && n.props.onRotationChange(s), n.lastPinchRotation = o;
|
|
35591
35622
|
});
|
|
35592
35623
|
}
|
|
@@ -35600,31 +35631,31 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35600
35631
|
},
|
|
35601
35632
|
"data-testid": "container",
|
|
35602
35633
|
style: _,
|
|
35603
|
-
className:
|
|
35604
|
-
}, r ? n.createElement("img",
|
|
35634
|
+
className: kA("reactEasyCrop_Container", x)
|
|
35635
|
+
}, r ? n.createElement("img", aA({
|
|
35605
35636
|
alt: "",
|
|
35606
|
-
className:
|
|
35637
|
+
className: kA("reactEasyCrop_Image", w === "contain" && "reactEasyCrop_Contain", w === "horizontal-cover" && "reactEasyCrop_Cover_Horizontal", w === "vertical-cover" && "reactEasyCrop_Cover_Vertical", C)
|
|
35607
35638
|
}, a, {
|
|
35608
35639
|
src: r,
|
|
35609
35640
|
ref: this.imageRef,
|
|
35610
|
-
style:
|
|
35641
|
+
style: aA(aA({}, y), { transform: s || `translate(${l}px, ${u}px) rotate(${d}deg) scale(${f})` }),
|
|
35611
35642
|
onLoad: this.onMediaLoad
|
|
35612
|
-
})) : i && n.createElement("video",
|
|
35643
|
+
})) : i && n.createElement("video", aA({
|
|
35613
35644
|
autoPlay: !0,
|
|
35614
35645
|
playsInline: !0,
|
|
35615
35646
|
loop: !0,
|
|
35616
35647
|
muted: !0,
|
|
35617
|
-
className:
|
|
35648
|
+
className: kA("reactEasyCrop_Video", w === "contain" && "reactEasyCrop_Contain", w === "horizontal-cover" && "reactEasyCrop_Cover_Horizontal", w === "vertical-cover" && "reactEasyCrop_Cover_Vertical", C)
|
|
35618
35649
|
}, a, {
|
|
35619
35650
|
ref: this.videoRef,
|
|
35620
35651
|
onLoadedMetadata: this.onMediaLoad,
|
|
35621
|
-
style:
|
|
35652
|
+
style: aA(aA({}, y), { transform: s || `translate(${l}px, ${u}px) rotate(${d}deg) scale(${f})` }),
|
|
35622
35653
|
controls: !1
|
|
35623
35654
|
}), (Array.isArray(i) ? i : [{ src: i }]).map(function(e) {
|
|
35624
|
-
return n.createElement("source",
|
|
35625
|
-
})), this.state.cropSize && n.createElement("div",
|
|
35655
|
+
return n.createElement("source", aA({ key: e.src }, e));
|
|
35656
|
+
})), this.state.cropSize && n.createElement("div", aA({
|
|
35626
35657
|
ref: this.cropperRef,
|
|
35627
|
-
style:
|
|
35658
|
+
style: aA(aA({}, v), {
|
|
35628
35659
|
width: h ? Math.round(this.state.cropSize.width) : this.state.cropSize.width,
|
|
35629
35660
|
height: h ? Math.round(this.state.cropSize.height) : this.state.cropSize.height
|
|
35630
35661
|
}),
|
|
@@ -35632,14 +35663,14 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35632
35663
|
onKeyDown: this.onKeyDown,
|
|
35633
35664
|
onKeyUp: this.onKeyUp,
|
|
35634
35665
|
"data-testid": "cropper",
|
|
35635
|
-
className:
|
|
35666
|
+
className: kA("reactEasyCrop_CropArea", p === "round" && "reactEasyCrop_CropAreaRound", m && "reactEasyCrop_CropAreaGrid", S)
|
|
35636
35667
|
}, o)));
|
|
35637
35668
|
}, t.defaultProps = {
|
|
35638
35669
|
zoom: 1,
|
|
35639
35670
|
rotation: 0,
|
|
35640
35671
|
aspect: 4 / 3,
|
|
35641
|
-
maxZoom:
|
|
35642
|
-
minZoom:
|
|
35672
|
+
maxZoom: MA,
|
|
35673
|
+
minZoom: jA,
|
|
35643
35674
|
cropShape: "rect",
|
|
35644
35675
|
objectFit: "contain",
|
|
35645
35676
|
showGrid: !0,
|
|
@@ -35650,7 +35681,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35650
35681
|
zoomSpeed: 1,
|
|
35651
35682
|
restrictPosition: !0,
|
|
35652
35683
|
zoomWithScroll: !0,
|
|
35653
|
-
keyboardStep:
|
|
35684
|
+
keyboardStep: NA
|
|
35654
35685
|
}, t.getMousePoint = function(e) {
|
|
35655
35686
|
return {
|
|
35656
35687
|
x: Number(e.clientX),
|
|
@@ -35665,7 +35696,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35665
35696
|
}(n.Component);
|
|
35666
35697
|
//#endregion
|
|
35667
35698
|
//#region src/images/imageCropper/ImageCropper.tsx
|
|
35668
|
-
function
|
|
35699
|
+
function FA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error: i, isLoading: a, isCompleted: o, className: s = "" }) {
|
|
35669
35700
|
let c = y(() => e && `${e}${e.includes("?") ? "&" : "?"}t=${Date.now()}`, [e]), [l, u] = x(!1), [d, f] = x(c), [p, h] = x({
|
|
35670
35701
|
x: 0,
|
|
35671
35702
|
y: 0
|
|
@@ -35673,7 +35704,7 @@ function MA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error:
|
|
|
35673
35704
|
g(() => {
|
|
35674
35705
|
o && u(!1);
|
|
35675
35706
|
}, [o]);
|
|
35676
|
-
let { inputElement: E, trigger: D } =
|
|
35707
|
+
let { inputElement: E, trigger: D } = Jk({ onChange: async (e) => {
|
|
35677
35708
|
let t = e[0];
|
|
35678
35709
|
if (!t) return;
|
|
35679
35710
|
let n = await r(t);
|
|
@@ -35723,7 +35754,7 @@ function MA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error:
|
|
|
35723
35754
|
children: [
|
|
35724
35755
|
d ? /* @__PURE__ */ C("div", {
|
|
35725
35756
|
className: "relative w-full h-64",
|
|
35726
|
-
children: /* @__PURE__ */ C(
|
|
35757
|
+
children: /* @__PURE__ */ C(PA, {
|
|
35727
35758
|
image: d,
|
|
35728
35759
|
crop: p,
|
|
35729
35760
|
zoom: _,
|
|
@@ -35769,4 +35800,4 @@ function MA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error:
|
|
|
35769
35800
|
})] });
|
|
35770
35801
|
}
|
|
35771
35802
|
//#endregion
|
|
35772
|
-
export { Wa as A, Ua as ATarget, Fo as AddButton, Yo as AlertWrapper, rC as ArenaTag, as as Autocomplete,
|
|
35803
|
+
export { Wa as A, Ua as ATarget, Fo as AddButton, Yo as AlertWrapper, rC as ArenaTag, as as Autocomplete, Vk as Avatar, Hk as AvatarTag, Uk as AvatarTimeTag, eC as BlockTag, LS as BuddyTag, fo as Button, wo as CacheButton, zS as CalendarTag, zk as Carousel, es as ChatAlert, ls as CheckboxGroup, hC as CityTag, Va as ClickableDiv, Lo as CloseAccountButton, Ra as CloseIcon, cC as CoachTag, iC as CollectionTag, Ho as Column, os as CommentEditor, KS as CommentTag, TC as CommentsSection, Uo as Container, Rs as Coordinates, Bs as CoordinatesUpdater, HS as CopyTag, Ws as Copyright, pC as CreatePostTag, BS as CreateTag, xC as DashedLine, wy as DateDisplay, Iv as DatePicker, Cy as DateRange, Sy as DateTimePicker, qo as Deletable, ss as DuelVersus, La as EditIcon, Ko as EditableBlock, $a as EmailInput, wk as ErrorBoundary, Sk as ErrorMessage, aC as EventTag, Us as ExpandableContainer, IS as ExploreTag, zo as Form, lC as GameTag, qS as GoBackTag, Ga as Heading, PS as HomeTag, FA as ImageCropper, $k as ImageGrid, nA as ImageGridUpload, dC as ImageTag, Bo as Img, Ek as LazyErrorBoundary, uC as LeaderboardTag, SC as LikeSection, Ya as List, oo as LoadingIcon, so as LoadingIndicator, _C as LocationPointTag, WS as LogoutTag, VS as MapTag, oC as MarketTag, Yk as MediaUpload, jS as MenuTooltip, ts as MessageAlert, JS as MessageTag, yC as MiddleDot, jo as Modal, Po as ModalButton, No as ModalItem, Lv as MonthPicker, Vs as MyGeolocationUpdater, is as NavArrows, NS as Navbar, _b as NavigationControlPosition, FS as NearbyTag, RS as NewsfeedTag, Tk as NotFound, $o as NotificationAlert, bC as OrDivider, hk as OrderLabels, _k as OrderPicker, gb as OsmMap, Ka as P, no as PasswordInput, io as PasswordSetup, mk as Picker, fC as PollTag, mC as PostTag, US as PrivateTag, ds as RadioGroup, Mo as RedStar, EC as RepliesSection, ZS as ReportTag, Ha as Row, Io as SaveCancelButtons, Jo as SearchBar, za as SendIcon, tC as SettingsTag, Rk as ShowMore, Vo as SmartImage, Ls as SocialMediaIcon, Ja as Span, Go as StaticColumn, Wo as StaticRow, gC as StreetTag, Do as StyledButton, Dk as SuccessMessage, ho as SvgButton, q as SvgSize, Qo as SvgTag, AS as SvgTooltip, ns as Tabs, Fk as Tag, Ik as Tags, nC as TeamTag, Lk as Text, Qa as TextInput, Ps as TextUpdater, qa as Textarea, Ns as TextareaAutosize, Is as TimeAgo, sg as TimePicker, kk as Toaster, So as ToggleButton, kS as Tooltip, GS as UpArrowTag, sC as UserTag, vC as VerticalLine };
|