@lijian-ui/dsh-file-manager 0.1.21 → 0.2.0
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 +90 -64
- package/lib/client.js.map +1 -1
- package/lib/tsconfig.client.tsbuildinfo +1 -1
- package/lib/types/client/DockItem.d.ts +15 -0
- package/lib/types/client/DockItem.d.ts.map +1 -0
- package/lib/types/client/FilePanelDockItem.d.ts +16 -0
- package/lib/types/client/FilePanelDockItem.d.ts.map +1 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/layout.d.ts +0 -4
- package/lib/types/client/layout.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/DockItem.tsx +42 -0
- package/src/client/FilePanelDockItem.tsx +40 -0
- package/src/client/index.ts +15 -0
- package/src/client/layout.ts +31 -54
- package/src/client/styles/tokens.module.css +2 -74
- package/lib/assets/mermaid.min.js +0 -3587
- package/src/client/floating.ts +0 -63
package/src/client/floating.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Floating expand button geometry (issues #374 / #292): the button is a
|
|
3
|
-
* fixed chrome element docked at the viewport's top-right corner, just
|
|
4
|
-
* below the shell conversation header — the horizontal divider under the
|
|
5
|
-
* "Session log" row — so the re-expand control sits below the header
|
|
6
|
-
* chrome instead of overlapping it. Its top stays below the Window
|
|
7
|
-
* Controls Overlay titlebar strip when dsh-desktop reports one (issue
|
|
8
|
-
* #292). Every computed position is clamped into the usable range.
|
|
9
|
-
* @module dsh-filemgr/client/floating
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/** Breathing room above/below the button (px). */
|
|
13
|
-
export const FLOATING_MARGIN_PX = 6
|
|
14
|
-
/** Gap between the shell header's bottom divider and the button top (px). */
|
|
15
|
-
export const FLOATING_HEADER_GAP_PX = 8
|
|
16
|
-
/** The button's rendered size (kept in sync with tokens.module.css). */
|
|
17
|
-
export const FLOATING_BUTTON_HEIGHT_PX = 24
|
|
18
|
-
/** Top offset of the explorer's collapse chevron inside its tab bar (px).
|
|
19
|
-
* Used only as a fallback when the shell conversation header is not found
|
|
20
|
-
* (kept in sync with the chevron rule in tokens.module.css). */
|
|
21
|
-
export const COLLAPSE_CHEVRON_TOP_PX = 6
|
|
22
|
-
|
|
23
|
-
/** Minimal Window Controls Overlay surface (untyped in older TS DOM libs). */
|
|
24
|
-
interface WindowControlsOverlayLike {
|
|
25
|
-
visible: boolean
|
|
26
|
-
getTitlebarAreaRect?: () => { height?: number }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** The WCO titlebar height when visible; 0 in a plain browser tab. */
|
|
30
|
-
export function titlebarAreaHeight(): number {
|
|
31
|
-
const wco = (navigator as Navigator & { windowControlsOverlay?: WindowControlsOverlayLike }).windowControlsOverlay
|
|
32
|
-
if (wco === undefined || !wco.visible || wco.getTitlebarAreaRect === undefined) return 0
|
|
33
|
-
try {
|
|
34
|
-
const rect = wco.getTitlebarAreaRect()
|
|
35
|
-
const height = rect?.height ?? 0
|
|
36
|
-
return height > 0 ? Math.round(height) : 0
|
|
37
|
-
} catch {
|
|
38
|
-
return 0
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** Clamp a requested top px into the usable vertical range. */
|
|
43
|
-
export function clampFloatingTop(
|
|
44
|
-
top: number,
|
|
45
|
-
viewportHeight: number,
|
|
46
|
-
buttonHeight: number,
|
|
47
|
-
titlebar: number,
|
|
48
|
-
): number {
|
|
49
|
-
const min = titlebar + FLOATING_MARGIN_PX
|
|
50
|
-
const max = Math.max(min, viewportHeight - buttonHeight - FLOATING_MARGIN_PX)
|
|
51
|
-
if (!Number.isFinite(top)) return min
|
|
52
|
-
return Math.min(max, Math.max(min, top))
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** The default top: aligned with the collapse chevron at the top-right. */
|
|
56
|
-
export function topAlignedFloatingTop(viewportHeight: number, buttonHeight: number, titlebar: number): number {
|
|
57
|
-
return clampFloatingTop(
|
|
58
|
-
titlebar + COLLAPSE_CHEVRON_TOP_PX,
|
|
59
|
-
viewportHeight,
|
|
60
|
-
buttonHeight,
|
|
61
|
-
titlebar,
|
|
62
|
-
)
|
|
63
|
-
}
|