@vlprojects-chat/chat 0.32.1 → 0.33.0

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 +16 -16
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -24983,7 +24983,7 @@ const oO = yS("PollRef", {
24983
24983
  const t = [], n = [];
24984
24984
  let r = !1;
24985
24985
  e.options.forEach((i) => {
24986
- t.push(i), i.valid && (n.push(i.option), r = !0);
24986
+ t.push(i), i.valid === !0 && (n.push(i.option), r = !0);
24987
24987
  }), r = e.withAnswer;
24988
24988
  const o = e.isMultiselect;
24989
24989
  return new Kc({ ...e, id: `${e.id}`, options: t, validOptions: n, withAnswer: r, isMultiselect: o });
@@ -25294,7 +25294,7 @@ let Yt = class extends ur({
25294
25294
  }
25295
25295
  upsertPoll(e) {
25296
25296
  const t = this.findPollById(String(e.id));
25297
- return t ? (t.question = e.question, t.isOpenEnded = e.isOpenEnded, t.withAnswer = e.withAnswer, t.isVoted = !!e.isVoted, t.options = e.options.map((n) => ({ ...n })), t.validOptions = e.options.filter((n) => n.valid).map((n) => n.option), t.templateId = e.templateId, t.createdAt = e.createdAt, t.stoppedAt = e.stoppedAt, t.status = e.status, t.votes = e.votes ?? [], t.updatedAt = void 0, t.isMultiselect = e.isMultiselect, t) : this.addPoll(e);
25297
+ return t ? (t.question = e.question, t.isOpenEnded = e.isOpenEnded, t.withAnswer = e.withAnswer, t.isVoted = !!e.isVoted, t.options = e.options.map((n) => ({ ...n })), t.validOptions = e.options.filter((n) => n.valid === !0).map((n) => n.option), t.templateId = e.templateId, t.createdAt = e.createdAt, t.stoppedAt = e.stoppedAt, t.status = e.status, t.votes = e.votes ?? [], t.updatedAt = void 0, t.isMultiselect = e.isMultiselect, t) : this.addPoll(e);
25298
25298
  }
25299
25299
  startPoll(e) {
25300
25300
  e && this.setActivePoll(oO(e));
@@ -38244,7 +38244,7 @@ const P$ = {
38244
38244
  const r = mk(e, (/* @__PURE__ */ new Date()).toISOString());
38245
38245
  return r === -2 ? /* @__PURE__ */ h.jsx(Te, { id: "time.dayBefore" }) : r < -2 ? qs({ date: e, formatString: "dd MMMM", lang: n }) : qs({ date: e, lang: n });
38246
38246
  }, gk = (e) => /* @__PURE__ */ h.jsx(je, { container: !0, alignItems: "center", children: e.children }), eee = (e) => {
38247
- const { option: t } = e;
38247
+ const { option: t } = e, n = t.valid === !0 ? q.SUCCESS_BASE : t.valid === !1 ? q.ERROR_BASE : q.PRIMARY;
38248
38248
  return /* @__PURE__ */ h.jsxs(gk, { children: [
38249
38249
  /* @__PURE__ */ h.jsx(
38250
38250
  je,
@@ -38253,7 +38253,7 @@ const P$ = {
38253
38253
  xs: !0,
38254
38254
  component: be,
38255
38255
  variant: "subtitle2",
38256
- color: t.valid ? q.SUCCESS_BASE : q.PRIMARY,
38256
+ color: n,
38257
38257
  sx: { wordBreak: "break-word" },
38258
38258
  children: t.option
38259
38259
  }
@@ -38264,7 +38264,7 @@ const P$ = {
38264
38264
  item: !0,
38265
38265
  component: be,
38266
38266
  variant: "subtitle2",
38267
- color: t.valid ? q.SUCCESS_BASE : q.PRIMARY,
38267
+ color: n,
38268
38268
  children: t.votesCount
38269
38269
  }
38270
38270
  )
@@ -60213,7 +60213,7 @@ const ode = (e) => {
60213
60213
  /* @__PURE__ */ h.jsx(Ea, { onBack: () => e.back(), children: /* @__PURE__ */ h.jsx(oi, { children: /* @__PURE__ */ h.jsx(Te, { id: "userList" }) }) }),
60214
60214
  /* @__PURE__ */ h.jsx(kde, { users: n })
60215
60215
  ] });
60216
- }, LA = st(Nde), jde = "@vlprojects-chat/chat", Mde = "vlprojects", Dde = "0.32.1-LK-196-popup-restore-dialogs.1", Lde = "vlprojects chat", Bde = "ISC", Fde = "dist/index.d.ts", Vde = "./dist/index.mjs", _de = "./dist/index.mjs", Ude = [
60216
+ }, LA = st(Nde), jde = "@vlprojects-chat/chat", Mde = "vlprojects", Dde = "0.32.1", Lde = "vlprojects chat", Bde = "ISC", Fde = "dist/index.d.ts", Vde = "./dist/index.mjs", _de = "./dist/index.mjs", Ude = [
60217
60217
  "dist"
60218
60218
  ], Wde = {
60219
60219
  type: "git",
@@ -60544,14 +60544,14 @@ const ode = (e) => {
60544
60544
  /* @__PURE__ */ h.jsx(be, { variant: "h2", children: /* @__PURE__ */ h.jsx(Te, { id: "thanks" }) }),
60545
60545
  /* @__PURE__ */ h.jsx(be, { variant: "body1", children: /* @__PURE__ */ h.jsx(Te, { id: "answerAccepted" }) })
60546
60546
  ] }) : /* @__PURE__ */ h.jsx(h.Fragment, { children: /* @__PURE__ */ h.jsx(je, { container: !0, direction: "column", rowGap: 2, children: r.options.map((s) => {
60547
- const a = () => {
60548
- if (s.valid)
60549
- return q.SUCCESS_BASE;
60547
+ const a = s.valid === !0 ? q.SUCCESS_BASE : s.valid === !1 ? q.ERROR_BASE : null, l = () => {
60548
+ if (a)
60549
+ return a;
60550
60550
  if (s.isVoted) {
60551
- const u = q[t.me.getAvatarColor];
60552
- return sfe(u);
60551
+ const c = q[t.me.getAvatarColor];
60552
+ return sfe(c);
60553
60553
  } else return s.votesCount > 0 ? q.SECONDARY_01 : q.BG;
60554
- }, l = (u) => u === q.SECONDARY_01 ? q.BG : `color-mix(in srgb,${u}, #fff 50%)`;
60554
+ }, u = (c) => c === q.SECONDARY_01 ? q.BG : `color-mix(in srgb,${c}, #fff 50%)`;
60555
60555
  return /* @__PURE__ */ h.jsxs(
60556
60556
  je,
60557
60557
  {
@@ -60560,13 +60560,13 @@ const ode = (e) => {
60560
60560
  className: o.progress,
60561
60561
  "data-qa-votes": s.votesCount,
60562
60562
  "data-qa-option": s.option,
60563
- bgcolor: l(a()),
60563
+ bgcolor: u(l()),
60564
60564
  children: [
60565
60565
  /* @__PURE__ */ h.jsx(
60566
60566
  be,
60567
60567
  {
60568
60568
  component: "span",
60569
- color: s.isVoted || s.valid ? q.BG : q.PRIMARY,
60569
+ color: s.isVoted || a ? q.BG : q.PRIMARY,
60570
60570
  fontWeight: 500,
60571
60571
  padding: "8px 25px 8px 12px",
60572
60572
  zIndex: "10",
@@ -60577,7 +60577,7 @@ const ode = (e) => {
60577
60577
  Ss,
60578
60578
  {
60579
60579
  width: s.votesCount ? `${s.votesCount / i * 100}%` : "100%",
60580
- bgcolor: a(),
60580
+ bgcolor: l(),
60581
60581
  position: "absolute",
60582
60582
  minHeight: "100%",
60583
60583
  borderRadius: "10px"
@@ -60590,7 +60590,7 @@ const ode = (e) => {
60590
60590
  variant: "body2",
60591
60591
  position: "absolute",
60592
60592
  right: "10px",
60593
- color: s.isVoted || s.valid ? `color-mix(in srgb,${q.BG}, #fff 50%)` : q.PRIMARY,
60593
+ color: s.isVoted || a ? `color-mix(in srgb,${q.BG}, #fff 50%)` : q.PRIMARY,
60594
60594
  children: s.votesCount
60595
60595
  }
60596
60596
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vlprojects-chat/chat",
3
3
  "author": "vlprojects",
4
- "version": "0.32.1",
4
+ "version": "0.33.0",
5
5
  "description": "vlprojects chat",
6
6
  "license": "ISC",
7
7
  "types": "dist/index.d.ts",