@rooode/dsh-plugin-preview 0.1.14 → 0.1.15

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 CHANGED
@@ -3158,10 +3158,12 @@
3158
3158
  }, [normalizedContent, category, isHighlighted, searchQuery]);
3159
3159
 
3160
3160
  const lineCount = highlightedLines.length;
3161
- const digitCount = Math.max(2, String(lineCount).length);
3162
- const gutterWidth = Math.max(24, digitCount * 7.5 + 12);
3161
+ const digitCount = Math.max(1, String(lineCount).length);
3163
3162
 
3164
- return h('div', { className: `dsh-code-editor-view ${isWordWrap ? 'word-wrap' : ''}` },
3163
+ return h('div', {
3164
+ className: `dsh-code-editor-view ${isWordWrap ? 'word-wrap' : ''}`,
3165
+ style: { '--dsh-gutter-digits': digitCount }
3166
+ },
3165
3167
  highlightedLines.map((lineHtml, i) => {
3166
3168
  const lineNum = i + 1;
3167
3169
  return h('div', {
@@ -3172,7 +3174,6 @@
3172
3174
  h('span', {
3173
3175
  id: `line-gutter-${lineNum}`,
3174
3176
  className: 'dsh-line-gutter',
3175
- style: { minWidth: `${gutterWidth}px` },
3176
3177
  onClick: () => onLineClick && onLineClick(lineNum),
3177
3178
  title: `第 ${lineNum} 行 (点击定位)`,
3178
3179
  }, lineNum),
@@ -5961,10 +5962,13 @@
5961
5962
  .dsh-line-gutter {
5962
5963
  display: inline-block;
5963
5964
  box-sizing: border-box;
5964
- padding: 0 8px 0 6px;
5965
+ width: calc(var(--dsh-gutter-digits, 2) * 1ch + 8px);
5966
+ min-width: calc(var(--dsh-gutter-digits, 2) * 1ch + 8px);
5967
+ padding: 0 4px 0 2px;
5965
5968
  text-align: right;
5966
5969
  user-select: none;
5967
5970
  color: var(--dsw-alias-label-tertiary, #94a3b8);
5971
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Cascadia Code", "Fira Code", monospace;
5968
5972
  font-size: 11px;
5969
5973
  line-height: 20px;
5970
5974
  flex-shrink: 0;
@@ -5987,7 +5991,7 @@
5987
5991
  .dsh-line-code {
5988
5992
  flex: 1;
5989
5993
  min-width: 0;
5990
- padding: 0 12px 0 10px;
5994
+ padding: 0 8px 0 6px;
5991
5995
  white-space: pre;
5992
5996
  font-family: inherit;
5993
5997
  font-size: inherit;
package/lib/index.js CHANGED
@@ -29,7 +29,7 @@ export class PreviewService extends Service {
29
29
  handler: this.handleHttpRequest.bind(this),
30
30
  });
31
31
  });
32
- console.log('[PreviewService] Registered /api/preview route on webServer (v0.1.14)');
32
+ console.log('[PreviewService] Registered /api/preview route on webServer (v0.1.15)');
33
33
  } else {
34
34
  console.warn('[PreviewService] webServer not available yet in ctx');
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rooode/dsh-plugin-preview",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "DeepSeek Harness Markdown 文档与工作空间文件浏览器右侧预览插件 (支持工作区文件树、文件夹创建与文件移动、JSON 交互结构树/格式化、Java/C++/Python/JS/TS/YAML/Go/Rust 多语言语法高亮与符号大纲、自动换行与多标签 FileTabs)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",