@prozilla-os/core 1.0.7
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.md +21 -0
- package/README.md +1 -0
- package/package.json +43 -0
- package/src/components/_utils/button/Button.module.css +25 -0
- package/src/components/_utils/button/Button.tsx +48 -0
- package/src/components/_utils/directory-list/DirectoryList.module.css +70 -0
- package/src/components/_utils/directory-list/DirectoryList.tsx +203 -0
- package/src/components/_utils/directory-list/ImagePreview.module.css +19 -0
- package/src/components/_utils/directory-list/ImagePreview.tsx +33 -0
- package/src/components/_utils/dropdown-button/DropdownButton.module.css +60 -0
- package/src/components/_utils/dropdown-button/DropdownButton.tsx +40 -0
- package/src/components/_utils/header-menu/HeaderMenu.module.css +8 -0
- package/src/components/_utils/header-menu/HeaderMenu.tsx +15 -0
- package/src/components/_utils/index.ts +10 -0
- package/src/components/_utils/interactable/Interactable.tsx +42 -0
- package/src/components/_utils/progress-bar/ProgressBar.module.css +20 -0
- package/src/components/_utils/progress-bar/ProgressBar.tsx +22 -0
- package/src/components/_utils/web-view/WebView.module.css +15 -0
- package/src/components/_utils/web-view/WebView.tsx +47 -0
- package/src/components/actions/Actions.module.css +281 -0
- package/src/components/actions/Actions.tsx +108 -0
- package/src/components/actions/actions/ClickAction.tsx +30 -0
- package/src/components/actions/actions/Divider.tsx +5 -0
- package/src/components/actions/actions/DropdownAction.tsx +50 -0
- package/src/components/actions/actions/RadioAction.tsx +50 -0
- package/src/components/actions/actions/TextDisplay.tsx +12 -0
- package/src/components/actions/actions/ToggleAction.tsx +31 -0
- package/src/components/actions/index.ts +7 -0
- package/src/components/desktop/Desktop.module.css +49 -0
- package/src/components/desktop/Desktop.tsx +199 -0
- package/src/components/index.ts +10 -0
- package/src/components/modals/ModalView.module.css +14 -0
- package/src/components/modals/ModalView.tsx +54 -0
- package/src/components/modals/ModalsView.module.css +4 -0
- package/src/components/modals/ModalsView.tsx +32 -0
- package/src/components/modals/_utils/WindowedModal.module.css +92 -0
- package/src/components/modals/_utils/WindowedModal.tsx +71 -0
- package/src/components/modals/dialog-box/DialogBox.module.css +27 -0
- package/src/components/modals/dialog-box/DialogBox.tsx +26 -0
- package/src/components/modals/file-selector/FileSelector.module.css +25 -0
- package/src/components/modals/file-selector/FileSelector.tsx +77 -0
- package/src/components/modals/index.ts +7 -0
- package/src/components/modals/share/Option.tsx +23 -0
- package/src/components/modals/share/Share.module.css +153 -0
- package/src/components/modals/share/Share.tsx +197 -0
- package/src/components/prozilla-os/ProzillaOS.module.css +14 -0
- package/src/components/prozilla-os/ProzillaOS.tsx +76 -0
- package/src/components/taskbar/Taskbar.module.css +218 -0
- package/src/components/taskbar/Taskbar.tsx +193 -0
- package/src/components/taskbar/app-icon/AppIcon.module.css +62 -0
- package/src/components/taskbar/app-icon/AppIcon.tsx +76 -0
- package/src/components/taskbar/indicators/Battery.module.css +32 -0
- package/src/components/taskbar/indicators/Battery.tsx +114 -0
- package/src/components/taskbar/indicators/Calendar.module.css +24 -0
- package/src/components/taskbar/indicators/Calendar.tsx +67 -0
- package/src/components/taskbar/indicators/Network.module.css +17 -0
- package/src/components/taskbar/indicators/Network.tsx +38 -0
- package/src/components/taskbar/indicators/Volume.module.css +17 -0
- package/src/components/taskbar/indicators/Volume.tsx +38 -0
- package/src/components/taskbar/indicators/index.ts +4 -0
- package/src/components/taskbar/menus/AppList.module.css +33 -0
- package/src/components/taskbar/menus/HomeMenu.module.css +47 -0
- package/src/components/taskbar/menus/HomeMenu.tsx +118 -0
- package/src/components/taskbar/menus/SearchMenu.module.css +68 -0
- package/src/components/taskbar/menus/SearchMenu.tsx +100 -0
- package/src/components/taskbar/menus/UtilMenu.module.css +41 -0
- package/src/components/taskbar/menus/UtilMenu.tsx +23 -0
- package/src/components/windows/WindowFallbackView.tsx +38 -0
- package/src/components/windows/WindowView.module.css +152 -0
- package/src/components/windows/WindowView.tsx +233 -0
- package/src/components/windows/WindowsView.tsx +89 -0
- package/src/constants/index.ts +3 -0
- package/src/constants/modals.const.ts +3 -0
- package/src/constants/themes.const.ts +8 -0
- package/src/constants/utils.const.ts +19 -0
- package/src/constants/virtualDrive.const.ts +20 -0
- package/src/features/_utils/array.utils.ts +14 -0
- package/src/features/_utils/browser.utils.ts +111 -0
- package/src/features/_utils/date.utils.ts +90 -0
- package/src/features/_utils/event.utils.ts +39 -0
- package/src/features/_utils/index.ts +8 -0
- package/src/features/_utils/math.utils.ts +18 -0
- package/src/features/_utils/number.utils.ts +3 -0
- package/src/features/_utils/string.utils.ts +31 -0
- package/src/features/_utils/time.utils.ts +13 -0
- package/src/features/actions/actionsManager.ts +7 -0
- package/src/features/index.ts +12 -0
- package/src/features/math/vector2.ts +75 -0
- package/src/features/modals/modal.ts +74 -0
- package/src/features/modals/modalsManager.ts +72 -0
- package/src/features/settings/settings.ts +109 -0
- package/src/features/settings/settingsManager.ts +31 -0
- package/src/features/storage/storageManager.ts +35 -0
- package/src/features/system/configs/app.tsx +60 -0
- package/src/features/system/configs/appsConfig.ts +60 -0
- package/src/features/system/configs/desktopConfig.ts +46 -0
- package/src/features/system/configs/index.ts +9 -0
- package/src/features/system/configs/miscConfig.ts +19 -0
- package/src/features/system/configs/modalsConfig.ts +28 -0
- package/src/features/system/configs/taskbarConfig.ts +19 -0
- package/src/features/system/configs/trackingConfig.ts +24 -0
- package/src/features/system/configs/virtualDriveConfig.ts +39 -0
- package/src/features/system/configs/windowsConfig.ts +34 -0
- package/src/features/system/systemManager.ts +68 -0
- package/src/features/tracking/trackingManager.ts +40 -0
- package/src/features/virtual-drive/file/index.ts +2 -0
- package/src/features/virtual-drive/file/virtualFile.ts +197 -0
- package/src/features/virtual-drive/file/virtualFileLink.ts +111 -0
- package/src/features/virtual-drive/folder/index.ts +2 -0
- package/src/features/virtual-drive/folder/virtualFolder.ts +388 -0
- package/src/features/virtual-drive/folder/virtualFolderLink.ts +148 -0
- package/src/features/virtual-drive/index.ts +3 -0
- package/src/features/virtual-drive/root/defaultData.ts +140 -0
- package/src/features/virtual-drive/root/virtualRoot.ts +244 -0
- package/src/features/virtual-drive/virtualBase.ts +191 -0
- package/src/features/windows/windowsManager.ts +244 -0
- package/src/features/z-index/zIndexGroup.ts +40 -0
- package/src/features/z-index/zIndexManager.ts +46 -0
- package/src/hooks/_utils/history.ts +50 -0
- package/src/hooks/_utils/index.ts +6 -0
- package/src/hooks/_utils/keyboard.ts +111 -0
- package/src/hooks/_utils/mouse.ts +32 -0
- package/src/hooks/_utils/outsideClick.tsx +33 -0
- package/src/hooks/_utils/screen.ts +61 -0
- package/src/hooks/_utils/scrollWithShadows.ts +138 -0
- package/src/hooks/apps/appFolder.ts +30 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/modals/alert.tsx +34 -0
- package/src/hooks/modals/contextMenu.tsx +47 -0
- package/src/hooks/modals/index.ts +4 -0
- package/src/hooks/modals/modalsContext.ts +10 -0
- package/src/hooks/modals/modalsManagerContext.ts +10 -0
- package/src/hooks/modals/modalsManagerProvider.tsx +16 -0
- package/src/hooks/modals/modalsProvider.tsx +20 -0
- package/src/hooks/modals/windowedModal.ts +47 -0
- package/src/hooks/settings/settingsManagerContext.ts +10 -0
- package/src/hooks/settings/settingsManagerProvider.tsx +16 -0
- package/src/hooks/system/systemManagerContext.ts +8 -0
- package/src/hooks/system/systemManagerProvider.tsx +26 -0
- package/src/hooks/themes/themes.tsx +22 -0
- package/src/hooks/tracking/trackingManagerContext.ts +10 -0
- package/src/hooks/tracking/trackingManagerProvider.tsx +13 -0
- package/src/hooks/virtual-drive/virtualRootContext.ts +10 -0
- package/src/hooks/virtual-drive/virtualRootProvider.tsx +13 -0
- package/src/hooks/windows/windowsContext.ts +10 -0
- package/src/hooks/windows/windowsManagerContext.ts +10 -0
- package/src/hooks/windows/windowsManagerProvider.tsx +24 -0
- package/src/hooks/windows/windowsProvider.tsx +20 -0
- package/src/hooks/z-index/zIndex.ts +32 -0
- package/src/hooks/z-index/zIndexManagerContext.ts +10 -0
- package/src/hooks/z-index/zIndexManagerProvider.tsx +11 -0
- package/src/index.ts +5 -0
- package/src/styles/global/fonts.css +18 -0
- package/src/styles/global/scrollbar.css +29 -0
- package/src/styles/global/themes.css +67 -0
- package/src/styles/global/variables.css +92 -0
- package/src/styles/global.css +65 -0
- package/src/styles/index.ts +3 -0
- package/src/styles/utils.module.css +22 -0
- package/src/types/util.d.ts +3 -0
- package/src/types/vite-env.d.ts +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DialogBox } from "./dialog-box/DialogBox";
|
|
2
|
+
export { WindowedModal } from "./_utils/WindowedModal";
|
|
3
|
+
export { FileSelector } from "./file-selector/FileSelector";
|
|
4
|
+
export { Share } from "./share/Share";
|
|
5
|
+
export { ModalsView } from "./ModalsView";
|
|
6
|
+
|
|
7
|
+
export type { ModalProps } from "./ModalView";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChangeEventHandler, useState } from "react";
|
|
2
|
+
import styles from "./Share.module.css";
|
|
3
|
+
|
|
4
|
+
interface OptionProps {
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
setOption: Function;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function Option({ name, label, setOption }: OptionProps) {
|
|
11
|
+
const [value, setValue] = useState("");
|
|
12
|
+
|
|
13
|
+
const onChange = (event: Event) => {
|
|
14
|
+
const newValue = (event.target as HTMLInputElement).value;
|
|
15
|
+
setValue(newValue);
|
|
16
|
+
setOption(name, newValue);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return <label className={styles.Label}>
|
|
20
|
+
<p>{label}:</p>
|
|
21
|
+
<input className={styles.Input} name={name} type="text" value={value} onChange={onChange as unknown as ChangeEventHandler}/>
|
|
22
|
+
</label>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
.Share {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
padding: 1rem 0;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.Top, .Bottom {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: flex-start;
|
|
16
|
+
align-items: flex-start;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.Share > .Top {
|
|
21
|
+
flex-grow: 1;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.Title {
|
|
26
|
+
margin-top: 0;
|
|
27
|
+
margin-left: 1rem;
|
|
28
|
+
font-size: 1.5rem;
|
|
29
|
+
pointer-events: auto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.FormContainer {
|
|
33
|
+
position: relative;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.Form {
|
|
41
|
+
--margin: 1rem;
|
|
42
|
+
|
|
43
|
+
position: absolute;
|
|
44
|
+
display: flex;
|
|
45
|
+
gap: 0.5rem;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
width: calc(100% - var(--margin) * 2);
|
|
50
|
+
height: 100%;
|
|
51
|
+
margin: 0 var(--margin);
|
|
52
|
+
overflow-x: hidden;
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
pointer-events: auto;
|
|
55
|
+
z-index: -1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.Label {
|
|
59
|
+
--gap: 0.5rem;
|
|
60
|
+
|
|
61
|
+
display: flex;
|
|
62
|
+
gap: var(--gap);
|
|
63
|
+
align-items: center;
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 1.75rem;
|
|
66
|
+
min-height: 1.75rem;
|
|
67
|
+
z-index: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.Label > p {
|
|
71
|
+
width: calc(40% - var(--gap));
|
|
72
|
+
min-width: 40%;
|
|
73
|
+
margin: 0;
|
|
74
|
+
text-align: start;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.Input {
|
|
78
|
+
width: auto;
|
|
79
|
+
max-width: calc(60% - var(--gap));
|
|
80
|
+
padding: 0.25rem 0.5rem;
|
|
81
|
+
height: 100%;
|
|
82
|
+
color: var(--text-color);
|
|
83
|
+
background-color: var(--background-color-1);
|
|
84
|
+
border: none;
|
|
85
|
+
border-radius: var(--border-radius-1);
|
|
86
|
+
outline: none;
|
|
87
|
+
font-size: 0.875em;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
select.Input > * {
|
|
91
|
+
color: inherit;
|
|
92
|
+
background-color: inherit;
|
|
93
|
+
border: none;
|
|
94
|
+
border-radius: var(--border-radius-1);
|
|
95
|
+
outline: none;
|
|
96
|
+
font-family: inherit;
|
|
97
|
+
font-size: inherit;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.Input:disabled ~ div, .Input:disabled ~ p {
|
|
101
|
+
opacity: 0.25;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.Input[type=checkbox] {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.Checkbox {
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
align-items: center;
|
|
112
|
+
width: auto;
|
|
113
|
+
height: 87.5%;
|
|
114
|
+
aspect-ratio: 1;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.Checkbox > svg {
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 100%;
|
|
121
|
+
object-fit: contain;
|
|
122
|
+
fill: var(--background-color-0);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.Checkbox > svg > * {
|
|
126
|
+
fill: inherit;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.Share > .Bottom {
|
|
130
|
+
gap: 0.5rem;
|
|
131
|
+
flex-direction: row;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
align-items: center;
|
|
134
|
+
margin: 0.75rem 1rem 0;
|
|
135
|
+
pointer-events: auto;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.Url {
|
|
139
|
+
margin: 0;
|
|
140
|
+
text-align: start;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
text-overflow: ellipsis;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.Button {
|
|
147
|
+
--normal-color: var(--background-color-0) !important;
|
|
148
|
+
--hover-color: var(--background-color-1) !important;
|
|
149
|
+
|
|
150
|
+
padding: 0.5rem 1rem;
|
|
151
|
+
border-radius: var(--border-radius-1);
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { ChangeEventHandler, MutableRefObject, ReactEventHandler, UIEventHandler, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { ModalsManager } from "../../../features/modals/modalsManager";
|
|
3
|
+
import { WindowedModal } from "../_utils/WindowedModal";
|
|
4
|
+
import styles from "./Share.module.css";
|
|
5
|
+
import { copyToClipboard, generateUrl } from "../../../features/_utils/browser.utils";
|
|
6
|
+
import utilStyles from "../../../styles/utils.module.css";
|
|
7
|
+
import { Button } from "../../_utils/button/Button";
|
|
8
|
+
import { Option } from "./Option";
|
|
9
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
10
|
+
import { faSquare } from "@fortawesome/free-regular-svg-icons";
|
|
11
|
+
import { faSquareCheck } from "@fortawesome/free-solid-svg-icons";
|
|
12
|
+
import { useAlert } from "../../../hooks/modals/alert";
|
|
13
|
+
import { ModalProps } from "../ModalView";
|
|
14
|
+
import { useScrollWithShadow } from "../../../hooks/_utils/scrollWithShadows";
|
|
15
|
+
import { useSystemManager } from "../../../hooks";
|
|
16
|
+
|
|
17
|
+
const APP_OPTIONS: Record<string, { label: string, name: string }[]> = {
|
|
18
|
+
"terminal": [
|
|
19
|
+
{
|
|
20
|
+
label: "Command",
|
|
21
|
+
name: "input"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Path",
|
|
25
|
+
name: "path"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"browser": [
|
|
29
|
+
{
|
|
30
|
+
label: "Website",
|
|
31
|
+
name: "url"
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
"file-explorer": [
|
|
35
|
+
{
|
|
36
|
+
label: "Path",
|
|
37
|
+
name: "path"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"text-editor": [
|
|
41
|
+
{
|
|
42
|
+
label: "Path",
|
|
43
|
+
name: "path"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export function Share({ modal, params, ...props }: ModalProps) {
|
|
49
|
+
const { appsConfig } = useSystemManager();
|
|
50
|
+
const [appId, setAppId] = useState<string>(params?.appId ?? "");
|
|
51
|
+
const [fullscreen, setFullscreen] = useState<boolean>(params?.fullscreen ?? false);
|
|
52
|
+
const [standalone, setStandalone] = useState<boolean>(params?.standalone ?? false);
|
|
53
|
+
const [options, setOptions] = useState({});
|
|
54
|
+
const [url, setUrl] = useState<string | null>(null);
|
|
55
|
+
const { alert } = useAlert();
|
|
56
|
+
const formRef = useRef<HTMLFormElement>(null);
|
|
57
|
+
const { boxShadow, onUpdate } = useScrollWithShadow({
|
|
58
|
+
ref: formRef as MutableRefObject<HTMLFormElement>,
|
|
59
|
+
horizontal: false,
|
|
60
|
+
dynamicOffsetFactor: 1,
|
|
61
|
+
shadow: {
|
|
62
|
+
offset: 20,
|
|
63
|
+
blurRadius: 10,
|
|
64
|
+
spreadRadius: -10,
|
|
65
|
+
color: { a: 25 },
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
setUrl(generateUrl({
|
|
71
|
+
appId: appId !== "" ? appId : undefined,
|
|
72
|
+
fullscreen,
|
|
73
|
+
standalone,
|
|
74
|
+
...options
|
|
75
|
+
}));
|
|
76
|
+
}, [appId, fullscreen, standalone, options]);
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
onUpdate({ target: formRef.current as unknown as HTMLElement });
|
|
80
|
+
}, [appId]);
|
|
81
|
+
|
|
82
|
+
const onAppIdChange = (event: Event) => {
|
|
83
|
+
const newAppId = (event.target as HTMLInputElement).value;
|
|
84
|
+
|
|
85
|
+
if (newAppId === appId)
|
|
86
|
+
return;
|
|
87
|
+
|
|
88
|
+
setAppId(newAppId);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const onFullscreenChange = (event: Event) => {
|
|
92
|
+
const newFullscreen = (event.target as HTMLInputElement).checked;
|
|
93
|
+
setFullscreen(newFullscreen);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const onStandaloneChange = (event: Event) => {
|
|
97
|
+
const newStandalone = (event.target as HTMLInputElement).checked;
|
|
98
|
+
setStandalone(newStandalone);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const setOption = (name: string, value: string) => {
|
|
102
|
+
setOptions((options: Record<string, string> = {}) => {
|
|
103
|
+
options = { ...options };
|
|
104
|
+
options[name] = value;
|
|
105
|
+
return options;
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return <WindowedModal className={styles.Share} modal={modal} params={{
|
|
110
|
+
...params,
|
|
111
|
+
title: "Share",
|
|
112
|
+
iconUrl: ModalsManager.getModalIconUrl("share"),
|
|
113
|
+
}} {...props}>
|
|
114
|
+
<div className={styles.Top}>
|
|
115
|
+
<h1 className={styles.Title}>Share options</h1>
|
|
116
|
+
<div className={styles.FormContainer} style={{ boxShadow }}>
|
|
117
|
+
<form
|
|
118
|
+
className={styles.Form}
|
|
119
|
+
onScroll={onUpdate as unknown as UIEventHandler}
|
|
120
|
+
onResize={onUpdate as unknown as ReactEventHandler}
|
|
121
|
+
ref={formRef}
|
|
122
|
+
>
|
|
123
|
+
<label className={styles.Label}>
|
|
124
|
+
<p>App:</p>
|
|
125
|
+
<select className={styles.Input} name="app" value={appId} onChange={onAppIdChange as unknown as ChangeEventHandler}>
|
|
126
|
+
<option value={""}>(None)</option>
|
|
127
|
+
{appsConfig.apps.map(({ name, id }) =>
|
|
128
|
+
<option key={id} value={id}>{name}</option>
|
|
129
|
+
)}
|
|
130
|
+
</select>
|
|
131
|
+
</label>
|
|
132
|
+
{appId !== "" ? <label className={styles.Label}>
|
|
133
|
+
<p>Standalone:</p>
|
|
134
|
+
<input
|
|
135
|
+
className={styles.Input}
|
|
136
|
+
name="standalone"
|
|
137
|
+
type="checkbox"
|
|
138
|
+
checked={standalone}
|
|
139
|
+
value={standalone.toString()}
|
|
140
|
+
onChange={onStandaloneChange as unknown as ChangeEventHandler}
|
|
141
|
+
/>
|
|
142
|
+
<div className={styles.Checkbox}>
|
|
143
|
+
{standalone
|
|
144
|
+
? <FontAwesomeIcon icon={faSquareCheck}/>
|
|
145
|
+
: <FontAwesomeIcon icon={faSquare}/>
|
|
146
|
+
}
|
|
147
|
+
</div>
|
|
148
|
+
</label> : null}
|
|
149
|
+
{appId !== "" ? <label className={styles.Label}>
|
|
150
|
+
<input
|
|
151
|
+
className={styles.Input}
|
|
152
|
+
name="fullscreen"
|
|
153
|
+
type="checkbox"
|
|
154
|
+
checked={fullscreen}
|
|
155
|
+
disabled={standalone}
|
|
156
|
+
value={fullscreen.toString()}
|
|
157
|
+
onChange={onFullscreenChange as unknown as ChangeEventHandler}
|
|
158
|
+
/>
|
|
159
|
+
<p>Fullscreen:</p>
|
|
160
|
+
<div className={styles.Checkbox}>
|
|
161
|
+
{fullscreen
|
|
162
|
+
? <FontAwesomeIcon icon={faSquareCheck}/>
|
|
163
|
+
: <FontAwesomeIcon icon={faSquare}/>
|
|
164
|
+
}
|
|
165
|
+
</div>
|
|
166
|
+
</label> : null}
|
|
167
|
+
{APP_OPTIONS[appId]?.map(({ label, name }) =>
|
|
168
|
+
<Option key={name} name={name} label={label} setOption={setOption}/>
|
|
169
|
+
)}
|
|
170
|
+
</form>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
<div className={styles.Bottom}>
|
|
174
|
+
<p className={`${styles.Url} ${utilStyles.TextLight}`}>{url}</p>
|
|
175
|
+
<Button
|
|
176
|
+
className={`${styles.Button} ${utilStyles.TextBold}`}
|
|
177
|
+
onClick={() => {
|
|
178
|
+
copyToClipboard(url as string, () => {
|
|
179
|
+
alert({
|
|
180
|
+
title: "Share",
|
|
181
|
+
iconUrl: ModalsManager.getModalIconUrl("share"),
|
|
182
|
+
text: "Copied to clipboard!",
|
|
183
|
+
});
|
|
184
|
+
}, () => {
|
|
185
|
+
alert({
|
|
186
|
+
title: "Share",
|
|
187
|
+
iconUrl: ModalsManager.getModalIconUrl("share"),
|
|
188
|
+
text: "Failed to copy.",
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}}
|
|
192
|
+
>
|
|
193
|
+
Copy
|
|
194
|
+
</Button>
|
|
195
|
+
</div>
|
|
196
|
+
</WindowedModal>;
|
|
197
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { memo, ReactElement, ReactNode } from "react";
|
|
2
|
+
import styles from "./ProzillaOS.module.css";
|
|
3
|
+
import { VirtualRootProvider } from "../../hooks/virtual-drive/virtualRootProvider";
|
|
4
|
+
import { ZIndexManagerProvider } from "../../hooks/z-index/zIndexManagerProvider";
|
|
5
|
+
import { WindowsManagerProvider } from "../../hooks/windows/windowsManagerProvider";
|
|
6
|
+
import { ModalsManagerProvider } from "../../hooks/modals/modalsManagerProvider";
|
|
7
|
+
import { SettingsManagerProvider } from "../../hooks/settings/settingsManagerProvider";
|
|
8
|
+
import { ThemeProvider } from "../../hooks/themes/themes";
|
|
9
|
+
import { SystemManagerParams } from "../../features/system/systemManager";
|
|
10
|
+
import { SystemManagerProvider } from "../../hooks/system/systemManagerProvider";
|
|
11
|
+
import { DesktopConfig, DesktopConfigOptions } from "../../features/system/configs/desktopConfig";
|
|
12
|
+
import { AppsConfig, AppsConfigOptions } from "../../features/system/configs/appsConfig";
|
|
13
|
+
import { MiscConfig, MiscConfigOptions } from "../../features/system/configs/miscConfig";
|
|
14
|
+
import { ModalsConfig, ModalsConfigOptions } from "../../features/system/configs/modalsConfig";
|
|
15
|
+
import { TaskbarConfig, TaskbarConfigOptions } from "../../features/system/configs/taskbarConfig";
|
|
16
|
+
import { TrackingConfig, TrackingConfigOptions } from "../../features/system/configs/trackingConfig";
|
|
17
|
+
import { WindowsConfig, WindowsConfigOptions } from "../../features/system/configs/windowsConfig";
|
|
18
|
+
import { OptionalInterface } from "../../types/util";
|
|
19
|
+
import { TrackingManagerProvider } from "../../hooks/tracking/trackingManagerProvider";
|
|
20
|
+
import { VirtualDriveConfig, VirtualDriveConfigOptions } from "../../features/system/configs/virtualDriveConfig";
|
|
21
|
+
|
|
22
|
+
interface ProzillaOSProps {
|
|
23
|
+
systemName?: string;
|
|
24
|
+
tagLine?: string;
|
|
25
|
+
config?: {
|
|
26
|
+
apps?: OptionalInterface<AppsConfigOptions>;
|
|
27
|
+
desktop?: OptionalInterface<DesktopConfigOptions>;
|
|
28
|
+
misc?: OptionalInterface<MiscConfigOptions>;
|
|
29
|
+
modals?: OptionalInterface<ModalsConfigOptions>;
|
|
30
|
+
taskbar?: OptionalInterface<TaskbarConfigOptions>;
|
|
31
|
+
tracking?: OptionalInterface<TrackingConfigOptions>;
|
|
32
|
+
windows?: OptionalInterface<WindowsConfigOptions>;
|
|
33
|
+
virtualDrive?: OptionalInterface<VirtualDriveConfigOptions>;
|
|
34
|
+
}
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const ProzillaOS = memo(function(props: ProzillaOSProps): ReactElement {
|
|
39
|
+
const { systemName, tagLine, config, children } = props;
|
|
40
|
+
|
|
41
|
+
const systemParams = {
|
|
42
|
+
systemName,
|
|
43
|
+
tagLine,
|
|
44
|
+
appsConfig: new AppsConfig(config?.apps),
|
|
45
|
+
desktopConfig: new DesktopConfig(config?.desktop),
|
|
46
|
+
miscConfig: new MiscConfig(config?.misc),
|
|
47
|
+
modalsConfig: new ModalsConfig(config?.modals),
|
|
48
|
+
taskbarConfig: new TaskbarConfig(config?.taskbar),
|
|
49
|
+
trackingConfig: new TrackingConfig(config?.tracking),
|
|
50
|
+
windowsConfig: new WindowsConfig(config?.windows),
|
|
51
|
+
virtualDriveConfig: new VirtualDriveConfig(config?.virtualDrive),
|
|
52
|
+
} as SystemManagerParams;
|
|
53
|
+
|
|
54
|
+
return <SystemManagerProvider {...systemParams}>
|
|
55
|
+
<VirtualRootProvider>
|
|
56
|
+
<ZIndexManagerProvider>
|
|
57
|
+
<TrackingManagerProvider>
|
|
58
|
+
<WindowsManagerProvider>
|
|
59
|
+
<ModalsManagerProvider>
|
|
60
|
+
<SettingsManagerProvider>
|
|
61
|
+
<ThemeProvider>
|
|
62
|
+
<div
|
|
63
|
+
onContextMenu={(event) => { event.preventDefault(); }}
|
|
64
|
+
className={styles.ProzillaOS}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</div>
|
|
68
|
+
</ThemeProvider>
|
|
69
|
+
</SettingsManagerProvider>
|
|
70
|
+
</ModalsManagerProvider>
|
|
71
|
+
</WindowsManagerProvider>
|
|
72
|
+
</TrackingManagerProvider>
|
|
73
|
+
</ZIndexManagerProvider>
|
|
74
|
+
</VirtualRootProvider>
|
|
75
|
+
</SystemManagerProvider>;
|
|
76
|
+
});
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
.Taskbar {
|
|
2
|
+
--svg-drop-shadow-color: var(--taskbar-color);
|
|
3
|
+
|
|
4
|
+
position: fixed;
|
|
5
|
+
display: flex;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: var(--taskbar-height);
|
|
10
|
+
margin-bottom: env(safe-area-inset-bottom);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.Taskbar::after,
|
|
14
|
+
.Taskbar::before {
|
|
15
|
+
content: "";
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
bottom: calc(env(safe-area-inset-bottom, 0) * -1);
|
|
19
|
+
left: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.Taskbar::after {
|
|
25
|
+
opacity: var(--taskbar-opacity);
|
|
26
|
+
background-color: var(--taskbar-color);
|
|
27
|
+
z-index: -2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.Taskbar::before {
|
|
31
|
+
backdrop-filter: var(--taskbar-filter);
|
|
32
|
+
z-index: -3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.Taskbar button {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
color: var(--foreground-color-0);
|
|
39
|
+
background: none;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
border: none;
|
|
42
|
+
outline: none;
|
|
43
|
+
transition: background-color 100ms ease-in-out;
|
|
44
|
+
z-index: -1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.Taskbar button:hover,
|
|
48
|
+
.Taskbar button:focus-visible {
|
|
49
|
+
background-color: var(--taskbar-button-hover-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.HomeContainer,
|
|
53
|
+
.SearchContainer {
|
|
54
|
+
position: relative;
|
|
55
|
+
padding: 0 !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.HomeContainer,
|
|
59
|
+
.HomeContainer > div,
|
|
60
|
+
.SearchContainer,
|
|
61
|
+
.SearchContainer > div {
|
|
62
|
+
height: 100%;
|
|
63
|
+
width: auto;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.HomeButton * {
|
|
67
|
+
fill: var(--foreground-color-0);
|
|
68
|
+
filter: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.MenuIcons,
|
|
72
|
+
.AppIcons {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
height: 100%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.AppIconsContainer {
|
|
79
|
+
position: relative;
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: auto;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.AppIcons {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
overflow-x: auto;
|
|
93
|
+
overflow-y: hidden;
|
|
94
|
+
pointer-events: auto;
|
|
95
|
+
z-index: -1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.AppIcons::-webkit-scrollbar {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.AppIcons > *,
|
|
103
|
+
.MenuButton {
|
|
104
|
+
height: 100%;
|
|
105
|
+
padding: 0.75rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.AppIcons > * > svg,
|
|
109
|
+
.MenuButton > svg {
|
|
110
|
+
height: 1.25rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.AppIcons > button div,
|
|
114
|
+
.AppIcons > button div > svg,
|
|
115
|
+
.MenuButton div,
|
|
116
|
+
.MenuButton div > svg {
|
|
117
|
+
height: 100%;
|
|
118
|
+
width: auto;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.UtilIcons {
|
|
122
|
+
display: flex;
|
|
123
|
+
gap: 0;
|
|
124
|
+
justify-content: flex-end;
|
|
125
|
+
align-items: center;
|
|
126
|
+
height: 100%;
|
|
127
|
+
margin-left: auto;
|
|
128
|
+
padding-left: 0.5rem;
|
|
129
|
+
z-index: -1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.UtilIcons > div {
|
|
133
|
+
height: 100%;
|
|
134
|
+
width: min-content;
|
|
135
|
+
z-index: -1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.UtilIcons > button,
|
|
139
|
+
.UtilIcons > div > button {
|
|
140
|
+
height: 100%;
|
|
141
|
+
width: min-content;
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding: 0.4rem;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.UtilIcons > button > svg,
|
|
147
|
+
.UtilIcons > div > button > svg {
|
|
148
|
+
height: 1rem;
|
|
149
|
+
width: 1rem;
|
|
150
|
+
aspect-ratio: 1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
#desktop-button {
|
|
154
|
+
border-left: 1px solid rgba(255, 255, 255, 50%);
|
|
155
|
+
height: 100%;
|
|
156
|
+
width: 0.5rem;
|
|
157
|
+
padding: 0;
|
|
158
|
+
margin-left: 1rem;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.MenuContainer {
|
|
162
|
+
position: absolute;
|
|
163
|
+
right: 0;
|
|
164
|
+
bottom: 100%;
|
|
165
|
+
height: auto !important;
|
|
166
|
+
overflow: hidden;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.MenuContainer:not(.Active) {
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.Menu {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
display: flex;
|
|
176
|
+
border-top-left-radius: var(--border-radius-1);
|
|
177
|
+
border-top-right-radius: var(--border-radius-1);
|
|
178
|
+
border-bottom-left-radius: var(--border-radius-1);
|
|
179
|
+
transform: none;
|
|
180
|
+
transition: opacity 200ms ease-in-out, transform 200ms ease-in-out;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
resize: horizontal;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.MenuContainer:not(.Active) .Menu {
|
|
186
|
+
opacity: 0;
|
|
187
|
+
transform: translateY(100px);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.Menu::after,
|
|
191
|
+
.MenuContainer::after {
|
|
192
|
+
content: "";
|
|
193
|
+
position: absolute;
|
|
194
|
+
top: 0;
|
|
195
|
+
bottom: 0;
|
|
196
|
+
left: 0;
|
|
197
|
+
right: 0;
|
|
198
|
+
border-radius: inherit;
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.Menu::after {
|
|
203
|
+
opacity: var(--taskbar-menu-opacity);
|
|
204
|
+
background-color: var(--taskbar-menu-color);
|
|
205
|
+
z-index: -2;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.MenuContainer::after {
|
|
209
|
+
opacity: 1;
|
|
210
|
+
transition: opacity 200ms ease-in-out, top 200ms ease-in-out;
|
|
211
|
+
backdrop-filter: var(--taskbar-filter);
|
|
212
|
+
z-index: -3;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.MenuContainer:not(.Active)::after {
|
|
216
|
+
opacity: 0;
|
|
217
|
+
top: 100px;
|
|
218
|
+
}
|