@civilization/dsh-workspace-files 0.3.0 → 0.3.2
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 +6 -1
- package/lib/client.js +211 -77
- package/lib/client.js.map +1 -1
- package/lib/index.js +151 -47
- package/package.json +1 -1
- package/src/client/icons.tsx +19 -0
- package/src/client/index.tsx +149 -27
- package/src/files.ts +74 -33
- package/src/index.ts +98 -22
package/README.md
CHANGED
|
@@ -17,7 +17,12 @@ DeepSeek Harness (DSH) 原生增强型文件浏览器插件。
|
|
|
17
17
|
- 🎯 **官方原生交互式 Tag 胶囊引用 (ReferenceChipNode)**:
|
|
18
18
|
- 深度贯通会话输入框的 Lexical AST 引擎,点击 `@引用` 直接生成与官方敲 `@` 回车 100% 一模一样带图标的深色圆角 **Tag 胶囊卡片**(`[📁 folder/]` 与 `[📄 file]`);
|
|
19
19
|
- 智能消除用户光标前已键入的 `@` 字符,杜绝 `@@path` 冗余;文件与文件夹均支持一键引用。
|
|
20
|
-
- 📂
|
|
20
|
+
- 📂 **在文件资源管理器中显示 (Reveal in Explorer)**:
|
|
21
|
+
- 悬浮在文件上点击,即刻在 Windows 资源管理器中打开并高亮选中该文件(`explorer.exe /select`);
|
|
22
|
+
- 悬浮在目录上点击,直接在资源管理器中打开该文件夹,告别手动层层翻找目录的繁琐操作。
|
|
23
|
+
- 🚀 **用系统默认应用打开 (Open with Default App)**:
|
|
24
|
+
- 悬浮在任意文件/目录上点击,直接调起系统默认程序打开;对于图片、音频、PDF、Office 文档等外部文件极为方便。
|
|
25
|
+
- 📁 **默认折叠与持久化展开记忆 (localStorage)**:
|
|
21
26
|
- 首次打开默认全部折叠关闭,清爽简洁;
|
|
22
27
|
- 用户展开的每一个文件夹均按工作区独立持久化记忆,无论刷新页面还是切换会话再切回,均完美保持展开状态。
|
|
23
28
|
- 📋 **快速复制相对路径**:支持一键复制文件/目录的相对工作区路径,方便在终端或配置中直接使用。
|
package/lib/client.js
CHANGED
|
@@ -265,6 +265,47 @@ window.__ModuleLoader__.load({
|
|
|
265
265
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("polyline", { points: "4 6 8 10 12 6" })
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
|
+
function IconExplorer({ size = 12 }) {
|
|
269
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
270
|
+
width: size,
|
|
271
|
+
height: size,
|
|
272
|
+
viewBox: "0 0 16 16",
|
|
273
|
+
fill: "currentColor",
|
|
274
|
+
style: {
|
|
275
|
+
display: "inline-block",
|
|
276
|
+
verticalAlign: "middle",
|
|
277
|
+
flexShrink: 0
|
|
278
|
+
},
|
|
279
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M1.75 2A1.75 1.75 0 000 3.75v8.5C0 13.216.784 14 1.75 14h12.5A1.75 1.75 0 0016 12.25v-6.5A1.75 1.75 0 0014.25 4H7.5a.25.25 0 01-.2-.1l-.9-1.2C6.07 2.26 5.55 2 5 2H1.75zM1.5 5.5h13v6.75a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V5.5z" })
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function IconExternalApp({ size = 12 }) {
|
|
283
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
284
|
+
width: size,
|
|
285
|
+
height: size,
|
|
286
|
+
viewBox: "0 0 16 16",
|
|
287
|
+
fill: "none",
|
|
288
|
+
stroke: "currentColor",
|
|
289
|
+
strokeWidth: "1.35",
|
|
290
|
+
strokeLinecap: "round",
|
|
291
|
+
strokeLinejoin: "round",
|
|
292
|
+
style: {
|
|
293
|
+
display: "inline-block",
|
|
294
|
+
verticalAlign: "middle",
|
|
295
|
+
flexShrink: 0
|
|
296
|
+
},
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12.5 9.5v3.25a1.25 1.25 0 01-1.25 1.25H3.25A1.25 1.25 0 012 12.75V4.75A1.25 1.25 0 013.25 3.5H6.5" }),
|
|
299
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("polyline", { points: "10 2 14 2 14 6" }),
|
|
300
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
|
|
301
|
+
x1: "6.5",
|
|
302
|
+
y1: "9.5",
|
|
303
|
+
x2: "13.5",
|
|
304
|
+
y2: "2.5"
|
|
305
|
+
})
|
|
306
|
+
]
|
|
307
|
+
});
|
|
308
|
+
}
|
|
268
309
|
//#endregion
|
|
269
310
|
//#region src/client/index.tsx
|
|
270
311
|
const inject = ["slots", "sidebarRightTabs"];
|
|
@@ -327,23 +368,12 @@ window.__ModuleLoader__.load({
|
|
|
327
368
|
key: OFFICIAL_FILES_TAB_ID
|
|
328
369
|
}, WorkspaceFilesTabTitle)), "dsh-workspace-files: official tab title");
|
|
329
370
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}, WorkspaceFilesSettingsCard);
|
|
337
|
-
yield targetCtx.slots.register({
|
|
338
|
-
name: "settings.plugin.item",
|
|
339
|
-
key: "@civilization/dsh-workspace-files"
|
|
340
|
-
}, WorkspaceFilesSettingsCard);
|
|
341
|
-
}), "dsh-workspace-files: settings card");
|
|
342
|
-
};
|
|
343
|
-
if (slots) registerSettingsCard(ctx);
|
|
344
|
-
if (ctx.inject) ctx.inject(["settingsScope"], (scoped) => {
|
|
345
|
-
registerSettingsCard(scoped);
|
|
346
|
-
});
|
|
371
|
+
if (slots) ctx.effect(() => slots.inject("settings.plugins.tab", () => slots.register({
|
|
372
|
+
name: "settings.plugins.tab",
|
|
373
|
+
id: "workspace-files",
|
|
374
|
+
order: 20,
|
|
375
|
+
label: () => "工作区文件"
|
|
376
|
+
}, WorkspaceFilesSettingsCard)), "dsh-workspace-files: settings card");
|
|
347
377
|
}
|
|
348
378
|
const CONFIG_STORAGE_KEY = "dsh_workspace_files_config";
|
|
349
379
|
function loadWorkspaceFilesConfig() {
|
|
@@ -644,9 +674,9 @@ window.__ModuleLoader__.load({
|
|
|
644
674
|
className: "dsh-wf-head-text",
|
|
645
675
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
646
676
|
className: "dsh-wf-name",
|
|
647
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "工作区文件" }), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
677
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "工作区文件" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
648
678
|
className: "dsh-wf-version",
|
|
649
|
-
children: "
|
|
679
|
+
children: ["v", "0.3.2"]
|
|
650
680
|
})]
|
|
651
681
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
652
682
|
className: "dsh-wf-desc",
|
|
@@ -769,7 +799,7 @@ window.__ModuleLoader__.load({
|
|
|
769
799
|
window.addEventListener("dsh-workspace-files:config-change", handleCfgChange);
|
|
770
800
|
return () => window.removeEventListener("dsh-workspace-files:config-change", handleCfgChange);
|
|
771
801
|
}, []);
|
|
772
|
-
const loadTree = (0, react.useCallback)(async (quiet = false) => {
|
|
802
|
+
const loadTree = (0, react.useCallback)(async (quiet = false, forceRefresh = false) => {
|
|
773
803
|
if (!quiet) setLoading(true);
|
|
774
804
|
setError(null);
|
|
775
805
|
try {
|
|
@@ -777,7 +807,8 @@ window.__ModuleLoader__.load({
|
|
|
777
807
|
sessionId,
|
|
778
808
|
cwd,
|
|
779
809
|
showHidden,
|
|
780
|
-
maxDepth: activeConfig.maxDepth
|
|
810
|
+
maxDepth: activeConfig.maxDepth,
|
|
811
|
+
forceRefresh
|
|
781
812
|
});
|
|
782
813
|
setData(res);
|
|
783
814
|
setExpandedPaths((prev) => {
|
|
@@ -885,6 +916,44 @@ window.__ModuleLoader__.load({
|
|
|
885
916
|
else showToastMsg(`已复制引用: ${mentionText.trim()}`);
|
|
886
917
|
});
|
|
887
918
|
};
|
|
919
|
+
const handleRevealInExplorer = (e, item) => {
|
|
920
|
+
e.stopPropagation();
|
|
921
|
+
fetch("/dsh-workspace-files/api/files.open", {
|
|
922
|
+
method: "POST",
|
|
923
|
+
headers: { "content-type": "application/json" },
|
|
924
|
+
body: JSON.stringify({
|
|
925
|
+
action: "reveal",
|
|
926
|
+
path: item.path,
|
|
927
|
+
isDirectory: Boolean(item.isDirectory),
|
|
928
|
+
sessionId,
|
|
929
|
+
cwd
|
|
930
|
+
})
|
|
931
|
+
}).then((res) => res.json()).then((data) => {
|
|
932
|
+
if (data.ok) showToastMsg(`已在资源管理器中显示: ${item.name}`);
|
|
933
|
+
else showToastMsg(`打开失败: ${data.error?.message || "未知错误"}`);
|
|
934
|
+
}).catch((err) => {
|
|
935
|
+
showToastMsg(`请求失败: ${err?.message || String(err)}`);
|
|
936
|
+
});
|
|
937
|
+
};
|
|
938
|
+
const handleOpenDefaultApp = (e, item) => {
|
|
939
|
+
e.stopPropagation();
|
|
940
|
+
fetch("/dsh-workspace-files/api/files.open", {
|
|
941
|
+
method: "POST",
|
|
942
|
+
headers: { "content-type": "application/json" },
|
|
943
|
+
body: JSON.stringify({
|
|
944
|
+
action: "openDefault",
|
|
945
|
+
path: item.path,
|
|
946
|
+
isDirectory: Boolean(item.isDirectory),
|
|
947
|
+
sessionId,
|
|
948
|
+
cwd
|
|
949
|
+
})
|
|
950
|
+
}).then((res) => res.json()).then((data) => {
|
|
951
|
+
if (data.ok) showToastMsg(`已启动系统应用打开: ${item.name}`);
|
|
952
|
+
else showToastMsg(`打开失败: ${data.error?.message || "未知错误"}`);
|
|
953
|
+
}).catch((err) => {
|
|
954
|
+
showToastMsg(`请求失败: ${err?.message || String(err)}`);
|
|
955
|
+
});
|
|
956
|
+
};
|
|
888
957
|
const [searchViewMode, setSearchViewMode] = (0, react.useState)("flat");
|
|
889
958
|
const [searchExpandedPaths, setSearchExpandedPaths] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
|
890
959
|
const { filteredTreeItems, flatSearchResults } = (0, react.useMemo)(() => {
|
|
@@ -1044,7 +1113,7 @@ window.__ModuleLoader__.load({
|
|
|
1044
1113
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1045
1114
|
type: "button",
|
|
1046
1115
|
className: "dsh-files-tool-btn",
|
|
1047
|
-
onClick: () => void loadTree(true),
|
|
1116
|
+
onClick: () => void loadTree(false, true),
|
|
1048
1117
|
disabled: loading,
|
|
1049
1118
|
title: "刷新文件树",
|
|
1050
1119
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRefresh, { size: 13 })
|
|
@@ -1107,7 +1176,8 @@ window.__ModuleLoader__.load({
|
|
|
1107
1176
|
children: [
|
|
1108
1177
|
"找到 ",
|
|
1109
1178
|
flatSearchResults.length,
|
|
1110
|
-
" 个匹配项"
|
|
1179
|
+
" 个匹配项",
|
|
1180
|
+
flatSearchResults.length > 150 ? "(展示前 150 项)" : ""
|
|
1111
1181
|
]
|
|
1112
1182
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1113
1183
|
type: "button",
|
|
@@ -1116,9 +1186,9 @@ window.__ModuleLoader__.load({
|
|
|
1116
1186
|
title: "切换为可折叠的树形视图",
|
|
1117
1187
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTree, { size: 12 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "切为树形" })]
|
|
1118
1188
|
})]
|
|
1119
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1189
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1120
1190
|
className: "dsh-files-flat-list",
|
|
1121
|
-
children: flatSearchResults.map(({ item, parentDir }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1191
|
+
children: [flatSearchResults.slice(0, 150).map(({ item, parentDir }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1122
1192
|
className: `dsh-files-flat-row ${item.isDirectory ? "is-directory" : ""}`,
|
|
1123
1193
|
onClick: () => {
|
|
1124
1194
|
if (item.isDirectory) handleJumpToFolderInTree(item.path);
|
|
@@ -1162,25 +1232,51 @@ window.__ModuleLoader__.load({
|
|
|
1162
1232
|
}),
|
|
1163
1233
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1164
1234
|
className: "dsh-files-row-actions",
|
|
1165
|
-
children: [
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1235
|
+
children: [
|
|
1236
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1237
|
+
type: "button",
|
|
1238
|
+
className: "dsh-files-action-btn dsh-files-action-at",
|
|
1239
|
+
onClick: (e) => handleMention(e, item),
|
|
1240
|
+
title: `一键 @ 引用此${item.isDirectory ? "目录" : "文件"}到当前会话`,
|
|
1241
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconAt, { size: 13 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1242
|
+
className: "dsh-files-action-at-text",
|
|
1243
|
+
children: "@引用"
|
|
1244
|
+
})]
|
|
1245
|
+
}),
|
|
1246
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1247
|
+
type: "button",
|
|
1248
|
+
className: "dsh-files-action-btn",
|
|
1249
|
+
onClick: (e) => handleRevealInExplorer(e, item),
|
|
1250
|
+
title: `在文件资源管理器中显示此${item.isDirectory ? "目录" : "文件"}`,
|
|
1251
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExplorer, { size: 12 })
|
|
1252
|
+
}),
|
|
1253
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1254
|
+
type: "button",
|
|
1255
|
+
className: "dsh-files-action-btn",
|
|
1256
|
+
onClick: (e) => handleOpenDefaultApp(e, item),
|
|
1257
|
+
title: `用系统默认应用打开此${item.isDirectory ? "目录" : "文件"}`,
|
|
1258
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExternalApp, { size: 12 })
|
|
1259
|
+
}),
|
|
1260
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1261
|
+
type: "button",
|
|
1262
|
+
className: "dsh-files-action-btn",
|
|
1263
|
+
onClick: (e) => handleCopyPath(e, item.path),
|
|
1264
|
+
title: "复制相对路径",
|
|
1265
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopy, { size: 12 })
|
|
1266
|
+
})
|
|
1267
|
+
]
|
|
1181
1268
|
})
|
|
1182
1269
|
]
|
|
1183
|
-
}, item.path))
|
|
1270
|
+
}, item.path)), flatSearchResults.length > 150 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1271
|
+
style: {
|
|
1272
|
+
padding: "10px 14px",
|
|
1273
|
+
fontSize: 11,
|
|
1274
|
+
textAlign: "center",
|
|
1275
|
+
color: "var(--dsw-alias-label-tertiary, #8b93a1)",
|
|
1276
|
+
borderTop: "1px dashed var(--dsw-alias-border-l2, #e5e7eb)"
|
|
1277
|
+
},
|
|
1278
|
+
children: "匹配项较多,已限制展示前 150 项以保证流畅度,请输入更详细关键字"
|
|
1279
|
+
})]
|
|
1184
1280
|
})]
|
|
1185
1281
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1186
1282
|
className: "dsh-files-tree",
|
|
@@ -1213,7 +1309,9 @@ window.__ModuleLoader__.load({
|
|
|
1213
1309
|
},
|
|
1214
1310
|
onOpenFile,
|
|
1215
1311
|
onMention: handleMention,
|
|
1216
|
-
onCopyPath: handleCopyPath
|
|
1312
|
+
onCopyPath: handleCopyPath,
|
|
1313
|
+
onRevealInExplorer: handleRevealInExplorer,
|
|
1314
|
+
onOpenDefaultApp: handleOpenDefaultApp
|
|
1217
1315
|
}, item.path))]
|
|
1218
1316
|
})
|
|
1219
1317
|
}),
|
|
@@ -1225,7 +1323,7 @@ window.__ModuleLoader__.load({
|
|
|
1225
1323
|
});
|
|
1226
1324
|
}
|
|
1227
1325
|
function FileTreeNode(props) {
|
|
1228
|
-
const { item, depth, query, isSearchMode, expandedPaths, onToggleExpand, onOpenFile, onMention, onCopyPath } = props;
|
|
1326
|
+
const { item, depth, query, isSearchMode, expandedPaths, onToggleExpand, onOpenFile, onMention, onCopyPath, onRevealInExplorer, onOpenDefaultApp } = props;
|
|
1229
1327
|
const isExpanded = expandedPaths.has(item.path);
|
|
1230
1328
|
if (item.isDirectory) {
|
|
1231
1329
|
const childCount = item.children?.length ?? 0;
|
|
@@ -1263,22 +1361,39 @@ window.__ModuleLoader__.load({
|
|
|
1263
1361
|
}),
|
|
1264
1362
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1265
1363
|
className: "dsh-files-row-actions",
|
|
1266
|
-
children: [
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1364
|
+
children: [
|
|
1365
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1366
|
+
type: "button",
|
|
1367
|
+
className: "dsh-files-action-btn dsh-files-action-at",
|
|
1368
|
+
onClick: (e) => onMention(e, item),
|
|
1369
|
+
title: "一键 @ 引用此目录到当前会话",
|
|
1370
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconAt, { size: 13 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1371
|
+
className: "dsh-files-action-at-text",
|
|
1372
|
+
children: "@引用"
|
|
1373
|
+
})]
|
|
1374
|
+
}),
|
|
1375
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1376
|
+
type: "button",
|
|
1377
|
+
className: "dsh-files-action-btn",
|
|
1378
|
+
onClick: (e) => onRevealInExplorer(e, item),
|
|
1379
|
+
title: "在文件资源管理器中打开此目录",
|
|
1380
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExplorer, { size: 12 })
|
|
1381
|
+
}),
|
|
1382
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1383
|
+
type: "button",
|
|
1384
|
+
className: "dsh-files-action-btn",
|
|
1385
|
+
onClick: (e) => onOpenDefaultApp(e, item),
|
|
1386
|
+
title: "用系统默认应用打开此目录",
|
|
1387
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExternalApp, { size: 12 })
|
|
1388
|
+
}),
|
|
1389
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1390
|
+
type: "button",
|
|
1391
|
+
className: "dsh-files-action-btn",
|
|
1392
|
+
onClick: (e) => onCopyPath(e, item.path),
|
|
1393
|
+
title: "复制目录路径",
|
|
1394
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopy, { size: 12 })
|
|
1395
|
+
})
|
|
1396
|
+
]
|
|
1282
1397
|
})
|
|
1283
1398
|
]
|
|
1284
1399
|
}), isExpanded && item.children && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1292,7 +1407,9 @@ window.__ModuleLoader__.load({
|
|
|
1292
1407
|
onToggleExpand,
|
|
1293
1408
|
onOpenFile,
|
|
1294
1409
|
onMention,
|
|
1295
|
-
onCopyPath
|
|
1410
|
+
onCopyPath,
|
|
1411
|
+
onRevealInExplorer,
|
|
1412
|
+
onOpenDefaultApp
|
|
1296
1413
|
}, child.path))
|
|
1297
1414
|
})]
|
|
1298
1415
|
});
|
|
@@ -1322,22 +1439,39 @@ window.__ModuleLoader__.load({
|
|
|
1322
1439
|
}),
|
|
1323
1440
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1324
1441
|
className: "dsh-files-row-actions",
|
|
1325
|
-
children: [
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1442
|
+
children: [
|
|
1443
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1444
|
+
type: "button",
|
|
1445
|
+
className: "dsh-files-action-btn dsh-files-action-at",
|
|
1446
|
+
onClick: (e) => onMention(e, item),
|
|
1447
|
+
title: "一键 @ 引用此文件到当前会话",
|
|
1448
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconAt, { size: 13 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1449
|
+
className: "dsh-files-action-at-text",
|
|
1450
|
+
children: "@引用"
|
|
1451
|
+
})]
|
|
1452
|
+
}),
|
|
1453
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1454
|
+
type: "button",
|
|
1455
|
+
className: "dsh-files-action-btn",
|
|
1456
|
+
onClick: (e) => onRevealInExplorer(e, item),
|
|
1457
|
+
title: "在文件资源管理器中显示此文件",
|
|
1458
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExplorer, { size: 12 })
|
|
1459
|
+
}),
|
|
1460
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1461
|
+
type: "button",
|
|
1462
|
+
className: "dsh-files-action-btn",
|
|
1463
|
+
onClick: (e) => onOpenDefaultApp(e, item),
|
|
1464
|
+
title: "用系统默认应用打开此文件",
|
|
1465
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconExternalApp, { size: 12 })
|
|
1466
|
+
}),
|
|
1467
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1468
|
+
type: "button",
|
|
1469
|
+
className: "dsh-files-action-btn",
|
|
1470
|
+
onClick: (e) => onCopyPath(e, item.path),
|
|
1471
|
+
title: "复制相对路径",
|
|
1472
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopy, { size: 12 })
|
|
1473
|
+
})
|
|
1474
|
+
]
|
|
1341
1475
|
})
|
|
1342
1476
|
]
|
|
1343
1477
|
});
|