@decentnetwork/beagle 0.1.94 → 0.1.96
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 +58 -19
- package/package.json +1 -1
package/dist/desktop/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.__DK_UI_VERSION="0.1.
|
|
1
|
+
window.__DK_UI_VERSION="0.1.96";
|
|
2
2
|
"use strict";
|
|
3
3
|
(() => {
|
|
4
4
|
// packages/beagle-ui/dist/beagle-ui.js
|
|
@@ -110,6 +110,7 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
110
110
|
unlink: '<path d="M9 15 5.5 18.5a3.5 3.5 0 0 1-5-5L4 10"/><path d="m15 9 3.5-3.5a3.5 3.5 0 0 1 5 5L20 14"/><path d="M8 8 4 4M16 16l4 4M3 11h2M11 3v2"/>',
|
|
111
111
|
zap: '<path d="M13 2 4 13h7l-1 9 9-11h-7l1-9Z"/>',
|
|
112
112
|
clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3.5 2"/>',
|
|
113
|
+
bellOff: '<path d="M8.7 3.4A6 6 0 0 1 18 8.5c0 3 .5 5 1.1 6.3M6.1 6.1A6 6 0 0 0 6 8.5c0 6.5-2.5 8-2.5 8H16"/><path d="M13.7 20.5a2 2 0 0 1-3.4 0"/><path d="m3 3 18 18"/>',
|
|
113
114
|
plug: '<path d="M9 2v6M15 2v6"/><path d="M7 8h10v3a5 5 0 0 1-10 0V8Z"/><path d="M12 16v6"/>'
|
|
114
115
|
});
|
|
115
116
|
var H = {};
|
|
@@ -493,7 +494,7 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
493
494
|
paddingLeft: 8
|
|
494
495
|
} }, r.descr), failed[r.id] && /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--ui)", fontSize: 11, color: "var(--danger)" } }, failed[r.id]), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: 6 } }, /* @__PURE__ */ React.createElement(Btn, { tone: "ok", icon: "check", size: "sm", onClick: () => act(r, "accept"), style: { flex: 1 } }, T.accept), /* @__PURE__ */ React.createElement(Btn, { tone: "danger", icon: "x", size: "sm", onClick: () => act(r, "reject"), style: { flex: 1 } }, T.reject))))));
|
|
495
496
|
}
|
|
496
|
-
function PeerRow({ peer, T, active, onClick }) {
|
|
497
|
+
function PeerRow({ peer, T, active, onClick, muted }) {
|
|
497
498
|
const name = peer.alias || peer.userId;
|
|
498
499
|
return /* @__PURE__ */ React.createElement("button", { onClick, style: {
|
|
499
500
|
display: "flex",
|
|
@@ -515,7 +516,7 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
515
516
|
whiteSpace: "nowrap",
|
|
516
517
|
overflow: "hidden",
|
|
517
518
|
textOverflow: "ellipsis"
|
|
518
|
-
} }, peer.alias || shortKey(peer.userId, 8, 5)), peer.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 13, color: "var(--faint)", stroke: 2 }), 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 } }, /* @__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"), /* @__PURE__ */ React.createElement("span", { style: {
|
|
519
|
+
} }, peer.alias || shortKey(peer.userId, 8, 5)), peer.agent && /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 13, color: "var(--faint)", stroke: 2 }), 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 } }, /* @__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"), /* @__PURE__ */ React.createElement("span", { style: {
|
|
519
520
|
fontSize: 11,
|
|
520
521
|
color: "var(--dim)",
|
|
521
522
|
whiteSpace: "nowrap",
|
|
@@ -528,7 +529,7 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
528
529
|
function dkActivityTs(p) {
|
|
529
530
|
return Math.max(p.lastTs || 0, p.acceptedAt || 0, p.requestedAt || 0);
|
|
530
531
|
}
|
|
531
|
-
function PeerSidebar({ T, peers, requests, activeId, onSelect, onAct, onAdd, prefillAddr, onPrefillConsumed }) {
|
|
532
|
+
function PeerSidebar({ T, peers, requests, activeId, onSelect, onAct, onAdd, prefillAddr, onPrefillConsumed, muted }) {
|
|
532
533
|
const [q, setQ] = React.useState("");
|
|
533
534
|
const [addr, setAddr] = React.useState("");
|
|
534
535
|
const [addState, setAddState] = React.useState(null);
|
|
@@ -539,6 +540,10 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
539
540
|
setFromDeepLink(true);
|
|
540
541
|
}
|
|
541
542
|
}, [prefillAddr]);
|
|
543
|
+
const dismissDeepLink = () => {
|
|
544
|
+
setFromDeepLink(false);
|
|
545
|
+
onPrefillConsumed && onPrefillConsumed();
|
|
546
|
+
};
|
|
542
547
|
const submitAddr = () => {
|
|
543
548
|
const v = addr.trim();
|
|
544
549
|
if (!v || addState && addState.kind === "sending")
|
|
@@ -551,9 +556,11 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
551
556
|
onPrefillConsumed && onPrefillConsumed();
|
|
552
557
|
setAddState({ kind: "ok", msg: T.addSent });
|
|
553
558
|
} else {
|
|
559
|
+
dismissDeepLink();
|
|
554
560
|
setAddState({ kind: "err", msg: r && r.error ? `${T.addFailed}: ${r.error}` : T.addFailed });
|
|
555
561
|
}
|
|
556
562
|
}).catch((e) => {
|
|
563
|
+
dismissDeepLink();
|
|
557
564
|
setAddState({ kind: "err", msg: `${T.addFailed}: ${e && e.message || e}` });
|
|
558
565
|
}).finally(() => {
|
|
559
566
|
setTimeout(() => setAddState((s) => s && s.kind !== "sending" ? null : s), 6e3);
|
|
@@ -579,8 +586,11 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
579
586
|
background: "color-mix(in oklab, var(--accent), transparent 88%)",
|
|
580
587
|
border: "1px solid var(--accent)",
|
|
581
588
|
borderRadius: 8,
|
|
582
|
-
padding: "7px 10px"
|
|
583
|
-
|
|
589
|
+
padding: "7px 10px",
|
|
590
|
+
display: "flex",
|
|
591
|
+
alignItems: "flex-start",
|
|
592
|
+
gap: 8
|
|
593
|
+
} }, /* @__PURE__ */ React.createElement("span", { style: { flex: 1 } }, T.deepLinkConfirm || "\u901A\u8FC7\u94FE\u63A5\u6DFB\u52A0\u8FD9\u4F4D\u597D\u53CB? \u70B9\u300C\u6DFB\u52A0\u300D\u53D1\u9001\u597D\u53CB\u8BF7\u6C42 / Add this contact from the link? Tap Add to send a friend request."), /* @__PURE__ */ React.createElement(Btn, { size: "sm", icon: "x", title: T.cancel || "Dismiss", onClick: dismissDeepLink, style: { flexShrink: 0 } })), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: 7 } }, /* @__PURE__ */ React.createElement(
|
|
584
594
|
"input",
|
|
585
595
|
{
|
|
586
596
|
value: addr,
|
|
@@ -601,7 +611,7 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
601
611
|
fontSize: 11.5,
|
|
602
612
|
lineHeight: 1.35,
|
|
603
613
|
color: addState.kind === "err" ? "var(--bad, #e5484d)" : addState.kind === "ok" ? "var(--good, #46a758)" : "var(--faint)"
|
|
604
|
-
} }, addState.msg), /* @__PURE__ */ React.createElement("div", { style: { position: "relative", display: "flex", alignItems: "center" } }, /* @__PURE__ */ React.createElement(Icon, { name: "search", size: 15, color: "var(--faint)", stroke: 2, style: { position: "absolute", left: 9 } }), /* @__PURE__ */ React.createElement("input", { value: q, onChange: (e) => setQ(e.target.value), placeholder: T.search, style: { ...inputStyle, paddingLeft: 30 } }))), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, overflow: "auto", padding: "10px 8px 16px" } }, /* @__PURE__ */ React.createElement(RequestsBlock, { T, requests, onAct }), /* @__PURE__ */ React.createElement(Section, { label: T.peers, count: `${online}/${peers.length}`, style: { margin: "6px 4px 8px" } }), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 2 } }, filtered.map((p) => /* @__PURE__ */ React.createElement(PeerRow, { key: p.id, peer: p, T, active: p.id === activeId, onClick: () => onSelect(p.id) })), !filtered.length && /* @__PURE__ */ React.createElement("div", { style: { padding: 16, textAlign: "center", fontFamily: "var(--mono)", fontSize: 12, color: "var(--faint)" } }, "no matches"))));
|
|
614
|
+
} }, addState.msg), /* @__PURE__ */ React.createElement("div", { style: { position: "relative", display: "flex", alignItems: "center" } }, /* @__PURE__ */ React.createElement(Icon, { name: "search", size: 15, color: "var(--faint)", stroke: 2, style: { position: "absolute", left: 9 } }), /* @__PURE__ */ React.createElement("input", { value: q, onChange: (e) => setQ(e.target.value), placeholder: T.search, style: { ...inputStyle, paddingLeft: 30 } }))), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, overflow: "auto", padding: "10px 8px 16px" } }, /* @__PURE__ */ React.createElement(RequestsBlock, { T, requests, onAct }), /* @__PURE__ */ React.createElement(Section, { label: T.peers, count: `${online}/${peers.length}`, style: { margin: "6px 4px 8px" } }), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 2 } }, filtered.map((p) => /* @__PURE__ */ React.createElement(PeerRow, { key: p.id, peer: p, T, active: p.id === activeId, onClick: () => onSelect(p.id), muted: !!muted && muted.includes(p.id) })), !filtered.length && /* @__PURE__ */ React.createElement("div", { style: { padding: 16, textAlign: "center", fontFamily: "var(--mono)", fontSize: 12, color: "var(--faint)" } }, "no matches"))));
|
|
605
615
|
}
|
|
606
616
|
var inputStyle = {
|
|
607
617
|
flex: 1,
|
|
@@ -1586,7 +1596,7 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
1586
1596
|
) : mine && m.status === "sent" && m.confirmed === false ? /* @__PURE__ */ React.createElement(Icon, { name: "check", size: 12, stroke: 2.2, color: "var(--faint)", title: T.sentUnconfirmed || "sent \u2014 not confirmed by the peer" }) : mine && m.status && /* @__PURE__ */ React.createElement(Icon, { name: "checkCheck", size: 12, stroke: 2.2, color: m.status === "read" ? "var(--accent)" : "var(--faint)" })))
|
|
1587
1597
|
);
|
|
1588
1598
|
}
|
|
1589
|
-
function Conversation({ T, peer, lang, peers, onOpenChat, thread: threadProp, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread }) {
|
|
1599
|
+
function Conversation({ T, peer, lang, peers, onOpenChat, thread: threadProp, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread, muted, onToggleMute }) {
|
|
1590
1600
|
const scrollRef = React.useRef(null);
|
|
1591
1601
|
const isGroup = React.useMemo(() => dkThreadIsGroup(threadProp), [threadProp]);
|
|
1592
1602
|
const followScrollRef = React.useRef(true);
|
|
@@ -1870,7 +1880,14 @@ window.__DK_UI_VERSION="0.1.94";
|
|
|
1870
1880
|
${peer.address}`
|
|
1871
1881
|
},
|
|
1872
1882
|
shortKey(peer.address, 8, 6)
|
|
1873
|
-
)))), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }),
|
|
1883
|
+
)))), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }), onToggleMute && /* @__PURE__ */ React.createElement(
|
|
1884
|
+
Btn,
|
|
1885
|
+
{
|
|
1886
|
+
icon: muted ? "bellOff" : "bell",
|
|
1887
|
+
title: muted ? T && T.unmuteSound || "Turn sound back on for this chat" : T && T.muteSound || "Mute sound for this chat",
|
|
1888
|
+
onClick: () => onToggleMute(peer.id)
|
|
1889
|
+
}
|
|
1890
|
+
), onCall && /* @__PURE__ */ React.createElement(Btn, { icon: "phone", title: T && T.audioCall || "Audio call", onClick: () => onCall(peer.userId, false) }), onCall && /* @__PURE__ */ React.createElement(Btn, { icon: "video", title: T && T.videoCall || "Video call", onClick: () => onCall(peer.userId, true) }), onSendRtcFile && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1874
1891
|
"input",
|
|
1875
1892
|
{
|
|
1876
1893
|
ref: rtcFileRef,
|
|
@@ -2062,9 +2079,9 @@ ${peer.address}`
|
|
|
2062
2079
|
function ChatEmpty({ T }) {
|
|
2063
2080
|
return /* @__PURE__ */ React.createElement("div", { style: { flex: 1, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 12, color: "var(--faint)", background: "var(--bg)" } }, /* @__PURE__ */ React.createElement(Icon, { name: "message", size: 40, stroke: 1.4, color: "var(--line)" }), /* @__PURE__ */ React.createElement("div", { style: { fontFamily: "var(--mono)", fontSize: 13 } }, T.pickPeer));
|
|
2064
2081
|
}
|
|
2065
|
-
function ChatTab({ T, lang, peers, requests, activeId, thread, onSelect, onAct, onAdd, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread, prefillAddr, onPrefillConsumed }) {
|
|
2082
|
+
function ChatTab({ T, lang, peers, requests, activeId, thread, onSelect, onAct, onAdd, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread, prefillAddr, onPrefillConsumed, muted, onToggleMute }) {
|
|
2066
2083
|
const peer = peers.find((p) => p.id === activeId);
|
|
2067
|
-
return /* @__PURE__ */ React.createElement("div", { style: { flex: 1, display: "flex", minWidth: 0, minHeight: 0 } }, /* @__PURE__ */ React.createElement(PeerSidebar, { T, peers, requests, activeId, onSelect, onAct, onAdd, prefillAddr, onPrefillConsumed }), peer ? /* @__PURE__ */ React.createElement(Conversation, { T, peer, lang, peers, onOpenChat: onSelect, thread, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread }) : /* @__PURE__ */ React.createElement(ChatEmpty, { T }));
|
|
2084
|
+
return /* @__PURE__ */ React.createElement("div", { style: { flex: 1, display: "flex", minWidth: 0, minHeight: 0 } }, /* @__PURE__ */ React.createElement(PeerSidebar, { T, peers, requests, activeId, onSelect, onAct, onAdd, prefillAddr, onPrefillConsumed, muted }), peer ? /* @__PURE__ */ React.createElement(Conversation, { T, peer, lang, peers, onOpenChat: onSelect, thread, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread, muted: !!muted && muted.includes(peer.id), onToggleMute }) : /* @__PURE__ */ React.createElement(ChatEmpty, { T }));
|
|
2068
2085
|
}
|
|
2069
2086
|
Object.assign(window, { ChatTab });
|
|
2070
2087
|
function CopyBtn({ value, copiedText = "Copied", copyFailedText = "Copy failed", copyTitle = "Copy" }) {
|
|
@@ -4438,8 +4455,10 @@ ${peer.address}`
|
|
|
4438
4455
|
function dkLooking() {
|
|
4439
4456
|
return document.visibilityState === "visible" && document.hasFocus();
|
|
4440
4457
|
}
|
|
4441
|
-
function useIncomingAlerts({ T, peers, requests, loaded, activeId, sound = true, flash = true }) {
|
|
4458
|
+
function useIncomingAlerts({ T, peers, requests, loaded, activeId, sound = true, flash = true, muted }) {
|
|
4442
4459
|
const prev = React.useRef(null);
|
|
4460
|
+
const mutedRef = React.useRef(/* @__PURE__ */ new Set());
|
|
4461
|
+
mutedRef.current = new Set(muted || []);
|
|
4443
4462
|
React.useEffect(() => dkUnlockAudioOnGesture(), []);
|
|
4444
4463
|
React.useEffect(() => {
|
|
4445
4464
|
if (!flash)
|
|
@@ -4473,7 +4492,7 @@ ${peer.address}`
|
|
|
4473
4492
|
prev.current = { byId, reqIds };
|
|
4474
4493
|
if (!was)
|
|
4475
4494
|
return;
|
|
4476
|
-
let msgs = 0, elsewhere = 0, reqs = 0;
|
|
4495
|
+
let msgs = 0, elsewhere = 0, reqs = 0, loud = 0, loudElsewhere = 0;
|
|
4477
4496
|
for (const [id, cur] of byId) {
|
|
4478
4497
|
if (cur.dir !== "in" || !cur.ts)
|
|
4479
4498
|
continue;
|
|
@@ -4483,6 +4502,11 @@ ${peer.address}`
|
|
|
4483
4502
|
msgs += 1;
|
|
4484
4503
|
if (id !== activeId)
|
|
4485
4504
|
elsewhere += 1;
|
|
4505
|
+
if (!mutedRef.current.has(id)) {
|
|
4506
|
+
loud += 1;
|
|
4507
|
+
if (id !== activeId)
|
|
4508
|
+
loudElsewhere += 1;
|
|
4509
|
+
}
|
|
4486
4510
|
}
|
|
4487
4511
|
for (const id of reqIds)
|
|
4488
4512
|
if (!was.reqIds.has(id))
|
|
@@ -4490,8 +4514,8 @@ ${peer.address}`
|
|
|
4490
4514
|
if (!msgs && !reqs)
|
|
4491
4515
|
return;
|
|
4492
4516
|
const looking = dkLooking();
|
|
4493
|
-
if (sound && !(looking && !reqs && !
|
|
4494
|
-
dkChime(reqs && !
|
|
4517
|
+
if (sound && (reqs || loud) && !(looking && !reqs && !loudElsewhere))
|
|
4518
|
+
dkChime(reqs && !loud ? "request" : "message");
|
|
4495
4519
|
if (flash && !looking) {
|
|
4496
4520
|
const label = msgs ? T && T.alertMsg || "New message" : T && T.alertReq || "New friend request";
|
|
4497
4521
|
dkFlashStart(label, msgs + reqs);
|
|
@@ -4628,6 +4652,9 @@ ${peer.address}`
|
|
|
4628
4652
|
profile: "Profile",
|
|
4629
4653
|
alertMsg: "New message",
|
|
4630
4654
|
alertReq: "New friend request",
|
|
4655
|
+
muteSound: "Mute sound for this chat",
|
|
4656
|
+
unmuteSound: "Turn sound back on for this chat",
|
|
4657
|
+
mutedTag: "sound muted",
|
|
4631
4658
|
recommended: "Discover",
|
|
4632
4659
|
registered: "Names",
|
|
4633
4660
|
here: "Here",
|
|
@@ -4810,6 +4837,9 @@ ${peer.address}`
|
|
|
4810
4837
|
profile: "\u6211\u7684",
|
|
4811
4838
|
alertMsg: "\u65B0\u6D88\u606F",
|
|
4812
4839
|
alertReq: "\u65B0\u7684\u597D\u53CB\u8BF7\u6C42",
|
|
4840
|
+
muteSound: "\u5173\u95ED\u6B64\u4F1A\u8BDD\u7684\u63D0\u793A\u97F3",
|
|
4841
|
+
unmuteSound: "\u6062\u590D\u6B64\u4F1A\u8BDD\u7684\u63D0\u793A\u97F3",
|
|
4842
|
+
mutedTag: "\u5DF2\u9759\u97F3",
|
|
4813
4843
|
recommended: "\u63A8\u8350",
|
|
4814
4844
|
registered: "\u540D\u5F55",
|
|
4815
4845
|
here: "\u5728\u573A",
|
|
@@ -5167,10 +5197,16 @@ ${peer.address}`
|
|
|
5167
5197
|
window.addEventListener("hashchange", onHash);
|
|
5168
5198
|
return () => window.removeEventListener("hashchange", onHash);
|
|
5169
5199
|
}, []);
|
|
5200
|
+
const jumpedFor = React.useRef("");
|
|
5170
5201
|
React.useEffect(() => {
|
|
5171
|
-
if (!pendingAddr)
|
|
5202
|
+
if (!pendingAddr) {
|
|
5203
|
+
jumpedFor.current = "";
|
|
5172
5204
|
return;
|
|
5173
|
-
|
|
5205
|
+
}
|
|
5206
|
+
if (jumpedFor.current !== pendingAddr) {
|
|
5207
|
+
jumpedFor.current = pendingAddr;
|
|
5208
|
+
setTab("chat");
|
|
5209
|
+
}
|
|
5174
5210
|
if (!peers || !peers.length)
|
|
5175
5211
|
return;
|
|
5176
5212
|
const hit = peers.find((p) => p.address && p.address === pendingAddr);
|
|
@@ -5202,6 +5238,8 @@ ${peer.address}`
|
|
|
5202
5238
|
const T = STR[t.lang] || STR.en;
|
|
5203
5239
|
const vars = dkTheme(t.theme, t.accent);
|
|
5204
5240
|
const rowPad = t.density === "comfortable" ? "11px 12px" : "7px 10px";
|
|
5241
|
+
const mutedIds = Array.isArray(t.alertMuted) ? t.alertMuted : [];
|
|
5242
|
+
const onToggleMute = (id) => setTweak("alertMuted", mutedIds.includes(id) ? mutedIds.filter((x) => x !== id) : mutedIds.concat(id));
|
|
5205
5243
|
useIncomingAlerts({
|
|
5206
5244
|
T,
|
|
5207
5245
|
peers,
|
|
@@ -5209,7 +5247,8 @@ ${peer.address}`
|
|
|
5209
5247
|
loaded: data.loaded,
|
|
5210
5248
|
activeId,
|
|
5211
5249
|
sound: t.alertSound !== false,
|
|
5212
|
-
flash: t.alertFlash !== false
|
|
5250
|
+
flash: t.alertFlash !== false,
|
|
5251
|
+
muted: mutedIds
|
|
5213
5252
|
});
|
|
5214
5253
|
const callCtl = useCallController(me.userId, (peerId, video, direction) => {
|
|
5215
5254
|
const text = `WebRTC ${video ? "video" : "audio"} call: ${direction}`;
|
|
@@ -5361,7 +5400,7 @@ ${peer.address}`
|
|
|
5361
5400
|
display: "flex",
|
|
5362
5401
|
border: "1px solid " + (tab === "profile" ? "var(--line)" : "transparent"),
|
|
5363
5402
|
background: tab === "profile" ? "var(--panel-2)" : "transparent"
|
|
5364
|
-
} }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: { ...me, id: me.userId, agent: false }, size: 36, radius: 9 }))), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column" } }, /* @__PURE__ */ React.createElement(DkBrowserNotice, { lang: t.lang }), /* @__PURE__ */ React.createElement("div", { style: { height: 46, flexShrink: 0, borderBottom: "1px solid var(--line)", background: "var(--panel)", display: "flex", alignItems: "center", gap: 12, padding: "0 16px" } }, /* @__PURE__ */ React.createElement("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "var(--accent)", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", style: { display: "block", flexShrink: 0 } }, /* @__PURE__ */ React.createElement("path", { d: "m4.5 17 6-6-6-6" }), /* @__PURE__ */ React.createElement("path", { d: "M12 18.5h7.5" })), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 14, fontWeight: 700, letterSpacing: -0.3, color: "var(--text)" } }, "beagle"), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 12, color: "var(--faint)" } }, "\xB7 ", (nav.find((n) => n.id === tab) || { label: T.profile }).label.toLowerCase()), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }), /* @__PURE__ */ React.createElement(Tag, { tone: "accent" }, me.channel, " \xB7 lan ", me.lanVer), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 7, padding: "0 4px" } }, /* @__PURE__ */ React.createElement(StatusDot, { online: me.online }), /* @__PURE__ */ React.createElement(Mono, { size: 12.5, copy: me.ip }, me.ip)), /* @__PURE__ */ React.createElement("span", { style: { width: 1, height: 22, background: "var(--line)" } }), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8 } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: { ...me, id: me.userId, agent: false }, size: 26, radius: 7 }), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 12.5, fontWeight: 600, color: "var(--text)" } }, me.name))), tab === "chat" && /* @__PURE__ */ React.createElement(ChatTab, { T, lang: t.lang, peers, requests, activeId, thread: data.threads[activeId], onSelect, onAct, onAdd, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread: () => activeId && data.loadThread(activeId), prefillAddr: pendingAddr, onPrefillConsumed: () => setPendingAddr("") }), tab === "here" && /* @__PURE__ */ React.createElement(DiscoverTab, { T, kind: "bridge", peers, meId: me.userId, onAdd, onOpenChat }), tab === "recommended" && /* @__PURE__ */ React.createElement(DiscoverTab, { T, kind: "recommended", peers, meId: me.userId, onAdd, onOpenChat }), tab === "registered" && /* @__PURE__ */ React.createElement(DiscoverTab, { T, kind: "registered", peers, meId: me.userId, onAdd, onOpenChat }), tab === "network" && /* @__PURE__ */ React.createElement(NetworkTab, { T, me, peers, exits, activeExit, reqCount: requests.length, onSetExit, onOpenChat, backend, onArmLan: armLan, onCancelLan: cancelLan }), tab === "apps" && /* @__PURE__ */ React.createElement(AppsTab, { T, t }), tab === "profile" && /* @__PURE__ */ React.createElement(ProfileTab, { T, me, onEdit, t, setTweak })), data.locked && /* @__PURE__ */ React.createElement(
|
|
5403
|
+
} }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: { ...me, id: me.userId, agent: false }, size: 36, radius: 9 }))), /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column" } }, /* @__PURE__ */ React.createElement(DkBrowserNotice, { lang: t.lang }), /* @__PURE__ */ React.createElement("div", { style: { height: 46, flexShrink: 0, borderBottom: "1px solid var(--line)", background: "var(--panel)", display: "flex", alignItems: "center", gap: 12, padding: "0 16px" } }, /* @__PURE__ */ React.createElement("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "var(--accent)", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", style: { display: "block", flexShrink: 0 } }, /* @__PURE__ */ React.createElement("path", { d: "m4.5 17 6-6-6-6" }), /* @__PURE__ */ React.createElement("path", { d: "M12 18.5h7.5" })), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 14, fontWeight: 700, letterSpacing: -0.3, color: "var(--text)" } }, "beagle"), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 12, color: "var(--faint)" } }, "\xB7 ", (nav.find((n) => n.id === tab) || { label: T.profile }).label.toLowerCase()), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }), /* @__PURE__ */ React.createElement(Tag, { tone: "accent" }, me.channel, " \xB7 lan ", me.lanVer), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 7, padding: "0 4px" } }, /* @__PURE__ */ React.createElement(StatusDot, { online: me.online }), /* @__PURE__ */ React.createElement(Mono, { size: 12.5, copy: me.ip }, me.ip)), /* @__PURE__ */ React.createElement("span", { style: { width: 1, height: 22, background: "var(--line)" } }), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8 } }, /* @__PURE__ */ React.createElement(DkAvatar, { peer: { ...me, id: me.userId, agent: false }, size: 26, radius: 7 }), /* @__PURE__ */ React.createElement("span", { style: { fontFamily: "var(--mono)", fontSize: 12.5, fontWeight: 600, color: "var(--text)" } }, me.name))), tab === "chat" && /* @__PURE__ */ React.createElement(ChatTab, { T, lang: t.lang, peers, requests, activeId, thread: data.threads[activeId], onSelect, onAct, onAdd, onSend, onSendFile, onSendRtcFile, onAlias, onRemove, onOpenNet, onCall, onReloadThread: () => activeId && data.loadThread(activeId), prefillAddr: pendingAddr, onPrefillConsumed: () => setPendingAddr(""), muted: mutedIds, onToggleMute }), tab === "here" && /* @__PURE__ */ React.createElement(DiscoverTab, { T, kind: "bridge", peers, meId: me.userId, onAdd, onOpenChat }), tab === "recommended" && /* @__PURE__ */ React.createElement(DiscoverTab, { T, kind: "recommended", peers, meId: me.userId, onAdd, onOpenChat }), tab === "registered" && /* @__PURE__ */ React.createElement(DiscoverTab, { T, kind: "registered", peers, meId: me.userId, onAdd, onOpenChat }), tab === "network" && /* @__PURE__ */ React.createElement(NetworkTab, { T, me, peers, exits, activeExit, reqCount: requests.length, onSetExit, onOpenChat, backend, onArmLan: armLan, onCancelLan: cancelLan }), tab === "apps" && /* @__PURE__ */ React.createElement(AppsTab, { T, t }), tab === "profile" && /* @__PURE__ */ React.createElement(ProfileTab, { T, me, onEdit, t, setTweak })), data.locked && /* @__PURE__ */ React.createElement(
|
|
5365
5404
|
DkLockedOut,
|
|
5366
5405
|
{
|
|
5367
5406
|
compact: true,
|
package/package.json
CHANGED