@rooode/dsh-plugin-preview 0.1.18 → 0.1.20
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 +40 -33
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
const STORAGE_KEY_TREE_OPEN = 'dsh:preview:tree:open:v1';
|
|
28
28
|
const STORAGE_KEY_TREE_WIDTH = 'dsh:preview:tree:width:v1';
|
|
29
29
|
const STORAGE_KEY_MANUAL_WS = 'dsh:preview:manual_workspace:v1';
|
|
30
|
-
const DEFAULT_PANEL_WIDTH =
|
|
30
|
+
const DEFAULT_PANEL_WIDTH = 700;
|
|
31
31
|
const MIN_PANEL_WIDTH = 380;
|
|
32
|
-
const DEFAULT_TREE_WIDTH =
|
|
33
|
-
const MIN_TREE_WIDTH =
|
|
32
|
+
const DEFAULT_TREE_WIDTH = 220;
|
|
33
|
+
const MIN_TREE_WIDTH = 170;
|
|
34
34
|
const MAX_TREE_WIDTH = 450;
|
|
35
35
|
const SUPPORTED_EXTENSIONS = new Set([
|
|
36
36
|
'.md', '.markdown', '.mdown', '.mkdn', '.mdwn',
|
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
return t.split('|').map(c => c.trim());
|
|
959
959
|
};
|
|
960
960
|
|
|
961
|
-
const tableRegex = /^(
|
|
961
|
+
const tableRegex = /^([ \t]*\|?.+\|.*)\n([ \t]*\|?[ \t]*:?-+:?[ \t]*(?:\|[ \t]*:?-+:?[ \t]*)+\|?[ \t]*)(?:\n((?:[ \t]*\|.*\|.*(?:\n|$))*))?/gm;
|
|
962
962
|
text = text.replace(tableRegex, (match, headerLine, alignLine, bodyLines) => {
|
|
963
963
|
const headerCells = parseTableRow(headerLine);
|
|
964
964
|
const alignCells = parseTableRow(alignLine);
|
|
@@ -975,16 +975,18 @@
|
|
|
975
975
|
});
|
|
976
976
|
tableHtml += '</tr></thead><tbody>';
|
|
977
977
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
978
|
+
if (bodyLines) {
|
|
979
|
+
const rows = bodyLines.trim().split('\n');
|
|
980
|
+
for (const row of rows) {
|
|
981
|
+
if (!row.trim()) continue;
|
|
982
|
+
const cells = parseTableRow(row);
|
|
983
|
+
tableHtml += '<tr>';
|
|
984
|
+
cells.forEach((cell, i) => {
|
|
985
|
+
const align = aligns[i] || 'left';
|
|
986
|
+
tableHtml += `<td style="text-align:${align}">${formatInlineStyles(cell)}</td>`;
|
|
987
|
+
});
|
|
988
|
+
tableHtml += '</tr>';
|
|
989
|
+
}
|
|
988
990
|
}
|
|
989
991
|
tableHtml += '</tbody></table></div>\n\n';
|
|
990
992
|
return tableHtml;
|
|
@@ -3437,13 +3439,6 @@
|
|
|
3437
3439
|
h('div', { className: 'dsh-preview-toolbar' },
|
|
3438
3440
|
// Left: View mode toggles
|
|
3439
3441
|
h('div', { className: 'dsh-preview-toolbar-left' },
|
|
3440
|
-
h('button', {
|
|
3441
|
-
type: 'button',
|
|
3442
|
-
className: `dsh-preview-tool-btn ${isTreeOpen ? 'active' : ''}`,
|
|
3443
|
-
onClick: onToggleTree,
|
|
3444
|
-
title: isTreeOpen ? '隐藏工作区目录树 (Ctrl/Cmd+B)' : '展开工作区目录树 (Ctrl/Cmd+B)',
|
|
3445
|
-
}, '🗂️ 目录树'),
|
|
3446
|
-
|
|
3447
3442
|
// Adaptive View Mode buttons based on File Category
|
|
3448
3443
|
category === 'markdown' ? (
|
|
3449
3444
|
h('div', { className: 'dsh-preview-mode-group' },
|
|
@@ -4337,19 +4332,28 @@
|
|
|
4337
4332
|
}
|
|
4338
4333
|
|
|
4339
4334
|
/* Side-by-Side Right Sidebar Layout Integration */
|
|
4340
|
-
body.dsh-preview-sidebar-active div[class*="
|
|
4341
|
-
|
|
4342
|
-
max-width: calc(100% - var(--dsh-preview-width,
|
|
4335
|
+
body.dsh-preview-sidebar-active div[class*="frame"] {
|
|
4336
|
+
width: calc(100% - var(--dsh-preview-width, 700px)) !important;
|
|
4337
|
+
max-width: calc(100% - var(--dsh-preview-width, 700px)) !important;
|
|
4343
4338
|
box-sizing: border-box !important;
|
|
4344
|
-
transition:
|
|
4339
|
+
transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
|
|
4345
4340
|
}
|
|
4346
|
-
body.dsh-preview-sidebar-active.dsh-preview-maximized div[class*="
|
|
4341
|
+
body.dsh-preview-sidebar-active.dsh-preview-maximized div[class*="frame"] {
|
|
4347
4342
|
display: none !important;
|
|
4348
4343
|
}
|
|
4349
4344
|
body.dsh-preview-sidebar-active.dsh-preview-maximized .dsh-preview-drawer-container {
|
|
4350
4345
|
width: 100vw !important;
|
|
4351
4346
|
}
|
|
4352
4347
|
|
|
4348
|
+
/* Shift Right Activity Rail to dock on the preview sidebar left border when open */
|
|
4349
|
+
body.dsh-preview-sidebar-active .dsh-right-activity-rail {
|
|
4350
|
+
right: var(--dsh-preview-width, 700px) !important;
|
|
4351
|
+
transition: right 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
|
|
4352
|
+
}
|
|
4353
|
+
body.dsh-preview-sidebar-active.dsh-preview-maximized .dsh-right-activity-rail {
|
|
4354
|
+
display: none !important;
|
|
4355
|
+
}
|
|
4356
|
+
|
|
4353
4357
|
/* Workspace Switcher Header & Popover */
|
|
4354
4358
|
.dsh-tree-sidebar-title.dsh-tree-title-clickable {
|
|
4355
4359
|
cursor: pointer;
|
|
@@ -4746,15 +4750,18 @@
|
|
|
4746
4750
|
display: flex;
|
|
4747
4751
|
align-items: center;
|
|
4748
4752
|
justify-content: space-between;
|
|
4749
|
-
padding:
|
|
4753
|
+
padding: 4px 8px;
|
|
4750
4754
|
height: 38px;
|
|
4751
4755
|
min-height: 38px;
|
|
4752
4756
|
flex-shrink: 0;
|
|
4753
4757
|
background: var(--dsw-alias-bg-layer-2, #f8fafc);
|
|
4754
4758
|
border-bottom: 1px solid var(--dsw-alias-border-l2, #e2e8f0);
|
|
4755
|
-
gap:
|
|
4759
|
+
gap: 6px;
|
|
4756
4760
|
box-sizing: border-box;
|
|
4761
|
+
overflow-x: auto;
|
|
4762
|
+
scrollbar-width: none;
|
|
4757
4763
|
}
|
|
4764
|
+
.dsh-preview-toolbar::-webkit-scrollbar { display: none; }
|
|
4758
4765
|
body[data-ds-dark-theme] .dsh-preview-toolbar {
|
|
4759
4766
|
background: var(--dsw-alias-bg-layer-2, #161a24);
|
|
4760
4767
|
border-bottom-color: var(--dsw-alias-border-l2, #252d3d);
|
|
@@ -4763,7 +4770,7 @@
|
|
|
4763
4770
|
.dsh-preview-toolbar-right {
|
|
4764
4771
|
display: flex;
|
|
4765
4772
|
align-items: center;
|
|
4766
|
-
gap:
|
|
4773
|
+
gap: 4px;
|
|
4767
4774
|
flex-shrink: 0;
|
|
4768
4775
|
white-space: nowrap;
|
|
4769
4776
|
}
|
|
@@ -4785,7 +4792,7 @@
|
|
|
4785
4792
|
border: none;
|
|
4786
4793
|
color: var(--dsw-alias-label-secondary, #64748b);
|
|
4787
4794
|
font-size: 11px;
|
|
4788
|
-
padding:
|
|
4795
|
+
padding: 3px 7px;
|
|
4789
4796
|
border-radius: 4px;
|
|
4790
4797
|
cursor: pointer;
|
|
4791
4798
|
transition: all 0.15s;
|
|
@@ -4811,13 +4818,13 @@
|
|
|
4811
4818
|
border: 1px solid var(--dsw-alias-border-l2, #cbd5e1);
|
|
4812
4819
|
color: var(--dsw-alias-label-primary, #334155);
|
|
4813
4820
|
font-size: 11px;
|
|
4814
|
-
padding:
|
|
4815
|
-
border-radius:
|
|
4821
|
+
padding: 3px 7px;
|
|
4822
|
+
border-radius: 4px;
|
|
4816
4823
|
cursor: pointer;
|
|
4817
4824
|
transition: all 0.15s;
|
|
4818
4825
|
display: flex;
|
|
4819
4826
|
align-items: center;
|
|
4820
|
-
gap:
|
|
4827
|
+
gap: 3px;
|
|
4821
4828
|
white-space: nowrap;
|
|
4822
4829
|
flex-shrink: 0;
|
|
4823
4830
|
}
|
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.
|
|
32
|
+
console.log('[PreviewService] Registered /api/preview route on webServer (v0.1.20)');
|
|
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.
|
|
3
|
+
"version": "0.1.20",
|
|
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",
|