@decentnetwork/lan 0.1.92 → 0.1.93
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/ui/desktop/app.js
CHANGED
|
@@ -501,13 +501,30 @@ const __TWEAKS_STYLE = `
|
|
|
501
501
|
.twk-chip svg{position:absolute;top:6px;left:6px;width:13px;height:13px;
|
|
502
502
|
filter:drop-shadow(0 1px 1px rgba(0,0,0,.3))}
|
|
503
503
|
`;
|
|
504
|
+
const TWEAKS_STORAGE_KEY = "decentlan.tweaks";
|
|
504
505
|
function useTweaks(defaults) {
|
|
505
|
-
const [values, setValues] = React.useState(
|
|
506
|
+
const [values, setValues] = React.useState(() => {
|
|
507
|
+
try {
|
|
508
|
+
const saved = JSON.parse(localStorage.getItem(TWEAKS_STORAGE_KEY) || "{}");
|
|
509
|
+
return { ...defaults, ...saved };
|
|
510
|
+
} catch (e) {
|
|
511
|
+
return defaults;
|
|
512
|
+
}
|
|
513
|
+
});
|
|
506
514
|
const setTweak = React.useCallback((keyOrEdits, val) => {
|
|
507
515
|
const edits = typeof keyOrEdits === "object" && keyOrEdits !== null ? keyOrEdits : { [keyOrEdits]: val };
|
|
508
|
-
setValues((prev) =>
|
|
509
|
-
|
|
510
|
-
|
|
516
|
+
setValues((prev) => {
|
|
517
|
+
const next = { ...prev, ...edits };
|
|
518
|
+
try {
|
|
519
|
+
localStorage.setItem(TWEAKS_STORAGE_KEY, JSON.stringify(next));
|
|
520
|
+
} catch (e) {
|
|
521
|
+
}
|
|
522
|
+
return next;
|
|
523
|
+
});
|
|
524
|
+
try {
|
|
525
|
+
window.dispatchEvent(new CustomEvent("tweakchange", { detail: edits }));
|
|
526
|
+
} catch (e) {
|
|
527
|
+
}
|
|
511
528
|
}, []);
|
|
512
529
|
return [values, setTweak];
|
|
513
530
|
}
|
|
@@ -576,7 +593,23 @@ function TweaksPanel({ title = "Tweaks", children }) {
|
|
|
576
593
|
window.addEventListener("mousemove", move);
|
|
577
594
|
window.addEventListener("mouseup", up);
|
|
578
595
|
};
|
|
579
|
-
if (!open) return
|
|
596
|
+
if (!open) return /* @__PURE__ */ React.createElement("button", { onClick: () => setOpen(true), title, "aria-label": title, style: {
|
|
597
|
+
position: "fixed",
|
|
598
|
+
right: 16,
|
|
599
|
+
bottom: 16,
|
|
600
|
+
zIndex: 2147483646,
|
|
601
|
+
width: 40,
|
|
602
|
+
height: 40,
|
|
603
|
+
borderRadius: 11,
|
|
604
|
+
cursor: "pointer",
|
|
605
|
+
background: "var(--panel-2)",
|
|
606
|
+
border: "1px solid var(--line)",
|
|
607
|
+
color: "var(--dim)",
|
|
608
|
+
display: "flex",
|
|
609
|
+
alignItems: "center",
|
|
610
|
+
justifyContent: "center",
|
|
611
|
+
boxShadow: "0 6px 20px rgba(0,0,0,0.28)"
|
|
612
|
+
} }, /* @__PURE__ */ React.createElement(Icon, { name: "sliders", size: 18, stroke: 1.9 }));
|
|
580
613
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, __TWEAKS_STYLE), /* @__PURE__ */ React.createElement(
|
|
581
614
|
"div",
|
|
582
615
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.93",
|
|
4
4
|
"description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|