@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.
Files changed (2) hide show
  1. package/dist/index.mjs +43 -33
  2. 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
- !r[a] && !t.isMultiselect && Object.values(r).filter(Boolean).length > 0 || o((c) => ({ ...c, [a]: !c[a] }));
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 t = Sn(null), [n, r] = Be(null), o = Sn(0), i = Sn(100), s = Sn(void 0), a = (m) => {
57046
- var g;
57047
- t.current || (t.current = m);
57048
- const v = (g = t.current) == null ? void 0 : g.getBoundingClientRect().height;
57049
- v && (o.current = v / window.innerHeight * 100, c(o.current));
57050
- }, c = (m) => {
57051
- if (t.current && (i.current = Math.max(0, Math.min(100, m)), t.current.style.height = `${i.current}vh`, i.current === 0)) {
57052
- t.current.style.transform = "translateY(100%)";
57053
- const v = () => {
57054
- var g;
57055
- (g = t.current) == null || g.removeEventListener("transitionend", v), e == null || e();
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
- t.current.addEventListener("transitionend", v);
57066
+ n.current.addEventListener("transitionend", g);
57058
57067
  }
57059
- }, u = (m) => m instanceof TouchEvent ? m.touches[0].pageY : m.pageY, l = (m) => {
57060
- s.current = u(m), t.current && t.current.classList.add("dragging");
57061
- }, f = (m) => {
57062
- if (!s.current)
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 v = u(m), b = (s.current - v) / window.innerHeight * 100;
57065
- s.current = v, c(i.current + b);
57066
- }, p = () => {
57067
- if (o.current && s.current !== void 0) {
57068
- if (s.current = void 0, t.current && t.current.classList.remove("dragging"), i.current > 75) {
57069
- c(100);
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 (i.current < 50) {
57073
- c(0);
57081
+ if (s.current < 50) {
57082
+ u(0);
57074
57083
  return;
57075
57084
  }
57076
- c(o.current);
57085
+ u(i.current);
57077
57086
  }
57078
57087
  };
57079
- return bt(() => (n == null || n.addEventListener("mousedown", l), n == null || n.addEventListener("touchstart", l), window.addEventListener("mousemove", f), window.addEventListener("touchmove", f), window.addEventListener("mouseup", p), window.addEventListener("touchend", p), () => {
57080
- n == null || n.addEventListener("mousedown", l), n == null || n.addEventListener("touchstart", l), window.addEventListener("mousemove", f), window.addEventListener("touchmove", f), window.addEventListener("mouseup", p), window.addEventListener("touchend", p);
57081
- }), [n]), {
57082
- dragRef: r,
57083
- setInitialHeight: a
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",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vlprojects-chat/chat",
3
3
  "author": "vlprojects",
4
- "version": "0.10.0",
4
+ "version": "0.10.1-release-2024-08-19.1",
5
5
  "description": "vlprojects chat",
6
6
  "license": "ISC",
7
7
  "types": "dist/index.d.ts",