@decentnetwork/beagle 0.1.144 → 0.1.145

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.
@@ -1,4 +1,4 @@
1
- window.__DK_UI_VERSION="0.1.144";
1
+ window.__DK_UI_VERSION="0.1.145";
2
2
  "use strict";
3
3
  (() => {
4
4
  // packages/beagle-ui/dist/beagle-ui.js
@@ -2255,6 +2255,11 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
2255
2255
  }, [userid]);
2256
2256
  return rec;
2257
2257
  }
2258
+ function verifiedLabel(userid, name) {
2259
+ if (!name)
2260
+ return name;
2261
+ return ensVerdict(name, verifier.peek(userid)).label || name;
2262
+ }
2258
2263
  function useEnsVerdict(userid, name) {
2259
2264
  return ensVerdict(name, useEnsRecord(userid));
2260
2265
  }
@@ -4193,7 +4198,7 @@ ${peer.address}`
4193
4198
  e.preventDefault();
4194
4199
  }
4195
4200
  },
4196
- placeholder: phone ? `${T.message}\u2026` : `${T.message} ${peer.alias || shortKey(peer.userId, 6, 4)}\u2026`,
4201
+ placeholder: phone ? `${T.message}\u2026` : `${T.message} ${verifiedLabel(peer.app ? null : peer.userId, peer.alias) || shortKey(peer.userId, 6, 4)}\u2026`,
4197
4202
  style: { flex: 1, height: 38, borderRadius: 9, border: "1px solid var(--line)", background: "var(--panel-2)", color: "var(--text)", fontFamily: "var(--ui)", fontSize: 13.5, padding: "0 14px", outline: "none", minWidth: 0 }
4198
4203
  }
4199
4204
  ), /* @__PURE__ */ React.createElement(Btn, { tone: "solid", icon: "arrowUp", title: T.send, onClick: sendDraft }))),
@@ -4244,7 +4249,7 @@ ${peer.address}`
4244
4249
  style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain", borderRadius: 6 }
4245
4250
  }
4246
4251
  ))),
4247
- pubProfile && /* @__PURE__ */ React.createElement(DkPublicProfile, { T, userid: peer.userId, fallbackName: peer.alias, isFriend: true, onClose: () => setPubProfile(false) }),
4252
+ pubProfile && /* @__PURE__ */ React.createElement(DkPublicProfile, { T, userid: peer.userId, fallbackName: verifiedLabel(peer.userId, peer.alias), isFriend: true, onClose: () => setPubProfile(false) }),
4248
4253
  nameCardProf && (() => {
4249
4254
  const cardFriend2 = cardFriend(nameCardProf, peers);
4250
4255
  return /* @__PURE__ */ React.createElement(
@@ -6386,7 +6391,7 @@ ${peer.address}`
6386
6391
  if (!inc)
6387
6392
  return null;
6388
6393
  const peer = (peers || []).find((p) => p.id === inc.peerId) || { id: inc.peerId };
6389
- const name = peer.alias || peer.name || shortKey(inc.peerId, 10, 6);
6394
+ const name = verifiedLabel(inc.peerId, peer.alias) || peer.name || shortKey(inc.peerId, 10, 6);
6390
6395
  return /* @__PURE__ */ React.createElement("div", { style: { position: "fixed", inset: 0, zIndex: 80, background: "color-mix(in oklab, var(--bg), transparent 15%)", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React.createElement("div", { style: { width: 320, padding: 26, borderRadius: 18, background: "var(--panel)", border: "1px solid var(--line)", textAlign: "center", boxShadow: "0 20px 60px rgba(0,0,0,0.4)" } }, /* @__PURE__ */ React.createElement("div", { style: { position: "relative", display: "inline-flex", alignItems: "center", justifyContent: "center", marginBottom: 14 } }, /* @__PURE__ */ React.createElement("span", { style: { position: "absolute", width: 96, height: 96, borderRadius: 999, border: "2px solid var(--accent)", animation: "dkpulse 2s ease-out infinite" } }), /* @__PURE__ */ React.createElement(DkIdenticon, { seed: inc.peerId, size: 72, radius: 18 })), /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--mono)", fontSize: 17, fontWeight: 700, color: "var(--text)" } }, name), /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--mono)", fontSize: 12.5, color: "var(--faint)", marginTop: 4, display: "flex", gap: 6, alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React.createElement(Icon, { name: inc.video ? "video" : "phone", size: 14, stroke: 2 }), T && (inc.video ? T.incomingVideo : T.incomingAudio) || "Incoming " + (inc.video ? "video" : "audio") + " call"), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: 14, justifyContent: "center", marginTop: 22 } }, /* @__PURE__ */ React.createElement(CallBtn, { icon: "phone", label: T && T.decline || "Decline", danger: true, onClick: ctl.reject }), /* @__PURE__ */ React.createElement(CallBtn, { icon: inc.video ? "video" : "phone", label: T && T.accept || "Accept", active: true, onClick: ctl.accept }))));
6391
6396
  }
6392
6397
  function CallBtn({ icon, label, onClick, active, danger, wide }) {
@@ -6426,7 +6431,7 @@ ${peer.address}`
6426
6431
  if (!call)
6427
6432
  return null;
6428
6433
  const peer = (peers || []).find((p) => p.id === call.peerId) || { id: call.peerId };
6429
- const name = peer.alias || peer.name || shortKey(call.peerId, 10, 6);
6434
+ const name = verifiedLabel(call.peerId, peer.alias) || peer.name || shortKey(call.peerId, 10, 6);
6430
6435
  const streamHasVideo = (s) => !!(s && s.getVideoTracks && s.getVideoTracks().length > 0);
6431
6436
  const video = call.video || ctl.sharing || streamHasVideo(ctl.remoteStream) || streamHasVideo(ctl.localStream);
6432
6437
  const mm = String(Math.floor(secs / 60)).padStart(2, "0");
@@ -7002,7 +7007,7 @@ ${peer.address}`
7002
7007
  const downloadLabel = T && T.downloadFile || "Download";
7003
7008
  return /* @__PURE__ */ React.createElement("div", { style: { position: "fixed", right: 72, bottom: 18, zIndex: 90, width: 360, maxWidth: "calc(100vw - 96px)", display: "flex", flexDirection: "column", gap: 10 } }, items.map((it) => {
7004
7009
  const peer = (peers || []).find((p) => p.id === it.peerId || p.userId === it.peerId) || {};
7005
- const who = peer.alias || peer.name || shortKey(it.peerId, 8, 5);
7010
+ const who = verifiedLabel(peer.userId || it.peerId, peer.alias) || peer.name || shortKey(it.peerId, 8, 5);
7006
7011
  return /* @__PURE__ */ React.createElement("div", { key: it.id, style: { border: "1px solid var(--line)", background: "var(--panel)", borderRadius: 12, padding: 12, boxShadow: "0 14px 40px rgba(0,0,0,0.35)" } }, /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--mono)", fontSize: 12, color: "var(--faint)", marginBottom: 6 } }, T && T.receivedFile || "Received file", " \xB7 ", who), /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 13, fontWeight: 700, color: "var(--text)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, it.name), /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--mono)", fontSize: 11, color: "var(--faint)", marginTop: 3 } }, dkFileSize(it.size)), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 10, paddingRight: 2 } }, /* @__PURE__ */ React.createElement("button", { onClick: () => ctl.dismissIncoming(it.id), style: { height: 30, minWidth: 58, borderRadius: 8, border: "1px solid var(--line)", background: "transparent", color: "var(--dim)", cursor: "pointer" } }, closeLabel), /* @__PURE__ */ React.createElement("a", { href: it.url, download: it.name, onClick: () => setTimeout(() => ctl.dismissIncoming(it.id), 500), style: { height: 30, minWidth: 76, textAlign: "center", borderRadius: 8, padding: "6px 10px", background: "var(--accent)", color: "#fff", textDecoration: "none", fontFamily: "var(--mono)", fontSize: 12 } }, downloadLabel)));
7007
7012
  }));
7008
7013
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/beagle",
3
- "version": "0.1.144",
3
+ "version": "0.1.145",
4
4
  "description": "Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "start": "node dist/cli.js"
27
27
  },
28
28
  "dependencies": {
29
- "@decentnetwork/beagle-ui": "^0.2.46",
29
+ "@decentnetwork/beagle-ui": "^0.2.47",
30
30
  "@decentnetwork/chat-components": "^0.1.3",
31
31
  "@decentnetwork/lan": "^0.1.316",
32
32
  "@decentnetwork/peer": "^0.1.178",