dsh-font-enhancer 1.4.0 → 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.
- package/lib/client.js +115 -5
- package/package.json +77 -77
package/lib/client.js
CHANGED
|
@@ -313,6 +313,9 @@ window.__ModuleLoader__.load({
|
|
|
313
313
|
"#dsh-fe-toggle{position:fixed;left:auto;top:auto;right:18px;bottom:18px;z-index:2147483647 !important;width:54px !important;height:54px !important;border-radius:50% !important;border:0 !important;background:radial-gradient(circle at 30% 25%,rgba(255,255,255,.15),rgba(40,44,54,.95) 70%) !important;color:#eef0f4 !important;font-size:22px !important;font-weight:700 !important;cursor:grab !important;user-select:none !important;touch-action:none !important;box-shadow:0 4px 24px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,255,255,.15) !important;backdrop-filter:blur(12px) !important;line-height:54px !important;text-align:center !important;display:block !important;visibility:visible !important;opacity:1 !important;transform:none !important;pointer-events:auto !important}",
|
|
314
314
|
"#dsh-fe-toggle:hover{box-shadow:0 6px 32px rgba(0,0,0,.7),inset 0 1px 0 rgba(255,255,255,.2) !important;transform:scale(1.06) !important}",
|
|
315
315
|
"#dsh-fe-toggle.dsh-fe-dragging{cursor:grabbing !important;transform:scale(1.12) !important;box-shadow:0 8px 40px rgba(0,0,0,.8) !important}",
|
|
316
|
+
"/* ── v1.4.3 orb restyle: warm gradient + 🔤 glyph(字体球独立美化,与 skill-browser 统一样式一致;幂等)── */",
|
|
317
|
+
"#dsh-fe-root #dsh-fe-toggle{width:46px !important;height:46px !important;line-height:46px !important;font-size:0 !important;color:transparent !important;display:flex !important;align-items:center !important;justify-content:center !important;background:linear-gradient(135deg,#ff8c42,#ffd27a) !important;box-shadow:0 4px 16px rgba(255,140,66,.35) !important}",
|
|
318
|
+
"#dsh-fe-root #dsh-fe-toggle::after{content:'🔤';font-size:20px;color:#fff;display:block;line-height:1}",
|
|
316
319
|
"/* ── panel root — deep glass studio (position set by JS positionPanel) ── */",
|
|
317
320
|
"#dsh-fe-panel{position:fixed !important;z-index:2147483647 !important;width:348px !important;max-width:calc(100vw - 36px) !important;max-height:86vh;overflow-y:auto !important;overflow-x:hidden !important;color:#e6e6e6 !important;border-radius:20px !important;padding:20px !important;font:13px/1.5 KaiTi,'Microsoft YaHei',sans-serif !important;background:rgba(16,18,22,.92) !important;border:1px solid rgba(255,255,255,.08) !important;box-shadow:0 20px 60px rgba(0,0,0,.7),inset 0 1px 0 rgba(255,255,255,.06) !important;backdrop-filter:blur(24px) !important;-webkit-backdrop-filter:blur(24px) !important;visibility:visible !important;pointer-events:auto !important}",
|
|
318
321
|
"#dsh-fe-panel::-webkit-scrollbar{width:3px}",
|
|
@@ -1563,6 +1566,56 @@ window.__ModuleLoader__.load({
|
|
|
1563
1566
|
} catch (e) { feReact = null; }
|
|
1564
1567
|
if (!feReact) { try { feReact = window.React || null; } catch (e) {} }
|
|
1565
1568
|
|
|
1569
|
+
// v1.4.3(2026-09-06 用户要求):分区智能让位 + UI 对齐 skill-browser 版式。
|
|
1570
|
+
// 探测机制:skill-browser 的 🧩 悬浮球 DOM(页面加载即建,不依赖打开设置页)。
|
|
1571
|
+
// 让位机制:延迟注册——skill-browser 在场则不注册分区,独立运行才注册兜底分区。
|
|
1572
|
+
// 独立存在时(未装 skill-browser):完整版「悬浮球导航」分区——字体球开关
|
|
1573
|
+
// + 🎯 一键恢复默认位置 + 推荐插件位(照片显示器 / 技能浏览器)。
|
|
1574
|
+
|
|
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
|
+
}
|
|
1600
|
+
function feResetBallToDefault() {
|
|
1601
|
+
try {
|
|
1602
|
+
var data = loadSettings();
|
|
1603
|
+
data.bx = null; data.by = null;
|
|
1604
|
+
saveSettings(data);
|
|
1605
|
+
state.bx = null; state.by = null;
|
|
1606
|
+
} catch (e) {}
|
|
1607
|
+
var t = document.getElementById("dsh-fe-toggle");
|
|
1608
|
+
if (t) {
|
|
1609
|
+
t.style.left = "auto"; t.style.top = "auto";
|
|
1610
|
+
t.style.right = "18px"; t.style.bottom = "18px";
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
// skill-browser 是否已安装运行(🧩 球元素存在即算,与球显隐无关)
|
|
1615
|
+
function feSkillBrowserPresent() {
|
|
1616
|
+
try { return !!document.getElementById("dsh-skill-browser-ball"); } catch (e) { return false; }
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1566
1619
|
function FontSettingsSection(props) {
|
|
1567
1620
|
if (!feReact) return null;
|
|
1568
1621
|
var rows = [];
|
|
@@ -1572,13 +1625,27 @@ window.__ModuleLoader__.load({
|
|
|
1572
1625
|
feReact.createElement("span", null, label));
|
|
1573
1626
|
}
|
|
1574
1627
|
rows.push(feReact.createElement("div", { key: "head", style: { fontWeight: "600", marginBottom: "4px" } }, "悬浮球导航"));
|
|
1575
|
-
rows.push(mkToggle("fe-set-ball", "
|
|
1628
|
+
rows.push(mkToggle("fe-set-ball", "字体插件悬浮球(🔤)", function (e) {
|
|
1576
1629
|
feWriteStore(FE_BALL_VIS_KEY, e.target.checked);
|
|
1577
1630
|
feApplyBallVisibility();
|
|
1578
1631
|
}));
|
|
1632
|
+
rows.push(feReact.createElement("button", { key: "fe-reset-pos",
|
|
1633
|
+
onClick: function () { try { feResetBallToDefault(); } catch (e) {} },
|
|
1634
|
+
style: { alignSelf: "flex-start", fontSize: "13px", cursor: "pointer",
|
|
1635
|
+
background: "rgba(255,210,122,.12)", border: "1px solid rgba(255,210,122,.35)",
|
|
1636
|
+
borderRadius: "6px", padding: "6px 12px", color: "#ffd27a" }
|
|
1637
|
+
}, "🎯 一键恢复悬浮球默认位置(右下角)"));
|
|
1579
1638
|
rows.push(feReact.createElement("div", { key: "hint", style: { fontSize: "12px", color: "#8b93a8" } },
|
|
1580
|
-
"
|
|
1581
|
-
|
|
1639
|
+
"悬浮球可拖动;本分区就在 DSH 设置中,随时可改悬浮球显隐"));
|
|
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);
|
|
1582
1649
|
}
|
|
1583
1650
|
|
|
1584
1651
|
function registerSettings(ctx) {
|
|
@@ -1589,7 +1656,7 @@ window.__ModuleLoader__.load({
|
|
|
1589
1656
|
name: "settings.section",
|
|
1590
1657
|
id: "dsh-font-enhancer",
|
|
1591
1658
|
order: 23,
|
|
1592
|
-
label: function () { return "
|
|
1659
|
+
label: function () { return "悬浮球导航"; },
|
|
1593
1660
|
inject: function () { return {}; }
|
|
1594
1661
|
}, FontSettingsSection);
|
|
1595
1662
|
});
|
|
@@ -1598,8 +1665,29 @@ window.__ModuleLoader__.load({
|
|
|
1598
1665
|
}
|
|
1599
1666
|
|
|
1600
1667
|
var inject = ["slots", "locale"];
|
|
1668
|
+
var __feSectionRegistered = false;
|
|
1669
|
+
// v1.4.3 延迟注册让位:skill-browser 在场则永不注册(设置页不会出现空标题分区);
|
|
1670
|
+
// 60s 内确认独立存在才注册完整版分区。两插件装卸都以重启为界,轮询窗口足够。
|
|
1671
|
+
function feDelayedRegister(ctx) {
|
|
1672
|
+
var tries = 0;
|
|
1673
|
+
var t = setInterval(function () {
|
|
1674
|
+
tries++;
|
|
1675
|
+
try {
|
|
1676
|
+
if (__feSectionRegistered) { clearInterval(t); return; }
|
|
1677
|
+
if (feSkillBrowserPresent()) {
|
|
1678
|
+
clearInterval(t);
|
|
1679
|
+
try { console.log("[dsh-font-enhancer] settings section skipped (skill-browser present)"); } catch (e) {}
|
|
1680
|
+
return;
|
|
1681
|
+
}
|
|
1682
|
+
if (tries >= 30) { // 60s 仍无 skill-browser → 独立运行,注册兜底分区
|
|
1683
|
+
clearInterval(t);
|
|
1684
|
+
if (registerSettings(ctx)) { __feSectionRegistered = true; setTimeout(feApplyRecBadges, 1500); setInterval(feApplyRecBadges, 5000); }
|
|
1685
|
+
}
|
|
1686
|
+
} catch (e) {}
|
|
1687
|
+
}, 2000);
|
|
1688
|
+
}
|
|
1601
1689
|
function apply(ctx) {
|
|
1602
|
-
try {
|
|
1690
|
+
try { feDelayedRegister(ctx); } catch (e) {}
|
|
1603
1691
|
if (document.readyState === "loading") {
|
|
1604
1692
|
document.addEventListener("DOMContentLoaded", buildUI);
|
|
1605
1693
|
} else {
|
|
@@ -1607,6 +1695,28 @@ window.__ModuleLoader__.load({
|
|
|
1607
1695
|
}
|
|
1608
1696
|
feWatchBall();
|
|
1609
1697
|
feApplyBallVisibility();
|
|
1698
|
+
// v1.4.3 推荐位安装状态徽标:对每个推荐插件探测是否已安装,
|
|
1699
|
+
// 未安装 → 行内注入「未安装」徽标(已安装则不动,保持干净)。
|
|
1700
|
+
setTimeout(function () {
|
|
1701
|
+
var markNotInstalled = function (recId) {
|
|
1702
|
+
var row = document.querySelector('[data-rec-id="' + recId + '"]');
|
|
1703
|
+
if (!row || row.querySelector(".fe-rec-badge")) return;
|
|
1704
|
+
var badge = document.createElement("span");
|
|
1705
|
+
badge.className = "fe-rec-badge";
|
|
1706
|
+
badge.textContent = "未安装";
|
|
1707
|
+
badge.style.cssText = "flex-shrink:0;margin-left:8px;font-size:11px;padding:2px 8px;border-radius:6px;background:rgba(255,120,120,.15);border:1px solid rgba(255,120,120,.35);color:#ffb3b3;white-space:nowrap";
|
|
1708
|
+
var star = row.querySelector("a");
|
|
1709
|
+
if (star) row.insertBefore(badge, star); else row.appendChild(badge);
|
|
1710
|
+
};
|
|
1711
|
+
// skill-browser:client 运行 = 球元素在 DOM(字体分区出现时通常未装 → 徽标显示)
|
|
1712
|
+
setTimeout(function () {
|
|
1713
|
+
try { if (!document.getElementById("dsh-skill-browser-ball")) markNotInstalled("skillbrowser"); } catch (e) {}
|
|
1714
|
+
}, 1500);
|
|
1715
|
+
// lightbox:宿主路由 /api/image-gallery/list 通 = 已安装
|
|
1716
|
+
try {
|
|
1717
|
+
fetch("/api/image-gallery/list").then(function (r) { if (!r.ok) markNotInstalled("lightbox"); }).catch(function () { markNotInstalled("lightbox"); });
|
|
1718
|
+
} catch (e) { markNotInstalled("lightbox"); }
|
|
1719
|
+
}, 800);
|
|
1610
1720
|
}
|
|
1611
1721
|
|
|
1612
1722
|
exports.apply = apply;
|
package/package.json
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
+
}
|