npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-float-window

v0.4.1

Published

Shared floating-window shell for DSH web plugins (float/dock/minimize/maximize, boss keys). 共享浮窗外壳组件

Readme

dsh-float-window

DSH 插件共享浮窗外壳组件 —— 一份 React 组件,给所有 DeepSeek Harness web 插件提供行为一致的浮窗:dsh-shorts-walldsh-deepsea 共用同一实现。

English | 中文

能力

| 特性 | 说明 | |------|------| | 三态窗口 | 浮动(拖拽 / 右缘吸附贴边)/ 贴边竖栏 / 最小化;切停靠即吸附右缘(0.4.1) | | 四角缩放 | nw/ne/sw/se 对角锚定;两模式共享矩形,停靠吸附右缘、还原不跳位 | | 最小化记忆 | 记住最小化前模式与贴边展开态,还原精确回原布局 | | 窗口控制钮 | 标题栏右侧 ─ 最小化 / □ 最大化 icon 钮; 最小化即老板键动作,tooltip 显示活组合(如「Alt+X 最小化」) | | 一键最大化 | 标题栏按钮铺满视口(留 8px 边距);原矩形完整保留, 再点精确还原;拖拽最大化窗自动还原并跟手;状态持久化 | | 老板键 | 默认 Alt+S;多窗自动分配互不冲突的组合(见下) | | 多窗共存 | 双 z 带、启动按钮错位堆叠、恢复置顶、老板键按窗分配 | | 内容永不重载 | 模式切换只改容器样式,内容子树保持挂载 | | 完全可定制 | 标题 / 主题色 / 图标 / 边界 / 默认模式 / 文案全 props 化 |

用法

源码包(消费方 tsdown 直接内联,react 为 peerDependency):

import { FloatWindow } from 'dsh-float-window'

<FloatWindow
  storageKey="my-plugin:shell"   // 几何/模式持久化 key
  title="My Window"
  accent="#7fc4ff"
  launcherGlyph="🪟"
  labels={{
    openTitle: '打开窗口',
    expandTitle: '展开',
    minimizeTitle: '最小化(老板键还原)',
    modeToggleTip: '切换 浮动 / 贴边',
    floatText: '浮动',
    bossKeyText: '老板键 {key}',  // 可选;{key} 替换为实际组合,默认即此模板
  }}
>
  {(visible, ctx) => <YourContent visible={visible} bossKey={ctx.bossKey} />}
</FloatWindow>

要求:React 18+(peer),TypeScript bundler 解析 (tsdown/vite/tsc moduleResolution: bundler)。

多窗识别与老板键分配(≥0.2)

每个插件的 client bundle 各自内联本组件,模块态不共享, 协调走 window.__dshFloatWindows 全局注册表:

  • 识别floatWindowSnapshot() 返回当前文档挂载中的浮窗及各自老板键; 同一注册表也驱动 z 层叠与右下角启动按钮错位(bottom: 18 + n×52)。
  • 自动分配:未声明老板键的窗口按挂载顺序领取组合池 Alt+S → Alt+X → Alt+Z → Alt+C → Alt+V → Alt+B → Alt+Q → Alt+W (刻意避开 Chrome 占用的 Alt+D/E/F),超出后顺延 Alt+Shift+1…。 单窗行为与 0.1 完全一致(就是 Alt+S)。
  • 显式预留bossKey="Alt+D" 声明的组合会被注册表预留,自动窗永不落入; 同组合的自动窗会让位并即时刷新提示。两个显式同组合窗口则各自照常响应。
  • 完全自定义isBossKey 谓词且不传 bossKey 时保持 0.1 匿名行为—— 不参与协调,提示文案退化为「老板键」。
  • 提示联动:launcher / 贴边栏 tooltip 与标题栏 bossKeyText(支持 {key} 占位符)始终显示该窗当前实际响应的组合。

注意:协调要求同页所有浮窗都运行 ≥0.2 (0.1 实例不注册,仍各自默认 Alt+S)。

License

MIT