@lemoncat7/dsh-ssh 1.16.20 → 1.16.22

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.
@@ -1,8 +1,8 @@
1
- import { type RefObject } from 'react';
2
- /**
3
- * Place the plugin's official footer-slot contribution above Workspace without
4
- * replacing the single `sidebar.workspaces` slot. If the current sidebar shell
5
- * cannot be identified, the entry remains in the supported footer slot.
6
- */
7
- export declare function useWorkspaceTopAnchor(ref: RefObject<HTMLElement>): void;
1
+ import { type ReactNode } from 'react';
2
+ /** Keep the official slot's React node in place. Only our private portal host moves. */
3
+ export declare function WorkspaceTopAnchor({ children, id, order }: {
4
+ children: ReactNode;
5
+ id: string;
6
+ order: number;
7
+ }): JSX.Element;
8
8
  //# sourceMappingURL=sidebar-anchor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-anchor.d.ts","sourceRoot":"","sources":["../src/sidebar-anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,IAAI,CAuCvE"}
1
+ {"version":3,"file":"sidebar-anchor.d.ts","sourceRoot":"","sources":["../src/sidebar-anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGzE,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAmD3H"}
@@ -1,50 +1,57 @@
1
- import { useEffect } from 'react';
2
- /**
3
- * Place the plugin's official footer-slot contribution above Workspace without
4
- * replacing the single `sidebar.workspaces` slot. If the current sidebar shell
5
- * cannot be identified, the entry remains in the supported footer slot.
6
- */
7
- export function useWorkspaceTopAnchor(ref) {
8
- useEffect(() => {
9
- const element = ref.current;
10
- const originalParent = element?.parentElement;
11
- if (element === null || element === undefined || originalParent === null || originalParent === undefined)
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useLayoutEffect, useRef, useState } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ /** Keep the official slot's React node in place. Only our private portal host moves. */
5
+ export function WorkspaceTopAnchor({ children, id, order }) {
6
+ const placeholder = useRef(null);
7
+ const [target, setTarget] = useState(null);
8
+ useLayoutEffect(() => {
9
+ const marker = placeholder.current;
10
+ if (marker === null)
12
11
  return;
13
- const parent = originalParent;
14
- let moved = false;
15
- let observer;
12
+ const anchor = document.createElement('div');
13
+ anchor.dataset.dshWorkspaceAnchor = id;
14
+ anchor.dataset.dshWorkspaceOrder = String(order);
15
+ anchor.style.display = 'contents';
16
16
  const place = () => {
17
- // List-slot entries may be wrapped by the slot renderer. Walk out from
18
- // the entry until the preceding sibling is the flexible Workspace
19
- // region, instead of assuming the entry is a direct footer child.
20
- let ancestor = element.parentElement;
17
+ // A temporarily detached sidebar must not attach an entry elsewhere.
18
+ if (!marker.isConnected)
19
+ return;
20
+ let parent = marker;
21
+ let ancestor = marker.parentElement;
21
22
  while (ancestor !== null && ancestor !== document.body) {
22
23
  const candidate = ancestor.previousElementSibling;
23
24
  if (candidate instanceof HTMLElement) {
24
25
  const style = getComputedStyle(candidate);
25
- const flexGrow = Number.parseFloat(style.flexGrow);
26
- if (style.display === 'flex' && style.flexDirection === 'column' && flexGrow > 0) {
27
- candidate.insertBefore(element, candidate.firstChild);
28
- element.dataset.dshSshAnchored = 'true';
29
- moved = true;
30
- return true;
26
+ if (style.display === 'flex' && style.flexDirection === 'column' && Number.parseFloat(style.flexGrow) > 0) {
27
+ parent = candidate;
28
+ break;
31
29
  }
32
30
  }
33
31
  ancestor = ancestor.parentElement;
34
32
  }
35
- return false;
36
- };
37
- if (!place()) {
38
- observer = new MutationObserver(() => { if (place())
39
- observer?.disconnect(); });
40
- observer.observe(document.body, { childList: true, subtree: true });
41
- }
42
- return () => {
43
- observer?.disconnect();
44
- delete element.dataset.dshSshAnchored;
45
- if (moved && parent.isConnected)
46
- parent.append(element);
33
+ // Preserve both plugin order and the native Workspace subtree. A new
34
+ // instance never adopts/removes an old instance's private portal host.
35
+ const siblings = Array.from(parent.children);
36
+ const before = parent === marker ? null : siblings.find(child => child !== anchor && (!(child instanceof HTMLElement) || child.dataset.dshWorkspaceAnchor === undefined || Number(child.dataset.dshWorkspaceOrder) > order)) ?? null;
37
+ if (anchor.parentElement === parent) {
38
+ if (anchor.nextSibling === before)
39
+ return;
40
+ const current = siblings.indexOf(anchor);
41
+ const next = before === null ? siblings.length : siblings.indexOf(before);
42
+ // Overlapping old/new instances with equal order retain their DOM
43
+ // order instead of repeatedly moving past each other.
44
+ if (current >= 0 && current < next && siblings.slice(current + 1, next).every(child => child instanceof HTMLElement && child.dataset.dshWorkspaceAnchor !== undefined && Number(child.dataset.dshWorkspaceOrder) === order))
45
+ return;
46
+ }
47
+ parent.insertBefore(anchor, before);
47
48
  };
48
- }, [ref]);
49
+ place();
50
+ setTarget(anchor);
51
+ const observer = new MutationObserver(place);
52
+ observer.observe(marker.closest('[data-slot="sidebar"]') ?? document.body, { childList: true, subtree: true });
53
+ return () => { observer.disconnect(); anchor.remove(); };
54
+ }, [id, order]);
55
+ return _jsx("span", { ref: placeholder, style: { display: 'contents' }, children: target === null ? null : createPortal(children, target) });
49
56
  }
50
57
  //# sourceMappingURL=sidebar-anchor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-anchor.js","sourceRoot":"","sources":["../src/sidebar-anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAA;AAEjD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAA2B;IAC/D,SAAS,CAAC,G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AA;IACzD,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAA;IACf,OAAO,eAAM,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,YAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAQ,CAAA;AACjI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemoncat7/dsh-ssh",
3
- "version": "1.16.20",
3
+ "version": "1.16.22",
4
4
  "description": "Secure SSH, FTP/FTPS/SFTP file transfer, browser terminals, proxies, port forwarding, and session-scoped AI access for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -47,7 +47,10 @@
47
47
  "docs/releases/1.10.4.md",
48
48
  "docs/dsh-021-compatibility.md",
49
49
  "docs/releases/1.11.4.md",
50
- "docs/compatibility-0.2.2-rc.1.md"
50
+ "docs/compatibility-0.2.2-rc.1.md",
51
+ "docs/compatibility-0.2.2-rc.2.md",
52
+ "docs/releases/1.16.21.md",
53
+ "docs/releases/1.16.22.md"
51
54
  ],
52
55
  "dsh": {
53
56
  "bundle": {
@@ -70,14 +73,15 @@
70
73
  },
71
74
  "engines": {
72
75
  "node": ">=24.9.0",
73
- "dsh": "=0.2.2-rc.1"
76
+ "dsh": "=0.2.2-rc.1 || =0.2.2-rc.2"
74
77
  },
75
78
  "scripts": {
76
79
  "clean": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\"",
77
80
  "build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
78
81
  "prepare": "npm run clean && npm run build",
79
82
  "test": "npm run build && node --test test/*.test.mjs",
80
- "pack:check": "npm pack --dry-run"
83
+ "pack:check": "npm pack --dry-run",
84
+ "test:sidebar-browser": "node test/sidebar-anchor.browser.mjs"
81
85
  },
82
86
  "dependencies": {
83
87
  "@deepseek-ai/schemastery": "~3.19.0",
@@ -139,7 +143,9 @@
139
143
  "@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.1",
140
144
  "@deepseek-ai/dsh-ptc-runtime": "0.2.2-rc.1",
141
145
  "@hugeicons/core-free-icons": "^4.3.5",
142
- "@hugeicons/react": "^1.1.10"
146
+ "@hugeicons/react": "^1.1.10",
147
+ "@types/react-dom": "18.3.7",
148
+ "react-dom": "18.3.1"
143
149
  },
144
150
  "publishConfig": {
145
151
  "access": "public"