dsh-dock 0.21.0 → 0.21.1
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 +349 -600
- package/features/animation/view.jsx +81 -4
- package/features/balance/view.js +1 -0
- package/features/tokenlog/view.jsx +2 -1
- package/index.js +0 -3
- package/package.json +2 -2
- package/src/client.jsx +158 -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);
|
|
@@ -3759,6 +3759,7 @@ function TokenLogChip(props) {
|
|
|
3759
3759
|
children: [
|
|
3760
3760
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-dot", style: { background: gone ? "var(--dsw-alias-label-tertiary,#8b95ab)" : "var(--dk-warn)" } }),
|
|
3761
3761
|
labelIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-ic", children: labelIcon }) : null,
|
|
3762
|
+
hasData ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-pre-s", children: "\u7528\u91CF " }) : null,
|
|
3762
3763
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: labelMain }),
|
|
3763
3764
|
labelExtra ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-x", children: labelExtra }) : null
|
|
3764
3765
|
]
|
|
@@ -5484,6 +5485,7 @@ function BalanceChip(props) {
|
|
|
5484
5485
|
},
|
|
5485
5486
|
import_react8.default.createElement("span", { className: "dockchip-dot", style: { background: accent } }),
|
|
5486
5487
|
mm ? import_react8.default.createElement("span", { className: "dockchip-pre" }, mm[1]) : null,
|
|
5488
|
+
mm ? import_react8.default.createElement("span", { className: "dockchip-pre-s" }, "\u4F59\u989D ") : null,
|
|
5487
5489
|
import_react8.default.createElement("span", null, mm ? mm[2] : text)
|
|
5488
5490
|
);
|
|
5489
5491
|
}
|
|
@@ -6524,6 +6526,85 @@ function AnimationOverlay(props) {
|
|
|
6524
6526
|
}, 0);
|
|
6525
6527
|
}
|
|
6526
6528
|
};
|
|
6529
|
+
const [badgePos, setBadgePos] = (0, import_react9.useState)(null);
|
|
6530
|
+
const badgePosRef = (0, import_react9.useRef)(null);
|
|
6531
|
+
const badgeDragRef = (0, import_react9.useRef)(null);
|
|
6532
|
+
const badgeClickBlockRef = (0, import_react9.useRef)(false);
|
|
6533
|
+
(0, import_react9.useEffect)(() => {
|
|
6534
|
+
try {
|
|
6535
|
+
if (typeof localStorage === "undefined") return;
|
|
6536
|
+
const raw = localStorage.getItem("dsh-dock/anim/badge-pos/v1");
|
|
6537
|
+
const p2 = raw ? JSON.parse(raw) : null;
|
|
6538
|
+
if (p2 && typeof p2.x === "number" && typeof p2.y === "number" && typeof window !== "undefined") {
|
|
6539
|
+
const card = document.querySelector(".dkan-badge");
|
|
6540
|
+
const w = card ? card.offsetWidth : 180, h = card ? card.offsetHeight : 34;
|
|
6541
|
+
const x = Math.min(Math.max(8, p2.x), Math.max(8, window.innerWidth - w - 8));
|
|
6542
|
+
const y = Math.min(Math.max(8, p2.y), Math.max(8, window.innerHeight - h - 8));
|
|
6543
|
+
badgePosRef.current = { x, y };
|
|
6544
|
+
setBadgePos({ x, y });
|
|
6545
|
+
}
|
|
6546
|
+
} catch {
|
|
6547
|
+
}
|
|
6548
|
+
}, []);
|
|
6549
|
+
const onBadgePointerDown = (e) => {
|
|
6550
|
+
if (e.button !== 0) return;
|
|
6551
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
6552
|
+
badgeDragRef.current = { sx: e.clientX, sy: e.clientY, ox: r.left, oy: r.top, moved: false };
|
|
6553
|
+
try {
|
|
6554
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6555
|
+
} catch {
|
|
6556
|
+
}
|
|
6557
|
+
};
|
|
6558
|
+
const onBadgePointerMove = (e) => {
|
|
6559
|
+
const d = badgeDragRef.current;
|
|
6560
|
+
if (!d || typeof window === "undefined") return;
|
|
6561
|
+
const dx = e.clientX - d.sx, dy = e.clientY - d.sy;
|
|
6562
|
+
if (!d.moved && Math.hypot(dx, dy) < 4) return;
|
|
6563
|
+
d.moved = true;
|
|
6564
|
+
const el = e.currentTarget;
|
|
6565
|
+
const w = el.offsetWidth || 180, h = el.offsetHeight || 34;
|
|
6566
|
+
const x = Math.min(Math.max(8, d.ox + dx), window.innerWidth - w - 8);
|
|
6567
|
+
const y = Math.min(Math.max(8, d.oy + dy), window.innerHeight - h - 8);
|
|
6568
|
+
badgePosRef.current = { x, y };
|
|
6569
|
+
setBadgePos({ x, y });
|
|
6570
|
+
};
|
|
6571
|
+
const onBadgePointerUp = () => {
|
|
6572
|
+
const d = badgeDragRef.current;
|
|
6573
|
+
badgeDragRef.current = null;
|
|
6574
|
+
if (d && d.moved) {
|
|
6575
|
+
try {
|
|
6576
|
+
if (typeof localStorage !== "undefined") localStorage.setItem("dsh-dock/anim/badge-pos/v1", JSON.stringify(badgePosRef.current));
|
|
6577
|
+
} catch {
|
|
6578
|
+
}
|
|
6579
|
+
badgeClickBlockRef.current = true;
|
|
6580
|
+
setTimeout(() => {
|
|
6581
|
+
badgeClickBlockRef.current = false;
|
|
6582
|
+
}, 0);
|
|
6583
|
+
}
|
|
6584
|
+
};
|
|
6585
|
+
const resetBadgePos = () => {
|
|
6586
|
+
try {
|
|
6587
|
+
if (typeof localStorage !== "undefined") localStorage.removeItem("dsh-dock/anim/badge-pos/v1");
|
|
6588
|
+
} catch {
|
|
6589
|
+
}
|
|
6590
|
+
badgePosRef.current = null;
|
|
6591
|
+
setBadgePos(null);
|
|
6592
|
+
};
|
|
6593
|
+
const badgeClickTimer = (0, import_react9.useRef)(null);
|
|
6594
|
+
const onBadgeClick = () => {
|
|
6595
|
+
if (badgeClickBlockRef.current) return;
|
|
6596
|
+
if (badgeClickTimer.current) {
|
|
6597
|
+
clearTimeout(badgeClickTimer.current);
|
|
6598
|
+
badgeClickTimer.current = null;
|
|
6599
|
+
resetBadgePos();
|
|
6600
|
+
return;
|
|
6601
|
+
}
|
|
6602
|
+
badgeClickTimer.current = setTimeout(() => {
|
|
6603
|
+
badgeClickTimer.current = null;
|
|
6604
|
+
openPanel("animation");
|
|
6605
|
+
}, 240);
|
|
6606
|
+
};
|
|
6607
|
+
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
6608
|
const onBotResizePointerDown = (e) => {
|
|
6528
6609
|
if (e.button !== 0) return;
|
|
6529
6610
|
e.preventDefault();
|
|
@@ -6635,9 +6716,13 @@ function AnimationOverlay(props) {
|
|
|
6635
6716
|
{
|
|
6636
6717
|
type: "button",
|
|
6637
6718
|
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
|
-
|
|
6719
|
+
style: badgeStyle,
|
|
6720
|
+
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",
|
|
6721
|
+
onPointerDown: onBadgePointerDown,
|
|
6722
|
+
onPointerMove: onBadgePointerMove,
|
|
6723
|
+
onPointerUp: onBadgePointerUp,
|
|
6724
|
+
onPointerCancel: onBadgePointerUp,
|
|
6725
|
+
onClick: onBadgeClick,
|
|
6641
6726
|
children: [
|
|
6642
6727
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dkan-dotwrap", children: [
|
|
6643
6728
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dkan-dot" }),
|
|
@@ -6960,7 +7045,7 @@ var css2 = [
|
|
|
6960
7045
|
".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
7046
|
"@keyframes dkan-confetti{0%{opacity:1;transform:translateY(0) rotate(0)}100%{opacity:0;transform:translateY(75vh) translateX(var(--dx)) rotate(var(--r))}}",
|
|
6962
7047
|
// 右下角状态徽标(玻璃拟态,可点击);抬到 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:
|
|
7048
|
+
".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
7049
|
".dkan-badge:hover{color:var(--dsw-alias-label-primary);}",
|
|
6965
7050
|
".dkan-badge .n{color:var(--dsw-alias-label-primary);font-weight:600;}",
|
|
6966
7051
|
"@keyframes dkan-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}",
|
|
@@ -14551,388 +14636,9 @@ var feature12 = {
|
|
|
14551
14636
|
HomeStat: MobileRelayHomeStat
|
|
14552
14637
|
};
|
|
14553
14638
|
|
|
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
14639
|
// 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
|
|
14640
|
+
var DOCK_VERSION = "0.21.1";
|
|
14641
|
+
var BUILTIN_FEATURES = [feature, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature11, feature12];
|
|
14936
14642
|
var PLANNED_FEATURES = [];
|
|
14937
14643
|
var PLANNED_NOTES = {};
|
|
14938
14644
|
var externalDefs = [];
|
|
@@ -15046,8 +14752,15 @@ var SHELL_CSS = [
|
|
|
15046
14752
|
".dockm-name{display:flex;align-items:center;gap:8px;font-weight:600;font-size:15px;}",
|
|
15047
14753
|
".dockm-desc{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.6;}",
|
|
15048
14754
|
".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;
|
|
14755
|
+
".dockm-page{box-sizing:border-box;height:100%;display:flex;flex-direction:column;overflow:hidden;padding:16px 20px 0;}",
|
|
14756
|
+
".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);}",
|
|
14757
|
+
".dockm-page-body{flex:1;min-height:0;display:flex;}",
|
|
14758
|
+
".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;}",
|
|
14759
|
+
".dockm-page-wide-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
|
|
14760
|
+
/* 面板页的左侧菜单收窄:给右侧列表/表格让出宽度,别留大片空白 */
|
|
14761
|
+
".dockm-page .dockm-nav{width:140px;padding:8px 6px;}",
|
|
14762
|
+
".dockm-page .dockm-nav-item{padding:7px 8px;font-size:12.5px;gap:6px;}",
|
|
14763
|
+
".dockm-page-body>.dockm-body{flex:1;min-height:0;}",
|
|
15051
14764
|
".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
14765
|
".dockm-page-titles{min-width:0;}",
|
|
15053
14766
|
".dockm-page-title{font-size:17px;font-weight:600;color:var(--dsw-alias-label-primary);line-height:1.3;}",
|
|
@@ -15085,9 +14798,17 @@ var SHELL_CSS = [
|
|
|
15085
14798
|
// 禁用桌面拖拽/缩放,所有导航和关闭动作保持至少 44px 的可点击面积。
|
|
15086
14799
|
"@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
14800
|
/* 手机端:功能坞弹层挂在 .overlayLayer(z20) 内,会被 z71 的侧栏抽屉盖住(只剩右侧一条)。\n 把 overlayLayer 在窄屏抬到抽屉之上,面板才能全屏覆盖——且不依赖【手机适配】模块是否启用。 */
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
14801
|
+
/* 只在「功能坞弹层真的打开」时抬 z 序(:has 精确到 .dockm-dialog),其余时候不碰 DSH 原生浮层 */
|
|
14802
|
+
'@media (max-width:767px){body:has(.dockm-dialog) [class*="overlayLayer"]{z-index:100 !important}}',
|
|
14803
|
+
/* 手机:功能坞面板页的左侧菜单改成横向可滚动条,占满整行;页头与内边距收紧,「全屏」按钮在手机上无意义(侧栏本就是抽屉)故隐藏 */
|
|
14804
|
+
"@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}}",
|
|
14805
|
+
/* 手机自适应(≤767px,始终生效,不依赖任何功能开关):
|
|
14806
|
+
· 输入卡贴底(空会话时不再垂直居中留大片空白);
|
|
14807
|
+
· 输入卡里的「轮/步/token/缓存」状态条移到输入框上方,压成一行不溢出。 */
|
|
14808
|
+
'@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}}',
|
|
14809
|
+
/* 手机自适应:设置弹层内容给安全区内边距、会话滚动体留底部安全区、代码块横向滚动、
|
|
14810
|
+
行内代码可断行(窄屏不撑破版面)。 */
|
|
14811
|
+
'@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
14812
|
"@media (prefers-reduced-motion:reduce){.dockm-backdrop,.dockm-dialog{animation:none}.dockm-nav-item,.dockm-close,.dockm-win,.dock-sw{transition:none}}",
|
|
15092
14813
|
".dockh-desc{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.5;}",
|
|
15093
14814
|
".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 +14835,12 @@ var SHELL_CSS = [
|
|
|
15114
14835
|
".dockchip:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
|
|
15115
14836
|
".dockchip .dockchip-dot{width:6px;height:6px;border-radius:50%;flex:none;}",
|
|
15116
14837
|
".dockchip.err{color:var(--dsw-alias-state-error-primary);}",
|
|
15117
|
-
/*
|
|
15118
|
-
|
|
14838
|
+
/* 手机自适应:输入区工具行很窄——chip 字号/内距收紧、隐藏费用后缀与「余额」前缀,
|
|
14839
|
+
数值完整显示且工具行保持单行不换行(完整信息仍在 title 悬浮提示里)。 */
|
|
14840
|
+
".dockchip-pre-s{display:none;}",
|
|
14841
|
+
"@media (max-width:767px){.dockchip-row{max-width:min(216px,50cqw);gap:0}.dockchip-x{display:none}.dockchip-pre{display:none}.dockchip-ic{display:none}.dockchip-pre-s{display:inline}.dockchip{font-size:9.5px!important;line-height:16px!important;padding:0 1px!important;gap:2px!important}.dockchip .dockchip-dot{width:4px;height:4px}}",
|
|
14842
|
+
/* 手机触控基础:去点按蓝块、消双击缩放判定延迟;原生侧栏开关热区扩到 44×44(视觉不变)。 */
|
|
14843
|
+
`@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
14844
|
].join("\n");
|
|
15120
14845
|
var dockCssTag = null;
|
|
15121
14846
|
var initialCssSchedule = null;
|
|
@@ -15151,8 +14876,8 @@ function ensureCss() {
|
|
|
15151
14876
|
}
|
|
15152
14877
|
}
|
|
15153
14878
|
function useExternalVersion() {
|
|
15154
|
-
const [, bump] =
|
|
15155
|
-
|
|
14879
|
+
const [, bump] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
14880
|
+
import_react24.default.useEffect(() => {
|
|
15156
14881
|
externalListeners.add(bump);
|
|
15157
14882
|
return () => {
|
|
15158
14883
|
externalListeners.delete(bump);
|
|
@@ -15162,33 +14887,148 @@ function useExternalVersion() {
|
|
|
15162
14887
|
var lastGeom = { x: null, y: null, w: null, h: null };
|
|
15163
14888
|
function DockIcon(props) {
|
|
15164
14889
|
const size = props && props.size || 16;
|
|
15165
|
-
return
|
|
14890
|
+
return import_react24.default.createElement(
|
|
15166
14891
|
"svg",
|
|
15167
14892
|
{ width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.3, "aria-hidden": true },
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
14893
|
+
import_react24.default.createElement("rect", { x: 2.5, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
14894
|
+
import_react24.default.createElement("rect", { x: 9, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
14895
|
+
import_react24.default.createElement("rect", { x: 2.5, y: 9, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
14896
|
+
import_react24.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
|
|
15172
14897
|
);
|
|
15173
14898
|
}
|
|
15174
|
-
function
|
|
15175
|
-
const [nav, setNav] =
|
|
15176
|
-
|
|
15177
|
-
const open = nav.open || typeof document === "undefined";
|
|
14899
|
+
function DockWorkspace() {
|
|
14900
|
+
const [nav, setNav] = import_react24.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
|
|
14901
|
+
import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
|
|
15178
14902
|
const active = nav.active;
|
|
15179
|
-
const setActive = navigatePanel;
|
|
15180
14903
|
const navParams = nav.params;
|
|
15181
|
-
const
|
|
14904
|
+
const setActive = navigatePanel;
|
|
14905
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15182
14906
|
useExternalVersion();
|
|
15183
|
-
const
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
14907
|
+
const contentRef = import_react24.default.useRef(null);
|
|
14908
|
+
import_react24.default.useEffect(() => {
|
|
14909
|
+
if (contentRef.current) contentRef.current.scrollTop = 0;
|
|
14910
|
+
}, [active]);
|
|
14911
|
+
const MODULES = allModules();
|
|
14912
|
+
const isHome = active === "home";
|
|
14913
|
+
const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
|
|
14914
|
+
const st = mod ? stateOf(mod.id) : null;
|
|
14915
|
+
const View = mod ? mod.View : null;
|
|
14916
|
+
const viewNode = mod && View ? import_react24.default.createElement(
|
|
14917
|
+
"div",
|
|
14918
|
+
{ className: "dockm-view" },
|
|
14919
|
+
import_react24.default.createElement(
|
|
14920
|
+
FeatureBoundary,
|
|
14921
|
+
{ key: mod.id, label: mod.name },
|
|
14922
|
+
import_react24.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
|
|
14923
|
+
)
|
|
14924
|
+
) : null;
|
|
14925
|
+
const enabledCount = MODULES.filter((m) => {
|
|
14926
|
+
const s = stateOf(m.id);
|
|
14927
|
+
return !!(s && s.enabled);
|
|
14928
|
+
}).length;
|
|
14929
|
+
return import_react24.default.createElement(
|
|
14930
|
+
"div",
|
|
14931
|
+
{ className: "dockm-body" },
|
|
14932
|
+
import_react24.default.createElement(
|
|
14933
|
+
"nav",
|
|
14934
|
+
{ className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
|
|
14935
|
+
import_react24.default.createElement(
|
|
14936
|
+
"button",
|
|
14937
|
+
{
|
|
14938
|
+
type: "button",
|
|
14939
|
+
key: "home",
|
|
14940
|
+
className: "dockm-nav-item" + (isHome ? " on" : ""),
|
|
14941
|
+
onClick: () => setActive("home")
|
|
14942
|
+
},
|
|
14943
|
+
import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)),
|
|
14944
|
+
import_react24.default.createElement("span", null, "\u9996\u9875")
|
|
14945
|
+
),
|
|
14946
|
+
MODULES.map((m) => import_react24.default.createElement(
|
|
14947
|
+
"button",
|
|
14948
|
+
{
|
|
14949
|
+
type: "button",
|
|
14950
|
+
key: m.id,
|
|
14951
|
+
className: "dockm-nav-item" + (m.id === active ? " on" : ""),
|
|
14952
|
+
onClick: () => setActive(m.id)
|
|
14953
|
+
},
|
|
14954
|
+
import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
14955
|
+
import_react24.default.createElement("span", null, m.name),
|
|
14956
|
+
m.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14957
|
+
m.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
|
|
14958
|
+
))
|
|
14959
|
+
),
|
|
14960
|
+
import_react24.default.createElement(
|
|
14961
|
+
"div",
|
|
14962
|
+
{ className: "dockm-content", ref: contentRef },
|
|
14963
|
+
import_react24.default.createElement(
|
|
14964
|
+
"div",
|
|
14965
|
+
{ className: "dockm-content-head" },
|
|
14966
|
+
import_react24.default.createElement(
|
|
14967
|
+
"div",
|
|
14968
|
+
{ className: "dockm-name" },
|
|
14969
|
+
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 } }),
|
|
14970
|
+
isHome ? "\u9996\u9875" : mod.name,
|
|
14971
|
+
!isHome && mod.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14972
|
+
!isHome && mod.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
|
|
14973
|
+
),
|
|
14974
|
+
import_react24.default.createElement(
|
|
14975
|
+
"div",
|
|
14976
|
+
{ className: "dockm-desc" },
|
|
14977
|
+
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
|
|
14978
|
+
)
|
|
14979
|
+
),
|
|
14980
|
+
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"),
|
|
14981
|
+
import_react24.default.createElement(
|
|
14982
|
+
"div",
|
|
14983
|
+
{ className: "dockm-foot" },
|
|
14984
|
+
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"),
|
|
14985
|
+
!isHome && mod && !mod.planned && st ? import_react24.default.createElement(
|
|
14986
|
+
"span",
|
|
14987
|
+
{ className: "dockm-foot-sw" },
|
|
14988
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
|
|
14989
|
+
import_react24.default.createElement("button", {
|
|
14990
|
+
type: "button",
|
|
14991
|
+
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
14992
|
+
role: "switch",
|
|
14993
|
+
"aria-checked": !!st.enabled,
|
|
14994
|
+
"aria-label": (st.enabled ? "\u505C\u7528" : "\u542F\u7528") + mod.name,
|
|
14995
|
+
title: st.enabled ? "\u505C\u7528\u300C" + mod.name + "\u300D" : "\u542F\u7528\u300C" + mod.name + "\u300D",
|
|
14996
|
+
onClick: () => {
|
|
14997
|
+
toggleFeature(mod.id);
|
|
14998
|
+
force();
|
|
14999
|
+
}
|
|
15000
|
+
})
|
|
15001
|
+
) : null,
|
|
15002
|
+
!isHome && mod && typeof mod.Chip === "function" ? import_react24.default.createElement(
|
|
15003
|
+
"span",
|
|
15004
|
+
{ className: "dockm-foot-sw" },
|
|
15005
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
15006
|
+
import_react24.default.createElement("button", {
|
|
15007
|
+
type: "button",
|
|
15008
|
+
className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
|
|
15009
|
+
role: "switch",
|
|
15010
|
+
"aria-checked": chipShown(mod.id),
|
|
15011
|
+
"aria-label": (chipShown(mod.id) ? "\u9690\u85CF" : "\u663E\u793A") + mod.name + "\u7684\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6",
|
|
15012
|
+
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",
|
|
15013
|
+
onClick: () => {
|
|
15014
|
+
setChipShown(mod.id, !chipShown(mod.id));
|
|
15015
|
+
force();
|
|
15016
|
+
}
|
|
15017
|
+
})
|
|
15018
|
+
) : null
|
|
15019
|
+
)
|
|
15020
|
+
)
|
|
15021
|
+
);
|
|
15022
|
+
}
|
|
15023
|
+
function DockModal() {
|
|
15024
|
+
const [nav, setNav] = import_react24.default.useState({ open: panelNav.open });
|
|
15025
|
+
import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
|
|
15026
|
+
const open = nav.open || typeof document === "undefined";
|
|
15027
|
+
const [win, setWin] = import_react24.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
|
|
15028
|
+
const dlgRef = import_react24.default.useRef(null);
|
|
15029
|
+
import_react24.default.useEffect(() => {
|
|
15187
15030
|
if (lastGeom.w) setWin({ mode: "normal", x: lastGeom.x, y: lastGeom.y, w: lastGeom.w, h: lastGeom.h });
|
|
15188
15031
|
}, []);
|
|
15189
|
-
import_react26.default.useEffect(() => {
|
|
15190
|
-
if (open && contentRef.current) contentRef.current.scrollTop = 0;
|
|
15191
|
-
}, [active, open]);
|
|
15192
15032
|
function beginDrag(e, type) {
|
|
15193
15033
|
if (win.mode !== "normal" || e.button !== 0) return;
|
|
15194
15034
|
if (type === "move" && e.target && e.target.closest && e.target.closest("button,select,input")) return;
|
|
@@ -15219,24 +15059,6 @@ function DockModal() {
|
|
|
15219
15059
|
window.addEventListener("pointerup", onUp);
|
|
15220
15060
|
}
|
|
15221
15061
|
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
15062
|
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
15063
|
position: "fixed",
|
|
15242
15064
|
left: win.x != null ? win.x : void 0,
|
|
@@ -15244,10 +15066,10 @@ function DockModal() {
|
|
|
15244
15066
|
width: win.w != null ? win.w : void 0,
|
|
15245
15067
|
height: win.mode === "min" ? "auto" : win.h != null ? win.h : void 0
|
|
15246
15068
|
} : null;
|
|
15247
|
-
return
|
|
15069
|
+
return import_react24.default.createElement(
|
|
15248
15070
|
"div",
|
|
15249
15071
|
{ className: "dockm-backdrop", onClick: () => setPanelOpen(false) },
|
|
15250
|
-
|
|
15072
|
+
import_react24.default.createElement(
|
|
15251
15073
|
"div",
|
|
15252
15074
|
{
|
|
15253
15075
|
className: "dockm-dialog" + (win.mode === "max" ? " dockm-max" : "") + (win.mode === "min" ? " dockm-min" : ""),
|
|
@@ -15255,151 +15077,59 @@ function DockModal() {
|
|
|
15255
15077
|
ref: dlgRef,
|
|
15256
15078
|
onClick: (e) => e.stopPropagation()
|
|
15257
15079
|
},
|
|
15258
|
-
|
|
15080
|
+
import_react24.default.createElement(
|
|
15259
15081
|
"div",
|
|
15260
15082
|
{
|
|
15261
15083
|
className: "dockm-head",
|
|
15262
15084
|
onPointerDown: (e) => beginDrag(e, "move"),
|
|
15263
15085
|
onDoubleClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
|
|
15264
15086
|
},
|
|
15265
|
-
|
|
15266
|
-
|
|
15267
|
-
|
|
15268
|
-
|
|
15087
|
+
import_react24.default.createElement(DockIcon, null),
|
|
15088
|
+
import_react24.default.createElement("span", { className: "dockm-title" }, "\u529F\u80FD\u575E"),
|
|
15089
|
+
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"),
|
|
15090
|
+
import_react24.default.createElement(
|
|
15269
15091
|
"span",
|
|
15270
15092
|
{ className: "dockm-ctrls" },
|
|
15271
|
-
|
|
15093
|
+
import_react24.default.createElement("button", {
|
|
15272
15094
|
type: "button",
|
|
15273
15095
|
className: "dockm-win",
|
|
15274
15096
|
title: win.mode === "min" ? "\u8FD8\u539F" : "\u6700\u5C0F\u5316",
|
|
15275
15097
|
onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "min" ? "normal" : "min" }))
|
|
15276
15098
|
}, "\u2581"),
|
|
15277
|
-
|
|
15099
|
+
import_react24.default.createElement("button", {
|
|
15278
15100
|
type: "button",
|
|
15279
15101
|
className: "dockm-win",
|
|
15280
15102
|
title: win.mode === "max" ? "\u8FD8\u539F" : "\u6700\u5927\u5316",
|
|
15281
15103
|
onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
|
|
15282
15104
|
}, win.mode === "max" ? "\u2750" : "\u25A2"),
|
|
15283
|
-
|
|
15284
|
-
)
|
|
15285
|
-
),
|
|
15286
|
-
import_react26.default.createElement(
|
|
15287
|
-
"div",
|
|
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
|
-
)
|
|
15105
|
+
import_react24.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
|
|
15377
15106
|
)
|
|
15378
15107
|
),
|
|
15379
|
-
|
|
15108
|
+
import_react24.default.createElement(DockWorkspace, null),
|
|
15109
|
+
win.mode === "normal" ? import_react24.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
|
|
15380
15110
|
)
|
|
15381
15111
|
);
|
|
15382
15112
|
}
|
|
15383
15113
|
function HomeView(props) {
|
|
15384
15114
|
const ctx = props && props.ctx;
|
|
15385
|
-
const [, force] =
|
|
15115
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15386
15116
|
useExternalVersion();
|
|
15387
15117
|
const open = (id) => {
|
|
15388
15118
|
if (props && typeof props.onOpen === "function") props.onOpen(id);
|
|
15389
15119
|
};
|
|
15390
|
-
return
|
|
15120
|
+
return import_react24.default.createElement(
|
|
15391
15121
|
"div",
|
|
15392
15122
|
{ className: "dockh-grid" },
|
|
15393
15123
|
allModules().map((m) => {
|
|
15394
15124
|
const st = stateOf(m.id);
|
|
15395
15125
|
const enabled = !!(st && st.enabled);
|
|
15396
15126
|
const Stat = m.HomeStat;
|
|
15397
|
-
const statNode = m.planned ?
|
|
15127
|
+
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
15128
|
FeatureBoundary,
|
|
15399
15129
|
{ key: m.id, label: m.name },
|
|
15400
|
-
|
|
15401
|
-
) :
|
|
15402
|
-
return
|
|
15130
|
+
import_react24.default.createElement(Stat, { ctx })
|
|
15131
|
+
) : import_react24.default.createElement("span", null, "\u5DF2\u505C\u7528\uFF0C\u542F\u7528\u540E\u5728\u6B64\u5C55\u793A\u8FD0\u884C\u6982\u8981");
|
|
15132
|
+
return import_react24.default.createElement(
|
|
15403
15133
|
"div",
|
|
15404
15134
|
{
|
|
15405
15135
|
key: m.id,
|
|
@@ -15414,21 +15144,21 @@ function HomeView(props) {
|
|
|
15414
15144
|
}
|
|
15415
15145
|
}
|
|
15416
15146
|
},
|
|
15417
|
-
|
|
15147
|
+
import_react24.default.createElement(
|
|
15418
15148
|
"div",
|
|
15419
15149
|
{ className: "dockh-head" },
|
|
15420
|
-
|
|
15421
|
-
|
|
15422
|
-
m.external ?
|
|
15150
|
+
import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
15151
|
+
import_react24.default.createElement("span", { className: "dockh-name" }, m.name),
|
|
15152
|
+
m.external ? import_react24.default.createElement("span", { className: "dockh-badge", title: m.package || void 0 }, "\u5916\u90E8") : null,
|
|
15423
15153
|
// 状态标识:圆点 + 文字(纯展示,与开关视觉区分)
|
|
15424
|
-
|
|
15154
|
+
import_react24.default.createElement(
|
|
15425
15155
|
"span",
|
|
15426
15156
|
{ className: "dockh-status" + (m.planned ? " plan" : enabled ? "" : " off") },
|
|
15427
|
-
|
|
15428
|
-
|
|
15157
|
+
import_react24.default.createElement("span", { className: "dockh-sdot" }),
|
|
15158
|
+
import_react24.default.createElement("span", null, m.planned ? "\u89C4\u5212\u4E2D" : enabled ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u505C\u7528")
|
|
15429
15159
|
),
|
|
15430
15160
|
// 启停开关(规划中的功能不显示)
|
|
15431
|
-
m.planned ? null :
|
|
15161
|
+
m.planned ? null : import_react24.default.createElement("button", {
|
|
15432
15162
|
type: "button",
|
|
15433
15163
|
className: "dock-sw" + (enabled ? " on" : ""),
|
|
15434
15164
|
role: "switch",
|
|
@@ -15443,12 +15173,12 @@ function HomeView(props) {
|
|
|
15443
15173
|
}
|
|
15444
15174
|
})
|
|
15445
15175
|
),
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
|
|
15176
|
+
import_react24.default.createElement("div", { className: "dockh-desc" }, m.description),
|
|
15177
|
+
import_react24.default.createElement("div", { className: "dockh-stat" }, statNode),
|
|
15178
|
+
import_react24.default.createElement(
|
|
15449
15179
|
"div",
|
|
15450
15180
|
{ className: "dockh-foot" },
|
|
15451
|
-
|
|
15181
|
+
import_react24.default.createElement("span", { className: "dockh-go" }, "\u67E5\u770B\u8BE6\u60C5 \u2192")
|
|
15452
15182
|
)
|
|
15453
15183
|
);
|
|
15454
15184
|
})
|
|
@@ -15456,16 +15186,16 @@ function HomeView(props) {
|
|
|
15456
15186
|
}
|
|
15457
15187
|
function DockPanel(props) {
|
|
15458
15188
|
const ctx = ctxRef.current;
|
|
15459
|
-
const [, force] =
|
|
15189
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15460
15190
|
useExternalVersion();
|
|
15461
15191
|
const toggle = (id) => {
|
|
15462
15192
|
toggleFeature(id);
|
|
15463
15193
|
force();
|
|
15464
15194
|
};
|
|
15465
|
-
return
|
|
15195
|
+
return import_react24.default.createElement(
|
|
15466
15196
|
"div",
|
|
15467
15197
|
{ className: "dock-root" },
|
|
15468
|
-
|
|
15198
|
+
import_react24.default.createElement(
|
|
15469
15199
|
"div",
|
|
15470
15200
|
{ className: "dock-intro" },
|
|
15471
15201
|
"\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 +15204,25 @@ function DockPanel(props) {
|
|
|
15474
15204
|
allModules().map((f) => {
|
|
15475
15205
|
const st = stateOf(f.id);
|
|
15476
15206
|
const View = f.View;
|
|
15477
|
-
const viewNode = !f.planned && st.enabled && View ?
|
|
15207
|
+
const viewNode = !f.planned && st.enabled && View ? import_react24.default.createElement(
|
|
15478
15208
|
"div",
|
|
15479
15209
|
{ className: "dock-body" },
|
|
15480
|
-
|
|
15210
|
+
import_react24.default.createElement(
|
|
15481
15211
|
FeatureBoundary,
|
|
15482
15212
|
{ key: f.id, label: f.name },
|
|
15483
|
-
|
|
15213
|
+
import_react24.default.createElement(View, { ctx, feature: f, params: props && props.params })
|
|
15484
15214
|
)
|
|
15485
15215
|
) : null;
|
|
15486
|
-
return
|
|
15216
|
+
return import_react24.default.createElement(
|
|
15487
15217
|
"div",
|
|
15488
15218
|
{ className: "dock-card", key: f.id },
|
|
15489
|
-
|
|
15219
|
+
import_react24.default.createElement(
|
|
15490
15220
|
"div",
|
|
15491
15221
|
{ className: "dock-card-head" },
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
f.planned ?
|
|
15222
|
+
import_react24.default.createElement("span", { className: "dock-dot" + (st.error ? " err" : st.enabled ? " on" : "") }),
|
|
15223
|
+
import_react24.default.createElement("span", { className: "dock-name" }, f.name),
|
|
15224
|
+
import_react24.default.createElement("span", { className: "dock-desc" }, f.description + (f.external ? "\uFF08\u6765\u81EA\u5916\u90E8\u5305" + (f.package ? " " + f.package : "") + "\uFF09" : "")),
|
|
15225
|
+
f.planned ? import_react24.default.createElement("span", { className: "dock-badge" }, "\u89C4\u5212\u4E2D") : import_react24.default.createElement("button", {
|
|
15496
15226
|
type: "button",
|
|
15497
15227
|
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
15498
15228
|
role: "switch",
|
|
@@ -15501,11 +15231,11 @@ function DockPanel(props) {
|
|
|
15501
15231
|
title: st.enabled ? "\u505C\u7528\u300C" + f.name + "\u300D" : "\u542F\u7528\u300C" + f.name + "\u300D",
|
|
15502
15232
|
onClick: () => toggle(f.id)
|
|
15503
15233
|
}),
|
|
15504
|
-
!f.planned && typeof f.Chip === "function" ?
|
|
15234
|
+
!f.planned && typeof f.Chip === "function" ? import_react24.default.createElement(
|
|
15505
15235
|
"span",
|
|
15506
15236
|
{ className: "dockm-foot-sw" },
|
|
15507
|
-
|
|
15508
|
-
|
|
15237
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(f.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
15238
|
+
import_react24.default.createElement("button", {
|
|
15509
15239
|
type: "button",
|
|
15510
15240
|
className: "dock-sw" + (chipShown(f.id) ? " on" : ""),
|
|
15511
15241
|
role: "switch",
|
|
@@ -15519,40 +15249,59 @@ function DockPanel(props) {
|
|
|
15519
15249
|
})
|
|
15520
15250
|
) : null
|
|
15521
15251
|
),
|
|
15522
|
-
f.planned ?
|
|
15252
|
+
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
15253
|
viewNode
|
|
15524
15254
|
);
|
|
15525
15255
|
})
|
|
15526
15256
|
);
|
|
15527
15257
|
}
|
|
15528
15258
|
function DockPage() {
|
|
15529
|
-
|
|
15259
|
+
const ctx = ctxRef.current;
|
|
15260
|
+
const [wide, setWide] = import_react24.default.useState(false);
|
|
15261
|
+
const toggleWide = () => {
|
|
15262
|
+
try {
|
|
15263
|
+
const layout = ctx && typeof ctx.get === "function" ? ctx.get("layout") : null;
|
|
15264
|
+
if (layout && typeof layout.toggleSidebar === "function") {
|
|
15265
|
+
layout.toggleSidebar();
|
|
15266
|
+
setWide((v) => !v);
|
|
15267
|
+
}
|
|
15268
|
+
} catch (e) {
|
|
15269
|
+
}
|
|
15270
|
+
};
|
|
15271
|
+
return import_react24.default.createElement(
|
|
15530
15272
|
"div",
|
|
15531
|
-
{ className: "dockm-page" },
|
|
15532
|
-
|
|
15273
|
+
{ className: "dockm-page" + (wide ? " dockm-page-wide" : "") },
|
|
15274
|
+
import_react24.default.createElement(
|
|
15533
15275
|
"div",
|
|
15534
15276
|
{ className: "dockm-page-head" },
|
|
15535
|
-
|
|
15536
|
-
|
|
15277
|
+
import_react24.default.createElement("span", { className: "dockm-page-icon" }, import_react24.default.createElement(DockIcon, { size: 20 })),
|
|
15278
|
+
import_react24.default.createElement(
|
|
15537
15279
|
"div",
|
|
15538
15280
|
{ className: "dockm-page-titles" },
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
)
|
|
15281
|
+
import_react24.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
|
|
15282
|
+
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")
|
|
15283
|
+
),
|
|
15284
|
+
import_react24.default.createElement("button", {
|
|
15285
|
+
type: "button",
|
|
15286
|
+
className: "dockm-page-wide-btn",
|
|
15287
|
+
title: wide ? "\u8FD8\u539F\u4FA7\u680F\u5BBD\u5EA6" : "\u6536\u8D77\u5DE6\u4FA7\u680F\uFF0C\u5168\u5C4F\u663E\u793A\u529F\u80FD\u575E",
|
|
15288
|
+
"aria-label": wide ? "\u8FD8\u539F\u5BBD\u5EA6" : "\u5168\u5C4F",
|
|
15289
|
+
onClick: toggleWide
|
|
15290
|
+
}, wide ? "\u2750 \u8FD8\u539F" : "\u25A2 \u5168\u5C4F")
|
|
15542
15291
|
),
|
|
15543
|
-
|
|
15292
|
+
import_react24.default.createElement("div", { className: "dockm-page-body" }, import_react24.default.createElement(DockWorkspace, null))
|
|
15544
15293
|
);
|
|
15545
15294
|
}
|
|
15546
15295
|
function DockChips(props) {
|
|
15547
|
-
const [, force] =
|
|
15548
|
-
|
|
15296
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15297
|
+
import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
15549
15298
|
const items = [];
|
|
15550
15299
|
for (const f of allModules()) {
|
|
15551
15300
|
if (f.planned || !stateOf(f.id).enabled || !chipShown(f.id) || typeof f.Chip !== "function") continue;
|
|
15552
|
-
items.push(
|
|
15301
|
+
items.push(import_react24.default.createElement(
|
|
15553
15302
|
FeatureBoundary,
|
|
15554
15303
|
{ key: f.id, label: f.name },
|
|
15555
|
-
|
|
15304
|
+
import_react24.default.createElement(f.Chip, {
|
|
15556
15305
|
ctx: props.ctx,
|
|
15557
15306
|
feature: f,
|
|
15558
15307
|
session: props.session,
|
|
@@ -15562,38 +15311,38 @@ function DockChips(props) {
|
|
|
15562
15311
|
));
|
|
15563
15312
|
}
|
|
15564
15313
|
if (items.length === 0) return null;
|
|
15565
|
-
return
|
|
15314
|
+
return import_react24.default.createElement("div", { className: "dockchip-row" }, items);
|
|
15566
15315
|
}
|
|
15567
15316
|
function FeatureOverlays() {
|
|
15568
|
-
const [, force] =
|
|
15317
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15569
15318
|
useExternalVersion();
|
|
15570
|
-
|
|
15319
|
+
import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
15571
15320
|
const items = [];
|
|
15572
15321
|
for (const f of allModules()) {
|
|
15573
15322
|
if (f.planned || !stateOf(f.id).enabled || typeof f.Overlay !== "function") continue;
|
|
15574
|
-
items.push(
|
|
15323
|
+
items.push(import_react24.default.createElement(
|
|
15575
15324
|
FeatureBoundary,
|
|
15576
15325
|
{ key: f.id, label: f.name },
|
|
15577
|
-
|
|
15326
|
+
import_react24.default.createElement(f.Overlay, { ctx: ctxRef.current, feature: f })
|
|
15578
15327
|
));
|
|
15579
15328
|
}
|
|
15580
15329
|
if (items.length === 0) return null;
|
|
15581
|
-
return
|
|
15330
|
+
return import_react24.default.createElement(import_react24.default.Fragment, null, items);
|
|
15582
15331
|
}
|
|
15583
15332
|
function FeatureTurnTail(props) {
|
|
15584
|
-
const [, force] =
|
|
15585
|
-
|
|
15333
|
+
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
15334
|
+
import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
15586
15335
|
const items = [];
|
|
15587
15336
|
for (const f of allModules()) {
|
|
15588
15337
|
if (f.planned || !stateOf(f.id).enabled || typeof f.TurnTail !== "function") continue;
|
|
15589
|
-
items.push(
|
|
15338
|
+
items.push(import_react24.default.createElement(
|
|
15590
15339
|
FeatureBoundary,
|
|
15591
15340
|
{ key: f.id, label: f.name },
|
|
15592
|
-
|
|
15341
|
+
import_react24.default.createElement(f.TurnTail, Object.assign({}, props, { ctx: ctxRef.current, feature: f }))
|
|
15593
15342
|
));
|
|
15594
15343
|
}
|
|
15595
15344
|
if (items.length === 0) return null;
|
|
15596
|
-
return
|
|
15345
|
+
return import_react24.default.createElement(import_react24.default.Fragment, null, items);
|
|
15597
15346
|
}
|
|
15598
15347
|
var ctxRef = { current: null };
|
|
15599
15348
|
function apply(ctx) {
|
|
@@ -15604,31 +15353,31 @@ function apply(ctx) {
|
|
|
15604
15353
|
if (slots === void 0) return;
|
|
15605
15354
|
slots.inject("sidebar.panellist", () => slots.register(
|
|
15606
15355
|
{ name: "sidebar.panellist", id: "dsh-dock", order: 30, label: "\u529F\u80FD\u575E" },
|
|
15607
|
-
(props) =>
|
|
15356
|
+
(props) => import_react24.default.createElement(DockIcon, { size: props && props.size || 18 })
|
|
15608
15357
|
));
|
|
15609
15358
|
slots.inject("main", () => slots.register(
|
|
15610
15359
|
{ name: "main", key: "dsh-dock", label: "\u529F\u80FD\u575E" },
|
|
15611
|
-
() =>
|
|
15360
|
+
() => import_react24.default.createElement(DockPage, null)
|
|
15612
15361
|
));
|
|
15613
15362
|
slots.inject("shell.overlay", () => slots.register(
|
|
15614
15363
|
{ name: "shell.overlay", id: "dsh-dock-panel", order: 21, label: "\u529F\u80FD\u575E\u9762\u677F" },
|
|
15615
|
-
() =>
|
|
15364
|
+
() => import_react24.default.createElement(DockModal, null)
|
|
15616
15365
|
));
|
|
15617
15366
|
slots.inject("shell.overlay", () => slots.register(
|
|
15618
15367
|
{ name: "shell.overlay", id: "dsh-dock-feature-overlays", order: 22, label: "\u529F\u80FD\u575E\u5168\u5C40\u6D6E\u5C42" },
|
|
15619
|
-
() =>
|
|
15368
|
+
() => import_react24.default.createElement(FeatureOverlays, null)
|
|
15620
15369
|
));
|
|
15621
15370
|
slots.inject("settings.section", () => slots.register(
|
|
15622
15371
|
{ name: "settings.section", id: "dsh-dock", order: 90, label: "\u529F\u80FD\u575E" },
|
|
15623
|
-
(props) =>
|
|
15372
|
+
(props) => import_react24.default.createElement(DockPanel, props)
|
|
15624
15373
|
));
|
|
15625
15374
|
slots.inject("conversation.input.left", () => slots.register(
|
|
15626
15375
|
{ name: "conversation.input.left", id: "dsh-dock-chips", order: 10, label: "\u529F\u80FD\u575E" },
|
|
15627
|
-
(zone) =>
|
|
15376
|
+
(zone) => import_react24.default.createElement(DockChips, Object.assign({}, zone, { ctx: ctxRef.current }))
|
|
15628
15377
|
));
|
|
15629
15378
|
slots.inject("conversation.chat.turnTail", () => slots.register(
|
|
15630
15379
|
{ name: "conversation.chat.turnTail", id: "dsh-dock-turn-tail", order: 40, label: "\u529F\u80FD\u575E" },
|
|
15631
|
-
(owner) =>
|
|
15380
|
+
(owner) => import_react24.default.createElement(FeatureTurnTail, owner)
|
|
15632
15381
|
));
|
|
15633
15382
|
}
|
|
15634
15383
|
var inject = ["timer"];
|