@vlprojects-chat/chat 0.9.6 → 0.9.8

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 +46 -38
  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.6", 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.8", 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",
@@ -54332,12 +54332,13 @@ const wbe = (e) => {
54332
54332
  zIndex: yc.HEADER
54333
54333
  }
54334
54334
  }), Vbe = () => {
54335
+ var m, v;
54335
54336
  const e = Ge(), { ui: t, chat: n, auth: r } = e, o = t.isMobile ? Lbe() : Fbe(), i = String(t.params.id), s = n.channels.get(i), a = s == null ? void 0 : s.lastPinnedMessage;
54336
54337
  if (!a)
54337
54338
  return null;
54338
54339
  const c = a.user.current, u = new Date(a.message.createdAt), l = () => Nk(a.id), f = async () => {
54339
- const m = s.findMessageIdx(a.messageId);
54340
- m > -1 ? t.jumpToMessage(m) : (await Ik(e, Number(i), Number(s.sortedMessages[0].id), {
54340
+ const g = s.findMessageIdx(a.messageId);
54341
+ g > -1 ? t.jumpToMessage(g) : (await Ik(e, Number(i), Number(s.sortedMessages[0].id), {
54341
54342
  until: Number(a.messageId)
54342
54343
  }), setTimeout(() => {
54343
54344
  t.jumpToMessage(0);
@@ -54365,7 +54366,8 @@ const wbe = (e) => {
54365
54366
  children: p
54366
54367
  }
54367
54368
  ),
54368
- /* @__PURE__ */ h.jsx(ce, { noWrap: !0, className: o.pinnedMessage, children: a.message.text })
54369
+ /* @__PURE__ */ h.jsx(ce, { noWrap: !0, className: o.pinnedMessage, children: a.message.text }),
54370
+ ((m = a.message.attachments) == null ? void 0 : m.length) && /* @__PURE__ */ h.jsx(ce, { noWrap: !0, className: o.pinnedMessage, children: (v = a.message.attachments) == null ? void 0 : v[0].name })
54369
54371
  ] }),
54370
54372
  r.me.role === od.Moderator && /* @__PURE__ */ h.jsx(Jn, { onClick: l, className: o.pinButton, children: /* @__PURE__ */ h.jsx(Ihe, {}) })
54371
54373
  ]
@@ -56816,7 +56818,10 @@ const gye = (e) => {
56816
56818
  const { poll: t, voteHandler: n } = e, [r, o] = Be(
56817
56819
  t.options.reduce((a, c) => ({ ...a, [c.id]: !1 }), {})
56818
56820
  ), i = !Object.values(r).find((a) => a), s = (a) => () => {
56819
- !r[a] && !t.isMultiselect && Object.values(r).filter(Boolean).length > 0 || o((c) => ({ ...c, [a]: !c[a] }));
56821
+ o((c) => ({
56822
+ ...t.options.reduce((u, l) => ({ ...u, [l.id]: !1 }), {}),
56823
+ [a]: !c[a]
56824
+ }));
56820
56825
  };
56821
56826
  return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
56822
56827
  /* @__PURE__ */ h.jsx(ye, { container: !0, direction: "column", rowGap: 2, children: t.options.map((a) => /* @__PURE__ */ h.jsx(
@@ -57035,46 +57040,49 @@ const gye = (e) => {
57035
57040
  {
57036
57041
  name: "PollPortal"
57037
57042
  }
57038
- ), Jye = (e) => {
57039
- const t = Sn(null), [n, r] = Be(null), o = Sn(0), i = Sn(100), s = Sn(void 0), a = (m) => {
57040
- var g;
57041
- t.current || (t.current = m);
57042
- const v = (g = t.current) == null ? void 0 : g.getBoundingClientRect().height;
57043
- v && (o.current = v / window.innerHeight * 100, c(o.current));
57044
- }, c = (m) => {
57045
- if (t.current && (i.current = Math.max(0, Math.min(100, m)), t.current.style.height = `${i.current}vh`, i.current === 0)) {
57046
- t.current.style.transform = "translateY(100%)";
57047
- const v = () => {
57048
- var g;
57049
- (g = t.current) == null || g.removeEventListener("transitionend", v), e == null || e();
57043
+ ), Jye = (e, t) => {
57044
+ const n = Sn(null), [r, o] = Be(null), i = Sn(0), s = Sn(100), a = Sn(void 0), c = (v) => {
57045
+ var b;
57046
+ if (!t)
57047
+ return;
57048
+ n.current || (n.current = v);
57049
+ const g = (b = n.current) == null ? void 0 : b.getBoundingClientRect().height;
57050
+ g && (i.current = g / window.innerHeight * 100, u(i.current));
57051
+ }, u = (v) => {
57052
+ if (n.current && (s.current = Math.max(0, Math.min(100, v)), n.current.style.height = `${s.current}vh`, s.current === 0)) {
57053
+ n.current.style.transform = "translateY(100%)";
57054
+ const g = () => {
57055
+ var b;
57056
+ (b = n.current) == null || b.removeEventListener("transitionend", g), e == null || e();
57050
57057
  };
57051
- t.current.addEventListener("transitionend", v);
57058
+ n.current.addEventListener("transitionend", g);
57052
57059
  }
57053
- }, u = (m) => m instanceof TouchEvent ? m.touches[0].pageY : m.pageY, l = (m) => {
57054
- s.current = u(m), t.current && t.current.classList.add("dragging");
57055
- }, f = (m) => {
57056
- if (!s.current)
57060
+ }, l = (v) => v instanceof TouchEvent ? v.touches[0].pageY : v.pageY, f = (v) => {
57061
+ a.current = l(v), n.current && n.current.classList.add("dragging");
57062
+ }, p = (v) => {
57063
+ if (!a.current)
57057
57064
  return;
57058
- const v = u(m), b = (s.current - v) / window.innerHeight * 100;
57059
- s.current = v, c(i.current + b);
57060
- }, p = () => {
57061
- if (o.current && s.current !== void 0) {
57062
- if (s.current = void 0, t.current && t.current.classList.remove("dragging"), i.current > 75) {
57063
- c(100);
57065
+ const g = l(v), y = (a.current - g) / window.innerHeight * 100;
57066
+ a.current = g, u(s.current + y);
57067
+ }, m = () => {
57068
+ if (i.current && a.current !== void 0) {
57069
+ if (a.current = void 0, n.current && n.current.classList.remove("dragging"), s.current > 75) {
57070
+ u(100);
57064
57071
  return;
57065
57072
  }
57066
- if (i.current < 50) {
57067
- c(0);
57073
+ if (s.current < 50) {
57074
+ u(0);
57068
57075
  return;
57069
57076
  }
57070
- c(o.current);
57077
+ u(i.current);
57071
57078
  }
57072
57079
  };
57073
- 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), () => {
57074
- 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);
57075
- }), [n]), {
57076
- dragRef: r,
57077
- setInitialHeight: a
57080
+ 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), () => {
57081
+ 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);
57082
+ }) : () => {
57083
+ }, [t, r]), {
57084
+ dragRef: o,
57085
+ setInitialHeight: c
57078
57086
  };
57079
57087
  }, Zye = () => {
57080
57088
  let e = document.getElementById(ZO);
@@ -57085,7 +57093,7 @@ const gye = (e) => {
57085
57093
  ui: { isMobile: r }
57086
57094
  } = Ge(), o = Xye(), i = rn(() => {
57087
57095
  e.closePollPortal();
57088
- }, [e]), { dragRef: s, setInitialHeight: a } = Jye(i), c = (t == null ? void 0 : t.options.find((u) => u.isVoted)) || (t == null ? void 0 : t.isVoted);
57096
+ }, [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);
57089
57097
  return /* @__PURE__ */ h.jsxs(pv, { container: Zye(), children: [
57090
57098
  r && /* @__PURE__ */ h.jsx(
57091
57099
  "div",
@@ -57176,7 +57184,7 @@ const gye = (e) => {
57176
57184
  /* @__PURE__ */ h.jsx(t1e, {})
57177
57185
  ] });
57178
57186
  };
57179
- var uu = { VITE_APP_VERSION: "0.9.6", 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 };
57187
+ var uu = { VITE_APP_VERSION: "0.9.8", 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 };
57180
57188
  const zD = (e) => {
57181
57189
  $e.error("Chat init error", { case: "handleInitError", errorInfo: e }), Do.emit(so.App, {
57182
57190
  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.6",
4
+ "version": "0.9.8",
5
5
  "description": "VLprojects chat",
6
6
  "license": "ISC",
7
7
  "types": "dist/index.d.ts",