dsh-long-plugins 3.0.2 → 3.0.3

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/client/client.js CHANGED
@@ -708,7 +708,14 @@ window.__ModuleLoader__.load({
708
708
  try {
709
709
  const isOffice = /\.(docx|xlsx|pptx)$/i.test(name)
710
710
  if (isOffice) {
711
- // 先打开弹窗并提示转换中(NAS docx/xlsx 转换可能耗时 1~2 秒)
711
+ // .docx:走 docx-preview 真实渲染页(浏览器端解析、所见即所得,轻量),
712
+ // 避免 mammoth 把整篇渲染成超大 HTML 塞进 iframe 造成长时间"转换中…"。
713
+ if (/\.docx$/i.test(name) && state.root) {
714
+ const full = String(state.root).replace(/\/+$/, '') + '/' + name
715
+ setPreview({ url: '/api/dsh-uploads/docx-preview?path=' + encodeURIComponent(full), name })
716
+ return
717
+ }
718
+ // 其它 Office(xlsx/pptx):服务端渲染 HTML
712
719
  setPreview({ name, officeLoading: true })
713
720
  const response = await fetch(previewUrl(name), { cache: 'no-store' })
714
721
  if (!response.ok) {
package/dsh.plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-long-plugins",
3
3
  "description": "Merged DSH web plugins: upload manager (drag-and-drop attach any file to the message), workspace output files, skill docs, account balance, Markdown-to-Word (md2docx), and polished file preview (Word & PowerPoint real preview with zoom/pan, rendered Markdown), plus an auto-repair install for DSH core patches (reverse-proxy WebSocket heartbeat, upgrade relink). | 一个插件整合 DSH Web 的常用增强:上传管理(拖放上传:拖任意文件到会话框直接附加)、工作区「输出文件」面板、技能文档浏览、账户余额显示、Markdown 转 Word(md2docx)、Word/PowerPoint 真实预览(可缩放、翻页);并自带修复安装,自动重连 DSH 核心补丁(反代 WebSocket 心跳、升级重连)。",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "entry": {
6
6
  "name": "dsh-long-plugins",
7
7
  "inject": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-long-plugins",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Merged DSH web plugins: upload manager (drag-and-drop attach any file to the message), workspace output files, skill docs, account balance, and polished file preview (Word & PowerPoint real preview with zoom/pan, rendered Markdown), plus an auto-repair install for DSH core patches (reverse-proxy WebSocket heartbeat, upgrade relink). | 一个插件整合 DSH Web 的常用增强:上传管理(拖放上传:拖任意文件到会话框直接附加)、工作区「输出文件」面板、技能文档浏览、账户余额显示、Word/PowerPoint 真实预览(可缩放、翻页);并自带修复安装,自动重连 DSH 核心补丁(反代 WebSocket 心跳、升级重连)。Office 读取/生成已独立到 dsh-office-reader;RA-Span 已独立到 dsh-span。",
5
5
  "type": "module",
6
6
  "license": "MIT",