@glodon-aiot/agent-cli-ui 3.26.0-alpha.21 → 3.26.0-alpha.24
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/dist/es/index.mjs +4358 -4059
- package/dist/lib/index.js +20 -20
- package/dist/src/components/LocalWorkspace/importDroppedFiles.d.ts +47 -0
- package/package.json +4 -4
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { WorkspaceFiles } from '@glodon-aiot/bot-client-sdk';
|
|
2
|
+
/** 从系统拖进来的一项。没有 file 时表示空文件夹。 */
|
|
3
|
+
export interface DroppedEntry {
|
|
4
|
+
/** 相对本次拖放根的路径,使用 /。空文件夹可带结尾斜杠。 */
|
|
5
|
+
relativePath: string;
|
|
6
|
+
file?: File;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ImportFailure {
|
|
10
|
+
path: string;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ImportResult {
|
|
14
|
+
files: number;
|
|
15
|
+
directories: number;
|
|
16
|
+
failed: ImportFailure[];
|
|
17
|
+
}
|
|
18
|
+
export interface ImportProgress {
|
|
19
|
+
done: number;
|
|
20
|
+
total: number;
|
|
21
|
+
}
|
|
22
|
+
interface WebkitEntry {
|
|
23
|
+
isFile: boolean;
|
|
24
|
+
isDirectory: boolean;
|
|
25
|
+
name: string;
|
|
26
|
+
fullPath: string;
|
|
27
|
+
file?: (success: (file: File) => void, error?: (err: DOMException) => void) => void;
|
|
28
|
+
createReader?: () => {
|
|
29
|
+
readEntries: (success: (entries: WebkitEntry[]) => void, error?: (err: DOMException) => void) => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** 把拖放目标目录和条目相对路径拼成工作区路径。 */
|
|
33
|
+
export declare function joinWorkspacePath(directory: string, relativePath: string): string;
|
|
34
|
+
export declare function filesToEntries(files: Iterable<File>): DroppedEntry[];
|
|
35
|
+
export declare function collectEntries(roots: WebkitEntry[]): Promise<DroppedEntry[]>;
|
|
36
|
+
/**
|
|
37
|
+
* 读取拖放内容。webkitGetAsEntry 必须在 drop 事件里同步调用,
|
|
38
|
+
* 否则浏览器会清空 dataTransfer.items。
|
|
39
|
+
*/
|
|
40
|
+
export declare function readDataTransfer(dataTransfer: DataTransfer): Promise<DroppedEntry[]>;
|
|
41
|
+
/** 把拖入的文件写入已授权工作区。单次失败不影响其余文件。 */
|
|
42
|
+
export declare function importDroppedEntries(files: Pick<WorkspaceFiles, 'write' | 'mkdir'>, directory: string, entries: DroppedEntry[], onProgress?: (progress: ImportProgress) => void): Promise<ImportResult>;
|
|
43
|
+
export declare function describeImportResult(result: ImportResult): {
|
|
44
|
+
type: 'success' | 'warning' | 'error';
|
|
45
|
+
content: string;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/agent-cli-ui",
|
|
3
|
-
"version": "3.26.0-alpha.
|
|
3
|
+
"version": "3.26.0-alpha.24",
|
|
4
4
|
"module": "./dist/es/index.mjs",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"typings": "./dist/src/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ant-design/icons": "^5.3.4",
|
|
34
|
-
"@glodon-aiot/apis": "^3.26.0-alpha.
|
|
35
|
-
"@glodon-aiot/bot-client-sdk": "^3.26.0-alpha.
|
|
36
|
-
"@glodon-aiot/react-components": "^3.26.0-alpha.
|
|
34
|
+
"@glodon-aiot/apis": "^3.26.0-alpha.24",
|
|
35
|
+
"@glodon-aiot/bot-client-sdk": "^3.26.0-alpha.24",
|
|
36
|
+
"@glodon-aiot/react-components": "^3.26.0-alpha.24",
|
|
37
37
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
38
38
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
39
39
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|