dsh-dock 0.21.0 → 0.21.2
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/README.md +0 -1
- package/client.js +370 -602
- package/features/animation/view.jsx +81 -4
- package/features/balance/view.js +7 -1
- package/features/tokenlog/view.jsx +8 -1
- package/index.js +0 -3
- package/package.json +2 -2
- package/src/client.jsx +161 -113
- package/features/mobile/host.js +0 -22
- package/features/mobile/view.js +0 -345
package/client.js
CHANGED
|
@@ -2126,7 +2126,7 @@ __export(client_exports, {
|
|
|
2126
2126
|
inject: () => inject
|
|
2127
2127
|
});
|
|
2128
2128
|
module.exports = __toCommonJS(client_exports);
|
|
2129
|
-
var
|
|
2129
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
2130
2130
|
|
|
2131
2131
|
// src/shared.js
|
|
2132
2132
|
var import_react = __toESM(require("react"), 1);
|
|
@@ -3757,9 +3757,15 @@ function TokenLogChip(props) {
|
|
|
3757
3757
|
"aria-label": "\u4F1A\u8BDD\u7528\u91CF",
|
|
3758
3758
|
onClick: () => openPanel("tokenlog", { sessionId: sid, navAt: Date.now() }),
|
|
3759
3759
|
children: [
|
|
3760
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-svg", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 16 16", width: "13", height: "13", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
|
|
3761
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3.5 12.5V9" }),
|
|
3762
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 12.5V4.5" }),
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12.5 12.5V7" })
|
|
3764
|
+
] }) }),
|
|
3760
3765
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-dot", style: { background: gone ? "var(--dsw-alias-label-tertiary,#8b95ab)" : "var(--dk-warn)" } }),
|
|
3761
3766
|
labelIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-ic", children: labelIcon }) : null,
|
|
3762
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children:
|
|
3767
|
+
hasData ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-pre-s", children: "\u7528\u91CF " }) : null,
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-val", children: labelMain }),
|
|
3763
3769
|
labelExtra ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-x", children: labelExtra }) : null
|
|
3764
3770
|
]
|
|
3765
3771
|
}
|
|
@@ -5482,9 +5488,21 @@ function BalanceChip(props) {
|
|
|
5482
5488
|
"aria-label": "\u6A21\u578B\u4F59\u989D",
|
|
5483
5489
|
onClick: () => openPanel("balance", def ? { provider: def } : null)
|
|
5484
5490
|
},
|
|
5491
|
+
// 窄屏只显示这枚小图标:点它进功能坞看余额详情(title 里是完整数值)
|
|
5492
|
+
import_react8.default.createElement(
|
|
5493
|
+
"span",
|
|
5494
|
+
{ className: "dockchip-svg", "aria-hidden": "true" },
|
|
5495
|
+
import_react8.default.createElement(
|
|
5496
|
+
"svg",
|
|
5497
|
+
{ viewBox: "0 0 16 16", width: 13, height: 13, fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" },
|
|
5498
|
+
import_react8.default.createElement("path", { d: "M2.8 6.2h10.4v6.3a1 1 0 0 1-1 1H3.8a1 1 0 0 1-1-1z" }),
|
|
5499
|
+
import_react8.default.createElement("path", { d: "M5.4 6.2V4.6a2.6 2.6 0 0 1 5.2 0v1.6" })
|
|
5500
|
+
)
|
|
5501
|
+
),
|
|
5485
5502
|
import_react8.default.createElement("span", { className: "dockchip-dot", style: { background: accent } }),
|
|
5486
5503
|
mm ? import_react8.default.createElement("span", { className: "dockchip-pre" }, mm[1]) : null,
|
|
5487
|
-
import_react8.default.createElement("span",
|
|
5504
|
+
mm ? import_react8.default.createElement("span", { className: "dockchip-pre-s" }, "\u4F59\u989D ") : null,
|
|
5505
|
+
import_react8.default.createElement("span", { className: "dockchip-val" }, mm ? mm[2] : text)
|
|
5488
5506
|
);
|
|
5489
5507
|
}
|
|
5490
5508
|
var feature6 = {
|
|
@@ -6524,6 +6542,85 @@ function AnimationOverlay(props) {
|
|
|
6524
6542
|
}, 0);
|
|
6525
6543
|
}
|
|
6526
6544
|
};
|
|
6545
|
+
const [badgePos, setBadgePos] = (0, import_react9.useState)(null);
|
|
6546
|
+
const badgePosRef = (0, import_react9.useRef)(null);
|
|
6547
|
+
const badgeDragRef = (0, import_react9.useRef)(null);
|
|
6548
|
+
const badgeClickBlockRef = (0, import_react9.useRef)(false);
|
|
6549
|
+
(0, import_react9.useEffect)(() => {
|
|
6550
|
+
try {
|
|
6551
|
+
if (typeof localStorage === "undefined") return;
|
|
6552
|
+
const raw = localStorage.getItem("dsh-dock/anim/badge-pos/v1");
|
|
6553
|
+
const p2 = raw ? JSON.parse(raw) : null;
|
|
6554
|
+
if (p2 && typeof p2.x === "number" && typeof p2.y === "number" && typeof window !== "undefined") {
|
|
6555
|
+
const card = document.querySelector(".dkan-badge");
|
|
6556
|
+
const w = card ? card.offsetWidth : 180, h = card ? card.offsetHeight : 34;
|
|
6557
|
+
const x = Math.min(Math.max(8, p2.x), Math.max(8, window.innerWidth - w - 8));
|
|
6558
|
+
const y = Math.min(Math.max(8, p2.y), Math.max(8, window.innerHeight - h - 8));
|
|
6559
|
+
badgePosRef.current = { x, y };
|
|
6560
|
+
setBadgePos({ x, y });
|
|
6561
|
+
}
|
|
6562
|
+
} catch {
|
|
6563
|
+
}
|
|
6564
|
+
}, []);
|
|
6565
|
+
const onBadgePointerDown = (e) => {
|
|
6566
|
+
if (e.button !== 0) return;
|
|
6567
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
6568
|
+
badgeDragRef.current = { sx: e.clientX, sy: e.clientY, ox: r.left, oy: r.top, moved: false };
|
|
6569
|
+
try {
|
|
6570
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6571
|
+
} catch {
|
|
6572
|
+
}
|
|
6573
|
+
};
|
|
6574
|
+
const onBadgePointerMove = (e) => {
|
|
6575
|
+
const d = badgeDragRef.current;
|
|
6576
|
+
if (!d || typeof window === "undefined") return;
|
|
6577
|
+
const dx = e.clientX - d.sx, dy = e.clientY - d.sy;
|
|
6578
|
+
if (!d.moved && Math.hypot(dx, dy) < 4) return;
|
|
6579
|
+
d.moved = true;
|
|
6580
|
+
const el = e.currentTarget;
|
|
6581
|
+
const w = el.offsetWidth || 180, h = el.offsetHeight || 34;
|
|
6582
|
+
const x = Math.min(Math.max(8, d.ox + dx), window.innerWidth - w - 8);
|
|
6583
|
+
const y = Math.min(Math.max(8, d.oy + dy), window.innerHeight - h - 8);
|
|
6584
|
+
badgePosRef.current = { x, y };
|
|
6585
|
+
setBadgePos({ x, y });
|
|
6586
|
+
};
|
|
6587
|
+
const onBadgePointerUp = () => {
|
|
6588
|
+
const d = badgeDragRef.current;
|
|
6589
|
+
badgeDragRef.current = null;
|
|
6590
|
+
if (d && d.moved) {
|
|
6591
|
+
try {
|
|
6592
|
+
if (typeof localStorage !== "undefined") localStorage.setItem("dsh-dock/anim/badge-pos/v1", JSON.stringify(badgePosRef.current));
|
|
6593
|
+
} catch {
|
|
6594
|
+
}
|
|
6595
|
+
badgeClickBlockRef.current = true;
|
|
6596
|
+
setTimeout(() => {
|
|
6597
|
+
badgeClickBlockRef.current = false;
|
|
6598
|
+
}, 0);
|
|
6599
|
+
}
|
|
6600
|
+
};
|
|
6601
|
+
const resetBadgePos = () => {
|
|
6602
|
+
try {
|
|
6603
|
+
if (typeof localStorage !== "undefined") localStorage.removeItem("dsh-dock/anim/badge-pos/v1");
|
|
6604
|
+
} catch {
|
|
6605
|
+
}
|
|
6606
|
+
badgePosRef.current = null;
|
|
6607
|
+
setBadgePos(null);
|
|
6608
|
+
};
|
|
6609
|
+
const badgeClickTimer = (0, import_react9.useRef)(null);
|
|
6610
|
+
const onBadgeClick = () => {
|
|
6611
|
+
if (badgeClickBlockRef.current) return;
|
|
6612
|
+
if (badgeClickTimer.current) {
|
|
6613
|
+
clearTimeout(badgeClickTimer.current);
|
|
6614
|
+
badgeClickTimer.current = null;
|
|
6615
|
+
resetBadgePos();
|
|
6616
|
+
return;
|
|
6617
|
+
}
|
|
6618
|
+
badgeClickTimer.current = setTimeout(() => {
|
|
6619
|
+
badgeClickTimer.current = null;
|
|
6620
|
+
openPanel("animation");
|
|
6621
|
+
}, 240);
|
|
6622
|
+
};
|
|
6623
|
+
const badgeStyle = badgePos ? Object.assign({}, speedStyle, { "--dkan-phase": phaseColor(waitingTask ? "code" : phase), left: badgePos.x, top: badgePos.y, right: "auto", bottom: "auto" }) : Object.assign({}, speedStyle, { "--dkan-phase": phaseColor(waitingTask ? "code" : phase) });
|
|
6527
6624
|
const onBotResizePointerDown = (e) => {
|
|
6528
6625
|
if (e.button !== 0) return;
|
|
6529
6626
|
e.preventDefault();
|
|
@@ -6635,9 +6732,13 @@ function AnimationOverlay(props) {
|
|
|
6635
6732
|
{
|
|
6636
6733
|
type: "button",
|
|
6637
6734
|
className: "dkan-badge" + (mode === "breathe" ? " dkan-badge-breathe" : ""),
|
|
6638
|
-
style:
|
|
6639
|
-
title: active.length + " \u4E2A\u4EFB\u52A1\u8FDB\u884C\u4E2D \xB7 " + (waitingTask ? waitWord : phaseLabel(phase)) + " \xB7 \u70B9\u51FB\u67E5\u770B\u4EFB\u52A1\u52A8\u753B\u9875",
|
|
6640
|
-
|
|
6735
|
+
style: badgeStyle,
|
|
6736
|
+
title: active.length + " \u4E2A\u4EFB\u52A1\u8FDB\u884C\u4E2D \xB7 " + (waitingTask ? waitWord : phaseLabel(phase)) + " \xB7 \u70B9\u51FB\u67E5\u770B\u4EFB\u52A1\u52A8\u753B\u9875 \xB7 \u53EF\u62D6\u52A8\u5230\u4EFB\u610F\u4F4D\u7F6E\uFF0C\u53CC\u51FB\u590D\u4F4D",
|
|
6737
|
+
onPointerDown: onBadgePointerDown,
|
|
6738
|
+
onPointerMove: onBadgePointerMove,
|
|
6739
|
+
onPointerUp: onBadgePointerUp,
|
|
6740
|
+
onPointerCancel: onBadgePointerUp,
|
|
6741
|
+
onClick: onBadgeClick,
|
|
6641
6742
|
children: [
|
|
6642
6743
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dkan-dotwrap", children: [
|
|
6643
6744
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dkan-dot" }),
|
|
@@ -6960,7 +7061,7 @@ var css2 = [
|
|
|
6960
7061
|
".dkan-fx-confetti i{position:absolute;top:-14px;width:8px;height:13px;border-radius:2px;box-shadow:0 0 4px currentColor;animation:dkan-confetti 2s var(--ds-ease-in-out) forwards;}",
|
|
6961
7062
|
"@keyframes dkan-confetti{0%{opacity:1;transform:translateY(0) rotate(0)}100%{opacity:0;transform:translateY(75vh) translateX(var(--dx)) rotate(var(--r))}}",
|
|
6962
7063
|
// 右下角状态徽标(玻璃拟态,可点击);抬到 dsh 输入卡上方避免重叠错位
|
|
6963
|
-
".dkan-badge{position:fixed;right:20px;bottom:calc(var(--dsh-composer-height,152px) + 20px);z-index:2;display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;cursor:
|
|
7064
|
+
".dkan-badge{position:fixed;right:20px;bottom:calc(var(--dsh-composer-height,152px) + 20px);z-index:2;display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;border:1px solid var(--dsw-alias-border-l1);background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 78%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 6px 24px rgb(0 0 0 / .16);color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;line-height:18px;pointer-events:auto;animation:dkan-rise .3s var(--ds-ease-in-out);transition:color .15s var(--ds-ease-in-out);}",
|
|
6964
7065
|
".dkan-badge:hover{color:var(--dsw-alias-label-primary);}",
|
|
6965
7066
|
".dkan-badge .n{color:var(--dsw-alias-label-primary);font-weight:600;}",
|
|
6966
7067
|
"@keyframes dkan-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}",
|
|
@@ -14551,388 +14652,9 @@ var feature12 = {
|
|
|
14551
14652
|
HomeStat: MobileRelayHomeStat
|
|
14552
14653
|
};
|
|
14553
14654
|
|
|
14554
|
-
// features/mobile/view.js
|
|
14555
|
-
var import_react24 = __toESM(require("react"), 1);
|
|
14556
|
-
var import_react25 = require("react");
|
|
14557
|
-
var MOBILE_QUERY = "(max-width: 767px)";
|
|
14558
|
-
var COARSE_QUERY = "(pointer: coarse) and (hover: none)";
|
|
14559
|
-
function mobileActive() {
|
|
14560
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
|
|
14561
|
-
try {
|
|
14562
|
-
return window.matchMedia(MOBILE_QUERY).matches || window.matchMedia(COARSE_QUERY).matches;
|
|
14563
|
-
} catch {
|
|
14564
|
-
return false;
|
|
14565
|
-
}
|
|
14566
|
-
}
|
|
14567
|
-
var MOBILE_CSS = [
|
|
14568
|
-
"/* \u89E6\u63A7\u4E0E\u8F93\u5165\uFF1A\u7C97\u6307\u9488\u771F\u673A\uFF08\u4E0D\u5206\u5BBD\u5EA6\uFF09 */",
|
|
14569
|
-
"@media (pointer: coarse) and (hover: none){",
|
|
14570
|
-
' body[data-dk-mobile="1"] :is(textarea,input:not([type]),input[type="text"],input[type="search"],input[type="url"],input[type="password"],input[type="number"],input[type="email"],[contenteditable="true"]){font-size:16px !important;}',
|
|
14571
|
-
' body[data-dk-mobile="1"] :is(button,[role="button"]){-webkit-tap-highlight-color:transparent;touch-action:manipulation;}',
|
|
14572
|
-
"}",
|
|
14573
|
-
"@media (max-width:767px){",
|
|
14574
|
-
' body[data-dk-mobile="1"] :is(textarea,input:not([type]),input[type="text"],input[type="search"],input[type="url"],input[type="password"],input[type="number"],input[type="email"],[contenteditable="true"]){font-size:16px !important;}',
|
|
14575
|
-
' body[data-dk-mobile="1"] :is(button,[role="button"]){-webkit-tap-highlight-color:transparent;touch-action:manipulation;}',
|
|
14576
|
-
' body[data-dk-mobile="1"] pre{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}',
|
|
14577
|
-
' body[data-dk-mobile="1"] code{overflow-wrap:anywhere;}',
|
|
14578
|
-
' body[data-dk-mobile="1"] pre code{overflow-wrap:normal;}',
|
|
14579
|
-
' body[data-dk-mobile="1"] .dockchip-row{display:none;}',
|
|
14580
|
-
' body[data-dk-mobile="1"] [data-sidebar-opener]{position:relative;}',
|
|
14581
|
-
' body[data-dk-mobile="1"] [data-sidebar-opener]::after{content:"";position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%);}',
|
|
14582
|
-
' body[data-dk-mobile="1"] [role="dialog"][class*="panel"] [class*="options"]{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));}',
|
|
14583
|
-
' body[data-dk-mobile="1"] [class*="scrollBody"]{padding-bottom:env(safe-area-inset-bottom,0px) !important;}',
|
|
14584
|
-
" /* \u529F\u80FD\u575E\u9762\u677F\uFF08.dockm-*\uFF09\u6302\u5728 .overlayLayer(z20) \u5185\uFF0C\u800C\u624B\u673A\u62BD\u5C49 .sidebarCol \u662F z71\u2014\u2014\u9762\u677F\u867D\u662F\u5168\u5C4F\u5374\u88AB\u62BD\u5C49\u76D6\u4F4F\u3002\u628A overlayLayer \u62AC\u5230\u62BD\u5C49\u4E4B\u4E0A\uFF0C\u529F\u80FD\u575E/\u5168\u5C40\u6D6E\u5C42\u624D\u80FD\u5168\u5C4F\u76D6\u4F4F\u62BD\u5C49\u3002 */",
|
|
14585
|
-
' body[data-dk-mobile="1"] [class*="overlayLayer"]{z-index:100 !important;}',
|
|
14586
|
-
' body[data-dk-mobile="1"] [role="dialog"][class*="panel"][data-dsh-mobile-stack]{display:flex !important;flex-direction:column !important;width:100vw !important;max-width:100vw !important;height:100dvh !important;max-height:none !important;border-radius:0 !important;overflow:hidden !important;}',
|
|
14587
|
-
' body[data-dk-mobile="1"] [role="dialog"][class*="panel"][data-dsh-mobile-stack] > [class*="header"]{order:0;flex:none;width:auto !important;height:auto !important;padding:8px 12px !important;justify-content:flex-end !important;}',
|
|
14588
|
-
' body[data-dk-mobile="1"] [role="dialog"][class*="panel"][data-dsh-mobile-stack] > [class*="navTitle"]{order:1;flex:none;width:auto !important;padding:2px 16px 8px !important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}',
|
|
14589
|
-
' body[data-dk-mobile="1"] [role="dialog"][class*="panel"][data-dsh-mobile-stack] > nav{order:2;flex:none;width:auto !important;height:auto !important;padding:0 8px 8px !important;overflow-x:auto;overflow-y:hidden;}',
|
|
14590
|
-
' body[data-dk-mobile="1"] [role="dialog"][class*="panel"][data-dsh-mobile-stack] > nav [class*="navList"]{flex-direction:row !important;}',
|
|
14591
|
-
' body[data-dk-mobile="1"] [role="dialog"][class*="panel"][data-dsh-mobile-stack] > [class*="options"]{order:3;flex:1 1 auto !important;min-height:0 !important;width:auto !important;overflow-y:auto !important;padding-bottom:max(16px,env(safe-area-inset-bottom,0px)) !important;}',
|
|
14592
|
-
' body[data-dk-mobile="1"][data-dsh-mobile-legacy] [class$="frame"]{grid-template-columns:0px minmax(0,1fr) 0px !important;}',
|
|
14593
|
-
' body[data-dk-mobile="1"][data-dsh-mobile-legacy] [class$="frame"] [class*="sidebarCol"]{position:fixed !important;top:0 !important;bottom:0 !important;left:0 !important;width:min(86vw,300px) !important;z-index:80 !important;box-shadow:0 12px 48px rgba(0,0,0,.45);transform:none !important;visibility:visible !important;transition:transform .22s ease !important;}',
|
|
14594
|
-
' body[data-dk-mobile="1"][data-dsh-mobile-legacy] [class$="frame"][data-sidebar-collapsed] [class*="sidebarCol"]{transform:translateX(-105%) !important;visibility:hidden !important;transition:transform .22s ease, visibility 0s linear .22s !important;}',
|
|
14595
|
-
' body[data-dk-mobile="1"] .dsh-mobile-scrim{position:fixed;inset:0;z-index:75;background:rgba(8,10,14,.45);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);touch-action:none;}',
|
|
14596
|
-
' body[data-dk-mobile="1"] .dsh-mobile-burger{position:fixed;left:calc(4px + env(safe-area-inset-left,0px));top:calc(4px + env(safe-area-inset-top,0px));z-index:66;box-sizing:border-box;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary,#e6eaf2);-webkit-tap-highlight-color:transparent;touch-action:manipulation;}',
|
|
14597
|
-
' body[data-dk-mobile="1"] .dsh-mobile-burger svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;}',
|
|
14598
|
-
' body[data-dk-mobile="1"] .dsh-mobile-burger:active{background:color-mix(in srgb,currentColor 12%,transparent);}',
|
|
14599
|
-
' body[data-dk-mobile="1"][data-dsh-mobile-legacy] [class$="frame"] header:has([class*="titleRow"]){padding-left:calc(48px + env(safe-area-inset-left,0px));}',
|
|
14600
|
-
' html.dsh-dock-kbd body[data-dk-mobile="1"] .dsh-mobile-burger{display:none !important;}',
|
|
14601
|
-
"}"
|
|
14602
|
-
].join("\n");
|
|
14603
|
-
var STYLE_ATTR = "data-dsh-mobile-runtime";
|
|
14604
|
-
var BODY_ATTR = "data-dk-mobile";
|
|
14605
|
-
var LEGACY_ATTR = "data-dsh-mobile-legacy";
|
|
14606
|
-
var currentDispose = null;
|
|
14607
|
-
function applyRuntime() {
|
|
14608
|
-
if (typeof window === "undefined" || typeof document === "undefined") return function() {
|
|
14609
|
-
};
|
|
14610
|
-
const doc = document;
|
|
14611
|
-
const body = doc.body;
|
|
14612
|
-
if (!body) return function() {
|
|
14613
|
-
};
|
|
14614
|
-
if (currentDispose) {
|
|
14615
|
-
try {
|
|
14616
|
-
currentDispose();
|
|
14617
|
-
} catch (e) {
|
|
14618
|
-
}
|
|
14619
|
-
currentDispose = null;
|
|
14620
|
-
}
|
|
14621
|
-
body.setAttribute(BODY_ATTR, "1");
|
|
14622
|
-
let styleEl = doc.querySelector("style[" + STYLE_ATTR + "]");
|
|
14623
|
-
if (!styleEl) {
|
|
14624
|
-
styleEl = doc.createElement("style");
|
|
14625
|
-
styleEl.setAttribute(STYLE_ATTR, "");
|
|
14626
|
-
styleEl.textContent = MOBILE_CSS;
|
|
14627
|
-
doc.head.appendChild(styleEl);
|
|
14628
|
-
}
|
|
14629
|
-
const mql = window.matchMedia ? window.matchMedia(MOBILE_QUERY) : null;
|
|
14630
|
-
const vv = window.visualViewport || null;
|
|
14631
|
-
const phone = function() {
|
|
14632
|
-
return !!(mql && mql.matches);
|
|
14633
|
-
};
|
|
14634
|
-
const frame = function() {
|
|
14635
|
-
return doc.querySelector('[class$="frame"]');
|
|
14636
|
-
};
|
|
14637
|
-
const isCollapsed = function() {
|
|
14638
|
-
const f = frame();
|
|
14639
|
-
return !!(f && f.hasAttribute("data-sidebar-collapsed"));
|
|
14640
|
-
};
|
|
14641
|
-
let scrim = null;
|
|
14642
|
-
let burger = null;
|
|
14643
|
-
let observer = null;
|
|
14644
|
-
let timer = 0;
|
|
14645
|
-
function sidebarOpenToggle() {
|
|
14646
|
-
const b = doc.querySelector("[data-sidebar-opener]") || doc.querySelector("[data-sidebar-toggle]");
|
|
14647
|
-
if (b && typeof b.click === "function") b.click();
|
|
14648
|
-
}
|
|
14649
|
-
function clearStack() {
|
|
14650
|
-
const panels = doc.querySelectorAll('[role="dialog"][class*="panel"][data-dsh-mobile-stack]');
|
|
14651
|
-
for (let i = 0; i < panels.length; i++) panels[i].removeAttribute("data-dsh-mobile-stack");
|
|
14652
|
-
}
|
|
14653
|
-
function dialogStackSync() {
|
|
14654
|
-
const panel = doc.querySelector('[role="dialog"][class*="panel"]');
|
|
14655
|
-
if (!panel) return;
|
|
14656
|
-
let nav = null;
|
|
14657
|
-
let opt = null;
|
|
14658
|
-
const kids = panel.children;
|
|
14659
|
-
for (let i = 0; i < kids.length; i++) {
|
|
14660
|
-
const k = kids[i];
|
|
14661
|
-
if (!nav && k.tagName === "NAV") nav = k;
|
|
14662
|
-
if (!opt && k.className && String(k.className).indexOf("options") >= 0) opt = k;
|
|
14663
|
-
}
|
|
14664
|
-
if (!nav || !opt) {
|
|
14665
|
-
panel.removeAttribute("data-dsh-mobile-stack");
|
|
14666
|
-
return;
|
|
14667
|
-
}
|
|
14668
|
-
const a = nav.getBoundingClientRect();
|
|
14669
|
-
const b = opt.getBoundingClientRect();
|
|
14670
|
-
if (!a.width || !b.width) return;
|
|
14671
|
-
const sideBySide = b.left >= a.right - 8 && b.top < a.bottom - 4 && b.bottom > a.top + 4;
|
|
14672
|
-
if (sideBySide) panel.setAttribute("data-dsh-mobile-stack", "1");
|
|
14673
|
-
else panel.removeAttribute("data-dsh-mobile-stack");
|
|
14674
|
-
}
|
|
14675
|
-
function removeChrome() {
|
|
14676
|
-
if (scrim) {
|
|
14677
|
-
scrim.remove();
|
|
14678
|
-
scrim = null;
|
|
14679
|
-
}
|
|
14680
|
-
if (burger) {
|
|
14681
|
-
burger.remove();
|
|
14682
|
-
burger = null;
|
|
14683
|
-
}
|
|
14684
|
-
body.removeAttribute(LEGACY_ATTR);
|
|
14685
|
-
}
|
|
14686
|
-
function ensureChrome() {
|
|
14687
|
-
if (!scrim) {
|
|
14688
|
-
scrim = doc.createElement("div");
|
|
14689
|
-
scrim.className = "dsh-mobile-scrim";
|
|
14690
|
-
scrim.style.display = "none";
|
|
14691
|
-
scrim.addEventListener("click", function() {
|
|
14692
|
-
if (!isCollapsed()) sidebarOpenToggle();
|
|
14693
|
-
});
|
|
14694
|
-
body.appendChild(scrim);
|
|
14695
|
-
}
|
|
14696
|
-
if (!burger) {
|
|
14697
|
-
burger = doc.createElement("button");
|
|
14698
|
-
burger.type = "button";
|
|
14699
|
-
burger.className = "dsh-mobile-burger";
|
|
14700
|
-
burger.setAttribute("aria-label", "\u6253\u5F00\u4F1A\u8BDD\u5217\u8868");
|
|
14701
|
-
burger.setAttribute("aria-expanded", "false");
|
|
14702
|
-
burger.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h16"/><path d="M4 12h16"/><path d="M4 17h16"/></svg>';
|
|
14703
|
-
burger.addEventListener("click", function() {
|
|
14704
|
-
sidebarOpenToggle();
|
|
14705
|
-
});
|
|
14706
|
-
body.appendChild(burger);
|
|
14707
|
-
}
|
|
14708
|
-
}
|
|
14709
|
-
function legacySync() {
|
|
14710
|
-
const f = frame();
|
|
14711
|
-
const legacy = !!f && phone() && !f.hasAttribute("data-sidebar-drawer");
|
|
14712
|
-
if (!legacy) {
|
|
14713
|
-
removeChrome();
|
|
14714
|
-
return;
|
|
14715
|
-
}
|
|
14716
|
-
body.setAttribute(LEGACY_ATTR, "1");
|
|
14717
|
-
ensureChrome();
|
|
14718
|
-
const collapsed = isCollapsed();
|
|
14719
|
-
if (scrim) scrim.style.display = collapsed ? "none" : "";
|
|
14720
|
-
if (burger) {
|
|
14721
|
-
burger.style.display = "";
|
|
14722
|
-
burger.setAttribute("aria-expanded", collapsed ? "false" : "true");
|
|
14723
|
-
}
|
|
14724
|
-
}
|
|
14725
|
-
function kbdSync() {
|
|
14726
|
-
if (!vv) return;
|
|
14727
|
-
const kbd = vv.height > 0 && window.innerHeight - vv.height > 120;
|
|
14728
|
-
const de = doc.documentElement;
|
|
14729
|
-
if (kbd) de.classList.add("dsh-dock-kbd");
|
|
14730
|
-
else de.classList.remove("dsh-dock-kbd");
|
|
14731
|
-
}
|
|
14732
|
-
let dockAutoClosed = false;
|
|
14733
|
-
function dockOpen() {
|
|
14734
|
-
return !!doc.querySelector(".dockm-dialog");
|
|
14735
|
-
}
|
|
14736
|
-
function tick() {
|
|
14737
|
-
try {
|
|
14738
|
-
kbdSync();
|
|
14739
|
-
if (phone()) {
|
|
14740
|
-
const dopen = dockOpen();
|
|
14741
|
-
if (dopen && !isCollapsed() && !dockAutoClosed) {
|
|
14742
|
-
dockAutoClosed = true;
|
|
14743
|
-
sidebarOpenToggle();
|
|
14744
|
-
}
|
|
14745
|
-
if (!dopen) dockAutoClosed = false;
|
|
14746
|
-
dialogStackSync();
|
|
14747
|
-
legacySync();
|
|
14748
|
-
} else {
|
|
14749
|
-
clearStack();
|
|
14750
|
-
removeChrome();
|
|
14751
|
-
dockAutoClosed = false;
|
|
14752
|
-
}
|
|
14753
|
-
} catch (e) {
|
|
14754
|
-
}
|
|
14755
|
-
}
|
|
14756
|
-
tick();
|
|
14757
|
-
if (typeof MutationObserver !== "undefined") {
|
|
14758
|
-
observer = new MutationObserver(function() {
|
|
14759
|
-
tick();
|
|
14760
|
-
});
|
|
14761
|
-
try {
|
|
14762
|
-
observer.observe(doc.documentElement, { attributes: true, attributeFilter: ["data-sidebar-collapsed", "data-sidebar-drawer"], subtree: true });
|
|
14763
|
-
observer.observe(body, { childList: true, subtree: true });
|
|
14764
|
-
} catch (e) {
|
|
14765
|
-
}
|
|
14766
|
-
}
|
|
14767
|
-
timer = window.setInterval(tick, 1200);
|
|
14768
|
-
const onResize = function() {
|
|
14769
|
-
tick();
|
|
14770
|
-
};
|
|
14771
|
-
window.addEventListener("resize", onResize);
|
|
14772
|
-
if (vv && vv.addEventListener) vv.addEventListener("resize", kbdSync);
|
|
14773
|
-
if (mql && mql.addEventListener) mql.addEventListener("change", tick);
|
|
14774
|
-
else if (mql && mql.addListener) mql.addListener(tick);
|
|
14775
|
-
const dispose = function() {
|
|
14776
|
-
if (currentDispose === dispose) currentDispose = null;
|
|
14777
|
-
try {
|
|
14778
|
-
if (observer) observer.disconnect();
|
|
14779
|
-
} catch (e) {
|
|
14780
|
-
}
|
|
14781
|
-
if (timer) window.clearInterval(timer);
|
|
14782
|
-
window.removeEventListener("resize", onResize);
|
|
14783
|
-
if (vv && vv.removeEventListener) vv.removeEventListener("resize", kbdSync);
|
|
14784
|
-
if (mql && mql.removeEventListener) mql.removeEventListener("change", tick);
|
|
14785
|
-
else if (mql && mql.removeListener) mql.removeListener(tick);
|
|
14786
|
-
try {
|
|
14787
|
-
doc.documentElement.classList.remove("dsh-dock-kbd");
|
|
14788
|
-
} catch (e) {
|
|
14789
|
-
}
|
|
14790
|
-
try {
|
|
14791
|
-
clearStack();
|
|
14792
|
-
} catch (e) {
|
|
14793
|
-
}
|
|
14794
|
-
removeChrome();
|
|
14795
|
-
try {
|
|
14796
|
-
body.removeAttribute(BODY_ATTR);
|
|
14797
|
-
} catch (e) {
|
|
14798
|
-
}
|
|
14799
|
-
try {
|
|
14800
|
-
if (styleEl && styleEl.parentNode) styleEl.parentNode.removeChild(styleEl);
|
|
14801
|
-
} catch (e) {
|
|
14802
|
-
}
|
|
14803
|
-
};
|
|
14804
|
-
currentDispose = dispose;
|
|
14805
|
-
return dispose;
|
|
14806
|
-
}
|
|
14807
|
-
function MobileOverlay() {
|
|
14808
|
-
const [active, setActive] = (0, import_react25.useState)(function() {
|
|
14809
|
-
return mobileActive();
|
|
14810
|
-
});
|
|
14811
|
-
(0, import_react25.useEffect)(function() {
|
|
14812
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return void 0;
|
|
14813
|
-
let mqs = [];
|
|
14814
|
-
try {
|
|
14815
|
-
mqs = [window.matchMedia(MOBILE_QUERY), window.matchMedia(COARSE_QUERY)];
|
|
14816
|
-
} catch (e) {
|
|
14817
|
-
return void 0;
|
|
14818
|
-
}
|
|
14819
|
-
const update = function() {
|
|
14820
|
-
setActive(mqs.some(function(m) {
|
|
14821
|
-
return m.matches;
|
|
14822
|
-
}));
|
|
14823
|
-
};
|
|
14824
|
-
update();
|
|
14825
|
-
for (let i = 0; i < mqs.length; i++) {
|
|
14826
|
-
const m = mqs[i];
|
|
14827
|
-
if (m.addEventListener) m.addEventListener("change", update);
|
|
14828
|
-
else if (m.addListener) m.addListener(update);
|
|
14829
|
-
}
|
|
14830
|
-
return function() {
|
|
14831
|
-
for (let i = 0; i < mqs.length; i++) {
|
|
14832
|
-
const m = mqs[i];
|
|
14833
|
-
if (m.removeEventListener) m.removeEventListener("change", update);
|
|
14834
|
-
else if (m.removeListener) m.removeListener(update);
|
|
14835
|
-
}
|
|
14836
|
-
};
|
|
14837
|
-
}, []);
|
|
14838
|
-
(0, import_react25.useEffect)(function() {
|
|
14839
|
-
if (!active) return void 0;
|
|
14840
|
-
return applyRuntime();
|
|
14841
|
-
}, [active]);
|
|
14842
|
-
return null;
|
|
14843
|
-
}
|
|
14844
|
-
function useViewport() {
|
|
14845
|
-
const [size, setSize] = (0, import_react25.useState)(function() {
|
|
14846
|
-
return typeof window === "undefined" ? null : { w: window.innerWidth, h: window.innerHeight };
|
|
14847
|
-
});
|
|
14848
|
-
(0, import_react25.useEffect)(function() {
|
|
14849
|
-
if (typeof window === "undefined") return void 0;
|
|
14850
|
-
const update = function() {
|
|
14851
|
-
setSize({ w: window.innerWidth, h: window.innerHeight });
|
|
14852
|
-
};
|
|
14853
|
-
window.addEventListener("resize", update);
|
|
14854
|
-
return function() {
|
|
14855
|
-
window.removeEventListener("resize", update);
|
|
14856
|
-
};
|
|
14857
|
-
}, []);
|
|
14858
|
-
return size;
|
|
14859
|
-
}
|
|
14860
|
-
function MobileView() {
|
|
14861
|
-
const size = useViewport();
|
|
14862
|
-
const [active, setActive] = (0, import_react25.useState)(function() {
|
|
14863
|
-
return mobileActive();
|
|
14864
|
-
});
|
|
14865
|
-
const [drawer, setDrawer] = (0, import_react25.useState)(false);
|
|
14866
|
-
(0, import_react25.useEffect)(function() {
|
|
14867
|
-
if (typeof window === "undefined") return void 0;
|
|
14868
|
-
const tick = function() {
|
|
14869
|
-
setActive(mobileActive());
|
|
14870
|
-
const f = document.querySelector('[class$="frame"]');
|
|
14871
|
-
setDrawer(!!(f && f.hasAttribute("data-sidebar-drawer")));
|
|
14872
|
-
};
|
|
14873
|
-
tick();
|
|
14874
|
-
const t = setInterval(tick, 1e3);
|
|
14875
|
-
return function() {
|
|
14876
|
-
clearInterval(t);
|
|
14877
|
-
};
|
|
14878
|
-
}, []);
|
|
14879
|
-
const mode = !active ? "\u672A\u547D\u4E2D" : window.matchMedia && window.matchMedia(MOBILE_QUERY).matches ? drawer ? "\u62BD\u5C49\u6A21\u5F0F\uFF08\u539F\u751F\uFF09" : "\u65E7\u7248\u515C\u5E95\uFF08\u6D6E\u5C42\u62BD\u5C49\uFF09" : "\u4EC5\u89E6\u63A7\u4F18\u5316";
|
|
14880
|
-
return import_react24.default.createElement(
|
|
14881
|
-
"div",
|
|
14882
|
-
{ className: "dkmob-root" },
|
|
14883
|
-
import_react24.default.createElement(
|
|
14884
|
-
"div",
|
|
14885
|
-
{ className: "dkmob-row" },
|
|
14886
|
-
import_react24.default.createElement("span", { className: "dkmob-label" }, "\u624B\u673A\u6A21\u5F0F"),
|
|
14887
|
-
import_react24.default.createElement("span", { className: "dkmob-state" + (active ? " on" : "") }, active ? "\u5DF2\u547D\u4E2D" : "\u672A\u547D\u4E2D"),
|
|
14888
|
-
import_react24.default.createElement("span", { className: "dkmob-dim" }, size ? size.w + "\xD7" + size.h + "px" : "")
|
|
14889
|
-
),
|
|
14890
|
-
import_react24.default.createElement(
|
|
14891
|
-
"div",
|
|
14892
|
-
{ className: "dkmob-row" },
|
|
14893
|
-
import_react24.default.createElement("span", { className: "dkmob-label" }, "\u5F53\u524D\u5F62\u6001"),
|
|
14894
|
-
import_react24.default.createElement("span", { className: "dkmob-state" + (active ? " on" : "") }, mode)
|
|
14895
|
-
),
|
|
14896
|
-
import_react24.default.createElement(
|
|
14897
|
-
"div",
|
|
14898
|
-
{ className: "dkmob-note" },
|
|
14899
|
-
"\u751F\u6548\u4E2D\u7684\u4F18\u5316\uFF1A\u8F93\u5165\u7C7B\u63A7\u4EF6\u5B57\u53F7 16px\uFF08\u9632 iOS \u805A\u7126\u6574\u9875\u7F29\u653E\uFF09\xB7 \u539F\u751F\u4FA7\u680F\u5F00\u5173\u70ED\u533A\u6269\u5230 44\xD744 \xB7 ",
|
|
14900
|
-
"\u53BB\u70B9\u6309\u9AD8\u4EAE\u4E0E\u53CC\u51FB\u7F29\u653E\u5224\u5B9A \xB7 \u4EE3\u7801\u5757\u6A2A\u5411\u6EDA\u52A8 / \u884C\u5185\u4EE3\u7801\u6362\u884C \xB7 \u4F1A\u8BDD\u8F93\u5165\u884C\u7684\u4F59\u989D/\u7528\u91CF chip \u6536\u8D77 \xB7 ",
|
|
14901
|
-
"\u8BBE\u7F6E\u5F39\u5C42\u5185\u5BB9\u5B89\u5168\u533A\u5185\u8FB9\u8DDD\u3002\u65E7\u7248 dsh\uFF08<768 \u4ECD\u662F\u4E24\u680F\u5F39\u5C42\u6216\u9759\u6001\u56FE\u6807\u8F68\u9053\uFF09\u4F1A\u81EA\u52A8\u515C\u5E95\u4E3A\u5355\u5217 / \u6D6E\u5C42\u62BD\u5C49\u3002",
|
|
14902
|
-
"\u5173\u95ED\u672C\u529F\u80FD\u5373\u5168\u90E8\u8FD8\u539F\u2014\u2014\u8FD0\u884C\u65F6\u6837\u5F0F\u3001body \u5C5E\u6027\u3001\u906E\u7F69/\u6309\u94AE\u4E0E\u6240\u6709\u76D1\u542C\u5668\u4E00\u5E76\u79FB\u9664\uFF0C\u9875\u9762\u4E0D\u6B8B\u7559\u4EFB\u4F55\u6CE8\u5165\u3002"
|
|
14903
|
-
)
|
|
14904
|
-
);
|
|
14905
|
-
}
|
|
14906
|
-
function MobileStat() {
|
|
14907
|
-
const active = mobileActive();
|
|
14908
|
-
if (!active) return import_react24.default.createElement("span", null, "\u5F53\u524D\u89C6\u53E3\u672A\u547D\u4E2D\u624B\u673A\u5F62\u6001\uFF0C\u672A\u542F\u7528\u4EFB\u4F55\u4F18\u5316");
|
|
14909
|
-
return import_react24.default.createElement("span", null, "\u624B\u673A\u6A21\u5F0F\u751F\u6548\u4E2D\uFF0816px \u8F93\u5165 / \u89E6\u63A7\u70ED\u533A / \u4EE3\u7801\u6EDA\u52A8 / \u5F39\u5C42\u515C\u5E95\uFF09");
|
|
14910
|
-
}
|
|
14911
|
-
var css6 = [
|
|
14912
|
-
".dkmob-root{display:flex;flex-direction:column;gap:10px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:1.6;}",
|
|
14913
|
-
".dkmob-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}",
|
|
14914
|
-
".dkmob-label{font-weight:600;flex:none;}",
|
|
14915
|
-
".dkmob-state{flex:none;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-tertiary);border-radius:999px;padding:1px 10px;font-size:11px;}",
|
|
14916
|
-
".dkmob-state.on{color:var(--dsw-alias-state-success-primary);border-color:var(--dsw-alias-state-success-primary);}",
|
|
14917
|
-
".dkmob-dim{color:var(--dsw-alias-label-secondary);font-size:12px;}",
|
|
14918
|
-
".dkmob-note{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.7;border-top:1px solid var(--dsw-alias-border-l1);padding-top:10px;}"
|
|
14919
|
-
].join("\n");
|
|
14920
|
-
var feature13 = {
|
|
14921
|
-
id: "mobile",
|
|
14922
|
-
name: "\u624B\u673A\u9002\u914D",
|
|
14923
|
-
order: 170,
|
|
14924
|
-
accent: "#34d399",
|
|
14925
|
-
description: "\u624B\u673A/\u7A84\u5C4F\u4F53\u9A8C\u4F18\u5316\uFF1A16px \u8F93\u5165\u9632\u7F29\u653E\u3001\u89E6\u63A7\u70ED\u533A\u3001\u4EE3\u7801\u5757\u6EDA\u52A8\u3001\u4F1A\u8BDD chip \u6536\u8D77\u3001\u8BBE\u7F6E\u5F39\u5C42\u5355\u5217\u4E0E\u65E7\u7248\u62BD\u5C49\u515C\u5E95\uFF1B\u5173\u95ED\u540E\u96F6\u6B8B\u7559",
|
|
14926
|
-
defaultEnabled: false,
|
|
14927
|
-
css: css6,
|
|
14928
|
-
Overlay: MobileOverlay,
|
|
14929
|
-
View: MobileView,
|
|
14930
|
-
HomeStat: MobileStat
|
|
14931
|
-
};
|
|
14932
|
-
|
|
14933
14655
|
// src/client.jsx
|
|
14934
|
-
var DOCK_VERSION = "0.21.
|
|
14935
|
-
var BUILTIN_FEATURES = [feature, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature11, feature12
|
|
14656
|
+
var DOCK_VERSION = "0.21.2";
|
|
14657
|
+
var BUILTIN_FEATURES = [feature, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature11, feature12];
|
|
14936
14658
|
var PLANNED_FEATURES = [];
|
|
14937
14659
|
var PLANNED_NOTES = {};
|
|
14938
14660
|
var externalDefs = [];
|
|
@@ -15046,8 +14768,15 @@ var SHELL_CSS = [
|
|
|
15046
14768
|
".dockm-name{display:flex;align-items:center;gap:8px;font-weight:600;font-size:15px;}",
|
|
15047
14769
|
".dockm-desc{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.6;}",
|
|
15048
14770
|
".dockm-view{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:10px;}",
|
|
15049
|
-
".dockm-page{box-sizing:border-box;height:100%;overflow:
|
|
15050
|
-
".dockm-page-head{display:flex;align-items:flex-start;gap:10px;
|
|
14771
|
+
".dockm-page{box-sizing:border-box;height:100%;display:flex;flex-direction:column;overflow:hidden;padding:16px 20px 0;}",
|
|
14772
|
+
".dockm-page-head{flex:none;display:flex;align-items:flex-start;gap:10px;padding-bottom:12px;border-bottom:1px solid var(--dsw-alias-border-l1);}",
|
|
14773
|
+
".dockm-page-body{flex:1;min-height:0;display:flex;}",
|
|
14774
|
+
".dockm-page-wide-btn{flex:none;margin-left:auto;display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 10px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;cursor:pointer;}",
|
|
14775
|
+
".dockm-page-wide-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
|
|
14776
|
+
/* 面板页的左侧菜单收窄:给右侧列表/表格让出宽度,别留大片空白 */
|
|
14777
|
+
".dockm-page .dockm-nav{width:140px;padding:8px 6px;}",
|
|
14778
|
+
".dockm-page .dockm-nav-item{padding:7px 8px;font-size:12.5px;gap:6px;}",
|
|
14779
|
+
".dockm-page-body>.dockm-body{flex:1;min-height:0;}",
|
|
15051
14780
|
".dockm-page-icon{flex:none;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:10px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);}",
|
|
15052
14781
|
".dockm-page-titles{min-width:0;}",
|
|
15053
14782
|
".dockm-page-title{font-size:17px;font-weight:600;color:var(--dsw-alias-label-primary);line-height:1.3;}",
|
|
@@ -15085,9 +14814,17 @@ var SHELL_CSS = [
|
|
|
15085
14814
|
// 禁用桌面拖拽/缩放,所有导航和关闭动作保持至少 44px 的可点击面积。
|
|
15086
14815
|
"@media (max-width:680px){.dockm-backdrop{align-items:stretch;justify-content:stretch;background:var(--dsw-alias-bg-layer-2);backdrop-filter:none}.dockm-dialog,.dockm-dialog.dockm-max{position:fixed!important;left:0!important;top:0!important;right:auto!important;bottom:auto!important;width:100dvw!important;height:100dvh!important;min-height:100dvh;border:0;border-radius:0;box-shadow:none}.dockm-dialog.dockm-min .dockm-body{display:flex}.dockm-head{min-height:60px;box-sizing:border-box;padding:calc(env(safe-area-inset-top) + 8px) 12px 8px;cursor:default;touch-action:manipulation}.dockm-sub,.dockm-win,.dockm-resize{display:none}.dockm-title{font-size:16px}.dockm-close{width:44px;height:44px;font-size:17px}.dockm-body{flex-direction:column;min-height:0}.dockm-nav{box-sizing:border-box;width:auto;max-width:100%;min-height:56px;flex-direction:row;gap:6px;padding:6px 10px;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--dsw-alias-border-l1);scrollbar-width:none;overscroll-behavior-x:contain}.dockm-nav::-webkit-scrollbar{display:none}.dockm-nav-item{flex:none;min-height:44px;padding:0 12px;font-size:13px;touch-action:manipulation}.dockm-nav-item .dockm-badge{display:none}.dockm-content{padding:16px max(16px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));gap:14px;overscroll-behavior:contain}.dockm-content-head{gap:5px}.dockm-name{font-size:16px}.dockm-desc{font-size:13px;line-height:1.55}.dockm-foot{padding-top:12px;font-size:11px}.dockm-foot-sw{width:100%;margin-left:0;justify-content:space-between}.dock-sw{width:44px;height:26px}.dock-sw::after{top:3px;left:3px;width:18px;height:18px}.dock-sw.on::after{transform:translateX(18px)}.dockh-grid{grid-template-columns:minmax(0,1fr);gap:10px;min-width:0}.dockh-card{padding:12px;box-sizing:border-box;min-width:0}.dockh-desc{font-size:13px}.dockh-go{font-size:12px}}",
|
|
15087
14816
|
/* 手机端:功能坞弹层挂在 .overlayLayer(z20) 内,会被 z71 的侧栏抽屉盖住(只剩右侧一条)。\n 把 overlayLayer 在窄屏抬到抽屉之上,面板才能全屏覆盖——且不依赖【手机适配】模块是否启用。 */
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
14817
|
+
/* 只在「功能坞弹层真的打开」时抬 z 序(:has 精确到 .dockm-dialog),其余时候不碰 DSH 原生浮层 */
|
|
14818
|
+
'@media (max-width:767px){body:has(.dockm-dialog) [class*="overlayLayer"]{z-index:100 !important}}',
|
|
14819
|
+
/* 手机:功能坞面板页的左侧菜单改成横向可滚动条,占满整行;页头与内边距收紧,「全屏」按钮在手机上无意义(侧栏本就是抽屉)故隐藏 */
|
|
14820
|
+
"@media (max-width:767px){.dockm-page{padding:12px 12px 0}.dockm-page-head{gap:8px;padding-bottom:10px}.dockm-page-sub{display:none}.dockm-page-wide-btn{display:none}.dockm-page .dockm-nav{width:auto;max-width:100%;flex-direction:row;gap:6px;padding:8px 0;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--dsw-alias-border-l1);scrollbar-width:none}.dockm-page .dockm-nav::-webkit-scrollbar{display:none}.dockm-page .dockm-nav-item{flex:none;min-height:40px;padding:0 10px;font-size:12.5px}.dockm-page .dockm-page-body{flex-direction:column}.dockm-page .dockm-body{flex-direction:column;min-height:0}.dockm-page .dockm-content{padding:12px 0 16px;gap:12px}}",
|
|
14821
|
+
/* 手机自适应(≤767px,始终生效,不依赖任何功能开关):
|
|
14822
|
+
· 输入卡贴底(空会话时不再垂直居中留大片空白);
|
|
14823
|
+
· 输入卡里的「轮/步/token/缓存」状态条移到输入框上方,压成一行不溢出。 */
|
|
14824
|
+
'@media (max-width:767px){[class*="scrollBody"]>[class*="composerSeat"]{margin-top:auto!important;padding-bottom:0!important}[class*="composerSeat"] [class*="_dock"]{order:-1!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding:0 2px 6px!important;gap:6px!important;font-size:10px!important;overflow:hidden!important;flex-wrap:nowrap!important;white-space:nowrap!important}[class*="composerSeat"] [class*="_dock"]>*{min-width:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[class*="composerSeat"] [class*="_dock"]>*:first-child{flex:0 0 auto}[class*="composerSeat"] [class*="_row"]{gap:4px!important}}',
|
|
14825
|
+
/* 手机自适应:设置弹层内容给安全区内边距、会话滚动体留底部安全区、代码块横向滚动、
|
|
14826
|
+
行内代码可断行(窄屏不撑破版面)。 */
|
|
14827
|
+
'@media (max-width:767px){[role="dialog"][class*="panel"] [class*="options"]{padding-left:max(16px,env(safe-area-inset-left,0px))!important;padding-right:max(16px,env(safe-area-inset-right,0px))!important}[class*="scrollBody"]{padding-bottom:env(safe-area-inset-bottom,0px)!important}pre{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}code{overflow-wrap:anywhere}pre code{overflow-wrap:normal}}',
|
|
15091
14828
|
"@media (prefers-reduced-motion:reduce){.dockm-backdrop,.dockm-dialog{animation:none}.dockm-nav-item,.dockm-close,.dockm-win,.dock-sw{transition:none}}",
|
|
15092
14829
|
".dockh-desc{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.5;}",
|
|
15093
14830
|
".dockh-stat{color:var(--dsw-alias-label-tertiary);font-size:12px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
|
|
@@ -15114,8 +14851,15 @@ var SHELL_CSS = [
|
|
|
15114
14851
|
".dockchip:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
|
|
15115
14852
|
".dockchip .dockchip-dot{width:6px;height:6px;border-radius:50%;flex:none;}",
|
|
15116
14853
|
".dockchip.err{color:var(--dsw-alias-state-error-primary);}",
|
|
15117
|
-
/*
|
|
15118
|
-
|
|
14854
|
+
/* 手机自适应:输入区工具行很窄——chip 字号/内距收紧、隐藏费用后缀与「余额」前缀,
|
|
14855
|
+
数值完整显示且工具行保持单行不换行(完整信息仍在 title 悬浮提示里)。 */
|
|
14856
|
+
".dockchip-pre-s{display:none;}",
|
|
14857
|
+
".dockchip-svg{display:none;align-items:center;justify-content:center;}",
|
|
14858
|
+
/* 手机端:输入区工具行太窄,余额/用量只留两枚小图标(点进功能坞看具体数据),
|
|
14859
|
+
文本与圆点全部隐藏,图标做成 24×24 的稳定触控块 → 工具行必定单行。 */
|
|
14860
|
+
"@media (max-width:767px){.dockchip-row{max-width:min(92px,20cqw);gap:2px}.dockchip-svg{display:inline-flex}.dockchip-val,.dockchip-pre,.dockchip-pre-s,.dockchip-ic,.dockchip-x,.dockchip .dockchip-dot{display:none}.dockchip{width:24px;height:24px;box-sizing:border-box;justify-content:center;padding:0!important;gap:0!important;border-radius:6px}}",
|
|
14861
|
+
/* 手机触控基础:去点按蓝块、消双击缩放判定延迟;原生侧栏开关热区扩到 44×44(视觉不变)。 */
|
|
14862
|
+
`@media (max-width:767px){:is(button,[role="button"]){-webkit-tap-highlight-color:transparent;touch-action:manipulation}[data-sidebar-opener]{position:relative}[data-sidebar-opener]::after{content:'';position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%)}}`
|
|
15119
14863
|
].join("\n");
|
|
15120
14864
|
var dockCssTag = null;
|
|
15121
14865
|
var initialCssSchedule = null;
|
|
@@ -15151,8 +14895,8 @@ function ensureCss() {
|
|
|
15151
14895
|
}
|
|
15152
14896
|
}
|
|
15153
14897
|
function useExternalVersion() {
|
|
15154
|
-
const [, bump] =
|
|
15155
|
-
|
|
14898
|
+
const [, bump] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
14899
|
+
import_react24.default.useEffect(() => {
|
|
15156
14900
|
externalListeners.add(bump);
|
|
15157
14901
|
return () => {
|
|
15158
14902
|
externalListeners.delete(bump);
|
|
@@ -15162,33 +14906,148 @@ function useExternalVersion() {
|
|
|
15162
14906
|
var lastGeom = { x: null, y: null, w: null, h: null };
|
|
15163
14907
|
function DockIcon(props) {
|
|
15164
14908
|
const size = props && props.size || 16;
|
|
15165
|
-
return
|
|
14909
|
+
return import_react24.default.createElement(
|
|
15166
14910
|
"svg",
|
|
15167
14911
|
{ width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.3, "aria-hidden": true },
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
14912
|
+
import_react24.default.createElement("rect", { x: 2.5, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
14913
|
+
import_react24.default.createElement("rect", { x: 9, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
14914
|
+
import_react24.default.createElement("rect", { x: 2.5, y: 9, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
14915
|
+
import_react24.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
|
|
15172
14916
|
);
|
|
15173
14917
|
}
|
|
15174
|
-
function
|
|
15175
|
-
const [nav, setNav] =
|
|
15176
|
-
|
|
15177
|
-
const open = nav.open || typeof document === "undefined";
|
|
14918
|
+
function DockWorkspace() {
|
|
14919
|
+
const [nav, setNav] = import_react24.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
|
|
14920
|
+
import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
|
|
15178
14921
|
const active = nav.active;
|
|
15179
|
-
const setActive = navigatePanel;
|
|
15180
14922
|
const navParams = nav.params;
|
|
15181
|
-
const
|
|
14923
|
+
const setActive = navigatePanel;
|
|
14924
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15182
14925
|
useExternalVersion();
|
|
15183
|
-
const
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
14926
|
+
const contentRef = import_react24.default.useRef(null);
|
|
14927
|
+
import_react24.default.useEffect(() => {
|
|
14928
|
+
if (contentRef.current) contentRef.current.scrollTop = 0;
|
|
14929
|
+
}, [active]);
|
|
14930
|
+
const MODULES = allModules();
|
|
14931
|
+
const isHome = active === "home";
|
|
14932
|
+
const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
|
|
14933
|
+
const st = mod ? stateOf(mod.id) : null;
|
|
14934
|
+
const View = mod ? mod.View : null;
|
|
14935
|
+
const viewNode = mod && View ? import_react24.default.createElement(
|
|
14936
|
+
"div",
|
|
14937
|
+
{ className: "dockm-view" },
|
|
14938
|
+
import_react24.default.createElement(
|
|
14939
|
+
FeatureBoundary,
|
|
14940
|
+
{ key: mod.id, label: mod.name },
|
|
14941
|
+
import_react24.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
|
|
14942
|
+
)
|
|
14943
|
+
) : null;
|
|
14944
|
+
const enabledCount = MODULES.filter((m) => {
|
|
14945
|
+
const s = stateOf(m.id);
|
|
14946
|
+
return !!(s && s.enabled);
|
|
14947
|
+
}).length;
|
|
14948
|
+
return import_react24.default.createElement(
|
|
14949
|
+
"div",
|
|
14950
|
+
{ className: "dockm-body" },
|
|
14951
|
+
import_react24.default.createElement(
|
|
14952
|
+
"nav",
|
|
14953
|
+
{ className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
|
|
14954
|
+
import_react24.default.createElement(
|
|
14955
|
+
"button",
|
|
14956
|
+
{
|
|
14957
|
+
type: "button",
|
|
14958
|
+
key: "home",
|
|
14959
|
+
className: "dockm-nav-item" + (isHome ? " on" : ""),
|
|
14960
|
+
onClick: () => setActive("home")
|
|
14961
|
+
},
|
|
14962
|
+
import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)),
|
|
14963
|
+
import_react24.default.createElement("span", null, "\u9996\u9875")
|
|
14964
|
+
),
|
|
14965
|
+
MODULES.map((m) => import_react24.default.createElement(
|
|
14966
|
+
"button",
|
|
14967
|
+
{
|
|
14968
|
+
type: "button",
|
|
14969
|
+
key: m.id,
|
|
14970
|
+
className: "dockm-nav-item" + (m.id === active ? " on" : ""),
|
|
14971
|
+
onClick: () => setActive(m.id)
|
|
14972
|
+
},
|
|
14973
|
+
import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
14974
|
+
import_react24.default.createElement("span", null, m.name),
|
|
14975
|
+
m.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14976
|
+
m.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
|
|
14977
|
+
))
|
|
14978
|
+
),
|
|
14979
|
+
import_react24.default.createElement(
|
|
14980
|
+
"div",
|
|
14981
|
+
{ className: "dockm-content", ref: contentRef },
|
|
14982
|
+
import_react24.default.createElement(
|
|
14983
|
+
"div",
|
|
14984
|
+
{ className: "dockm-content-head" },
|
|
14985
|
+
import_react24.default.createElement(
|
|
14986
|
+
"div",
|
|
14987
|
+
{ className: "dockm-name" },
|
|
14988
|
+
isHome ? import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)) : import_react24.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
|
|
14989
|
+
isHome ? "\u9996\u9875" : mod.name,
|
|
14990
|
+
!isHome && mod.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14991
|
+
!isHome && mod.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
|
|
14992
|
+
),
|
|
14993
|
+
import_react24.default.createElement(
|
|
14994
|
+
"div",
|
|
14995
|
+
{ className: "dockm-desc" },
|
|
14996
|
+
isHome ? "\u6240\u6709\u5B50\u529F\u80FD\u603B\u63FD\uFF1A\u8FD0\u884C\u72B6\u6001\u3001\u6982\u8981\u4E0E\u5FEB\u6377\u5F00\u5173\uFF0C\u70B9\u51FB\u5361\u7247\u8FDB\u5165\u5BF9\u5E94\u529F\u80FD\u9875\u3002" : mod.description
|
|
14997
|
+
)
|
|
14998
|
+
),
|
|
14999
|
+
isHome ? import_react24.default.createElement("div", { className: "dockm-view" }, import_react24.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react24.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react24.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react24.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
|
|
15000
|
+
import_react24.default.createElement(
|
|
15001
|
+
"div",
|
|
15002
|
+
{ className: "dockm-foot" },
|
|
15003
|
+
import_react24.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
|
|
15004
|
+
!isHome && mod && !mod.planned && st ? import_react24.default.createElement(
|
|
15005
|
+
"span",
|
|
15006
|
+
{ className: "dockm-foot-sw" },
|
|
15007
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
|
|
15008
|
+
import_react24.default.createElement("button", {
|
|
15009
|
+
type: "button",
|
|
15010
|
+
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
15011
|
+
role: "switch",
|
|
15012
|
+
"aria-checked": !!st.enabled,
|
|
15013
|
+
"aria-label": (st.enabled ? "\u505C\u7528" : "\u542F\u7528") + mod.name,
|
|
15014
|
+
title: st.enabled ? "\u505C\u7528\u300C" + mod.name + "\u300D" : "\u542F\u7528\u300C" + mod.name + "\u300D",
|
|
15015
|
+
onClick: () => {
|
|
15016
|
+
toggleFeature(mod.id);
|
|
15017
|
+
force();
|
|
15018
|
+
}
|
|
15019
|
+
})
|
|
15020
|
+
) : null,
|
|
15021
|
+
!isHome && mod && typeof mod.Chip === "function" ? import_react24.default.createElement(
|
|
15022
|
+
"span",
|
|
15023
|
+
{ className: "dockm-foot-sw" },
|
|
15024
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
15025
|
+
import_react24.default.createElement("button", {
|
|
15026
|
+
type: "button",
|
|
15027
|
+
className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
|
|
15028
|
+
role: "switch",
|
|
15029
|
+
"aria-checked": chipShown(mod.id),
|
|
15030
|
+
"aria-label": (chipShown(mod.id) ? "\u9690\u85CF" : "\u663E\u793A") + mod.name + "\u7684\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6",
|
|
15031
|
+
title: "\u63A7\u5236\u4F1A\u8BDD\u8F93\u5165\u533A\uFF08\u6A21\u578B\u9009\u62E9\u5668\u5DE6\u4FA7\uFF09\u662F\u5426\u663E\u793A\u672C\u529F\u80FD\u7684\u968F\u8EAB\u5C0F\u63A7\u4EF6",
|
|
15032
|
+
onClick: () => {
|
|
15033
|
+
setChipShown(mod.id, !chipShown(mod.id));
|
|
15034
|
+
force();
|
|
15035
|
+
}
|
|
15036
|
+
})
|
|
15037
|
+
) : null
|
|
15038
|
+
)
|
|
15039
|
+
)
|
|
15040
|
+
);
|
|
15041
|
+
}
|
|
15042
|
+
function DockModal() {
|
|
15043
|
+
const [nav, setNav] = import_react24.default.useState({ open: panelNav.open });
|
|
15044
|
+
import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
|
|
15045
|
+
const open = nav.open || typeof document === "undefined";
|
|
15046
|
+
const [win, setWin] = import_react24.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
|
|
15047
|
+
const dlgRef = import_react24.default.useRef(null);
|
|
15048
|
+
import_react24.default.useEffect(() => {
|
|
15187
15049
|
if (lastGeom.w) setWin({ mode: "normal", x: lastGeom.x, y: lastGeom.y, w: lastGeom.w, h: lastGeom.h });
|
|
15188
15050
|
}, []);
|
|
15189
|
-
import_react26.default.useEffect(() => {
|
|
15190
|
-
if (open && contentRef.current) contentRef.current.scrollTop = 0;
|
|
15191
|
-
}, [active, open]);
|
|
15192
15051
|
function beginDrag(e, type) {
|
|
15193
15052
|
if (win.mode !== "normal" || e.button !== 0) return;
|
|
15194
15053
|
if (type === "move" && e.target && e.target.closest && e.target.closest("button,select,input")) return;
|
|
@@ -15219,24 +15078,6 @@ function DockModal() {
|
|
|
15219
15078
|
window.addEventListener("pointerup", onUp);
|
|
15220
15079
|
}
|
|
15221
15080
|
if (!open) return null;
|
|
15222
|
-
const MODULES = allModules();
|
|
15223
|
-
const isHome = active === "home";
|
|
15224
|
-
const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
|
|
15225
|
-
const st = mod ? stateOf(mod.id) : null;
|
|
15226
|
-
const View = mod ? mod.View : null;
|
|
15227
|
-
const viewNode = mod && View ? import_react26.default.createElement(
|
|
15228
|
-
"div",
|
|
15229
|
-
{ className: "dockm-view" },
|
|
15230
|
-
import_react26.default.createElement(
|
|
15231
|
-
FeatureBoundary,
|
|
15232
|
-
{ key: mod.id, label: mod.name },
|
|
15233
|
-
import_react26.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
|
|
15234
|
-
)
|
|
15235
|
-
) : null;
|
|
15236
|
-
const enabledCount = MODULES.filter((m) => {
|
|
15237
|
-
const s = stateOf(m.id);
|
|
15238
|
-
return !!(s && s.enabled);
|
|
15239
|
-
}).length;
|
|
15240
15081
|
const dialogStyle = win.mode === "max" ? { position: "fixed", left: 10, top: 10, right: 10, bottom: 10, width: "auto", height: "auto" } : win.x != null || win.y != null || win.w != null || win.h != null ? {
|
|
15241
15082
|
position: "fixed",
|
|
15242
15083
|
left: win.x != null ? win.x : void 0,
|
|
@@ -15244,10 +15085,10 @@ function DockModal() {
|
|
|
15244
15085
|
width: win.w != null ? win.w : void 0,
|
|
15245
15086
|
height: win.mode === "min" ? "auto" : win.h != null ? win.h : void 0
|
|
15246
15087
|
} : null;
|
|
15247
|
-
return
|
|
15088
|
+
return import_react24.default.createElement(
|
|
15248
15089
|
"div",
|
|
15249
15090
|
{ className: "dockm-backdrop", onClick: () => setPanelOpen(false) },
|
|
15250
|
-
|
|
15091
|
+
import_react24.default.createElement(
|
|
15251
15092
|
"div",
|
|
15252
15093
|
{
|
|
15253
15094
|
className: "dockm-dialog" + (win.mode === "max" ? " dockm-max" : "") + (win.mode === "min" ? " dockm-min" : ""),
|
|
@@ -15255,151 +15096,59 @@ function DockModal() {
|
|
|
15255
15096
|
ref: dlgRef,
|
|
15256
15097
|
onClick: (e) => e.stopPropagation()
|
|
15257
15098
|
},
|
|
15258
|
-
|
|
15099
|
+
import_react24.default.createElement(
|
|
15259
15100
|
"div",
|
|
15260
15101
|
{
|
|
15261
15102
|
className: "dockm-head",
|
|
15262
15103
|
onPointerDown: (e) => beginDrag(e, "move"),
|
|
15263
15104
|
onDoubleClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
|
|
15264
15105
|
},
|
|
15265
|
-
|
|
15266
|
-
|
|
15267
|
-
|
|
15268
|
-
|
|
15106
|
+
import_react24.default.createElement(DockIcon, null),
|
|
15107
|
+
import_react24.default.createElement("span", { className: "dockm-title" }, "\u529F\u80FD\u575E"),
|
|
15108
|
+
import_react24.default.createElement("span", { className: "dockm-sub" }, "dsh-dock \xB7 \u4E5F\u53EF\u5728 \u8BBE\u7F6E \u2192 \u529F\u80FD\u575E \u6253\u5F00\u7BA1\u7406\u9875"),
|
|
15109
|
+
import_react24.default.createElement(
|
|
15269
15110
|
"span",
|
|
15270
15111
|
{ className: "dockm-ctrls" },
|
|
15271
|
-
|
|
15112
|
+
import_react24.default.createElement("button", {
|
|
15272
15113
|
type: "button",
|
|
15273
15114
|
className: "dockm-win",
|
|
15274
15115
|
title: win.mode === "min" ? "\u8FD8\u539F" : "\u6700\u5C0F\u5316",
|
|
15275
15116
|
onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "min" ? "normal" : "min" }))
|
|
15276
15117
|
}, "\u2581"),
|
|
15277
|
-
|
|
15118
|
+
import_react24.default.createElement("button", {
|
|
15278
15119
|
type: "button",
|
|
15279
15120
|
className: "dockm-win",
|
|
15280
15121
|
title: win.mode === "max" ? "\u8FD8\u539F" : "\u6700\u5927\u5316",
|
|
15281
15122
|
onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
|
|
15282
15123
|
}, win.mode === "max" ? "\u2750" : "\u25A2"),
|
|
15283
|
-
|
|
15124
|
+
import_react24.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
|
|
15284
15125
|
)
|
|
15285
15126
|
),
|
|
15286
|
-
|
|
15287
|
-
|
|
15288
|
-
{ className: "dockm-body" },
|
|
15289
|
-
import_react26.default.createElement(
|
|
15290
|
-
"nav",
|
|
15291
|
-
{ className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
|
|
15292
|
-
import_react26.default.createElement(
|
|
15293
|
-
"button",
|
|
15294
|
-
{
|
|
15295
|
-
type: "button",
|
|
15296
|
-
key: "home",
|
|
15297
|
-
className: "dockm-nav-item" + (isHome ? " on" : ""),
|
|
15298
|
-
onClick: () => setActive("home")
|
|
15299
|
-
},
|
|
15300
|
-
import_react26.default.createElement("span", { className: "dockm-navhome" }, import_react26.default.createElement(DockIcon, null)),
|
|
15301
|
-
import_react26.default.createElement("span", null, "\u9996\u9875")
|
|
15302
|
-
),
|
|
15303
|
-
MODULES.map((m) => import_react26.default.createElement(
|
|
15304
|
-
"button",
|
|
15305
|
-
{
|
|
15306
|
-
type: "button",
|
|
15307
|
-
key: m.id,
|
|
15308
|
-
className: "dockm-nav-item" + (m.id === active ? " on" : ""),
|
|
15309
|
-
onClick: () => setActive(m.id)
|
|
15310
|
-
},
|
|
15311
|
-
import_react26.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
15312
|
-
import_react26.default.createElement("span", null, m.name),
|
|
15313
|
-
m.planned ? import_react26.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
15314
|
-
m.external ? import_react26.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
|
|
15315
|
-
))
|
|
15316
|
-
),
|
|
15317
|
-
import_react26.default.createElement(
|
|
15318
|
-
"div",
|
|
15319
|
-
{ className: "dockm-content", ref: contentRef },
|
|
15320
|
-
import_react26.default.createElement(
|
|
15321
|
-
"div",
|
|
15322
|
-
{ className: "dockm-content-head" },
|
|
15323
|
-
import_react26.default.createElement(
|
|
15324
|
-
"div",
|
|
15325
|
-
{ className: "dockm-name" },
|
|
15326
|
-
isHome ? import_react26.default.createElement("span", { className: "dockm-navhome" }, import_react26.default.createElement(DockIcon, null)) : import_react26.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
|
|
15327
|
-
isHome ? "\u9996\u9875" : mod.name,
|
|
15328
|
-
!isHome && mod.planned ? import_react26.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
15329
|
-
!isHome && mod.external ? import_react26.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
|
|
15330
|
-
),
|
|
15331
|
-
import_react26.default.createElement(
|
|
15332
|
-
"div",
|
|
15333
|
-
{ className: "dockm-desc" },
|
|
15334
|
-
isHome ? "\u6240\u6709\u5B50\u529F\u80FD\u603B\u63FD\uFF1A\u8FD0\u884C\u72B6\u6001\u3001\u6982\u8981\u4E0E\u5FEB\u6377\u5F00\u5173\uFF0C\u70B9\u51FB\u5361\u7247\u8FDB\u5165\u5BF9\u5E94\u529F\u80FD\u9875\u3002" : mod.description
|
|
15335
|
-
)
|
|
15336
|
-
),
|
|
15337
|
-
isHome ? import_react26.default.createElement("div", { className: "dockm-view" }, import_react26.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react26.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react26.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react26.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
|
|
15338
|
-
import_react26.default.createElement(
|
|
15339
|
-
"div",
|
|
15340
|
-
{ className: "dockm-foot" },
|
|
15341
|
-
import_react26.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
|
|
15342
|
-
!isHome && mod && !mod.planned && st ? import_react26.default.createElement(
|
|
15343
|
-
"span",
|
|
15344
|
-
{ className: "dockm-foot-sw" },
|
|
15345
|
-
import_react26.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
|
|
15346
|
-
import_react26.default.createElement("button", {
|
|
15347
|
-
type: "button",
|
|
15348
|
-
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
15349
|
-
role: "switch",
|
|
15350
|
-
"aria-checked": !!st.enabled,
|
|
15351
|
-
"aria-label": (st.enabled ? "\u505C\u7528" : "\u542F\u7528") + mod.name,
|
|
15352
|
-
title: st.enabled ? "\u505C\u7528\u300C" + mod.name + "\u300D" : "\u542F\u7528\u300C" + mod.name + "\u300D",
|
|
15353
|
-
onClick: () => {
|
|
15354
|
-
toggleFeature(mod.id);
|
|
15355
|
-
force();
|
|
15356
|
-
}
|
|
15357
|
-
})
|
|
15358
|
-
) : null,
|
|
15359
|
-
!isHome && mod && typeof mod.Chip === "function" ? import_react26.default.createElement(
|
|
15360
|
-
"span",
|
|
15361
|
-
{ className: "dockm-foot-sw" },
|
|
15362
|
-
import_react26.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
15363
|
-
import_react26.default.createElement("button", {
|
|
15364
|
-
type: "button",
|
|
15365
|
-
className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
|
|
15366
|
-
role: "switch",
|
|
15367
|
-
"aria-checked": chipShown(mod.id),
|
|
15368
|
-
"aria-label": (chipShown(mod.id) ? "\u9690\u85CF" : "\u663E\u793A") + mod.name + "\u7684\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6",
|
|
15369
|
-
title: "\u63A7\u5236\u4F1A\u8BDD\u8F93\u5165\u533A\uFF08\u6A21\u578B\u9009\u62E9\u5668\u5DE6\u4FA7\uFF09\u662F\u5426\u663E\u793A\u672C\u529F\u80FD\u7684\u968F\u8EAB\u5C0F\u63A7\u4EF6",
|
|
15370
|
-
onClick: () => {
|
|
15371
|
-
setChipShown(mod.id, !chipShown(mod.id));
|
|
15372
|
-
force();
|
|
15373
|
-
}
|
|
15374
|
-
})
|
|
15375
|
-
) : null
|
|
15376
|
-
)
|
|
15377
|
-
)
|
|
15378
|
-
),
|
|
15379
|
-
win.mode === "normal" ? import_react26.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
|
|
15127
|
+
import_react24.default.createElement(DockWorkspace, null),
|
|
15128
|
+
win.mode === "normal" ? import_react24.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
|
|
15380
15129
|
)
|
|
15381
15130
|
);
|
|
15382
15131
|
}
|
|
15383
15132
|
function HomeView(props) {
|
|
15384
15133
|
const ctx = props && props.ctx;
|
|
15385
|
-
const [, force] =
|
|
15134
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15386
15135
|
useExternalVersion();
|
|
15387
15136
|
const open = (id) => {
|
|
15388
15137
|
if (props && typeof props.onOpen === "function") props.onOpen(id);
|
|
15389
15138
|
};
|
|
15390
|
-
return
|
|
15139
|
+
return import_react24.default.createElement(
|
|
15391
15140
|
"div",
|
|
15392
15141
|
{ className: "dockh-grid" },
|
|
15393
15142
|
allModules().map((m) => {
|
|
15394
15143
|
const st = stateOf(m.id);
|
|
15395
15144
|
const enabled = !!(st && st.enabled);
|
|
15396
15145
|
const Stat = m.HomeStat;
|
|
15397
|
-
const statNode = m.planned ?
|
|
15146
|
+
const statNode = m.planned ? import_react24.default.createElement("span", null, PLANNED_NOTES[m.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : enabled && Stat ? import_react24.default.createElement(
|
|
15398
15147
|
FeatureBoundary,
|
|
15399
15148
|
{ key: m.id, label: m.name },
|
|
15400
|
-
|
|
15401
|
-
) :
|
|
15402
|
-
return
|
|
15149
|
+
import_react24.default.createElement(Stat, { ctx })
|
|
15150
|
+
) : import_react24.default.createElement("span", null, "\u5DF2\u505C\u7528\uFF0C\u542F\u7528\u540E\u5728\u6B64\u5C55\u793A\u8FD0\u884C\u6982\u8981");
|
|
15151
|
+
return import_react24.default.createElement(
|
|
15403
15152
|
"div",
|
|
15404
15153
|
{
|
|
15405
15154
|
key: m.id,
|
|
@@ -15414,21 +15163,21 @@ function HomeView(props) {
|
|
|
15414
15163
|
}
|
|
15415
15164
|
}
|
|
15416
15165
|
},
|
|
15417
|
-
|
|
15166
|
+
import_react24.default.createElement(
|
|
15418
15167
|
"div",
|
|
15419
15168
|
{ className: "dockh-head" },
|
|
15420
|
-
|
|
15421
|
-
|
|
15422
|
-
m.external ?
|
|
15169
|
+
import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
15170
|
+
import_react24.default.createElement("span", { className: "dockh-name" }, m.name),
|
|
15171
|
+
m.external ? import_react24.default.createElement("span", { className: "dockh-badge", title: m.package || void 0 }, "\u5916\u90E8") : null,
|
|
15423
15172
|
// 状态标识:圆点 + 文字(纯展示,与开关视觉区分)
|
|
15424
|
-
|
|
15173
|
+
import_react24.default.createElement(
|
|
15425
15174
|
"span",
|
|
15426
15175
|
{ className: "dockh-status" + (m.planned ? " plan" : enabled ? "" : " off") },
|
|
15427
|
-
|
|
15428
|
-
|
|
15176
|
+
import_react24.default.createElement("span", { className: "dockh-sdot" }),
|
|
15177
|
+
import_react24.default.createElement("span", null, m.planned ? "\u89C4\u5212\u4E2D" : enabled ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u505C\u7528")
|
|
15429
15178
|
),
|
|
15430
15179
|
// 启停开关(规划中的功能不显示)
|
|
15431
|
-
m.planned ? null :
|
|
15180
|
+
m.planned ? null : import_react24.default.createElement("button", {
|
|
15432
15181
|
type: "button",
|
|
15433
15182
|
className: "dock-sw" + (enabled ? " on" : ""),
|
|
15434
15183
|
role: "switch",
|
|
@@ -15443,12 +15192,12 @@ function HomeView(props) {
|
|
|
15443
15192
|
}
|
|
15444
15193
|
})
|
|
15445
15194
|
),
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
|
|
15195
|
+
import_react24.default.createElement("div", { className: "dockh-desc" }, m.description),
|
|
15196
|
+
import_react24.default.createElement("div", { className: "dockh-stat" }, statNode),
|
|
15197
|
+
import_react24.default.createElement(
|
|
15449
15198
|
"div",
|
|
15450
15199
|
{ className: "dockh-foot" },
|
|
15451
|
-
|
|
15200
|
+
import_react24.default.createElement("span", { className: "dockh-go" }, "\u67E5\u770B\u8BE6\u60C5 \u2192")
|
|
15452
15201
|
)
|
|
15453
15202
|
);
|
|
15454
15203
|
})
|
|
@@ -15456,16 +15205,16 @@ function HomeView(props) {
|
|
|
15456
15205
|
}
|
|
15457
15206
|
function DockPanel(props) {
|
|
15458
15207
|
const ctx = ctxRef.current;
|
|
15459
|
-
const [, force] =
|
|
15208
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15460
15209
|
useExternalVersion();
|
|
15461
15210
|
const toggle = (id) => {
|
|
15462
15211
|
toggleFeature(id);
|
|
15463
15212
|
force();
|
|
15464
15213
|
};
|
|
15465
|
-
return
|
|
15214
|
+
return import_react24.default.createElement(
|
|
15466
15215
|
"div",
|
|
15467
15216
|
{ className: "dock-root" },
|
|
15468
|
-
|
|
15217
|
+
import_react24.default.createElement(
|
|
15469
15218
|
"div",
|
|
15470
15219
|
{ className: "dock-intro" },
|
|
15471
15220
|
"\u529F\u80FD\u575E\uFF08dsh-dock\uFF09\xB7 \u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u4E00\u4E2A\u9762\u677F\u91CC\u7BA1\u7406\u3002v0.4.0 \u8D77\u6BCF\u4E2A\u529F\u80FD\u662F\u72EC\u7ACB\u6A21\u5757\uFF08features/<id>/\uFF09\uFF0C",
|
|
@@ -15474,25 +15223,25 @@ function DockPanel(props) {
|
|
|
15474
15223
|
allModules().map((f) => {
|
|
15475
15224
|
const st = stateOf(f.id);
|
|
15476
15225
|
const View = f.View;
|
|
15477
|
-
const viewNode = !f.planned && st.enabled && View ?
|
|
15226
|
+
const viewNode = !f.planned && st.enabled && View ? import_react24.default.createElement(
|
|
15478
15227
|
"div",
|
|
15479
15228
|
{ className: "dock-body" },
|
|
15480
|
-
|
|
15229
|
+
import_react24.default.createElement(
|
|
15481
15230
|
FeatureBoundary,
|
|
15482
15231
|
{ key: f.id, label: f.name },
|
|
15483
|
-
|
|
15232
|
+
import_react24.default.createElement(View, { ctx, feature: f, params: props && props.params })
|
|
15484
15233
|
)
|
|
15485
15234
|
) : null;
|
|
15486
|
-
return
|
|
15235
|
+
return import_react24.default.createElement(
|
|
15487
15236
|
"div",
|
|
15488
15237
|
{ className: "dock-card", key: f.id },
|
|
15489
|
-
|
|
15238
|
+
import_react24.default.createElement(
|
|
15490
15239
|
"div",
|
|
15491
15240
|
{ className: "dock-card-head" },
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
f.planned ?
|
|
15241
|
+
import_react24.default.createElement("span", { className: "dock-dot" + (st.error ? " err" : st.enabled ? " on" : "") }),
|
|
15242
|
+
import_react24.default.createElement("span", { className: "dock-name" }, f.name),
|
|
15243
|
+
import_react24.default.createElement("span", { className: "dock-desc" }, f.description + (f.external ? "\uFF08\u6765\u81EA\u5916\u90E8\u5305" + (f.package ? " " + f.package : "") + "\uFF09" : "")),
|
|
15244
|
+
f.planned ? import_react24.default.createElement("span", { className: "dock-badge" }, "\u89C4\u5212\u4E2D") : import_react24.default.createElement("button", {
|
|
15496
15245
|
type: "button",
|
|
15497
15246
|
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
15498
15247
|
role: "switch",
|
|
@@ -15501,11 +15250,11 @@ function DockPanel(props) {
|
|
|
15501
15250
|
title: st.enabled ? "\u505C\u7528\u300C" + f.name + "\u300D" : "\u542F\u7528\u300C" + f.name + "\u300D",
|
|
15502
15251
|
onClick: () => toggle(f.id)
|
|
15503
15252
|
}),
|
|
15504
|
-
!f.planned && typeof f.Chip === "function" ?
|
|
15253
|
+
!f.planned && typeof f.Chip === "function" ? import_react24.default.createElement(
|
|
15505
15254
|
"span",
|
|
15506
15255
|
{ className: "dockm-foot-sw" },
|
|
15507
|
-
|
|
15508
|
-
|
|
15256
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(f.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
15257
|
+
import_react24.default.createElement("button", {
|
|
15509
15258
|
type: "button",
|
|
15510
15259
|
className: "dock-sw" + (chipShown(f.id) ? " on" : ""),
|
|
15511
15260
|
role: "switch",
|
|
@@ -15519,40 +15268,59 @@ function DockPanel(props) {
|
|
|
15519
15268
|
})
|
|
15520
15269
|
) : null
|
|
15521
15270
|
),
|
|
15522
|
-
f.planned ?
|
|
15271
|
+
f.planned ? import_react24.default.createElement("div", { className: "dock-body" }, PLANNED_NOTES[f.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st.error ? import_react24.default.createElement("div", { className: "dock-body dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : null,
|
|
15523
15272
|
viewNode
|
|
15524
15273
|
);
|
|
15525
15274
|
})
|
|
15526
15275
|
);
|
|
15527
15276
|
}
|
|
15528
15277
|
function DockPage() {
|
|
15529
|
-
|
|
15278
|
+
const ctx = ctxRef.current;
|
|
15279
|
+
const [wide, setWide] = import_react24.default.useState(false);
|
|
15280
|
+
const toggleWide = () => {
|
|
15281
|
+
try {
|
|
15282
|
+
const layout = ctx && typeof ctx.get === "function" ? ctx.get("layout") : null;
|
|
15283
|
+
if (layout && typeof layout.toggleSidebar === "function") {
|
|
15284
|
+
layout.toggleSidebar();
|
|
15285
|
+
setWide((v) => !v);
|
|
15286
|
+
}
|
|
15287
|
+
} catch (e) {
|
|
15288
|
+
}
|
|
15289
|
+
};
|
|
15290
|
+
return import_react24.default.createElement(
|
|
15530
15291
|
"div",
|
|
15531
|
-
{ className: "dockm-page" },
|
|
15532
|
-
|
|
15292
|
+
{ className: "dockm-page" + (wide ? " dockm-page-wide" : "") },
|
|
15293
|
+
import_react24.default.createElement(
|
|
15533
15294
|
"div",
|
|
15534
15295
|
{ className: "dockm-page-head" },
|
|
15535
|
-
|
|
15536
|
-
|
|
15296
|
+
import_react24.default.createElement("span", { className: "dockm-page-icon" }, import_react24.default.createElement(DockIcon, { size: 20 })),
|
|
15297
|
+
import_react24.default.createElement(
|
|
15537
15298
|
"div",
|
|
15538
15299
|
{ className: "dockm-page-titles" },
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
)
|
|
15300
|
+
import_react24.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
|
|
15301
|
+
import_react24.default.createElement("div", { className: "dockm-page-sub" }, "\u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4FA7\u680F\u56FE\u6807\u53EF\u5728\u300C\u66F4\u591A\u300D\u83DC\u5355\u91CC Pin \u5230\u9876\u90E8\uFF0C\u6216\u53D6\u6D88\u56FA\u5B9A\u6536\u8FDB\u66F4\u591A\u3002")
|
|
15302
|
+
),
|
|
15303
|
+
import_react24.default.createElement("button", {
|
|
15304
|
+
type: "button",
|
|
15305
|
+
className: "dockm-page-wide-btn",
|
|
15306
|
+
title: wide ? "\u8FD8\u539F\u4FA7\u680F\u5BBD\u5EA6" : "\u6536\u8D77\u5DE6\u4FA7\u680F\uFF0C\u5168\u5C4F\u663E\u793A\u529F\u80FD\u575E",
|
|
15307
|
+
"aria-label": wide ? "\u8FD8\u539F\u5BBD\u5EA6" : "\u5168\u5C4F",
|
|
15308
|
+
onClick: toggleWide
|
|
15309
|
+
}, wide ? "\u2750 \u8FD8\u539F" : "\u25A2 \u5168\u5C4F")
|
|
15542
15310
|
),
|
|
15543
|
-
|
|
15311
|
+
import_react24.default.createElement("div", { className: "dockm-page-body" }, import_react24.default.createElement(DockWorkspace, null))
|
|
15544
15312
|
);
|
|
15545
15313
|
}
|
|
15546
15314
|
function DockChips(props) {
|
|
15547
|
-
const [, force] =
|
|
15548
|
-
|
|
15315
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15316
|
+
import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
15549
15317
|
const items = [];
|
|
15550
15318
|
for (const f of allModules()) {
|
|
15551
15319
|
if (f.planned || !stateOf(f.id).enabled || !chipShown(f.id) || typeof f.Chip !== "function") continue;
|
|
15552
|
-
items.push(
|
|
15320
|
+
items.push(import_react24.default.createElement(
|
|
15553
15321
|
FeatureBoundary,
|
|
15554
15322
|
{ key: f.id, label: f.name },
|
|
15555
|
-
|
|
15323
|
+
import_react24.default.createElement(f.Chip, {
|
|
15556
15324
|
ctx: props.ctx,
|
|
15557
15325
|
feature: f,
|
|
15558
15326
|
session: props.session,
|
|
@@ -15562,38 +15330,38 @@ function DockChips(props) {
|
|
|
15562
15330
|
));
|
|
15563
15331
|
}
|
|
15564
15332
|
if (items.length === 0) return null;
|
|
15565
|
-
return
|
|
15333
|
+
return import_react24.default.createElement("div", { className: "dockchip-row" }, items);
|
|
15566
15334
|
}
|
|
15567
15335
|
function FeatureOverlays() {
|
|
15568
|
-
const [, force] =
|
|
15336
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15569
15337
|
useExternalVersion();
|
|
15570
|
-
|
|
15338
|
+
import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
15571
15339
|
const items = [];
|
|
15572
15340
|
for (const f of allModules()) {
|
|
15573
15341
|
if (f.planned || !stateOf(f.id).enabled || typeof f.Overlay !== "function") continue;
|
|
15574
|
-
items.push(
|
|
15342
|
+
items.push(import_react24.default.createElement(
|
|
15575
15343
|
FeatureBoundary,
|
|
15576
15344
|
{ key: f.id, label: f.name },
|
|
15577
|
-
|
|
15345
|
+
import_react24.default.createElement(f.Overlay, { ctx: ctxRef.current, feature: f })
|
|
15578
15346
|
));
|
|
15579
15347
|
}
|
|
15580
15348
|
if (items.length === 0) return null;
|
|
15581
|
-
return
|
|
15349
|
+
return import_react24.default.createElement(import_react24.default.Fragment, null, items);
|
|
15582
15350
|
}
|
|
15583
15351
|
function FeatureTurnTail(props) {
|
|
15584
|
-
const [, force] =
|
|
15585
|
-
|
|
15352
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15353
|
+
import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
15586
15354
|
const items = [];
|
|
15587
15355
|
for (const f of allModules()) {
|
|
15588
15356
|
if (f.planned || !stateOf(f.id).enabled || typeof f.TurnTail !== "function") continue;
|
|
15589
|
-
items.push(
|
|
15357
|
+
items.push(import_react24.default.createElement(
|
|
15590
15358
|
FeatureBoundary,
|
|
15591
15359
|
{ key: f.id, label: f.name },
|
|
15592
|
-
|
|
15360
|
+
import_react24.default.createElement(f.TurnTail, Object.assign({}, props, { ctx: ctxRef.current, feature: f }))
|
|
15593
15361
|
));
|
|
15594
15362
|
}
|
|
15595
15363
|
if (items.length === 0) return null;
|
|
15596
|
-
return
|
|
15364
|
+
return import_react24.default.createElement(import_react24.default.Fragment, null, items);
|
|
15597
15365
|
}
|
|
15598
15366
|
var ctxRef = { current: null };
|
|
15599
15367
|
function apply(ctx) {
|
|
@@ -15604,31 +15372,31 @@ function apply(ctx) {
|
|
|
15604
15372
|
if (slots === void 0) return;
|
|
15605
15373
|
slots.inject("sidebar.panellist", () => slots.register(
|
|
15606
15374
|
{ name: "sidebar.panellist", id: "dsh-dock", order: 30, label: "\u529F\u80FD\u575E" },
|
|
15607
|
-
(props) =>
|
|
15375
|
+
(props) => import_react24.default.createElement(DockIcon, { size: props && props.size || 18 })
|
|
15608
15376
|
));
|
|
15609
15377
|
slots.inject("main", () => slots.register(
|
|
15610
15378
|
{ name: "main", key: "dsh-dock", label: "\u529F\u80FD\u575E" },
|
|
15611
|
-
() =>
|
|
15379
|
+
() => import_react24.default.createElement(DockPage, null)
|
|
15612
15380
|
));
|
|
15613
15381
|
slots.inject("shell.overlay", () => slots.register(
|
|
15614
15382
|
{ name: "shell.overlay", id: "dsh-dock-panel", order: 21, label: "\u529F\u80FD\u575E\u9762\u677F" },
|
|
15615
|
-
() =>
|
|
15383
|
+
() => import_react24.default.createElement(DockModal, null)
|
|
15616
15384
|
));
|
|
15617
15385
|
slots.inject("shell.overlay", () => slots.register(
|
|
15618
15386
|
{ name: "shell.overlay", id: "dsh-dock-feature-overlays", order: 22, label: "\u529F\u80FD\u575E\u5168\u5C40\u6D6E\u5C42" },
|
|
15619
|
-
() =>
|
|
15387
|
+
() => import_react24.default.createElement(FeatureOverlays, null)
|
|
15620
15388
|
));
|
|
15621
15389
|
slots.inject("settings.section", () => slots.register(
|
|
15622
15390
|
{ name: "settings.section", id: "dsh-dock", order: 90, label: "\u529F\u80FD\u575E" },
|
|
15623
|
-
(props) =>
|
|
15391
|
+
(props) => import_react24.default.createElement(DockPanel, props)
|
|
15624
15392
|
));
|
|
15625
15393
|
slots.inject("conversation.input.left", () => slots.register(
|
|
15626
15394
|
{ name: "conversation.input.left", id: "dsh-dock-chips", order: 10, label: "\u529F\u80FD\u575E" },
|
|
15627
|
-
(zone) =>
|
|
15395
|
+
(zone) => import_react24.default.createElement(DockChips, Object.assign({}, zone, { ctx: ctxRef.current }))
|
|
15628
15396
|
));
|
|
15629
15397
|
slots.inject("conversation.chat.turnTail", () => slots.register(
|
|
15630
15398
|
{ name: "conversation.chat.turnTail", id: "dsh-dock-turn-tail", order: 40, label: "\u529F\u80FD\u575E" },
|
|
15631
|
-
(owner) =>
|
|
15399
|
+
(owner) => import_react24.default.createElement(FeatureTurnTail, owner)
|
|
15632
15400
|
));
|
|
15633
15401
|
}
|
|
15634
15402
|
var inject = ["timer"];
|