@huyooo/file-explorer-bridge-electron 0.2.0 → 0.3.0

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.
@@ -56,10 +56,7 @@ function createElectronAdapter() {
56
56
  }
57
57
  };
58
58
  }
59
- function electronUrlEncoder(filePath) {
60
- const encodedPath = encodeURIComponent(filePath);
61
- return `app://file${encodedPath}`;
62
- }
59
+ var electronUrlEncoder = import_file_explorer_core.encodeFileUrl;
63
60
  function registerFileExplorerHandlers() {
64
61
  const adapter = createElectronAdapter();
65
62
  import_electron.ipcMain.handle(channel("readDirectory"), async (_event, dirPath) => {
@@ -1,4 +1,4 @@
1
- import { PlatformAdapter, ClipboardAdapter } from '@huyooo/file-explorer-core';
1
+ import { PlatformAdapter, encodeFileUrl, ClipboardAdapter } from '@huyooo/file-explorer-core';
2
2
 
3
3
  /**
4
4
  * File Explorer Electron Bridge - Main Process
@@ -15,10 +15,8 @@ declare function setClipboardAdapter(adapter: ClipboardAdapter): void;
15
15
  * 创建 Electron 平台适配器
16
16
  */
17
17
  declare function createElectronAdapter(): PlatformAdapter;
18
- /**
19
- * URL 编码器(使用 app:// 协议)
20
- */
21
- declare function electronUrlEncoder(filePath: string): string;
18
+ /** URL 编码器(使用 core 中的协议工具) */
19
+ declare const electronUrlEncoder: typeof encodeFileUrl;
22
20
  /**
23
21
  * 注册文件系统 IPC handlers
24
22
  */
@@ -1,4 +1,4 @@
1
- import { PlatformAdapter, ClipboardAdapter } from '@huyooo/file-explorer-core';
1
+ import { PlatformAdapter, encodeFileUrl, ClipboardAdapter } from '@huyooo/file-explorer-core';
2
2
 
3
3
  /**
4
4
  * File Explorer Electron Bridge - Main Process
@@ -15,10 +15,8 @@ declare function setClipboardAdapter(adapter: ClipboardAdapter): void;
15
15
  * 创建 Electron 平台适配器
16
16
  */
17
17
  declare function createElectronAdapter(): PlatformAdapter;
18
- /**
19
- * URL 编码器(使用 app:// 协议)
20
- */
21
- declare function electronUrlEncoder(filePath: string): string;
18
+ /** URL 编码器(使用 core 中的协议工具) */
19
+ declare const electronUrlEncoder: typeof encodeFileUrl;
22
20
  /**
23
21
  * 注册文件系统 IPC handlers
24
22
  */
@@ -23,7 +23,8 @@ import {
23
23
  searchFilesStream,
24
24
  getFileType,
25
25
  formatFileSize,
26
- formatDateTime
26
+ formatDateTime,
27
+ encodeFileUrl
27
28
  } from "@huyooo/file-explorer-core";
28
29
  import { promises as fs } from "fs";
29
30
  var CHANNEL_PREFIX = "file-explorer";
@@ -42,10 +43,7 @@ function createElectronAdapter() {
42
43
  }
43
44
  };
44
45
  }
45
- function electronUrlEncoder(filePath) {
46
- const encodedPath = encodeURIComponent(filePath);
47
- return `app://file${encodedPath}`;
48
- }
46
+ var electronUrlEncoder = encodeFileUrl;
49
47
  function registerFileExplorerHandlers() {
50
48
  const adapter = createElectronAdapter();
51
49
  ipcMain.handle(channel("readDirectory"), async (_event, dirPath) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/file-explorer-bridge-electron",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "File Explorer Electron Bridge - IPC integration for Electron apps",
5
5
  "type": "module",
6
6
  "main": "./dist/main/index.cjs",
@@ -36,7 +36,7 @@
36
36
  "clean": "rm -rf dist"
37
37
  },
38
38
  "dependencies": {
39
- "@huyooo/file-explorer-core": "^0.2.0"
39
+ "@huyooo/file-explorer-core": "^0.3.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "electron": ">=20.0.0"