@vlprojects-chat/chat 0.9.7 → 0.9.9

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 +45 -35
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -35394,7 +35394,7 @@ const qA = {
35394
35394
  }, _se = () => {
35395
35395
  const e = te.useContext(yS);
35396
35396
  return e ? e.chatSnackbarContainer : null;
35397
- }, Fse = "@vlprojects-chat/chat", Lse = "vlprojects", Vse = "0.9.7", Bse = "VLprojects chat", Use = "ISC", Wse = "dist/index.d.ts", Hse = "./dist/index.mjs", Gse = "./dist/index.mjs", qse = [
35397
+ }, Fse = "@vlprojects-chat/chat", Lse = "vlprojects", Vse = "0.9.9", Bse = "VLprojects chat", Use = "ISC", Wse = "dist/index.d.ts", Hse = "./dist/index.mjs", Gse = "./dist/index.mjs", qse = [
35398
35398
  "dist"
35399
35399
  ], zse = {
35400
35400
  type: "git",
@@ -56818,7 +56818,14 @@ const gye = (e) => {
56818
56818
  const { poll: t, voteHandler: n } = e, [r, o] = Be(
56819
56819
  t.options.reduce((a, c) => ({ ...a, [c.id]: !1 }), {})
56820
56820
  ), i = !Object.values(r).find((a) => a), s = (a) => () => {
56821
- !r[a] && !t.isMultiselect && Object.values(r).filter(Boolean).length > 0 || o((c) => ({ ...c, [a]: !c[a] }));
56821
+ if (t.isMultiselect) {
56822
+ o((c) => ({ ...c, [a]: !c[a] }));
56823
+ return;
56824
+ }
56825
+ o((c) => ({
56826
+ ...t.options.reduce((u, l) => ({ ...u, [l.id]: !1 }), {}),
56827
+ [a]: !c[a]
56828
+ }));
56822
56829
  };
56823
56830
  return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
56824
56831
  /* @__PURE__ */ h.jsx(ye, { container: !0, direction: "column", rowGap: 2, children: t.options.map((a) => /* @__PURE__ */ h.jsx(
@@ -57037,46 +57044,49 @@ const gye = (e) => {
57037
57044
  {
57038
57045
  name: "PollPortal"
57039
57046
  }
57040
- ), Jye = (e) => {
57041
- const t = Sn(null), [n, r] = Be(null), o = Sn(0), i = Sn(100), s = Sn(void 0), a = (m) => {
57042
- var g;
57043
- t.current || (t.current = m);
57044
- const v = (g = t.current) == null ? void 0 : g.getBoundingClientRect().height;
57045
- v && (o.current = v / window.innerHeight * 100, c(o.current));
57046
- }, c = (m) => {
57047
- if (t.current && (i.current = Math.max(0, Math.min(100, m)), t.current.style.height = `${i.current}vh`, i.current === 0)) {
57048
- t.current.style.transform = "translateY(100%)";
57049
- const v = () => {
57050
- var g;
57051
- (g = t.current) == null || g.removeEventListener("transitionend", v), e == null || e();
57047
+ ), Jye = (e, t) => {
57048
+ const n = Sn(null), [r, o] = Be(null), i = Sn(0), s = Sn(100), a = Sn(void 0), c = (v) => {
57049
+ var b;
57050
+ if (!t)
57051
+ return;
57052
+ n.current || (n.current = v);
57053
+ const g = (b = n.current) == null ? void 0 : b.getBoundingClientRect().height;
57054
+ g && (i.current = g / window.innerHeight * 100, u(i.current));
57055
+ }, u = (v) => {
57056
+ if (n.current && (s.current = Math.max(0, Math.min(100, v)), n.current.style.height = `${s.current}vh`, s.current === 0)) {
57057
+ n.current.style.transform = "translateY(100%)";
57058
+ const g = () => {
57059
+ var b;
57060
+ (b = n.current) == null || b.removeEventListener("transitionend", g), e == null || e();
57052
57061
  };
57053
- t.current.addEventListener("transitionend", v);
57062
+ n.current.addEventListener("transitionend", g);
57054
57063
  }
57055
- }, u = (m) => m instanceof TouchEvent ? m.touches[0].pageY : m.pageY, l = (m) => {
57056
- s.current = u(m), t.current && t.current.classList.add("dragging");
57057
- }, f = (m) => {
57058
- if (!s.current)
57064
+ }, l = (v) => v instanceof TouchEvent ? v.touches[0].pageY : v.pageY, f = (v) => {
57065
+ a.current = l(v), n.current && n.current.classList.add("dragging");
57066
+ }, p = (v) => {
57067
+ if (!a.current)
57059
57068
  return;
57060
- const v = u(m), b = (s.current - v) / window.innerHeight * 100;
57061
- s.current = v, c(i.current + b);
57062
- }, p = () => {
57063
- if (o.current && s.current !== void 0) {
57064
- if (s.current = void 0, t.current && t.current.classList.remove("dragging"), i.current > 75) {
57065
- c(100);
57069
+ const g = l(v), y = (a.current - g) / window.innerHeight * 100;
57070
+ a.current = g, u(s.current + y);
57071
+ }, m = () => {
57072
+ if (i.current && a.current !== void 0) {
57073
+ if (a.current = void 0, n.current && n.current.classList.remove("dragging"), s.current > 75) {
57074
+ u(100);
57066
57075
  return;
57067
57076
  }
57068
- if (i.current < 50) {
57069
- c(0);
57077
+ if (s.current < 50) {
57078
+ u(0);
57070
57079
  return;
57071
57080
  }
57072
- c(o.current);
57081
+ u(i.current);
57073
57082
  }
57074
57083
  };
57075
- 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), () => {
57076
- 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);
57077
- }), [n]), {
57078
- dragRef: r,
57079
- setInitialHeight: a
57084
+ 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), () => {
57085
+ 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);
57086
+ }) : () => {
57087
+ }, [t, r]), {
57088
+ dragRef: o,
57089
+ setInitialHeight: c
57080
57090
  };
57081
57091
  }, Zye = () => {
57082
57092
  let e = document.getElementById(ZO);
@@ -57087,7 +57097,7 @@ const gye = (e) => {
57087
57097
  ui: { isMobile: r }
57088
57098
  } = Ge(), o = Xye(), i = rn(() => {
57089
57099
  e.closePollPortal();
57090
- }, [e]), { dragRef: s, setInitialHeight: a } = Jye(i), c = (t == null ? void 0 : t.options.find((u) => u.isVoted)) || (t == null ? void 0 : t.isVoted);
57100
+ }, [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);
57091
57101
  return /* @__PURE__ */ h.jsxs(pv, { container: Zye(), children: [
57092
57102
  r && /* @__PURE__ */ h.jsx(
57093
57103
  "div",
@@ -57178,7 +57188,7 @@ const gye = (e) => {
57178
57188
  /* @__PURE__ */ h.jsx(t1e, {})
57179
57189
  ] });
57180
57190
  };
57181
- var uu = { VITE_APP_VERSION: "0.9.7", VITE_APP_API_BASEURL: "https://api.livedigital.chat", VITE_APP_SENTRY_DSN: "https://445426b388f045748970982694bb1520@o1158674.ingest.sentry.io/6242013", BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
57191
+ var uu = { VITE_APP_VERSION: "0.9.9", VITE_APP_API_BASEURL: "https://api.livedigital.chat", VITE_APP_SENTRY_DSN: "https://445426b388f045748970982694bb1520@o1158674.ingest.sentry.io/6242013", BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
57182
57192
  const zD = (e) => {
57183
57193
  $e.error("Chat init error", { case: "handleInitError", errorInfo: e }), Do.emit(so.App, {
57184
57194
  event: Po.ChatInitError,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vlprojects-chat/chat",
3
3
  "author": "vlprojects",
4
- "version": "0.9.7",
4
+ "version": "0.9.9",
5
5
  "description": "VLprojects chat",
6
6
  "license": "ISC",
7
7
  "types": "dist/index.d.ts",