@tutti-os/workspace-file-manager 0.0.1
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/LICENSE +202 -0
- package/README.md +51 -0
- package/dist/chunk-2AG4ND4D.js +208 -0
- package/dist/chunk-2AG4ND4D.js.map +1 -0
- package/dist/chunk-IMOFXYBB.js +1759 -0
- package/dist/chunk-IMOFXYBB.js.map +1 -0
- package/dist/fileKinds-MpDaZhVB.d.ts +392 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +11 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-6L2biT8M.d.ts +90 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +2802 -0
- package/dist/index.js.map +1 -0
- package/dist/services/index.d.ts +8 -0
- package/dist/services/index.js +41 -0
- package/dist/services/index.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { a as WorkspaceFileManagerI18nRuntime } from './index-6L2biT8M.js';
|
|
2
|
+
|
|
3
|
+
type WorkspaceFileManagerHostActionMessageStatus = "cancelled" | "completed" | "started";
|
|
4
|
+
interface WorkspaceFileManagerHostActionMessage {
|
|
5
|
+
actionKind: "export" | "import";
|
|
6
|
+
entry?: WorkspaceFileEntry | null;
|
|
7
|
+
message: string;
|
|
8
|
+
status: WorkspaceFileManagerHostActionMessageStatus;
|
|
9
|
+
}
|
|
10
|
+
interface WorkspaceFileManagerHostImportResult {
|
|
11
|
+
cancelledMessage?: string | null;
|
|
12
|
+
completedMessage?: string | null;
|
|
13
|
+
startedMessage?: string | null;
|
|
14
|
+
summary?: WorkspaceFileImportSummary | null;
|
|
15
|
+
message?: string | null;
|
|
16
|
+
supported: boolean;
|
|
17
|
+
title?: string | null;
|
|
18
|
+
importConflict?: WorkspaceFileManagerHostImportConflict | null;
|
|
19
|
+
}
|
|
20
|
+
interface WorkspaceFileManagerHostExportResult {
|
|
21
|
+
cancelledMessage?: string | null;
|
|
22
|
+
completedMessage?: string | null;
|
|
23
|
+
message?: string | null;
|
|
24
|
+
startedMessage?: string | null;
|
|
25
|
+
supported: boolean;
|
|
26
|
+
title?: string | null;
|
|
27
|
+
importConflict?: null;
|
|
28
|
+
}
|
|
29
|
+
type WorkspaceFileManagerHostActionResult = WorkspaceFileManagerHostExportResult | WorkspaceFileManagerHostImportResult;
|
|
30
|
+
interface WorkspaceFileManagerHostImportConflict {
|
|
31
|
+
conflicts: WorkspaceFileImportConflict[];
|
|
32
|
+
summary?: WorkspaceFileImportSummary | null;
|
|
33
|
+
onConfirm?: () => Promise<WorkspaceFileManagerHostImportResult | void>;
|
|
34
|
+
}
|
|
35
|
+
interface WorkspaceFileManagerFileActivationRequest {
|
|
36
|
+
entry: WorkspaceFileEntry;
|
|
37
|
+
target: WorkspaceFileActivationTarget | null;
|
|
38
|
+
}
|
|
39
|
+
type WorkspaceFileManagerHostFallbackActionKind = "download" | "none" | "open";
|
|
40
|
+
type WorkspaceFileManagerHostFallbackAction = {
|
|
41
|
+
kind: "download" | "open";
|
|
42
|
+
label?: string | null;
|
|
43
|
+
onSelect: () => Promise<WorkspaceFileManagerHostFileActivationResult | void>;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "none";
|
|
46
|
+
label?: string | null;
|
|
47
|
+
};
|
|
48
|
+
type WorkspaceFileManagerHostFileActivationResult = {
|
|
49
|
+
disposition: "handled";
|
|
50
|
+
} | {
|
|
51
|
+
actions?: WorkspaceFileManagerHostFallbackAction[] | null;
|
|
52
|
+
disposition: "fallback" | "unsupported";
|
|
53
|
+
message?: string | null;
|
|
54
|
+
title?: string | null;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
type WorkspaceFileEntryKind = "file" | "directory" | "unknown";
|
|
58
|
+
type WorkspaceFileSearchMatchTarget = "basename" | "path";
|
|
59
|
+
type WorkspaceFileImportConflictKind = "replaceable" | "type_mismatch";
|
|
60
|
+
type WorkspaceFilePreviewKind = "image" | "text";
|
|
61
|
+
declare const workspaceFileManagerPersistedStateSchemaVersion: 2;
|
|
62
|
+
interface WorkspaceFileEntry {
|
|
63
|
+
hasChildren: boolean;
|
|
64
|
+
kind: WorkspaceFileEntryKind;
|
|
65
|
+
mtimeMs: number | null;
|
|
66
|
+
name: string;
|
|
67
|
+
path: string;
|
|
68
|
+
sizeBytes: number | null;
|
|
69
|
+
}
|
|
70
|
+
interface WorkspaceFileActivationTarget {
|
|
71
|
+
fileKind: WorkspaceFilePreviewKind;
|
|
72
|
+
mtimeMs: number | null;
|
|
73
|
+
name: string;
|
|
74
|
+
path: string;
|
|
75
|
+
sizeBytes: number | null;
|
|
76
|
+
}
|
|
77
|
+
type WorkspaceFilePreviewState = {
|
|
78
|
+
status: "empty";
|
|
79
|
+
} | {
|
|
80
|
+
entry: WorkspaceFileEntry;
|
|
81
|
+
status: "directory";
|
|
82
|
+
} | {
|
|
83
|
+
entry: WorkspaceFileActivationTarget;
|
|
84
|
+
status: "loading";
|
|
85
|
+
} | {
|
|
86
|
+
content: string;
|
|
87
|
+
entry: WorkspaceFileActivationTarget;
|
|
88
|
+
status: "text";
|
|
89
|
+
} | {
|
|
90
|
+
entry: WorkspaceFileActivationTarget;
|
|
91
|
+
objectUrl: string;
|
|
92
|
+
status: "image";
|
|
93
|
+
} | {
|
|
94
|
+
entry: WorkspaceFileEntry;
|
|
95
|
+
message: string;
|
|
96
|
+
status: "unsupported";
|
|
97
|
+
} | {
|
|
98
|
+
entry: WorkspaceFileEntry;
|
|
99
|
+
message: string;
|
|
100
|
+
status: "readonly";
|
|
101
|
+
} | {
|
|
102
|
+
entry: WorkspaceFileEntry;
|
|
103
|
+
message: string;
|
|
104
|
+
status: "error";
|
|
105
|
+
};
|
|
106
|
+
interface WorkspaceFileDirectoryListing {
|
|
107
|
+
directoryPath: string;
|
|
108
|
+
entries: WorkspaceFileEntry[];
|
|
109
|
+
root: string;
|
|
110
|
+
workspaceID: string;
|
|
111
|
+
}
|
|
112
|
+
interface WorkspaceFileSearchEntry {
|
|
113
|
+
directoryPath: string;
|
|
114
|
+
kind: WorkspaceFileEntryKind;
|
|
115
|
+
matchIndices: number[];
|
|
116
|
+
matchTarget: WorkspaceFileSearchMatchTarget;
|
|
117
|
+
name: string;
|
|
118
|
+
path: string;
|
|
119
|
+
score: number;
|
|
120
|
+
}
|
|
121
|
+
interface WorkspaceFileSearchResult {
|
|
122
|
+
entries: WorkspaceFileSearchEntry[];
|
|
123
|
+
root: string;
|
|
124
|
+
workspaceID: string;
|
|
125
|
+
}
|
|
126
|
+
interface WorkspaceFileImportConflict {
|
|
127
|
+
conflictKind: WorkspaceFileImportConflictKind;
|
|
128
|
+
destinationKind: WorkspaceFileEntryKind;
|
|
129
|
+
destinationPath: string;
|
|
130
|
+
name: string;
|
|
131
|
+
sourcePath: string;
|
|
132
|
+
}
|
|
133
|
+
type WorkspaceFileImportSummaryReason = "ignored" | "symlink" | "system_metadata";
|
|
134
|
+
interface WorkspaceFileImportSummaryReasonCount {
|
|
135
|
+
count: number;
|
|
136
|
+
reason: WorkspaceFileImportSummaryReason;
|
|
137
|
+
}
|
|
138
|
+
interface WorkspaceFileImportSummary {
|
|
139
|
+
filteredCount?: number;
|
|
140
|
+
ignoredCount?: number;
|
|
141
|
+
reasonBreakdown?: WorkspaceFileImportSummaryReasonCount[];
|
|
142
|
+
selectedCount?: number;
|
|
143
|
+
}
|
|
144
|
+
interface WorkspaceFileManagerPersistedState {
|
|
145
|
+
currentDirectoryPath: string;
|
|
146
|
+
navigationBackStack: string[];
|
|
147
|
+
navigationForwardStack: string[];
|
|
148
|
+
schemaVersion: typeof workspaceFileManagerPersistedStateSchemaVersion;
|
|
149
|
+
}
|
|
150
|
+
interface WorkspaceFileSearchInput {
|
|
151
|
+
includeKinds?: Extract<WorkspaceFileEntryKind, "file" | "directory">[];
|
|
152
|
+
limit?: number;
|
|
153
|
+
query: string;
|
|
154
|
+
}
|
|
155
|
+
interface WorkspaceFileOpenWithApplication {
|
|
156
|
+
applicationPath: string;
|
|
157
|
+
iconDataUrl?: string | null;
|
|
158
|
+
name: string;
|
|
159
|
+
}
|
|
160
|
+
interface WorkspaceFileManagerCapabilities {
|
|
161
|
+
canCopy: boolean;
|
|
162
|
+
canCreateDirectory: boolean;
|
|
163
|
+
canCreateFile: boolean;
|
|
164
|
+
canDelete: boolean;
|
|
165
|
+
canExport: boolean;
|
|
166
|
+
canImportFromDrop: boolean;
|
|
167
|
+
canImportFromPicker: boolean;
|
|
168
|
+
canMove: boolean;
|
|
169
|
+
canOpenInAppBrowser: boolean;
|
|
170
|
+
canOpenInDefaultBrowser: boolean;
|
|
171
|
+
canOpenWith: boolean;
|
|
172
|
+
canPickOtherOpenWithApplication: boolean;
|
|
173
|
+
canRevealInFolder: boolean;
|
|
174
|
+
canRename: boolean;
|
|
175
|
+
canSearch: boolean;
|
|
176
|
+
}
|
|
177
|
+
type WorkspaceFileManagerBusyAction = "create" | "delete" | "export" | "import" | "move" | "rename" | "view";
|
|
178
|
+
interface WorkspaceFileManagerCreateDialogState {
|
|
179
|
+
errorMessage: string | null;
|
|
180
|
+
kind: "directory" | "file";
|
|
181
|
+
name: string;
|
|
182
|
+
}
|
|
183
|
+
type WorkspaceFileManagerInlineRenameValidation = "invalid" | "required";
|
|
184
|
+
interface WorkspaceFileManagerDeleteDialogState {
|
|
185
|
+
entryPath: string;
|
|
186
|
+
}
|
|
187
|
+
interface WorkspaceFileManagerContextMenuState {
|
|
188
|
+
entryPath: string | null;
|
|
189
|
+
x: number;
|
|
190
|
+
y: number;
|
|
191
|
+
}
|
|
192
|
+
interface WorkspaceFileManagerUnsupportedDialogState {
|
|
193
|
+
actions?: WorkspaceFileManagerHostFallbackAction[] | null;
|
|
194
|
+
entryPath?: string | null;
|
|
195
|
+
kind: "import" | "view";
|
|
196
|
+
message?: string | null;
|
|
197
|
+
title?: string | null;
|
|
198
|
+
}
|
|
199
|
+
interface WorkspaceFileManagerState {
|
|
200
|
+
busyAction: WorkspaceFileManagerBusyAction | null;
|
|
201
|
+
capabilities: WorkspaceFileManagerCapabilities;
|
|
202
|
+
contextMenu: WorkspaceFileManagerContextMenuState | null;
|
|
203
|
+
contextMenuEntryPath: string | null;
|
|
204
|
+
createDialog: WorkspaceFileManagerCreateDialogState | null;
|
|
205
|
+
currentDirectoryPath: string;
|
|
206
|
+
deleteDialog: WorkspaceFileManagerDeleteDialogState | null;
|
|
207
|
+
inlineRenameEntryPath: string | null;
|
|
208
|
+
inlineRenameValidation: WorkspaceFileManagerInlineRenameValidation | null;
|
|
209
|
+
dragDepth: number;
|
|
210
|
+
entries: WorkspaceFileEntry[];
|
|
211
|
+
error: string | null;
|
|
212
|
+
isLoading: boolean;
|
|
213
|
+
isMutating: boolean;
|
|
214
|
+
isSearching: boolean;
|
|
215
|
+
navigationBackStack: string[];
|
|
216
|
+
navigationForwardStack: string[];
|
|
217
|
+
pendingDirectoryPath: string | null;
|
|
218
|
+
previewState: WorkspaceFilePreviewState;
|
|
219
|
+
root: string;
|
|
220
|
+
searchEntries: WorkspaceFileSearchEntry[];
|
|
221
|
+
searchError: string | null;
|
|
222
|
+
searchQuery: string;
|
|
223
|
+
selectedPath: string | null;
|
|
224
|
+
unsupportedDialog: WorkspaceFileManagerUnsupportedDialogState | null;
|
|
225
|
+
importConflictDialog: WorkspaceFileManagerHostImportConflict | null;
|
|
226
|
+
workspaceID: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
interface WorkspaceFileManagerMutationErrorMessage {
|
|
230
|
+
actionKind: "create" | "delete" | "move" | "rename";
|
|
231
|
+
error: unknown;
|
|
232
|
+
message: string;
|
|
233
|
+
}
|
|
234
|
+
interface WorkspaceFileManagerHost {
|
|
235
|
+
listDirectory(input: {
|
|
236
|
+
includeHidden?: boolean;
|
|
237
|
+
path: string;
|
|
238
|
+
workspaceID: string;
|
|
239
|
+
}): Promise<WorkspaceFileDirectoryListing>;
|
|
240
|
+
search?(input: WorkspaceFileSearchInput & {
|
|
241
|
+
workspaceID: string;
|
|
242
|
+
}): Promise<WorkspaceFileSearchResult>;
|
|
243
|
+
createDirectory?(input: {
|
|
244
|
+
path: string;
|
|
245
|
+
workspaceID: string;
|
|
246
|
+
}): Promise<WorkspaceFileEntry>;
|
|
247
|
+
createFile?(input: {
|
|
248
|
+
path: string;
|
|
249
|
+
workspaceID: string;
|
|
250
|
+
}): Promise<WorkspaceFileEntry>;
|
|
251
|
+
deleteEntry?(input: {
|
|
252
|
+
kind?: Extract<WorkspaceFileEntryKind, "file" | "directory"> | null;
|
|
253
|
+
path: string;
|
|
254
|
+
workspaceID: string;
|
|
255
|
+
}): Promise<void>;
|
|
256
|
+
moveEntry?(input: {
|
|
257
|
+
kind: Extract<WorkspaceFileEntryKind, "file" | "directory">;
|
|
258
|
+
path: string;
|
|
259
|
+
targetDirectoryPath: string;
|
|
260
|
+
workspaceID: string;
|
|
261
|
+
}): Promise<WorkspaceFileEntry>;
|
|
262
|
+
renameEntry?(input: {
|
|
263
|
+
path: string;
|
|
264
|
+
newName: string;
|
|
265
|
+
workspaceID: string;
|
|
266
|
+
}): Promise<WorkspaceFileEntry>;
|
|
267
|
+
copyEntriesToClipboard?(input: {
|
|
268
|
+
paths: string[];
|
|
269
|
+
workspaceID: string;
|
|
270
|
+
}): Promise<void>;
|
|
271
|
+
listOpenWithApplications?(input: {
|
|
272
|
+
path: string;
|
|
273
|
+
workspaceID: string;
|
|
274
|
+
}): Promise<WorkspaceFileOpenWithApplication[]>;
|
|
275
|
+
openFileWithApplication?(input: {
|
|
276
|
+
applicationPath: string;
|
|
277
|
+
path: string;
|
|
278
|
+
workspaceID: string;
|
|
279
|
+
}): Promise<void>;
|
|
280
|
+
openFileWithOtherApplication?(input: {
|
|
281
|
+
applicationPickerPrompt?: string;
|
|
282
|
+
path: string;
|
|
283
|
+
workspaceID: string;
|
|
284
|
+
}): Promise<void>;
|
|
285
|
+
openFileInAppBrowser?(input: {
|
|
286
|
+
path: string;
|
|
287
|
+
workspaceID: string;
|
|
288
|
+
}): Promise<void>;
|
|
289
|
+
openFileInDefaultBrowser?(input: {
|
|
290
|
+
path: string;
|
|
291
|
+
workspaceID: string;
|
|
292
|
+
}): Promise<void>;
|
|
293
|
+
revealEntry?(input: {
|
|
294
|
+
path: string;
|
|
295
|
+
workspaceID: string;
|
|
296
|
+
}): Promise<void>;
|
|
297
|
+
activateFile?(request: WorkspaceFileManagerFileActivationRequest, workspaceID: string): Promise<WorkspaceFileManagerHostFileActivationResult>;
|
|
298
|
+
exportEntry?(input: {
|
|
299
|
+
entry: WorkspaceFileEntry;
|
|
300
|
+
workspaceID: string;
|
|
301
|
+
}): Promise<WorkspaceFileManagerHostExportResult>;
|
|
302
|
+
readPreviewFile?(workspaceID: string, path: string): Promise<Uint8Array | ArrayBuffer>;
|
|
303
|
+
resolveErrorMessage?(error: unknown, overrides?: Record<string, string>): string;
|
|
304
|
+
resolveDroppedPaths?(dataTransfer: Pick<DataTransfer, "files" | "items">): string[];
|
|
305
|
+
importFiles?(workspaceID: string, targetDirectoryPath: string): Promise<WorkspaceFileManagerHostActionResult>;
|
|
306
|
+
importPaths?(workspaceID: string, targetDirectoryPath: string, sourcePaths: string[]): Promise<WorkspaceFileManagerHostActionResult>;
|
|
307
|
+
}
|
|
308
|
+
interface CreateWorkspaceFileManagerSessionInput {
|
|
309
|
+
i18n: WorkspaceFileManagerI18nRuntime;
|
|
310
|
+
host: WorkspaceFileManagerHost;
|
|
311
|
+
initialDirectoryPath?: string;
|
|
312
|
+
onHostActionMessage?: (message: WorkspaceFileManagerHostActionMessage) => void;
|
|
313
|
+
onMutationErrorMessage?: (message: WorkspaceFileManagerMutationErrorMessage) => boolean | void;
|
|
314
|
+
persistedState?: WorkspaceFileManagerPersistedState | null;
|
|
315
|
+
persistence?: {
|
|
316
|
+
load?(): WorkspaceFileManagerPersistedState | null | undefined;
|
|
317
|
+
save(state: WorkspaceFileManagerPersistedState): void;
|
|
318
|
+
};
|
|
319
|
+
workspaceID: string;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface WorkspaceFileManagerCommands {
|
|
323
|
+
applyRevealIntent(intent: {
|
|
324
|
+
path: string;
|
|
325
|
+
requestID: string;
|
|
326
|
+
} | null): Promise<void>;
|
|
327
|
+
closeContextMenu(): void;
|
|
328
|
+
closeCreateDialog(): void;
|
|
329
|
+
closeDeleteDialog(): void;
|
|
330
|
+
cancelInlineRename(): void;
|
|
331
|
+
closeTransientUi(): void;
|
|
332
|
+
closeUnsupportedDialog(): void;
|
|
333
|
+
closeImportConflictDialog(): void;
|
|
334
|
+
confirmCreateDialog(): Promise<void>;
|
|
335
|
+
confirmDeleteDialog(): Promise<void>;
|
|
336
|
+
clearInlineRenameValidation(): void;
|
|
337
|
+
confirmInlineRename(newName: string): Promise<boolean>;
|
|
338
|
+
copyToClipboard(entry: WorkspaceFileEntry): Promise<void>;
|
|
339
|
+
confirmImportConflict(): Promise<void>;
|
|
340
|
+
createDirectory(path: string): Promise<void>;
|
|
341
|
+
createFile(path: string): Promise<void>;
|
|
342
|
+
deleteSelected(): Promise<void>;
|
|
343
|
+
decrementDragDepth(): void;
|
|
344
|
+
goBack(): Promise<void>;
|
|
345
|
+
goForward(): Promise<void>;
|
|
346
|
+
getPersistedState(): WorkspaceFileManagerPersistedState;
|
|
347
|
+
handleActivationFallbackAction(action: WorkspaceFileManagerHostFallbackAction): Promise<void>;
|
|
348
|
+
incrementDragDepth(): void;
|
|
349
|
+
initialize(): Promise<void>;
|
|
350
|
+
loadDirectory(path?: string): Promise<void>;
|
|
351
|
+
openContextMenu(input: WorkspaceFileManagerContextMenuState): void;
|
|
352
|
+
openCreateDirectoryDialog(): void;
|
|
353
|
+
openCreateFileDialog(): void;
|
|
354
|
+
openDeleteDialog(entry: WorkspaceFileEntry): void;
|
|
355
|
+
startInlineRename(entry: WorkspaceFileEntry): void;
|
|
356
|
+
getCachedOpenWithApplications(entry: WorkspaceFileEntry): WorkspaceFileOpenWithApplication[] | null;
|
|
357
|
+
listOpenWithApplications(entry: WorkspaceFileEntry): Promise<WorkspaceFileOpenWithApplication[]>;
|
|
358
|
+
openEntry(entry: WorkspaceFileEntry): Promise<void>;
|
|
359
|
+
openFileWithApplication(entry: WorkspaceFileEntry, applicationPath: string): Promise<void>;
|
|
360
|
+
openFileInAppBrowser(entry: WorkspaceFileEntry): Promise<void>;
|
|
361
|
+
openFileInDefaultBrowser(entry: WorkspaceFileEntry): Promise<void>;
|
|
362
|
+
openFileWithOtherApplication(entry: WorkspaceFileEntry): Promise<void>;
|
|
363
|
+
revealEntry(entry: WorkspaceFileEntry): Promise<void>;
|
|
364
|
+
exportEntry(entry: WorkspaceFileEntry): Promise<WorkspaceFileManagerHostActionResult>;
|
|
365
|
+
importDroppedFiles(dataTransfer: Pick<DataTransfer, "files" | "items">, targetDirectoryPath: string): Promise<WorkspaceFileManagerHostActionResult>;
|
|
366
|
+
importFiles(targetDirectoryPath: string): Promise<WorkspaceFileManagerHostActionResult>;
|
|
367
|
+
moveEntry(entry: WorkspaceFileEntry, targetDirectoryPath: string): Promise<void>;
|
|
368
|
+
refresh(): Promise<void>;
|
|
369
|
+
revealPath(path: string): Promise<void>;
|
|
370
|
+
resetDragDepth(): void;
|
|
371
|
+
search(query: string): Promise<void>;
|
|
372
|
+
select(path: string | null): void;
|
|
373
|
+
setActive(active: boolean): void;
|
|
374
|
+
setI18nRuntime(copy: WorkspaceFileManagerI18nRuntime): void;
|
|
375
|
+
updateCreateDialogName(name: string): void;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
interface WorkspaceFileManagerSession extends WorkspaceFileManagerCommands {
|
|
379
|
+
activateFile(request: WorkspaceFileManagerFileActivationRequest): Promise<WorkspaceFileManagerHostFileActivationResult>;
|
|
380
|
+
dispose(): void;
|
|
381
|
+
readonly store: WorkspaceFileManagerState;
|
|
382
|
+
}
|
|
383
|
+
interface WorkspaceFileManagerService {
|
|
384
|
+
createSession(input: CreateWorkspaceFileManagerSessionInput): WorkspaceFileManagerSession;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare function createWorkspaceFileManagerService(): WorkspaceFileManagerService;
|
|
388
|
+
|
|
389
|
+
declare function classifyWorkspaceFilePreviewKind(entry: WorkspaceFileEntry): WorkspaceFilePreviewKind | null;
|
|
390
|
+
declare function resolveWorkspaceFileActivationTarget(entry: WorkspaceFileEntry): WorkspaceFileActivationTarget | null;
|
|
391
|
+
|
|
392
|
+
export { type WorkspaceFilePreviewState as A, type WorkspaceFileSearchEntry as B, type CreateWorkspaceFileManagerSessionInput as C, type WorkspaceFileSearchResult as D, classifyWorkspaceFilePreviewKind as E, createWorkspaceFileManagerService as F, resolveWorkspaceFileActivationTarget as G, type WorkspaceFileActivationTarget as W, type WorkspaceFileDirectoryListing as a, type WorkspaceFileEntry as b, type WorkspaceFileEntryKind as c, type WorkspaceFileImportConflict as d, type WorkspaceFileImportSummary as e, type WorkspaceFileImportSummaryReason as f, type WorkspaceFileImportSummaryReasonCount as g, type WorkspaceFileManagerCapabilities as h, type WorkspaceFileManagerFileActivationRequest as i, type WorkspaceFileManagerHost as j, type WorkspaceFileManagerHostActionMessage as k, type WorkspaceFileManagerHostActionMessageStatus as l, type WorkspaceFileManagerHostActionResult as m, type WorkspaceFileManagerHostExportResult as n, type WorkspaceFileManagerHostFallbackAction as o, type WorkspaceFileManagerHostFallbackActionKind as p, type WorkspaceFileManagerHostFileActivationResult as q, type WorkspaceFileManagerHostImportConflict as r, type WorkspaceFileManagerHostImportResult as s, type WorkspaceFileManagerMutationErrorMessage as t, type WorkspaceFileManagerPersistedState as u, type WorkspaceFileManagerService as v, type WorkspaceFileManagerSession as w, type WorkspaceFileManagerState as x, type WorkspaceFileOpenWithApplication as y, type WorkspaceFilePreviewKind as z };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createWorkspaceFileManagerI18nRuntime,
|
|
3
|
+
workspaceFileManagerI18nNamespace,
|
|
4
|
+
workspaceFileManagerI18nResources
|
|
5
|
+
} from "../chunk-2AG4ND4D.js";
|
|
6
|
+
export {
|
|
7
|
+
createWorkspaceFileManagerI18nRuntime,
|
|
8
|
+
workspaceFileManagerI18nNamespace,
|
|
9
|
+
workspaceFileManagerI18nResources
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { I18nRuntime, I18nDictionary } from '@tutti-os/ui-i18n-runtime';
|
|
2
|
+
|
|
3
|
+
type WorkspaceFileManagerI18nLocale = "en" | "zh-CN";
|
|
4
|
+
declare const workspaceFileManagerI18nNamespace = "workspaceFileManager";
|
|
5
|
+
declare const workspaceFileManagerEn: {
|
|
6
|
+
readonly backLabel: "Back";
|
|
7
|
+
readonly breadcrumbRootLabel: "workspace";
|
|
8
|
+
readonly cancelLabel: "Cancel";
|
|
9
|
+
readonly closeLabel: "Close";
|
|
10
|
+
readonly copyLabel: "Copy";
|
|
11
|
+
readonly copyPathLabel: "Copy path";
|
|
12
|
+
readonly copyPathSuccessTitle: "Path copied";
|
|
13
|
+
readonly copySuccessTitle: "Copied to clipboard";
|
|
14
|
+
readonly createActionLabel: "Create";
|
|
15
|
+
readonly createDirectoryLabel: "New folder";
|
|
16
|
+
readonly createDirectoryPlaceholder: "Folder name";
|
|
17
|
+
readonly createFileLabel: "New file";
|
|
18
|
+
readonly createFilePlaceholder: "File name";
|
|
19
|
+
readonly createNameInvalid: "Use a valid name without path separators";
|
|
20
|
+
readonly createNameRequired: "Enter a name to continue";
|
|
21
|
+
readonly deleteConfirmDescription: "Delete {{name}} from this workspace?";
|
|
22
|
+
readonly deleteLabel: "Delete";
|
|
23
|
+
readonly deletingLabel: "Deleting...";
|
|
24
|
+
readonly downloadFailedTitle: "Download failed";
|
|
25
|
+
readonly downloadLabel: "Download";
|
|
26
|
+
readonly dropToImportLabel: "Drop files here to import to the current folder";
|
|
27
|
+
readonly emptyDirectory: "No visible files in this folder";
|
|
28
|
+
readonly forwardLabel: "Forward";
|
|
29
|
+
readonly loading: "Loading";
|
|
30
|
+
readonly modifiedLabel: "Modified";
|
|
31
|
+
readonly nameLabel: "Name";
|
|
32
|
+
readonly noSearchResults: "No files matched your search";
|
|
33
|
+
readonly openFailedTitle: "Open failed";
|
|
34
|
+
readonly openLabel: "Open";
|
|
35
|
+
readonly openInAppBrowserLabel: "Nextop built-in browser";
|
|
36
|
+
readonly openInDefaultBrowserLabel: "Default Browser";
|
|
37
|
+
readonly openWithLabel: "Open With";
|
|
38
|
+
readonly openWithLoadingLabel: "Loading apps...";
|
|
39
|
+
readonly openWithOtherLabel: "Other...";
|
|
40
|
+
readonly openWithOtherPickerPrompt: "Choose an application to open this file:";
|
|
41
|
+
readonly revealInFileExplorerLabel: "Reveal in File Explorer";
|
|
42
|
+
readonly revealInFileManagerLabel: "Reveal in File Manager";
|
|
43
|
+
readonly revealInFinderLabel: "Reveal in Finder";
|
|
44
|
+
readonly unknownErrorMessage: "Something went wrong. Please try again.";
|
|
45
|
+
readonly previewBinary: "This file looks binary, so the preview stays read-only for now.";
|
|
46
|
+
readonly previewDecodeFailed: "We couldn't decode this file as UTF-8 text for preview.";
|
|
47
|
+
readonly previewDirectoryLabel: "Folder";
|
|
48
|
+
readonly previewEmptyLabel: "Select a file or folder to view details";
|
|
49
|
+
readonly previewFileTooLarge: "This file is larger than {{maxSize}}, so inline preview is disabled.";
|
|
50
|
+
readonly previewLoadingLabel: "Loading preview...";
|
|
51
|
+
readonly previewTooLarge: "This text file is larger than {{maxSize}}, so inline preview is disabled.";
|
|
52
|
+
readonly previewUnavailableDownloadBody: "Download {{name}} to open it in another environment.";
|
|
53
|
+
readonly previewUnavailableOpenBody: "Open {{name}} in your local app instead.";
|
|
54
|
+
readonly previewUnavailableTitle: "Can't preview this file";
|
|
55
|
+
readonly previewUnsupported: "Inline preview isn't available for this file type yet.";
|
|
56
|
+
readonly revealFailedTitle: "Could not reveal in file manager";
|
|
57
|
+
readonly renameActionLabel: "Rename";
|
|
58
|
+
readonly renameLabel: "Rename";
|
|
59
|
+
readonly renamePlaceholder: "New name";
|
|
60
|
+
readonly refreshLabel: "Refresh";
|
|
61
|
+
readonly retryLabel: "Retry";
|
|
62
|
+
readonly searchPlaceholder: "Search files";
|
|
63
|
+
readonly searchResultsLabel: "Search results";
|
|
64
|
+
readonly sizeLabel: "Size";
|
|
65
|
+
readonly unsupportedImportBody: "Importing local files into the workspace is not wired up in this desktop build yet.";
|
|
66
|
+
readonly unsupportedImportTitle: "Import not available yet";
|
|
67
|
+
readonly unsupportedViewBody: "Opening {{name}} from the file manager is not supported in this desktop build yet.";
|
|
68
|
+
readonly unsupportedViewTitle: "Open not available yet";
|
|
69
|
+
readonly importConflictDescription: "{{count}} file from this import already exists in this folder tree. Replace it?";
|
|
70
|
+
readonly importConflictReplaceLabel: "Replace files";
|
|
71
|
+
readonly importConflictReviewLabel: "Existing path";
|
|
72
|
+
readonly importConflictSummaryFiltered: "Filtered: {{count}}";
|
|
73
|
+
readonly importConflictSummaryIgnored: "Ignored: {{count}}";
|
|
74
|
+
readonly importConflictSummaryReasonIgnored: "Ignored by rules: {{count}}";
|
|
75
|
+
readonly importConflictSummaryReasonSymlink: "Skipped symlinks: {{count}}";
|
|
76
|
+
readonly importConflictSummaryReasonSystemMetadata: "Skipped system metadata: {{count}}";
|
|
77
|
+
readonly importConflictSummarySelected: "Selected: {{count}}";
|
|
78
|
+
readonly importConflictTitle: "Replace existing file?";
|
|
79
|
+
readonly importFailedTitle: "Import failed";
|
|
80
|
+
readonly importLabel: "Import";
|
|
81
|
+
readonly importTypeConflictDescription: "{{count}} import path conflicts with an existing file or folder using an incompatible type. Resolve it before retrying.";
|
|
82
|
+
readonly importTypeConflictTitle: "Import path conflict";
|
|
83
|
+
};
|
|
84
|
+
type WorkspaceFileManagerI18nKey = keyof typeof workspaceFileManagerEn;
|
|
85
|
+
type WorkspaceFileManagerI18nRuntime = I18nRuntime<WorkspaceFileManagerI18nKey>;
|
|
86
|
+
declare const workspaceFileManagerI18nResources: Record<WorkspaceFileManagerI18nLocale, I18nDictionary>;
|
|
87
|
+
declare function createWorkspaceFileManagerI18nRuntime(runtime: I18nRuntime<string>): WorkspaceFileManagerI18nRuntime;
|
|
88
|
+
declare function resolveRevealInFolderLabel(copy: WorkspaceFileManagerI18nRuntime, platform: NodeJS.Platform): string;
|
|
89
|
+
|
|
90
|
+
export { type WorkspaceFileManagerI18nKey as W, type WorkspaceFileManagerI18nRuntime as a, workspaceFileManagerI18nResources as b, createWorkspaceFileManagerI18nRuntime as c, resolveRevealInFolderLabel as r, workspaceFileManagerI18nNamespace as w };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { y as WorkspaceFileOpenWithApplication, b as WorkspaceFileEntry, w as WorkspaceFileManagerSession } from './fileKinds-MpDaZhVB.js';
|
|
2
|
+
export { C as CreateWorkspaceFileManagerSessionInput, W as WorkspaceFileActivationTarget, a as WorkspaceFileDirectoryListing, c as WorkspaceFileEntryKind, d as WorkspaceFileImportConflict, e as WorkspaceFileImportSummary, f as WorkspaceFileImportSummaryReason, g as WorkspaceFileImportSummaryReasonCount, h as WorkspaceFileManagerCapabilities, i as WorkspaceFileManagerFileActivationRequest, j as WorkspaceFileManagerHost, k as WorkspaceFileManagerHostActionMessage, l as WorkspaceFileManagerHostActionMessageStatus, m as WorkspaceFileManagerHostActionResult, n as WorkspaceFileManagerHostExportResult, o as WorkspaceFileManagerHostFallbackAction, p as WorkspaceFileManagerHostFallbackActionKind, q as WorkspaceFileManagerHostFileActivationResult, r as WorkspaceFileManagerHostImportConflict, s as WorkspaceFileManagerHostImportResult, t as WorkspaceFileManagerMutationErrorMessage, u as WorkspaceFileManagerPersistedState, v as WorkspaceFileManagerService, x as WorkspaceFileManagerState, z as WorkspaceFilePreviewKind, A as WorkspaceFilePreviewState, B as WorkspaceFileSearchEntry, D as WorkspaceFileSearchResult, E as classifyWorkspaceFilePreviewKind, F as createWorkspaceFileManagerService, G as resolveWorkspaceFileActivationTarget } from './fileKinds-MpDaZhVB.js';
|
|
3
|
+
import { a as WorkspaceFileManagerI18nRuntime } from './index-6L2biT8M.js';
|
|
4
|
+
export { W as WorkspaceFileManagerI18nKey, c as createWorkspaceFileManagerI18nRuntime, w as workspaceFileManagerI18nNamespace, b as workspaceFileManagerI18nResources } from './index-6L2biT8M.js';
|
|
5
|
+
import { ReactElement } from 'react';
|
|
6
|
+
import { NextopDateLocale } from '@tutti-os/ui-system/date-format';
|
|
7
|
+
export { decodeWorkspaceTextFile, isWorkspaceTextFileTooLarge, looksLikeBinaryText, resolveWorkspaceFileExtension, resolveWorkspaceImageMimeType, workspaceFilePreviewMaxBytes, workspaceFileTextMaxBytes } from '@tutti-os/workspace-file-preview';
|
|
8
|
+
import '@tutti-os/ui-i18n-runtime';
|
|
9
|
+
|
|
10
|
+
type WorkspaceFileManagerEntryDragMode = "external" | "internal-move";
|
|
11
|
+
|
|
12
|
+
interface WorkspaceFileManagerProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
dateLocale?: NextopDateLocale;
|
|
15
|
+
entryDragMode?: WorkspaceFileManagerEntryDragMode;
|
|
16
|
+
openInAppBrowserIcon?: ReactElement;
|
|
17
|
+
resolveOpenWithApplicationIcon?: (application: WorkspaceFileOpenWithApplication) => ReactElement | null;
|
|
18
|
+
onCopyEntry?: () => Promise<void> | void;
|
|
19
|
+
onCopyPath?: (path: string) => Promise<void> | void;
|
|
20
|
+
onDirectoryExpanded?: (path: string) => void;
|
|
21
|
+
onEntryDragStart?: (entry: WorkspaceFileEntry, dataTransfer: DataTransfer) => void;
|
|
22
|
+
hostOs?: NodeJS.Platform;
|
|
23
|
+
i18n: WorkspaceFileManagerI18nRuntime;
|
|
24
|
+
session: WorkspaceFileManagerSession;
|
|
25
|
+
surface?: "card" | "embedded";
|
|
26
|
+
}
|
|
27
|
+
declare function WorkspaceFileManager({ className, dateLocale, entryDragMode, i18n, onCopyEntry, onCopyPath, onDirectoryExpanded, onEntryDragStart, openInAppBrowserIcon, resolveOpenWithApplicationIcon, hostOs, session, surface }: WorkspaceFileManagerProps): ReactElement;
|
|
28
|
+
|
|
29
|
+
export { WorkspaceFileEntry, WorkspaceFileManager, type WorkspaceFileManagerEntryDragMode, WorkspaceFileManagerI18nRuntime, type WorkspaceFileManagerProps, WorkspaceFileManagerSession };
|