dsh-skill-browser 1.5.5 → 1.5.7

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.
Files changed (2) hide show
  1. package/lib/client.js +75 -8
  2. package/package.json +53 -53
package/lib/client.js CHANGED
@@ -696,7 +696,7 @@ window.__ModuleLoader__.load({
696
696
  // ---- 球体样式 + 字体球统一样式 + 显隐规则(纯 CSS,永久生效)----
697
697
  var CSS = [
698
698
  /* 技能球 */
699
- '#' + BALL_ID + '{position:fixed;right:26px;bottom:118px;width:46px;height:46px;border-radius:50%;' +
699
+ '#' + BALL_ID + '{position:fixed;right:74px;bottom:18px;width:46px;height:46px;border-radius:50%;' +
700
700
  'background:linear-gradient(135deg,#6a5cff,#2fb7ff);color:#fff;font-size:22px;display:flex;align-items:center;justify-content:center;' +
701
701
  'cursor:grab;z-index:2147481000;box-shadow:0 4px 16px rgba(40,80,255,.35);user-select:none;touch-action:none;transition:transform .15s ease}',
702
702
  '#' + BALL_ID + ':hover{transform:scale(1.08)}',
@@ -733,8 +733,46 @@ window.__ModuleLoader__.load({
733
733
  } catch (e) {}
734
734
  }
735
735
 
736
+ // v1.5.6 字体插件安装探测:dsh-fe-toggle 元素存在 = font-enhancer client 已运行。
737
+ // 元素存在不依赖球显隐(隐藏是 CSS display,DOM 仍在);卸载/禁用后元素消失。
738
+ function isFontEnhancerInstalled() {
739
+ try { return !!document.getElementById("dsh-fe-toggle"); } catch (e) { return false; }
740
+ }
741
+
736
742
  // v1.5.3 一键恢复默认位置:清位置记忆与收起/隐藏状态,球立即回右下角默认位。
737
743
  // 供 DSH 设置页「悬浮球导航」分区按钮调用(球可能被拖出屏幕外卡住,无法点回)。
744
+ // v1.5.7 推荐位安装徽标:探测三个插件的 client 运行状态,注入「已安装/未安装」徽标。
745
+ function recBadgeInstalled(id) {
746
+ if (id === "font") return !!document.getElementById("dsh-fe-toggle");
747
+ if (id === "skillbrowser") return !!document.getElementById(BALL_ID);
748
+ return false; // lightbox 用异步 fetch 判定,不走这里
749
+ }
750
+ function markRecBadge(recId, installed) {
751
+ var row = document.querySelector('[data-rec-id="' + recId + '"]');
752
+ if (!row || row.querySelector(".fe-rec-badge")) return;
753
+ var badge = document.createElement("span");
754
+ badge.className = "fe-rec-badge";
755
+ badge.textContent = installed ? "已安装" : "未安装";
756
+ badge.style.cssText = "flex-shrink:0;margin-left:8px;font-size:11px;padding:2px 8px;border-radius:6px;" +
757
+ (installed ? "background:rgba(120,220,150,.15);border:1px solid rgba(120,220,150,.4);color:#9fe0b5"
758
+ : "background:rgba(255,120,120,.15);border:1px solid rgba(255,120,120,.35);color:#ffb3b3") +
759
+ ";white-space:nowrap";
760
+ var star = row.querySelector("a");
761
+ if (star) row.insertBefore(badge, star); else row.appendChild(badge);
762
+ }
763
+ function applyRecBadges() {
764
+ ["font", "skillbrowser", "lightbox"].forEach(function (id) {
765
+ if (id === "lightbox") {
766
+ try {
767
+ fetch("/api/image-gallery/list").then(function (r) {
768
+ markRecBadge("lightbox", r.ok);
769
+ }).catch(function () { markRecBadge("lightbox", false); });
770
+ } catch (e) { markRecBadge("lightbox", false); }
771
+ } else {
772
+ markRecBadge(id, recBadgeInstalled(id));
773
+ }
774
+ });
775
+ }
738
776
  function resetBallToDefault() {
739
777
  try { localStorage.removeItem(BALL_POS_KEY); } catch (e) {}
740
778
  try { writeStore(BALL_VIS_KEY, true); } catch (e) {}
@@ -742,11 +780,29 @@ window.__ModuleLoader__.load({
742
780
  var b = $(BALL_ID);
743
781
  if (b) {
744
782
  b.style.left = ""; b.style.top = "";
745
- b.style.right = "26px"; b.style.bottom = "118px";
783
+ b.style.right = "74px"; b.style.bottom = "18px";
746
784
  b.classList.remove("dsb-ghost");
747
785
  }
748
786
  try { applyBallVisibility(); } catch (e) {}
749
- try { console.log("[dsh-skill-browser] ball reset to default position (bottom-right)"); } catch (e) {}
787
+ // v1.5.6 双球联动(仅字体插件已安装时挂载):🎯 复位时顺带把字体球归位
788
+ // (右下角 right:18px bottom:18px)。跨插件组合:只清位置记忆 + DOM 归位。
789
+ if (isFontEnhancerInstalled()) try {
790
+ var FE_POS_KEY = "dsh-font-enhancer";
791
+ var raw = localStorage.getItem(FE_POS_KEY);
792
+ if (raw) {
793
+ var data = JSON.parse(raw);
794
+ data.bx = null; data.by = null;
795
+ localStorage.setItem(FE_POS_KEY, JSON.stringify(data));
796
+ }
797
+ } catch (e) {}
798
+ try {
799
+ var feBall = document.getElementById("dsh-fe-toggle");
800
+ if (feBall) {
801
+ feBall.style.left = "auto"; feBall.style.top = "auto";
802
+ feBall.style.right = "18px"; feBall.style.bottom = "18px";
803
+ }
804
+ } catch (e) {}
805
+ try { console.log("[dsh-skill-browser] reset: skill ball + font ball -> default positions (paired bottom-right)"); } catch (e) {}
750
806
  }
751
807
 
752
808
  function buildBall() {
@@ -865,8 +921,17 @@ window.__ModuleLoader__.load({
865
921
  style: { alignSelf: "flex-start", fontSize: "13px", cursor: "pointer",
866
922
  background: "rgba(255,210,122,.12)", border: "1px solid rgba(255,210,122,.35)",
867
923
  borderRadius: "6px", padding: "6px 12px", color: "#ffd27a" }
868
- }, "🎯 一键恢复悬浮球默认位置(右下角)"));
869
- return React.createElement("div", { "data-dsb-slot": "1", style: { display: "flex", flexDirection: "column", gap: "8px", padding: "8px 0" } }, rows);
924
+ }, isFontEnhancerInstalled() ? "🎯 一键恢复悬浮球默认位置(右下角,双球)" : "🎯 一键恢复悬浮球默认位置(右下角)"));
925
+ // ── 推荐插件(v1.5.7 统一三条清单:字体/技能/照片,探测式安装徽标)──
926
+ rows.push(React.createElement("div", { key: "rec-head", style: { fontWeight: "600", marginTop: "12px", marginBottom: "4px", borderTop: "1px solid rgba(255,255,255,.08)", paddingTop: "10px" } }, "推荐插件"));
927
+ function recRow(key, recId, icon, text, repo) {
928
+ return React.createElement("div", { key: key, "data-rec-id": recId, style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: "13px", padding: "3px 0" } },
929
+ React.createElement("span", null, icon + " " + text),
930
+ React.createElement("a", { href: "https://github.com/" + repo, target: "_blank", rel: "noopener", style: { textDecoration: "none", fontSize: "12px", background: "rgba(255,255,255,.06)", border: "1px solid rgba(255,255,255,.12)", borderRadius: "6px", padding: "2px 8px", color: "#ffd27a", cursor: "pointer", whiteSpace: "nowrap" } }, "⭐ Star"));
931
+ }
932
+ rows.push(recRow("rec-font", "font", "🔤", "字体插件 — 区域自定义字体/颜色/字号", "loyalchiiina/dsh-font-enhancer"));
933
+ rows.push(recRow("rec-skillbrowser", "skillbrowser", "🧩", "技能浏览器 — 悬浮球面板浏览共享技能库 + 失效台账", "loyalchiiina/dsh-skill-browser"));
934
+ rows.push(recRow("rec-lightbox", "lightbox", "🖼️", "照片显示器 — 聊天图片灯箱(放大/下载/浏览)", "loyalchiiina/dsh-chat-image-lightbox"));return React.createElement("div", { "data-dsb-slot": "1", style: { display: "flex", flexDirection: "column", gap: "8px", padding: "8px 0" } }, rows);
870
935
  }
871
936
 
872
937
  function registerSettings(ctx) {
@@ -903,14 +968,14 @@ window.__ModuleLoader__.load({
903
968
  function migrateOldState() {
904
969
  try {
905
970
  var ver = localStorage.getItem("dsh-skill-browser-cfg-ver");
906
- if (ver !== "3") {
971
+ if (ver !== "4") {
907
972
  localStorage.setItem(BALL_VIS_KEY, "1"); // 球恢复显示
908
973
  localStorage.setItem(FONT_BALL_VIS_KEY, "1"); // 字体球恢复显示
909
974
  localStorage.removeItem(GHOST_KEY);
910
975
  // v3 复位(2026-09-05 用户要求"恢复原状"):同时清除拖拽位置记忆与
911
976
  // 收起小圆点状态,让悬浮球回到默认右下角 (right:26px bottom:118px) 常规大小。
912
977
  localStorage.removeItem(BALL_POS_KEY);
913
- localStorage.setItem("dsh-skill-browser-cfg-ver", "3");
978
+ localStorage.setItem("dsh-skill-browser-cfg-ver", "4");
914
979
  }
915
980
  } catch (e) {}
916
981
  }
@@ -935,7 +1000,9 @@ window.__ModuleLoader__.load({
935
1000
  applyFontBallVisibility();
936
1001
  applyBallVisibility();
937
1002
  } catch (e) {}
938
- try { console.log("[dsh-skill-browser] client mounted (v1.4.1 slot-only)"); } catch (e3) {}
1003
+ try { console.log("[dsh-skill-browser] client mounted (v1.4.1 slot-only)"); } catch (e3) {}
1004
+ setTimeout(applyRecBadges, 1200);
1005
+ setInterval(applyRecBadges, 5000);
939
1006
  };
940
1007
 
941
1008
  return module.exports;
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "dsh-skill-browser",
3
- "version": "1.5.5",
4
- "description": "DSH 技能浏览器:悬浮球面板浏览共享技能库(分类/中文简介/搜索/失效台账/全文查看),含 DSH 设置页悬浮球显隐开关与一键恢复默认位置按钮、技能库位置可配置(原生目录选择框)与技能失效台账自动登记(自动/人工分开显示);推荐插件位仅保留面板设置展开区一处。Skill library browser panel with categories, Chinese descriptions, configurable skill root with native directory chooser, one-click ball position reset and automatic skill-failure ledger.",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "sideEffects": false,
8
- "engines": {
9
- "node": ">=18"
10
- },
11
- "exports": {
12
- ".": "./lib/index.js",
13
- "./client": "./lib/client.js",
14
- "./package.json": "./package.json"
15
- },
16
- "files": [
17
- "lib/**/*.js",
18
- "lib/**/*.ps1",
19
- "cordis.patch.yml",
20
- "README.md",
21
- "LICENSE"
22
- ],
23
- "license": "MIT",
24
- "keywords": [
25
- "dsh-plugin",
26
- "deepseek-harness",
27
- "skill",
28
- "技能",
29
- "skills-browser",
30
- "skill-browser",
31
- "fluent",
32
- "cfd",
33
- "分类",
34
- "category",
35
- "chinese",
36
- "中文简介"
37
- ],
38
- "dsh": {
39
- "bundle": {
40
- "patch": "./cordis.patch.yml"
41
- },
42
- "client": {
43
- "inject": [
44
- "@deepseek-ai/dsh-client-connection",
45
- "@deepseek-ai/dsh-client-runtime",
46
- "@deepseek-ai/dsh-client-ui-settings",
47
- "@deepseek-ai/dsh-client-ui-slots",
48
- "@deepseek-ai/dsh-client-locale"
49
- ],
50
- "platform": "web"
51
- }
52
- }
53
- }
1
+ {
2
+ "name": "dsh-skill-browser",
3
+ "version": "1.5.7",
4
+ "description": "DSH 技能浏览器:悬浮球面板浏览共享技能库(分类/中文简介/搜索/失效台账/全文查看),含 DSH 设置页悬浮球显隐开关与一键恢复默认位置按钮、技能库位置可配置(原生目录选择框)与技能失效台账自动登记(自动/人工分开显示);推荐插件位仅保留面板设置展开区一处。Skill library browser panel with categories, Chinese descriptions, configurable skill root with native directory chooser, one-click ball position reset and automatic skill-failure ledger.",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "sideEffects": false,
8
+ "engines": {
9
+ "node": "\u003e=18"
10
+ },
11
+ "exports": {
12
+ ".": "./lib/index.js",
13
+ "./client": "./lib/client.js",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "lib/**/*.js",
18
+ "lib/**/*.ps1",
19
+ "cordis.patch.yml",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "license": "MIT",
24
+ "keywords": [
25
+ "dsh-plugin",
26
+ "deepseek-harness",
27
+ "skill",
28
+ "技能",
29
+ "skills-browser",
30
+ "skill-browser",
31
+ "fluent",
32
+ "cfd",
33
+ "分类",
34
+ "category",
35
+ "chinese",
36
+ "中文简介"
37
+ ],
38
+ "dsh": {
39
+ "bundle": {
40
+ "patch": "./cordis.patch.yml"
41
+ },
42
+ "client": {
43
+ "inject": [
44
+ "@deepseek-ai/dsh-client-connection",
45
+ "@deepseek-ai/dsh-client-runtime",
46
+ "@deepseek-ai/dsh-client-ui-settings",
47
+ "@deepseek-ai/dsh-client-ui-slots",
48
+ "@deepseek-ai/dsh-client-locale"
49
+ ],
50
+ "platform": "web"
51
+ }
52
+ }
53
+ }