@vlprojects-chat/chat 0.10.0 → 0.10.1-release-2024-08-19.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/index.mjs +43 -33
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -56822,7 +56822,14 @@ const gye = (e) => {
|
|
|
56822
56822
|
const { poll: t, voteHandler: n } = e, [r, o] = Be(
|
|
56823
56823
|
t.options.reduce((a, c) => ({ ...a, [c.id]: !1 }), {})
|
|
56824
56824
|
), i = !Object.values(r).find((a) => a), s = (a) => () => {
|
|
56825
|
-
|
|
56825
|
+
if (t.isMultiselect) {
|
|
56826
|
+
o((c) => ({ ...c, [a]: !c[a] }));
|
|
56827
|
+
return;
|
|
56828
|
+
}
|
|
56829
|
+
o((c) => ({
|
|
56830
|
+
...t.options.reduce((u, l) => ({ ...u, [l.id]: !1 }), {}),
|
|
56831
|
+
[a]: !c[a]
|
|
56832
|
+
}));
|
|
56826
56833
|
};
|
|
56827
56834
|
return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
56828
56835
|
/* @__PURE__ */ h.jsx(ye, { container: !0, direction: "column", rowGap: 2, children: t.options.map((a) => /* @__PURE__ */ h.jsx(
|
|
@@ -57041,46 +57048,49 @@ const gye = (e) => {
|
|
|
57041
57048
|
{
|
|
57042
57049
|
name: "PollPortal"
|
|
57043
57050
|
}
|
|
57044
|
-
), Jye = (e) => {
|
|
57045
|
-
const
|
|
57046
|
-
var
|
|
57047
|
-
|
|
57048
|
-
|
|
57049
|
-
|
|
57050
|
-
|
|
57051
|
-
|
|
57052
|
-
|
|
57053
|
-
|
|
57054
|
-
|
|
57055
|
-
|
|
57051
|
+
), Jye = (e, t) => {
|
|
57052
|
+
const n = Sn(null), [r, o] = Be(null), i = Sn(0), s = Sn(100), a = Sn(void 0), c = (v) => {
|
|
57053
|
+
var b;
|
|
57054
|
+
if (!t)
|
|
57055
|
+
return;
|
|
57056
|
+
n.current || (n.current = v);
|
|
57057
|
+
const g = (b = n.current) == null ? void 0 : b.getBoundingClientRect().height;
|
|
57058
|
+
g && (i.current = g / window.innerHeight * 100, u(i.current));
|
|
57059
|
+
}, u = (v) => {
|
|
57060
|
+
if (n.current && (s.current = Math.max(0, Math.min(100, v)), n.current.style.height = `${s.current}vh`, s.current === 0)) {
|
|
57061
|
+
n.current.style.transform = "translateY(100%)";
|
|
57062
|
+
const g = () => {
|
|
57063
|
+
var b;
|
|
57064
|
+
(b = n.current) == null || b.removeEventListener("transitionend", g), e == null || e();
|
|
57056
57065
|
};
|
|
57057
|
-
|
|
57066
|
+
n.current.addEventListener("transitionend", g);
|
|
57058
57067
|
}
|
|
57059
|
-
},
|
|
57060
|
-
|
|
57061
|
-
},
|
|
57062
|
-
if (!
|
|
57068
|
+
}, l = (v) => v instanceof TouchEvent ? v.touches[0].pageY : v.pageY, f = (v) => {
|
|
57069
|
+
a.current = l(v), n.current && n.current.classList.add("dragging");
|
|
57070
|
+
}, p = (v) => {
|
|
57071
|
+
if (!a.current)
|
|
57063
57072
|
return;
|
|
57064
|
-
const
|
|
57065
|
-
|
|
57066
|
-
},
|
|
57067
|
-
if (
|
|
57068
|
-
if (
|
|
57069
|
-
|
|
57073
|
+
const g = l(v), y = (a.current - g) / window.innerHeight * 100;
|
|
57074
|
+
a.current = g, u(s.current + y);
|
|
57075
|
+
}, m = () => {
|
|
57076
|
+
if (i.current && a.current !== void 0) {
|
|
57077
|
+
if (a.current = void 0, n.current && n.current.classList.remove("dragging"), s.current > 75) {
|
|
57078
|
+
u(100);
|
|
57070
57079
|
return;
|
|
57071
57080
|
}
|
|
57072
|
-
if (
|
|
57073
|
-
|
|
57081
|
+
if (s.current < 50) {
|
|
57082
|
+
u(0);
|
|
57074
57083
|
return;
|
|
57075
57084
|
}
|
|
57076
|
-
|
|
57085
|
+
u(i.current);
|
|
57077
57086
|
}
|
|
57078
57087
|
};
|
|
57079
|
-
return bt(() => (
|
|
57080
|
-
|
|
57081
|
-
})
|
|
57082
|
-
|
|
57083
|
-
|
|
57088
|
+
return bt(() => t ? (r == null || r.addEventListener("mousedown", f), r == null || r.addEventListener("touchstart", f), window.addEventListener("mousemove", p), window.addEventListener("touchmove", p), window.addEventListener("mouseup", m), window.addEventListener("touchend", m), () => {
|
|
57089
|
+
r == null || r.addEventListener("mousedown", f), r == null || r.addEventListener("touchstart", f), window.addEventListener("mousemove", p), window.addEventListener("touchmove", p), window.addEventListener("mouseup", m), window.addEventListener("touchend", m);
|
|
57090
|
+
}) : () => {
|
|
57091
|
+
}, [t, r]), {
|
|
57092
|
+
dragRef: o,
|
|
57093
|
+
setInitialHeight: c
|
|
57084
57094
|
};
|
|
57085
57095
|
}, Zye = () => {
|
|
57086
57096
|
let e = document.getElementById(ZO);
|
|
@@ -57091,7 +57101,7 @@ const gye = (e) => {
|
|
|
57091
57101
|
ui: { isMobile: r }
|
|
57092
57102
|
} = Ge(), o = Xye(), i = rn(() => {
|
|
57093
57103
|
e.closePollPortal();
|
|
57094
|
-
}, [e]), { dragRef: s, setInitialHeight: a } = Jye(i), c = (t == null ? void 0 : t.options.find((u) => u.isVoted)) || (t == null ? void 0 : t.isVoted);
|
|
57104
|
+
}, [e]), { dragRef: s, setInitialHeight: a } = Jye(i, r), c = (t == null ? void 0 : t.options.find((u) => u.isVoted)) || (t == null ? void 0 : t.isVoted);
|
|
57095
57105
|
return /* @__PURE__ */ h.jsxs(pv, { container: Zye(), children: [
|
|
57096
57106
|
r && /* @__PURE__ */ h.jsx(
|
|
57097
57107
|
"div",
|