soulnet-dsh 0.1.6 → 0.1.8

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/lib/client.js CHANGED
@@ -2339,6 +2339,9 @@ window.__ModuleLoader__.load({
2339
2339
  "bubble.auto": "auto-reply",
2340
2340
  "bubble.note": "SoulMirror",
2341
2341
  "settings.nav": "SoulMirror network",
2342
+ "page.update.banner": "New version v{v} - click to upgrade",
2343
+ "page.update.confirm": "Upgrade SoulMirror to v{v} now? The service restarts itself and this page reloads.",
2344
+ "page.update.busy": "Upgrading… the page will reload by itself.",
2342
2345
  "settings.title": "SoulMirror network",
2343
2346
  "settings.intro": "This dsh is a node on the SoulMirror network: an end-to-end encrypted A2A identity, friends, and your alter — one dsh session (\"My alter\") that speaks to every friend on your behalf.",
2344
2347
  "settings.status": "Backend",
@@ -2767,6 +2770,9 @@ window.__ModuleLoader__.load({
2767
2770
  "bubble.auto": "自动回复",
2768
2771
  "bubble.note": "灵镜",
2769
2772
  "settings.nav": "灵镜网络",
2773
+ "page.update.banner": "发现新版本 v{v}——点击升级",
2774
+ "page.update.confirm": "现在升级 SoulMirror 到 v{v} 吗?服务会自动重启,页面随后自动恢复。",
2775
+ "page.update.busy": "升级中……页面会自动刷新。",
2770
2776
  "settings.title": "灵镜网络",
2771
2777
  "settings.intro": "这个 dsh 是灵镜网络上的一个节点:端到端加密的 A2A 身份、好友,以及你的分身——一条 dsh 会话(「我的分身」),替你和所有好友往来。",
2772
2778
  "settings.status": "后端",
@@ -7729,10 +7735,23 @@ window.__ModuleLoader__.load({
7729
7735
  return t("group.join.applied");
7730
7736
  });
7731
7737
  };
7738
+ const upgrade = (0, react.useSyncExternalStore)(upgradeStore.subscribe, upgradeStore.getSnapshot);
7739
+ const upgradeBusy = upgrade.phase === "installing" || upgrade.phase === "restarting" || upgrade.phase === "reloading";
7732
7740
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
7733
7741
  className: "sm-list-col",
7734
7742
  "data-soulmirror-page-list": true,
7735
7743
  children: [
7744
+ upgrade.hasUpdate || upgradeBusy ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
7745
+ type: "button",
7746
+ className: "sm-update-banner",
7747
+ disabled: upgradeBusy,
7748
+ "data-soulmirror-update-banner": upgrade.latest,
7749
+ onClick: () => {
7750
+ if (upgradeBusy || upgrade.latest === void 0) return;
7751
+ if (window.confirm(t("page.update.confirm", { v: upgrade.latest }))) upgradeStore.run();
7752
+ },
7753
+ children: upgradeBusy ? t("page.update.busy") : t("page.update.banner", { v: upgrade.latest ?? "" })
7754
+ }) : null,
7736
7755
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7737
7756
  className: "sm-list-head",
7738
7757
  children: [
@@ -11082,6 +11101,14 @@ window.__ModuleLoader__.load({
11082
11101
  */
11083
11102
  const STYLE_ID = "soulmirror-styles";
11084
11103
  const CSS = `
11104
+ .sm-update-banner {
11105
+ flex: none; margin: 8px 10px 0; padding: 7px 10px; border: none; border-radius: 9px;
11106
+ background: var(--dsw-alias-brand-primary); color: var(--dsw-alias-label-primary-inverted);
11107
+ font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-align: center;
11108
+ }
11109
+ .sm-update-banner:hover { filter: brightness(1.08); }
11110
+ .sm-update-banner:disabled { opacity: .7; cursor: default; }
11111
+
11085
11112
  /* Native form controls follow the ACTIVE theme: the option list of a <select>
11086
11113
  (and scrollbars, checkboxes...) is OS-rendered and ignores CSS tokens - it
11087
11114
  only obeys color-scheme. dsh marks its dark theme on <body>. */
@@ -11567,7 +11594,7 @@ body[data-ds-dark-theme] .sm-page-root {
11567
11594
  silent: true,
11568
11595
  refresh: true
11569
11596
  });
11570
- }, 18e5);
11597
+ }, 3e5);
11571
11598
  return () => {
11572
11599
  clearInterval(timer);
11573
11600
  };