dsh-enhance 0.3.5 → 0.3.7
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.md +9 -7
- package/lib/client.js +200 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-enhance
|
|
2
2
|
|
|
3
|
-
DeepSeek Harness(DSH)增强插件:Markdown
|
|
3
|
+
DeepSeek Harness(DSH)增强插件:Markdown 主题统一、划词批注、文件与链接右键菜单、侧栏更窄、启动默认状态。
|
|
4
4
|
|
|
5
5
|
## 功能
|
|
6
6
|
|
|
@@ -14,10 +14,12 @@ DeepSeek Harness(DSH)增强插件:Markdown 主题统一、划词批注、
|
|
|
14
14
|
- 有批注挂起时发送按钮即刻可用,而输入框保持空白;发送瞬间才把引文拼进消息
|
|
15
15
|
- 弹窗输入框无内边距、贴合面板,高度随内容自动增长且不出现滚动条
|
|
16
16
|
- **侧栏提问** — 从同一面板把段落送到右侧栏的侧边对话,不打断当前对话。首次创建,之后复用同一标签页。
|
|
17
|
-
- **文件右键菜单** — 在对话消息里的文件链接(含行内代码形式的文件引用)上右键,弹出跟随深浅主题的菜单:用默认应用打开、打开方式(列出系统为该登记的应用)、另存为、复制路径、复制文件内容、在 Finder 中显示。打开/打开方式/Finder 定位走宿主 `ctx.remote.session.openWorkspacePath`,应用清单走 `workspacePathApplications`,读取内容走鉴权路由 `GET /api/file?path=`。路径取文件链接的 `title`,相对路径按当前会话 `cwd` 补全;另存为从 `/api/file` 取得字节后优先调用 `showSaveFilePicker`,不支持时退化为浏览器下载(DSH
|
|
17
|
+
- **文件右键菜单** — 在对话消息里的文件链接(含行内代码形式的文件引用)上右键,弹出跟随深浅主题的菜单:用默认应用打开、打开方式(列出系统为该登记的应用)、另存为、复制路径、复制文件内容、在 Finder 中显示。打开/打开方式/Finder 定位走宿主 `ctx.remote.session.openWorkspacePath`,应用清单走 `workspacePathApplications`,读取内容走鉴权路由 `GET /api/file?path=`。路径取文件链接的 `title`,相对路径按当前会话 `cwd` 补全;另存为从 `/api/file` 取得字节后优先调用 `showSaveFilePicker`,不支持时退化为浏览器下载(DSH 未提供原生保存对话框)。
|
|
18
|
+
- **网页链接右键菜单** — 在对话消息里的普通 HTTP(S) 链接上右键,弹出「打开方式」菜单:新标签页、新窗口、默认浏览器、复制链接、链接另存为…。新标签页优先打开宿主内置浏览器页签(`ctx.sidebarRight.openTab('browser', { url })`,未启用该页签时回退到新窗口);新窗口用浏览器弹窗;默认浏览器交给系统(桌面端主窗口把 `window.open` 的 http(s) 交给系统浏览器);链接另存为通过 `fetch` 取数据后以 `download` 下载,受跨域限制时提示无法下载。两个菜单都只在会话正文内拦截右键,其它位置保留宿主原生菜单;点击别处、滚动、Esc、失焦、窗口缩放都会关闭它。
|
|
18
19
|
- **侧栏更窄** — 侧栏可拖到 214px(上游限制 264px),文字相应缩小一档;文件夹图标换成展开/收起三角,文件夹标题与会话标题同字号、左端对齐。
|
|
19
|
-
- **面板图标置顶** — Plugins /
|
|
20
|
-
- **插件图标也置顶** — 新装的插件如果把图标注册到侧栏底部(`sidebar.footer.action
|
|
20
|
+
- **面板图标置顶** — Plugins / 自动化等面板图标移到侧栏顶部、工作区列表之上,并排成一行;一行放几个由侧栏宽度决定,放不下就换行。上游是带文字的竖排列表,此前本插件把它放在右下角。只改位置与排版,宿主的选中态、悬停态和那个「更多」菜单都照旧。
|
|
21
|
+
- **插件图标也置顶** — 新装的插件如果把图标注册到侧栏底部(`sidebar.footer.action`,比如「远程访问」的电话图标),它的按钮会被搬进同一行顶部列表,跟着侧栏宽度一起换行。搬的是宿主自己的容器而不是插件的按钮,所以插件自己的选中态、悬停态和弹层都照常工作;折叠成图标轨时交回宿主布局。
|
|
22
|
+
- **这一行只显示图标** — 顶部图标行里的每个按钮只留图标,文字一律不显示:宿主面板的标题本来就已隐藏,插件自己带进这一行的标签(比如「远程访问」那个图标旁边的「Remote」)也被去掉——标签按形状识别(这一段里没有图标的内容就是文字),不写死插件的类名。按钮的 `title`/`aria-label` 原样保留,悬停和读屏仍能认出是哪个插件;插件若在同一个插槽里放了纯文字按钮(如「退出」),它保持可读、可点,不会被压成空白方块。
|
|
21
23
|
- **启动即最窄** — 首次启动侧栏直接是 214px(上游每次加载都回到 280px),之后按你上次拖到的宽度打开。折叠/展开不会丢掉这个宽度。
|
|
22
24
|
- **窗口铺满屏幕** — 首次启动主窗口铺满可用区域(菜单栏与 Dock 保留,等同绿色按钮的缩放);之后按上次关闭时的窗口位置与大小重新打开。保存的窗口若超出当前显示器(换屏、改分辨率)会被拉回可见区域。
|
|
23
25
|
- **运行中彩色转圈** — 侧栏里正在运行的会话,状态环不再是宿主那样的灰色,而是一圈彩色:蓝→紫→洋红→琥珀的 4 秒色相循环,浅色与深色主题下都清晰。环的转动与虚线段仍由宿主驱动,本插件只改颜色;其他位置的状态点(任务、审批、工作流)保持原样。
|
|
@@ -32,9 +34,9 @@ DSH 打开 **Plugins** 页面 → 添加插件 → 输入 `dsh-enhance` → 安
|
|
|
32
34
|
### 方式二:本地 tar 包
|
|
33
35
|
|
|
34
36
|
```bash
|
|
35
|
-
# 从 Releases 下载 dsh-enhance-0.3.
|
|
37
|
+
# 从 Releases 下载 dsh-enhance-0.3.7.tgz 后
|
|
36
38
|
cd ~/.dsh/profiles/desktop
|
|
37
|
-
npx pnpm@11.28.5 add "file:/绝对路径/dsh-enhance-0.3.
|
|
39
|
+
npx pnpm@11.28.5 add "file:/绝对路径/dsh-enhance-0.3.7.tgz"
|
|
38
40
|
```
|
|
39
41
|
|
|
40
42
|
再编辑 `~/.dsh/profiles/desktop/package.json`,把 `dsh-enhance` 加入 `dsh.profile.bundles`:
|
|
@@ -114,7 +116,7 @@ npx pnpm@11.28.5 remove dsh-enhance
|
|
|
114
116
|
| `src/client/turn-badge.ts` | Dock 未读会话角标(映射宿主 completionUnread,报到 Host 路由) |
|
|
115
117
|
| `src/index.ts` | Host 半边:`/dsh-enhance/badge` 路由,主进程画 Dock 角标 |
|
|
116
118
|
| `src/client/side-chat.ts` | 侧栏对话资源与标签页 |
|
|
117
|
-
| `src/client/file-menu.ts` |
|
|
119
|
+
| `src/client/file-menu.ts` | 会话内的右键菜单:文件链接(路径解析、打开方式子菜单、六项动作)与网页链接(新标签/新窗口/默认浏览器/复制/另存为) |
|
|
118
120
|
| `src/client/styles/file-menu.ts` | 右键菜单与结果提示的样式表 |
|
|
119
121
|
| `src/client/styles/` | 各样式表(每个文件导出一个 `String.raw` 模板);`running-spinner.ts` 负责侧栏运行中色环 |
|
|
120
122
|
| `lib/` | 构建产物,即 `npm pack` 打包内容 |
|
package/lib/client.js
CHANGED
|
@@ -726,9 +726,10 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
|
|
|
726
726
|
* The row is kept — upstream stacks these icons in a column, which costs one
|
|
727
727
|
* row per shortcut at the top of the tree.
|
|
728
728
|
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
*
|
|
729
|
+
* How many fit on a line follows the sidebar's own width: the row takes the
|
|
730
|
+
* full content width and the wrap does the counting, so a wider sidebar shows
|
|
731
|
+
* more icons on the first line and the narrowest one (214px) still fits five
|
|
732
|
+
* 36px buttons and four 2px gaps.
|
|
732
733
|
*
|
|
733
734
|
* Scope excludes the collapsed rail: there the column is the app's 56px icon
|
|
734
735
|
* strip (0px on macOS), a row of 36px buttons cannot fit it, and the host's own
|
|
@@ -742,7 +743,8 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
|
|
|
742
743
|
justify-content: flex-start !important;
|
|
743
744
|
gap: 2px !important;
|
|
744
745
|
margin: 0 0 6px 0 !important;
|
|
745
|
-
|
|
746
|
+
width: 100% !important;
|
|
747
|
+
max-width: 100% !important;
|
|
746
748
|
}
|
|
747
749
|
|
|
748
750
|
[class*="sidebarCol"] [class*="panelList"] [class*="panelTitle"] { display: none !important; }
|
|
@@ -780,8 +782,17 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
|
|
|
780
782
|
* trigger into an icon+label pill that fills that row's width, which means
|
|
781
783
|
* justify-content:flex-start and a gap. In a 36px square that reads as an icon
|
|
782
784
|
* glued to the left edge, so the box model is normalised here: centred, no
|
|
783
|
-
* gap, no padding, one icon size for the whole row.
|
|
784
|
-
|
|
785
|
+
* gap, no padding, one icon size for the whole row.
|
|
786
|
+
*
|
|
787
|
+
* Only a trigger that carries an icon is normalised: a plugin may also put a
|
|
788
|
+
* text-only control in the same slot (the Remote plugin's Exit link), and
|
|
789
|
+
* squeezing that into a 36px square would clip the word instead of showing it.
|
|
790
|
+
*
|
|
791
|
+
* The font size goes to zero as well: a trigger that puts bare text next to
|
|
792
|
+
* its icon (no element around it) has no box to hide, and the text would
|
|
793
|
+
* otherwise spill out of the square. The icon keeps its own size — the sheet
|
|
794
|
+
* pins the svg to 16px below, in pixels, not in em. */
|
|
795
|
+
[class*="sidebarCol"] [class*="panelList"] > [data-dsh-enhance-entries] button:has(svg, img) {
|
|
785
796
|
flex: none !important;
|
|
786
797
|
display: inline-flex !important;
|
|
787
798
|
justify-content: center !important;
|
|
@@ -792,12 +803,29 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
|
|
|
792
803
|
margin: 0 !important;
|
|
793
804
|
padding: 0 !important;
|
|
794
805
|
border-radius: 12px !important;
|
|
806
|
+
font-size: 0 !important;
|
|
795
807
|
}
|
|
796
808
|
[class*="sidebarCol"] [class*="panelList"] > [data-dsh-enhance-entries] button svg {
|
|
797
809
|
flex: none !important;
|
|
798
810
|
width: 16px !important;
|
|
799
811
|
height: 16px !important;
|
|
800
812
|
}
|
|
813
|
+
/* The row is a strip of glyphs: every entry shows its icon and nothing else.
|
|
814
|
+
*
|
|
815
|
+
* A plugin that joins the row brings its footer markup with it, and that
|
|
816
|
+
* markup is written for a wide footer row — the Remote plugin's entry is an
|
|
817
|
+
* icon+label pill, so in the 36px square its label spilled out as a clipped
|
|
818
|
+
* "R…". The label is dropped by shape rather than by name, because the markup
|
|
819
|
+
* is the plugin's own: inside the relocated container an element that carries
|
|
820
|
+
* no icon is text. The has() selector keeps an icon wrapper (a span around an
|
|
821
|
+
* svg) alive, and the empty check keeps the plugin's own badge dots.
|
|
822
|
+
*
|
|
823
|
+
* The trigger keeps its title and aria-label, so the icon still names the
|
|
824
|
+
* plugin on hover and to a screen reader; only the visible text goes.
|
|
825
|
+
*/
|
|
826
|
+
[class*="sidebarCol"] [class*="panelList"] > [data-dsh-enhance-entries] :where(span, label, p, div):not(:empty):not(:has(svg)):not(:has(img)) {
|
|
827
|
+
display: none !important;
|
|
828
|
+
}
|
|
801
829
|
/* The rail keeps the host's own treatment: the footer action block is hidden
|
|
802
830
|
there exactly as the host hides it, so the strip keeps only the app's icons. */
|
|
803
831
|
[class*="sidebarCol"] [class*="_root"][class*="collapsed"] [data-dsh-enhance-entries] {
|
|
@@ -2148,8 +2176,9 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
|
|
|
2148
2176
|
* parents, and no amount of `order` moves a node into a sibling container. So
|
|
2149
2177
|
* this module moves the footer's action container into the panel nav once the
|
|
2150
2178
|
* shell exists, and the stylesheet dissolves it (`display: contents`) so its
|
|
2151
|
-
* buttons join the row the nav lays out.
|
|
2152
|
-
*
|
|
2179
|
+
* buttons join the row the nav lays out. How many sit on one line follows the
|
|
2180
|
+
* sidebar's width: the row spans the content width and wraps by itself (see
|
|
2181
|
+
* sidebar-layout.css).
|
|
2153
2182
|
*
|
|
2154
2183
|
* The relocated element is the *container* the host owns, not the entries a
|
|
2155
2184
|
* plugin renders. React updates those entries inside it and removes them from
|
|
@@ -2819,6 +2848,8 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
|
|
|
2819
2848
|
// src/client/file-menu.ts
|
|
2820
2849
|
/** Hashed CSS-module classes still contain these stable substrings. */
|
|
2821
2850
|
const FILE_MENTION_SELECTOR = "button[class*=\"fileMention\"][title], button[class*=\"fileLink\"][title]";
|
|
2851
|
+
/** Web links rendered inside chat messages (file mentions are buttons, not anchors). */
|
|
2852
|
+
const WEB_LINK_SELECTOR = "a[href]";
|
|
2822
2853
|
/** A file mention counts only inside rendered chat content. */
|
|
2823
2854
|
const TRANSCRIPT_ROOT_SELECTOR = `${CHAT_NODE_SELECTOR}, ${ASSISTANT_FLOW_SELECTOR}, [class*="_markdown"]`;
|
|
2824
2855
|
/** Marks both the menu and its submenu, so outside clicks can be recognised. */
|
|
@@ -2828,6 +2859,9 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
|
|
|
2828
2859
|
const MENU_HEIGHT = 268;
|
|
2829
2860
|
const SUBMENU_WIDTH = 210;
|
|
2830
2861
|
const SUBMENU_ROW = 30;
|
|
2862
|
+
/** Link menu footprint: header, three open rows, a separator, two copy/save rows. */
|
|
2863
|
+
const LINK_MENU_WIDTH = 232;
|
|
2864
|
+
const LINK_MENU_HEIGHT = 292;
|
|
2831
2865
|
/**
|
|
2832
2866
|
* Turn a mention's `title` into a usable path.
|
|
2833
2867
|
* Handles `file://` URLs and the `#L12` / `#L12-L20` line anchors the markdown
|
|
@@ -2911,6 +2945,38 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
|
|
|
2911
2945
|
return mention;
|
|
2912
2946
|
}
|
|
2913
2947
|
/**
|
|
2948
|
+
* Accept an HTTP(S) URL and nothing else.
|
|
2949
|
+
* @param href - raw href attribute.
|
|
2950
|
+
* @returns the URL string, or undefined for other schemes or empties.
|
|
2951
|
+
*/
|
|
2952
|
+
function normalizeWebLink(href) {
|
|
2953
|
+
const value = href.trim();
|
|
2954
|
+
if (!/^https?:\/\//i.test(value)) return void 0;
|
|
2955
|
+
try {
|
|
2956
|
+
const url = new URL(value);
|
|
2957
|
+
return url.protocol === "http:" || url.protocol === "https:" ? url.href : void 0;
|
|
2958
|
+
} catch {
|
|
2959
|
+
return;
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
/**
|
|
2963
|
+
* Find the web link a context-menu event landed on.
|
|
2964
|
+
* @param node - event target.
|
|
2965
|
+
* @returns the link URL, or undefined for non-links, other schemes, or outside chat.
|
|
2966
|
+
*/
|
|
2967
|
+
function webLinkFrom(node) {
|
|
2968
|
+
const element = node instanceof Element ? node : node?.parentElement ?? void 0;
|
|
2969
|
+
if (element === void 0) return void 0;
|
|
2970
|
+
const anchor = element.closest(WEB_LINK_SELECTOR);
|
|
2971
|
+
if (!(anchor instanceof HTMLAnchorElement)) return void 0;
|
|
2972
|
+
if (anchor.closest(TRANSCRIPT_ROOT_SELECTOR) === null) return void 0;
|
|
2973
|
+
const url = normalizeWebLink(anchor.getAttribute("href") ?? "");
|
|
2974
|
+
return url === void 0 ? void 0 : {
|
|
2975
|
+
anchor,
|
|
2976
|
+
url
|
|
2977
|
+
};
|
|
2978
|
+
}
|
|
2979
|
+
/**
|
|
2914
2980
|
* Copy text with the async clipboard API, falling back to a hidden textarea.
|
|
2915
2981
|
* @param text - text to copy.
|
|
2916
2982
|
*/
|
|
@@ -3172,22 +3238,115 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
|
|
|
3172
3238
|
menu = root;
|
|
3173
3239
|
loadApps();
|
|
3174
3240
|
};
|
|
3175
|
-
/**
|
|
3241
|
+
/** Open a web link in the app's in-app browser tab when one exists. */
|
|
3242
|
+
const openLinkInTab = (url) => {
|
|
3243
|
+
const tabs = ctx.sidebarRightTabs;
|
|
3244
|
+
const right = ctx.sidebarRight;
|
|
3245
|
+
if (tabs?.get?.("browser") !== void 0 && typeof right?.openTab === "function") {
|
|
3246
|
+
right.openTab("browser", { params: { url } });
|
|
3247
|
+
return t("linkMenu.done.opened");
|
|
3248
|
+
}
|
|
3249
|
+
window.open(url, "_blank", "noopener,noreferrer");
|
|
3250
|
+
return "";
|
|
3251
|
+
};
|
|
3252
|
+
/** Open a web link in a separate window (browser popup; the desktop shell
|
|
3253
|
+
* hands external URLs to the system browser). */
|
|
3254
|
+
const openLinkNewWindow = (url) => {
|
|
3255
|
+
window.open(url, "_blank", "noopener,noreferrer,popup=yes,width=1024,height=768");
|
|
3256
|
+
return "";
|
|
3257
|
+
};
|
|
3258
|
+
/** Hand a web link to the environment's default browser. */
|
|
3259
|
+
const openLinkDefault = (url) => {
|
|
3260
|
+
window.open(url, "_blank", "noopener,noreferrer");
|
|
3261
|
+
return "";
|
|
3262
|
+
};
|
|
3263
|
+
/** Save a web link's resource as a download, best-effort under CORS. */
|
|
3264
|
+
const saveLink = async (url) => {
|
|
3265
|
+
let blob;
|
|
3266
|
+
try {
|
|
3267
|
+
const response = await fetch(url);
|
|
3268
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
3269
|
+
blob = await response.blob();
|
|
3270
|
+
} catch {
|
|
3271
|
+
throw new Error(t("linkMenu.saveFailed"));
|
|
3272
|
+
}
|
|
3273
|
+
let name = "download";
|
|
3274
|
+
try {
|
|
3275
|
+
name = decodeURIComponent(new URL(url).pathname.split("/").pop() || "") || "download";
|
|
3276
|
+
} catch {}
|
|
3277
|
+
const href = URL.createObjectURL(blob);
|
|
3278
|
+
const anchor = doc.createElement("a");
|
|
3279
|
+
anchor.href = href;
|
|
3280
|
+
anchor.download = name;
|
|
3281
|
+
anchor.style.display = "none";
|
|
3282
|
+
doc.body.appendChild(anchor);
|
|
3283
|
+
anchor.click();
|
|
3284
|
+
anchor.remove();
|
|
3285
|
+
window.setTimeout(() => URL.revokeObjectURL(href), 1e3);
|
|
3286
|
+
return t("linkMenu.done.saved");
|
|
3287
|
+
};
|
|
3288
|
+
/** Build and show the menu for a web link. */
|
|
3289
|
+
const openLinkMenu = (x, y, url) => {
|
|
3290
|
+
close();
|
|
3291
|
+
const root = doc.createElement("div");
|
|
3292
|
+
root.className = "dsh-file-menu";
|
|
3293
|
+
root.setAttribute(MENU_ATTRIBUTE, "");
|
|
3294
|
+
root.setAttribute("role", "menu");
|
|
3295
|
+
const header = doc.createElement("div");
|
|
3296
|
+
header.className = "dsh-file-menu__header";
|
|
3297
|
+
header.textContent = t("linkMenu.header");
|
|
3298
|
+
const separator = doc.createElement("div");
|
|
3299
|
+
separator.className = "dsh-file-menu__separator";
|
|
3300
|
+
const row = (label, run) => {
|
|
3301
|
+
const button = doc.createElement("button");
|
|
3302
|
+
button.type = "button";
|
|
3303
|
+
button.className = "dsh-file-menu__item";
|
|
3304
|
+
button.setAttribute("role", "menuitem");
|
|
3305
|
+
const text = doc.createElement("span");
|
|
3306
|
+
text.textContent = label;
|
|
3307
|
+
button.append(text);
|
|
3308
|
+
button.addEventListener("click", (event) => {
|
|
3309
|
+
event.stopPropagation();
|
|
3310
|
+
act(async () => run());
|
|
3311
|
+
});
|
|
3312
|
+
return button;
|
|
3313
|
+
};
|
|
3314
|
+
root.append(header, row(t("linkMenu.newTab"), () => openLinkInTab(url)), row(t("linkMenu.newWindow"), () => openLinkNewWindow(url)), row(t("linkMenu.defaultBrowser"), () => openLinkDefault(url)), separator, row(t("linkMenu.copyLink"), async () => {
|
|
3315
|
+
await copy(url);
|
|
3316
|
+
return t("linkMenu.done.copied");
|
|
3317
|
+
}), row(t("linkMenu.saveLink"), () => saveLink(url)));
|
|
3318
|
+
const placed = placeMenu(x, y, LINK_MENU_WIDTH, LINK_MENU_HEIGHT, {
|
|
3319
|
+
width: window.innerWidth,
|
|
3320
|
+
height: window.innerHeight
|
|
3321
|
+
});
|
|
3322
|
+
root.style.left = `${placed.left}px`;
|
|
3323
|
+
root.style.top = `${placed.top}px`;
|
|
3324
|
+
doc.body.appendChild(root);
|
|
3325
|
+
menu = root;
|
|
3326
|
+
};
|
|
3327
|
+
/** The gesture: only file mentions and web links inside chat content are claimed. */
|
|
3176
3328
|
const onContextMenu = (event) => {
|
|
3177
|
-
const
|
|
3178
|
-
if (
|
|
3179
|
-
|
|
3329
|
+
const file = fileTargetFrom(event.target);
|
|
3330
|
+
if (file !== void 0) {
|
|
3331
|
+
const mention = normalizeMentionPath(file.getAttribute("title") ?? "");
|
|
3332
|
+
if (mention === void 0) {
|
|
3333
|
+
close();
|
|
3334
|
+
return;
|
|
3335
|
+
}
|
|
3336
|
+
const resolved = resolvePath(mention, cwdFor(ctx));
|
|
3337
|
+
event.preventDefault();
|
|
3338
|
+
event.stopPropagation();
|
|
3339
|
+
open(event.clientX, event.clientY, resolved ?? mention);
|
|
3180
3340
|
return;
|
|
3181
3341
|
}
|
|
3182
|
-
const
|
|
3183
|
-
if (
|
|
3184
|
-
|
|
3342
|
+
const link = webLinkFrom(event.target);
|
|
3343
|
+
if (link !== void 0) {
|
|
3344
|
+
event.preventDefault();
|
|
3345
|
+
event.stopPropagation();
|
|
3346
|
+
openLinkMenu(event.clientX, event.clientY, link.url);
|
|
3185
3347
|
return;
|
|
3186
3348
|
}
|
|
3187
|
-
|
|
3188
|
-
event.preventDefault();
|
|
3189
|
-
event.stopPropagation();
|
|
3190
|
-
open(event.clientX, event.clientY, resolved ?? mention);
|
|
3349
|
+
close();
|
|
3191
3350
|
};
|
|
3192
3351
|
/** Close on any press that is not inside one of our panels. */
|
|
3193
3352
|
const onPointerDown = (event) => {
|
|
@@ -3256,7 +3415,17 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
|
|
|
3256
3415
|
"fileMenu.done.copyPath": "已复制路径",
|
|
3257
3416
|
"fileMenu.done.copyContents": "已复制文件内容",
|
|
3258
3417
|
"fileMenu.done.saved": "已保存",
|
|
3259
|
-
"fileMenu.failed": "操作失败:{message}"
|
|
3418
|
+
"fileMenu.failed": "操作失败:{message}",
|
|
3419
|
+
"linkMenu.header": "打开方式",
|
|
3420
|
+
"linkMenu.newTab": "新标签页",
|
|
3421
|
+
"linkMenu.newWindow": "新窗口",
|
|
3422
|
+
"linkMenu.defaultBrowser": "默认浏览器",
|
|
3423
|
+
"linkMenu.copyLink": "复制链接",
|
|
3424
|
+
"linkMenu.saveLink": "链接另存为…",
|
|
3425
|
+
"linkMenu.done.opened": "已打开",
|
|
3426
|
+
"linkMenu.done.copied": "已复制链接",
|
|
3427
|
+
"linkMenu.done.saved": "已保存",
|
|
3428
|
+
"linkMenu.saveFailed": "无法下载该链接(可能受跨域限制)"
|
|
3260
3429
|
};
|
|
3261
3430
|
/** Toolbar copy, English. */
|
|
3262
3431
|
const en = {
|
|
@@ -3294,7 +3463,17 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
|
|
|
3294
3463
|
"fileMenu.done.copyPath": "Path copied",
|
|
3295
3464
|
"fileMenu.done.copyContents": "File contents copied",
|
|
3296
3465
|
"fileMenu.done.saved": "Saved",
|
|
3297
|
-
"fileMenu.failed": "Could not do that: {message}"
|
|
3466
|
+
"fileMenu.failed": "Could not do that: {message}",
|
|
3467
|
+
"linkMenu.header": "Open in",
|
|
3468
|
+
"linkMenu.newTab": "New tab",
|
|
3469
|
+
"linkMenu.newWindow": "New window",
|
|
3470
|
+
"linkMenu.defaultBrowser": "Default browser",
|
|
3471
|
+
"linkMenu.copyLink": "Copy link",
|
|
3472
|
+
"linkMenu.saveLink": "Save link as...",
|
|
3473
|
+
"linkMenu.done.opened": "Opened",
|
|
3474
|
+
"linkMenu.done.copied": "Link copied",
|
|
3475
|
+
"linkMenu.done.saved": "Saved",
|
|
3476
|
+
"linkMenu.saveFailed": "Could not download this link (cross-origin restrictions may apply)"
|
|
3298
3477
|
};
|
|
3299
3478
|
// src/client/anchors.ts
|
|
3300
3479
|
/** Any transcript row the plugin may anchor to. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-enhance",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "DeepSeek Harness enhancements: Markdown theme for every renderer, select-text annotations with pins, a file right-click menu, a narrower sidebar, and startup defaults (maximized window, narrowest sidebar, colourful running marker). 中文:DSH 增强插件——Markdown 主题、划词批注、文件右键菜单、侧栏宽度、启动默认状态。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|