dsh-chat-link-actions 0.2.8 → 0.2.9

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.
Files changed (3) hide show
  1. package/client.js +10 -4
  2. package/index.js +6 -2
  3. package/package.json +1 -1
package/client.js CHANGED
@@ -488,7 +488,8 @@ window.__ModuleLoader__.load({
488
488
  copiedPath: "已复制路径", // ui-copy-ignore
489
489
  copiedQuote: "已复制引用", // ui-copy-ignore
490
490
  missing: "目标文件不存在", // ui-copy-ignore
491
- managerFailed: "无法打开文件管理器" // ui-copy-ignore
491
+ managerFailed: "无法打开文件管理器",
492
+ clipboardFailed: "剪贴板不可用" // ui-copy-ignore
492
493
  },
493
494
  en: { // ui-copy-ignore
494
495
  menu: "File actions", // ui-copy-ignore
@@ -498,7 +499,8 @@ window.__ModuleLoader__.load({
498
499
  copiedPath: "Path copied", // ui-copy-ignore
499
500
  copiedQuote: "Reference copied", // ui-copy-ignore
500
501
  missing: "File not found", // ui-copy-ignore
501
- managerFailed: "Could not open the file manager" // ui-copy-ignore
502
+ managerFailed: "Could not open the file manager",
503
+ clipboardFailed: "Clipboard unavailable" // ui-copy-ignore
502
504
  }
503
505
  };
504
506
 
@@ -713,7 +715,9 @@ window.__ModuleLoader__.load({
713
715
  if (inserted) return;
714
716
  navigator.clipboard.writeText(referenceText(path)).then(function () {
715
717
  toast(strings().copiedQuote);
716
- }, function () {});
718
+ }, function () {
719
+ toast(strings().clipboardFailed);
720
+ });
717
721
  });
718
722
  } },
719
723
  { id: "reveal", label: strings().reveal, icon: "reveal", run: function () {
@@ -722,7 +726,9 @@ window.__ModuleLoader__.load({
722
726
  { id: "copy", label: strings().copy, icon: "copy", run: function () {
723
727
  navigator.clipboard.writeText(path).then(function () {
724
728
  toast(strings().copiedPath);
725
- }, function () {});
729
+ }, function () {
730
+ toast(strings().clipboardFailed);
731
+ });
726
732
  } }
727
733
  ];
728
734
 
package/index.js CHANGED
@@ -121,8 +121,12 @@ export function revealCommand(path, platform = process.platform, facts = {}) {
121
121
  case 'darwin':
122
122
  if (isDirectory && !isSymbolicLink) return { command: 'open', args: [target] }
123
123
  return { command: 'open', args: ['-R', target] }
124
- case 'win32':
125
- return { command: 'explorer.exe', args: [encodeExplorerSelect(windowsTarget(target))] }
124
+ case 'win32': {
125
+ const spelled = windowsTarget(target)
126
+ /* explorer cannot /select a drive root; open the drive itself instead. */
127
+ if (/^[A-Za-z]:\\$/u.test(spelled)) return { command: 'explorer.exe', args: [spelled] }
128
+ return { command: 'explorer.exe', args: [encodeExplorerSelect(spelled)] }
129
+ }
126
130
  case 'android':
127
131
  return { command: 'termux-open', args: [directoryOf(target, platform)] }
128
132
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-chat-link-actions",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Right-click actions on file links in the DSH transcript: quote the path into the composer, or reveal the file in the OS file manager. Menus are drawn in the app's own style, never the system one.",
5
5
  "type": "module",
6
6
  "main": "index.js",