@artenx/dshb 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +26 -23
- package/lib/client.js.map +1 -1
- package/lib/exec-docker/docker-backend.d.ts +1 -0
- package/lib/exec-docker/docker-client.d.ts +1 -0
- package/lib/exec-docker/docker-client.js +18 -2
- package/lib/exec-docker/docker-client.js.map +1 -1
- package/lib/exec-docker/fs-provider.d.ts +4 -0
- package/lib/exec-docker/fs-provider.js +4 -0
- package/lib/exec-docker/fs-provider.js.map +1 -1
- package/lib/exec-docker/remote-docker-cli.d.ts +1 -0
- package/lib/exec-docker/remote-docker-cli.js +20 -3
- package/lib/exec-docker/remote-docker-cli.js.map +1 -1
- package/lib/exec-docker/world.d.ts +1 -1
- package/lib/exec-ssh/executor.d.ts +1 -0
- package/lib/exec-ssh/executor.js +25 -0
- package/lib/exec-ssh/executor.js.map +1 -1
- package/lib/exec-ssh/fs-provider.d.ts +4 -0
- package/lib/exec-ssh/fs-provider.js +4 -0
- package/lib/exec-ssh/fs-provider.js.map +1 -1
- package/lib/exec-ssh/world.d.ts +1 -1
- package/lib/router/decorate-fs.js +13 -0
- package/lib/router/decorate-fs.js.map +1 -1
- package/lib/router/decorate-shell.d.ts +1 -1
- package/lib/router/index.d.ts +1 -1
- package/lib/router/resolve.d.ts +1 -1
- package/lib/router/router-fs.d.ts +4 -0
- package/lib/router/router-fs.js +9 -0
- package/lib/router/router-fs.js.map +1 -1
- package/lib/router/types.d.ts +1 -1
- package/lib/{types-DPP05ZsA.d.ts → types-_0vpT-jm.d.ts} +5 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1223,6 +1223,14 @@ window.__ModuleLoader__.load({
|
|
|
1223
1223
|
scrollbar-width: none;
|
|
1224
1224
|
touch-action: pan-x pan-y !important;
|
|
1225
1225
|
}
|
|
1226
|
+
/* xterm uses a transparent helper textarea for all terminal input. Keep it
|
|
1227
|
+
focusable and non-zero-sized so mobile browsers can present their keyboard. */
|
|
1228
|
+
[data-phase] .xterm .xterm-helper-textarea {
|
|
1229
|
+
width: 1px !important;
|
|
1230
|
+
height: 1px !important;
|
|
1231
|
+
opacity: .01 !important;
|
|
1232
|
+
z-index: 1 !important;
|
|
1233
|
+
}
|
|
1226
1234
|
[data-phase] [class*="bodyScroll"]::-webkit-scrollbar,
|
|
1227
1235
|
[data-phase] [class*="ioCard"]::-webkit-scrollbar,
|
|
1228
1236
|
[data-phase] [class*="ioSection"]::-webkit-scrollbar,
|
|
@@ -1772,6 +1780,23 @@ window.__ModuleLoader__.load({
|
|
|
1772
1780
|
};
|
|
1773
1781
|
}, "dshb-mobile: context panel position");
|
|
1774
1782
|
}
|
|
1783
|
+
function installMobileTerminalInputFocus(ctx) {
|
|
1784
|
+
ctx.effect(() => {
|
|
1785
|
+
const mobile = window.matchMedia(MOBILE_QUERY);
|
|
1786
|
+
const focusInput = (event) => {
|
|
1787
|
+
if (!mobile.matches || !(event.target instanceof Element)) return;
|
|
1788
|
+
const textarea = event.target.closest(".xterm")?.querySelector(".xterm-helper-textarea");
|
|
1789
|
+
if (!textarea || textarea.readOnly) return;
|
|
1790
|
+
textarea.inputMode = "text";
|
|
1791
|
+
textarea.focus({ preventScroll: true });
|
|
1792
|
+
try {
|
|
1793
|
+
navigator.virtualKeyboard?.show?.();
|
|
1794
|
+
} catch {}
|
|
1795
|
+
};
|
|
1796
|
+
document.addEventListener("pointerdown", focusInput, true);
|
|
1797
|
+
return () => document.removeEventListener("pointerdown", focusInput, true);
|
|
1798
|
+
}, "dshb-mobile: terminal input focus");
|
|
1799
|
+
}
|
|
1775
1800
|
/** 目录抽屉切换按钮(仅切换,不含文件浏览/日志导出等功能按钮)。 */
|
|
1776
1801
|
function DrawerToggle({ toggleSidebar }) {
|
|
1777
1802
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -1861,6 +1886,7 @@ window.__ModuleLoader__.load({
|
|
|
1861
1886
|
/** 安装移动端适配:样式 + viewport + 抽屉标记 + 抽屉交互 + 切换按钮。 */
|
|
1862
1887
|
function installMobile(ctx) {
|
|
1863
1888
|
installStyles(ctx);
|
|
1889
|
+
installMobileTerminalInputFocus(ctx);
|
|
1864
1890
|
installViewport(ctx);
|
|
1865
1891
|
installFrameMarker(ctx);
|
|
1866
1892
|
installStatsLine(ctx);
|
|
@@ -3026,29 +3052,6 @@ window.__ModuleLoader__.load({
|
|
|
3026
3052
|
}, DirectoryFlowOccupant));
|
|
3027
3053
|
}
|
|
3028
3054
|
});
|
|
3029
|
-
const workspaces = ctx.workspaces;
|
|
3030
|
-
if (workspaces && typeof workspaces.openPath === "function") {
|
|
3031
|
-
const originalOpenPath = workspaces.openPath.bind(workspaces);
|
|
3032
|
-
workspaces.openPath = async (path) => {
|
|
3033
|
-
try {
|
|
3034
|
-
const res = await fetch(`/api/dshb/remote/bound?path=${encodeURIComponent(path)}`);
|
|
3035
|
-
if (res.ok) {
|
|
3036
|
-
const data = await res.json();
|
|
3037
|
-
if (data.bound) {
|
|
3038
|
-
if (data.kind !== "file") return originalOpenPath(path);
|
|
3039
|
-
const a = document.createElement("a");
|
|
3040
|
-
a.href = `/api/dshb/remote/file?path=${encodeURIComponent(path)}`;
|
|
3041
|
-
a.download = "";
|
|
3042
|
-
document.body.appendChild(a);
|
|
3043
|
-
a.click();
|
|
3044
|
-
a.remove();
|
|
3045
|
-
return;
|
|
3046
|
-
}
|
|
3047
|
-
}
|
|
3048
|
-
} catch {}
|
|
3049
|
-
return originalOpenPath(path);
|
|
3050
|
-
};
|
|
3051
|
-
}
|
|
3052
3055
|
const ICON_SVG = {
|
|
3053
3056
|
auth: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 7C9.3807 7 10.5 5.8807 10.5 4.5C10.5 3.1193 9.3807 2 8 2C6.6193 2 5.5 3.1193 5.5 4.5C5.5 5.8807 6.6193 7 8 7Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 14C3 11.2386 5.2386 9 8 9C10.7614 9 13 11.2386 13 14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
|
3054
3057
|
"dshb-nodes": `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="3.5" cy="4" r="2" stroke="currentColor" stroke-width="1.5"/><circle cx="12.5" cy="4" r="2" stroke="currentColor" stroke-width="1.5"/><circle cx="8" cy="12" r="2" stroke="currentColor" stroke-width="1.5"/><path d="M3.5 6V8C3.5 9.1 4.4 10 5.5 10H8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M12.5 6V8C12.5 9.1 11.6 10 10.5 10H8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>`
|