@prozilla-os/media-viewer 1.1.18 → 1.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.d.ts +1019 -3
- package/dist/main.js +21 -21
- package/dist/main.js.map +1 -1
- package/package.json +8 -6
package/dist/main.d.ts
CHANGED
|
@@ -1,6 +1,253 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
3
|
+
import { Skin } from '@prozilla-os/skins';
|
|
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
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* A function that handles an event.
|
|
247
|
+
* @typeParam T - A record of all events.
|
|
248
|
+
* @typeParam K - The event this function handles.
|
|
249
|
+
*/
|
|
250
|
+
declare type Listener<T extends Record<keyof T, unknown[]>, K extends keyof T> = (...args: T[K]) => void;
|
|
4
251
|
|
|
5
252
|
export declare const mediaViewer: App<MediaViewerProps>;
|
|
6
253
|
|
|
@@ -8,4 +255,773 @@ declare interface MediaViewerProps extends WindowProps {
|
|
|
8
255
|
file?: VirtualFile;
|
|
9
256
|
}
|
|
10
257
|
|
|
258
|
+
declare class MiscConfig {
|
|
259
|
+
doubleClickDelay: MiscConfigOptions["doubleClickDelay"];
|
|
260
|
+
constructor(options?: Partial<MiscConfigOptions>);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
declare interface MiscConfigOptions {
|
|
264
|
+
/**
|
|
265
|
+
* The maximum time between two clicks to register as a double click (in ms).
|
|
266
|
+
* @default 250
|
|
267
|
+
* */
|
|
268
|
+
doubleClickDelay: number;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare class ModalsConfig {
|
|
272
|
+
defaultDialogSize: ModalsConfigOptions["defaultDialogSize"];
|
|
273
|
+
defaultFileSelectorSize: ModalsConfigOptions["defaultFileSelectorSize"];
|
|
274
|
+
static DIALOG_CONTENT_TYPES: {
|
|
275
|
+
closeButton: number;
|
|
276
|
+
};
|
|
277
|
+
constructor(options?: Partial<ModalsConfigOptions>);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare interface ModalsConfigOptions {
|
|
281
|
+
/**
|
|
282
|
+
* Default size of a dialog box.
|
|
283
|
+
* @default new Vector2(400, 200)
|
|
284
|
+
*/
|
|
285
|
+
defaultDialogSize: Vector2;
|
|
286
|
+
/**
|
|
287
|
+
* Default size of a file selector.
|
|
288
|
+
* @default new Vector2(700, 400)
|
|
289
|
+
*/
|
|
290
|
+
defaultFileSelectorSize: Vector2;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
declare type OptionalStringProperty = string | null | undefined;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* A wrapper for {@link localStorage} with additional functionality like compression and a size limit.
|
|
297
|
+
*/
|
|
298
|
+
declare class Storage_2 {
|
|
299
|
+
/**
|
|
300
|
+
* Enables compression of values stored in this storage.
|
|
301
|
+
* @default false
|
|
302
|
+
*/
|
|
303
|
+
enableCompression: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* The prefix to prepend to keys.
|
|
306
|
+
* @default undefined
|
|
307
|
+
*/
|
|
308
|
+
prefix: string | undefined;
|
|
309
|
+
/**
|
|
310
|
+
* The maximum amount of bytes of a value in this storage.
|
|
311
|
+
*/
|
|
312
|
+
static readonly MAX_BYTES = 5000000;
|
|
313
|
+
static readonly COMPRESSED_PREFIX = "\uE000";
|
|
314
|
+
static readonly UNCOMPRESSED_PREFIX = "\uE001";
|
|
315
|
+
/**
|
|
316
|
+
* Stores a key and value pair in this storage.
|
|
317
|
+
* @param key - The key to store.
|
|
318
|
+
* @param value - The value to store.
|
|
319
|
+
*/
|
|
320
|
+
store(key: string, value: string): void;
|
|
321
|
+
/**
|
|
322
|
+
* Loads a value associated with the given key.
|
|
323
|
+
* @param key - The key of the item.
|
|
324
|
+
* @returns The value of the item.
|
|
325
|
+
*/
|
|
326
|
+
load(key: string): string | null;
|
|
327
|
+
/**
|
|
328
|
+
* Replaces the key of an item if it exists.
|
|
329
|
+
* @param oldKey - The key to replace.
|
|
330
|
+
* @param newKey - The new key.
|
|
331
|
+
*/
|
|
332
|
+
rename(oldKey: string, newKey: string): this;
|
|
333
|
+
/**
|
|
334
|
+
* Removes the item with the given key from this storage.
|
|
335
|
+
* @param key - The key of the item.
|
|
336
|
+
*/
|
|
337
|
+
remove(key: string): this;
|
|
338
|
+
/**
|
|
339
|
+
* Clears all items stored in this storage.
|
|
340
|
+
*/
|
|
341
|
+
clear(): this;
|
|
342
|
+
/**
|
|
343
|
+
* Returns the byte size of a key and value pair.
|
|
344
|
+
* @param key - The key of the item.
|
|
345
|
+
* @param value - The value of the item.
|
|
346
|
+
*/
|
|
347
|
+
getItemByteSize(key: string, value: string): number;
|
|
348
|
+
getEncodedByteSize(string: string | null): number;
|
|
349
|
+
encode(string: string): {
|
|
350
|
+
result: string;
|
|
351
|
+
size: number;
|
|
352
|
+
};
|
|
353
|
+
decode(string: string): string;
|
|
354
|
+
setPrefix(prefix?: string): this;
|
|
355
|
+
static getByteSize(string: string | null): number;
|
|
356
|
+
static byteToKilobyte(bytes: number): number;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
declare class SystemManager {
|
|
360
|
+
#private;
|
|
361
|
+
/** The name of the system. */
|
|
362
|
+
readonly systemName: string;
|
|
363
|
+
/** The tagline/short description of the system. */
|
|
364
|
+
readonly tagLine: string;
|
|
365
|
+
readonly skin: Skin;
|
|
366
|
+
readonly appsConfig: AppsConfig;
|
|
367
|
+
readonly desktopConfig: DesktopConfig;
|
|
368
|
+
readonly miscConfig: MiscConfig;
|
|
369
|
+
readonly modalsConfig: ModalsConfig;
|
|
370
|
+
readonly taskbarConfig: TaskbarConfig;
|
|
371
|
+
readonly trackingConfig: TrackingConfig;
|
|
372
|
+
readonly windowsConfig: WindowsConfig;
|
|
373
|
+
readonly virtualDriveConfig: VirtualDriveConfig;
|
|
374
|
+
readonly storage: Storage_2;
|
|
375
|
+
constructor({ systemName, tagLine, skin, desktopConfig, appsConfig, miscConfig, modalsConfig, taskbarConfig, trackingConfig, windowsConfig, virtualDriveConfig, }: SystemManagerParams);
|
|
376
|
+
private loadSkin;
|
|
377
|
+
getUptime(precision?: number): string;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
declare interface SystemManagerParams {
|
|
381
|
+
systemName: SystemManager["systemName"] | null;
|
|
382
|
+
tagLine: SystemManager["tagLine"] | null;
|
|
383
|
+
skin?: SystemManager["skin"];
|
|
384
|
+
desktopConfig: DesktopConfig;
|
|
385
|
+
appsConfig: AppsConfig;
|
|
386
|
+
miscConfig: MiscConfig;
|
|
387
|
+
modalsConfig: ModalsConfig;
|
|
388
|
+
taskbarConfig: TaskbarConfig;
|
|
389
|
+
trackingConfig: TrackingConfig;
|
|
390
|
+
windowsConfig: WindowsConfig;
|
|
391
|
+
virtualDriveConfig: VirtualDriveConfig;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare class TaskbarConfig {
|
|
395
|
+
height: TaskbarConfigOptions["height"];
|
|
396
|
+
constructor(options?: Partial<TaskbarConfigOptions>);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare interface TaskbarConfigOptions {
|
|
400
|
+
/**
|
|
401
|
+
* Height of the taskbar in CSS pixels.
|
|
402
|
+
* @default 3 * 16
|
|
403
|
+
*/
|
|
404
|
+
height: number;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
declare class TrackingConfig {
|
|
408
|
+
enabled: TrackingConfigOptions["enabled"];
|
|
409
|
+
googleAnalyticsMeasurementId: TrackingConfigOptions["GAMeasurementId"];
|
|
410
|
+
constructor(options?: Partial<TrackingConfigOptions>);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare interface TrackingConfigOptions {
|
|
414
|
+
/**
|
|
415
|
+
* Enable tracking.
|
|
416
|
+
* @default true
|
|
417
|
+
*/
|
|
418
|
+
enabled: boolean;
|
|
419
|
+
/** Google Analytics measurement ID. */
|
|
420
|
+
GAMeasurementId: string;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
declare class TrackingManager {
|
|
424
|
+
#private;
|
|
425
|
+
measurementId?: string | null;
|
|
426
|
+
constructor(systemManager: SystemManager);
|
|
427
|
+
init(): this;
|
|
428
|
+
event(options: UaEventOptions | string): void;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
declare class Vector2 {
|
|
432
|
+
x: number;
|
|
433
|
+
y: number;
|
|
434
|
+
constructor(xy: number);
|
|
435
|
+
constructor(x: number, y?: number);
|
|
436
|
+
static get ZERO(): Vector2;
|
|
437
|
+
get clone(): Vector2;
|
|
438
|
+
get magnitude(): number;
|
|
439
|
+
setX(x: number): this;
|
|
440
|
+
setY(y: number): this;
|
|
441
|
+
set(x: number, y: number): this;
|
|
442
|
+
round(): this;
|
|
443
|
+
normalize(): this;
|
|
444
|
+
scale(scalar: number): this;
|
|
445
|
+
getDistanceSquared(x: number, y?: number): number;
|
|
446
|
+
getDistanceSquared(vector2: Vector2): number;
|
|
447
|
+
getDistance(x: number, y?: number): number;
|
|
448
|
+
getDistance(vector2: Vector2): number;
|
|
449
|
+
add(x: number, y?: number): this;
|
|
450
|
+
add(vector2: Vector2): this;
|
|
451
|
+
subtract(x: number, y?: number): this;
|
|
452
|
+
subtract(vector2: Vector2): this;
|
|
453
|
+
multiply(x: number, y?: number): this;
|
|
454
|
+
multiply(vector2: Vector2): this;
|
|
455
|
+
divide(x: number, y?: number): this;
|
|
456
|
+
divide(vector2: Vector2): this;
|
|
457
|
+
lerp(vector2: Vector2, t: number): this;
|
|
458
|
+
static sum(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
459
|
+
static difference(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
460
|
+
static product(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
461
|
+
static division(vector2A: Vector2, vector2B: Vector2): Vector2;
|
|
462
|
+
static scale(vector2: Vector2, scalar: number): Vector2;
|
|
463
|
+
static normalize(vector2: Vector2): Vector2;
|
|
464
|
+
static lerp(vector2A: Vector2, vector2B: Vector2, t: number): Vector2;
|
|
465
|
+
static from({ x, y }: {
|
|
466
|
+
x: number;
|
|
467
|
+
y: number;
|
|
468
|
+
}): Vector2;
|
|
469
|
+
static parseVector(x: number | Vector2, y?: number): {
|
|
470
|
+
x: number;
|
|
471
|
+
y: number;
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
declare class VirtualBase<E extends VirtualBaseEvents = VirtualBaseEvents> extends EventEmitter<E & Record<keyof E, unknown[]>> {
|
|
476
|
+
/** The name of this item. */
|
|
477
|
+
name: string;
|
|
478
|
+
/** The alias of this item. */
|
|
479
|
+
alias: string | undefined | null;
|
|
480
|
+
/** The folder this item is in. */
|
|
481
|
+
parent: VirtualFolder | undefined | null;
|
|
482
|
+
/** Whether this item is protected from changes. */
|
|
483
|
+
isProtected: boolean | undefined | null;
|
|
484
|
+
/** The URL of the icon of this item. */
|
|
485
|
+
iconUrl: string | undefined | null;
|
|
486
|
+
/** The file this item links to. */
|
|
487
|
+
linkedFile: VirtualFile | undefined | null;
|
|
488
|
+
/** The folder this item links to. */
|
|
489
|
+
linkedFolder: VirtualFolder | undefined | null;
|
|
490
|
+
/** Whether this item has been edited by the user. */
|
|
491
|
+
editedByUser: boolean | undefined | null;
|
|
492
|
+
/** Whether this item is the root folder. */
|
|
493
|
+
isRoot: boolean | undefined | null;
|
|
494
|
+
/** The root folder. */
|
|
495
|
+
root: VirtualRoot | undefined | null;
|
|
496
|
+
/** Whether this item has been deleted. */
|
|
497
|
+
isDeleted: boolean;
|
|
498
|
+
static readonly UPDATE_EVENT = "update";
|
|
499
|
+
constructor(name: string);
|
|
500
|
+
get id(): string;
|
|
501
|
+
setName(name: string): this;
|
|
502
|
+
setAlias(alias: string): this;
|
|
503
|
+
setParent(parent: VirtualFolder): this;
|
|
504
|
+
setProtected(value: boolean): this;
|
|
505
|
+
setIconUrl(iconUrl: string | null): this;
|
|
506
|
+
getIconUrl(): string;
|
|
507
|
+
getType(): string;
|
|
508
|
+
/**
|
|
509
|
+
* Tries to delete this item.
|
|
510
|
+
*/
|
|
511
|
+
delete(): void;
|
|
512
|
+
confirmChanges(root?: VirtualRoot): void;
|
|
513
|
+
/**
|
|
514
|
+
* Opens this item in the appropriate application.
|
|
515
|
+
*/
|
|
516
|
+
open(..._args: unknown[]): unknown;
|
|
517
|
+
/**
|
|
518
|
+
* Returns the path of this item.
|
|
519
|
+
*/
|
|
520
|
+
get path(): string;
|
|
521
|
+
/**
|
|
522
|
+
* Returns path without using this item's alias.
|
|
523
|
+
*/
|
|
524
|
+
get displayPath(): string;
|
|
525
|
+
/**
|
|
526
|
+
* Returns path without using any aliases.
|
|
527
|
+
*/
|
|
528
|
+
get absolutePath(): string;
|
|
529
|
+
/**
|
|
530
|
+
* Returns whether this can be edited in its current state.
|
|
531
|
+
*/
|
|
532
|
+
get canBeEdited(): boolean;
|
|
533
|
+
/**
|
|
534
|
+
* Returns the root folder.
|
|
535
|
+
*/
|
|
536
|
+
getRoot(): VirtualRoot;
|
|
537
|
+
isFile(): this is VirtualFile;
|
|
538
|
+
isFolder(): this is VirtualFolder;
|
|
539
|
+
toJSON(): VirtualBaseJson | null;
|
|
540
|
+
toString(): string | null;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
declare interface VirtualBaseEvents {
|
|
544
|
+
update: [];
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
declare interface VirtualBaseJson {
|
|
548
|
+
nam: string;
|
|
549
|
+
ico?: string;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
declare class VirtualDriveConfig {
|
|
553
|
+
saveData: VirtualDriveConfigOptions["saveData"];
|
|
554
|
+
defaultData: VirtualDriveConfigOptions["defaultData"];
|
|
555
|
+
constructor(options?: Partial<VirtualDriveConfigOptions>);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
declare interface VirtualDriveConfigOptions {
|
|
559
|
+
/**
|
|
560
|
+
* Enables persistent storage of the virtual drive.
|
|
561
|
+
* @default {
|
|
562
|
+
enableCompression: true,
|
|
563
|
+
prefix: "pos-"
|
|
564
|
+
}
|
|
565
|
+
*/
|
|
566
|
+
saveData: false | {
|
|
567
|
+
/**
|
|
568
|
+
* Enables compression of stored items.
|
|
569
|
+
* @default false
|
|
570
|
+
*/
|
|
571
|
+
enableCompression: boolean;
|
|
572
|
+
/**
|
|
573
|
+
* The prefix to prepend to stored keys.
|
|
574
|
+
* @default "pos-"
|
|
575
|
+
*/
|
|
576
|
+
prefix?: string;
|
|
577
|
+
/**
|
|
578
|
+
* An array of tuples of old and new keys to migrate.
|
|
579
|
+
* @default [["data", VirtualDriveStorage.KEY]]
|
|
580
|
+
*/
|
|
581
|
+
migrations?: [string, string][];
|
|
582
|
+
};
|
|
583
|
+
/**
|
|
584
|
+
* Configure the data that is loaded initially when ProzillaOS is opened.
|
|
585
|
+
*/
|
|
586
|
+
defaultData: {
|
|
587
|
+
/**
|
|
588
|
+
* Include pictures folder in default data.
|
|
589
|
+
* @default true
|
|
590
|
+
*/
|
|
591
|
+
includePicturesFolder?: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Include documents folder in default data.
|
|
594
|
+
* @default true
|
|
595
|
+
*/
|
|
596
|
+
includeDocumentsFolder?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* Include desktop folder in default data.
|
|
599
|
+
* @default true
|
|
600
|
+
*/
|
|
601
|
+
includeDesktopFolder?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* Include source tree folder in default data.
|
|
604
|
+
* @default true
|
|
605
|
+
*/
|
|
606
|
+
includeSourceTree?: boolean;
|
|
607
|
+
/**
|
|
608
|
+
* Include apps folder in default data.
|
|
609
|
+
* @default true
|
|
610
|
+
*/
|
|
611
|
+
includeAppsFolder?: boolean;
|
|
612
|
+
loadData?: (virtualRoot: VirtualRoot) => void;
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
declare class VirtualDriveStorage extends Storage_2 {
|
|
617
|
+
virtualDriveConfig: VirtualDriveConfig;
|
|
618
|
+
static readonly KEY = "drive";
|
|
619
|
+
constructor(virtualDriveConfig: VirtualDriveConfig);
|
|
620
|
+
load(key: string): string | null;
|
|
621
|
+
store(key: string, value: string): void;
|
|
622
|
+
synchronize(): void;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* A virtual file that can be stored inside a folder.
|
|
627
|
+
*/
|
|
628
|
+
declare class VirtualFile extends VirtualBase<VirtualFileEvents> {
|
|
629
|
+
/** The extension of this file. */
|
|
630
|
+
extension: OptionalStringProperty;
|
|
631
|
+
/** The URL of the source of this file. */
|
|
632
|
+
source: OptionalStringProperty;
|
|
633
|
+
/** The content of this file. */
|
|
634
|
+
content: OptionalStringProperty;
|
|
635
|
+
static NON_TEXT_EXTENSIONS: string[];
|
|
636
|
+
static readonly CONTENT_CHANGE_EVENT = "contentChange";
|
|
637
|
+
constructor(name: string, extension?: string);
|
|
638
|
+
setAlias(alias: string): this;
|
|
639
|
+
/**
|
|
640
|
+
* Sets the source of this file and removes the content.
|
|
641
|
+
*/
|
|
642
|
+
setSource(source: string): this;
|
|
643
|
+
/**
|
|
644
|
+
* Sets the content of this file and removes the source.
|
|
645
|
+
*/
|
|
646
|
+
setContent(content: string | string[]): this;
|
|
647
|
+
get id(): string;
|
|
648
|
+
static splitId(id: string): {
|
|
649
|
+
name: string;
|
|
650
|
+
extension: OptionalStringProperty;
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* Opens this file in an app associated with its extension.
|
|
654
|
+
*/
|
|
655
|
+
open(windowsManager: WindowsManager): object | null;
|
|
656
|
+
read(): Promise<OptionalStringProperty | undefined>;
|
|
657
|
+
isFile(): this is VirtualFile;
|
|
658
|
+
getIconUrl(): string;
|
|
659
|
+
getType(): string;
|
|
660
|
+
download(): void;
|
|
661
|
+
isDownloadable(): boolean;
|
|
662
|
+
toJSON(): VirtualFileJson | null;
|
|
663
|
+
static removeFileScheme(source: string): string;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
declare interface VirtualFileEvents extends VirtualBaseEvents {
|
|
667
|
+
contentChange: [VirtualFile];
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
declare interface VirtualFileJson extends VirtualBaseJson {
|
|
671
|
+
ext?: string;
|
|
672
|
+
cnt?: string;
|
|
673
|
+
src?: string;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* A link that points to a virtual file.
|
|
678
|
+
*/
|
|
679
|
+
declare class VirtualFileLink extends VirtualFile {
|
|
680
|
+
linkedPath?: string;
|
|
681
|
+
constructor(name: string, linkedFile?: VirtualFile);
|
|
682
|
+
setLinkedFile(file: VirtualFile | null): VirtualFileLink;
|
|
683
|
+
setLinkedPath(path: string): VirtualFileLink;
|
|
684
|
+
isValid(): boolean;
|
|
685
|
+
toJSON(): VirtualFileLinkJson | null;
|
|
686
|
+
setAlias(...args: Parameters<VirtualFile["setAlias"]>): this;
|
|
687
|
+
setSource(...args: Parameters<VirtualFile["setSource"]>): this;
|
|
688
|
+
setContent(...args: Parameters<VirtualFile["setContent"]>): this;
|
|
689
|
+
get id(): string;
|
|
690
|
+
open(...args: Parameters<VirtualFile["open"]>): ReturnType<VirtualFile["open"]>;
|
|
691
|
+
read(...args: Parameters<VirtualFile["read"]>): Promise<string | null | undefined>;
|
|
692
|
+
getIconUrl(...args: Parameters<VirtualFile["getIconUrl"]>): ReturnType<VirtualFile["getIconUrl"]>;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
declare interface VirtualFileLinkJson extends VirtualFileJson {
|
|
696
|
+
lnk: string;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* A virtual folder that can contains files and sub-folders.
|
|
701
|
+
*/
|
|
702
|
+
declare class VirtualFolder<E extends VirtualBaseEvents = VirtualBaseEvents> extends VirtualBase<E> {
|
|
703
|
+
/** The folders inside this folder. */
|
|
704
|
+
subFolders: (VirtualFolder | VirtualFolderLink)[];
|
|
705
|
+
/** The files inside this folder. */
|
|
706
|
+
files: (VirtualFile | VirtualFileLink)[];
|
|
707
|
+
/**
|
|
708
|
+
* The type of this folder.
|
|
709
|
+
* @default VirtualFolder.TYPE.general
|
|
710
|
+
*/
|
|
711
|
+
type: number | undefined;
|
|
712
|
+
static TYPE: {
|
|
713
|
+
general: number;
|
|
714
|
+
media: number;
|
|
715
|
+
};
|
|
716
|
+
constructor(name: string, type?: number);
|
|
717
|
+
setAlias(alias: string): this;
|
|
718
|
+
/**
|
|
719
|
+
* Returns true if this folder contains a file matching a name and extension.
|
|
720
|
+
*/
|
|
721
|
+
hasFile(name: string, extension?: string): boolean;
|
|
722
|
+
/**
|
|
723
|
+
* Returns true if this folder contains a folder matching a name.
|
|
724
|
+
*/
|
|
725
|
+
hasFolder(name: string): boolean;
|
|
726
|
+
/**
|
|
727
|
+
* Finds and returns a file inside this folder matching a name and extension.
|
|
728
|
+
*/
|
|
729
|
+
findFile(name: string, extension?: string | null): VirtualFile | VirtualFileLink | null;
|
|
730
|
+
/**
|
|
731
|
+
* Finds and returns a folder inside this folder matching a name.
|
|
732
|
+
*/
|
|
733
|
+
findSubFolder(name: string): VirtualFolder | VirtualFolderLink | null;
|
|
734
|
+
addFile(file: VirtualFile, confirmChanges?: boolean): this;
|
|
735
|
+
/**
|
|
736
|
+
* Creates a file with a name and extension.
|
|
737
|
+
*/
|
|
738
|
+
createFile(name: string, extension?: string, callback?: (newFile: VirtualFile | VirtualFileLink) => void): this;
|
|
739
|
+
/**
|
|
740
|
+
* Creates files based on an array of objects with file names and extensions.
|
|
741
|
+
*/
|
|
742
|
+
createFiles(files: {
|
|
743
|
+
name: string;
|
|
744
|
+
extension: string;
|
|
745
|
+
}[]): this;
|
|
746
|
+
/**
|
|
747
|
+
* Creates a file link with a name.
|
|
748
|
+
*/
|
|
749
|
+
createFileLink(name: string, callback?: (newFileLink: VirtualFileLink | VirtualFile) => void): this;
|
|
750
|
+
/**
|
|
751
|
+
* Creates file links based on an array of objects with file names and extensions.
|
|
752
|
+
*/
|
|
753
|
+
createFileLinks(fileLinks: {
|
|
754
|
+
name: string;
|
|
755
|
+
}[]): this;
|
|
756
|
+
addFolder(folder: VirtualFolder, confirmChanges?: boolean): this;
|
|
757
|
+
/**
|
|
758
|
+
* Creates a folder with a name.
|
|
759
|
+
*/
|
|
760
|
+
createFolder(name: string, callback?: (newFolder: VirtualFolder) => void): this;
|
|
761
|
+
/**
|
|
762
|
+
* Creates folders based on an array of folder names.
|
|
763
|
+
*/
|
|
764
|
+
createFolders(names: string[]): this;
|
|
765
|
+
/**
|
|
766
|
+
* Creates a folder link with a name.
|
|
767
|
+
*/
|
|
768
|
+
createFolderLink(name: string, callback?: (newFolderLink: VirtualFolderLink | VirtualFolder) => void): this;
|
|
769
|
+
/**
|
|
770
|
+
* Creates folder links based on an array of folder names.
|
|
771
|
+
*/
|
|
772
|
+
createFolderLinks(names: string[]): this;
|
|
773
|
+
/**
|
|
774
|
+
* Removes a file or folder from this folder.
|
|
775
|
+
*/
|
|
776
|
+
remove(child: VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink): this;
|
|
777
|
+
/**
|
|
778
|
+
* Returns the file or folder at a relative path or null if it doesn't exist.
|
|
779
|
+
*/
|
|
780
|
+
navigate(relativePath: string): VirtualFile | VirtualFolder | null;
|
|
781
|
+
navigateToFolder(relativePath: string): VirtualFolder | null;
|
|
782
|
+
navigateToFile(relativePath: string): VirtualFile | null;
|
|
783
|
+
/**
|
|
784
|
+
* Opens this folder in file explorer.
|
|
785
|
+
*/
|
|
786
|
+
open(windowsManager: WindowsManager): object | null | undefined;
|
|
787
|
+
/**
|
|
788
|
+
* Deletes this folder and all its files and sub-folders recursively.
|
|
789
|
+
*/
|
|
790
|
+
delete(): void;
|
|
791
|
+
/**
|
|
792
|
+
* Returns all files inside this folder.
|
|
793
|
+
* @param showHidden - Whether to include hidden files.
|
|
794
|
+
*/
|
|
795
|
+
getFiles(showHidden?: boolean): VirtualFile[];
|
|
796
|
+
/**
|
|
797
|
+
* Returns all sub-folders inside this folder.
|
|
798
|
+
* @param showHidden - Whether to include hidden folders.
|
|
799
|
+
*/
|
|
800
|
+
getSubFolders(showHidden?: boolean): VirtualFolder[];
|
|
801
|
+
/**
|
|
802
|
+
* Returns the amount of files and sub-folders inside this folder.
|
|
803
|
+
* @param includeHidden - Whether to include hidden files and folders in the count.
|
|
804
|
+
*/
|
|
805
|
+
getItemCount(includeHidden?: boolean): number;
|
|
806
|
+
isFolder(): this is VirtualFolder;
|
|
807
|
+
getIconUrl(): string;
|
|
808
|
+
toJSON(): VirtualFolderJson | null;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
declare interface VirtualFolderJson extends VirtualBaseJson {
|
|
812
|
+
fls?: VirtualFileJson[];
|
|
813
|
+
fds?: VirtualFolderJson[];
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* A link that points to a virtual folder.
|
|
818
|
+
*/
|
|
819
|
+
declare class VirtualFolderLink extends VirtualFolder {
|
|
820
|
+
linkedPath?: string;
|
|
821
|
+
constructor(name: string, linkedFolder?: VirtualFolder);
|
|
822
|
+
setLinkedFolder(folder: VirtualFolder | null): VirtualFolderLink;
|
|
823
|
+
setLinkedPath(path: string): VirtualFolderLink;
|
|
824
|
+
isValid(): boolean;
|
|
825
|
+
getIconUrl(): string;
|
|
826
|
+
toJSON(): VirtualFolderLinkJson | null;
|
|
827
|
+
setAlias(...args: Parameters<VirtualFolder["setAlias"]>): this;
|
|
828
|
+
createFile(...args: Parameters<VirtualFolder["createFile"]>): this;
|
|
829
|
+
createFiles(...args: Parameters<VirtualFolder["createFiles"]>): this;
|
|
830
|
+
createFolder(...args: Parameters<VirtualFolder["createFolder"]>): this;
|
|
831
|
+
createFolders(...args: Parameters<VirtualFolder["createFolders"]>): this;
|
|
832
|
+
hasFile(...args: Parameters<VirtualFolder["hasFile"]>): ReturnType<VirtualFolder["hasFile"]>;
|
|
833
|
+
hasFolder(...args: Parameters<VirtualFolder["hasFolder"]>): ReturnType<VirtualFolder["hasFolder"]>;
|
|
834
|
+
findFile(...args: Parameters<VirtualFolder["findFile"]>): ReturnType<VirtualFolder["findFile"]>;
|
|
835
|
+
findSubFolder(...args: Parameters<VirtualFolder["findSubFolder"]>): ReturnType<VirtualFolder["findSubFolder"]>;
|
|
836
|
+
getFiles(...args: Parameters<VirtualFolder["getFiles"]>): ReturnType<VirtualFolder["getFiles"]>;
|
|
837
|
+
getSubFolders(...args: Parameters<VirtualFolder["getSubFolders"]>): ReturnType<VirtualFolder["getSubFolders"]>;
|
|
838
|
+
open(...args: Parameters<VirtualFolder["open"]>): ReturnType<VirtualFolder["open"]>;
|
|
839
|
+
getItemCount(...args: Parameters<VirtualFolder["getItemCount"]>): ReturnType<VirtualFolder["getItemCount"]>;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
declare interface VirtualFolderLinkJson extends VirtualFolderJson {
|
|
843
|
+
lnk: string;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* A virtual folder that serves as the root folder.
|
|
848
|
+
*/
|
|
849
|
+
declare class VirtualRoot extends VirtualFolder<VirtualRootEvents> {
|
|
850
|
+
/** Aliases for files and folders. */
|
|
851
|
+
shortcuts: Record<string, VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink>;
|
|
852
|
+
initiated: boolean;
|
|
853
|
+
loadedDefaultData: boolean;
|
|
854
|
+
systemManager: SystemManager;
|
|
855
|
+
storage: VirtualDriveStorage;
|
|
856
|
+
static readonly ERROR_EVENT = "error";
|
|
857
|
+
constructor(systemManager: SystemManager);
|
|
858
|
+
loadDefaultData(): void;
|
|
859
|
+
loadData(): void;
|
|
860
|
+
/**
|
|
861
|
+
* Calls the storage manager's store function with this root's data as a string.
|
|
862
|
+
*/
|
|
863
|
+
saveData(): void;
|
|
864
|
+
/**
|
|
865
|
+
* Initializes this root by loading the default data and then the user's data on top.
|
|
866
|
+
*/
|
|
867
|
+
init(): VirtualRoot;
|
|
868
|
+
/**
|
|
869
|
+
* Adds a shortcut to a file or folder.
|
|
870
|
+
*/
|
|
871
|
+
addShortcut(name: string, destination: VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink): this;
|
|
872
|
+
/**
|
|
873
|
+
* Tells the storage manager to clear all data and reloads the window.
|
|
874
|
+
*/
|
|
875
|
+
reset(): void;
|
|
876
|
+
static isValidName(_name: string): boolean;
|
|
877
|
+
static isValidFileName(_name: string): boolean;
|
|
878
|
+
static isValidFolderName(_name: string): boolean;
|
|
879
|
+
get path(): string;
|
|
880
|
+
get displayPath(): string;
|
|
881
|
+
toJSON(): VirtualRootJson | null;
|
|
882
|
+
toString(): string | null;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
declare interface VirtualRootEvents extends VirtualBaseEvents {
|
|
886
|
+
error: [{
|
|
887
|
+
message: string;
|
|
888
|
+
}];
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
declare interface VirtualRootJson extends VirtualFolderJson {
|
|
892
|
+
scs: Record<string, string>;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
declare interface WindowOptions {
|
|
896
|
+
/** The ID of the window. */
|
|
897
|
+
id?: string;
|
|
898
|
+
/** The app associated with the window. */
|
|
899
|
+
app?: App;
|
|
900
|
+
/**
|
|
901
|
+
* The size of the window.
|
|
902
|
+
* @default new Vector2(700, 400)
|
|
903
|
+
*/
|
|
904
|
+
size?: Vector2;
|
|
905
|
+
/** The position of the window. */
|
|
906
|
+
position?: Vector2;
|
|
907
|
+
fullscreen?: boolean | string;
|
|
908
|
+
options?: object;
|
|
909
|
+
isFocused?: boolean;
|
|
910
|
+
lastInteraction?: number;
|
|
911
|
+
minimized?: boolean;
|
|
912
|
+
[key: string]: unknown;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
declare interface WindowProps extends WindowOptions {
|
|
916
|
+
/**
|
|
917
|
+
* Whether to start the window in fullscreen mode.
|
|
918
|
+
* @default false
|
|
919
|
+
*/
|
|
920
|
+
fullscreen?: boolean;
|
|
921
|
+
/** Function that sets the title of the window. */
|
|
922
|
+
setTitle?: React.Dispatch<React.SetStateAction<string>>;
|
|
923
|
+
/** Function that sets the icon URL of the window. */
|
|
924
|
+
setIconUrl?: React.Dispatch<React.SetStateAction<string>>;
|
|
925
|
+
/** Function that closes the window. */
|
|
926
|
+
close?: (event?: Event | React.UIEvent<HTMLElement>) => void;
|
|
927
|
+
/** Function that brings the window in focus. */
|
|
928
|
+
focus?: (event?: Event | React.UIEvent<HTMLElement>, force?: boolean) => void;
|
|
929
|
+
/** Whether the window is currently focused and should allow interactions. */
|
|
930
|
+
active?: boolean;
|
|
931
|
+
/** Whether to start the window in minimized mode. */
|
|
932
|
+
minimized?: boolean;
|
|
933
|
+
/** Function that toggles the minimized mode of the window. */
|
|
934
|
+
toggleMinimized?: (event?: Event) => void;
|
|
935
|
+
/** The depth value of the window. */
|
|
936
|
+
index?: number;
|
|
937
|
+
/** Whether the window is in standalone mode. */
|
|
938
|
+
standalone?: boolean;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
declare class WindowsConfig {
|
|
942
|
+
screenMargin: WindowsConfigOptions["screenMargin"];
|
|
943
|
+
titleSeparator: WindowsConfigOptions["titleSeparator"];
|
|
944
|
+
minScreenSize: WindowsConfigOptions["minScreenSize"];
|
|
945
|
+
constructor(options?: Partial<WindowsConfigOptions>);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
declare interface WindowsConfigOptions {
|
|
949
|
+
/**
|
|
950
|
+
* The margin around windows that are not maximized, in pixels.
|
|
951
|
+
* @default 32
|
|
952
|
+
*/
|
|
953
|
+
screenMargin: number;
|
|
954
|
+
/**
|
|
955
|
+
* The separator to use in window titles.
|
|
956
|
+
* @default "-"
|
|
957
|
+
*/
|
|
958
|
+
titleSeparator: string;
|
|
959
|
+
/**
|
|
960
|
+
* If the user's screen is smaller than these values, windows will always be maximized.
|
|
961
|
+
* @default new Vector2(350, 350)
|
|
962
|
+
*/
|
|
963
|
+
minScreenSize: Vector2;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Manages the states of windows.
|
|
968
|
+
*/
|
|
969
|
+
declare class WindowsManager {
|
|
970
|
+
#private;
|
|
971
|
+
windows: {
|
|
972
|
+
[id: string]: WindowOptions;
|
|
973
|
+
};
|
|
974
|
+
/** Function that handles changes to the open windows. */
|
|
975
|
+
updateWindows: (window: WindowsManager["windows"]) => void;
|
|
976
|
+
startupComplete: boolean;
|
|
977
|
+
constructor(systemManager: SystemManager, trackingManager: TrackingManager);
|
|
978
|
+
/**
|
|
979
|
+
* Opens a window for an application.
|
|
980
|
+
* @param appId - The ID of the app.
|
|
981
|
+
*/
|
|
982
|
+
open(appId: string, options?: WindowOptions | null): object | null;
|
|
983
|
+
/**
|
|
984
|
+
* Opens a file with the associated app or by a method specified by the file scheme.
|
|
985
|
+
* @returns Opened window.
|
|
986
|
+
*/
|
|
987
|
+
openFile(file: VirtualFile, options?: object): object | null;
|
|
988
|
+
/**
|
|
989
|
+
* Close a window.
|
|
990
|
+
*/
|
|
991
|
+
close(windowId: string): void;
|
|
992
|
+
/**
|
|
993
|
+
* Focus on a specific window.
|
|
994
|
+
*/
|
|
995
|
+
focus(windowId: string): void;
|
|
996
|
+
/**
|
|
997
|
+
* Check whether a window is focused.
|
|
998
|
+
*/
|
|
999
|
+
isFocused(windowId: string): boolean | undefined;
|
|
1000
|
+
/**
|
|
1001
|
+
* Check if any window is focused.
|
|
1002
|
+
*/
|
|
1003
|
+
isAnyFocused(): boolean;
|
|
1004
|
+
/**
|
|
1005
|
+
* Change the minimized state of a window.
|
|
1006
|
+
* @param windowId - The ID of the window.
|
|
1007
|
+
* @param minimized - Leave as undefined to toggle the window's minimization state.
|
|
1008
|
+
*/
|
|
1009
|
+
setMinimized(windowId: string, minimized?: boolean): void;
|
|
1010
|
+
/**
|
|
1011
|
+
* Minimize all windows.
|
|
1012
|
+
*/
|
|
1013
|
+
minimizeAll(): void;
|
|
1014
|
+
/**
|
|
1015
|
+
* Check if an app has an open window.
|
|
1016
|
+
*/
|
|
1017
|
+
isAppActive(appId: string): boolean;
|
|
1018
|
+
/**
|
|
1019
|
+
* Get an opened window of a certain app.
|
|
1020
|
+
*/
|
|
1021
|
+
getAppWindowId(appId: string): string | null;
|
|
1022
|
+
setUpdateWindows(updateWindows: WindowsManager["updateWindows"]): void;
|
|
1023
|
+
startup(appIds: string[], options: Record<string, unknown>): void;
|
|
1024
|
+
get windowIds(): string[];
|
|
1025
|
+
}
|
|
1026
|
+
|
|
11
1027
|
export { }
|
package/dist/main.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._MediaViewer_vkowo_1{display:flex;justify-content:center;align-items:center;width:100%;height:100%;padding:2rem}._MediaViewer_vkowo_1 img{width:100%;height:100%;object-fit:contain}._VideoViewer_vkowo_16,._AudioViewer_vkowo_16{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}._VideoViewer_vkowo_16 h3{margin:0}._VideoViewer_vkowo_16>*{width:100%;height:100%;border:none;background:transparent}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
|
-
import { useSystemManager as x, useWindowsManager as E, AUDIO_EXTENSIONS as
|
|
3
|
-
import { jsx as r, jsxs as
|
|
4
|
-
import { useRef as
|
|
5
|
-
const
|
|
6
|
-
MediaViewer:
|
|
7
|
-
VideoViewer:
|
|
8
|
-
AudioViewer:
|
|
2
|
+
import { useSystemManager as x, useWindowsManager as E, AUDIO_EXTENSIONS as c, VIDEO_EXTENSIONS as u, AppsConfig as p, MEDIA_EXTENSIONS as w, IMAGE_EXTENSIONS as g, App as _ } from "@prozilla-os/core";
|
|
3
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
import { useRef as d, useEffect as l } from "react";
|
|
5
|
+
const h = "_MediaViewer_vkowo_1", y = "_VideoViewer_vkowo_16", A = "_AudioViewer_vkowo_16", n = {
|
|
6
|
+
MediaViewer: h,
|
|
7
|
+
VideoViewer: y,
|
|
8
|
+
AudioViewer: A
|
|
9
9
|
};
|
|
10
|
-
function
|
|
11
|
-
const { appsConfig:
|
|
12
|
-
if (
|
|
13
|
-
e != null &&
|
|
14
|
-
}, [e, s]),
|
|
10
|
+
function N({ file: e, close: m, setTitle: s }) {
|
|
11
|
+
const { appsConfig: V } = x(), v = E(), o = d(null), i = d(null);
|
|
12
|
+
if (l(() => {
|
|
13
|
+
e != null && s?.(e.id);
|
|
14
|
+
}, [e, s]), l(() => {
|
|
15
15
|
if (!(e == null || e.source == null))
|
|
16
|
-
return e.extension &&
|
|
16
|
+
return e.extension && c.includes(e.extension) && o.current && (o.current.src = e.source, o.current.play()), e.extension && u.includes(e.extension) && i.current && (i.current.src = e.source, i.current.play()), () => {
|
|
17
17
|
o.current && (o.current.pause(), o.current.currentTime = 0), i.current && (i.current.pause(), i.current.currentTime = 0);
|
|
18
18
|
};
|
|
19
19
|
}, [e]), e == null) {
|
|
20
|
-
const
|
|
20
|
+
const t = V.getAppByRole(p.APP_ROLES.fileExplorer);
|
|
21
21
|
return setTimeout(() => {
|
|
22
|
-
|
|
22
|
+
t != null && v?.open(t.id, { path: "~/Pictures" }), m?.();
|
|
23
23
|
}, 10), null;
|
|
24
24
|
}
|
|
25
|
-
return e.extension == null || !
|
|
25
|
+
return e.extension == null || !w.includes(e.extension) ? /* @__PURE__ */ r("p", { children: "Invalid file format." }) : e.source == null ? /* @__PURE__ */ r("p", { children: "File failed to load." }) : g.includes(e.extension) ? /* @__PURE__ */ r("div", { className: n.MediaViewer, children: /* @__PURE__ */ r("img", { src: e.source, alt: e.id, draggable: "false" }) }) : c.includes(e.extension) ? /* @__PURE__ */ r("div", { className: n.AudioViewer, children: /* @__PURE__ */ a("audio", { ref: o, controls: !0, children: [
|
|
26
26
|
/* @__PURE__ */ r("source", { src: e.source, type: `video/${e.extension}` }),
|
|
27
27
|
"Your browser does not support audio."
|
|
28
|
-
] }) }) :
|
|
28
|
+
] }) }) : u.includes(e.extension) ? e.extension === "yt" ? /* @__PURE__ */ r("div", { className: n.VideoViewer, children: /* @__PURE__ */ r(
|
|
29
29
|
"iframe",
|
|
30
30
|
{
|
|
31
31
|
src: e.source.replace("watch?v=", "embed/"),
|
|
@@ -34,14 +34,14 @@ function g({ file: e, close: t, setTitle: s }) {
|
|
|
34
34
|
allowFullScreen: !0,
|
|
35
35
|
allowTransparency: !0
|
|
36
36
|
}
|
|
37
|
-
) }) : /* @__PURE__ */ r("div", { className: n.VideoViewer, children: /* @__PURE__ */
|
|
37
|
+
) }) : /* @__PURE__ */ r("div", { className: n.VideoViewer, children: /* @__PURE__ */ a("video", { ref: i, controls: !0, className: n.VideoPlayer, children: [
|
|
38
38
|
/* @__PURE__ */ r("source", { src: e.source, type: `video/${e.extension}` }),
|
|
39
39
|
"Your browser does not support videos."
|
|
40
40
|
] }) }) : /* @__PURE__ */ r("div", { className: n.MediaViewer, children: /* @__PURE__ */ r("img", { src: e.source, alt: e.id, draggable: "false" }) });
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const M = new _("Media Viewer", "media-viewer", N).setIconUrl("https://os.prozilla.dev/assets/apps/icons/media-viewer.svg").setRole(p.APP_ROLES.mediaViewer).setAssociatedExtensions(w).setCategory("Photo & video");
|
|
43
|
+
M.setMetadata({ name: "@prozilla-os/media-viewer", version: "1.1.19", author: "Prozilla" });
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
M as mediaViewer
|
|
46
46
|
};
|
|
47
47
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/components/MediaViewer.tsx","../src/main.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport styles from \"./MediaViewer.module.css\";\nimport { AppsConfig, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS, useSystemManager, useWindowsManager, VirtualFile, WindowProps, MEDIA_EXTENSIONS } from \"@prozilla-os/core\";\n\nexport interface MediaViewerProps extends WindowProps {\n\tfile?: VirtualFile;\n}\n\nexport function MediaViewer({ file, close, setTitle }: MediaViewerProps) {\n\tconst { appsConfig } = useSystemManager();\n\tconst windowsManager = useWindowsManager();\n\tconst audioRef = useRef<HTMLAudioElement | null>(null);\n\tconst videoRef = useRef<HTMLVideoElement | null>(null);\n\n\tuseEffect(() => {\n\t\tif (file != null)\n\t\t\tsetTitle?.(file.id);\n\t}, [file, setTitle]);\n\n\tuseEffect(() => {\n\t\tif (file == null || file.source == null)\n\t\t\treturn;\n\n\t\tif (file.extension && AUDIO_EXTENSIONS.includes(file.extension)) {\n\t\t\tif (audioRef.current) {\n\t\t\t\taudioRef.current.src = file.source;\n\t\t\t\tvoid audioRef.current.play();\n\t\t\t}\n\t\t}\n\n\t\tif (file.extension && VIDEO_EXTENSIONS.includes(file.extension)) {\n\t\t\tif (videoRef.current) {\n\t\t\t\tvideoRef.current.src = file.source;\n\t\t\t\tvoid videoRef.current.play();\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (audioRef.current) {\n\t\t\t\taudioRef.current.pause();\n\t\t\t\taudioRef.current.currentTime = 0;\n\t\t\t}\n\t\t\tif (videoRef.current) {\n\t\t\t\tvideoRef.current.pause();\n\t\t\t\tvideoRef.current.currentTime = 0;\n\t\t\t}\n\t\t};\n\t}, [file]);\n\n\tif (file == null) {\n\t\tconst fileExplorerApp = appsConfig.getAppByRole(AppsConfig.APP_ROLES.fileExplorer);\n\n\t\tsetTimeout(() => {\n\t\t\tif (fileExplorerApp != null)\n\t\t\t\twindowsManager?.open(fileExplorerApp.id, { path: \"~/Pictures\" });\n\t\t\tclose?.();\n\t\t}, 10);\n\t\treturn null;\n\t}\n\n\tif (file.extension == null || !MEDIA_EXTENSIONS.includes(file.extension)) {\n\t\treturn <p>Invalid file format.</p>;\n\t}\n\n\tif (file.source == null)\n\t\treturn <p>File failed to load.</p>;\n\n\tif (IMAGE_EXTENSIONS.includes(file.extension)) {\n\t\treturn <div className={styles.MediaViewer}>\n\t\t\t<img src={file.source} alt={file.id} draggable=\"false\" />\n\t\t</div>;\n\t} else if (AUDIO_EXTENSIONS.includes(file.extension)) {\n\t\treturn <div className={styles.AudioViewer}>\n\t\t\t<audio ref={audioRef} controls>\n\t\t\t\t<source src={file.source} type={`video/${file.extension}`}/>\n\t\t\t\tYour browser does not support audio.\n\t\t\t</audio> \n\t\t</div>;\n\t} else if (VIDEO_EXTENSIONS.includes(file.extension)) {\n\t\tif (file.extension === \"yt\") {\n\t\t\treturn <div className={styles.VideoViewer}>\n\t\t\t\t<iframe\n\t\t\t\t\tsrc={file.source.replace(\"watch?v=\", \"embed/\")}\n\t\t\t\t\ttitle={file.id}\n\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n\t\t\t\t\tallowFullScreen\n\t\t\t\t\tallowTransparency={true}\n\t\t\t\t/>\n\t\t\t</div>;\n\t\t} else {\n\t\t\treturn <div className={styles.VideoViewer}>\n\t\t\t\t<video ref={videoRef} controls className={styles.VideoPlayer}>\n\t\t\t\t\t<source src={file.source} type={`video/${file.extension}`} />\n\t\t\t\t\tYour browser does not support videos.\n\t\t\t\t</video>\n\t\t\t</div>;\n\t\t}\n\t}\n\n\treturn <div className={styles.MediaViewer}>\n\t\t<img src={file.source} alt={file.id} draggable=\"false\"/>\n\t</div>;\n}","import { App, AppsConfig, MEDIA_EXTENSIONS } from \"@prozilla-os/core\";\nimport { MediaViewer, MediaViewerProps } from \"./components/MediaViewer\";\n\nconst mediaViewer = new App<MediaViewerProps>(\"Media Viewer\", \"media-viewer\", MediaViewer)\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/media-viewer.svg\")\n\t.setRole(AppsConfig.APP_ROLES.mediaViewer)\n\t.setAssociatedExtensions(MEDIA_EXTENSIONS)\n\t.setCategory(\"Photo & video\");\
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/components/MediaViewer.tsx","../src/main.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport styles from \"./MediaViewer.module.css\";\nimport { AppsConfig, IMAGE_EXTENSIONS, VIDEO_EXTENSIONS, AUDIO_EXTENSIONS, useSystemManager, useWindowsManager, VirtualFile, WindowProps, MEDIA_EXTENSIONS } from \"@prozilla-os/core\";\n\nexport interface MediaViewerProps extends WindowProps {\n\tfile?: VirtualFile;\n}\n\nexport function MediaViewer({ file, close, setTitle }: MediaViewerProps) {\n\tconst { appsConfig } = useSystemManager();\n\tconst windowsManager = useWindowsManager();\n\tconst audioRef = useRef<HTMLAudioElement | null>(null);\n\tconst videoRef = useRef<HTMLVideoElement | null>(null);\n\n\tuseEffect(() => {\n\t\tif (file != null)\n\t\t\tsetTitle?.(file.id);\n\t}, [file, setTitle]);\n\n\tuseEffect(() => {\n\t\tif (file == null || file.source == null)\n\t\t\treturn;\n\n\t\tif (file.extension && AUDIO_EXTENSIONS.includes(file.extension)) {\n\t\t\tif (audioRef.current) {\n\t\t\t\taudioRef.current.src = file.source;\n\t\t\t\tvoid audioRef.current.play();\n\t\t\t}\n\t\t}\n\n\t\tif (file.extension && VIDEO_EXTENSIONS.includes(file.extension)) {\n\t\t\tif (videoRef.current) {\n\t\t\t\tvideoRef.current.src = file.source;\n\t\t\t\tvoid videoRef.current.play();\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (audioRef.current) {\n\t\t\t\taudioRef.current.pause();\n\t\t\t\taudioRef.current.currentTime = 0;\n\t\t\t}\n\t\t\tif (videoRef.current) {\n\t\t\t\tvideoRef.current.pause();\n\t\t\t\tvideoRef.current.currentTime = 0;\n\t\t\t}\n\t\t};\n\t}, [file]);\n\n\tif (file == null) {\n\t\tconst fileExplorerApp = appsConfig.getAppByRole(AppsConfig.APP_ROLES.fileExplorer);\n\n\t\tsetTimeout(() => {\n\t\t\tif (fileExplorerApp != null)\n\t\t\t\twindowsManager?.open(fileExplorerApp.id, { path: \"~/Pictures\" });\n\t\t\tclose?.();\n\t\t}, 10);\n\t\treturn null;\n\t}\n\n\tif (file.extension == null || !MEDIA_EXTENSIONS.includes(file.extension)) {\n\t\treturn <p>Invalid file format.</p>;\n\t}\n\n\tif (file.source == null)\n\t\treturn <p>File failed to load.</p>;\n\n\tif (IMAGE_EXTENSIONS.includes(file.extension)) {\n\t\treturn <div className={styles.MediaViewer}>\n\t\t\t<img src={file.source} alt={file.id} draggable=\"false\" />\n\t\t</div>;\n\t} else if (AUDIO_EXTENSIONS.includes(file.extension)) {\n\t\treturn <div className={styles.AudioViewer}>\n\t\t\t<audio ref={audioRef} controls>\n\t\t\t\t<source src={file.source} type={`video/${file.extension}`}/>\n\t\t\t\tYour browser does not support audio.\n\t\t\t</audio> \n\t\t</div>;\n\t} else if (VIDEO_EXTENSIONS.includes(file.extension)) {\n\t\tif (file.extension === \"yt\") {\n\t\t\treturn <div className={styles.VideoViewer}>\n\t\t\t\t<iframe\n\t\t\t\t\tsrc={file.source.replace(\"watch?v=\", \"embed/\")}\n\t\t\t\t\ttitle={file.id}\n\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n\t\t\t\t\tallowFullScreen\n\t\t\t\t\tallowTransparency={true}\n\t\t\t\t/>\n\t\t\t</div>;\n\t\t} else {\n\t\t\treturn <div className={styles.VideoViewer}>\n\t\t\t\t<video ref={videoRef} controls className={styles.VideoPlayer}>\n\t\t\t\t\t<source src={file.source} type={`video/${file.extension}`} />\n\t\t\t\t\tYour browser does not support videos.\n\t\t\t\t</video>\n\t\t\t</div>;\n\t\t}\n\t}\n\n\treturn <div className={styles.MediaViewer}>\n\t\t<img src={file.source} alt={file.id} draggable=\"false\"/>\n\t</div>;\n}","import { App, AppsConfig, MEDIA_EXTENSIONS } from \"@prozilla-os/core\";\nimport { MediaViewer, MediaViewerProps } from \"./components/MediaViewer\";\n\nconst mediaViewer = new App<MediaViewerProps>(\"Media Viewer\", \"media-viewer\", MediaViewer)\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/media-viewer.svg\")\n\t.setRole(AppsConfig.APP_ROLES.mediaViewer)\n\t.setAssociatedExtensions(MEDIA_EXTENSIONS)\n\t.setCategory(\"Photo & video\");\n\nexport { mediaViewer };"],"names":["MediaViewer","file","close","setTitle","appsConfig","useSystemManager","windowsManager","useWindowsManager","audioRef","useRef","videoRef","useEffect","AUDIO_EXTENSIONS","VIDEO_EXTENSIONS","fileExplorerApp","AppsConfig","MEDIA_EXTENSIONS","jsx","IMAGE_EXTENSIONS","styles","jsxs","mediaViewer","App"],"mappings":";;;;;;;;AAQO,SAASA,EAAY,EAAE,MAAAC,GAAM,OAAAC,GAAO,UAAAC,KAA8B;AACxE,QAAM,EAAE,YAAAC,EAAA,IAAeC,EAAA,GACjBC,IAAiBC,EAAA,GACjBC,IAAWC,EAAgC,IAAI,GAC/CC,IAAWD,EAAgC,IAAI;AAqCrD,MAnCAE,EAAU,MAAM;AACf,IAAIV,KAAQ,QACXE,IAAWF,EAAK,EAAE;AAAA,EACpB,GAAG,CAACA,GAAME,CAAQ,CAAC,GAEnBQ,EAAU,MAAM;AACf,QAAI,EAAAV,KAAQ,QAAQA,EAAK,UAAU;AAGnC,aAAIA,EAAK,aAAaW,EAAiB,SAASX,EAAK,SAAS,KACzDO,EAAS,YACZA,EAAS,QAAQ,MAAMP,EAAK,QACvBO,EAAS,QAAQ,KAAA,IAIpBP,EAAK,aAAaY,EAAiB,SAASZ,EAAK,SAAS,KACzDS,EAAS,YACZA,EAAS,QAAQ,MAAMT,EAAK,QACvBS,EAAS,QAAQ,KAAA,IAIjB,MAAM;AACZ,QAAIF,EAAS,YACZA,EAAS,QAAQ,MAAA,GACjBA,EAAS,QAAQ,cAAc,IAE5BE,EAAS,YACZA,EAAS,QAAQ,MAAA,GACjBA,EAAS,QAAQ,cAAc;AAAA,MAEjC;AAAA,EACD,GAAG,CAACT,CAAI,CAAC,GAELA,KAAQ,MAAM;AACjB,UAAMa,IAAkBV,EAAW,aAAaW,EAAW,UAAU,YAAY;AAEjF,sBAAW,MAAM;AAChB,MAAID,KAAmB,QACtBR,GAAgB,KAAKQ,EAAgB,IAAI,EAAE,MAAM,cAAc,GAChEZ,IAAA;AAAA,IACD,GAAG,EAAE,GACE;AAAA,EACR;AAEA,SAAID,EAAK,aAAa,QAAQ,CAACe,EAAiB,SAASf,EAAK,SAAS,IAC/D,gBAAAgB,EAAC,OAAE,UAAA,uBAAA,CAAoB,IAG3BhB,EAAK,UAAU,OACX,gBAAAgB,EAAC,OAAE,UAAA,uBAAA,CAAoB,IAE3BC,EAAiB,SAASjB,EAAK,SAAS,IACpC,gBAAAgB,EAAC,OAAA,EAAI,WAAWE,EAAO,aAC7B,UAAA,gBAAAF,EAAC,OAAA,EAAI,KAAKhB,EAAK,QAAQ,KAAKA,EAAK,IAAI,WAAU,SAAQ,GACxD,IACUW,EAAiB,SAASX,EAAK,SAAS,IAC3C,gBAAAgB,EAAC,OAAA,EAAI,WAAWE,EAAO,aAC7B,4BAAC,SAAA,EAAM,KAAKX,GAAU,UAAQ,IAC7B,UAAA;AAAA,IAAA,gBAAAS,EAAC,UAAA,EAAO,KAAKhB,EAAK,QAAQ,MAAM,SAASA,EAAK,SAAS,GAAA,CAAG;AAAA,IAAE;AAAA,EAAA,EAAA,CAE7D,EAAA,CACD,IACUY,EAAiB,SAASZ,EAAK,SAAS,IAC9CA,EAAK,cAAc,OACf,gBAAAgB,EAAC,OAAA,EAAI,WAAWE,EAAO,aAC7B,UAAA,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,KAAKhB,EAAK,OAAO,QAAQ,YAAY,QAAQ;AAAA,MAC7C,OAAOA,EAAK;AAAA,MACZ,OAAM;AAAA,MACN,iBAAe;AAAA,MACf,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErB,IAEO,gBAAAgB,EAAC,OAAA,EAAI,WAAWE,EAAO,aAC7B,UAAA,gBAAAC,EAAC,SAAA,EAAM,KAAKV,GAAU,UAAQ,IAAC,WAAWS,EAAO,aAChD,UAAA;AAAA,IAAA,gBAAAF,EAAC,UAAA,EAAO,KAAKhB,EAAK,QAAQ,MAAM,SAASA,EAAK,SAAS,GAAA,CAAI;AAAA,IAAE;AAAA,EAAA,EAAA,CAE9D,EAAA,CACD,IAIK,gBAAAgB,EAAC,OAAA,EAAI,WAAWE,EAAO,aAC7B,UAAA,gBAAAF,EAAC,OAAA,EAAI,KAAKhB,EAAK,QAAQ,KAAKA,EAAK,IAAI,WAAU,SAAO,GACvD;AACD;ACnGA,MAAMoB,IAAc,IAAIC,EAAsB,gBAAgB,gBAAgBtB,CAAW,EACvF,WAAW,4DAA4D,EACvE,QAAQe,EAAW,UAAU,WAAW,EACxC,wBAAwBC,CAAgB,EACxC,YAAY,eAAe;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prozilla-os/media-viewer",
|
|
3
3
|
"description": "A ProzillaOS application for viewing different kinds of media.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.21",
|
|
5
5
|
"homepage": "https://os.prozilla.dev/media-viewer",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Prozilla",
|
|
@@ -20,17 +20,19 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"react": "^18.3.1",
|
|
23
|
-
"@prozilla-os/core": "
|
|
23
|
+
"@prozilla-os/core": "2.0.1",
|
|
24
|
+
"@prozilla-os/skins": "1.1.9",
|
|
25
|
+
"@prozilla-os/shared": "1.3.0"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
28
|
"@types/node": "^20.14.5",
|
|
27
|
-
"@types/react": "^18.3.
|
|
29
|
+
"@types/react": "^18.3.27",
|
|
28
30
|
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
29
31
|
"typescript": "^5.5.4",
|
|
30
|
-
"vite": "^
|
|
31
|
-
"vite-plugin-dts": "^
|
|
32
|
+
"vite": "^7.3.1",
|
|
33
|
+
"vite-plugin-dts": "^4.5.4",
|
|
32
34
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
33
|
-
"@prozilla-os/dev-tools": "1.1.
|
|
35
|
+
"@prozilla-os/dev-tools": "1.1.13"
|
|
34
36
|
},
|
|
35
37
|
"files": [
|
|
36
38
|
"dist"
|