dsh-font-enhancer 1.4.3 → 1.4.4

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 +34 -10
  2. package/package.json +77 -77
package/lib/client.js CHANGED
@@ -1573,6 +1573,30 @@ window.__ModuleLoader__.load({
1573
1573
  // + 🎯 一键恢复默认位置 + 推荐插件位(照片显示器 / 技能浏览器)。
1574
1574
 
1575
1575
  // 恢复字体球默认位置(右下角 right:18px bottom:18px),清 bx/by 持久化。
1576
+ // v1.4.4 推荐位安装徽标(与 skill-browser 同款探测)
1577
+ function feMarkRecBadge(recId, installed) {
1578
+ var row = document.querySelector('[data-rec-id="' + recId + '"]');
1579
+ if (!row || row.querySelector(".fe-rec-badge")) return;
1580
+ var badge = document.createElement("span");
1581
+ badge.className = "fe-rec-badge";
1582
+ badge.textContent = installed ? "已安装" : "未安装";
1583
+ badge.style.cssText = "flex-shrink:0;margin-left:8px;font-size:11px;padding:2px 8px;border-radius:6px;" +
1584
+ (installed ? "background:rgba(120,220,150,.15);border:1px solid rgba(120,220,150,.4);color:#9fe0b5"
1585
+ : "background:rgba(255,120,120,.15);border:1px solid rgba(255,120,120,.35);color:#ffb3b3") +
1586
+ ";white-space:nowrap";
1587
+ var star = row.querySelector("a");
1588
+ if (star) row.insertBefore(badge, star); else row.appendChild(badge);
1589
+ }
1590
+ function feApplyRecBadges() {
1591
+ feMarkRecBadge("font", true); // 本插件在跑,恒已装
1592
+ try {
1593
+ var sbOk = !!document.getElementById("dsh-skill-browser-ball");
1594
+ feMarkRecBadge("skillbrowser", sbOk);
1595
+ } catch (e) { feMarkRecBadge("skillbrowser", false); }
1596
+ try {
1597
+ fetch("/api/image-gallery/list").then(function (r) { feMarkRecBadge("lightbox", r.ok); }).catch(function () { feMarkRecBadge("lightbox", false); });
1598
+ } catch (e) { feMarkRecBadge("lightbox", false); }
1599
+ }
1576
1600
  function feResetBallToDefault() {
1577
1601
  try {
1578
1602
  var data = loadSettings();
@@ -1613,15 +1637,15 @@ window.__ModuleLoader__.load({
1613
1637
  }, "🎯 一键恢复悬浮球默认位置(右下角)"));
1614
1638
  rows.push(feReact.createElement("div", { key: "hint", style: { fontSize: "12px", color: "#8b93a8" } },
1615
1639
  "悬浮球可拖动;本分区就在 DSH 设置中,随时可改悬浮球显隐"));
1616
- // ── 推荐插件(仅字体插件独立存在、未装 skill-browser 时可见——skill-browser 在场时整个分区已被 CSS 隐藏)──
1617
- rows.push(feReact.createElement("div", { key: "fe-rec-head", style: { fontWeight: "600", marginTop: "12px", marginBottom: "4px", borderTop: "1px solid rgba(255,255,255,.08)", paddingTop: "10px" } }, "推荐插件"));
1618
- rows.push(feReact.createElement("div", { key: "fe-rec-lightbox", "data-rec-id": "lightbox", style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: "13px", padding: "3px 0" } },
1619
- feReact.createElement("span", null, "🖼️ 照片显示器 — 聊天图片灯箱(放大/下载/浏览)"),
1620
- feReact.createElement("a", { href: "https://github.com/loyalchiiina/dsh-chat-image-lightbox", 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")));
1621
- rows.push(feReact.createElement("div", { key: "fe-rec-skillbrowser", "data-rec-id": "skillbrowser", style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: "13px", padding: "3px 0" } },
1622
- feReact.createElement("span", null, "🧩 技能浏览器 — 悬浮球面板浏览共享技能库 + 失效台账"),
1623
- feReact.createElement("a", { href: "https://github.com/loyalchiiina/dsh-skill-browser", 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")));
1624
- return feReact.createElement("div", { "data-fe-slot": "1", style: { display: "flex", flexDirection: "column", gap: "8px", padding: "8px 0" } }, rows);
1640
+ // ── 推荐插件(v1.4.4 统一三条清单:字体/技能/照片,探测式安装徽标)──
1641
+ function recRow(key, recId, icon, text, repo) {
1642
+ return feReact.createElement("div", { key: key, "data-rec-id": recId, style: { display: "flex", alignItems: "center", justifyContent: "space-between", fontSize: "13px", padding: "3px 0" } },
1643
+ feReact.createElement("span", null, icon + " " + text),
1644
+ feReact.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"));
1645
+ }
1646
+ rows.push(recRow("rec-font", "font", "🔤", "字体插件 — 区域自定义字体/颜色/字号", "loyalchiiina/dsh-font-enhancer"));
1647
+ rows.push(recRow("rec-skillbrowser", "skillbrowser", "🧩", "技能浏览器 — 悬浮球面板浏览共享技能库 + 失效台账", "loyalchiiina/dsh-skill-browser"));
1648
+ rows.push(recRow("rec-lightbox", "lightbox", "🖼️", "照片显示器 — 聊天图片灯箱(放大/下载/浏览)", "loyalchiiina/dsh-chat-image-lightbox"));return feReact.createElement("div", { "data-fe-slot": "1", style: { display: "flex", flexDirection: "column", gap: "8px", padding: "8px 0" } }, rows);
1625
1649
  }
1626
1650
 
1627
1651
  function registerSettings(ctx) {
@@ -1657,7 +1681,7 @@ window.__ModuleLoader__.load({
1657
1681
  }
1658
1682
  if (tries >= 30) { // 60s 仍无 skill-browser → 独立运行,注册兜底分区
1659
1683
  clearInterval(t);
1660
- if (registerSettings(ctx)) __feSectionRegistered = true;
1684
+ if (registerSettings(ctx)) { __feSectionRegistered = true; setTimeout(feApplyRecBadges, 1500); setInterval(feApplyRecBadges, 5000); }
1661
1685
  }
1662
1686
  } catch (e) {}
1663
1687
  }, 2000);
package/package.json CHANGED
@@ -1,77 +1,77 @@
1
- {
2
- "name": "dsh-font-enhancer",
3
- "version": "1.4.3",
4
- "description": "DSH 字体样式 DIY 插件(搜「字体」找到我):按区域自定义中英文字体/字号/字重/斜体/颜色,框选元素创建自定义区域,全局统一控制,主题保存/切换,随机配色,支持自定义字体。DIY your DSH UI fonts & colors: per-region custom font/size/weight/italic/color, pick elements to create custom regions, unified overrides, theme save/switch, random color, custom fonts.",
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/fonts/*.ttf",
19
- "cordis.patch.yml",
20
- "README.md",
21
- "LICENSE"
22
- ],
23
- "license": "MIT",
24
- "keywords": [
25
- "dsh-plugin",
26
- "deepseek-harness",
27
- "font",
28
- "字体",
29
- "typography",
30
- "排版",
31
- "DIY",
32
- "theme",
33
- "主题",
34
- "color",
35
- "颜色",
36
- "ui",
37
- "区域",
38
- "styling",
39
- "样式",
40
- "chinese-font",
41
- "中文字体",
42
- "english-font",
43
- "font-picker",
44
- "font-size",
45
- "字重",
46
- "斜体",
47
- "theme-switch",
48
- "主题切换",
49
- "text-styling",
50
- "文字样式",
51
- "custom-font",
52
- "自定义字体"
53
- ],
54
- "repository": {
55
- "type": "git",
56
- "url": "git+https://github.com/loyalchiiina/dsh-font-enhancer.git"
57
- },
58
- "homepage": "https://github.com/loyalchiiina/dsh-font-enhancer#readme",
59
- "bugs": {
60
- "url": "https://github.com/loyalchiiina/dsh-font-enhancer/issues"
61
- },
62
- "dsh": {
63
- "bundle": {
64
- "patch": "./cordis.patch.yml"
65
- },
66
- "client": {
67
- "inject": [
68
- "@deepseek-ai/dsh-client-connection",
69
- "@deepseek-ai/dsh-client-runtime",
70
- "@deepseek-ai/dsh-client-ui-settings",
71
- "@deepseek-ai/dsh-client-ui-slots",
72
- "@deepseek-ai/dsh-client-locale"
73
- ],
74
- "platform": "web"
75
- }
76
- }
77
- }
1
+ {
2
+ "name": "dsh-font-enhancer",
3
+ "version": "1.4.4",
4
+ "description": "DSH 字体样式 DIY 插件(搜「字体」找到我):按区域自定义中英文字体/字号/字重/斜体/颜色,框选元素创建自定义区域,全局统一控制,主题保存/切换,随机配色,支持自定义字体。DIY your DSH UI fonts \u0026 colors: per-region custom font/size/weight/italic/color, pick elements to create custom regions, unified overrides, theme save/switch, random color, custom fonts.",
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/fonts/*.ttf",
19
+ "cordis.patch.yml",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "license": "MIT",
24
+ "keywords": [
25
+ "dsh-plugin",
26
+ "deepseek-harness",
27
+ "font",
28
+ "字体",
29
+ "typography",
30
+ "排版",
31
+ "DIY",
32
+ "theme",
33
+ "主题",
34
+ "color",
35
+ "颜色",
36
+ "ui",
37
+ "区域",
38
+ "styling",
39
+ "样式",
40
+ "chinese-font",
41
+ "中文字体",
42
+ "english-font",
43
+ "font-picker",
44
+ "font-size",
45
+ "字重",
46
+ "斜体",
47
+ "theme-switch",
48
+ "主题切换",
49
+ "text-styling",
50
+ "文字样式",
51
+ "custom-font",
52
+ "自定义字体"
53
+ ],
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/loyalchiiina/dsh-font-enhancer.git"
57
+ },
58
+ "homepage": "https://github.com/loyalchiiina/dsh-font-enhancer#readme",
59
+ "bugs": {
60
+ "url": "https://github.com/loyalchiiina/dsh-font-enhancer/issues"
61
+ },
62
+ "dsh": {
63
+ "bundle": {
64
+ "patch": "./cordis.patch.yml"
65
+ },
66
+ "client": {
67
+ "inject": [
68
+ "@deepseek-ai/dsh-client-connection",
69
+ "@deepseek-ai/dsh-client-runtime",
70
+ "@deepseek-ai/dsh-client-ui-settings",
71
+ "@deepseek-ai/dsh-client-ui-slots",
72
+ "@deepseek-ai/dsh-client-locale"
73
+ ],
74
+ "platform": "web"
75
+ }
76
+ }
77
+ }