@prozilla-os/core 1.3.11 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +186 -186
- package/dist/main.d.ts +14 -0
- package/dist/main.js +4445 -4378
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Sieben De Beule
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Sieben De Beule
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<br />
|
|
3
|
-
<p>
|
|
4
|
-
<a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
|
|
5
|
-
</p>
|
|
6
|
-
<p>
|
|
7
|
-
<a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/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/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/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
|
|
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
|
-
</p>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
## About
|
|
15
|
-
|
|
16
|
-
`@prozilla-os/core` is a React Vite component library written in TypeScript for building web-based operating systems, made by Prozilla.
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
npm install @prozilla-os/core
|
|
22
|
-
yarn add @prozilla-os/core
|
|
23
|
-
pnpm add @prozilla-os/core
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
### Basic setup
|
|
29
|
-
|
|
30
|
-
```tsx
|
|
31
|
-
import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView } from "@prozilla-os/core";
|
|
32
|
-
|
|
33
|
-
function App() {
|
|
34
|
-
return (
|
|
35
|
-
<ProzillaOS systemName="Example" tagLine="Powered by ProzillaOS">
|
|
36
|
-
<Taskbar/>
|
|
37
|
-
<WindowsView/>
|
|
38
|
-
<ModalsView/>
|
|
39
|
-
<Desktop/>
|
|
40
|
-
</ProzillaOS>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
<br />
|
|
46
|
-
|
|
47
|
-
### Configuration
|
|
48
|
-
|
|
49
|
-
```tsx
|
|
50
|
-
interface ProzillaOSProps {
|
|
51
|
-
|
|
52
|
-
systemName: string,
|
|
53
|
-
|
|
54
|
-
tagLine: string,
|
|
55
|
-
|
|
56
|
-
skin: new Skin({
|
|
57
|
-
|
|
58
|
-
appIcons: Record<number, string> | undefined,
|
|
59
|
-
|
|
60
|
-
appNames: Record<number, string> | undefined,
|
|
61
|
-
|
|
62
|
-
wallpapers: string[],
|
|
63
|
-
|
|
64
|
-
defaultWallpaper: string,
|
|
65
|
-
|
|
66
|
-
fileIcons: {
|
|
67
|
-
generic: string;
|
|
68
|
-
info: string | undefined;
|
|
69
|
-
text: string | undefined;
|
|
70
|
-
code: string | undefined;
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
folderIcons: {
|
|
74
|
-
generic: string;
|
|
75
|
-
images: string | undefined;
|
|
76
|
-
text: string | undefined;
|
|
77
|
-
link: string | undefined;
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
loadStyleSheet: () => void | undefined
|
|
81
|
-
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
config: {
|
|
85
|
-
apps: new AppsConfig({
|
|
86
|
-
|
|
87
|
-
apps: App[]
|
|
88
|
-
|
|
89
|
-
}),
|
|
90
|
-
desktop: new DesktopConfig({
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @default 1
|
|
94
|
-
*/
|
|
95
|
-
defaultIconSize: 0 | 1 | 2,
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 0: vertical, 1: horizontal
|
|
99
|
-
* @default 0
|
|
100
|
-
* */
|
|
101
|
-
defaultIconDirection: 0 | 1
|
|
102
|
-
|
|
103
|
-
}),
|
|
104
|
-
misc: new MiscConfig({
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @default 250
|
|
108
|
-
*/
|
|
109
|
-
doubleClickDelay: number
|
|
110
|
-
|
|
111
|
-
})
|
|
112
|
-
modals: new ModalsConfig({
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Default size of a dialog box
|
|
116
|
-
* @default new Vector2(400, 200)
|
|
117
|
-
*/
|
|
118
|
-
defaultDialogSize: Vector2,
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Default size of a file selector
|
|
122
|
-
* @default new Vector2(700, 400)
|
|
123
|
-
*/
|
|
124
|
-
defaultFileSelectorSize: Vector2
|
|
125
|
-
|
|
126
|
-
}),
|
|
127
|
-
taskbar: new TaskbarConfig({
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Height of the taskbar in CSS pixels
|
|
131
|
-
* @default 3 * 16
|
|
132
|
-
*/
|
|
133
|
-
height: number
|
|
134
|
-
|
|
135
|
-
}),
|
|
136
|
-
tracking: new TrackingConfig({
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Enable tracking
|
|
140
|
-
* @default true
|
|
141
|
-
*/
|
|
142
|
-
enabled: boolean,
|
|
143
|
-
|
|
144
|
-
/** Google Analytics measurement ID */
|
|
145
|
-
GAMeasurementId: string
|
|
146
|
-
|
|
147
|
-
}),
|
|
148
|
-
windows: new WindowsConfig({
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* @default 32
|
|
152
|
-
*/
|
|
153
|
-
screenMargin: number,
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @default "-"
|
|
157
|
-
*/
|
|
158
|
-
titleSeparator: string,
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* If the user's screen is smaller than these values, windows will always be maximized
|
|
162
|
-
* @default new Vector2(350, 350)
|
|
163
|
-
*/
|
|
164
|
-
minScreenSize: Vector2
|
|
165
|
-
|
|
166
|
-
})
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## Links
|
|
173
|
-
|
|
174
|
-
- [Demo][demo]
|
|
175
|
-
- [Docs][docs]
|
|
176
|
-
- [GitHub][github]
|
|
177
|
-
- [npm][npm]
|
|
178
|
-
- [Discord][discord]
|
|
179
|
-
- [Ko-fi][ko-fi]
|
|
180
|
-
|
|
181
|
-
[demo]: https://os.prozilla.dev/
|
|
182
|
-
[docs]: https://os.prozilla.dev/docs/reference/core
|
|
183
|
-
[github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/core
|
|
184
|
-
[npm]: https://www.npmjs.com/package/@prozilla-os/core
|
|
185
|
-
[discord]: https://discord.gg/JwbyQP4tdz
|
|
186
|
-
[ko-fi]: https://ko-fi.com/prozilla
|
|
1
|
+
<div align="center">
|
|
2
|
+
<br />
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
|
|
5
|
+
</p>
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/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/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/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
|
|
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
|
+
</p>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
## About
|
|
15
|
+
|
|
16
|
+
`@prozilla-os/core` is a React Vite component library written in TypeScript for building web-based operating systems, made by Prozilla.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install @prozilla-os/core
|
|
22
|
+
yarn add @prozilla-os/core
|
|
23
|
+
pnpm add @prozilla-os/core
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Basic setup
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView } from "@prozilla-os/core";
|
|
32
|
+
|
|
33
|
+
function App() {
|
|
34
|
+
return (
|
|
35
|
+
<ProzillaOS systemName="Example" tagLine="Powered by ProzillaOS">
|
|
36
|
+
<Taskbar/>
|
|
37
|
+
<WindowsView/>
|
|
38
|
+
<ModalsView/>
|
|
39
|
+
<Desktop/>
|
|
40
|
+
</ProzillaOS>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
<br />
|
|
46
|
+
|
|
47
|
+
### Configuration
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
interface ProzillaOSProps {
|
|
51
|
+
|
|
52
|
+
systemName: string,
|
|
53
|
+
|
|
54
|
+
tagLine: string,
|
|
55
|
+
|
|
56
|
+
skin: new Skin({
|
|
57
|
+
|
|
58
|
+
appIcons: Record<number, string> | undefined,
|
|
59
|
+
|
|
60
|
+
appNames: Record<number, string> | undefined,
|
|
61
|
+
|
|
62
|
+
wallpapers: string[],
|
|
63
|
+
|
|
64
|
+
defaultWallpaper: string,
|
|
65
|
+
|
|
66
|
+
fileIcons: {
|
|
67
|
+
generic: string;
|
|
68
|
+
info: string | undefined;
|
|
69
|
+
text: string | undefined;
|
|
70
|
+
code: string | undefined;
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
folderIcons: {
|
|
74
|
+
generic: string;
|
|
75
|
+
images: string | undefined;
|
|
76
|
+
text: string | undefined;
|
|
77
|
+
link: string | undefined;
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
loadStyleSheet: () => void | undefined
|
|
81
|
+
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
config: {
|
|
85
|
+
apps: new AppsConfig({
|
|
86
|
+
|
|
87
|
+
apps: App[]
|
|
88
|
+
|
|
89
|
+
}),
|
|
90
|
+
desktop: new DesktopConfig({
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @default 1
|
|
94
|
+
*/
|
|
95
|
+
defaultIconSize: 0 | 1 | 2,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 0: vertical, 1: horizontal
|
|
99
|
+
* @default 0
|
|
100
|
+
* */
|
|
101
|
+
defaultIconDirection: 0 | 1
|
|
102
|
+
|
|
103
|
+
}),
|
|
104
|
+
misc: new MiscConfig({
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @default 250
|
|
108
|
+
*/
|
|
109
|
+
doubleClickDelay: number
|
|
110
|
+
|
|
111
|
+
})
|
|
112
|
+
modals: new ModalsConfig({
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Default size of a dialog box
|
|
116
|
+
* @default new Vector2(400, 200)
|
|
117
|
+
*/
|
|
118
|
+
defaultDialogSize: Vector2,
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Default size of a file selector
|
|
122
|
+
* @default new Vector2(700, 400)
|
|
123
|
+
*/
|
|
124
|
+
defaultFileSelectorSize: Vector2
|
|
125
|
+
|
|
126
|
+
}),
|
|
127
|
+
taskbar: new TaskbarConfig({
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Height of the taskbar in CSS pixels
|
|
131
|
+
* @default 3 * 16
|
|
132
|
+
*/
|
|
133
|
+
height: number
|
|
134
|
+
|
|
135
|
+
}),
|
|
136
|
+
tracking: new TrackingConfig({
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Enable tracking
|
|
140
|
+
* @default true
|
|
141
|
+
*/
|
|
142
|
+
enabled: boolean,
|
|
143
|
+
|
|
144
|
+
/** Google Analytics measurement ID */
|
|
145
|
+
GAMeasurementId: string
|
|
146
|
+
|
|
147
|
+
}),
|
|
148
|
+
windows: new WindowsConfig({
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @default 32
|
|
152
|
+
*/
|
|
153
|
+
screenMargin: number,
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @default "-"
|
|
157
|
+
*/
|
|
158
|
+
titleSeparator: string,
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* If the user's screen is smaller than these values, windows will always be maximized
|
|
162
|
+
* @default new Vector2(350, 350)
|
|
163
|
+
*/
|
|
164
|
+
minScreenSize: Vector2
|
|
165
|
+
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Links
|
|
173
|
+
|
|
174
|
+
- [Demo][demo]
|
|
175
|
+
- [Docs][docs]
|
|
176
|
+
- [GitHub][github]
|
|
177
|
+
- [npm][npm]
|
|
178
|
+
- [Discord][discord]
|
|
179
|
+
- [Ko-fi][ko-fi]
|
|
180
|
+
|
|
181
|
+
[demo]: https://os.prozilla.dev/
|
|
182
|
+
[docs]: https://os.prozilla.dev/docs/reference/core
|
|
183
|
+
[github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/core
|
|
184
|
+
[npm]: https://www.npmjs.com/package/@prozilla-os/core
|
|
185
|
+
[discord]: https://discord.gg/JwbyQP4tdz
|
|
186
|
+
[ko-fi]: https://ko-fi.com/prozilla
|
package/dist/main.d.ts
CHANGED
|
@@ -213,6 +213,8 @@ declare interface AppsConfigOptions {
|
|
|
213
213
|
apps: App<WindowProps>[];
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
export declare const AUDIO_EXTENSIONS: string[];
|
|
217
|
+
|
|
216
218
|
export declare function Button({ className, href, children, icon, target, ...props }: ButtonProps): JSX_2.Element;
|
|
217
219
|
|
|
218
220
|
declare interface ButtonProps {
|
|
@@ -283,6 +285,8 @@ declare interface DirectoryListProps {
|
|
|
283
285
|
|
|
284
286
|
export declare function Divider(): JSX_2.Element;
|
|
285
287
|
|
|
288
|
+
export declare function downloadUrl(url: string, name: string): void;
|
|
289
|
+
|
|
286
290
|
export declare function DropdownAction({ label, icon, children, showOnHover }: DropdownActionProps): ReactElement;
|
|
287
291
|
|
|
288
292
|
declare interface DropdownActionProps extends ActionProps {
|
|
@@ -374,6 +378,8 @@ declare interface InteractableProps {
|
|
|
374
378
|
|
|
375
379
|
export declare function isValidUrl(string: string): boolean;
|
|
376
380
|
|
|
381
|
+
export declare const MEDIA_EXTENSIONS: string[];
|
|
382
|
+
|
|
377
383
|
export declare class MiscConfig {
|
|
378
384
|
doubleClickDelay: MiscConfigOptions["doubleClickDelay"];
|
|
379
385
|
constructor(options?: Partial<MiscConfigOptions>);
|
|
@@ -659,6 +665,8 @@ declare interface SkinOptions {
|
|
|
659
665
|
text?: string;
|
|
660
666
|
code?: string;
|
|
661
667
|
external?: string;
|
|
668
|
+
video?: string;
|
|
669
|
+
audio?: string;
|
|
662
670
|
};
|
|
663
671
|
/**
|
|
664
672
|
* URLs of icons for types of folders
|
|
@@ -668,6 +676,8 @@ declare interface SkinOptions {
|
|
|
668
676
|
images?: string;
|
|
669
677
|
text?: string;
|
|
670
678
|
link?: string;
|
|
679
|
+
video?: string;
|
|
680
|
+
audio?: string;
|
|
671
681
|
};
|
|
672
682
|
/**
|
|
673
683
|
* Function that dynamically imports style sheet
|
|
@@ -942,6 +952,8 @@ export declare class Vector2 {
|
|
|
942
952
|
static lerp(vector2A: Vector2, vector2B: Vector2, t: number): Vector2;
|
|
943
953
|
}
|
|
944
954
|
|
|
955
|
+
export declare const VIDEO_EXTENSIONS: string[];
|
|
956
|
+
|
|
945
957
|
declare class VirtualBase extends EventEmitter<EventNamesMap> {
|
|
946
958
|
name: string;
|
|
947
959
|
alias: string | undefined | null;
|
|
@@ -1074,6 +1086,8 @@ export declare class VirtualFile extends VirtualBase {
|
|
|
1074
1086
|
isFile(): boolean;
|
|
1075
1087
|
getIconUrl(): string;
|
|
1076
1088
|
getType(): string;
|
|
1089
|
+
download(): void;
|
|
1090
|
+
isDownloadable(): boolean;
|
|
1077
1091
|
toJSON(): VirtualFileJson | null;
|
|
1078
1092
|
static removeFileScheme(source: string): string;
|
|
1079
1093
|
}
|