@prozilla-os/file-explorer 1.1.22 → 1.1.25
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/README.md +3 -3
- package/dist/main.d.ts +4 -1028
- package/dist/main.js +8 -8
- package/dist/main.js.map +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
|
|
5
5
|
</p>
|
|
6
6
|
<p>
|
|
7
|
-
<a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE
|
|
8
|
-
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/
|
|
9
|
-
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/
|
|
7
|
+
<a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/prozilla-os/ProzillaOS?style=flat-square&color=FF4D5B&label=License"></a>
|
|
8
|
+
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/prozilla-os/ProzillaOS?style=flat-square&color=FED24C&label=%E2%AD%90"></a>
|
|
9
|
+
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/prozilla-os/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
|
|
10
10
|
<a href="https://www.npmjs.com/package/prozilla-os"><img alt="NPM Version" src="https://img.shields.io/npm/v/prozilla-os?logo=npm&style=flat-square&label=prozilla-os&color=FF4D5B"></a>
|
|
11
11
|
</p>
|
|
12
12
|
</div>
|
package/dist/main.d.ts
CHANGED
|
@@ -1,250 +1,11 @@
|
|
|
1
|
+
import { App } from '@prozilla-os/core';
|
|
1
2
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { UaEventOptions } from 'react-ga4/types/ga4';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* An application that can be ran by ProzillaOS.
|
|
8
|
-
*
|
|
9
|
-
* Applications can be installed by adding them to {@link AppsConfig.apps}.
|
|
10
|
-
* @typeParam AppProps - The props of the {@link windowContent} of this app.
|
|
11
|
-
*/
|
|
12
|
-
declare class App<AppProps extends WindowProps = WindowProps> {
|
|
13
|
-
/**
|
|
14
|
-
* The display name of this application.
|
|
15
|
-
*/
|
|
16
|
-
name: string;
|
|
17
|
-
/**
|
|
18
|
-
* The unique ID of this application.
|
|
19
|
-
*/
|
|
20
|
-
id: string;
|
|
21
|
-
/**
|
|
22
|
-
* Main component that renders this app inside a window.
|
|
23
|
-
*/
|
|
24
|
-
windowContent: FC<AppProps> | null;
|
|
25
|
-
/**
|
|
26
|
-
* Default options that get passed to the {@link App.windowContent} component.
|
|
27
|
-
*/
|
|
28
|
-
windowOptions?: Partial<AppProps> & DefaultWindowOptions;
|
|
29
|
-
/**
|
|
30
|
-
* Description of this application.
|
|
31
|
-
*/
|
|
32
|
-
description: string | null;
|
|
33
|
-
/**
|
|
34
|
-
* URL of the icon of this application.
|
|
35
|
-
*/
|
|
36
|
-
iconUrl: string | null;
|
|
37
|
-
/**
|
|
38
|
-
* Defines what the app can handle and how it can be used elsewhere in the system.
|
|
39
|
-
*/
|
|
40
|
-
role: string | null;
|
|
41
|
-
/**
|
|
42
|
-
* An array of file extensions that this application can interpret.
|
|
43
|
-
*/
|
|
44
|
-
associatedExtensions: string[];
|
|
45
|
-
/**
|
|
46
|
-
* Determines whether the app is pinned by default.
|
|
47
|
-
* @default true
|
|
48
|
-
*/
|
|
49
|
-
pinnedByDefault: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Determines whether the app is launched at startup.
|
|
52
|
-
* @default false
|
|
53
|
-
*/
|
|
54
|
-
launchAtStartup: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* The category the app belongs to.
|
|
57
|
-
*/
|
|
58
|
-
category: typeof APP_CATEGORIES[number] | null;
|
|
59
|
-
/**
|
|
60
|
-
* Metadata of the app's package.
|
|
61
|
-
*/
|
|
62
|
-
metadata: AppMetadata | null;
|
|
63
|
-
/**
|
|
64
|
-
* Determines whether a desktop icon is added to the default data.
|
|
65
|
-
* @default false
|
|
66
|
-
*/
|
|
67
|
-
showDesktopIcon: boolean;
|
|
68
|
-
isActive: boolean;
|
|
69
|
-
isPinned?: boolean;
|
|
70
|
-
isInstalled: boolean;
|
|
71
|
-
constructor(name: App["name"], id: App["id"], windowContent: App<AppProps>["windowContent"], windowOptions?: Partial<AppProps> & DefaultWindowOptions);
|
|
72
|
-
/**
|
|
73
|
-
* Returns the component that renders the content of a window for this app.
|
|
74
|
-
*/
|
|
75
|
-
WindowContent: (props: AppProps) => JSX_2.Element | null;
|
|
76
|
-
/**
|
|
77
|
-
* Sets the display name of this application.
|
|
78
|
-
*/
|
|
79
|
-
setName(name: string): this;
|
|
80
|
-
/**
|
|
81
|
-
* Sets the description of this application.
|
|
82
|
-
*/
|
|
83
|
-
setDescription(description: App["description"]): this;
|
|
84
|
-
/**
|
|
85
|
-
* Sets the URL of the icon of this application.
|
|
86
|
-
*/
|
|
87
|
-
setIconUrl(iconUrl: App["iconUrl"]): this;
|
|
88
|
-
/**
|
|
89
|
-
* Sets the role of this application.
|
|
90
|
-
*/
|
|
91
|
-
setRole(role: string | null): this;
|
|
92
|
-
/**
|
|
93
|
-
* Sets the associated extensions of this application.
|
|
94
|
-
*/
|
|
95
|
-
setAssociatedExtensions(extensions: string[] | null): this;
|
|
96
|
-
/**
|
|
97
|
-
* Changes whether this application is pinned by default or not.
|
|
98
|
-
*/
|
|
99
|
-
setPinnedByDefault(pinnedByDefault: boolean): this;
|
|
100
|
-
/**
|
|
101
|
-
* Changes whether this application is launched at startup or not.
|
|
102
|
-
*/
|
|
103
|
-
setLaunchAtStartup(launchAtStartup: boolean): this;
|
|
104
|
-
/**
|
|
105
|
-
* Changes whether this application is installed by default or not.
|
|
106
|
-
*/
|
|
107
|
-
setInstalled(installed: boolean): this;
|
|
108
|
-
/**
|
|
109
|
-
* Sets the category this application belongs to.
|
|
110
|
-
*/
|
|
111
|
-
setCategory(category: typeof APP_CATEGORIES[number] | null): this;
|
|
112
|
-
/**
|
|
113
|
-
* Sets the metadata for this application.
|
|
114
|
-
*/
|
|
115
|
-
setMetadata(metadata: AppMetadata | null): this;
|
|
116
|
-
/**
|
|
117
|
-
* Changes whether this application has a desktop icon in the default data.
|
|
118
|
-
*/
|
|
119
|
-
setShowDesktopIcon(showDesktopIcon: boolean): this;
|
|
120
|
-
/**
|
|
121
|
-
* Sets the default options for the {@link App.windowContent} component.
|
|
122
|
-
*/
|
|
123
|
-
setWindowOptions(windowOptions: Partial<AppProps> & DefaultWindowOptions): this;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
declare const APP_CATEGORIES: readonly ["Business", "Developer tools", "Education", "Entertainment", "Food & dining", "Health & fitness", "Kids & family", "Lifestyle", "Media", "Medical", "Multimedia design", "Music", "Navigation & maps", "News & weather", "Personal finance", "Personalization", "Photo & video", "Productivity", "Security", "Shopping", "Social", "Sports", "Travel", "Utilities & tools"];
|
|
127
|
-
|
|
128
|
-
declare interface AppMetadata {
|
|
129
|
-
name: string;
|
|
130
|
-
version: `${number}.${number}.${number}`;
|
|
131
|
-
author: string;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
declare class AppsConfig {
|
|
135
|
-
apps: AppsConfigOptions["apps"];
|
|
136
|
-
static APP_ROLES: {
|
|
137
|
-
fileExplorer: string;
|
|
138
|
-
terminal: string;
|
|
139
|
-
textEditor: string;
|
|
140
|
-
settings: string;
|
|
141
|
-
mediaViewer: string;
|
|
142
|
-
browser: string;
|
|
143
|
-
};
|
|
144
|
-
constructor(options?: Partial<AppsConfigOptions>);
|
|
145
|
-
get installedApps(): App<WindowProps>[];
|
|
146
|
-
/**
|
|
147
|
-
* @param id - The ID of the app.
|
|
148
|
-
* @param includeUninstalled - Include apps that are not currently installed.
|
|
149
|
-
*/
|
|
150
|
-
getAppById(id: string, includeUninstalled?: boolean): App | null;
|
|
151
|
-
/**
|
|
152
|
-
* Get the app associated with a file extension.
|
|
153
|
-
*/
|
|
154
|
-
getAppByFileExtension(fileExtension: string): App | null;
|
|
155
|
-
/**
|
|
156
|
-
* Get the app with a specific role.
|
|
157
|
-
*/
|
|
158
|
-
getAppByRole(role: string): App | null;
|
|
159
|
-
/**
|
|
160
|
-
* Get all applications (including uninstalled apps) that belong to a category.
|
|
161
|
-
*/
|
|
162
|
-
getAppsByCategory(category: typeof APP_CATEGORIES[number]): App[];
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
declare interface AppsConfigOptions {
|
|
166
|
-
/**
|
|
167
|
-
* An array of applications.
|
|
168
|
-
*/
|
|
169
|
-
apps: App<WindowProps>[];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* A function that handles an event asynchronously.
|
|
174
|
-
* @typeParam T - A record of all events.
|
|
175
|
-
* @typeParam K - The event this function handles.
|
|
176
|
-
*/
|
|
177
|
-
declare type AsyncListener<T extends Record<keyof T, unknown[]>, K extends keyof T> = (...args: T[K]) => Promise<void>;
|
|
178
|
-
|
|
179
|
-
declare interface DefaultWindowOptions {
|
|
180
|
-
size?: Vector2;
|
|
181
|
-
[key: string]: unknown;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
declare class DesktopConfig {
|
|
185
|
-
defaultIconSize: DesktopConfigOptions["defaultIconSize"];
|
|
186
|
-
defaultIconDirection: DesktopConfigOptions["defaultIconDirection"];
|
|
187
|
-
constructor(options?: Partial<DesktopConfigOptions>);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
declare interface DesktopConfigOptions {
|
|
191
|
-
/**
|
|
192
|
-
* The default size of the icons.
|
|
193
|
-
* @default 1
|
|
194
|
-
*/
|
|
195
|
-
defaultIconSize: 0 | 1 | 2;
|
|
196
|
-
/**
|
|
197
|
-
* The defailt direction of the icons
|
|
198
|
-
* 0: vertical, 1: horizontal.
|
|
199
|
-
* @default 0
|
|
200
|
-
* */
|
|
201
|
-
defaultIconDirection: 0 | 1;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* A simple event emitter.
|
|
206
|
-
* @typeParam T - A record of all events.
|
|
207
|
-
*/
|
|
208
|
-
declare class EventEmitter<T extends Record<keyof T, unknown[]>> {
|
|
209
|
-
#private;
|
|
210
|
-
/**
|
|
211
|
-
* Starts listening to an event.
|
|
212
|
-
* @param event - The event to listen to.
|
|
213
|
-
* @param listener - The function to call when the event is emitted.
|
|
214
|
-
* @returns The listener.
|
|
215
|
-
*/
|
|
216
|
-
on<K extends keyof T>(event: K, listener: Listener<T, K>): Listener<T, K>;
|
|
217
|
-
/**
|
|
218
|
-
* Registers an event listener that is automatically removed when called.
|
|
219
|
-
* @param event - The event to listen to.
|
|
220
|
-
* @param listener - The function to call once the event is emitted.
|
|
221
|
-
* @returns The wrapped listener.
|
|
222
|
-
*/
|
|
223
|
-
once<K extends keyof T>(event: K, listener: Listener<T, K>): Listener<T, K>;
|
|
224
|
-
/**
|
|
225
|
-
* Starts listening to an event.
|
|
226
|
-
* @param event - The event to listen to.
|
|
227
|
-
* @param listener - The function to call when the event is emitted.
|
|
228
|
-
* @returns The wrapped listener.
|
|
229
|
-
*/
|
|
230
|
-
onAsync<K extends keyof T>(event: K, listener: AsyncListener<T, K>, onRejected?: Parameters<Promise<void>["catch"]>[0]): Listener<T, K>;
|
|
231
|
-
/**
|
|
232
|
-
* Removes an event listener.
|
|
233
|
-
* @param event - The event to remove the listener from.
|
|
234
|
-
* @param listener - The listener to remove.
|
|
235
|
-
*/
|
|
236
|
-
off<K extends keyof T>(event: K, listener: Listener<T, K>): void;
|
|
237
|
-
/**
|
|
238
|
-
* Emits an event to all its listeners.
|
|
239
|
-
* @param event - The event to emit.
|
|
240
|
-
* @param args - The arguments to pass to the listeners.
|
|
241
|
-
*/
|
|
242
|
-
emit<K extends keyof T>(event: K, ...args: T[K]): void;
|
|
243
|
-
}
|
|
3
|
+
import { OnSelectionChangeParams } from '@prozilla-os/core';
|
|
4
|
+
import { WindowProps } from '@prozilla-os/core';
|
|
244
5
|
|
|
245
6
|
export declare const fileExplorer: App<FileExplorerProps>;
|
|
246
7
|
|
|
247
|
-
declare interface FileExplorerProps extends WindowProps {
|
|
8
|
+
export declare interface FileExplorerProps extends WindowProps {
|
|
248
9
|
path?: string;
|
|
249
10
|
selectorMode?: number;
|
|
250
11
|
Footer?: FC;
|
|
@@ -258,789 +19,4 @@ export declare enum FileSelectorMode {
|
|
|
258
19
|
Multi = 2
|
|
259
20
|
}
|
|
260
21
|
|
|
261
|
-
/**
|
|
262
|
-
* A function that handles an event.
|
|
263
|
-
* @typeParam T - A record of all events.
|
|
264
|
-
* @typeParam K - The event this function handles.
|
|
265
|
-
*/
|
|
266
|
-
declare type Listener<T extends Record<keyof T, unknown[]>, K extends keyof T> = (...args: T[K]) => void;
|
|
267
|
-
|
|
268
|
-
declare class MiscConfig {
|
|
269
|
-
doubleClickDelay: MiscConfigOptions["doubleClickDelay"];
|
|
270
|
-
constructor(options?: Partial<MiscConfigOptions>);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
declare interface MiscConfigOptions {
|
|
274
|
-
/**
|
|
275
|
-
* The maximum time between two clicks to register as a double click (in ms).
|
|
276
|
-
* @default 250
|
|
277
|
-
* */
|
|
278
|
-
doubleClickDelay: number;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
declare class ModalsConfig {
|
|
282
|
-
defaultDialogSize: ModalsConfigOptions["defaultDialogSize"];
|
|
283
|
-
defaultFileSelectorSize: ModalsConfigOptions["defaultFileSelectorSize"];
|
|
284
|
-
static DIALOG_CONTENT_TYPES: {
|
|
285
|
-
closeButton: number;
|
|
286
|
-
};
|
|
287
|
-
constructor(options?: Partial<ModalsConfigOptions>);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
declare interface ModalsConfigOptions {
|
|
291
|
-
/**
|
|
292
|
-
* Default size of a dialog box.
|
|
293
|
-
* @default new Vector2(400, 200)
|
|
294
|
-
*/
|
|
295
|
-
defaultDialogSize: Vector2;
|
|
296
|
-
/**
|
|
297
|
-
* Default size of a file selector.
|
|
298
|
-
* @default new Vector2(700, 400)
|
|
299
|
-
*/
|
|
300
|
-
defaultFileSelectorSize: Vector2;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
declare interface OnSelectionChangeParams {
|
|
304
|
-
/** The selected files. */
|
|
305
|
-
files?: string[];
|
|
306
|
-
/** The selected folders. */
|
|
307
|
-
folders?: string[];
|
|
308
|
-
/** The directory the selection was made in. */
|
|
309
|
-
directory?: VirtualFolder;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
declare type OptionalStringProperty = string | null | undefined;
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* A wrapper for {@link localStorage} with additional functionality like compression and a size limit.
|
|
316
|
-
*/
|
|
317
|
-
declare class Storage_2 {
|
|
318
|
-
/**
|
|
319
|
-
* Enables compression of values stored in this storage.
|
|
320
|
-
* @default false
|
|
321
|
-
*/
|
|
322
|
-
enableCompression: boolean;
|
|
323
|
-
/**
|
|
324
|
-
* The prefix to prepend to keys.
|
|
325
|
-
* @default undefined
|
|
326
|
-
*/
|
|
327
|
-
prefix: string | undefined;
|
|
328
|
-
/**
|
|
329
|
-
* The maximum amount of bytes of a value in this storage.
|
|
330
|
-
*/
|
|
331
|
-
static readonly MAX_BYTES = 5000000;
|
|
332
|
-
static readonly COMPRESSED_PREFIX = "\uE000";
|
|
333
|
-
static readonly UNCOMPRESSED_PREFIX = "\uE001";
|
|
334
|
-
/**
|
|
335
|
-
* Stores a key and value pair in this storage.
|
|
336
|
-
* @param key - The key to store.
|
|
337
|
-
* @param value - The value to store.
|
|
338
|
-
*/
|
|
339
|
-
store(key: string, value: string): void;
|
|
340
|
-
/**
|
|
341
|
-
* Loads a value associated with the given key.
|
|
342
|
-
* @param key - The key of the item.
|
|
343
|
-
* @returns The value of the item.
|
|
344
|
-
*/
|
|
345
|
-
load(key: string): string | null;
|
|
346
|
-
/**
|
|
347
|
-
* Replaces the key of an item if it exists.
|
|
348
|
-
* @param oldKey - The key to replace.
|
|
349
|
-
* @param newKey - The new key.
|
|
350
|
-
*/
|
|
351
|
-
rename(oldKey: string, newKey: string): this;
|
|
352
|
-
/**
|
|
353
|
-
* Removes the item with the given key from this storage.
|
|
354
|
-
* @param key - The key of the item.
|
|
355
|
-
*/
|
|
356
|
-
remove(key: string): this;
|
|
357
|
-
/**
|
|
358
|
-
* Clears all items stored in this storage.
|
|
359
|
-
*/
|
|
360
|
-
clear(): this;
|
|
361
|
-
/**
|
|
362
|
-
* Returns the byte size of a key and value pair.
|
|
363
|
-
* @param key - The key of the item.
|
|
364
|
-
* @param value - The value of the item.
|
|
365
|
-
*/
|
|
366
|
-
getItemByteSize(key: string, value: string): number;
|
|
367
|
-
getEncodedByteSize(string: string | null): number;
|
|
368
|
-
encode(string: string): {
|
|
369
|
-
result: string;
|
|
370
|
-
size: number;
|
|
371
|
-
};
|
|
372
|
-
decode(string: string): string;
|
|
373
|
-
setPrefix(prefix?: string): this;
|
|
374
|
-
static getByteSize(string: string | null): number;
|
|
375
|
-
static byteToKilobyte(bytes: number): number;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
declare class SystemManager {
|
|
379
|
-
#private;
|
|
380
|
-
/** The name of the system. */
|
|
381
|
-
readonly systemName: string;
|
|
382
|
-
/** The tagline/short description of the system. */
|
|
383
|
-
readonly tagLine: string;
|
|
384
|
-
readonly skin: Skin;
|
|
385
|
-
readonly appsConfig: AppsConfig;
|
|
386
|
-
readonly desktopConfig: DesktopConfig;
|
|
387
|
-
readonly miscConfig: MiscConfig;
|
|
388
|
-
readonly modalsConfig: ModalsConfig;
|
|
389
|
-
readonly taskbarConfig: TaskbarConfig;
|
|
390
|
-
readonly trackingConfig: TrackingConfig;
|
|
391
|
-
readonly windowsConfig: WindowsConfig;
|
|
392
|
-
readonly virtualDriveConfig: VirtualDriveConfig;
|
|
393
|
-
readonly storage: Storage_2;
|
|
394
|
-
constructor({ systemName, tagLine, skin, desktopConfig, appsConfig, miscConfig, modalsConfig, taskbarConfig, trackingConfig, windowsConfig, virtualDriveConfig, }: SystemManagerParams);
|
|
395
|
-
private loadSkin;
|
|
396
|
-
getUptime(precision?: number): string;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
declare interface SystemManagerParams {
|
|
400
|
-
systemName: SystemManager["systemName"] | null;
|
|
401
|
-
tagLine: SystemManager["tagLine"] | null;
|
|
402
|
-
skin?: SystemManager["skin"];
|
|
403
|
-
desktopConfig: DesktopConfig;
|
|
404
|
-
appsConfig: AppsConfig;
|
|
405
|
-
miscConfig: MiscConfig;
|
|
406
|
-
modalsConfig: ModalsConfig;
|
|
407
|
-
taskbarConfig: TaskbarConfig;
|
|
408
|
-
trackingConfig: TrackingConfig;
|
|
409
|
-
windowsConfig: WindowsConfig;
|
|
410
|
-
virtualDriveConfig: VirtualDriveConfig;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
declare class TaskbarConfig {
|
|
414
|
-
height: TaskbarConfigOptions["height"];
|
|
415
|
-
constructor(options?: Partial<TaskbarConfigOptions>);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
declare interface TaskbarConfigOptions {
|
|
419
|
-
/**
|
|
420
|
-
* Height of the taskbar in CSS pixels.
|
|
421
|
-
* @default 3 * 16
|
|
422
|
-
*/
|
|
423
|
-
height: number;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
declare class TrackingConfig {
|
|
427
|
-
enabled: TrackingConfigOptions["enabled"];
|
|
428
|
-
googleAnalyticsMeasurementId: TrackingConfigOptions["GAMeasurementId"];
|
|
429
|
-
constructor(options?: Partial<TrackingConfigOptions>);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
declare interface TrackingConfigOptions {
|
|
433
|
-
/**
|
|
434
|
-
* Enable tracking.
|
|
435
|
-
* @default true
|
|
436
|
-
*/
|
|
437
|
-
enabled: boolean;
|
|
438
|
-
/** Google Analytics measurement ID. */
|
|
439
|
-
GAMeasurementId: string;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
declare class TrackingManager {
|
|
443
|
-
#private;
|
|
444
|
-
measurementId?: string | null;
|
|
445
|
-
constructor(systemManager: SystemManager);
|
|
446
|
-
init(): this;
|
|
447
|
-
event(options: UaEventOptions | string): void;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
declare class Vector2 {
|
|
451
|
-
x: number;
|
|
452
|
-
y: number;
|
|
453
|
-
constructor(xy: number);
|
|
454
|
-
constructor(x: number, y?: number);
|
|
455
|
-
static get ZERO(): Vector2;
|
|
456
|
-
get clone(): Vector2;
|
|
457
|
-
get magnitude(): number;
|
|
458
|
-
setX(x: number): this;
|
|
459
|
-
setY(y: number): this;
|
|
460
|
-
set(x: number, y: number): this;
|
|
461
|
-
round(): this;
|
|
462
|
-
normalize(): this;
|
|
463
|
-
scale(scalar: number): this;
|
|
464
|
-
getDistanceSquared(x: number, y?: number): number;
|
|
465
|
-
getDistanceSquared(vector2: Vector2): number;
|
|
466
|
-
getDistance(x: number, y?: number): number;
|
|
467
|
-
getDistance(vector2: Vector2): number;
|
|
468
|
-
add(x: number, y?: number): this;
|
|
469
|
-
add(vector2: Vector2): this;
|
|
470
|
-
subtract(x: number, y?: number): this;
|
|
471
|
-
subtract(vector2: Vector2): this;
|
|
472
|
-
multiply(x: number, y?: number): this;
|
|
473
|
-
multiply(vector2: Vector2): this;
|
|
474
|
-
divide(x: number, y?: number): this;
|
|
475
|
-
divide(vector2: Vector2): this;
|
|
476
|
-
lerp(vector2: Vector2, t: number): this;
|
|
477
|
-
static sum(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
478
|
-
static difference(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
479
|
-
static product(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
480
|
-
static division(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
481
|
-
static scale(vector2: Vector2, scalar: number): Vector2;
|
|
482
|
-
static normalize(vector2: Vector2): Vector2;
|
|
483
|
-
static lerp(vector2A: Vector2, vector2B: Vector2, t: number): Vector2;
|
|
484
|
-
static from({ x, y }: {
|
|
485
|
-
x: number;
|
|
486
|
-
y: number;
|
|
487
|
-
}): Vector2;
|
|
488
|
-
static parseVector(x: number | Vector2, y?: number): {
|
|
489
|
-
x: number;
|
|
490
|
-
y: number;
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
declare class VirtualBase<E extends VirtualBaseEvents = VirtualBaseEvents> extends EventEmitter<E & Record<keyof E, unknown[]>> {
|
|
495
|
-
/** The name of this item. */
|
|
496
|
-
name: string;
|
|
497
|
-
/** The alias of this item. */
|
|
498
|
-
alias: string | undefined | null;
|
|
499
|
-
/** The folder this item is in. */
|
|
500
|
-
parent: VirtualFolder | undefined | null;
|
|
501
|
-
/** Whether this item is protected from changes. */
|
|
502
|
-
isProtected: boolean | undefined | null;
|
|
503
|
-
/** The URL of the icon of this item. */
|
|
504
|
-
iconUrl: string | undefined | null;
|
|
505
|
-
/** The file this item links to. */
|
|
506
|
-
linkedFile: VirtualFile | undefined | null;
|
|
507
|
-
/** The folder this item links to. */
|
|
508
|
-
linkedFolder: VirtualFolder | undefined | null;
|
|
509
|
-
/** Whether this item has been edited by the user. */
|
|
510
|
-
editedByUser: boolean | undefined | null;
|
|
511
|
-
/** Whether this item is the root folder. */
|
|
512
|
-
isRoot: boolean | undefined | null;
|
|
513
|
-
/** The root folder. */
|
|
514
|
-
root: VirtualRoot | undefined | null;
|
|
515
|
-
/** Whether this item has been deleted. */
|
|
516
|
-
isDeleted: boolean;
|
|
517
|
-
static readonly UPDATE_EVENT = "update";
|
|
518
|
-
constructor(name: string);
|
|
519
|
-
get id(): string;
|
|
520
|
-
setName(name: string): this;
|
|
521
|
-
setAlias(alias: string): this;
|
|
522
|
-
setParent(parent: VirtualFolder): this;
|
|
523
|
-
setProtected(value: boolean): this;
|
|
524
|
-
setIconUrl(iconUrl: string | null): this;
|
|
525
|
-
getIconUrl(): string;
|
|
526
|
-
getType(): string;
|
|
527
|
-
/**
|
|
528
|
-
* Tries to delete this item.
|
|
529
|
-
*/
|
|
530
|
-
delete(): void;
|
|
531
|
-
confirmChanges(root?: VirtualRoot): void;
|
|
532
|
-
/**
|
|
533
|
-
* Opens this item in the appropriate application.
|
|
534
|
-
*/
|
|
535
|
-
open(..._args: unknown[]): unknown;
|
|
536
|
-
/**
|
|
537
|
-
* Returns the path of this item.
|
|
538
|
-
*/
|
|
539
|
-
get path(): string;
|
|
540
|
-
/**
|
|
541
|
-
* Returns path without using this item's alias.
|
|
542
|
-
*/
|
|
543
|
-
get displayPath(): string;
|
|
544
|
-
/**
|
|
545
|
-
* Returns path without using any aliases.
|
|
546
|
-
*/
|
|
547
|
-
get absolutePath(): string;
|
|
548
|
-
/**
|
|
549
|
-
* Returns whether this can be edited in its current state.
|
|
550
|
-
*/
|
|
551
|
-
get canBeEdited(): boolean;
|
|
552
|
-
/**
|
|
553
|
-
* Returns the root folder.
|
|
554
|
-
*/
|
|
555
|
-
getRoot(): VirtualRoot;
|
|
556
|
-
isFile(): this is VirtualFile;
|
|
557
|
-
isFolder(): this is VirtualFolder;
|
|
558
|
-
toJSON(): VirtualBaseJson | null;
|
|
559
|
-
toString(): string | null;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
declare interface VirtualBaseEvents {
|
|
563
|
-
update: [];
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
declare interface VirtualBaseJson {
|
|
567
|
-
nam: string;
|
|
568
|
-
ico?: string;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
declare class VirtualDriveConfig {
|
|
572
|
-
saveData: VirtualDriveConfigOptions["saveData"];
|
|
573
|
-
defaultData: VirtualDriveConfigOptions["defaultData"];
|
|
574
|
-
constructor(options?: Partial<VirtualDriveConfigOptions>);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
declare interface VirtualDriveConfigOptions {
|
|
578
|
-
/**
|
|
579
|
-
* Enables persistent storage of the virtual drive.
|
|
580
|
-
* @default {
|
|
581
|
-
enableCompression: true,
|
|
582
|
-
prefix: "pos-"
|
|
583
|
-
}
|
|
584
|
-
*/
|
|
585
|
-
saveData: false | {
|
|
586
|
-
/**
|
|
587
|
-
* Enables compression of stored items.
|
|
588
|
-
* @default false
|
|
589
|
-
*/
|
|
590
|
-
enableCompression: boolean;
|
|
591
|
-
/**
|
|
592
|
-
* The prefix to prepend to stored keys.
|
|
593
|
-
* @default "pos-"
|
|
594
|
-
*/
|
|
595
|
-
prefix?: string;
|
|
596
|
-
/**
|
|
597
|
-
* An array of tuples of old and new keys to migrate.
|
|
598
|
-
* @default [["data", VirtualDriveStorage.KEY]]
|
|
599
|
-
*/
|
|
600
|
-
migrations?: [string, string][];
|
|
601
|
-
};
|
|
602
|
-
/**
|
|
603
|
-
* Configure the data that is loaded initially when ProzillaOS is opened.
|
|
604
|
-
*/
|
|
605
|
-
defaultData: {
|
|
606
|
-
/**
|
|
607
|
-
* Include pictures folder in default data.
|
|
608
|
-
* @default true
|
|
609
|
-
*/
|
|
610
|
-
includePicturesFolder?: boolean;
|
|
611
|
-
/**
|
|
612
|
-
* Include documents folder in default data.
|
|
613
|
-
* @default true
|
|
614
|
-
*/
|
|
615
|
-
includeDocumentsFolder?: boolean;
|
|
616
|
-
/**
|
|
617
|
-
* Include desktop folder in default data.
|
|
618
|
-
* @default true
|
|
619
|
-
*/
|
|
620
|
-
includeDesktopFolder?: boolean;
|
|
621
|
-
/**
|
|
622
|
-
* Include source tree folder in default data.
|
|
623
|
-
* @default true
|
|
624
|
-
*/
|
|
625
|
-
includeSourceTree?: boolean;
|
|
626
|
-
/**
|
|
627
|
-
* Include apps folder in default data.
|
|
628
|
-
* @default true
|
|
629
|
-
*/
|
|
630
|
-
includeAppsFolder?: boolean;
|
|
631
|
-
loadData?: (virtualRoot: VirtualRoot) => void;
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
declare class VirtualDriveStorage extends Storage_2 {
|
|
636
|
-
virtualDriveConfig: VirtualDriveConfig;
|
|
637
|
-
static readonly KEY = "drive";
|
|
638
|
-
constructor(virtualDriveConfig: VirtualDriveConfig);
|
|
639
|
-
load(key: string): string | null;
|
|
640
|
-
store(key: string, value: string): void;
|
|
641
|
-
synchronize(): void;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* A virtual file that can be stored inside a folder.
|
|
646
|
-
*/
|
|
647
|
-
declare class VirtualFile extends VirtualBase<VirtualFileEvents> {
|
|
648
|
-
/** The extension of this file. */
|
|
649
|
-
extension: OptionalStringProperty;
|
|
650
|
-
/** The URL of the source of this file. */
|
|
651
|
-
source: OptionalStringProperty;
|
|
652
|
-
/** The content of this file. */
|
|
653
|
-
content: OptionalStringProperty;
|
|
654
|
-
static NON_TEXT_EXTENSIONS: string[];
|
|
655
|
-
static readonly CONTENT_CHANGE_EVENT = "contentChange";
|
|
656
|
-
constructor(name: string, extension?: string);
|
|
657
|
-
setAlias(alias: string): this;
|
|
658
|
-
/**
|
|
659
|
-
* Sets the source of this file and removes the content.
|
|
660
|
-
*/
|
|
661
|
-
setSource(source: string): this;
|
|
662
|
-
/**
|
|
663
|
-
* Sets the content of this file and removes the source.
|
|
664
|
-
*/
|
|
665
|
-
setContent(content: string | string[]): this;
|
|
666
|
-
get id(): string;
|
|
667
|
-
static splitId(id: string): {
|
|
668
|
-
name: string;
|
|
669
|
-
extension: OptionalStringProperty;
|
|
670
|
-
};
|
|
671
|
-
/**
|
|
672
|
-
* Opens this file in an app associated with its extension.
|
|
673
|
-
*/
|
|
674
|
-
open(windowsManager: WindowsManager): object | null;
|
|
675
|
-
read(): Promise<OptionalStringProperty | undefined>;
|
|
676
|
-
isFile(): this is VirtualFile;
|
|
677
|
-
getIconUrl(): string;
|
|
678
|
-
getType(): string;
|
|
679
|
-
download(): void;
|
|
680
|
-
isDownloadable(): boolean;
|
|
681
|
-
toJSON(): VirtualFileJson | null;
|
|
682
|
-
static removeFileScheme(source: string): string;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
declare interface VirtualFileEvents extends VirtualBaseEvents {
|
|
686
|
-
contentChange: [VirtualFile];
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
declare interface VirtualFileJson extends VirtualBaseJson {
|
|
690
|
-
ext?: string;
|
|
691
|
-
cnt?: string;
|
|
692
|
-
src?: string;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* A link that points to a virtual file.
|
|
697
|
-
*/
|
|
698
|
-
declare class VirtualFileLink extends VirtualFile {
|
|
699
|
-
linkedPath?: string;
|
|
700
|
-
constructor(name: string, linkedFile?: VirtualFile);
|
|
701
|
-
setLinkedFile(file: VirtualFile | null): VirtualFileLink;
|
|
702
|
-
setLinkedPath(path: string): VirtualFileLink;
|
|
703
|
-
isValid(): boolean;
|
|
704
|
-
toJSON(): VirtualFileLinkJson | null;
|
|
705
|
-
setAlias(...args: Parameters<VirtualFile["setAlias"]>): this;
|
|
706
|
-
setSource(...args: Parameters<VirtualFile["setSource"]>): this;
|
|
707
|
-
setContent(...args: Parameters<VirtualFile["setContent"]>): this;
|
|
708
|
-
get id(): string;
|
|
709
|
-
open(...args: Parameters<VirtualFile["open"]>): ReturnType<VirtualFile["open"]>;
|
|
710
|
-
read(...args: Parameters<VirtualFile["read"]>): Promise<string | null | undefined>;
|
|
711
|
-
getIconUrl(...args: Parameters<VirtualFile["getIconUrl"]>): ReturnType<VirtualFile["getIconUrl"]>;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
declare interface VirtualFileLinkJson extends VirtualFileJson {
|
|
715
|
-
lnk: string;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* A virtual folder that can contains files and sub-folders.
|
|
720
|
-
*/
|
|
721
|
-
declare class VirtualFolder<E extends VirtualBaseEvents = VirtualBaseEvents> extends VirtualBase<E> {
|
|
722
|
-
/** The folders inside this folder. */
|
|
723
|
-
subFolders: (VirtualFolder | VirtualFolderLink)[];
|
|
724
|
-
/** The files inside this folder. */
|
|
725
|
-
files: (VirtualFile | VirtualFileLink)[];
|
|
726
|
-
/**
|
|
727
|
-
* The type of this folder.
|
|
728
|
-
* @default VirtualFolder.TYPE.general
|
|
729
|
-
*/
|
|
730
|
-
type: number | undefined;
|
|
731
|
-
static TYPE: {
|
|
732
|
-
general: number;
|
|
733
|
-
media: number;
|
|
734
|
-
};
|
|
735
|
-
constructor(name: string, type?: number);
|
|
736
|
-
setAlias(alias: string): this;
|
|
737
|
-
/**
|
|
738
|
-
* Returns true if this folder contains a file matching a name and extension.
|
|
739
|
-
*/
|
|
740
|
-
hasFile(name: string, extension?: string): boolean;
|
|
741
|
-
/**
|
|
742
|
-
* Returns true if this folder contains a folder matching a name.
|
|
743
|
-
*/
|
|
744
|
-
hasFolder(name: string): boolean;
|
|
745
|
-
/**
|
|
746
|
-
* Finds and returns a file inside this folder matching a name and extension.
|
|
747
|
-
*/
|
|
748
|
-
findFile(name: string, extension?: string | null): VirtualFile | VirtualFileLink | null;
|
|
749
|
-
/**
|
|
750
|
-
* Finds and returns a folder inside this folder matching a name.
|
|
751
|
-
*/
|
|
752
|
-
findSubFolder(name: string): VirtualFolder | VirtualFolderLink | null;
|
|
753
|
-
addFile(file: VirtualFile, confirmChanges?: boolean): this;
|
|
754
|
-
/**
|
|
755
|
-
* Creates a file with a name and extension.
|
|
756
|
-
*/
|
|
757
|
-
createFile(name: string, extension?: string, callback?: (newFile: VirtualFile | VirtualFileLink) => void): this;
|
|
758
|
-
/**
|
|
759
|
-
* Creates files based on an array of objects with file names and extensions.
|
|
760
|
-
*/
|
|
761
|
-
createFiles(files: {
|
|
762
|
-
name: string;
|
|
763
|
-
extension: string;
|
|
764
|
-
}[]): this;
|
|
765
|
-
/**
|
|
766
|
-
* Creates a file link with a name.
|
|
767
|
-
*/
|
|
768
|
-
createFileLink(name: string, callback?: (newFileLink: VirtualFileLink | VirtualFile) => void): this;
|
|
769
|
-
/**
|
|
770
|
-
* Creates file links based on an array of objects with file names and extensions.
|
|
771
|
-
*/
|
|
772
|
-
createFileLinks(fileLinks: {
|
|
773
|
-
name: string;
|
|
774
|
-
}[]): this;
|
|
775
|
-
addFolder(folder: VirtualFolder, confirmChanges?: boolean): this;
|
|
776
|
-
/**
|
|
777
|
-
* Creates a folder with a name.
|
|
778
|
-
*/
|
|
779
|
-
createFolder(name: string, callback?: (newFolder: VirtualFolder) => void): this;
|
|
780
|
-
/**
|
|
781
|
-
* Creates folders based on an array of folder names.
|
|
782
|
-
*/
|
|
783
|
-
createFolders(names: string[]): this;
|
|
784
|
-
/**
|
|
785
|
-
* Creates a folder link with a name.
|
|
786
|
-
*/
|
|
787
|
-
createFolderLink(name: string, callback?: (newFolderLink: VirtualFolderLink | VirtualFolder) => void): this;
|
|
788
|
-
/**
|
|
789
|
-
* Creates folder links based on an array of folder names.
|
|
790
|
-
*/
|
|
791
|
-
createFolderLinks(names: string[]): this;
|
|
792
|
-
/**
|
|
793
|
-
* Removes a file or folder from this folder.
|
|
794
|
-
*/
|
|
795
|
-
remove(child: VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink): this;
|
|
796
|
-
/**
|
|
797
|
-
* Returns the file or folder at a relative path or null if it doesn't exist.
|
|
798
|
-
*/
|
|
799
|
-
navigate(relativePath: string): VirtualFile | VirtualFolder | null;
|
|
800
|
-
navigateToFolder(relativePath: string): VirtualFolder | null;
|
|
801
|
-
navigateToFile(relativePath: string): VirtualFile | null;
|
|
802
|
-
/**
|
|
803
|
-
* Opens this folder in file explorer.
|
|
804
|
-
*/
|
|
805
|
-
open(windowsManager: WindowsManager): object | null | undefined;
|
|
806
|
-
/**
|
|
807
|
-
* Deletes this folder and all its files and sub-folders recursively.
|
|
808
|
-
*/
|
|
809
|
-
delete(): void;
|
|
810
|
-
/**
|
|
811
|
-
* Returns all files inside this folder.
|
|
812
|
-
* @param showHidden - Whether to include hidden files.
|
|
813
|
-
*/
|
|
814
|
-
getFiles(showHidden?: boolean): VirtualFile[];
|
|
815
|
-
/**
|
|
816
|
-
* Returns all sub-folders inside this folder.
|
|
817
|
-
* @param showHidden - Whether to include hidden folders.
|
|
818
|
-
*/
|
|
819
|
-
getSubFolders(showHidden?: boolean): VirtualFolder[];
|
|
820
|
-
/**
|
|
821
|
-
* Returns the amount of files and sub-folders inside this folder.
|
|
822
|
-
* @param includeHidden - Whether to include hidden files and folders in the count.
|
|
823
|
-
*/
|
|
824
|
-
getItemCount(includeHidden?: boolean): number;
|
|
825
|
-
isFolder(): this is VirtualFolder;
|
|
826
|
-
getIconUrl(): string;
|
|
827
|
-
toJSON(): VirtualFolderJson | null;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
declare interface VirtualFolderJson extends VirtualBaseJson {
|
|
831
|
-
fls?: VirtualFileJson[];
|
|
832
|
-
fds?: VirtualFolderJson[];
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* A link that points to a virtual folder.
|
|
837
|
-
*/
|
|
838
|
-
declare class VirtualFolderLink extends VirtualFolder {
|
|
839
|
-
linkedPath?: string;
|
|
840
|
-
constructor(name: string, linkedFolder?: VirtualFolder);
|
|
841
|
-
setLinkedFolder(folder: VirtualFolder | null): VirtualFolderLink;
|
|
842
|
-
setLinkedPath(path: string): VirtualFolderLink;
|
|
843
|
-
isValid(): boolean;
|
|
844
|
-
getIconUrl(): string;
|
|
845
|
-
toJSON(): VirtualFolderLinkJson | null;
|
|
846
|
-
setAlias(...args: Parameters<VirtualFolder["setAlias"]>): this;
|
|
847
|
-
createFile(...args: Parameters<VirtualFolder["createFile"]>): this;
|
|
848
|
-
createFiles(...args: Parameters<VirtualFolder["createFiles"]>): this;
|
|
849
|
-
createFolder(...args: Parameters<VirtualFolder["createFolder"]>): this;
|
|
850
|
-
createFolders(...args: Parameters<VirtualFolder["createFolders"]>): this;
|
|
851
|
-
hasFile(...args: Parameters<VirtualFolder["hasFile"]>): ReturnType<VirtualFolder["hasFile"]>;
|
|
852
|
-
hasFolder(...args: Parameters<VirtualFolder["hasFolder"]>): ReturnType<VirtualFolder["hasFolder"]>;
|
|
853
|
-
findFile(...args: Parameters<VirtualFolder["findFile"]>): ReturnType<VirtualFolder["findFile"]>;
|
|
854
|
-
findSubFolder(...args: Parameters<VirtualFolder["findSubFolder"]>): ReturnType<VirtualFolder["findSubFolder"]>;
|
|
855
|
-
getFiles(...args: Parameters<VirtualFolder["getFiles"]>): ReturnType<VirtualFolder["getFiles"]>;
|
|
856
|
-
getSubFolders(...args: Parameters<VirtualFolder["getSubFolders"]>): ReturnType<VirtualFolder["getSubFolders"]>;
|
|
857
|
-
open(...args: Parameters<VirtualFolder["open"]>): ReturnType<VirtualFolder["open"]>;
|
|
858
|
-
getItemCount(...args: Parameters<VirtualFolder["getItemCount"]>): ReturnType<VirtualFolder["getItemCount"]>;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
declare interface VirtualFolderLinkJson extends VirtualFolderJson {
|
|
862
|
-
lnk: string;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
/**
|
|
866
|
-
* A virtual folder that serves as the root folder.
|
|
867
|
-
*/
|
|
868
|
-
declare class VirtualRoot extends VirtualFolder<VirtualRootEvents> {
|
|
869
|
-
/** Aliases for files and folders. */
|
|
870
|
-
shortcuts: Record<string, VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink>;
|
|
871
|
-
initiated: boolean;
|
|
872
|
-
loadedDefaultData: boolean;
|
|
873
|
-
systemManager: SystemManager;
|
|
874
|
-
storage: VirtualDriveStorage;
|
|
875
|
-
static readonly ERROR_EVENT = "error";
|
|
876
|
-
constructor(systemManager: SystemManager);
|
|
877
|
-
loadDefaultData(): void;
|
|
878
|
-
loadData(): void;
|
|
879
|
-
/**
|
|
880
|
-
* Calls the storage manager's store function with this root's data as a string.
|
|
881
|
-
*/
|
|
882
|
-
saveData(): void;
|
|
883
|
-
/**
|
|
884
|
-
* Initializes this root by loading the default data and then the user's data on top.
|
|
885
|
-
*/
|
|
886
|
-
init(): VirtualRoot;
|
|
887
|
-
/**
|
|
888
|
-
* Adds a shortcut to a file or folder.
|
|
889
|
-
*/
|
|
890
|
-
addShortcut(name: string, destination: VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink): this;
|
|
891
|
-
/**
|
|
892
|
-
* Tells the storage manager to clear all data and reloads the window.
|
|
893
|
-
*/
|
|
894
|
-
reset(): void;
|
|
895
|
-
static isValidName(_name: string): boolean;
|
|
896
|
-
static isValidFileName(_name: string): boolean;
|
|
897
|
-
static isValidFolderName(_name: string): boolean;
|
|
898
|
-
get path(): string;
|
|
899
|
-
get displayPath(): string;
|
|
900
|
-
toJSON(): VirtualRootJson | null;
|
|
901
|
-
toString(): string | null;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
declare interface VirtualRootEvents extends VirtualBaseEvents {
|
|
905
|
-
error: [{
|
|
906
|
-
message: string;
|
|
907
|
-
}];
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
declare interface VirtualRootJson extends VirtualFolderJson {
|
|
911
|
-
scs: Record<string, string>;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
declare interface WindowOptions {
|
|
915
|
-
/** The ID of the window. */
|
|
916
|
-
id?: string;
|
|
917
|
-
/** The app associated with the window. */
|
|
918
|
-
app?: App;
|
|
919
|
-
/**
|
|
920
|
-
* The size of the window.
|
|
921
|
-
* @default new Vector2(700, 400)
|
|
922
|
-
*/
|
|
923
|
-
size?: Vector2;
|
|
924
|
-
/** The position of the window. */
|
|
925
|
-
position?: Vector2;
|
|
926
|
-
fullscreen?: boolean | string;
|
|
927
|
-
options?: object;
|
|
928
|
-
isFocused?: boolean;
|
|
929
|
-
lastInteraction?: number;
|
|
930
|
-
minimized?: boolean;
|
|
931
|
-
[key: string]: unknown;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
declare interface WindowProps extends WindowOptions {
|
|
935
|
-
/**
|
|
936
|
-
* Whether to start the window in fullscreen mode.
|
|
937
|
-
* @default false
|
|
938
|
-
*/
|
|
939
|
-
fullscreen?: boolean;
|
|
940
|
-
/** Function that sets the title of the window. */
|
|
941
|
-
setTitle?: React.Dispatch<React.SetStateAction<string>>;
|
|
942
|
-
/** Function that sets the icon URL of the window. */
|
|
943
|
-
setIconUrl?: React.Dispatch<React.SetStateAction<string>>;
|
|
944
|
-
/** Function that closes the window. */
|
|
945
|
-
close?: (event?: Event | React.UIEvent<HTMLElement>) => void;
|
|
946
|
-
/** Function that brings the window in focus. */
|
|
947
|
-
focus?: (event?: Event | React.UIEvent<HTMLElement>, force?: boolean) => void;
|
|
948
|
-
/** Whether the window is currently focused and should allow interactions. */
|
|
949
|
-
active?: boolean;
|
|
950
|
-
/** Whether to start the window in minimized mode. */
|
|
951
|
-
minimized?: boolean;
|
|
952
|
-
/** Function that toggles the minimized mode of the window. */
|
|
953
|
-
toggleMinimized?: (event?: Event) => void;
|
|
954
|
-
/** The depth value of the window. */
|
|
955
|
-
index?: number;
|
|
956
|
-
/** Whether the window is in standalone mode. */
|
|
957
|
-
standalone?: boolean;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
declare class WindowsConfig {
|
|
961
|
-
screenMargin: WindowsConfigOptions["screenMargin"];
|
|
962
|
-
titleSeparator: WindowsConfigOptions["titleSeparator"];
|
|
963
|
-
minScreenSize: WindowsConfigOptions["minScreenSize"];
|
|
964
|
-
constructor(options?: Partial<WindowsConfigOptions>);
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
declare interface WindowsConfigOptions {
|
|
968
|
-
/**
|
|
969
|
-
* The margin around windows that are not maximized, in pixels.
|
|
970
|
-
* @default 32
|
|
971
|
-
*/
|
|
972
|
-
screenMargin: number;
|
|
973
|
-
/**
|
|
974
|
-
* The separator to use in window titles.
|
|
975
|
-
* @default "-"
|
|
976
|
-
*/
|
|
977
|
-
titleSeparator: string;
|
|
978
|
-
/**
|
|
979
|
-
* If the user's screen is smaller than these values, windows will always be maximized.
|
|
980
|
-
* @default new Vector2(350, 350)
|
|
981
|
-
*/
|
|
982
|
-
minScreenSize: Vector2;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
/**
|
|
986
|
-
* Manages the states of windows.
|
|
987
|
-
*/
|
|
988
|
-
declare class WindowsManager {
|
|
989
|
-
#private;
|
|
990
|
-
windows: {
|
|
991
|
-
[id: string]: WindowOptions;
|
|
992
|
-
};
|
|
993
|
-
/** Function that handles changes to the open windows. */
|
|
994
|
-
updateWindows: (window: WindowsManager["windows"]) => void;
|
|
995
|
-
startupComplete: boolean;
|
|
996
|
-
constructor(systemManager: SystemManager, trackingManager: TrackingManager);
|
|
997
|
-
/**
|
|
998
|
-
* Opens a window for an application.
|
|
999
|
-
* @param appId - The ID of the app.
|
|
1000
|
-
*/
|
|
1001
|
-
open(appId: string, options?: WindowOptions | null): object | null;
|
|
1002
|
-
/**
|
|
1003
|
-
* Opens a file with the associated app or by a method specified by the file scheme.
|
|
1004
|
-
* @returns Opened window.
|
|
1005
|
-
*/
|
|
1006
|
-
openFile(file: VirtualFile, options?: object): object | null;
|
|
1007
|
-
/**
|
|
1008
|
-
* Close a window.
|
|
1009
|
-
*/
|
|
1010
|
-
close(windowId: string): void;
|
|
1011
|
-
/**
|
|
1012
|
-
* Focus on a specific window.
|
|
1013
|
-
*/
|
|
1014
|
-
focus(windowId: string): void;
|
|
1015
|
-
/**
|
|
1016
|
-
* Check whether a window is focused.
|
|
1017
|
-
*/
|
|
1018
|
-
isFocused(windowId: string): boolean | undefined;
|
|
1019
|
-
/**
|
|
1020
|
-
* Check if any window is focused.
|
|
1021
|
-
*/
|
|
1022
|
-
isAnyFocused(): boolean;
|
|
1023
|
-
/**
|
|
1024
|
-
* Change the minimized state of a window.
|
|
1025
|
-
* @param windowId - The ID of the window.
|
|
1026
|
-
* @param minimized - Leave as undefined to toggle the window's minimization state.
|
|
1027
|
-
*/
|
|
1028
|
-
setMinimized(windowId: string, minimized?: boolean): void;
|
|
1029
|
-
/**
|
|
1030
|
-
* Minimize all windows.
|
|
1031
|
-
*/
|
|
1032
|
-
minimizeAll(): void;
|
|
1033
|
-
/**
|
|
1034
|
-
* Check if an app has an open window.
|
|
1035
|
-
*/
|
|
1036
|
-
isAppActive(appId: string): boolean;
|
|
1037
|
-
/**
|
|
1038
|
-
* Get an opened window of a certain app.
|
|
1039
|
-
*/
|
|
1040
|
-
getAppWindowId(appId: string): string | null;
|
|
1041
|
-
setUpdateWindows(updateWindows: WindowsManager["updateWindows"]): void;
|
|
1042
|
-
startup(appIds: string[], options: Record<string, unknown>): void;
|
|
1043
|
-
get windowIds(): string[];
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
22
|
export { }
|
package/dist/main.js
CHANGED
|
@@ -5,9 +5,9 @@ import { useState as P, useCallback as me, useEffect as $ } from "react";
|
|
|
5
5
|
import { FontAwesomeIcon as p } from "@fortawesome/react-fontawesome";
|
|
6
6
|
import { faDownload as he, faUpload as _e, faTrash as H, faCircleInfo as ge, faCaretLeft as Ne, faCaretRight as xe, faArrowUp as Ie, faPlus as be, faSearch as fe, faCog as ve, faHouse as Ee, faDesktop as ye, faImage as Se, faFileLines as Ce } from "@fortawesome/free-solid-svg-icons";
|
|
7
7
|
import { Vector2 as f } from "@prozilla-os/shared";
|
|
8
|
-
const
|
|
9
|
-
FileExplorer:
|
|
10
|
-
Header:
|
|
8
|
+
const we = "_FileExplorer_lr5mr_1", Be = "_Header_lr5mr_13", Pe = "_IconButton_lr5mr_23", Ae = "_PathInput_lr5mr_69", Fe = "_Body_lr5mr_80", Te = "_Sidebar_lr5mr_88", De = "_NavButton_lr5mr_102", Le = "_Main_lr5mr_125", ke = "_Footer_lr5mr_139", Oe = "_Selector_lr5mr_158", a = {
|
|
9
|
+
FileExplorer: we,
|
|
10
|
+
Header: Be,
|
|
11
11
|
IconButton: Pe,
|
|
12
12
|
PathInput: Ae,
|
|
13
13
|
Body: Fe,
|
|
@@ -129,7 +129,7 @@ function Ge({ app: l, path: m, selectorMode: r, Footer: h, onSelectionChange: _,
|
|
|
129
129
|
title: `${t.id} ${E.titleSeparator} Properties`,
|
|
130
130
|
iconUrl: t.getIconUrl(),
|
|
131
131
|
size: new f(400, 500),
|
|
132
|
-
Modal: (
|
|
132
|
+
Modal: (B) => /* @__PURE__ */ e(Ve, { file: t, ...B })
|
|
133
133
|
});
|
|
134
134
|
} })
|
|
135
135
|
] })
|
|
@@ -179,7 +179,7 @@ function Ge({ app: l, path: m, selectorMode: r, Footer: h, onSelectionChange: _,
|
|
|
179
179
|
title: "Error",
|
|
180
180
|
iconUrl: l?.iconUrl,
|
|
181
181
|
size: new f(300, 150),
|
|
182
|
-
Modal: (
|
|
182
|
+
Modal: (B) => /* @__PURE__ */ i(U, { ...B, children: [
|
|
183
183
|
/* @__PURE__ */ i("p", { children: [
|
|
184
184
|
'Invalid path: "',
|
|
185
185
|
n,
|
|
@@ -191,7 +191,7 @@ function Ge({ app: l, path: m, selectorMode: r, Footer: h, onSelectionChange: _,
|
|
|
191
191
|
return;
|
|
192
192
|
} else t.isFolder() && (y(t), b(t.root ? "/" : t.path));
|
|
193
193
|
}
|
|
194
|
-
},
|
|
194
|
+
}, w = s?.getItemCount(F) ?? 0;
|
|
195
195
|
return /* @__PURE__ */ i("div", { className: g ? `${a.FileExplorer} ${a.Selector}` : a.FileExplorer, children: [
|
|
196
196
|
/* @__PURE__ */ i("div", { className: a.Header, children: [
|
|
197
197
|
/* @__PURE__ */ e(
|
|
@@ -309,12 +309,12 @@ function Ge({ app: l, path: m, selectorMode: r, Footer: h, onSelectionChange: _,
|
|
|
309
309
|
}
|
|
310
310
|
)
|
|
311
311
|
] }),
|
|
312
|
-
g ? /* @__PURE__ */ e("div", { className: a.Footer, children: /* @__PURE__ */ e(h, {}) }) : /* @__PURE__ */ e("span", { className: a.Footer, children: /* @__PURE__ */ e("p", { className: A.TextLight, children:
|
|
312
|
+
g ? /* @__PURE__ */ e("div", { className: a.Footer, children: /* @__PURE__ */ e(h, {}) }) : /* @__PURE__ */ e("span", { className: a.Footer, children: /* @__PURE__ */ e("p", { className: A.TextLight, children: w === 1 ? w + " item" : w + " items" }) })
|
|
313
313
|
] });
|
|
314
314
|
}
|
|
315
315
|
var We = /* @__PURE__ */ ((l) => (l[l.None = 0] = "None", l[l.Single = 1] = "Single", l[l.Multi = 2] = "Multi", l))(We || {});
|
|
316
316
|
const Ye = new ue("File Explorer", "file-explorer", Ge).setIconUrl("https://os.prozilla.dev/assets/apps/icons/file-explorer.svg").setRole(pe.APP_ROLES.fileExplorer).setCategory("Utilities & tools");
|
|
317
|
-
Ye.setMetadata({ name: "@prozilla-os/file-explorer", version: "1.1.
|
|
317
|
+
Ye.setMetadata({ name: "@prozilla-os/file-explorer", version: "1.1.22", author: "Prozilla", website: "https://os.prozilla.dev/file-explorer" });
|
|
318
318
|
export {
|
|
319
319
|
We as FileSelectorMode,
|
|
320
320
|
Ye as fileExplorer
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/components/QuickAccessButton.tsx","../src/components/ImportButton.tsx","../src/constants/fileExplorer.const.ts","../src/components/modals/file-properties/FileProperties.tsx","../src/components/FileExplorer.tsx","../src/types/utils.ts","../src/main.ts"],"sourcesContent":["import { FontAwesomeIcon, FontAwesomeIconProps } from \"@fortawesome/react-fontawesome\";\nimport styles from \"./FileExplorer.module.css\";\nimport { MouseEventHandler } from \"react\";\nimport { utilStyles } from \"@prozilla-os/core\";\n\ninterface QuickAcessButton {\n\tonClick: MouseEventHandler;\n\ticon: FontAwesomeIconProps[\"icon\"];\n\tname: string;\n}\n\nexport function QuickAccessButton({ onClick, icon, name }: QuickAcessButton) {\n\treturn (\n\t\t<button\n\t\t\ttabIndex={0}\n\t\t\tclassName={`${styles.NavButton} ${utilStyles.TextSemibold}`}\n\t\t\tonClick={onClick}\n\t\t>\n\t\t\t<FontAwesomeIcon icon={icon}/>\n\t\t\t{name}\n\t\t</button>\n\t);\n}","import { FormEventHandler, ReactElement } from \"react\";\nimport styles from \"./FileExplorer.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faDownload } from \"@fortawesome/free-solid-svg-icons\";\nimport { VirtualFolder, VirtualFile } from \"@prozilla-os/core\";\n\ninterface ImportButtonProps {\n\tdirectory: VirtualFolder;\n}\n\nexport function ImportButton({ directory }: ImportButtonProps): ReactElement {\n\tconst onChange = (event: InputEvent) => {\n\t\tconst files = (event.target as HTMLInputElement).files;\n\n\t\tif (files == null)\n\t\t\treturn;\n\n\t\tArray.from(files).forEach((file: File) => {\n\t\t\tconst { name, extension } = VirtualFile.splitId(file.name);\n\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onload = (event: Event) => {\n\t\t\t\tconst { result } = event.target as FileReader;\n\n\t\t\t\t// Create a file with the same name and extension, with a base64 string as a source\n\t\t\t\tdirectory.createFile(name, extension as string | undefined, (virtualFile) => {\n\t\t\t\t\tvirtualFile.setSource(result as string);\n\t\t\t\t});\n\t\t\t};\n\t\t\treader.readAsDataURL(file);\n\t\t});\n\t};\n\n\treturn <label title=\"Import\" tabIndex={0} className={styles.IconButton}>\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\tid=\"import\"\n\t\t\tmultiple\n\t\t\tstyle={{ display: \"none\" }}\n\t\t\tonChange={onChange as unknown as FormEventHandler}\n\t\t/>\n\t\t<FontAwesomeIcon icon={faDownload}/>\n\t</label>;\n}","export const SELECTOR_MODE = {\n\tNONE: 0,\n\tSINGLE: 1,\n\tMULTIPLE: 2,\n};","import styles from \"./FileProperties.module.css\";\nimport { ImagePreview, ModalProps, StorageManager, useSystemManager, utilStyles, VirtualFile, WindowedModal } from \"@prozilla-os/core\";\n\ninterface FilePropetiesProps extends ModalProps {\n\tfile: VirtualFile;\n}\n\nexport function FileProperties({ modal, params, file, ...props }: FilePropetiesProps) {\n\tconst { appsConfig } = useSystemManager();\n\tconst associatedApp = file.extension != null ? appsConfig.getAppByFileExtension(file.extension) : null;\n\n\treturn <WindowedModal className={styles.FileProperties} modal={modal} params={params} {...props}>\n\t\t<span className={styles.Section}>\n\t\t\t<ImagePreview className={styles.Icon} source={file.getIconUrl()}/>\n\t\t\t<p className={`${styles.Line} ${utilStyles.TextBold}`}>{file.id}</p>\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Type: {file.getType()}</p>\n\t\t\t{associatedApp != null &&\n\t\t\t\t<span className={styles.Line}>\n\t\t\t\t\tOpens with: \n\t\t\t\t\t<ImagePreview className={styles.AppIcon} source={associatedApp.iconUrl ?? \"\"}/>\n\t\t\t\t\t{associatedApp.name}\n\t\t\t\t</span>\n\t\t\t}\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Location: {file.path}</p>\n\t\t\t<p className={styles.Line}>Size: {StorageManager.getByteSize(file.source ?? file.content as string | null)} bytes</p>\n\t\t\t<p className={styles.Line}>Size on drive: {StorageManager.getByteSize(file.toString())} bytes</p>\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Attributes: {file.isProtected ? \"Protected\" : \"N/A\"}</p>\n\t\t</span>\n\t</WindowedModal>;\n}","import { ChangeEventHandler, FC, KeyboardEventHandler, useCallback, useEffect, useState } from \"react\";\nimport styles from \"./FileExplorer.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowUp, faCaretLeft, faCaretRight, faCircleInfo, faCog, faDesktop, faFileLines, faHouse, faImage, faPlus, faSearch, faTrash, faUpload } from \"@fortawesome/free-solid-svg-icons\";\nimport { QuickAccessButton } from \"./QuickAccessButton\";\nimport { ImportButton } from \"./ImportButton\";\nimport { Actions, ClickAction, CODE_EXTENSIONS, DialogBox, DirectoryList, Divider, FileEventHandler, FolderEventHandler, ModalProps, ModalsConfig, OnSelectionChangeParams, useAlert, useContextMenu, useHistory, useSystemManager, useVirtualRoot, useWindowedModal, useWindowsManager, utilStyles, VirtualFile, VirtualFolder, VirtualFolderLink, VirtualRoot, WindowProps } from \"@prozilla-os/core\";\nimport { SELECTOR_MODE } from \"../constants/fileExplorer.const\";\nimport { FileProperties } from \"./modals/file-properties/FileProperties\";\nimport { JSX } from \"react/jsx-runtime\";\nimport { Vector2 } from \"@prozilla-os/shared\";\n\nexport interface FileExplorerProps extends WindowProps {\n\tpath?: string;\n\tselectorMode?: number;\n\tFooter?: FC;\n\tonSelectionChange?: (params: OnSelectionChangeParams) => void;\n\tonSelectionFinish?: () => void;\n}\n\nexport function FileExplorer({ app, path: startPath, selectorMode, Footer, onSelectionChange, onSelectionFinish }: FileExplorerProps) {\n\tconst isSelector = Footer != null && selectorMode != null && selectorMode !== SELECTOR_MODE.NONE;\n\n\tconst virtualRoot = useVirtualRoot();\n\tconst windowsManager = useWindowsManager();\n\tconst { windowsConfig } = useSystemManager();\n\n\tconst [currentDirectory, setCurrentDirectory] = useState<VirtualFolder | null>(virtualRoot ? virtualRoot.navigateToFolder(startPath ?? \"~\") : null);\n\tconst [path, setPath] = useState<string>(currentDirectory?.path ?? \"\");\n\tconst [showHidden] = useState(true);\n\tconst { history, stateIndex, pushState, undo, redo, undoAvailable, redoAvailable } = useHistory<string>(currentDirectory?.path ?? \"\");\n\tconst { alert } = useAlert();\n\n\tconst { openWindowedModal } = useWindowedModal();\n\tconst { onContextMenu: onContextMenuFile } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label={!isSelector ? \"Open\" : \"Select\"} onTrigger={(_event, file) => {\n\t\t\t\tif (isSelector) {\n\t\t\t\t\tonSelectionChange?.({ files: [(file as VirtualFile).id], directory: currentDirectory! });\n\t\t\t\t\tonSelectionFinish?.();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (windowsManager != null)\t(file as VirtualFile).open(windowsManager);\n\t\t\t}}/>\n\t\t\t{(props.triggerParams as VirtualFile).isDownloadable() && \n\t\t\t\t<ClickAction label=\"Export\" icon={faUpload} onTrigger={(_event, file) => {\n\t\t\t\t\t(file as VirtualFile).download();\n\t\t\t\t}}/>\n\t\t\t}\t\t\t\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, file) => {\n\t\t\t\t(file as VirtualFile).delete();\n\t\t\t}}/>\n\t\t\t<ClickAction label=\"Properties\" icon={faCircleInfo} onTrigger={(_event, file) => {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: `${(file as VirtualFile).id} ${windowsConfig.titleSeparator} Properties`,\n\t\t\t\t\ticonUrl: (file as VirtualFile).getIconUrl(),\n\t\t\t\t\tsize: new Vector2(400, 500),\n\t\t\t\t\tModal: (props: object) => <FileProperties file={file as VirtualFile} {...props}/>,\n\t\t\t\t});\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\tconst { onContextMenu: onContextMenuFolder } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label=\"Open\" onTrigger={(_event, folder) => {\n\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? (folder as VirtualFolder).name);\n\t\t\t}}/>\n\t\t\t{/* <ClickAction label={`Open in ${APP_NAMES.TERMINAL}`} icon={APP_ICONS.TERMINAL} onTrigger={(event, folder) => {\n\t\t\t\twindowsManager?.open(APPS.TERMINAL, { startPath: (folder as VirtualFolder).path });\n\t\t\t}}/> */}\n\t\t\t<Divider/>\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, folder) => {\n\t\t\t\t(folder as VirtualFolder).delete();\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\t// const { onContextMenu: onNew } = useContextMenu({\n\t// \tmodalsManager,\n\t// \toptions: {\n\t// \t\t\"File\": () => { currentDirectory.createFile(\"New File\"); },\n\t// \t\t\"Folder\": () => { currentDirectory.createFolder(\"New Folder\"); }\n\t// \t}\n\t// });\n\n\tconst changeDirectory = useCallback((path: string, absolute = false) => {\n\t\tif (currentDirectory == null)\n\t\t\tabsolute = true;\n\n\t\tconst directory = absolute ? virtualRoot?.navigate(path) : currentDirectory?.navigate(path);\n\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t\tpushState(directory.path);\n\t\t}\n\t}, [currentDirectory, pushState, virtualRoot]);\n\n\tuseEffect(() => {\n\t\tif (history.length === 0)\n\t\t\treturn;\n\n\t\tconst path = history[stateIndex];\n\t\tconst directory = virtualRoot?.navigate(path);\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t}\n\t}, [history, stateIndex, virtualRoot]);\n\n\tuseEffect(() => {\n\t\ttype Error = { message: string };\n\t\tconst onError = (error: unknown) => {\n\t\t\talert({\n\t\t\t\ttitle: (error as Error).message,\n\t\t\t\ttext: \"You have exceeded the virtual drive capacity. Files and folders will not be saved until more storage is freed.\",\n\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\tsize: new Vector2(300, 200),\n\t\t\t\tsingle: true,\n\t\t\t});\n\t\t};\n\n\t\tvirtualRoot?.on(VirtualRoot.ERROR_EVENT, onError);\n\n\t\treturn () => {\n\t\t\tvirtualRoot?.off(VirtualRoot.ERROR_EVENT, onError);\n\t\t};\n\t}, []);\n\n\tconst onPathChange = (event: Event) => {\n\t\tsetPath((event.target as HTMLInputElement).value);\n\t};\n\n\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\tlet value = (event.target as HTMLInputElement).value;\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tif (value === \"\")\n\t\t\t\tvalue = \"~\";\n\n\t\t\tconst directory = virtualRoot?.navigate(value);\n\n\t\t\tif (directory == null) {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t<p>Invalid path: \"{value}\"</p>\n\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} else if (directory.isFolder()) {\n\t\t\t\tsetCurrentDirectory(directory);\n\t\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst itemCount = currentDirectory?.getItemCount(showHidden) ?? 0;\n\n\treturn (\n\t\t<div className={!isSelector ? styles.FileExplorer : `${styles.FileExplorer} ${styles.Selector}`}>\n\t\t\t<div className={styles.Header}>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Back\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { undo(); }}\n\t\t\t\t\tdisabled={!undoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretLeft}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Forward\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { redo(); }}\n\t\t\t\t\tdisabled={!redoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Up\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { changeDirectory(\"..\"); }}\n\t\t\t\t\tdisabled={currentDirectory?.isRoot != null && currentDirectory.isRoot}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faArrowUp}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"New\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\topenWindowedModal({\n\t\t\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t\t\t<p>This folder is protected.</p>\n\t\t\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// if (currentDirectory.canBeEdited) {\n\t\t\t\t\t\t// \tonNew(event);\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// }\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={!currentDirectory?.canBeEdited}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faPlus}/>\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tvalue={path}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label=\"Path\"\n\t\t\t\t\tclassName={styles.PathInput}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tonChange={onPathChange as unknown as ChangeEventHandler}\n\t\t\t\t\tonKeyDown={onKeyDown as unknown as KeyboardEventHandler}\n\t\t\t\t\tplaceholder=\"Enter a path...\"\n\t\t\t\t/>\n\t\t\t\t<ImportButton directory={currentDirectory!}/>\n\t\t\t\t<button title=\"Search\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faSearch}/>\n\t\t\t\t</button>\n\t\t\t\t<button title=\"Settings\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faCog}/>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div className={styles.Body}>\n\t\t\t\t<div className={styles.Sidebar}>\n\t\t\t\t\t<QuickAccessButton name={\"Home\"} onClick={() => { changeDirectory(\"~\"); }} icon={faHouse}/>\n\t\t\t\t\t<QuickAccessButton name={\"Desktop\"} onClick={() => { changeDirectory(\"~/Desktop\"); }} icon={faDesktop}/>\n\t\t\t\t\t<QuickAccessButton name={\"Images\"} onClick={() => { changeDirectory(\"~/Pictures\"); }} icon={faImage}/>\n\t\t\t\t\t<QuickAccessButton name={\"Documents\"} onClick={() => { changeDirectory(\"~/Documents\"); }} icon={faFileLines}/>\n\t\t\t\t</div>\n\t\t\t\t<DirectoryList\n\t\t\t\t\tdirectory={currentDirectory!} \n\t\t\t\t\tid=\"main\"\n\t\t\t\t\tclassName={styles.Main}\n\t\t\t\t\tshowHidden={showHidden}\n\t\t\t\t\tonOpenFile={(event, file) => {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tif (isSelector)\n\t\t\t\t\t\t\treturn void onSelectionFinish?.();\n\t\t\t\t\t\tconst options: Record<string, string> = {};\n\t\t\t\t\t\tif (file.extension === \"md\" || file.extension != null && CODE_EXTENSIONS.includes(file.extension))\n\t\t\t\t\t\t\toptions.mode = \"view\";\n\t\t\t\t\t\twindowsManager?.openFile(file, options);\n\t\t\t\t\t}}\n\t\t\t\t\tonOpenFolder={(_event, folder) => {\n\t\t\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? folder.name);\n\t\t\t\t\t}}\n\t\t\t\t\tonContextMenuFile={onContextMenuFile as unknown as FileEventHandler}\n\t\t\t\t\tonContextMenuFolder={onContextMenuFolder as unknown as FolderEventHandler}\n\t\t\t\t\tallowMultiSelect={selectorMode !== SELECTOR_MODE.SINGLE}\n\t\t\t\t\tonSelectionChange={onSelectionChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{!isSelector\n\t\t\t\t? <span className={styles.Footer}>\n\t\t\t\t\t<p className={utilStyles.TextLight}>\n\t\t\t\t\t\t{itemCount === 1\n\t\t\t\t\t\t\t? itemCount + \" item\"\n\t\t\t\t\t\t\t: itemCount + \" items\"\n\t\t\t\t\t\t}\n\t\t\t\t\t</p>\n\t\t\t\t</span>\n\t\t\t\t: <div className={styles.Footer}>\n\t\t\t\t\t<Footer/>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t);\n}","export enum FileSelectorMode {\n\tNone = 0,\n\tSingle = 1,\n\tMulti = 2\n}","import { App, AppsConfig } from \"@prozilla-os/core\";\nimport { FileExplorer, FileExplorerProps } from \"./components/FileExplorer\";\n\nconst fileExplorer = new App<FileExplorerProps>(\"File Explorer\", \"file-explorer\", FileExplorer)\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/file-explorer.svg\")\n\t.setRole(AppsConfig.APP_ROLES.fileExplorer)\n\t.setCategory(\"Utilities & tools\");\n\nexport { fileExplorer };\nexport { FileSelectorMode } from \"./types/utils\";"],"names":["QuickAccessButton","onClick","icon","name","jsxs","styles","utilStyles","jsx","FontAwesomeIcon","ImportButton","directory","onChange","event","files","file","extension","VirtualFile","reader","result","virtualFile","faDownload","SELECTOR_MODE","FileProperties","modal","params","props","appsConfig","useSystemManager","associatedApp","WindowedModal","ImagePreview","StorageManager","FileExplorer","app","startPath","selectorMode","Footer","onSelectionChange","onSelectionFinish","isSelector","virtualRoot","useVirtualRoot","windowsManager","useWindowsManager","windowsConfig","currentDirectory","setCurrentDirectory","useState","path","setPath","showHidden","history","stateIndex","pushState","undo","redo","undoAvailable","redoAvailable","useHistory","alert","useAlert","openWindowedModal","useWindowedModal","onContextMenuFile","useContextMenu","Actions","ClickAction","_event","faUpload","faTrash","faCircleInfo","Vector2","onContextMenuFolder","folder","changeDirectory","Divider","useCallback","absolute","useEffect","onError","error","VirtualRoot","onPathChange","onKeyDown","value","DialogBox","ModalsConfig","itemCount","faCaretLeft","faCaretRight","faArrowUp","faPlus","faSearch","faCog","faHouse","faDesktop","faImage","faFileLines","DirectoryList","options","CODE_EXTENSIONS","FileSelectorMode","fileExplorer","App","AppsConfig"],"mappings":";;;;;;;;;;;;;;;;;;AAWO,SAASA,EAAkB,EAAE,SAAAC,GAAS,MAAAC,GAAM,MAAAC,KAA0B;AAC5E,SACC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,WAAW,GAAGC,EAAO,SAAS,IAAIC,EAAW,YAAY;AAAA,MACzD,SAAAL;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAM,EAACC,KAAgB,MAAAN,GAAW;AAAA,QAC3BC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGJ;ACZO,SAASM,GAAa,EAAE,WAAAC,KAA8C;AAC5E,QAAMC,IAAW,CAACC,MAAsB;AACvC,UAAMC,IAASD,EAAM,OAA4B;AAEjD,IAAIC,KAAS,QAGb,MAAM,KAAKA,CAAK,EAAE,QAAQ,CAACC,MAAe;AACzC,YAAM,EAAE,MAAAX,GAAM,WAAAY,EAAA,IAAcC,GAAY,QAAQF,EAAK,IAAI,GAEnDG,IAAS,IAAI,WAAA;AACnB,MAAAA,EAAO,SAAS,CAACL,MAAiB;AACjC,cAAM,EAAE,QAAAM,MAAWN,EAAM;AAGzB,QAAAF,EAAU,WAAWP,GAAMY,GAAiC,CAACI,MAAgB;AAC5E,UAAAA,EAAY,UAAUD,CAAgB;AAAA,QACvC,CAAC;AAAA,MACF,GACAD,EAAO,cAAcH,CAAI;AAAA,IAC1B,CAAC;AAAA,EACF;AAEA,SAAO,gBAAAV,EAAC,WAAM,OAAM,UAAS,UAAU,GAAG,WAAWC,EAAO,YAC3D,UAAA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AAA,EAAK,WAAWF,EAAO,QACzB,UAAA,gBAAAE,EAAC,KAAA,EAAE,WAAWD,EAAW,WACvB,UAAAiF,MAAc,IACZA,IAAY,UACZA,IAAY,SAAA,CAEhB,EAAA,CACD;AAAA,EAGA,GAEF;AAEF;ACzRO,IAAKc,uBAAAA,OACXA,EAAAA,EAAA,OAAO,CAAA,IAAP,QACAA,EAAAA,EAAA,SAAS,CAAA,IAAT,UACAA,EAAAA,EAAA,QAAQ,CAAA,IAAR,SAHWA,IAAAA,MAAA,CAAA,CAAA;ACGZ,MAAMC,KAAe,IAAIC,GAAuB,iBAAiB,iBAAiBvE,EAAY,EAC5F,WAAW,6DAA6D,EACxE,QAAQwE,GAAW,UAAU,YAAY,EACzC,YAAY,mBAAmB;;"}
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/components/QuickAccessButton.tsx","../src/components/ImportButton.tsx","../src/constants/fileExplorer.const.ts","../src/components/modals/file-properties/FileProperties.tsx","../src/components/FileExplorer.tsx","../src/types/utils.ts","../src/main.ts"],"sourcesContent":["import { FontAwesomeIcon, FontAwesomeIconProps } from \"@fortawesome/react-fontawesome\";\nimport styles from \"./FileExplorer.module.css\";\nimport { MouseEventHandler } from \"react\";\nimport { utilStyles } from \"@prozilla-os/core\";\n\ninterface QuickAcessButton {\n\tonClick: MouseEventHandler;\n\ticon: FontAwesomeIconProps[\"icon\"];\n\tname: string;\n}\n\nexport function QuickAccessButton({ onClick, icon, name }: QuickAcessButton) {\n\treturn (\n\t\t<button\n\t\t\ttabIndex={0}\n\t\t\tclassName={`${styles.NavButton} ${utilStyles.TextSemibold}`}\n\t\t\tonClick={onClick}\n\t\t>\n\t\t\t<FontAwesomeIcon icon={icon}/>\n\t\t\t{name}\n\t\t</button>\n\t);\n}","import { FormEventHandler, ReactElement } from \"react\";\nimport styles from \"./FileExplorer.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faDownload } from \"@fortawesome/free-solid-svg-icons\";\nimport { VirtualFolder, VirtualFile } from \"@prozilla-os/core\";\n\ninterface ImportButtonProps {\n\tdirectory: VirtualFolder;\n}\n\nexport function ImportButton({ directory }: ImportButtonProps): ReactElement {\n\tconst onChange = (event: InputEvent) => {\n\t\tconst files = (event.target as HTMLInputElement).files;\n\n\t\tif (files == null)\n\t\t\treturn;\n\n\t\tArray.from(files).forEach((file: File) => {\n\t\t\tconst { name, extension } = VirtualFile.splitId(file.name);\n\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onload = (event: Event) => {\n\t\t\t\tconst { result } = event.target as FileReader;\n\n\t\t\t\t// Create a file with the same name and extension, with a base64 string as a source\n\t\t\t\tdirectory.createFile(name, extension as string | undefined, (virtualFile) => {\n\t\t\t\t\tvirtualFile.setSource(result as string);\n\t\t\t\t});\n\t\t\t};\n\t\t\treader.readAsDataURL(file);\n\t\t});\n\t};\n\n\treturn <label title=\"Import\" tabIndex={0} className={styles.IconButton}>\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\tid=\"import\"\n\t\t\tmultiple\n\t\t\tstyle={{ display: \"none\" }}\n\t\t\tonChange={onChange as unknown as FormEventHandler}\n\t\t/>\n\t\t<FontAwesomeIcon icon={faDownload}/>\n\t</label>;\n}","export const SELECTOR_MODE = {\n\tNONE: 0,\n\tSINGLE: 1,\n\tMULTIPLE: 2,\n};","import styles from \"./FileProperties.module.css\";\nimport { ImagePreview, ModalProps, StorageManager, useSystemManager, utilStyles, VirtualFile, WindowedModal } from \"@prozilla-os/core\";\n\ninterface FilePropetiesProps extends ModalProps {\n\tfile: VirtualFile;\n}\n\nexport function FileProperties({ modal, params, file, ...props }: FilePropetiesProps) {\n\tconst { appsConfig } = useSystemManager();\n\tconst associatedApp = file.extension != null ? appsConfig.getAppByFileExtension(file.extension) : null;\n\n\treturn <WindowedModal className={styles.FileProperties} modal={modal} params={params} {...props}>\n\t\t<span className={styles.Section}>\n\t\t\t<ImagePreview className={styles.Icon} source={file.getIconUrl()}/>\n\t\t\t<p className={`${styles.Line} ${utilStyles.TextBold}`}>{file.id}</p>\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Type: {file.getType()}</p>\n\t\t\t{associatedApp != null &&\n\t\t\t\t<span className={styles.Line}>\n\t\t\t\t\tOpens with: \n\t\t\t\t\t<ImagePreview className={styles.AppIcon} source={associatedApp.iconUrl ?? \"\"}/>\n\t\t\t\t\t{associatedApp.name}\n\t\t\t\t</span>\n\t\t\t}\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Location: {file.path}</p>\n\t\t\t<p className={styles.Line}>Size: {StorageManager.getByteSize(file.source ?? file.content as string | null)} bytes</p>\n\t\t\t<p className={styles.Line}>Size on drive: {StorageManager.getByteSize(file.toString())} bytes</p>\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Attributes: {file.isProtected ? \"Protected\" : \"N/A\"}</p>\n\t\t</span>\n\t</WindowedModal>;\n}","import { ChangeEventHandler, FC, KeyboardEventHandler, useCallback, useEffect, useState } from \"react\";\nimport styles from \"./FileExplorer.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowUp, faCaretLeft, faCaretRight, faCircleInfo, faCog, faDesktop, faFileLines, faHouse, faImage, faPlus, faSearch, faTrash, faUpload } from \"@fortawesome/free-solid-svg-icons\";\nimport { QuickAccessButton } from \"./QuickAccessButton\";\nimport { ImportButton } from \"./ImportButton\";\nimport { Actions, ClickAction, CODE_EXTENSIONS, DialogBox, DirectoryList, Divider, FileEventHandler, FolderEventHandler, ModalProps, ModalsConfig, OnSelectionChangeParams, useAlert, useContextMenu, useHistory, useSystemManager, useVirtualRoot, useWindowedModal, useWindowsManager, utilStyles, VirtualFile, VirtualFolder, VirtualFolderLink, VirtualRoot, WindowProps } from \"@prozilla-os/core\";\nimport { SELECTOR_MODE } from \"../constants/fileExplorer.const\";\nimport { FileProperties } from \"./modals/file-properties/FileProperties\";\nimport { JSX } from \"react/jsx-runtime\";\nimport { Vector2 } from \"@prozilla-os/shared\";\n\nexport interface FileExplorerProps extends WindowProps {\n\tpath?: string;\n\tselectorMode?: number;\n\tFooter?: FC;\n\tonSelectionChange?: (params: OnSelectionChangeParams) => void;\n\tonSelectionFinish?: () => void;\n}\n\nexport function FileExplorer({ app, path: startPath, selectorMode, Footer, onSelectionChange, onSelectionFinish }: FileExplorerProps) {\n\tconst isSelector = Footer != null && selectorMode != null && selectorMode !== SELECTOR_MODE.NONE;\n\n\tconst virtualRoot = useVirtualRoot();\n\tconst windowsManager = useWindowsManager();\n\tconst { windowsConfig } = useSystemManager();\n\n\tconst [currentDirectory, setCurrentDirectory] = useState<VirtualFolder | null>(virtualRoot ? virtualRoot.navigateToFolder(startPath ?? \"~\") : null);\n\tconst [path, setPath] = useState<string>(currentDirectory?.path ?? \"\");\n\tconst [showHidden] = useState(true);\n\tconst { history, stateIndex, pushState, undo, redo, undoAvailable, redoAvailable } = useHistory<string>(currentDirectory?.path ?? \"\");\n\tconst { alert } = useAlert();\n\n\tconst { openWindowedModal } = useWindowedModal();\n\tconst { onContextMenu: onContextMenuFile } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label={!isSelector ? \"Open\" : \"Select\"} onTrigger={(_event, file) => {\n\t\t\t\tif (isSelector) {\n\t\t\t\t\tonSelectionChange?.({ files: [(file as VirtualFile).id], directory: currentDirectory! });\n\t\t\t\t\tonSelectionFinish?.();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (windowsManager != null)\t(file as VirtualFile).open(windowsManager);\n\t\t\t}}/>\n\t\t\t{(props.triggerParams as VirtualFile).isDownloadable() && \n\t\t\t\t<ClickAction label=\"Export\" icon={faUpload} onTrigger={(_event, file) => {\n\t\t\t\t\t(file as VirtualFile).download();\n\t\t\t\t}}/>\n\t\t\t}\t\t\t\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, file) => {\n\t\t\t\t(file as VirtualFile).delete();\n\t\t\t}}/>\n\t\t\t<ClickAction label=\"Properties\" icon={faCircleInfo} onTrigger={(_event, file) => {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: `${(file as VirtualFile).id} ${windowsConfig.titleSeparator} Properties`,\n\t\t\t\t\ticonUrl: (file as VirtualFile).getIconUrl(),\n\t\t\t\t\tsize: new Vector2(400, 500),\n\t\t\t\t\tModal: (props: object) => <FileProperties file={file as VirtualFile} {...props}/>,\n\t\t\t\t});\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\tconst { onContextMenu: onContextMenuFolder } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label=\"Open\" onTrigger={(_event, folder) => {\n\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? (folder as VirtualFolder).name);\n\t\t\t}}/>\n\t\t\t{/* <ClickAction label={`Open in ${APP_NAMES.TERMINAL}`} icon={APP_ICONS.TERMINAL} onTrigger={(event, folder) => {\n\t\t\t\twindowsManager?.open(APPS.TERMINAL, { startPath: (folder as VirtualFolder).path });\n\t\t\t}}/> */}\n\t\t\t<Divider/>\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, folder) => {\n\t\t\t\t(folder as VirtualFolder).delete();\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\t// const { onContextMenu: onNew } = useContextMenu({\n\t// \tmodalsManager,\n\t// \toptions: {\n\t// \t\t\"File\": () => { currentDirectory.createFile(\"New File\"); },\n\t// \t\t\"Folder\": () => { currentDirectory.createFolder(\"New Folder\"); }\n\t// \t}\n\t// });\n\n\tconst changeDirectory = useCallback((path: string, absolute = false) => {\n\t\tif (currentDirectory == null)\n\t\t\tabsolute = true;\n\n\t\tconst directory = absolute ? virtualRoot?.navigate(path) : currentDirectory?.navigate(path);\n\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t\tpushState(directory.path);\n\t\t}\n\t}, [currentDirectory, pushState, virtualRoot]);\n\n\tuseEffect(() => {\n\t\tif (history.length === 0)\n\t\t\treturn;\n\n\t\tconst path = history[stateIndex];\n\t\tconst directory = virtualRoot?.navigate(path);\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t}\n\t}, [history, stateIndex, virtualRoot]);\n\n\tuseEffect(() => {\n\t\ttype Error = { message: string };\n\t\tconst onError = (error: unknown) => {\n\t\t\talert({\n\t\t\t\ttitle: (error as Error).message,\n\t\t\t\ttext: \"You have exceeded the virtual drive capacity. Files and folders will not be saved until more storage is freed.\",\n\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\tsize: new Vector2(300, 200),\n\t\t\t\tsingle: true,\n\t\t\t});\n\t\t};\n\n\t\tvirtualRoot?.on(VirtualRoot.ERROR_EVENT, onError);\n\n\t\treturn () => {\n\t\t\tvirtualRoot?.off(VirtualRoot.ERROR_EVENT, onError);\n\t\t};\n\t}, []);\n\n\tconst onPathChange = (event: Event) => {\n\t\tsetPath((event.target as HTMLInputElement).value);\n\t};\n\n\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\tlet value = (event.target as HTMLInputElement).value;\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tif (value === \"\")\n\t\t\t\tvalue = \"~\";\n\n\t\t\tconst directory = virtualRoot?.navigate(value);\n\n\t\t\tif (directory == null) {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t<p>Invalid path: \"{value}\"</p>\n\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} else if (directory.isFolder()) {\n\t\t\t\tsetCurrentDirectory(directory);\n\t\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst itemCount = currentDirectory?.getItemCount(showHidden) ?? 0;\n\n\treturn (\n\t\t<div className={!isSelector ? styles.FileExplorer : `${styles.FileExplorer} ${styles.Selector}`}>\n\t\t\t<div className={styles.Header}>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Back\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { undo(); }}\n\t\t\t\t\tdisabled={!undoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretLeft}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Forward\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { redo(); }}\n\t\t\t\t\tdisabled={!redoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Up\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { changeDirectory(\"..\"); }}\n\t\t\t\t\tdisabled={currentDirectory?.isRoot != null && currentDirectory.isRoot}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faArrowUp}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"New\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\topenWindowedModal({\n\t\t\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t\t\t<p>This folder is protected.</p>\n\t\t\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// if (currentDirectory.canBeEdited) {\n\t\t\t\t\t\t// \tonNew(event);\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// }\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={!currentDirectory?.canBeEdited}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faPlus}/>\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tvalue={path}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label=\"Path\"\n\t\t\t\t\tclassName={styles.PathInput}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tonChange={onPathChange as unknown as ChangeEventHandler}\n\t\t\t\t\tonKeyDown={onKeyDown as unknown as KeyboardEventHandler}\n\t\t\t\t\tplaceholder=\"Enter a path...\"\n\t\t\t\t/>\n\t\t\t\t<ImportButton directory={currentDirectory!}/>\n\t\t\t\t<button title=\"Search\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faSearch}/>\n\t\t\t\t</button>\n\t\t\t\t<button title=\"Settings\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faCog}/>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div className={styles.Body}>\n\t\t\t\t<div className={styles.Sidebar}>\n\t\t\t\t\t<QuickAccessButton name={\"Home\"} onClick={() => { changeDirectory(\"~\"); }} icon={faHouse}/>\n\t\t\t\t\t<QuickAccessButton name={\"Desktop\"} onClick={() => { changeDirectory(\"~/Desktop\"); }} icon={faDesktop}/>\n\t\t\t\t\t<QuickAccessButton name={\"Images\"} onClick={() => { changeDirectory(\"~/Pictures\"); }} icon={faImage}/>\n\t\t\t\t\t<QuickAccessButton name={\"Documents\"} onClick={() => { changeDirectory(\"~/Documents\"); }} icon={faFileLines}/>\n\t\t\t\t</div>\n\t\t\t\t<DirectoryList\n\t\t\t\t\tdirectory={currentDirectory!} \n\t\t\t\t\tid=\"main\"\n\t\t\t\t\tclassName={styles.Main}\n\t\t\t\t\tshowHidden={showHidden}\n\t\t\t\t\tonOpenFile={(event, file) => {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tif (isSelector)\n\t\t\t\t\t\t\treturn void onSelectionFinish?.();\n\t\t\t\t\t\tconst options: Record<string, string> = {};\n\t\t\t\t\t\tif (file.extension === \"md\" || file.extension != null && CODE_EXTENSIONS.includes(file.extension))\n\t\t\t\t\t\t\toptions.mode = \"view\";\n\t\t\t\t\t\twindowsManager?.openFile(file, options);\n\t\t\t\t\t}}\n\t\t\t\t\tonOpenFolder={(_event, folder) => {\n\t\t\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? folder.name);\n\t\t\t\t\t}}\n\t\t\t\t\tonContextMenuFile={onContextMenuFile as unknown as FileEventHandler}\n\t\t\t\t\tonContextMenuFolder={onContextMenuFolder as unknown as FolderEventHandler}\n\t\t\t\t\tallowMultiSelect={selectorMode !== SELECTOR_MODE.SINGLE}\n\t\t\t\t\tonSelectionChange={onSelectionChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{!isSelector\n\t\t\t\t? <span className={styles.Footer}>\n\t\t\t\t\t<p className={utilStyles.TextLight}>\n\t\t\t\t\t\t{itemCount === 1\n\t\t\t\t\t\t\t? itemCount + \" item\"\n\t\t\t\t\t\t\t: itemCount + \" items\"\n\t\t\t\t\t\t}\n\t\t\t\t\t</p>\n\t\t\t\t</span>\n\t\t\t\t: <div className={styles.Footer}>\n\t\t\t\t\t<Footer/>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t);\n}","export enum FileSelectorMode {\n\tNone = 0,\n\tSingle = 1,\n\tMulti = 2\n}","import { App, AppsConfig } from \"@prozilla-os/core\";\nimport { FileExplorer, type FileExplorerProps } from \"./components/FileExplorer\";\n\nconst fileExplorer = new App<FileExplorerProps>(\"File Explorer\", \"file-explorer\", FileExplorer)\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/file-explorer.svg\")\n\t.setRole(AppsConfig.APP_ROLES.fileExplorer)\n\t.setCategory(\"Utilities & tools\");\n\nexport { fileExplorer, FileExplorerProps };\nexport { FileSelectorMode } from \"./types/utils\";"],"names":["QuickAccessButton","onClick","icon","name","jsxs","styles","utilStyles","jsx","FontAwesomeIcon","ImportButton","directory","onChange","event","files","file","extension","VirtualFile","reader","result","virtualFile","faDownload","SELECTOR_MODE","FileProperties","modal","params","props","appsConfig","useSystemManager","associatedApp","WindowedModal","ImagePreview","StorageManager","FileExplorer","app","startPath","selectorMode","Footer","onSelectionChange","onSelectionFinish","isSelector","virtualRoot","useVirtualRoot","windowsManager","useWindowsManager","windowsConfig","currentDirectory","setCurrentDirectory","useState","path","setPath","showHidden","history","stateIndex","pushState","undo","redo","undoAvailable","redoAvailable","useHistory","alert","useAlert","openWindowedModal","useWindowedModal","onContextMenuFile","useContextMenu","Actions","ClickAction","_event","faUpload","faTrash","faCircleInfo","Vector2","onContextMenuFolder","folder","changeDirectory","Divider","useCallback","absolute","useEffect","onError","error","VirtualRoot","onPathChange","onKeyDown","value","DialogBox","ModalsConfig","itemCount","faCaretLeft","faCaretRight","faArrowUp","faPlus","faSearch","faCog","faHouse","faDesktop","faImage","faFileLines","DirectoryList","options","CODE_EXTENSIONS","FileSelectorMode","fileExplorer","App","AppsConfig"],"mappings":";;;;;;;;;;;;;;;;;;AAWO,SAASA,EAAkB,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AAA,MAAA,CAAA,CAAA;ACGZ,MAAMC,KAAe,IAAIC,GAAuB,iBAAiB,iBAAiBvE,EAAY,EAC5F,WAAW,6DAA6D,EACxE,QAAQwE,GAAW,UAAU,YAAY,EACzC,YAAY,mBAAmB;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prozilla-os/file-explorer",
|
|
3
3
|
"description": "A standard ProzillaOS application for browsing files.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.25",
|
|
5
5
|
"homepage": "https://os.prozilla.dev/file-explorer",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Prozilla",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fortawesome/fontawesome-svg-core": "^7.
|
|
23
|
-
"@fortawesome/free-solid-svg-icons": "^7.
|
|
24
|
-
"@fortawesome/react-fontawesome": "^3.
|
|
22
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
23
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
24
|
+
"@fortawesome/react-fontawesome": "^3.3.1",
|
|
25
25
|
"react": "^18.3.1",
|
|
26
|
-
"@prozilla-os/core": "2.0.2",
|
|
27
26
|
"@prozilla-os/skins": "1.1.9",
|
|
28
|
-
"@prozilla-os/
|
|
27
|
+
"@prozilla-os/core": "2.1.2",
|
|
28
|
+
"@prozilla-os/shared": "1.4.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^20.
|
|
32
|
-
"@types/react": "^18.3.
|
|
33
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"vite": "^7.3.
|
|
31
|
+
"@types/node": "^20.19.39",
|
|
32
|
+
"@types/react": "^18.3.28",
|
|
33
|
+
"@vitejs/plugin-react-swc": "^3.11.0",
|
|
34
|
+
"typescript": "^5.9.3",
|
|
35
|
+
"vite": "^7.3.2",
|
|
36
36
|
"vite-plugin-dts": "^4.5.4",
|
|
37
|
-
"vite-plugin-lib-inject-css": "^2.
|
|
38
|
-
"@prozilla-os/dev-tools": "1.1.
|
|
37
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
38
|
+
"@prozilla-os/dev-tools": "1.1.17"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"dist"
|