@decentnetwork/beagle 0.1.143 → 0.1.144

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/desktop/app.js +166 -10
  2. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- window.__DK_UI_VERSION="0.1.143";
1
+ window.__DK_UI_VERSION="0.1.144";
2
2
  "use strict";
3
3
  (() => {
4
4
  // packages/beagle-ui/dist/beagle-ui.js
@@ -2146,6 +2146,143 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
2146
2146
  const action = friend ? "chat" : address ? isGroup ? "join" : "add" : null;
2147
2147
  return { userid, address, isGroup, friend, action };
2148
2148
  }
2149
+ var ENS_GATEWAY = "https://ens-gateway.beaglechat.workers.dev";
2150
+ function cleanName(name) {
2151
+ return String(name == null ? "" : name).replace(/[\u0000-\u001f\u007f]+/g, "").trim();
2152
+ }
2153
+ function ensLabel(name) {
2154
+ return cleanName(name).toLowerCase().replace(/\.beagles\.eth$/, "");
2155
+ }
2156
+ function claimsBeaglesName(name) {
2157
+ return /\.beagles\.eth$/i.test(cleanName(name));
2158
+ }
2159
+ function ensVerdict(shown, record) {
2160
+ const label = cleanName(shown);
2161
+ const out = { label, mark: false, hint: null, claimed: null };
2162
+ if (!label || record === void 0)
2163
+ return out;
2164
+ const gw = record && typeof record.name === "string" && record.name ? record.name : null;
2165
+ if (gw && ensLabel(label) === ensLabel(gw))
2166
+ return { ...out, mark: true };
2167
+ if (!claimsBeaglesName(label))
2168
+ return out;
2169
+ if (gw)
2170
+ return { label: gw, mark: true, hint: null, claimed: label };
2171
+ return { ...out, hint: "self-claimed" };
2172
+ }
2173
+ function createEnsVerifier({
2174
+ fetchImpl = typeof fetch === "function" ? fetch.bind(globalThis) : null,
2175
+ gateway = ENS_GATEWAY,
2176
+ ttlMs = 30 * 6e4,
2177
+ failTtlMs = 2 * 6e4,
2178
+ concurrency = 4,
2179
+ now = () => Date.now()
2180
+ } = {}) {
2181
+ const cache = /* @__PURE__ */ new Map();
2182
+ const inflight = /* @__PURE__ */ new Map();
2183
+ const queue = [];
2184
+ let running = 0;
2185
+ const pump = () => {
2186
+ while (running < concurrency && queue.length) {
2187
+ const job = queue.shift();
2188
+ running++;
2189
+ job().finally(() => {
2190
+ running--;
2191
+ pump();
2192
+ });
2193
+ }
2194
+ };
2195
+ const fetchRecord = async (userid) => {
2196
+ if (!fetchImpl)
2197
+ return void 0;
2198
+ try {
2199
+ const r = await fetchImpl(`${gateway}/getAddress/${encodeURIComponent(userid)}`);
2200
+ if (r.status === 404)
2201
+ return null;
2202
+ if (!r.ok)
2203
+ return void 0;
2204
+ const j = await r.json();
2205
+ if (!j || typeof j.name !== "string" || !j.name)
2206
+ return null;
2207
+ const owner = j.texts && j.texts.carrierUserId;
2208
+ if (owner && owner !== userid)
2209
+ return null;
2210
+ return { name: j.name, displayName: j.texts && j.texts.displayName || null };
2211
+ } catch (e) {
2212
+ return void 0;
2213
+ }
2214
+ };
2215
+ const peek = (userid) => {
2216
+ const hit = userid ? cache.get(userid) : null;
2217
+ return hit && hit.until > now() ? hit.value : void 0;
2218
+ };
2219
+ const lookup = (userid) => {
2220
+ if (!userid)
2221
+ return Promise.resolve(void 0);
2222
+ const hit = cache.get(userid);
2223
+ if (hit && hit.until > now())
2224
+ return Promise.resolve(hit.value);
2225
+ let p = inflight.get(userid);
2226
+ if (p)
2227
+ return p;
2228
+ p = new Promise((resolve) => {
2229
+ queue.push(() => fetchRecord(userid).then((value) => {
2230
+ cache.set(userid, { value, until: now() + (value === void 0 ? failTtlMs : ttlMs) });
2231
+ inflight.delete(userid);
2232
+ resolve(value);
2233
+ }));
2234
+ pump();
2235
+ });
2236
+ inflight.set(userid, p);
2237
+ return p;
2238
+ };
2239
+ return { lookup, peek };
2240
+ }
2241
+ var verifier = createEnsVerifier();
2242
+ function useEnsRecord(userid) {
2243
+ const [rec, setRec] = React.useState(() => verifier.peek(userid));
2244
+ React.useEffect(() => {
2245
+ let live = true;
2246
+ setRec(verifier.peek(userid));
2247
+ if (userid)
2248
+ verifier.lookup(userid).then((r) => {
2249
+ if (live)
2250
+ setRec(r);
2251
+ });
2252
+ return () => {
2253
+ live = false;
2254
+ };
2255
+ }, [userid]);
2256
+ return rec;
2257
+ }
2258
+ function useEnsVerdict(userid, name) {
2259
+ return ensVerdict(name, useEnsRecord(userid));
2260
+ }
2261
+ function DkEnsMark({ verdict, T, size = 12 }) {
2262
+ if (verdict.mark) {
2263
+ const title = verdict.claimed ? (T && T.ensVerifiedReplaced || "Registered beagles.eth name for this user. Their device shows {claimed}, which is not registered to them.").replace("{claimed}", verdict.claimed) : T && T.ensVerified || "Verified: this beagles.eth name is registered to this user.";
2264
+ return /* @__PURE__ */ React.createElement("span", { title, "aria-label": title, style: { display: "inline-flex", flexShrink: 0, color: "var(--accent)" } }, /* @__PURE__ */ React.createElement(Icon, { name: "check", size, stroke: 2.6, color: "var(--accent)" }));
2265
+ }
2266
+ if (verdict.hint === "self-claimed") {
2267
+ const title = T && T.ensSelfClaimedTip || "Shown by their device. This beagles.eth name is not registered to this user.";
2268
+ return /* @__PURE__ */ React.createElement("span", { title, style: {
2269
+ flexShrink: 0,
2270
+ fontFamily: "var(--ui)",
2271
+ fontSize: 10,
2272
+ color: "var(--faint)",
2273
+ border: "1px solid var(--line)",
2274
+ borderRadius: 4,
2275
+ padding: "0 4px",
2276
+ lineHeight: "14px",
2277
+ whiteSpace: "nowrap"
2278
+ } }, T && T.ensSelfClaimed || "self-claimed");
2279
+ }
2280
+ return null;
2281
+ }
2282
+ function DkVerifiedName({ userid, name, fallback, T, style, markSize }) {
2283
+ const v = useEnsVerdict(userid, name);
2284
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { style, title: v.claimed ? v.claimed + " \u2192 " + v.label : void 0 }, v.label || fallback), /* @__PURE__ */ React.createElement(DkEnsMark, { verdict: v, T, size: markSize }));
2285
+ }
2149
2286
  var NATIVE_MEDIA_MIME = {
2150
2287
  ".jpg": "image/jpeg",
2151
2288
  ".jpeg": "image/jpeg",
@@ -2431,7 +2568,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
2431
2568
  fontFamily: "inherit",
2432
2569
  border: "1px solid " + (active ? "var(--line)" : "transparent"),
2433
2570
  background: active ? "var(--panel-2)" : "transparent"
2434
- } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer, size: 32, radius: 7 }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6 } }, /* @__PURE__ */ React.createElement("span", { style: {
2571
+ } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer, size: 32, radius: 7 }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6 } }, /* @__PURE__ */ React.createElement(DkVerifiedName, { userid: peer.app ? null : peer.userId, name: peer.alias, fallback: shortKey(peer.userId, 8, 5), T, style: {
2435
2572
  fontFamily: peer.alias ? "var(--ui)" : "var(--mono)",
2436
2573
  fontSize: 13.5,
2437
2574
  fontWeight: 600,
@@ -2439,7 +2576,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
2439
2576
  whiteSpace: "nowrap",
2440
2577
  overflow: "hidden",
2441
2578
  textOverflow: "ellipsis"
2442
- } }, peer.alias || shortKey(peer.userId, 8, 5)), peer.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 13, color: "var(--faint)", stroke: 2 }), peer.app && /* @__PURE__ */ React.createElement(Tag, { tone: "accent", style: { height: 15, fontSize: 9.5, padding: "0 4px" } }, "APP"), muted && /* @__PURE__ */ React.createElement(Icon, { name: "bellOff", size: 12, color: "var(--faint)", stroke: 2, title: T && T.mutedTag || "sound muted" }), peer.wire === "64" && /* @__PURE__ */ React.createElement(Tag, { tone: "off", style: { height: 15, fontSize: 9.5, padding: "0 4px" } }, "w64")), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6, marginTop: 2 } }, peer.ip ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 11, color: "var(--faint)" } }, peer.ip), /* @__PURE__ */ React.createElement("span", { style: { color: "var(--line)", fontSize: 11 } }, "\xB7")) : null, /* @__PURE__ */ React.createElement("span", { style: {
2579
+ } }), peer.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 13, color: "var(--faint)", stroke: 2 }), peer.app && /* @__PURE__ */ React.createElement(Tag, { tone: "accent", style: { height: 15, fontSize: 9.5, padding: "0 4px" } }, "APP"), muted && /* @__PURE__ */ React.createElement(Icon, { name: "bellOff", size: 12, color: "var(--faint)", stroke: 2, title: T && T.mutedTag || "sound muted" }), peer.wire === "64" && /* @__PURE__ */ React.createElement(Tag, { tone: "off", style: { height: 15, fontSize: 9.5, padding: "0 4px" } }, "w64")), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6, marginTop: 2 } }, peer.ip ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 11, color: "var(--faint)" } }, peer.ip), /* @__PURE__ */ React.createElement("span", { style: { color: "var(--line)", fontSize: 11 } }, "\xB7")) : null, /* @__PURE__ */ React.createElement("span", { style: {
2443
2580
  fontSize: 11,
2444
2581
  color: "var(--dim)",
2445
2582
  whiteSpace: "nowrap",
@@ -2834,7 +2971,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
2834
2971
  title: grp.sender,
2835
2972
  style: { display: "inline-flex", alignItems: "center", gap: 5, background: "none", border: "none", padding: 0, cursor: "pointer" }
2836
2973
  },
2837
- avatar ? /* @__PURE__ */ React.createElement(DkEnsAvatar, { userid: grp.senderId, name: grp.sender, fallbackSeed: seed, size: 24, radius: 6 }) : /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 10.5, color: "var(--faint)" } }, grp.sender)
2974
+ avatar ? /* @__PURE__ */ React.createElement(DkEnsAvatar, { userid: grp.senderId, name: grp.sender, fallbackSeed: seed, size: 24, radius: 6 }) : /* @__PURE__ */ React.createElement(DkVerifiedName, { userid: grp.senderId, name: grp.sender, T, markSize: 10, style: { fontFamily: "var(--mono)", fontSize: 10.5, color: "var(--faint)" } })
2838
2975
  ), open && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { onClick: () => setOpen(false), style: { position: "fixed", inset: 0, zIndex: 40 } }), /* @__PURE__ */ React.createElement("span", { style: {
2839
2976
  position: "absolute",
2840
2977
  left: 0,
@@ -2849,7 +2986,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
2849
2986
  display: "flex",
2850
2987
  flexDirection: "column",
2851
2988
  gap: 8
2852
- } }, /* @__PURE__ */ React.createElement("span", { style: { display: "flex", alignItems: "center", gap: 8 } }, /* @__PURE__ */ React.createElement(DkEnsAvatar, { userid: grp.senderId, name: grp.sender, fallbackSeed: seed, size: 34, radius: 8 }), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 12.5, fontWeight: 700, color: "var(--text)", wordBreak: "break-all" } }, grp.sender)), grp.senderId ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Mono, { size: 10.5, dim: true, copy: grp.senderId, title: grp.senderId }, shortKey(grp.senderId, 12, 8)), /* @__PURE__ */ React.createElement(
2989
+ } }, /* @__PURE__ */ React.createElement("span", { style: { display: "flex", alignItems: "center", gap: 8 } }, /* @__PURE__ */ React.createElement(DkEnsAvatar, { userid: grp.senderId, name: grp.sender, fallbackSeed: seed, size: 34, radius: 8 }), /* @__PURE__ */ React.createElement(DkVerifiedName, { userid: grp.senderId, name: grp.sender, T, style: { fontFamily: "var(--mono)", fontSize: 12.5, fontWeight: 700, color: "var(--text)", wordBreak: "break-all" } })), grp.senderId ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Mono, { size: 10.5, dim: true, copy: grp.senderId, title: grp.senderId }, shortKey(grp.senderId, 12, 8)), /* @__PURE__ */ React.createElement(
2853
2990
  "button",
2854
2991
  {
2855
2992
  onClick: addFriend,
@@ -3886,7 +4023,17 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
3886
4023
  style: { width: 40, height: 44, flexShrink: 0, border: "none", background: "transparent", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", padding: 0 }
3887
4024
  },
3888
4025
  /* @__PURE__ */ React.createElement(Icon, { name: "chevronLeft", size: 26, stroke: 2.2, color: "var(--accent)" })
3889
- ), /* @__PURE__ */ React.createElement("div", { onClick: () => setPubProfile(true), title: T && T.pubOpen || "View public profile", style: { cursor: "pointer", flexShrink: 0 } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer, size: 34, radius: 8 })), /* @__PURE__ */ React.createElement("div", { style: { minWidth: 0, flex: phone ? 1 : void 0 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 } }, /* @__PURE__ */ React.createElement("span", { onClick: () => setPubProfile(true), style: { fontFamily: peer.alias ? "var(--ui)" : "var(--mono)", fontSize: 15, fontWeight: 700, color: "var(--text)", cursor: "pointer", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", minWidth: 0 } }, peer.alias || shortKey(peer.userId, phone ? 6 : 10, phone ? 4 : 6)), peer.app && !phone && /* @__PURE__ */ React.createElement(Tag, { tone: "accent" }, "APP"), peer.agent && !phone && /* @__PURE__ */ React.createElement(Tag, { tone: "accent" }, "agent"), isGroup && !phone && /* @__PURE__ */ React.createElement(Tag, null, T && T.groupTag || "group"), !phone && !peer.app && /* @__PURE__ */ React.createElement(RouteTag, { peer })), peer.app ? (
4026
+ ), /* @__PURE__ */ React.createElement("div", { onClick: () => setPubProfile(true), title: T && T.pubOpen || "View public profile", style: { cursor: "pointer", flexShrink: 0 } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer, size: 34, radius: 8 })), /* @__PURE__ */ React.createElement("div", { style: { minWidth: 0, flex: phone ? 1 : void 0 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 } }, /* @__PURE__ */ React.createElement("span", { onClick: () => setPubProfile(true), style: { display: "inline-flex", alignItems: "center", gap: 5, minWidth: 0, cursor: "pointer" } }, /* @__PURE__ */ React.createElement(
4027
+ DkVerifiedName,
4028
+ {
4029
+ userid: peer.app ? null : peer.userId,
4030
+ name: peer.alias,
4031
+ fallback: shortKey(peer.userId, phone ? 6 : 10, phone ? 4 : 6),
4032
+ T,
4033
+ markSize: 14,
4034
+ style: { fontFamily: peer.alias ? "var(--ui)" : "var(--mono)", fontSize: 15, fontWeight: 700, color: "var(--text)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", minWidth: 0 }
4035
+ }
4036
+ )), peer.app && !phone && /* @__PURE__ */ React.createElement(Tag, { tone: "accent" }, "APP"), peer.agent && !phone && /* @__PURE__ */ React.createElement(Tag, { tone: "accent" }, "agent"), isGroup && !phone && /* @__PURE__ */ React.createElement(Tag, null, T && T.groupTag || "group"), !phone && !peer.app && /* @__PURE__ */ React.createElement(RouteTag, { peer })), peer.app ? (
3890
4037
  // The internal id is not an address anyone can use and not a name
3891
4038
  // anyone chose; saying what this row IS is more use than showing it.
3892
4039
  /* @__PURE__ */ React.createElement("div", { style: { marginTop: 2, fontFamily: "var(--mono)", fontSize: 11.5, color: "var(--faint)" } }, T && T.assistantSub || "Local \xB7 APP")
@@ -4424,6 +4571,7 @@ ${peer.address}`
4424
4571
  function DkPublicProfile({ T, userid, fallbackName, onClose, isFriend, isMe, onMessage, card, friend }) {
4425
4572
  const view = card ? nameCardView(card, friend ? [friend] : []) : null;
4426
4573
  const [st, setSt] = React.useState({ loading: true });
4574
+ const ensV = useEnsVerdict(userid, st.prof && st.prof.ens);
4427
4575
  const [addState, setAddState] = React.useState(null);
4428
4576
  const [recOpen, setRecOpen] = React.useState(false);
4429
4577
  const [recPeers, setRecPeers] = React.useState(null);
@@ -4473,7 +4621,7 @@ ${peer.address}`
4473
4621
  const links = prof ? Object.entries(prof.links || {}) : [];
4474
4622
  const lbl = { width: 110, flexShrink: 0, fontFamily: "var(--mono)", fontSize: 11, fontWeight: 600, color: "var(--faint)", textTransform: "uppercase", letterSpacing: 0.5 };
4475
4623
  const rowS = { display: "flex", alignItems: "center", gap: 10, padding: "10px 0", borderTop: "1px solid var(--line)" };
4476
- return /* @__PURE__ */ React.createElement("div", { onClick: onClose, style: { position: "fixed", inset: 0, zIndex: 90, background: "color-mix(in oklab, #000, transparent 38%)", display: "flex", alignItems: "center", justifyContent: "center", padding: 24 } }, /* @__PURE__ */ React.createElement("div", { onClick: (e) => e.stopPropagation(), style: { width: 420, maxWidth: "94vw", background: "var(--panel)", border: "1px solid var(--line)", borderRadius: 16, padding: "20px 22px", display: "flex", flexDirection: "column", gap: 14 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 14 } }, prof && prof.avatarUrl ? /* @__PURE__ */ React.createElement(DkImgAvatar, { url: prof.avatarUrl, seed: userid, size: 56, radius: 14 }) : prof && prof.punkId != null ? /* @__PURE__ */ React.createElement(DkPunkAvatar, { id: prof.punkId, size: 56, radius: 14, fallbackSeed: userid }) : friend ? /* @__PURE__ */ React.createElement(DkAvatar, { peer: friend, size: 56, radius: 14, dot: false }) : card && card.avatar ? /* @__PURE__ */ React.createElement(DkImgAvatar, { url: card.avatar, seed: userid, size: 56, radius: 14 }) : /* @__PURE__ */ React.createElement(DkIdenticon, { seed: userid, size: 56, radius: 14 }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 17, fontWeight: 700, color: "var(--text)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, prof && prof.displayName || fallbackName || shortKey(userid, 10, 6)), prof && prof.ens && /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--mono)", fontSize: 12, color: "var(--accent)", marginTop: 2 } }, prof.ens)), /* @__PURE__ */ React.createElement(Btn, { icon: "x", size: "sm", onClick: onClose })), st.loading ? /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--faint)" } }, T.dirLoading || "loading\u2026") : !prof && view ? /* @__PURE__ */ React.createElement(DkNameCardNoProfile, { T, view, card, onMessage, isMe }) : !prof ? /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--faint)" } }, T.pubNone || "No public profile \u2014 this user has not registered a beagles.eth name.") : /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column" } }, prof.description && /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--dim)", paddingBottom: 12, lineHeight: 1.5 } }, prof.description), links.length > 0 && // Label keeps its column; pills wrap inside their OWN container so
4624
+ return /* @__PURE__ */ React.createElement("div", { onClick: onClose, style: { position: "fixed", inset: 0, zIndex: 90, background: "color-mix(in oklab, #000, transparent 38%)", display: "flex", alignItems: "center", justifyContent: "center", padding: 24 } }, /* @__PURE__ */ React.createElement("div", { onClick: (e) => e.stopPropagation(), style: { width: 420, maxWidth: "94vw", background: "var(--panel)", border: "1px solid var(--line)", borderRadius: 16, padding: "20px 22px", display: "flex", flexDirection: "column", gap: 14 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 14 } }, prof && prof.avatarUrl ? /* @__PURE__ */ React.createElement(DkImgAvatar, { url: prof.avatarUrl, seed: userid, size: 56, radius: 14 }) : prof && prof.punkId != null ? /* @__PURE__ */ React.createElement(DkPunkAvatar, { id: prof.punkId, size: 56, radius: 14, fallbackSeed: userid }) : friend ? /* @__PURE__ */ React.createElement(DkAvatar, { peer: friend, size: 56, radius: 14, dot: false }) : card && card.avatar ? /* @__PURE__ */ React.createElement(DkImgAvatar, { url: card.avatar, seed: userid, size: 56, radius: 14 }) : /* @__PURE__ */ React.createElement(DkIdenticon, { seed: userid, size: 56, radius: 14 }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 17, fontWeight: 700, color: "var(--text)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, prof && prof.displayName || fallbackName || shortKey(userid, 10, 6)), prof && prof.ens && /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 5, fontFamily: "var(--mono)", fontSize: 12, color: "var(--accent)", marginTop: 2 } }, prof.ens, /* @__PURE__ */ React.createElement(DkEnsMark, { verdict: ensV, T }))), /* @__PURE__ */ React.createElement(Btn, { icon: "x", size: "sm", onClick: onClose })), st.loading ? /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--faint)" } }, T.dirLoading || "loading\u2026") : !prof && view ? /* @__PURE__ */ React.createElement(DkNameCardNoProfile, { T, view, card, onMessage, isMe }) : !prof ? /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--faint)" } }, T.pubNone || "No public profile \u2014 this user has not registered a beagles.eth name.") : /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column" } }, prof.description && /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--dim)", paddingBottom: 12, lineHeight: 1.5 } }, prof.description), links.length > 0 && // Label keeps its column; pills wrap inside their OWN container so
4477
4625
  // an overflowing pill lands under the first pill, never under the label.
4478
4626
  /* @__PURE__ */ React.createElement("div", { style: { ...rowS, alignItems: "flex-start" } }, /* @__PURE__ */ React.createElement("span", { style: { ...lbl, paddingTop: 5 } }, T.linksCard || "links"), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0, display: "flex", gap: 8, flexWrap: "wrap" } }, links.map(([k, h]) => /* @__PURE__ */ React.createElement(
4479
4627
  "a",
@@ -4522,7 +4670,7 @@ ${peer.address}`
4522
4670
  style: { display: "flex", alignItems: "center", gap: 9, padding: "6px 8px", borderRadius: 9, border: "none", background: "transparent", cursor: recState[p.id] ? "default" : "pointer", textAlign: "left" }
4523
4671
  },
4524
4672
  /* @__PURE__ */ React.createElement(DkAvatar, { peer: p, size: 26, radius: 7, dot: false }),
4525
- /* @__PURE__ */ React.createElement("span", { style: { flex: 1, minWidth: 0, fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--text)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, p.alias || shortKey(p.userId, 8, 6)),
4673
+ /* @__PURE__ */ React.createElement("span", { style: { flex: 1, minWidth: 0, fontFamily: "var(--ui)", fontSize: 12.5, color: "var(--text)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, /* @__PURE__ */ React.createElement(DkVerifiedName, { userid: p.userId, name: p.alias, fallback: shortKey(p.userId, 8, 6), T })),
4526
4674
  recState[p.id] === "sent" ? /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--ui)", fontSize: 11.5, color: "var(--online)" } }, T.pubRecSent || "sent \u2713") : recState[p.id] === "busy" ? /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--ui)", fontSize: 11.5, color: "var(--faint)" } }, "\u2026") : recState[p.id] ? /* @__PURE__ */ React.createElement("span", { title: recState[p.id], style: { fontFamily: "var(--ui)", fontSize: 11.5, color: "var(--warn, #f59e0b)" } }, T.addFailed || "failed") : /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--ui)", fontSize: 11.5, color: "var(--accent)" } }, T.send || "Send")
4527
4675
  ))))));
4528
4676
  }
@@ -6872,7 +7020,7 @@ ${peer.address}`
6872
7020
  if (!peers.length)
6873
7021
  return null;
6874
7022
  if (phone) {
6875
- return /* @__PURE__ */ React.createElement("div", { style: { borderRadius: 11, border: "1px solid var(--line)", overflow: "hidden", background: "var(--panel)" } }, peers.map((p, i) => /* @__PURE__ */ React.createElement("div", { key: p.id, onClick: () => onOpenChat(p.id), style: { display: "flex", alignItems: "center", gap: 10, padding: "10px 12px", cursor: "pointer", borderBottom: i < peers.length - 1 ? "1px solid var(--line)" : "none" } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: p, size: 30, radius: 7 }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: 3 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6, minWidth: 0 } }, /* @__PURE__ */ React.createElement("span", { style: { fontFamily: p.alias ? "var(--ui)" : "var(--mono)", fontSize: 13.5, fontWeight: 600, color: "var(--text)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", minWidth: 0 } }, p.alias || shortKey(p.userId, 8, 5)), p.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 12, color: "var(--faint)", stroke: 2 })), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6, minWidth: 0 } }, /* @__PURE__ */ React.createElement(RouteTag, { peer: p }), p.ip ? /* @__PURE__ */ React.createElement(Mono, { size: 11.5, dim: true, copy: p.ip }, p.ip) : null)), /* @__PURE__ */ React.createElement(Icon, { name: "chevronRight", size: 16, color: "var(--faint)", stroke: 2 }))));
7023
+ return /* @__PURE__ */ React.createElement("div", { style: { borderRadius: 11, border: "1px solid var(--line)", overflow: "hidden", background: "var(--panel)" } }, peers.map((p, i) => /* @__PURE__ */ React.createElement("div", { key: p.id, onClick: () => onOpenChat(p.id), style: { display: "flex", alignItems: "center", gap: 10, padding: "10px 12px", cursor: "pointer", borderBottom: i < peers.length - 1 ? "1px solid var(--line)" : "none" } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: p, size: 30, radius: 7 }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: 3 } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6, minWidth: 0 } }, /* @__PURE__ */ React.createElement(DkVerifiedName, { userid: p.userId, name: p.alias, fallback: shortKey(p.userId, 8, 5), T, style: { fontFamily: p.alias ? "var(--ui)" : "var(--mono)", fontSize: 13.5, fontWeight: 600, color: "var(--text)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", minWidth: 0 } }), p.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 12, color: "var(--faint)", stroke: 2 })), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6, minWidth: 0 } }, /* @__PURE__ */ React.createElement(RouteTag, { peer: p }), p.ip ? /* @__PURE__ */ React.createElement(Mono, { size: 11.5, dim: true, copy: p.ip }, p.ip) : null)), /* @__PURE__ */ React.createElement(Icon, { name: "chevronRight", size: 16, color: "var(--faint)", stroke: 2 }))));
6876
7024
  }
6877
7025
  return /* @__PURE__ */ React.createElement("div", { style: { borderRadius: 11, border: "1px solid var(--line)", overflow: "hidden", background: "var(--panel)" } }, /* @__PURE__ */ React.createElement("div", { style: { display: "grid", gridTemplateColumns: "1.4fr 1fr 1fr 0.8fr 90px", gap: 0, padding: "9px 16px", borderBottom: "1px solid var(--line)", background: "var(--panel-2)" } }, [T.colPeer, T.colVip, T.colPath, T.colWire, ""].map((h, i) => /* @__PURE__ */ React.createElement("span", { key: i, style: { fontFamily: "var(--mono)", fontSize: 10.5, fontWeight: 700, letterSpacing: 0.8, textTransform: "uppercase", color: "var(--faint)", textAlign: i === 4 ? "right" : "left" } }, h))), peers.map((p, i) => /* @__PURE__ */ React.createElement("div", { key: p.id, style: {
6878
7026
  display: "grid",
@@ -6881,7 +7029,7 @@ ${peer.address}`
6881
7029
  alignItems: "center",
6882
7030
  padding: "11px 16px",
6883
7031
  borderBottom: i < peers.length - 1 ? "1px solid var(--line)" : "none"
6884
- } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 10, minWidth: 0 } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: p, size: 26, radius: 6 }), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: p.alias ? "var(--ui)" : "var(--mono)", fontSize: 13, fontWeight: 600, color: "var(--text)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }, p.alias || shortKey(p.userId, 8, 5)), p.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 12, color: "var(--faint)", stroke: 2 })), /* @__PURE__ */ React.createElement(Mono, { size: 12.5, dim: true, copy: p.ip }, p.ip), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(RouteTag, { peer: p })), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 11.5, color: p.wire === "64" ? "var(--warn)" : "var(--dim)" } }, p.wire === "64" ? "old\xB764" : "new\xB7163"), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", justifyContent: "flex-end", gap: 6 } }, /* @__PURE__ */ React.createElement(Btn, { icon: "message", size: "sm", title: T.openChat, onClick: () => onOpenChat(p.id) }), /* @__PURE__ */ React.createElement(Btn, { icon: "signal", size: "sm", title: T.ping })))));
7032
+ } }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 10, minWidth: 0 } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: p, size: 26, radius: 6 }), /* @__PURE__ */ React.createElement(DkVerifiedName, { userid: p.userId, name: p.alias, fallback: shortKey(p.userId, 8, 5), T, style: { fontFamily: p.alias ? "var(--ui)" : "var(--mono)", fontSize: 13, fontWeight: 600, color: "var(--text)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }), p.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 12, color: "var(--faint)", stroke: 2 })), /* @__PURE__ */ React.createElement(Mono, { size: 12.5, dim: true, copy: p.ip }, p.ip), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(RouteTag, { peer: p })), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 11.5, color: p.wire === "64" ? "var(--warn)" : "var(--dim)" } }, p.wire === "64" ? "old\xB764" : "new\xB7163"), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", justifyContent: "flex-end", gap: 6 } }, /* @__PURE__ */ React.createElement(Btn, { icon: "message", size: "sm", title: T.openChat, onClick: () => onOpenChat(p.id) }), /* @__PURE__ */ React.createElement(Btn, { icon: "signal", size: "sm", title: T.ping })))));
6885
7033
  }
6886
7034
  function ReconnectBtn({ T, ip, onReconnect, label, icon = "refresh" }) {
6887
7035
  const [busy, setBusy] = React.useState(false);
@@ -7562,6 +7710,10 @@ ${peer.address}`
7562
7710
  joinGroup: "Join group",
7563
7711
  cardIsFriend: "Already in your chats.",
7564
7712
  cardNoEns: "No beagles.eth name registered.",
7713
+ ensVerified: "Verified: this beagles.eth name is registered to this user.",
7714
+ ensVerifiedReplaced: "Registered beagles.eth name for this user. Their device shows {claimed}, which is not registered to them.",
7715
+ ensSelfClaimed: "self-claimed",
7716
+ ensSelfClaimedTip: "Shown by their device. This beagles.eth name is not registered to this user.",
7565
7717
  voiceMessage: "Voice message",
7566
7718
  groupFileNotDelivered: "Not delivered to this device: the group sends agents only a description of files.",
7567
7719
  shareFailed: "Screen share failed",
@@ -7792,6 +7944,10 @@ ${peer.address}`
7792
7944
  joinGroup: "\u52A0\u5165\u7FA4",
7793
7945
  cardIsFriend: "\u5DF2\u5728\u4F60\u7684\u4F1A\u8BDD\u91CC\u3002",
7794
7946
  cardNoEns: "\u5BF9\u65B9\u8FD8\u6CA1\u6709\u6CE8\u518C beagles.eth \u540D\u5B57\u3002",
7947
+ ensVerified: "\u5DF2\u9A8C\u8BC1:\u8FD9\u4E2A beagles.eth \u540D\u5B57\u6CE8\u518C\u5728\u6B64\u7528\u6237\u540D\u4E0B\u3002",
7948
+ ensVerifiedReplaced: "\u6B64\u7528\u6237\u6CE8\u518C\u7684 beagles.eth \u540D\u5B57\u3002\u5BF9\u65B9\u8BBE\u5907\u663E\u793A\u7684\u662F {claimed},\u5B83\u5E76\u6CA1\u6709\u6CE8\u518C\u5728\u5BF9\u65B9\u540D\u4E0B\u3002",
7949
+ ensSelfClaimed: "\u81EA\u79F0",
7950
+ ensSelfClaimedTip: "\u8FD9\u662F\u5BF9\u65B9\u8BBE\u5907\u81EA\u5DF1\u586B\u5199\u7684\u540D\u5B57,\u8FD9\u4E2A beagles.eth \u540D\u5B57\u5E76\u6CA1\u6709\u6CE8\u518C\u5728\u6B64\u7528\u6237\u540D\u4E0B\u3002",
7795
7951
  voiceMessage: "\u8BED\u97F3\u6D88\u606F",
7796
7952
  groupFileNotDelivered: "\u672A\u9001\u8FBE\u672C\u8BBE\u5907\uFF1A\u7FA4\u7EC4\u53EA\u5411\u4EE3\u7406\u53D1\u9001\u6587\u4EF6\u8BF4\u660E\uFF0C\u4E0D\u542B\u6587\u4EF6\u5185\u5BB9\u3002",
7797
7953
  shareFailed: "\u5C4F\u5E55\u5171\u4EAB\u5931\u8D25",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/beagle",
3
- "version": "0.1.143",
3
+ "version": "0.1.144",
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.45",
29
+ "@decentnetwork/beagle-ui": "^0.2.46",
30
30
  "@decentnetwork/chat-components": "^0.1.3",
31
31
  "@decentnetwork/lan": "^0.1.316",
32
32
  "@decentnetwork/peer": "^0.1.178",