@elevo-ai/plugin-sdk 0.4.1 → 0.4.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/index.cjs.js +1 -0
- package/index.d.ts +47 -1
- package/index.esm.js +1 -0
- package/package.json +1 -1
package/index.cjs.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface WorkspaceFile {
|
|
|
11
11
|
is_dir: boolean;
|
|
12
12
|
mod_time: string;
|
|
13
13
|
permission: 'readonly' | 'readwrite';
|
|
14
|
+
children?: WorkspaceFile[];
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -206,4 +207,49 @@ export interface ElevoPluginSDK {
|
|
|
206
207
|
|
|
207
208
|
export declare function usePluginSDK(): ElevoPluginSDK;
|
|
208
209
|
export declare function useInjectCSS(cssText: string): void;
|
|
209
|
-
export declare function
|
|
210
|
+
export declare function useWorkspaceFiles(options: UseWorkspaceFilesOptions): UseWorkspaceFilesReturn;
|
|
211
|
+
export declare function WorkspaceFileTree(props: WorkspaceFileTreeProps): React.ReactNode;
|
|
212
|
+
|
|
213
|
+
export interface UseWorkspaceFilesOptions {
|
|
214
|
+
workspaceId: string;
|
|
215
|
+
path?: string;
|
|
216
|
+
pattern?: string;
|
|
217
|
+
enabled?: boolean;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface UseWorkspaceFilesReturn {
|
|
221
|
+
files: WorkspaceFile[];
|
|
222
|
+
loading: boolean;
|
|
223
|
+
error: Error | null;
|
|
224
|
+
refresh: () => Promise<void>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface WorkspaceFileTreeProps {
|
|
228
|
+
files: WorkspaceFile[];
|
|
229
|
+
loading?: boolean;
|
|
230
|
+
onFileClick?: (file: WorkspaceFile) => void;
|
|
231
|
+
onFolderSelect?: (file: WorkspaceFile) => void;
|
|
232
|
+
onRename?: (file: WorkspaceFile) => void;
|
|
233
|
+
onDelete?: (file: WorkspaceFile) => void;
|
|
234
|
+
onCreateFile?: (parentPath: string) => void;
|
|
235
|
+
onCreateFolder?: (parentPath: string) => void;
|
|
236
|
+
onUpload?: (parentPath: string) => void;
|
|
237
|
+
onMove?: (sourcePath: string, targetPath: string) => void;
|
|
238
|
+
onSyncFromGit?: (parentPath: string) => void;
|
|
239
|
+
/** Path-based metadata for custom icons, read-only state, badges */
|
|
240
|
+
fileMetadata?: Map<string, FileNodeMetadata>;
|
|
241
|
+
enableContextMenu?: boolean;
|
|
242
|
+
enableDragDrop?: boolean;
|
|
243
|
+
compact?: boolean;
|
|
244
|
+
emptyState?: React.ReactNode;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Metadata overlay for a file/folder path */
|
|
248
|
+
export interface FileNodeMetadata {
|
|
249
|
+
/** Custom icon type to render instead of default folder/file icon */
|
|
250
|
+
iconType?: 'git' | 'git-error';
|
|
251
|
+
/** Whether this node and its children are read-only (no rename/delete/upload) */
|
|
252
|
+
isReadOnly?: boolean;
|
|
253
|
+
/** Status badge text */
|
|
254
|
+
badge?: string;
|
|
255
|
+
}
|
package/index.esm.js
CHANGED