@decentnetwork/beagle 0.1.142 → 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.
- package/dist/desktop/app.js +321 -71
- package/package.json +2 -2
package/dist/desktop/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.__DK_UI_VERSION="0.1.
|
|
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,257 @@ ${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
|
+
}
|
|
2286
|
+
var NATIVE_MEDIA_MIME = {
|
|
2287
|
+
".jpg": "image/jpeg",
|
|
2288
|
+
".jpeg": "image/jpeg",
|
|
2289
|
+
".png": "image/png",
|
|
2290
|
+
".gif": "image/gif",
|
|
2291
|
+
".webp": "image/webp",
|
|
2292
|
+
".heic": "image/heic",
|
|
2293
|
+
".heif": "image/heif",
|
|
2294
|
+
".bmp": "image/bmp",
|
|
2295
|
+
".m4a": "audio/mp4",
|
|
2296
|
+
".aac": "audio/aac",
|
|
2297
|
+
".mp3": "audio/mpeg",
|
|
2298
|
+
".wav": "audio/wav",
|
|
2299
|
+
".caf": "audio/x-caf",
|
|
2300
|
+
".amr": "audio/amr",
|
|
2301
|
+
".ogg": "audio/ogg",
|
|
2302
|
+
".opus": "audio/ogg",
|
|
2303
|
+
".mp4": "video/mp4",
|
|
2304
|
+
".mov": "video/quicktime",
|
|
2305
|
+
".m4v": "video/x-m4v",
|
|
2306
|
+
".3gp": "video/3gpp",
|
|
2307
|
+
".webm": "video/webm"
|
|
2308
|
+
};
|
|
2309
|
+
var GROUP_TS_RE = /\n?\[(20\d{2}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{2}:\d{2})\]\s*$/;
|
|
2310
|
+
function stripGroupTs(text) {
|
|
2311
|
+
const m = GROUP_TS_RE.exec(text);
|
|
2312
|
+
return m ? { body: text.slice(0, m.index), ts: m[1] } : { body: text, ts: null };
|
|
2313
|
+
}
|
|
2314
|
+
function splitGroupSender(text) {
|
|
2315
|
+
const m = /^([^:\n]{1,48}):\s([\s\S]+)$/.exec(text);
|
|
2316
|
+
return m ? { sender: m[1], body: m[2] } : null;
|
|
2317
|
+
}
|
|
2318
|
+
function nativeMediaKind(type, ext) {
|
|
2319
|
+
const t = String(type || "").toLowerCase();
|
|
2320
|
+
if (t === "image" || t === "photo" || t === "picture")
|
|
2321
|
+
return "image";
|
|
2322
|
+
if (t === "audio" || t === "voice")
|
|
2323
|
+
return "audio";
|
|
2324
|
+
if (t === "video")
|
|
2325
|
+
return "video";
|
|
2326
|
+
const mime = NATIVE_MEDIA_MIME[String(ext || "").toLowerCase()];
|
|
2327
|
+
return mime ? mime.split("/")[0] : null;
|
|
2328
|
+
}
|
|
2329
|
+
function unwrapCGP1(text) {
|
|
2330
|
+
if (!text.startsWith("CGP1 "))
|
|
2331
|
+
return null;
|
|
2332
|
+
let j = null;
|
|
2333
|
+
try {
|
|
2334
|
+
j = JSON.parse(text.slice(5));
|
|
2335
|
+
} catch (e) {
|
|
2336
|
+
return null;
|
|
2337
|
+
}
|
|
2338
|
+
if (!j || typeof j !== "object" || !j.message || typeof j.message.text !== "string")
|
|
2339
|
+
return null;
|
|
2340
|
+
const origin = j.origin || {};
|
|
2341
|
+
const senderId = origin.userid || origin.friendid || null;
|
|
2342
|
+
const sender = origin.nickname || origin.user_info && origin.user_info.name || (senderId ? senderId.slice(0, 10) : null);
|
|
2343
|
+
return { text: j.message.text, sender, senderId };
|
|
2344
|
+
}
|
|
2345
|
+
var MEDIA_SHAPE_RE = /^\{[\s\S]*"(?:fileExtension|fileName)"\s*:[\s\S]*"data"\s*:\s*"|^\{[\s\S]*"data"\s*:\s*"[A-Za-z0-9+/\\]{64}/;
|
|
2346
|
+
function nativeMediaFromText(input) {
|
|
2347
|
+
let text = String(input == null ? "" : input).trim();
|
|
2348
|
+
let sender = null;
|
|
2349
|
+
let senderId = null;
|
|
2350
|
+
const cgp = unwrapCGP1(text);
|
|
2351
|
+
if (cgp) {
|
|
2352
|
+
text = cgp.text;
|
|
2353
|
+
sender = cgp.sender;
|
|
2354
|
+
senderId = cgp.senderId;
|
|
2355
|
+
}
|
|
2356
|
+
let body = stripGroupTs(text).body.trim();
|
|
2357
|
+
if (body.length < 32)
|
|
2358
|
+
return null;
|
|
2359
|
+
if (!body.startsWith("{")) {
|
|
2360
|
+
const split = splitGroupSender(body);
|
|
2361
|
+
if (!split || !split.body.trim().startsWith("{"))
|
|
2362
|
+
return null;
|
|
2363
|
+
sender = sender || split.sender;
|
|
2364
|
+
body = split.body.trim();
|
|
2365
|
+
}
|
|
2366
|
+
if (!MEDIA_SHAPE_RE.test(body))
|
|
2367
|
+
return null;
|
|
2368
|
+
const extMatch = /"fileExtension"\s*:\s*"([^"]{0,16})"/.exec(body);
|
|
2369
|
+
const nameMatch = /"fileName"\s*:\s*"([^"]{0,200})"/.exec(body);
|
|
2370
|
+
const typeMatch = /"type"\s*:\s*"([^"]{0,32})"/.exec(body);
|
|
2371
|
+
let j = null;
|
|
2372
|
+
try {
|
|
2373
|
+
j = body.endsWith("}") ? JSON.parse(body) : null;
|
|
2374
|
+
} catch (e) {
|
|
2375
|
+
j = null;
|
|
2376
|
+
}
|
|
2377
|
+
if (!j || typeof j !== "object" || typeof j.data !== "string" || j.data.length < 16) {
|
|
2378
|
+
if (!extMatch && !nameMatch)
|
|
2379
|
+
return null;
|
|
2380
|
+
const ext2 = extMatch ? extMatch[1].toLowerCase() : "";
|
|
2381
|
+
const kind2 = nativeMediaKind(typeMatch && typeMatch[1], ext2) || "file";
|
|
2382
|
+
return { sender, senderId, kind: kind2, name: (nameMatch ? nameMatch[1] : "file") + ext2, broken: true };
|
|
2383
|
+
}
|
|
2384
|
+
const ext = String(j.fileExtension || "").toLowerCase();
|
|
2385
|
+
const named = typeof j.fileName === "string" || typeof j.fileExtension === "string";
|
|
2386
|
+
const typed = nativeMediaKind(j.type, "");
|
|
2387
|
+
if (!named && !typed)
|
|
2388
|
+
return null;
|
|
2389
|
+
const kind = nativeMediaKind(j.type, ext) || "file";
|
|
2390
|
+
const mime = NATIVE_MEDIA_MIME[ext] || (kind === "file" ? "application/octet-stream" : kind + "/*");
|
|
2391
|
+
const name = String(j.fileName || "file") + ext;
|
|
2392
|
+
return { sender, senderId, kind, name, url: "data:" + mime + ";base64," + j.data.replace(/\s+/g, "") };
|
|
2393
|
+
}
|
|
2394
|
+
function nativeMediaLabel(media) {
|
|
2395
|
+
if (!media)
|
|
2396
|
+
return "";
|
|
2397
|
+
const word = media.kind === "image" ? "image" : media.kind === "audio" ? "voice" : media.kind === "video" ? "video" : "file";
|
|
2398
|
+
return "[" + word + "] " + media.name;
|
|
2399
|
+
}
|
|
2149
2400
|
var DK_CMD_HIST_KEY = "beagle.assistant.history";
|
|
2150
2401
|
var DK_CMD_HIST_MAX = 50;
|
|
2151
2402
|
function RequestsBlock({ T, requests, onAct }) {
|
|
@@ -2317,7 +2568,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2317
2568
|
fontFamily: "inherit",
|
|
2318
2569
|
border: "1px solid " + (active ? "var(--line)" : "transparent"),
|
|
2319
2570
|
background: active ? "var(--panel-2)" : "transparent"
|
|
2320
|
-
} }, /* @__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(
|
|
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: {
|
|
2321
2572
|
fontFamily: peer.alias ? "var(--ui)" : "var(--mono)",
|
|
2322
2573
|
fontSize: 13.5,
|
|
2323
2574
|
fontWeight: 600,
|
|
@@ -2325,7 +2576,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2325
2576
|
whiteSpace: "nowrap",
|
|
2326
2577
|
overflow: "hidden",
|
|
2327
2578
|
textOverflow: "ellipsis"
|
|
2328
|
-
} }
|
|
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: {
|
|
2329
2580
|
fontSize: 11,
|
|
2330
2581
|
color: "var(--dim)",
|
|
2331
2582
|
whiteSpace: "nowrap",
|
|
@@ -2556,6 +2807,9 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2556
2807
|
return card;
|
|
2557
2808
|
const s = String(text == null ? "" : text);
|
|
2558
2809
|
const mine = /^you:\s*/i.test(s);
|
|
2810
|
+
const media = nativeMediaFromText(s.replace(/^you:\s*/i, ""));
|
|
2811
|
+
if (media)
|
|
2812
|
+
return (mine ? "you: " : "") + (media.sender ? media.sender + ": " : "") + nativeMediaLabel(media);
|
|
2559
2813
|
const cgp = dkParseCGP1(s.replace(/^you:\s*/i, ""));
|
|
2560
2814
|
if (cgp)
|
|
2561
2815
|
return (mine ? "you: " : "") + cgp.sender + ": " + (cgp.file ? fileLabel(cgp.file, T) : cgp.body.replace(/\s+/g, " "));
|
|
@@ -2663,31 +2917,6 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2663
2917
|
}
|
|
2664
2918
|
return html || dkHtmlEscape(src);
|
|
2665
2919
|
}
|
|
2666
|
-
var DK_NATIVE_MEDIA_MIME = {
|
|
2667
|
-
".jpg": "image/jpeg",
|
|
2668
|
-
".jpeg": "image/jpeg",
|
|
2669
|
-
".png": "image/png",
|
|
2670
|
-
".gif": "image/gif",
|
|
2671
|
-
".webp": "image/webp",
|
|
2672
|
-
".heic": "image/heic",
|
|
2673
|
-
".m4a": "audio/mp4",
|
|
2674
|
-
".aac": "audio/aac",
|
|
2675
|
-
".mp3": "audio/mpeg",
|
|
2676
|
-
".wav": "audio/wav",
|
|
2677
|
-
".caf": "audio/x-caf",
|
|
2678
|
-
".mp4": "video/mp4",
|
|
2679
|
-
".mov": "video/quicktime",
|
|
2680
|
-
".m4v": "video/x-m4v"
|
|
2681
|
-
};
|
|
2682
|
-
var DK_GROUP_TS_RE = /\n?\[(20\d{2}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{2}:\d{2})\]\s*$/;
|
|
2683
|
-
function dkStripGroupTs(text) {
|
|
2684
|
-
const m = DK_GROUP_TS_RE.exec(text);
|
|
2685
|
-
return m ? { body: text.slice(0, m.index), ts: m[1] } : { body: text, ts: null };
|
|
2686
|
-
}
|
|
2687
|
-
function dkSplitGroupSender(text) {
|
|
2688
|
-
const m = /^([^:\n]{1,48}):\s([\s\S]+)$/.exec(text);
|
|
2689
|
-
return m ? { sender: m[1], body: m[2] } : null;
|
|
2690
|
-
}
|
|
2691
2920
|
function dkParseCGP1(text) {
|
|
2692
2921
|
const t = String(text || "").trim();
|
|
2693
2922
|
if (!t.startsWith("CGP1 "))
|
|
@@ -2712,8 +2941,8 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2712
2941
|
if (cgp)
|
|
2713
2942
|
return cgp;
|
|
2714
2943
|
const t = String(text || "");
|
|
2715
|
-
const { body: noTs, ts } =
|
|
2716
|
-
const split =
|
|
2944
|
+
const { body: noTs, ts } = stripGroupTs(t);
|
|
2945
|
+
const split = splitGroupSender(noTs.trim());
|
|
2717
2946
|
if (!split)
|
|
2718
2947
|
return null;
|
|
2719
2948
|
return { sender: split.sender, senderId: null, body: split.body.trim(), ts, strong: !!ts };
|
|
@@ -2742,7 +2971,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2742
2971
|
title: grp.sender,
|
|
2743
2972
|
style: { display: "inline-flex", alignItems: "center", gap: 5, background: "none", border: "none", padding: 0, cursor: "pointer" }
|
|
2744
2973
|
},
|
|
2745
|
-
avatar ? /* @__PURE__ */ React.createElement(DkEnsAvatar, { userid: grp.senderId, name: grp.sender, fallbackSeed: seed, size: 24, radius: 6 }) : /* @__PURE__ */ React.createElement(
|
|
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)" } })
|
|
2746
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: {
|
|
2747
2976
|
position: "absolute",
|
|
2748
2977
|
left: 0,
|
|
@@ -2757,7 +2986,7 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2757
2986
|
display: "flex",
|
|
2758
2987
|
flexDirection: "column",
|
|
2759
2988
|
gap: 8
|
|
2760
|
-
} }, /* @__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(
|
|
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(
|
|
2761
2990
|
"button",
|
|
2762
2991
|
{
|
|
2763
2992
|
onClick: addFriend,
|
|
@@ -2799,36 +3028,6 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2799
3028
|
function dkThreadIsGroup(thread) {
|
|
2800
3029
|
return (thread || []).some((m) => !m.day && m.dir !== "out" && !m.file && (dkGroupParse(m.text) || {}).strong);
|
|
2801
3030
|
}
|
|
2802
|
-
function dkNativeMediaFromText(text) {
|
|
2803
|
-
let body = dkStripGroupTs(String(text || "")).body.trim();
|
|
2804
|
-
if (body.length < 32)
|
|
2805
|
-
return null;
|
|
2806
|
-
let sender = null;
|
|
2807
|
-
if (!body.startsWith("{")) {
|
|
2808
|
-
const split = dkSplitGroupSender(body);
|
|
2809
|
-
if (!split || !split.body.startsWith("{"))
|
|
2810
|
-
return null;
|
|
2811
|
-
sender = split.sender;
|
|
2812
|
-
body = split.body.trim();
|
|
2813
|
-
}
|
|
2814
|
-
if (!body.startsWith("{") || !body.endsWith("}"))
|
|
2815
|
-
return null;
|
|
2816
|
-
let j = null;
|
|
2817
|
-
try {
|
|
2818
|
-
j = JSON.parse(body);
|
|
2819
|
-
} catch (e) {
|
|
2820
|
-
return null;
|
|
2821
|
-
}
|
|
2822
|
-
if (!j || typeof j !== "object" || typeof j.data !== "string" || j.data.length < 16)
|
|
2823
|
-
return null;
|
|
2824
|
-
const kind = j.type === "image" ? "image" : j.type === "audio" || j.type === "voice" ? "audio" : j.type === "video" ? "video" : null;
|
|
2825
|
-
if (!kind)
|
|
2826
|
-
return null;
|
|
2827
|
-
const ext = String(j.fileExtension || "").toLowerCase();
|
|
2828
|
-
const mime = DK_NATIVE_MEDIA_MIME[ext] || kind + "/*";
|
|
2829
|
-
const name = String(j.fileName || "file") + ext;
|
|
2830
|
-
return { sender, kind, name, url: "data:" + mime + ";base64," + j.data.replace(/\s+/g, "") };
|
|
2831
|
-
}
|
|
2832
3031
|
function MarkdownText({ text, onNameCard }) {
|
|
2833
3032
|
const onClick = (e) => {
|
|
2834
3033
|
const a = e.target && e.target.closest && e.target.closest("a");
|
|
@@ -3056,10 +3255,10 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
3056
3255
|
}
|
|
3057
3256
|
function DkMsgBody({ m, peer, T, lang, onTheater, onDelete, onCancel, onRetry, onRetryMsg, onReveal, onOpenFile, onCall, onFormSubmit, onNameCard, onAssistantRemove, onAssistantAdopt, answered, selMode, selected, onToggleSel, busy, isGroup }) {
|
|
3058
3257
|
const mine = m.from === "me";
|
|
3059
|
-
const nativeMedia = !m.file ?
|
|
3258
|
+
const nativeMedia = !m.file ? nativeMediaFromText(m.text) : null;
|
|
3060
3259
|
const grp = isGroup && m.dir !== "out" && !m.file && !nativeMedia ? dkGroupParse(m.text) : null;
|
|
3061
3260
|
const fileSender = !mine && m.file && m.origin && (m.origin.userid || m.origin.nickname) ? { sender: m.origin.nickname || (m.origin.userid || "").slice(0, 10), senderId: m.origin.userid || null } : null;
|
|
3062
|
-
const grpSender = grp || fileSender || (nativeMedia && nativeMedia.sender ? { sender: nativeMedia.sender, senderId: null } : null);
|
|
3261
|
+
const grpSender = grp || fileSender || (nativeMedia && nativeMedia.sender ? { sender: nativeMedia.sender, senderId: nativeMedia.senderId || null } : null);
|
|
3063
3262
|
const read = window.ChatComponents ? window.ChatComponents.readMessage((grp ? grp.body : m.text) || "") : { text: grp ? grp.body : m.text, form: null, interaction: null };
|
|
3064
3263
|
const submitted = read.form && answered ? answered.get(read.form.custom_id) : null;
|
|
3065
3264
|
const rtcFile = !mine && !m.file ? dkRtcFileFromText(peer.userId || peer.id, m.text) : null;
|
|
@@ -3353,7 +3552,18 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
3353
3552
|
)
|
|
3354
3553
|
);
|
|
3355
3554
|
})()
|
|
3356
|
-
) : nativeMedia ? /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4, maxWidth: "min(420px, 88%)" } }, nativeMedia.sender && /* @__PURE__ */ React.createElement(DkGroupSender, { grp: { sender: nativeMedia.sender, senderId: null }, T }), nativeMedia.
|
|
3555
|
+
) : nativeMedia ? /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4, maxWidth: "min(420px, 88%)" } }, nativeMedia.sender && /* @__PURE__ */ React.createElement(DkGroupSender, { grp: { sender: nativeMedia.sender, senderId: nativeMedia.senderId || null }, T }), nativeMedia.broken ? (
|
|
3556
|
+
// Cut short or malformed: say what it was, never show the base64.
|
|
3557
|
+
/* @__PURE__ */ React.createElement("span", { style: {
|
|
3558
|
+
padding: "9px 12px",
|
|
3559
|
+
borderRadius: 12,
|
|
3560
|
+
background: "var(--bub-them)",
|
|
3561
|
+
border: "1px solid var(--line)",
|
|
3562
|
+
fontFamily: "var(--ui)",
|
|
3563
|
+
fontSize: 12.5,
|
|
3564
|
+
color: "var(--faint)"
|
|
3565
|
+
} }, "[" + (T && T["mediaKind_" + nativeMedia.kind] || nativeMedia.kind) + ", " + (T && T.mediaNotShown || "could not be shown") + "] " + nativeMedia.name)
|
|
3566
|
+
) : nativeMedia.kind === "image" ? /* @__PURE__ */ React.createElement(
|
|
3357
3567
|
"img",
|
|
3358
3568
|
{
|
|
3359
3569
|
src: nativeMedia.url,
|
|
@@ -3368,7 +3578,28 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
3368
3578
|
}
|
|
3369
3579
|
}
|
|
3370
3580
|
}
|
|
3371
|
-
) : nativeMedia.kind === "audio" ? /* @__PURE__ */ React.createElement("audio", { controls: true, src: nativeMedia.url, style: { maxWidth: "100%" } }) : /* @__PURE__ */ React.createElement("video", { controls: true, src: nativeMedia.url, style: { maxWidth: "100%", borderRadius: 12, border: "1px solid var(--line)" } })
|
|
3581
|
+
) : nativeMedia.kind === "audio" ? /* @__PURE__ */ React.createElement("audio", { controls: true, src: nativeMedia.url, style: { maxWidth: "100%" } }) : nativeMedia.kind === "video" ? /* @__PURE__ */ React.createElement("video", { controls: true, src: nativeMedia.url, style: { maxWidth: "100%", borderRadius: 12, border: "1px solid var(--line)" } }) : /* @__PURE__ */ React.createElement(
|
|
3582
|
+
"a",
|
|
3583
|
+
{
|
|
3584
|
+
href: nativeMedia.url,
|
|
3585
|
+
download: nativeMedia.name,
|
|
3586
|
+
style: {
|
|
3587
|
+
display: "inline-flex",
|
|
3588
|
+
alignItems: "center",
|
|
3589
|
+
gap: 8,
|
|
3590
|
+
padding: "9px 12px",
|
|
3591
|
+
borderRadius: 12,
|
|
3592
|
+
background: "var(--bub-them)",
|
|
3593
|
+
border: "1px solid var(--line)",
|
|
3594
|
+
color: "var(--text)",
|
|
3595
|
+
fontFamily: "var(--mono)",
|
|
3596
|
+
fontSize: 12.5,
|
|
3597
|
+
textDecoration: "none"
|
|
3598
|
+
}
|
|
3599
|
+
},
|
|
3600
|
+
/* @__PURE__ */ React.createElement(Icon, { name: "download", size: 16, stroke: 2, color: "var(--accent)" }),
|
|
3601
|
+
nativeMedia.name
|
|
3602
|
+
)) : grp && grp.file ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DkGroupSender, { grp, T }), /* @__PURE__ */ React.createElement(DkGroupFileCard, { file: grp.file, T, offline: m.via === "offline" })) : (() => {
|
|
3372
3603
|
const contact = !read.form ? dkParseBeagleContact(read.text) : null;
|
|
3373
3604
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, grp && /* @__PURE__ */ React.createElement(DkGroupSender, { grp, T }), contact && (contact.address || contact.userid) ? /* @__PURE__ */ React.createElement(DkContactCardMsg, { card: contact, mine, T, onNameCard }) : /* @__PURE__ */ React.createElement("div", { style: {
|
|
3374
3605
|
padding: "8px 12px",
|
|
@@ -3792,7 +4023,17 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
3792
4023
|
style: { width: 40, height: 44, flexShrink: 0, border: "none", background: "transparent", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", padding: 0 }
|
|
3793
4024
|
},
|
|
3794
4025
|
/* @__PURE__ */ React.createElement(Icon, { name: "chevronLeft", size: 26, stroke: 2.2, color: "var(--accent)" })
|
|
3795
|
-
), /* @__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: {
|
|
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 ? (
|
|
3796
4037
|
// The internal id is not an address anyone can use and not a name
|
|
3797
4038
|
// anyone chose; saying what this row IS is more use than showing it.
|
|
3798
4039
|
/* @__PURE__ */ React.createElement("div", { style: { marginTop: 2, fontFamily: "var(--mono)", fontSize: 11.5, color: "var(--faint)" } }, T && T.assistantSub || "Local \xB7 APP")
|
|
@@ -4330,6 +4571,7 @@ ${peer.address}`
|
|
|
4330
4571
|
function DkPublicProfile({ T, userid, fallbackName, onClose, isFriend, isMe, onMessage, card, friend }) {
|
|
4331
4572
|
const view = card ? nameCardView(card, friend ? [friend] : []) : null;
|
|
4332
4573
|
const [st, setSt] = React.useState({ loading: true });
|
|
4574
|
+
const ensV = useEnsVerdict(userid, st.prof && st.prof.ens);
|
|
4333
4575
|
const [addState, setAddState] = React.useState(null);
|
|
4334
4576
|
const [recOpen, setRecOpen] = React.useState(false);
|
|
4335
4577
|
const [recPeers, setRecPeers] = React.useState(null);
|
|
@@ -4379,7 +4621,7 @@ ${peer.address}`
|
|
|
4379
4621
|
const links = prof ? Object.entries(prof.links || {}) : [];
|
|
4380
4622
|
const lbl = { width: 110, flexShrink: 0, fontFamily: "var(--mono)", fontSize: 11, fontWeight: 600, color: "var(--faint)", textTransform: "uppercase", letterSpacing: 0.5 };
|
|
4381
4623
|
const rowS = { display: "flex", alignItems: "center", gap: 10, padding: "10px 0", borderTop: "1px solid var(--line)" };
|
|
4382
|
-
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
|
|
4383
4625
|
// an overflowing pill lands under the first pill, never under the label.
|
|
4384
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(
|
|
4385
4627
|
"a",
|
|
@@ -4428,7 +4670,7 @@ ${peer.address}`
|
|
|
4428
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" }
|
|
4429
4671
|
},
|
|
4430
4672
|
/* @__PURE__ */ React.createElement(DkAvatar, { peer: p, size: 26, radius: 7, dot: false }),
|
|
4431
|
-
/* @__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
|
|
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 })),
|
|
4432
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")
|
|
4433
4675
|
))))));
|
|
4434
4676
|
}
|
|
@@ -6778,7 +7020,7 @@ ${peer.address}`
|
|
|
6778
7020
|
if (!peers.length)
|
|
6779
7021
|
return null;
|
|
6780
7022
|
if (phone) {
|
|
6781
|
-
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(
|
|
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 }))));
|
|
6782
7024
|
}
|
|
6783
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: {
|
|
6784
7026
|
display: "grid",
|
|
@@ -6787,7 +7029,7 @@ ${peer.address}`
|
|
|
6787
7029
|
alignItems: "center",
|
|
6788
7030
|
padding: "11px 16px",
|
|
6789
7031
|
borderBottom: i < peers.length - 1 ? "1px solid var(--line)" : "none"
|
|
6790
|
-
} }, /* @__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(
|
|
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 })))));
|
|
6791
7033
|
}
|
|
6792
7034
|
function ReconnectBtn({ T, ip, onReconnect, label, icon = "refresh" }) {
|
|
6793
7035
|
const [busy, setBusy] = React.useState(false);
|
|
@@ -7468,6 +7710,10 @@ ${peer.address}`
|
|
|
7468
7710
|
joinGroup: "Join group",
|
|
7469
7711
|
cardIsFriend: "Already in your chats.",
|
|
7470
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.",
|
|
7471
7717
|
voiceMessage: "Voice message",
|
|
7472
7718
|
groupFileNotDelivered: "Not delivered to this device: the group sends agents only a description of files.",
|
|
7473
7719
|
shareFailed: "Screen share failed",
|
|
@@ -7698,6 +7944,10 @@ ${peer.address}`
|
|
|
7698
7944
|
joinGroup: "\u52A0\u5165\u7FA4",
|
|
7699
7945
|
cardIsFriend: "\u5DF2\u5728\u4F60\u7684\u4F1A\u8BDD\u91CC\u3002",
|
|
7700
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",
|
|
7701
7951
|
voiceMessage: "\u8BED\u97F3\u6D88\u606F",
|
|
7702
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",
|
|
7703
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.
|
|
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.
|
|
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",
|