@decentnetwork/beagle 0.1.144 → 0.1.146
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 +207 -121
- 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.146";
|
|
2
2
|
"use strict";
|
|
3
3
|
(() => {
|
|
4
4
|
// packages/beagle-ui/dist/beagle-ui.js
|
|
@@ -389,6 +389,201 @@ window.__DK_UI_VERSION="0.1.144";
|
|
|
389
389
|
const icon = file.media === "image" ? "\u{1F5BC} " : file.media === "video" ? "\u{1F3AC} " : "\u{1F4CE} ";
|
|
390
390
|
return icon + file.name;
|
|
391
391
|
}
|
|
392
|
+
var NATIVE_MEDIA_MIME = {
|
|
393
|
+
".jpg": "image/jpeg",
|
|
394
|
+
".jpeg": "image/jpeg",
|
|
395
|
+
".png": "image/png",
|
|
396
|
+
".gif": "image/gif",
|
|
397
|
+
".webp": "image/webp",
|
|
398
|
+
".heic": "image/heic",
|
|
399
|
+
".heif": "image/heif",
|
|
400
|
+
".bmp": "image/bmp",
|
|
401
|
+
".m4a": "audio/mp4",
|
|
402
|
+
".aac": "audio/aac",
|
|
403
|
+
".mp3": "audio/mpeg",
|
|
404
|
+
".wav": "audio/wav",
|
|
405
|
+
".caf": "audio/x-caf",
|
|
406
|
+
".amr": "audio/amr",
|
|
407
|
+
".ogg": "audio/ogg",
|
|
408
|
+
".opus": "audio/ogg",
|
|
409
|
+
".mp4": "video/mp4",
|
|
410
|
+
".mov": "video/quicktime",
|
|
411
|
+
".m4v": "video/x-m4v",
|
|
412
|
+
".3gp": "video/3gpp",
|
|
413
|
+
".webm": "video/webm"
|
|
414
|
+
};
|
|
415
|
+
var GROUP_TS_RE = /\n?\[(20\d{2}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{2}:\d{2})\]\s*$/;
|
|
416
|
+
function stripGroupTs(text) {
|
|
417
|
+
const m = GROUP_TS_RE.exec(text);
|
|
418
|
+
return m ? { body: text.slice(0, m.index), ts: m[1] } : { body: text, ts: null };
|
|
419
|
+
}
|
|
420
|
+
function splitGroupSender(text) {
|
|
421
|
+
const m = /^([^:\n]{1,48}):\s([\s\S]+)$/.exec(text);
|
|
422
|
+
return m ? { sender: m[1], body: m[2] } : null;
|
|
423
|
+
}
|
|
424
|
+
function nativeMediaKind(type, ext) {
|
|
425
|
+
const t = String(type || "").toLowerCase();
|
|
426
|
+
if (t === "image" || t === "photo" || t === "picture")
|
|
427
|
+
return "image";
|
|
428
|
+
if (t === "audio" || t === "voice")
|
|
429
|
+
return "audio";
|
|
430
|
+
if (t === "video")
|
|
431
|
+
return "video";
|
|
432
|
+
const mime = NATIVE_MEDIA_MIME[String(ext || "").toLowerCase()];
|
|
433
|
+
return mime ? mime.split("/")[0] : null;
|
|
434
|
+
}
|
|
435
|
+
function unwrapCGP1(text) {
|
|
436
|
+
if (!text.startsWith("CGP1 "))
|
|
437
|
+
return null;
|
|
438
|
+
let j = null;
|
|
439
|
+
try {
|
|
440
|
+
j = JSON.parse(text.slice(5));
|
|
441
|
+
} catch (e) {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
if (!j || typeof j !== "object" || !j.message || typeof j.message.text !== "string")
|
|
445
|
+
return null;
|
|
446
|
+
const origin = j.origin || {};
|
|
447
|
+
const senderId = origin.userid || origin.friendid || null;
|
|
448
|
+
const sender = origin.nickname || origin.user_info && origin.user_info.name || (senderId ? senderId.slice(0, 10) : null);
|
|
449
|
+
return { text: j.message.text, sender, senderId };
|
|
450
|
+
}
|
|
451
|
+
var MEDIA_SHAPE_RE = /^\{[\s\S]*"(?:fileExtension|fileName)"\s*:[\s\S]*"data"\s*:\s*"|^\{[\s\S]*"data"\s*:\s*"[A-Za-z0-9+/\\]{64}/;
|
|
452
|
+
function nativeMediaFromText(input) {
|
|
453
|
+
let text = String(input == null ? "" : input).trim();
|
|
454
|
+
let sender = null;
|
|
455
|
+
let senderId = null;
|
|
456
|
+
const cgp = unwrapCGP1(text);
|
|
457
|
+
if (cgp) {
|
|
458
|
+
text = cgp.text;
|
|
459
|
+
sender = cgp.sender;
|
|
460
|
+
senderId = cgp.senderId;
|
|
461
|
+
}
|
|
462
|
+
let body = stripGroupTs(text).body.trim();
|
|
463
|
+
if (body.length < 32)
|
|
464
|
+
return null;
|
|
465
|
+
if (!body.startsWith("{")) {
|
|
466
|
+
const split = splitGroupSender(body);
|
|
467
|
+
if (!split || !split.body.trim().startsWith("{"))
|
|
468
|
+
return null;
|
|
469
|
+
sender = sender || split.sender;
|
|
470
|
+
body = split.body.trim();
|
|
471
|
+
}
|
|
472
|
+
if (!MEDIA_SHAPE_RE.test(body))
|
|
473
|
+
return null;
|
|
474
|
+
const extMatch = /"fileExtension"\s*:\s*"([^"]{0,16})"/.exec(body);
|
|
475
|
+
const nameMatch = /"fileName"\s*:\s*"([^"]{0,200})"/.exec(body);
|
|
476
|
+
const typeMatch = /"type"\s*:\s*"([^"]{0,32})"/.exec(body);
|
|
477
|
+
let j = null;
|
|
478
|
+
try {
|
|
479
|
+
j = body.endsWith("}") ? JSON.parse(body) : null;
|
|
480
|
+
} catch (e) {
|
|
481
|
+
j = null;
|
|
482
|
+
}
|
|
483
|
+
if (!j || typeof j !== "object" || typeof j.data !== "string" || j.data.length < 16) {
|
|
484
|
+
if (!extMatch && !nameMatch)
|
|
485
|
+
return null;
|
|
486
|
+
const ext2 = extMatch ? extMatch[1].toLowerCase() : "";
|
|
487
|
+
const kind2 = nativeMediaKind(typeMatch && typeMatch[1], ext2) || "file";
|
|
488
|
+
return { sender, senderId, kind: kind2, name: (nameMatch ? nameMatch[1] : "file") + ext2, broken: true };
|
|
489
|
+
}
|
|
490
|
+
const ext = String(j.fileExtension || "").toLowerCase();
|
|
491
|
+
const named = typeof j.fileName === "string" || typeof j.fileExtension === "string";
|
|
492
|
+
const typed = nativeMediaKind(j.type, "");
|
|
493
|
+
if (!named && !typed)
|
|
494
|
+
return null;
|
|
495
|
+
const kind = nativeMediaKind(j.type, ext) || "file";
|
|
496
|
+
const mime = NATIVE_MEDIA_MIME[ext] || (kind === "file" ? "application/octet-stream" : kind + "/*");
|
|
497
|
+
const name = String(j.fileName || "file") + ext;
|
|
498
|
+
return { sender, senderId, kind, name, url: "data:" + mime + ";base64," + j.data.replace(/\s+/g, "") };
|
|
499
|
+
}
|
|
500
|
+
function nativeMediaLabel(media) {
|
|
501
|
+
if (!media)
|
|
502
|
+
return "";
|
|
503
|
+
const word = media.kind === "image" ? "image" : media.kind === "audio" ? "voice" : media.kind === "video" ? "video" : "file";
|
|
504
|
+
return "[" + word + "] " + media.name;
|
|
505
|
+
}
|
|
506
|
+
var SENT_TIME_MIN_EARLY_MS = 2 * 6e4;
|
|
507
|
+
var MARKER_MAX_EARLY_MS = 6 * 36e5;
|
|
508
|
+
function parseMarkerUtc(s) {
|
|
509
|
+
const m = /^(\d{4})-(\d{1,2})-(\d{1,2})\s+(\d{1,2}):(\d{2}):(\d{2})$/.exec(String(s || "").trim());
|
|
510
|
+
if (!m)
|
|
511
|
+
return null;
|
|
512
|
+
const ms = Date.UTC(+m[1], +m[2] - 1, +m[3], +m[4], +m[5], +m[6]);
|
|
513
|
+
return Number.isFinite(ms) ? ms : null;
|
|
514
|
+
}
|
|
515
|
+
function epochMs(x) {
|
|
516
|
+
const n = typeof x === "string" && /^\d+$/.test(x) ? Number(x) : x;
|
|
517
|
+
if (typeof n !== "number" || !Number.isFinite(n) || n <= 0)
|
|
518
|
+
return null;
|
|
519
|
+
if (n > 1e14)
|
|
520
|
+
return Math.floor(n / 1e3);
|
|
521
|
+
if (n > 1e11)
|
|
522
|
+
return Math.floor(n);
|
|
523
|
+
return Math.floor(n * 1e3);
|
|
524
|
+
}
|
|
525
|
+
function pickSentTime(arrivalMs, sentMs, maxEarlyMs = Infinity) {
|
|
526
|
+
if (!arrivalMs || sentMs == null)
|
|
527
|
+
return arrivalMs;
|
|
528
|
+
const early = arrivalMs - sentMs;
|
|
529
|
+
if (early < SENT_TIME_MIN_EARLY_MS)
|
|
530
|
+
return arrivalMs;
|
|
531
|
+
if (early > maxEarlyMs)
|
|
532
|
+
return arrivalMs;
|
|
533
|
+
return sentMs;
|
|
534
|
+
}
|
|
535
|
+
function groupSentTime(row) {
|
|
536
|
+
var _a, _b, _c, _d;
|
|
537
|
+
const arrival = row && row.ts;
|
|
538
|
+
if (!row || row.dir === "out" || !arrival)
|
|
539
|
+
return { ts: arrival, key: null };
|
|
540
|
+
const text = typeof row.text === "string" ? row.text : "";
|
|
541
|
+
if (text.startsWith("CGP1 ")) {
|
|
542
|
+
let j = null;
|
|
543
|
+
try {
|
|
544
|
+
j = JSON.parse(text.slice(5));
|
|
545
|
+
} catch (e) {
|
|
546
|
+
j = null;
|
|
547
|
+
}
|
|
548
|
+
const msg = j && j.message;
|
|
549
|
+
if (msg && typeof msg === "object") {
|
|
550
|
+
const raw = (_b = (_a = msg.file && msg.file.sent_at_ms) != null ? _a : msg.sent_at_ms) != null ? _b : msg.timestamp;
|
|
551
|
+
const sent2 = epochMs(raw);
|
|
552
|
+
const origin = j.origin && (j.origin.userid || j.origin.friendid || j.origin.nickname) || "";
|
|
553
|
+
const body = typeof msg.text === "string" ? msg.text : msg.file ? JSON.stringify(msg.file) : "";
|
|
554
|
+
return { ts: pickSentTime(arrival, sent2), key: sent2 != null ? `cgp1|${origin}|${raw}|${body}` : null };
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (row.file) {
|
|
558
|
+
const raw = (_d = (_c = row.sent_at_ms) != null ? _c : row.file.sent_at_ms) != null ? _d : row.origin && row.origin.sent_at_ms;
|
|
559
|
+
const sent2 = epochMs(raw);
|
|
560
|
+
if (sent2 != null) {
|
|
561
|
+
const who = row.origin && (row.origin.userid || row.origin.nickname) || "";
|
|
562
|
+
return { ts: pickSentTime(arrival, sent2), key: `file|${who}|${raw}|${row.file.name}|${row.file.size}` };
|
|
563
|
+
}
|
|
564
|
+
return { ts: arrival, key: null };
|
|
565
|
+
}
|
|
566
|
+
const marker = stripGroupTs(text).ts;
|
|
567
|
+
const sent = marker ? parseMarkerUtc(marker) : null;
|
|
568
|
+
if (sent == null)
|
|
569
|
+
return { ts: arrival, key: null };
|
|
570
|
+
return { ts: pickSentTime(arrival, sent, MARKER_MAX_EARLY_MS), key: `relay|${text}` };
|
|
571
|
+
}
|
|
572
|
+
function datedThread(rows) {
|
|
573
|
+
const seen = /* @__PURE__ */ new Set();
|
|
574
|
+
const out = [];
|
|
575
|
+
const ordered = [...rows || []].sort((a, b) => (a.ts || 0) - (b.ts || 0));
|
|
576
|
+
for (const r of ordered) {
|
|
577
|
+
const { ts, key } = groupSentTime(r);
|
|
578
|
+
if (key) {
|
|
579
|
+
if (seen.has(key))
|
|
580
|
+
continue;
|
|
581
|
+
seen.add(key);
|
|
582
|
+
}
|
|
583
|
+
out.push(ts === r.ts ? r : Object.assign({}, r, { ts, arrivedTs: r.ts }));
|
|
584
|
+
}
|
|
585
|
+
return out.map((r, i) => ({ r, i })).sort((a, b) => (a.r.ts || 0) - (b.r.ts || 0) || a.i - b.i).map((x) => x.r);
|
|
586
|
+
}
|
|
392
587
|
function dkHash(s) {
|
|
393
588
|
let h = 2166136261;
|
|
394
589
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -749,7 +944,7 @@ window.__DK_UI_VERSION="0.1.144";
|
|
|
749
944
|
const c = cache.current[peerId];
|
|
750
945
|
if (!c)
|
|
751
946
|
return;
|
|
752
|
-
const arr = [...c.byId.values()]
|
|
947
|
+
const arr = datedThread([...c.byId.values()]);
|
|
753
948
|
const withDay = [];
|
|
754
949
|
let lastDay = null;
|
|
755
950
|
for (const m of arr) {
|
|
@@ -2255,6 +2450,11 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2255
2450
|
}, [userid]);
|
|
2256
2451
|
return rec;
|
|
2257
2452
|
}
|
|
2453
|
+
function verifiedLabel(userid, name) {
|
|
2454
|
+
if (!name)
|
|
2455
|
+
return name;
|
|
2456
|
+
return ensVerdict(name, verifier.peek(userid)).label || name;
|
|
2457
|
+
}
|
|
2258
2458
|
function useEnsVerdict(userid, name) {
|
|
2259
2459
|
return ensVerdict(name, useEnsRecord(userid));
|
|
2260
2460
|
}
|
|
@@ -2283,120 +2483,6 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
|
|
|
2283
2483
|
const v = useEnsVerdict(userid, name);
|
|
2284
2484
|
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
2485
|
}
|
|
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
|
-
}
|
|
2400
2486
|
var DK_CMD_HIST_KEY = "beagle.assistant.history";
|
|
2401
2487
|
var DK_CMD_HIST_MAX = 50;
|
|
2402
2488
|
function RequestsBlock({ T, requests, onAct }) {
|
|
@@ -4193,7 +4279,7 @@ ${peer.address}`
|
|
|
4193
4279
|
e.preventDefault();
|
|
4194
4280
|
}
|
|
4195
4281
|
},
|
|
4196
|
-
placeholder: phone ? `${T.message}\u2026` : `${T.message} ${peer.alias || shortKey(peer.userId, 6, 4)}\u2026`,
|
|
4282
|
+
placeholder: phone ? `${T.message}\u2026` : `${T.message} ${verifiedLabel(peer.app ? null : peer.userId, peer.alias) || shortKey(peer.userId, 6, 4)}\u2026`,
|
|
4197
4283
|
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
4284
|
}
|
|
4199
4285
|
), /* @__PURE__ */ React.createElement(Btn, { tone: "solid", icon: "arrowUp", title: T.send, onClick: sendDraft }))),
|
|
@@ -4244,7 +4330,7 @@ ${peer.address}`
|
|
|
4244
4330
|
style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain", borderRadius: 6 }
|
|
4245
4331
|
}
|
|
4246
4332
|
))),
|
|
4247
|
-
pubProfile && /* @__PURE__ */ React.createElement(DkPublicProfile, { T, userid: peer.userId, fallbackName: peer.alias, isFriend: true, onClose: () => setPubProfile(false) }),
|
|
4333
|
+
pubProfile && /* @__PURE__ */ React.createElement(DkPublicProfile, { T, userid: peer.userId, fallbackName: verifiedLabel(peer.userId, peer.alias), isFriend: true, onClose: () => setPubProfile(false) }),
|
|
4248
4334
|
nameCardProf && (() => {
|
|
4249
4335
|
const cardFriend2 = cardFriend(nameCardProf, peers);
|
|
4250
4336
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -6386,7 +6472,7 @@ ${peer.address}`
|
|
|
6386
6472
|
if (!inc)
|
|
6387
6473
|
return null;
|
|
6388
6474
|
const peer = (peers || []).find((p) => p.id === inc.peerId) || { id: inc.peerId };
|
|
6389
|
-
const name = peer.alias || peer.name || shortKey(inc.peerId, 10, 6);
|
|
6475
|
+
const name = verifiedLabel(inc.peerId, peer.alias) || peer.name || shortKey(inc.peerId, 10, 6);
|
|
6390
6476
|
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
6477
|
}
|
|
6392
6478
|
function CallBtn({ icon, label, onClick, active, danger, wide }) {
|
|
@@ -6426,7 +6512,7 @@ ${peer.address}`
|
|
|
6426
6512
|
if (!call)
|
|
6427
6513
|
return null;
|
|
6428
6514
|
const peer = (peers || []).find((p) => p.id === call.peerId) || { id: call.peerId };
|
|
6429
|
-
const name = peer.alias || peer.name || shortKey(call.peerId, 10, 6);
|
|
6515
|
+
const name = verifiedLabel(call.peerId, peer.alias) || peer.name || shortKey(call.peerId, 10, 6);
|
|
6430
6516
|
const streamHasVideo = (s) => !!(s && s.getVideoTracks && s.getVideoTracks().length > 0);
|
|
6431
6517
|
const video = call.video || ctl.sharing || streamHasVideo(ctl.remoteStream) || streamHasVideo(ctl.localStream);
|
|
6432
6518
|
const mm = String(Math.floor(secs / 60)).padStart(2, "0");
|
|
@@ -7002,7 +7088,7 @@ ${peer.address}`
|
|
|
7002
7088
|
const downloadLabel = T && T.downloadFile || "Download";
|
|
7003
7089
|
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
7090
|
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);
|
|
7091
|
+
const who = verifiedLabel(peer.userId || it.peerId, peer.alias) || peer.name || shortKey(it.peerId, 8, 5);
|
|
7006
7092
|
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
7093
|
}));
|
|
7008
7094
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/beagle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.146",
|
|
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.48",
|
|
30
30
|
"@decentnetwork/chat-components": "^0.1.3",
|
|
31
31
|
"@decentnetwork/lan": "^0.1.316",
|
|
32
32
|
"@decentnetwork/peer": "^0.1.178",
|