prozilla-os 1.0.12 → 1.0.14

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 CHANGED
@@ -13,7 +13,9 @@
13
13
 
14
14
  ## About
15
15
 
16
- `prozilla-os` is a React component library written in TypeScript for building web-based operating systems, made by Prozilla.
16
+ `prozilla-os` is a React Vite component library written in TypeScript for building web-based operating systems, made by Prozilla. This package combines multiple other packages for easy access to different ProzillaOS features. You can also download these packages separately instead.
17
+
18
+ **Live demo: [os.prozilla.dev][website]** - [(source)][website-source]
17
19
 
18
20
  ## Installation
19
21
 
@@ -23,8 +25,21 @@ $ yarn add prozilla-os
23
25
  $ pnpm add prozilla-os
24
26
  ```
25
27
 
28
+ ## Packages
29
+
30
+ `prozilla-os` combines the following packages into one:
31
+
32
+ - [`@prozilla-os/core`][core] - Core functionality, React components and hooks
33
+ - [`@prozilla-os/file-explorer`][file-explorer] - File explorer app
34
+ - [`@prozilla-os/terminal`][terminal] - Terminal/shell app
35
+ - [`@prozilla-os/text-editor`][text-editor] - Text editor app
36
+
26
37
  ## Usage
27
38
 
39
+ For more information about the in-depth usage of each package, check out the links in the section above.
40
+
41
+ ### Basic setup
42
+
28
43
  ```tsx
29
44
  import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView } from "prozilla-os";
30
45
 
@@ -158,6 +173,11 @@ function App() {
158
173
  - [Ko-fi][ko-fi]
159
174
 
160
175
  [website]: https://os.prozilla.dev/
176
+ [website-source]: https://github.com/prozilla-os/ProzillaOS
161
177
  [github]: https://github.com/prozilla-os/ProzillaOS/tree/convert-to-monorepo/packages/prozilla-os
162
178
  [npm]: https://www.npmjs.com/package/prozilla-os
163
- [ko-fi]: https://ko-fi.com/prozilla
179
+ [ko-fi]: https://ko-fi.com/prozilla
180
+ [core]: https://www.npmjs.com/package/@prozilla-os/core
181
+ [file-explorer]: https://www.npmjs.com/package/@prozilla-os/file-explorer
182
+ [terminal]: https://www.npmjs.com/package/@prozilla-os/terminal
183
+ [text-editor]: https://www.npmjs.com/package/@prozilla-os/text-editor
package/dist/main.d.ts CHANGED
@@ -73,39 +73,95 @@ export declare const ANSI: {
73
73
  reset: string;
74
74
  };
75
75
 
76
+ /**
77
+ * An application that can be ran by ProzillaOS
78
+ * Applications can be installed by adding them to the `apps` array in {@link AppsConfig}
79
+ */
76
80
  export declare class App<AppProps extends WindowProps = WindowProps> {
81
+ /**
82
+ * The display name of this application
83
+ */
77
84
  name: string;
85
+ /**
86
+ * The unique ID of this application
87
+ */
78
88
  id: string;
89
+ /**
90
+ * Main component that renders this app inside a window
91
+ */
79
92
  windowContent: FC<AppProps>;
93
+ /**
94
+ * Default options that get passed to the {@link this.windowContent} component
95
+ */
80
96
  windowOptions?: {
81
97
  size: Vector2;
82
98
  [key: string]: unknown;
83
99
  };
100
+ /**
101
+ * Description of this application
102
+ */
84
103
  description: string | null;
104
+ /**
105
+ * URL of the icon of this application
106
+ */
85
107
  iconUrl: string | null;
86
- isActive: boolean;
87
- isPinned?: boolean;
88
108
  /**
89
- * @param windowOptions - Default window options
109
+ * Defines what the app can handle and how it can be used elsewhere in the system
90
110
  */
111
+ role: string | null;
112
+ /**
113
+ * An array of file extensions that this application can interpret
114
+ */
115
+ associatedExtensions: string[];
116
+ isActive: boolean;
117
+ isPinned?: boolean;
91
118
  constructor(name: App["name"], id: App["id"], windowContent: App<AppProps>["windowContent"], windowOptions?: App["windowOptions"]);
92
119
  WindowContent: (props: AppProps) => JSX_2.Element | null;
120
+ /**
121
+ * Set the display name of this application
122
+ */
123
+ setName(name: string): this;
124
+ /**
125
+ * Set the description of this application
126
+ */
93
127
  setDescription(description: App["description"]): this;
128
+ /**
129
+ * Set the URL of the icon of this application
130
+ */
94
131
  setIconUrl(iconUrl: App["iconUrl"]): this;
95
- setName(name: string): this;
132
+ /**
133
+ * Set the role of this application
134
+ */
135
+ setRole(role: string | null): this;
136
+ /**
137
+ * Set the associated extensions of this application
138
+ */
139
+ setAssociatedExtensions(extensions: string[] | null): this;
96
140
  }
97
141
 
98
142
  export declare class AppsConfig {
99
143
  apps: AppsConfigOptions["apps"];
144
+ static APP_ROLES: {
145
+ FileExplorer: string;
146
+ Terminal: string;
147
+ TextEditor: string;
148
+ };
100
149
  constructor(options?: OptionalInterface<AppsConfigOptions>);
101
150
  getAppById(id: string): App | null;
102
151
  /**
103
152
  * Get the app associated with a file extension
104
153
  */
105
154
  getAppByFileExtension(fileExtension: string): App | null;
155
+ /**
156
+ * Get the app with a specific role
157
+ */
158
+ getAppByRole(role: string): App | null;
106
159
  }
107
160
 
108
161
  declare interface AppsConfigOptions {
162
+ /**
163
+ * An array of applications
164
+ */
109
165
  apps: App<any>[];
110
166
  }
111
167
 
@@ -164,10 +220,6 @@ declare interface DesktopConfigOptions {
164
220
  defaultIconDirection: 0 | 1;
165
221
  }
166
222
 
167
- export declare const DIALOG_CONTENT_TYPES: {
168
- closeButton: number;
169
- };
170
-
171
223
  export declare function DialogBox({ modal, params, children, ...props }: ModalProps): JSX_2.Element;
172
224
 
173
225
  export declare function DirectoryList({ directory, showHidden, folderClassName, fileClassName, className, onContextMenuFile, onContextMenuFolder, onOpenFile, onOpenFolder, allowMultiSelect, onSelectionChange, ...props }: DirectoryListProps): ReactElement | null;
@@ -352,6 +404,9 @@ export declare interface ModalProps {
352
404
  export declare class ModalsConfig {
353
405
  defaultDialogSize: ModalsConfigOptions["defaultDialogSize"];
354
406
  defaultFileSelectorSize: ModalsConfigOptions["defaultFileSelectorSize"];
407
+ static DIALOG_CONTENT_TYPES: {
408
+ CloseButton: number;
409
+ };
355
410
  constructor(options?: OptionalInterface<ModalsConfigOptions>);
356
411
  }
357
412
 
@@ -984,7 +1039,7 @@ export declare class VirtualFolder extends VirtualBase {
984
1039
  /**
985
1040
  * Opens this folder in file explorer
986
1041
  */
987
- open(windowsManager: WindowsManager): object | null;
1042
+ open(windowsManager: WindowsManager): object | null | undefined;
988
1043
  /**
989
1044
  * Deletes this folder and all its files and sub-folders recursively
990
1045
  */