dsh-web-ui
zhu1090093659
Plugin and skin collection for DeepSeek Harness (DSH) Web UI - task board, git graph, right-side panel, remote mobile UI, pet, live token stats, and skin center.
HuanLinOTO/dsh-plugin-better-sidebar-plugin-office
为 better-sidebar 提供 Office 三件套预览(.docx/.xlsx/.pptx),独立 bundle 瘦身主体 | Provides Office-suite preview (.docx/.xlsx/.pptx) for better-sidebar as a separate bundle to slim the core
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:HuanLinOTO/dsh-plugin-better-sidebar-plugin-office
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
📌 本插件已收录于 dshfind 插件超市,点击上方徽章直达主页。
DSH web 插件:为 better-sidebar 的编辑器提供 Office 三件套文件预览(.docx / .xlsx / .pptx)。
better-sidebar 曾内置这三个 viewer,但 docx-preview / Univer(+ SheetJS)/ pptx-renderer 会把 client bundle 撑到约 23MB。本插件把它们拆成独立 bundle,better-sidebar 本体不再内联 Office 渲染库(约 5.9MB 全套 → 2.2MB 压缩),需要 Office 预览的用户单独安装本插件即可。
ctx.betterSidebar.registerFileViewer 注册 3 个 viewer(id 与内置一致):docx:.docx,docx-preview 保真渲染(样式/图片/表格,Alt+滚轮缩放)xlsx:.xlsx,Univer sheets 预设(数据 + 公式 + 合并单元格 + 列宽/行高)pptx:.pptx,@aiden0z/pptx-renderer 浏览器原生预览(翻页导航)mediaUrl 策略、priority 0、title/icon),因此:需要 better-sidebar >= 0.6.0(已移除内置 office viewer 的版本),否则会与内置 docx/xlsx/pptx 注册冲突(already registered)。
pnpm install
pnpm run typecheck # 类型门禁(需先构建 DSH-better-sidebar 的 lib/types)
pnpm test # vitest(xlsx→Univer 转换 + 注册描述符)
pnpm run build # tsdown 双产物(lib/index.js + lib/client.js)
tsdown.config.ts含jszip/xlsx的 browser-entry alias(SheetJS/JSZip 在 CJS 降级后残留 Node builtin 引用)与import.meta.resolve空定义(pptx-renderer 的 PDF.js 探测)。改动这些库版本时需一并验证 client bundle 不含 Node builtin。
# 从 npm 安装(推荐):
dsh plugin --profile web add @huanlin/dsh-plugin-better-sidebar-plugin-office
# 本地开发(link: 热更新)
dsh plugin --profile web add "link:D:/Projects/deepseek-harness/dsh-better-sidebar-plugin-office"
安装后重启 dsh web 进程并浏览器硬刷新(Ctrl+Shift+R)。
.docx / .xlsx / .pptx,预览器自动命中。docx / xlsx / pptx 三张卡片,可单独启用/禁用。| 检查项 | 命令 | 预期 |
|---|---|---|
| 类型门禁 | pnpm run typecheck |
0 错误 |
| 单元测试 | pnpm test |
全部通过 |
| 构建 | pnpm run build |
lib/client.js 生成,window.__ModuleLoader__.load({ id: '@huanlin/dsh-plugin-better-sidebar-plugin-office', ... }) 包裹 |
| bundle 纯度 | 产物中搜索 node: 或 require("fs") |
不应出现 Node builtin 引用 |
| profile 可见 | Test-Path ~/.dsh/profiles/web/node_modules/@huanlin/dsh-plugin-better-sidebar-plugin-office/lib/client.js |
True |
| 插件加载 | 重启 dsh web + 硬刷新后侧边栏打开 Office 文件 |
预览正常渲染 |
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: dsh-better-sidebar。