@prozilla-os/core 1.2.4 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -26
- package/dist/main.d.ts +19 -48
- package/dist/main.js +16278 -15007
- package/dist/main.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
## About
|
|
14
|
+
## About
|
|
15
15
|
|
|
16
16
|
`@prozilla-os/core` is a React Vite component library written in TypeScript for building web-based operating systems, made by Prozilla.
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
npm install @prozilla-os/core
|
|
22
|
+
yarn add @prozilla-os/core
|
|
23
|
+
pnpm add @prozilla-os/core
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
@@ -57,27 +57,27 @@ interface ProzillaOSProps {
|
|
|
57
57
|
|
|
58
58
|
appIcons: Record<number, string> | undefined,
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
appNames: Record<number, string> | undefined,
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
wallpapers: string[],
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
defaultWallpaper: string,
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
fileIcons: {
|
|
67
|
+
generic: string;
|
|
68
|
+
info: string | undefined;
|
|
69
|
+
text: string | undefined;
|
|
70
|
+
code: string | undefined;
|
|
71
|
+
},
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
folderIcons: {
|
|
74
|
+
generic: string;
|
|
75
|
+
images: string | undefined;
|
|
76
|
+
text: string | undefined;
|
|
77
|
+
link: string | undefined;
|
|
78
|
+
},
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
loadStyleSheet: () => void | undefined
|
|
81
81
|
|
|
82
82
|
})
|
|
83
83
|
|
|
@@ -101,14 +101,14 @@ interface ProzillaOSProps {
|
|
|
101
101
|
defaultIconDirection: 0 | 1
|
|
102
102
|
|
|
103
103
|
}),
|
|
104
|
-
|
|
104
|
+
misc: new MiscConfig({
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
* @default 250
|
|
108
|
+
*/
|
|
109
|
+
doubleClickDelay: number
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
})
|
|
112
112
|
modals: new ModalsConfig({
|
|
113
113
|
|
|
114
114
|
/**
|
|
@@ -183,4 +183,4 @@ interface ProzillaOSProps {
|
|
|
183
183
|
[github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/core
|
|
184
184
|
[npm]: https://www.npmjs.com/package/@prozilla-os/core
|
|
185
185
|
[discord]: https://discord.gg/JwbyQP4tdz
|
|
186
|
-
[ko-fi]: https://ko-fi.com/prozilla
|
|
186
|
+
[ko-fi]: https://ko-fi.com/prozilla
|
package/dist/main.d.ts
CHANGED
|
@@ -55,25 +55,6 @@ declare interface AlertParams {
|
|
|
55
55
|
single?: boolean;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export declare const ANSI: {
|
|
59
|
-
fg: {
|
|
60
|
-
black: string;
|
|
61
|
-
red: string;
|
|
62
|
-
green: string;
|
|
63
|
-
yellow: string;
|
|
64
|
-
blue: string;
|
|
65
|
-
magenta: string;
|
|
66
|
-
cyan: string;
|
|
67
|
-
white: string;
|
|
68
|
-
};
|
|
69
|
-
bg: {};
|
|
70
|
-
decoration: {
|
|
71
|
-
dim: string;
|
|
72
|
-
bold: string;
|
|
73
|
-
};
|
|
74
|
-
reset: string;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
58
|
/**
|
|
78
59
|
* An application that can be ran by ProzillaOS
|
|
79
60
|
* Applications can be installed by adding them to the `apps` array in {@link AppsConfig}
|
|
@@ -198,8 +179,6 @@ declare interface ButtonProps {
|
|
|
198
179
|
[key: string]: unknown;
|
|
199
180
|
}
|
|
200
181
|
|
|
201
|
-
export declare function clamp(value: number, min: number, max: number): number;
|
|
202
|
-
|
|
203
182
|
export declare const ClickAction: MemoExoticComponent<({ actionId, label, shortcut, disabled, onTrigger, icon }: ClickActionProps) => JSX_2.Element>;
|
|
204
183
|
|
|
205
184
|
declare interface ClickActionProps extends ActionProps {
|
|
@@ -216,6 +195,8 @@ export declare const CODE_EXTENSIONS: string[];
|
|
|
216
195
|
|
|
217
196
|
export declare function copyToClipboard(string: string, onSuccess?: (value: void) => void, onFail?: (value: void) => void): void;
|
|
218
197
|
|
|
198
|
+
export declare function DefaultRoute(): JSX_2.Element;
|
|
199
|
+
|
|
219
200
|
export declare const Desktop: MemoExoticComponent<() => JSX_2.Element>;
|
|
220
201
|
|
|
221
202
|
export declare class DesktopConfig {
|
|
@@ -273,7 +254,7 @@ export declare function DropdownButton({ label, options, shortcuts }: {
|
|
|
273
254
|
};
|
|
274
255
|
}): JSX_2.Element;
|
|
275
256
|
|
|
276
|
-
|
|
257
|
+
declare class EventEmitter<EventMap extends EventNamesMap> {
|
|
277
258
|
#private;
|
|
278
259
|
static EVENT_NAMES: EventNamesMap;
|
|
279
260
|
/**
|
|
@@ -290,28 +271,14 @@ export declare class EventEmitter<EventMap extends EventNamesMap> {
|
|
|
290
271
|
emit<Key extends keyof EventMap>(eventName: Key, data?: unknown): void;
|
|
291
272
|
}
|
|
292
273
|
|
|
293
|
-
|
|
274
|
+
declare type EventNamesMap = Record<string, string>;
|
|
294
275
|
|
|
295
276
|
export declare type FileEventHandler = (event: Event, file: VirtualFile) => void;
|
|
296
277
|
|
|
297
278
|
export declare type FolderEventHandler = (event: Event, folder: VirtualFolder) => void;
|
|
298
279
|
|
|
299
|
-
/**
|
|
300
|
-
* Format a time relative to now
|
|
301
|
-
* @param date - The date
|
|
302
|
-
* @param maxLength - The maximum amount of units, e.g.: 3 => years, months, days
|
|
303
|
-
*/
|
|
304
|
-
export declare function formatRelativeTime(date: Date, maxLength: number | undefined, allowAffixes: boolean): string;
|
|
305
|
-
|
|
306
280
|
export declare function formatShortcut(shortcut: string[]): string;
|
|
307
281
|
|
|
308
|
-
/**
|
|
309
|
-
* Format a time
|
|
310
|
-
* @param time - Time in milliseconds
|
|
311
|
-
* @param maxLength - The maximum amount of units, e.g.: 3 => years, months, days
|
|
312
|
-
*/
|
|
313
|
-
export declare function formatTime(time: number, maxLength: number | undefined, allowAffixes: boolean): string;
|
|
314
|
-
|
|
315
282
|
export declare function generateUrl(options: generateUrlOptions): string;
|
|
316
283
|
|
|
317
284
|
declare interface generateUrlOptions {
|
|
@@ -352,8 +319,6 @@ declare interface InteractableProps {
|
|
|
352
319
|
[key: string]: unknown;
|
|
353
320
|
}
|
|
354
321
|
|
|
355
|
-
export declare function isValidInteger(number: number | string): number | boolean;
|
|
356
|
-
|
|
357
322
|
export declare function isValidUrl(string: string): boolean;
|
|
358
323
|
|
|
359
324
|
export declare class MiscConfig {
|
|
@@ -453,6 +418,8 @@ declare type ModalsManagerState = ModalsManager | undefined;
|
|
|
453
418
|
|
|
454
419
|
export declare const ModalsView: MemoExoticComponent<() => JSX_2.Element>;
|
|
455
420
|
|
|
421
|
+
export declare function NoRoute(): JSX_2.Element;
|
|
422
|
+
|
|
456
423
|
export declare interface OnSelectionChangeParams {
|
|
457
424
|
files?: string[];
|
|
458
425
|
folders?: string[];
|
|
@@ -539,22 +506,20 @@ declare interface RadioActionProps extends ActionProps {
|
|
|
539
506
|
initialIndex: number;
|
|
540
507
|
}
|
|
541
508
|
|
|
542
|
-
export declare function randomFromArray<Type>(array: Type[]): Type;
|
|
543
|
-
|
|
544
|
-
export declare function randomRange(min: number, max: number): number;
|
|
545
|
-
|
|
546
509
|
/**
|
|
547
510
|
* Reloads the viewport
|
|
548
511
|
*/
|
|
549
512
|
export declare function reloadViewport(): void;
|
|
550
513
|
|
|
551
|
-
export declare function removeDuplicatesFromArray<Type>(array: Type[]): Type[];
|
|
552
|
-
|
|
553
|
-
export declare function removeFromArray<Type>(item: Type, array: Type[]): void;
|
|
554
|
-
|
|
555
514
|
export declare function removeUrlProtocol(url: string): string;
|
|
556
515
|
|
|
557
|
-
export declare function
|
|
516
|
+
export declare function Router({ path, homePage, fallbackPage }: RouterProps): JSX_2.Element;
|
|
517
|
+
|
|
518
|
+
declare interface RouterProps {
|
|
519
|
+
path?: string;
|
|
520
|
+
homePage?: JSX.Element;
|
|
521
|
+
fallbackPage?: JSX.Element;
|
|
522
|
+
}
|
|
558
523
|
|
|
559
524
|
declare class Settings {
|
|
560
525
|
#private;
|
|
@@ -653,6 +618,12 @@ declare interface SkinOptions {
|
|
|
653
618
|
loadStyleSheet?: () => void;
|
|
654
619
|
}
|
|
655
620
|
|
|
621
|
+
export declare function StandaloneRoute({ app }: StandaloneRouteProps): JSX_2.Element;
|
|
622
|
+
|
|
623
|
+
declare interface StandaloneRouteProps {
|
|
624
|
+
app: App;
|
|
625
|
+
}
|
|
626
|
+
|
|
656
627
|
declare class StorageManager_2 {
|
|
657
628
|
static MAX_BYTES: number;
|
|
658
629
|
static store(key: string, value: string): void;
|