@deepseek-ai/dsh-client-ui-sidebar-documentpreview 0.1.7-rc.2 → 0.2.0-rc.1
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/README.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/client.pdf.js +1 -1
- package/package.json +20 -20
package/README.i18n.yaml
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
en: 949156aa02ec8b07
|
|
22
22
|
zh: d3675754e2a37b5d
|
|
23
23
|
/deepseek-ai-dsh-client-ui-sidebar-documentpreview/how-it-reads:
|
|
24
|
-
en:
|
|
25
|
-
zh:
|
|
24
|
+
en: 5cdbd4a218315e70
|
|
25
|
+
zh: d5054f541e0e0275
|
|
26
26
|
/deepseek-ai-dsh-client-ui-sidebar-documentpreview/excel-preview:
|
|
27
27
|
en: b99b0e0b8efc2853
|
|
28
28
|
zh: 4327352d1334fc6b
|
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ PNG, JPEG, GIF, WebP, BMP, ICO, and SVG render through Blob URLs in an `<img>` s
|
|
|
63
63
|
|
|
64
64
|
Shared copy comes from `sidebarDocumentPreview`; each builtin renderer owns its localized labels. PDF and converted Office previews use a cool light-grey background in light mode and a matte-black background in dark mode, with subtle page shadows and original document colors. PDF and image previews share a floating control with **Fit width**, 25%, 50%, 100%, 150%, and 200% choices plus 25% incremental zoom across the 25%–400% fixed range. Fit width is the default and tracks pane resizing; 100% means the PDF's 96-DPI page size or the image's intrinsic CSS-pixel size. On fine pointers, the control starts hidden, slides up when the pointer enters the bottom 72 CSS pixels, and slides down after a 420 ms leave delay; hover, keyboard focus, an open menu, and an active gesture keep it visible, while devices without hover keep it visible continuously. Chromium maps a macOS trackpad pinch to the same live, pointer-anchored path as Ctrl+wheel; the control displays the gesture percentage, and the settled value survives body remounts until the tab closes. HTML previews do not expose zoom controls. After zoom settles or fit width changes, nearby PDF pages redraw at the resolved scale multiplied by the device pixel ratio. The previous bitmap and selectable text stay visible until the replacement bitmap is ready; offscreen pages refresh when they approach the viewport.
|
|
65
65
|
|
|
66
|
-
Initial reads and renderer preparation, including Office conversion, share a centered 28px ongoing `StateDot` with the visible localized status “Rendering document...”. The status exposes the same accessible name and respects reduced-motion preferences. Additional text pages keep a compact inline spinner while loaded content stays visible. The PDF body loads its package-local `client.pdf.js` chunk only when a PDF preview mounts; PDF.js, its Worker source, and embedded support data stay out of the startup `client.js`. PDF and converted Word/PowerPoint pages form a vertical sequence with 12px page gaps and a 12px outer inset showing the theme-specific document background; fit width reserves this inset, and pages render lazily near the viewport; an unrendered page holds its place as a quiet 3:4 placeholder block. PDF.js’s official TextLayerBuilder manages selection boundaries and normalized copying over an aligned text layer.
|
|
66
|
+
Initial reads and renderer preparation, including Office conversion, share a centered 28px ongoing `StateDot` with the visible localized status “Rendering document...”. The status exposes the same accessible name and respects reduced-motion preferences. Additional text pages keep a compact inline spinner while loaded content stays visible. The PDF body loads its package-local `client.pdf.js` chunk only when a PDF preview mounts; PDF.js, its Worker source, and embedded support data stay out of the startup `client.js`. PDF and converted Word/PowerPoint pages form a vertical sequence with 12px page gaps and a 12px outer inset showing the theme-specific document background; fit width reserves this inset, and pages render lazily near the viewport; an unrendered page holds its place as a quiet 3:4 placeholder block. PDF.js’s official TextLayerBuilder manages selection boundaries and normalized copying over an aligned text layer. Selections use translucent blue in both themes while the canvas retains the document text; blank line breaks remain unhighlighted; alignment accounts for PDF page units, page rotation, and viewport resizing, and page disposal cancels both layers. Image-only PDFs contain no selectable text. Code previews show a tertiary-colored language label and a copy icon with a tooltip; wrapping remains in the document toolbar. They show source line numbers by default without including them in copied text; plain text uses the same font size and line height as code. Code sits on the pane's own background rather than the chat card's fill; its banner is adjacent to a full-height inner scrollport, so both scrollbars begin below the copy control.
|
|
67
67
|
|
|
68
68
|
<a id="excel-preview"></a>
|
|
69
69
|
## Excel preview
|
package/README.zh.md
CHANGED
|
@@ -63,7 +63,7 @@ PNG、JPEG、GIF、WebP、BMP、ICO 和 SVG 通过 Blob URL 在 `<img>` 静态
|
|
|
63
63
|
|
|
64
64
|
共享文案来自 `sidebarDocumentPreview`;各内置渲染器拥有自己的本地化标签。PDF 与转换后的 Office 预览在浅色模式下使用冷调浅灰底色,在深色模式下使用哑黑底色,页面带有轻微阴影并保留文档原色。PDF 与图片预览共用浮动控件,提供**适应宽度**、25%、50%、100%、150% 和 200% 选项,并在 25%–400% 固定范围内按 25% 逐级缩放。适应宽度是默认模式并跟随面板尺寸;100% 表示 PDF 的 96 DPI 页面尺寸或图片的固有 CSS 像素尺寸。在精细指针设备上,控件初始隐藏;指针进入底部 72 个 CSS 像素时向上滑入,离开 420 ms 后向下退出;控件悬停、键盘焦点、菜单展开和手势进行期间保持显示,无 hover 的设备则始终显示。Chromium 将 macOS 触控板捏合映射到与 Ctrl+滚轮相同的实时指针锚定路径;控件同步显示手势比例,静止后的值在正文重新挂载后继续保留,直至 tab 关闭。HTML 预览不显示缩放控件。缩放稳定或适应宽度发生变化后,视口附近的 PDF 页面按最终缩放比例乘以设备像素比重绘。新位图完成前保留原有画面和可选文字层;屏幕外的页面在接近视口时更新。
|
|
65
65
|
|
|
66
|
-
首次读取及渲染器准备(包括 Office 转换)共用居中的 28px ongoing `StateDot`,下方显示本地化状态文字“文档渲染中...”。状态向辅助技术提供相同的名称,并遵循减少动态效果偏好。追加文本页时使用紧凑的行内转圈,同时保留已显示的内容。PDF 正文仅在 PDF 预览挂载时加载包内 `client.pdf.js` chunk;PDF.js、Worker 源码和内嵌支持数据不会进入启动 `client.js`。PDF 与转换后的 Word/PowerPoint 页面组成纵向序列,页间距与四周留白均为 12px,露出当前主题的文档背景色;适应宽度会预留此留白,页面在接近视口时惰性渲染;未渲染的页以安静的 3:4 占位块保持位置。PDF.js 官方 TextLayerBuilder
|
|
66
|
+
首次读取及渲染器准备(包括 Office 转换)共用居中的 28px ongoing `StateDot`,下方显示本地化状态文字“文档渲染中...”。状态向辅助技术提供相同的名称,并遵循减少动态效果偏好。追加文本页时使用紧凑的行内转圈,同时保留已显示的内容。PDF 正文仅在 PDF 预览挂载时加载包内 `client.pdf.js` chunk;PDF.js、Worker 源码和内嵌支持数据不会进入启动 `client.js`。PDF 与转换后的 Word/PowerPoint 页面组成纵向序列,页间距与四周留白均为 12px,露出当前主题的文档背景色;适应宽度会预留此留白,页面在接近视口时惰性渲染;未渲染的页以安静的 3:4 占位块保持位置。PDF.js 官方 TextLayerBuilder 在与画面重合的文字层上管理选区边界和复制文本规范化。两种主题均使用半透明蓝色选区,画布保留文档文字,空白换行不高亮;对齐同时考虑 PDF 页面单位、页面旋转与视口宽度变化,页面释放时取消两层渲染。纯图片 PDF 不包含可选取的文字。代码预览使用 tertiary 色的语言名称和带提示的复制图标;换行仍由文档工具栏控制。默认显示源码行号,但复制文本不包含行号;纯文本与代码使用相同字号和行高。代码直接坐在分栏自身的背景上,而不是会话卡片的填充色;复制条与占满剩余高度的内部滚动区相邻,因此横纵滚动条都从复制控件下方开始。
|
|
67
67
|
|
|
68
68
|
<a id="excel-preview"></a>
|
|
69
69
|
## Excel 预览
|
package/lib/client.pdf.js
CHANGED
|
@@ -32376,7 +32376,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
|
|
|
32376
32376
|
}
|
|
32377
32377
|
//#endregion
|
|
32378
32378
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-sidebar-documentpreview/src/client/pdf/PdfBody.module.css.mjs
|
|
32379
|
-
const css = ".E0GbtG_body{box-sizing:border-box;background:var(--dsw-alias-bg-document-preview);width:100%;min-width:100%;min-height:100%;font-family:var(--dsw-font,sans-serif);white-space:normal;flex-direction:column;gap:12px;padding:12px;display:flex;overflow:visible}[data-document-zoom-mode=fixed] .E0GbtG_body{width:max-content}.E0GbtG_page{box-sizing:border-box;width:100%;min-width:0;overflow-x:visible}.E0GbtG_placeholder{aspect-ratio:3/4;background:var(--dsw-alias-bg-skeleton);width:100%}.E0GbtG_canvas{width:100%;max-width:none;height:auto;margin-inline:auto;display:block}.E0GbtG_surface{max-width:none;box-shadow:var(--dsw-elevation-prominent);margin-inline:auto;position:relative}.E0GbtG_surface[hidden]{display:none}.E0GbtG_text{position:absolute;inset:0;overflow:clip}.E0GbtG_text .textLayer{text-align:initial;letter-spacing:normal;word-spacing:normal;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;caret-color:canvastext;z-index:0;--text-scale-factor:calc(var(--total-scale-factor) * var(--min-font-size));--min-font-size-inv:calc(1 / var(--min-font-size));line-height:1;position:absolute;inset:0;overflow:clip}.E0GbtG_text .textLayer[data-main-rotation=\"90\"]{transform:rotate(90deg)translateY(-100%)}.E0GbtG_text .textLayer[data-main-rotation=\"180\"]{transform:rotate(180deg)translate(-100%,-100%)}.E0GbtG_text .textLayer[data-main-rotation=\"270\"]{transform:rotate(270deg)translate(-100%)}.E0GbtG_text :is(span,br){color:#0000;white-space:pre;cursor:text;transform-origin:0 0;user-select:text;position:absolute}.E0GbtG_text .textLayer>:not(.markedContent),.E0GbtG_text .markedContent span:not(.markedContent){z-index:1;--font-height:0;--scale-x:1;--rotate:0deg;font-size:calc(var(--text-scale-factor) * var(--font-height));transform:rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv))}.E0GbtG_text .markedContent{display:contents}.E0GbtG_text ::selection{background:var(--dsw-alias-
|
|
32379
|
+
const css = ".E0GbtG_body{box-sizing:border-box;background:var(--dsw-alias-bg-document-preview);width:100%;min-width:100%;min-height:100%;font-family:var(--dsw-font,sans-serif);white-space:normal;flex-direction:column;gap:12px;padding:12px;display:flex;overflow:visible}[data-document-zoom-mode=fixed] .E0GbtG_body{width:max-content}.E0GbtG_page{box-sizing:border-box;width:100%;min-width:0;overflow-x:visible}.E0GbtG_placeholder{aspect-ratio:3/4;background:var(--dsw-alias-bg-skeleton);width:100%}.E0GbtG_canvas{width:100%;max-width:none;height:auto;margin-inline:auto;display:block}.E0GbtG_surface{max-width:none;box-shadow:var(--dsw-elevation-prominent);margin-inline:auto;position:relative}.E0GbtG_surface[hidden]{display:none}.E0GbtG_text{position:absolute;inset:0;overflow:clip}.E0GbtG_text .textLayer{text-align:initial;letter-spacing:normal;word-spacing:normal;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;caret-color:canvastext;z-index:0;--text-scale-factor:calc(var(--total-scale-factor) * var(--min-font-size));--min-font-size-inv:calc(1 / var(--min-font-size));line-height:1;position:absolute;inset:0;overflow:clip}.E0GbtG_text .textLayer[data-main-rotation=\"90\"]{transform:rotate(90deg)translateY(-100%)}.E0GbtG_text .textLayer[data-main-rotation=\"180\"]{transform:rotate(180deg)translate(-100%,-100%)}.E0GbtG_text .textLayer[data-main-rotation=\"270\"]{transform:rotate(270deg)translate(-100%)}.E0GbtG_text :is(span,br){color:#0000;white-space:pre;cursor:text;transform-origin:0 0;user-select:text;position:absolute}.E0GbtG_text .textLayer>:not(.markedContent),.E0GbtG_text .markedContent span:not(.markedContent){z-index:1;--font-height:0;--scale-x:1;--rotate:0deg;font-size:calc(var(--text-scale-factor) * var(--font-height));transform:rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv))}.E0GbtG_text .markedContent{display:contents}.E0GbtG_text ::selection{background:var(--dsw-alias-bg-document-selection);color:#0000}.E0GbtG_text br::selection{background:0 0}.E0GbtG_text .textLayer .endOfContent{z-index:0;cursor:default;user-select:none;display:block;position:absolute;inset:100% 0 0}.E0GbtG_text .selecting .endOfContent{top:0}.E0GbtG_status{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;padding:10px;font-size:13px;line-height:1.5;display:flex}.E0GbtG_body .E0GbtG_status{color:var(--dsw-alias-label-document-preview)}";
|
|
32380
32380
|
const tagId = "@deepseek-ai/dsh-client-ui-sidebar-documentpreview/PdfBody.module.css";
|
|
32381
32381
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
32382
32382
|
const tag = document.createElement("style");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-sidebar-documentpreview",
|
|
3
3
|
"description": "Extensible Sidebar previews for Office documents, spreadsheets, Markdown, code, images, PDF, HTML, and plain text",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0-rc.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -62,25 +62,25 @@
|
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
63
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
|
|
64
64
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
65
|
-
"@deepseek-ai/dsh-api-
|
|
66
|
-
"@deepseek-ai/dsh-api-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
-
"@deepseek-ai/dsh-client-locale": "0.
|
|
70
|
-
"@deepseek-ai/dsh-client-
|
|
71
|
-
"@deepseek-ai/dsh-client-
|
|
72
|
-
"@deepseek-ai/dsh-client-test-runtime": "0.
|
|
73
|
-
"@deepseek-ai/dsh-client-ui-dockkit": "0.
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.
|
|
79
|
-
"@deepseek-ai/dsh-
|
|
80
|
-
"@deepseek-ai/dsh-
|
|
81
|
-
"@deepseek-ai/dsh-
|
|
82
|
-
"@deepseek-ai/dsh-
|
|
83
|
-
"@deepseek-ai/dsh-
|
|
65
|
+
"@deepseek-ai/dsh-api-gateway": "0.2.0-rc.1",
|
|
66
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.0-rc.1",
|
|
67
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.2.0-rc.1",
|
|
68
|
+
"@deepseek-ai/dsh-client-connection": "0.2.0-rc.1",
|
|
69
|
+
"@deepseek-ai/dsh-client-locale": "0.2.0-rc.1",
|
|
70
|
+
"@deepseek-ai/dsh-client-store": "0.2.0-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-client-resources": "0.2.0-rc.1",
|
|
72
|
+
"@deepseek-ai/dsh-client-test-runtime": "0.2.0-rc.1",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-dockkit": "0.2.0-rc.1",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.0-rc.1",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.0-rc.1",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.1",
|
|
80
|
+
"@deepseek-ai/dsh-office-to-pdf": "0.2.0-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.0-rc.1",
|
|
82
|
+
"@deepseek-ai/dsh-session": "0.2.0-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.0-rc.1"
|
|
84
84
|
},
|
|
85
85
|
"files": [
|
|
86
86
|
"lib/index.js",
|