wacomm 3.4.0 → 3.5.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/wacomm.es.js CHANGED
@@ -1000,19 +1000,25 @@ function fr({ src: e, alt: t, ref: n = null, className: r = "", containerClassNa
1000
1000
  }
1001
1001
  //#endregion
1002
1002
  //#region src/html/img/SmartImage.tsx
1003
- function pr({ src: e, fallbackSrc: t, alt: n, ref: r = null, className: i = "", containerClassName: a = "", onClick: o, style: s = void 0, onLoad: c = void 0 }) {
1004
- let l = [e, t].filter((e) => !!e), [u, d] = y(0);
1003
+ function pr({ src: e, fallbackSrc: t, alt: n, ref: r = null, className: i = "", containerClassName: a = "", onClick: o, style: s = void 0, onLoad: c = void 0, onExhausted: l = void 0 }) {
1004
+ let u = [e, t].filter((e) => !!e), [d, f] = y(0);
1005
1005
  return /* @__PURE__ */ H(hn, {
1006
1006
  className: a,
1007
1007
  onClick: o,
1008
1008
  children: /* @__PURE__ */ H("img", {
1009
1009
  ref: r,
1010
- src: l[u],
1010
+ src: u[d],
1011
1011
  alt: n,
1012
1012
  style: s,
1013
1013
  className: i,
1014
1014
  onLoad: c,
1015
- onError: () => d((e) => Math.min(e + 1, Math.max(l.length - 1, 0)))
1015
+ onError: () => {
1016
+ if (d + 1 < u.length) {
1017
+ f(d + 1);
1018
+ return;
1019
+ }
1020
+ l?.();
1021
+ }
1016
1022
  })
1017
1023
  });
1018
1024
  }
@@ -1344,7 +1350,7 @@ function Pr({ onClick: e, placeholder: t = "Type your message...", className: n
1344
1350
  className: `relative w-full ${n}`,
1345
1351
  children: [/* @__PURE__ */ H("textarea", {
1346
1352
  ref: i,
1347
- className: "w-full border rounded px-2 py-1 pr-10",
1353
+ className: "w-full border border-gray-300 rounded px-2 py-1 pr-10",
1348
1354
  value: a,
1349
1355
  onChange: (e) => o(e.target.value),
1350
1356
  rows: r,
@@ -19495,12 +19501,14 @@ function VT({ letter: e, className: t = "", onClick: n }) {
19495
19501
  //#endregion
19496
19502
  //#region src/avatar/Avatar.tsx
19497
19503
  function HT({ label: e = "N", className: t = "w-full h-full", imgSrc: n = "", fallbackImgSrc: r = "", onClick: i }) {
19498
- return n || r ? /* @__PURE__ */ H(pr, {
19504
+ let [a, o] = y(!1);
19505
+ return p(() => o(!1), [n, r]), (n || r) && !a ? /* @__PURE__ */ H(pr, {
19499
19506
  className: j("Avatar rounded-full w-full h-full", t),
19500
19507
  src: n,
19501
19508
  fallbackSrc: r,
19502
19509
  alt: e,
19503
- onClick: i
19510
+ onClick: i,
19511
+ onExhausted: () => o(!0)
19504
19512
  }) : /* @__PURE__ */ H(VT, {
19505
19513
  className: `LetterAvatar ${t}`,
19506
19514
  onClick: i,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wacomm",
3
- "version": "3.4.0",
3
+ "version": "3.5.1",
4
4
  "main": "dist/wacomm.cjs.js",
5
5
  "module": "dist/wacomm.es.js",
6
6
  "types": "dist/index.d.ts",