@prozilla-os/file-explorer 1.1.15 → 1.1.17

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 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,105 +1,105 @@
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/file-explorer` is a standard ProzillaOS application for browsing files.
17
-
18
- ## Installation
19
-
20
- `@prozilla-os/core` is required to run this application.
21
-
22
- ```sh
23
- npm install @prozilla-os/core @prozilla-os/file-explorer
24
- yarn add @prozilla-os/core @prozilla-os/file-explorer
25
- pnpm add @prozilla-os/core @prozilla-os/file-explorer
26
- ```
27
-
28
- ## Usage
29
-
30
- ### Basic setup
31
-
32
- ```tsx
33
- import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView, AppsConfig } from "@prozilla-os/core";
34
- import { fileExplorer } from "@prozilla-os/file-explorer";
35
-
36
- function App() {
37
- return (
38
- <ProzillaOS
39
- systemName="Example"
40
- tagLine="Powered by ProzillaOS"
41
- config={{
42
- apps: new AppsConfig({
43
- apps: [ fileExplorer ]
44
- })
45
- }}
46
- >
47
- <Taskbar/>
48
- <WindowsView/>
49
- <ModalsView/>
50
- <Desktop/>
51
- </ProzillaOS>
52
- );
53
- }
54
- ```
55
-
56
- ### Window options
57
-
58
- ```tsx
59
- /**
60
- * Initial path that the app will open
61
- * @default "~" - Home directory
62
- */
63
- path: string;
64
-
65
- /**
66
- * Defines in which mode the application is running
67
- * 0: None
68
- * 1: Single
69
- * 2: Multiple
70
- * @default 0
71
- */
72
- selectorMode: number;
73
-
74
- /**
75
- * Footer component that will be displayed when `selectorMode` != 0
76
- * Can be used to display a list of selected files for example
77
- */
78
- Footer: React.FC;
79
-
80
- /**
81
- * Gets called each time the selection changes if `selectorMode` != 0
82
- */
83
- onSelectionChange: (params: OnSelectionChangeParams) => void;
84
-
85
- /**
86
- * Gets called when the selection is finished if `selectorMode` != 0
87
- */
88
- onSelectionFinish: Function;
89
- ```
90
-
91
- ## Links
92
-
93
- - [Demo][demo]
94
- - [Docs][docs]
95
- - [GitHub][github]
96
- - [npm][npm]
97
- - [Discord][discord]
98
- - [Ko-fi][ko-fi]
99
-
100
- [demo]: https://os.prozilla.dev/file-explorer
101
- [docs]: https://os.prozilla.dev/docs/reference/apps/file-explorer
102
- [github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/apps/file-explorer
103
- [npm]: https://www.npmjs.com/package/@prozilla-os/file-explorer
104
- [discord]: https://discord.gg/JwbyQP4tdz
105
- [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/file-explorer` is a standard ProzillaOS application for browsing files.
17
+
18
+ ## Installation
19
+
20
+ `@prozilla-os/core` is required to run this application.
21
+
22
+ ```sh
23
+ npm install @prozilla-os/core @prozilla-os/file-explorer
24
+ yarn add @prozilla-os/core @prozilla-os/file-explorer
25
+ pnpm add @prozilla-os/core @prozilla-os/file-explorer
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ### Basic setup
31
+
32
+ ```tsx
33
+ import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView, AppsConfig } from "@prozilla-os/core";
34
+ import { fileExplorer } from "@prozilla-os/file-explorer";
35
+
36
+ function App() {
37
+ return (
38
+ <ProzillaOS
39
+ systemName="Example"
40
+ tagLine="Powered by ProzillaOS"
41
+ config={{
42
+ apps: new AppsConfig({
43
+ apps: [ fileExplorer ]
44
+ })
45
+ }}
46
+ >
47
+ <Taskbar/>
48
+ <WindowsView/>
49
+ <ModalsView/>
50
+ <Desktop/>
51
+ </ProzillaOS>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ### Window options
57
+
58
+ ```tsx
59
+ /**
60
+ * Initial path that the app will open
61
+ * @default "~" - Home directory
62
+ */
63
+ path: string;
64
+
65
+ /**
66
+ * Defines in which mode the application is running
67
+ * 0: None
68
+ * 1: Single
69
+ * 2: Multiple
70
+ * @default 0
71
+ */
72
+ selectorMode: number;
73
+
74
+ /**
75
+ * Footer component that will be displayed when `selectorMode` != 0
76
+ * Can be used to display a list of selected files for example
77
+ */
78
+ Footer: React.FC;
79
+
80
+ /**
81
+ * Gets called each time the selection changes if `selectorMode` != 0
82
+ */
83
+ onSelectionChange: (params: OnSelectionChangeParams) => void;
84
+
85
+ /**
86
+ * Gets called when the selection is finished if `selectorMode` != 0
87
+ */
88
+ onSelectionFinish: Function;
89
+ ```
90
+
91
+ ## Links
92
+
93
+ - [Demo][demo]
94
+ - [Docs][docs]
95
+ - [GitHub][github]
96
+ - [npm][npm]
97
+ - [Discord][discord]
98
+ - [Ko-fi][ko-fi]
99
+
100
+ [demo]: https://os.prozilla.dev/file-explorer
101
+ [docs]: https://os.prozilla.dev/docs/reference/apps/file-explorer
102
+ [github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/apps/file-explorer
103
+ [npm]: https://www.npmjs.com/package/@prozilla-os/file-explorer
104
+ [discord]: https://discord.gg/JwbyQP4tdz
105
+ [ko-fi]: https://ko-fi.com/prozilla
package/dist/main.js CHANGED
@@ -1,49 +1,49 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('._FileExplorer_18occ_1{--header-height: 3.5rem;--sidebar-width: 10rem;--footer-height: 1.75rem;--scale: 1.15rem;display:flex;flex-direction:column;width:100%;height:100%}._Header_18occ_25{display:flex;gap:1rem;align-items:center;width:100%;height:var(--header-height);padding:1rem;background-color:var(--background-color-0)}._IconButton_18occ_45{--color: var(--foreground-color-0);position:relative;height:1.25rem;width:auto;padding:0;background:none;border:none;outline:none;aspect-ratio:1;cursor:pointer}._IconButton_18occ_45:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fff0;border-radius:var(--border-radius-99);transform:scale(1);transform-origin:center;transition:all var(--transition-duration-1) var(--ease-in-out-default)}._IconButton_18occ_45:hover:after,._IconButton_18occ_45:focus-visible:after{background-color:#ffffff1a;transform:scale(1.5)}._IconButton_18occ_45:disabled{--color: var(--background-color-1)}._IconButton_18occ_45 svg{height:100%}._IconButton_18occ_45 svg path{fill:var(--color);transition:fill var(--transition-duration-0) var(--ease-in-out-default)}._PathInput_18occ_137{flex:1;padding:.25rem .5rem;background-color:var(--background-color-2);border:none;border-radius:var(--border-radius-1);outline:none;font-family:inherit;font-size:inherit}._Body_18occ_159{flex:1;display:flex;width:100%;height:calc(100% - var(--header-height));background-color:var(--background-color-2)}._Sidebar_18occ_175{display:flex;gap:.25rem;flex-direction:column;min-width:calc(var(--sidebar-width) / 2);width:var(--sidebar-width);height:100%;max-width:50%;padding:.5rem;background-color:var(--background-color-1);resize:horizontal;overflow:hidden}._NavButton_18occ_203{display:flex;gap:.5rem;align-items:center;width:100%;padding:.5rem;background:none;border:none;border-radius:var(--border-radius-1);outline:none;cursor:pointer;transition:background-color var(--transition-duration-0) var(--ease-in-out-default)}._NavButton_18occ_203:hover,._NavButton_18occ_203:focus-visible{background-color:color-mix(in srgb,var(--background-color-0) 75%,transparent)}._NavButton_18occ_203 svg{height:1.35rem;aspect-ratio:1}._Main_18occ_249{--scale: inherit !important;position:relative;flex:1;display:flex;flex-wrap:wrap;align-content:flex-start;height:100%;padding:.5rem;padding-bottom:calc(.5rem + var(--footer-height));overflow:auto}._Footer_18occ_277{position:absolute;display:flex;justify-content:flex-start;align-items:center;bottom:0;left:0;width:100%;height:var(--footer-height);padding:0 .75rem;border-top:.25rem solid var(--background-color-0);background-color:var(--background-color-2)}._Footer_18occ_277 p{margin:0;font-size:.875em}._Selector_18occ_315{--footer-height: 4rem}._FileProperties_s5har_1{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding:1rem}._Icon_s5har_17{width:3rem;height:3rem}._Icon_s5har_17 div{width:inherit;height:inherit;object-fit:contain}._Icon_s5har_17 svg{max-width:100%;max-height:100%}._Section_s5har_49{--divider-width: .25rem;position:relative;display:flex;gap:.25rem;justify-content:flex-start;align-items:flex-start;flex-direction:column;width:100%;padding:1rem 0;padding-bottom:calc(1rem + var(--divider-width))}._Section_s5har_49:first-child{gap:.5rem;align-items:center;flex-direction:row;padding-top:0}._Section_s5har_49:first-child ._Line_s5har_91{font-size:1.25rem}._Section_s5har_49:not(:last-child):after{content:"";position:absolute;bottom:0;left:0;width:100%;height:var(--divider-width);border-radius:var(--border-radius-0);background-color:var(--background-color-0)}._Line_s5har_91{margin:0;text-align:left;padding-left:2rem;text-indent:-2rem}._AppIcon_s5har_135{display:inline-block;width:2rem;height:2rem;vertical-align:middle;margin-left:.5rem;margin-right:.25rem}._AppIcon_s5har_135 div{position:relative;width:inherit;height:inherit;object-fit:contain}._AppIcon_s5har_135 svg{position:absolute;top:0;left:0;max-width:100%;max-height:100%}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- import { utilStyles as L, VirtualFile as te, useSystemManager as W, WindowedModal as ne, ImagePreview as D, StorageManager as M, useVirtualRoot as oe, useWindowsManager as re, useHistory as se, useAlert as ce, useWindowedModal as ie, useContextMenu as O, Actions as U, ClickAction as x, Vector2 as b, Divider as ae, VirtualRoot as F, DialogBox as z, ModalsConfig as $, DirectoryList as le, CODE_EXTENSIONS as de, App as ue, AppsConfig as pe } from "@prozilla-os/core";
3
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
4
- import { useState as S, useCallback as me, useEffect as H } from "react";
5
- import { FontAwesomeIcon as m } from "@fortawesome/react-fontawesome";
6
- import { faDownload as he, faTrash as V, faCircleInfo as _e, faCaretLeft as Ne, faCaretRight as Ie, faArrowUp as ge, faPlus as xe, faSearch as fe, faCog as be, faHouse as Ee, faDesktop as ye, faImage as ve, faFileLines as Be } from "@fortawesome/free-solid-svg-icons";
7
- const Ce = "_FileExplorer_18occ_1", Ae = "_Header_18occ_25", Pe = "_IconButton_18occ_45", Se = "_PathInput_18occ_137", Le = "_Body_18occ_159", Te = "_Sidebar_18occ_175", we = "_NavButton_18occ_203", ke = "_Main_18occ_249", De = "_Footer_18occ_277", Me = "_Selector_18occ_315", a = {
8
- FileExplorer: Ce,
9
- Header: Ae,
10
- IconButton: Pe,
11
- PathInput: Se,
12
- Body: Le,
13
- Sidebar: Te,
14
- NavButton: we,
15
- Main: ke,
16
- Footer: De,
17
- Selector: Me
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('._FileExplorer_lr5mr_1{--header-height: 3.5rem;--sidebar-width: 10rem;--footer-height: 1.75rem;--scale: 1.15rem;display:flex;flex-direction:column;width:100%;height:100%}._Header_lr5mr_13{display:flex;gap:1rem;align-items:center;width:100%;height:var(--header-height);padding:1rem;background-color:var(--background-color-0)}._IconButton_lr5mr_23{--color: var(--foreground-color-0);position:relative;height:1.25rem;width:auto;padding:0;background:none;border:none;outline:none;aspect-ratio:1;cursor:pointer}._IconButton_lr5mr_23:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fff0;border-radius:var(--border-radius-99);transform:scale(1);transform-origin:center;transition:all var(--transition-duration-1) var(--ease-in-out-default)}._IconButton_lr5mr_23:hover:after,._IconButton_lr5mr_23:focus-visible:after{background-color:#ffffff1a;transform:scale(1.5)}._IconButton_lr5mr_23:disabled{--color: var(--background-color-1)}._IconButton_lr5mr_23 svg{height:100%}._IconButton_lr5mr_23 svg path{fill:var(--color);transition:fill var(--transition-duration-0) var(--ease-in-out-default)}._PathInput_lr5mr_69{flex:1;padding:.25rem .5rem;background-color:var(--background-color-2);border:none;border-radius:var(--border-radius-1);outline:none;font-family:inherit;font-size:inherit}._Body_lr5mr_80{flex:1;display:flex;width:100%;height:calc(100% - var(--header-height));background-color:var(--background-color-2)}._Sidebar_lr5mr_88{display:flex;gap:.25rem;flex-direction:column;min-width:calc(var(--sidebar-width) / 2);width:var(--sidebar-width);height:100%;max-width:50%;padding:.5rem;background-color:var(--background-color-1);resize:horizontal;overflow:hidden}._NavButton_lr5mr_102{display:flex;gap:.5rem;align-items:center;width:100%;padding:.5rem;background:none;border:none;border-radius:var(--border-radius-1);outline:none;cursor:pointer;transition:background-color var(--transition-duration-0) var(--ease-in-out-default)}._NavButton_lr5mr_102:hover,._NavButton_lr5mr_102:focus-visible{background-color:color-mix(in srgb,var(--background-color-0) 75%,transparent)}._NavButton_lr5mr_102 svg{height:1.35rem;aspect-ratio:1}._Main_lr5mr_125{--scale: inherit !important;position:relative;flex:1;display:flex;flex-wrap:wrap;align-content:flex-start;height:100%;padding:.5rem;padding-bottom:calc(.5rem + var(--footer-height));overflow:auto}._Footer_lr5mr_139{position:absolute;display:flex;justify-content:flex-start;align-items:center;bottom:0;left:0;width:100%;height:var(--footer-height);padding:0 .75rem;border-top:.25rem solid var(--background-color-0);background-color:var(--background-color-2)}._Footer_lr5mr_139 p{margin:0;font-size:.875em}._Selector_lr5mr_158{--footer-height: 4rem}._FileProperties_xi8b6_1{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding:1rem}._Icon_xi8b6_9{width:3rem;height:3rem}._Icon_xi8b6_9 div{width:inherit;height:inherit;object-fit:contain}._Icon_xi8b6_9 svg{max-width:100%;max-height:100%}._Section_xi8b6_25{--divider-width: .25rem;position:relative;display:flex;gap:.25rem;justify-content:flex-start;align-items:flex-start;flex-direction:column;width:100%;padding:1rem 0;padding-bottom:calc(1rem + var(--divider-width))}._Section_xi8b6_25:first-child{gap:.5rem;align-items:center;flex-direction:row;padding-top:0}._Section_xi8b6_25:first-child ._Line_xi8b6_46{font-size:1.25rem}._Section_xi8b6_25:not(:last-child):after{content:"";position:absolute;bottom:0;left:0;width:100%;height:var(--divider-width);border-radius:var(--border-radius-0);background-color:var(--background-color-0)}._Line_xi8b6_46{margin:0;text-align:left;padding-left:2rem;text-indent:-2rem}._AppIcon_xi8b6_68{display:inline-block;width:2rem;height:2rem;vertical-align:middle;margin-left:.5rem;margin-right:.25rem}._AppIcon_xi8b6_68 div{position:relative;width:inherit;height:inherit;object-fit:contain}._AppIcon_xi8b6_68 svg{position:absolute;top:0;left:0;max-width:100%;max-height:100%}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { utilStyles as w, VirtualFile as ne, useSystemManager as W, WindowedModal as oe, ImagePreview as D, StorageManager as M, useVirtualRoot as re, useWindowsManager as ie, useHistory as le, useAlert as ae, useWindowedModal as se, useContextMenu as O, Actions as U, ClickAction as b, Vector2 as E, Divider as ce, VirtualRoot as F, DialogBox as z, ModalsConfig as $, DirectoryList as de, CODE_EXTENSIONS as ue, App as me, AppsConfig as pe } from "@prozilla-os/core";
3
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
4
+ import { useState as S, useCallback as he, useEffect as H } from "react";
5
+ import { FontAwesomeIcon as h } from "@fortawesome/react-fontawesome";
6
+ import { faDownload as _e, faUpload as Ne, faTrash as V, faCircleInfo as ge, faCaretLeft as Ie, faCaretRight as xe, faArrowUp as be, faPlus as fe, faSearch as Ee, faCog as ye, faHouse as ve, faDesktop as Be, faImage as Ce, faFileLines as Pe } from "@fortawesome/free-solid-svg-icons";
7
+ const Ae = "_FileExplorer_lr5mr_1", Se = "_Header_lr5mr_13", we = "_IconButton_lr5mr_23", Le = "_PathInput_lr5mr_69", Te = "_Body_lr5mr_80", ke = "_Sidebar_lr5mr_88", De = "_NavButton_lr5mr_102", Me = "_Main_lr5mr_125", Oe = "_Footer_lr5mr_139", Ue = "_Selector_lr5mr_158", s = {
8
+ FileExplorer: Ae,
9
+ Header: Se,
10
+ IconButton: we,
11
+ PathInput: Le,
12
+ Body: Te,
13
+ Sidebar: ke,
14
+ NavButton: De,
15
+ Main: Me,
16
+ Footer: Oe,
17
+ Selector: Ue
18
18
  };
19
- function E({ onClick: o, icon: h, name: i }) {
20
- return /* @__PURE__ */ c(
19
+ function y({ onClick: n, icon: _, name: a }) {
20
+ return /* @__PURE__ */ l(
21
21
  "button",
22
22
  {
23
23
  tabIndex: 0,
24
- className: `${a.NavButton} ${L.TextSemibold}`,
25
- onClick: o,
24
+ className: `${s.NavButton} ${w.TextSemibold}`,
25
+ onClick: n,
26
26
  children: [
27
- /* @__PURE__ */ e(m, { icon: h }),
28
- i
27
+ /* @__PURE__ */ e(h, { icon: _ }),
28
+ a
29
29
  ]
30
30
  }
31
31
  );
32
32
  }
33
- function Oe({ directory: o }) {
34
- const h = (i) => {
35
- const _ = i.target.files;
36
- _ != null && Array.from(_).forEach((p) => {
37
- const { name: u, extension: N } = te.splitId(p.name), r = new FileReader();
38
- r.onload = (I) => {
39
- const { result: y } = I.target;
40
- o.createFile(u, N, (l) => {
41
- l.setSource(y);
33
+ function Fe({ directory: n }) {
34
+ const _ = (a) => {
35
+ const N = a.target.files;
36
+ N != null && Array.from(N).forEach((p) => {
37
+ const { name: u, extension: g } = ne.splitId(p.name), o = new FileReader();
38
+ o.onload = (I) => {
39
+ const { result: v } = I.target;
40
+ n.createFile(u, g, (c) => {
41
+ c.setSource(v);
42
42
  });
43
- }, r.readAsDataURL(p);
43
+ }, o.readAsDataURL(p);
44
44
  });
45
45
  };
46
- return /* @__PURE__ */ c("label", { title: "Import", tabIndex: 0, className: a.IconButton, children: [
46
+ return /* @__PURE__ */ l("label", { title: "Import", tabIndex: 0, className: s.IconButton, children: [
47
47
  /* @__PURE__ */ e(
48
48
  "input",
49
49
  {
@@ -51,135 +51,141 @@ function Oe({ directory: o }) {
51
51
  id: "import",
52
52
  multiple: !0,
53
53
  style: { display: "none" },
54
- onChange: h
54
+ onChange: _
55
55
  }
56
56
  ),
57
- /* @__PURE__ */ e(m, { icon: he })
57
+ /* @__PURE__ */ e(h, { icon: _e })
58
58
  ] });
59
59
  }
60
60
  const G = {
61
61
  NONE: 0,
62
62
  SINGLE: 1,
63
63
  MULTIPLE: 2
64
- }, Ue = "_FileProperties_s5har_1", Fe = "_Icon_s5har_17", ze = "_Section_s5har_49", $e = "_Line_s5har_91", He = "_AppIcon_s5har_135", d = {
65
- FileProperties: Ue,
66
- Icon: Fe,
67
- Section: ze,
68
- Line: $e,
69
- AppIcon: He
64
+ }, ze = "_FileProperties_xi8b6_1", $e = "_Icon_xi8b6_9", He = "_Section_xi8b6_25", Ve = "_Line_xi8b6_46", Ge = "_AppIcon_xi8b6_68", d = {
65
+ FileProperties: ze,
66
+ Icon: $e,
67
+ Section: He,
68
+ Line: Ve,
69
+ AppIcon: Ge
70
70
  };
71
- function Ve({ modal: o, params: h, file: i, ..._ }) {
72
- const { appsConfig: p } = W(), u = i.extension != null ? p.getAppByFileExtension(i.extension) : null;
73
- return /* @__PURE__ */ c(ne, { className: d.FileProperties, modal: o, params: h, ..._, children: [
74
- /* @__PURE__ */ c("span", { className: d.Section, children: [
75
- /* @__PURE__ */ e(D, { className: d.Icon, source: i.getIconUrl() }),
76
- /* @__PURE__ */ e("p", { className: `${d.Line} ${L.TextBold}`, children: i.id })
71
+ function We({ modal: n, params: _, file: a, ...N }) {
72
+ const { appsConfig: p } = W(), u = a.extension != null ? p.getAppByFileExtension(a.extension) : null;
73
+ return /* @__PURE__ */ l(oe, { className: d.FileProperties, modal: n, params: _, ...N, children: [
74
+ /* @__PURE__ */ l("span", { className: d.Section, children: [
75
+ /* @__PURE__ */ e(D, { className: d.Icon, source: a.getIconUrl() }),
76
+ /* @__PURE__ */ e("p", { className: `${d.Line} ${w.TextBold}`, children: a.id })
77
77
  ] }),
78
- /* @__PURE__ */ c("span", { className: d.Section, children: [
79
- /* @__PURE__ */ c("p", { className: d.Line, children: [
78
+ /* @__PURE__ */ l("span", { className: d.Section, children: [
79
+ /* @__PURE__ */ l("p", { className: d.Line, children: [
80
80
  "Type: ",
81
- i.getType()
81
+ a.getType()
82
82
  ] }),
83
- u != null && /* @__PURE__ */ c("span", { className: d.Line, children: [
83
+ u != null && /* @__PURE__ */ l("span", { className: d.Line, children: [
84
84
  "Opens with:",
85
85
  /* @__PURE__ */ e(D, { className: d.AppIcon, source: u.iconUrl ?? "" }),
86
86
  u.name
87
87
  ] })
88
88
  ] }),
89
- /* @__PURE__ */ c("span", { className: d.Section, children: [
90
- /* @__PURE__ */ c("p", { className: d.Line, children: [
89
+ /* @__PURE__ */ l("span", { className: d.Section, children: [
90
+ /* @__PURE__ */ l("p", { className: d.Line, children: [
91
91
  "Location: ",
92
- i.path
92
+ a.path
93
93
  ] }),
94
- /* @__PURE__ */ c("p", { className: d.Line, children: [
94
+ /* @__PURE__ */ l("p", { className: d.Line, children: [
95
95
  "Size: ",
96
- M.getByteSize(i.source ?? i.content),
96
+ M.getByteSize(a.source ?? a.content),
97
97
  " bytes"
98
98
  ] }),
99
- /* @__PURE__ */ c("p", { className: d.Line, children: [
99
+ /* @__PURE__ */ l("p", { className: d.Line, children: [
100
100
  "Size on drive: ",
101
- M.getByteSize(i.toString()),
101
+ M.getByteSize(a.toString()),
102
102
  " bytes"
103
103
  ] })
104
104
  ] }),
105
- /* @__PURE__ */ e("span", { className: d.Section, children: /* @__PURE__ */ c("p", { className: d.Line, children: [
105
+ /* @__PURE__ */ e("span", { className: d.Section, children: /* @__PURE__ */ l("p", { className: d.Line, children: [
106
106
  "Attributes: ",
107
- i.isProtected ? "Protected" : "N/A"
107
+ a.isProtected ? "Protected" : "N/A"
108
108
  ] }) })
109
109
  ] });
110
110
  }
111
- function Ge({ app: o, path: h, selectorMode: i, Footer: _, onSelectionChange: p, onSelectionFinish: u }) {
112
- const N = _ != null && i != null && i !== G.NONE, r = oe(), I = re(), { windowsConfig: y } = W(), [l, v] = S(r == null ? void 0 : r.navigate(h ?? "~")), [Y, f] = S((l == null ? void 0 : l.path) ?? ""), [T] = S(!0), { history: B, stateIndex: w, pushState: k, undo: j, redo: K, undoAvailable: Q, redoAvailable: X } = se(l.path), { alert: q } = ce(), { openWindowedModal: C } = ie(), { onContextMenu: J } = O({
113
- Actions: (s) => /* @__PURE__ */ c(U, { ...s, children: [
114
- /* @__PURE__ */ e(x, { label: N ? "Select" : "Open", onTrigger: (t, n) => {
115
- if (N) {
116
- p == null || p({ files: [n.id], directory: l }), u == null || u();
117
- return;
118
- }
119
- I != null && n.open(I);
120
- } }),
121
- /* @__PURE__ */ e(x, { label: "Delete", icon: V, onTrigger: (t, n) => {
122
- n.delete();
123
- } }),
124
- /* @__PURE__ */ e(x, { label: "Properties", icon: _e, onTrigger: (t, n) => {
125
- C({
126
- title: `${n.id} ${y.titleSeparator} Properties`,
127
- iconUrl: n.getIconUrl(),
128
- size: new b(400, 500),
129
- Modal: (P) => /* @__PURE__ */ e(Ve, { file: n, ...P })
130
- });
131
- } })
132
- ] })
111
+ function Ye({ app: n, path: _, selectorMode: a, Footer: N, onSelectionChange: p, onSelectionFinish: u }) {
112
+ const g = N != null && a != null && a !== G.NONE, o = re(), I = ie(), { windowsConfig: v } = W(), [c, B] = S(o == null ? void 0 : o.navigate(_ ?? "~")), [Y, f] = S((c == null ? void 0 : c.path) ?? ""), [L] = S(!0), { history: C, stateIndex: T, pushState: k, undo: j, redo: K, undoAvailable: Q, redoAvailable: X } = le(c.path), { alert: q } = ae(), { openWindowedModal: P } = se(), { onContextMenu: J } = O({
113
+ Actions: (r) => {
114
+ var t;
115
+ return /* @__PURE__ */ l(U, { ...r, children: [
116
+ /* @__PURE__ */ e(b, { label: g ? "Select" : "Open", onTrigger: (i, m) => {
117
+ if (g) {
118
+ p == null || p({ files: [m.id], directory: c }), u == null || u();
119
+ return;
120
+ }
121
+ I != null && m.open(I);
122
+ } }),
123
+ ((t = r.triggerParams) == null ? void 0 : t.isDownloadable()) && /* @__PURE__ */ e(b, { label: "Export", icon: Ne, onTrigger: (i, m) => {
124
+ m.download();
125
+ } }),
126
+ /* @__PURE__ */ e(b, { label: "Delete", icon: V, onTrigger: (i, m) => {
127
+ m.delete();
128
+ } }),
129
+ /* @__PURE__ */ e(b, { label: "Properties", icon: ge, onTrigger: (i, m) => {
130
+ P({
131
+ title: `${m.id} ${v.titleSeparator} Properties`,
132
+ iconUrl: m.getIconUrl(),
133
+ size: new E(400, 500),
134
+ Modal: (te) => /* @__PURE__ */ e(We, { file: m, ...te })
135
+ });
136
+ } })
137
+ ] });
138
+ }
133
139
  }), { onContextMenu: Z } = O({
134
- Actions: (s) => /* @__PURE__ */ c(U, { ...s, children: [
135
- /* @__PURE__ */ e(x, { label: "Open", onTrigger: (t, n) => {
136
- g(n.linkedPath ?? n.name);
140
+ Actions: (r) => /* @__PURE__ */ l(U, { ...r, children: [
141
+ /* @__PURE__ */ e(b, { label: "Open", onTrigger: (t, i) => {
142
+ x(i.linkedPath ?? i.name);
137
143
  } }),
138
- /* @__PURE__ */ e(ae, {}),
139
- /* @__PURE__ */ e(x, { label: "Delete", icon: V, onTrigger: (t, n) => {
140
- n.delete();
144
+ /* @__PURE__ */ e(ce, {}),
145
+ /* @__PURE__ */ e(b, { label: "Delete", icon: V, onTrigger: (t, i) => {
146
+ i.delete();
141
147
  } })
142
148
  ] })
143
- }), g = me((s, t = !1) => {
144
- if (s == null)
149
+ }), x = he((r, t = !1) => {
150
+ if (r == null)
145
151
  return;
146
- l == null && (t = !0);
147
- const n = t ? r == null ? void 0 : r.navigate(s) : l.navigate(s);
148
- n != null && (v(n), f(n.root ? "/" : n.path), k(n.path));
149
- }, [l, k, r]);
152
+ c == null && (t = !0);
153
+ const i = t ? o == null ? void 0 : o.navigate(r) : c.navigate(r);
154
+ i != null && (B(i), f(i.root ? "/" : i.path), k(i.path));
155
+ }, [c, k, o]);
150
156
  H(() => {
151
- if (B.length === 0)
157
+ if (C.length === 0)
152
158
  return;
153
- const s = B[w], t = r == null ? void 0 : r.navigate(s);
154
- t != null && (v(t), f(t.root ? "/" : t.path));
155
- }, [B, w, r]), H(() => {
156
- const s = (t) => {
159
+ const r = C[T], t = o == null ? void 0 : o.navigate(r);
160
+ t != null && (B(t), f(t.root ? "/" : t.path));
161
+ }, [C, T, o]), H(() => {
162
+ const r = (t) => {
157
163
  q({
158
164
  title: t.message,
159
165
  text: "You have exceeded the virtual drive capacity. Files and folders will not be saved until more storage is freed.",
160
- iconUrl: o == null ? void 0 : o.iconUrl,
161
- size: new b(300, 200),
166
+ iconUrl: n == null ? void 0 : n.iconUrl,
167
+ size: new E(300, 200),
162
168
  single: !0
163
169
  });
164
170
  };
165
- return r == null || r.on(F.EVENT_NAMES.error, s), () => {
166
- r == null || r.off(F.EVENT_NAMES.error, s);
171
+ return o == null || o.on(F.EVENT_NAMES.error, r), () => {
172
+ o == null || o.off(F.EVENT_NAMES.error, r);
167
173
  };
168
174
  }, []);
169
- const R = (s) => {
170
- f(s.target.value);
171
- }, ee = (s) => {
172
- let t = s.target.value;
173
- if (s.key === "Enter") {
175
+ const R = (r) => {
176
+ f(r.target.value);
177
+ }, ee = (r) => {
178
+ let t = r.target.value;
179
+ if (r.key === "Enter") {
174
180
  t === "" && (t = "~");
175
- const n = r == null ? void 0 : r.navigate(t);
176
- if (n == null) {
177
- C({
181
+ const i = o == null ? void 0 : o.navigate(t);
182
+ if (i == null) {
183
+ P({
178
184
  title: "Error",
179
- iconUrl: o == null ? void 0 : o.iconUrl,
180
- size: new b(300, 150),
181
- Modal: (P) => /* @__PURE__ */ c(z, { ...P, children: [
182
- /* @__PURE__ */ c("p", { children: [
185
+ iconUrl: n == null ? void 0 : n.iconUrl,
186
+ size: new E(300, 150),
187
+ Modal: (m) => /* @__PURE__ */ l(z, { ...m, children: [
188
+ /* @__PURE__ */ l("p", { children: [
183
189
  'Invalid path: "',
184
190
  t,
185
191
  '"'
@@ -189,22 +195,22 @@ function Ge({ app: o, path: h, selectorMode: i, Footer: _, onSelectionChange: p,
189
195
  });
190
196
  return;
191
197
  }
192
- v(n), f(n.root ? "/" : n.path);
198
+ B(i), f(i.root ? "/" : i.path);
193
199
  }
194
- }, A = l.getItemCount(T);
195
- return /* @__PURE__ */ c("div", { className: N ? `${a.FileExplorer} ${a.Selector}` : a.FileExplorer, children: [
196
- /* @__PURE__ */ c("div", { className: a.Header, children: [
200
+ }, A = c.getItemCount(L);
201
+ return /* @__PURE__ */ l("div", { className: g ? `${s.FileExplorer} ${s.Selector}` : s.FileExplorer, children: [
202
+ /* @__PURE__ */ l("div", { className: s.Header, children: [
197
203
  /* @__PURE__ */ e(
198
204
  "button",
199
205
  {
200
206
  title: "Back",
201
207
  tabIndex: 0,
202
- className: a.IconButton,
208
+ className: s.IconButton,
203
209
  onClick: () => {
204
210
  j();
205
211
  },
206
212
  disabled: !Q,
207
- children: /* @__PURE__ */ e(m, { icon: Ne })
213
+ children: /* @__PURE__ */ e(h, { icon: Ie })
208
214
  }
209
215
  ),
210
216
  /* @__PURE__ */ e(
@@ -212,12 +218,12 @@ function Ge({ app: o, path: h, selectorMode: i, Footer: _, onSelectionChange: p,
212
218
  {
213
219
  title: "Forward",
214
220
  tabIndex: 0,
215
- className: a.IconButton,
221
+ className: s.IconButton,
216
222
  onClick: () => {
217
223
  K();
218
224
  },
219
225
  disabled: !X,
220
- children: /* @__PURE__ */ e(m, { icon: Ie })
226
+ children: /* @__PURE__ */ e(h, { icon: xe })
221
227
  }
222
228
  ),
223
229
  /* @__PURE__ */ e(
@@ -225,12 +231,12 @@ function Ge({ app: o, path: h, selectorMode: i, Footer: _, onSelectionChange: p,
225
231
  {
226
232
  title: "Up",
227
233
  tabIndex: 0,
228
- className: a.IconButton,
234
+ className: s.IconButton,
229
235
  onClick: () => {
230
- g("..");
236
+ x("..");
231
237
  },
232
- disabled: l.isRoot != null && l.isRoot,
233
- children: /* @__PURE__ */ e(m, { icon: ge })
238
+ disabled: c.isRoot != null && c.isRoot,
239
+ children: /* @__PURE__ */ e(h, { icon: be })
234
240
  }
235
241
  ),
236
242
  /* @__PURE__ */ e(
@@ -238,20 +244,20 @@ function Ge({ app: o, path: h, selectorMode: i, Footer: _, onSelectionChange: p,
238
244
  {
239
245
  title: "New",
240
246
  tabIndex: 0,
241
- className: a.IconButton,
247
+ className: s.IconButton,
242
248
  onClick: () => {
243
- C({
249
+ P({
244
250
  title: "Error",
245
- iconUrl: o == null ? void 0 : o.iconUrl,
246
- size: new b(300, 150),
247
- Modal: (s) => /* @__PURE__ */ c(z, { ...s, children: [
251
+ iconUrl: n == null ? void 0 : n.iconUrl,
252
+ size: new E(300, 150),
253
+ Modal: (r) => /* @__PURE__ */ l(z, { ...r, children: [
248
254
  /* @__PURE__ */ e("p", { children: "This folder is protected." }),
249
255
  /* @__PURE__ */ e("button", { "data-type": $.DIALOG_CONTENT_TYPES.closeButton, children: "Ok" })
250
256
  ] })
251
257
  });
252
258
  },
253
- disabled: !l.canBeEdited,
254
- children: /* @__PURE__ */ e(m, { icon: xe })
259
+ disabled: !c.canBeEdited,
260
+ children: /* @__PURE__ */ e(h, { icon: fe })
255
261
  }
256
262
  ),
257
263
  /* @__PURE__ */ e(
@@ -260,63 +266,63 @@ function Ge({ app: o, path: h, selectorMode: i, Footer: _, onSelectionChange: p,
260
266
  value: Y,
261
267
  type: "text",
262
268
  "aria-label": "Path",
263
- className: a.PathInput,
269
+ className: s.PathInput,
264
270
  tabIndex: 0,
265
271
  onChange: R,
266
272
  onKeyDown: ee,
267
273
  placeholder: "Enter a path..."
268
274
  }
269
275
  ),
270
- /* @__PURE__ */ e(Oe, { directory: l }),
271
- /* @__PURE__ */ e("button", { title: "Search", tabIndex: 0, className: a.IconButton, children: /* @__PURE__ */ e(m, { icon: fe }) }),
272
- /* @__PURE__ */ e("button", { title: "Settings", tabIndex: 0, className: a.IconButton, children: /* @__PURE__ */ e(m, { icon: be }) })
276
+ /* @__PURE__ */ e(Fe, { directory: c }),
277
+ /* @__PURE__ */ e("button", { title: "Search", tabIndex: 0, className: s.IconButton, children: /* @__PURE__ */ e(h, { icon: Ee }) }),
278
+ /* @__PURE__ */ e("button", { title: "Settings", tabIndex: 0, className: s.IconButton, children: /* @__PURE__ */ e(h, { icon: ye }) })
273
279
  ] }),
274
- /* @__PURE__ */ c("div", { className: a.Body, children: [
275
- /* @__PURE__ */ c("div", { className: a.Sidebar, children: [
276
- /* @__PURE__ */ e(E, { name: "Home", onClick: () => {
277
- g("~");
278
- }, icon: Ee }),
279
- /* @__PURE__ */ e(E, { name: "Desktop", onClick: () => {
280
- g("~/Desktop");
281
- }, icon: ye }),
282
- /* @__PURE__ */ e(E, { name: "Images", onClick: () => {
283
- g("~/Pictures");
280
+ /* @__PURE__ */ l("div", { className: s.Body, children: [
281
+ /* @__PURE__ */ l("div", { className: s.Sidebar, children: [
282
+ /* @__PURE__ */ e(y, { name: "Home", onClick: () => {
283
+ x("~");
284
284
  }, icon: ve }),
285
- /* @__PURE__ */ e(E, { name: "Documents", onClick: () => {
286
- g("~/Documents");
287
- }, icon: Be })
285
+ /* @__PURE__ */ e(y, { name: "Desktop", onClick: () => {
286
+ x("~/Desktop");
287
+ }, icon: Be }),
288
+ /* @__PURE__ */ e(y, { name: "Images", onClick: () => {
289
+ x("~/Pictures");
290
+ }, icon: Ce }),
291
+ /* @__PURE__ */ e(y, { name: "Documents", onClick: () => {
292
+ x("~/Documents");
293
+ }, icon: Pe })
288
294
  ] }),
289
295
  /* @__PURE__ */ e(
290
- le,
296
+ de,
291
297
  {
292
- directory: l,
298
+ directory: c,
293
299
  id: "main",
294
- className: a.Main,
295
- showHidden: T,
296
- onOpenFile: (s, t) => {
297
- if (s.preventDefault(), N)
300
+ className: s.Main,
301
+ showHidden: L,
302
+ onOpenFile: (r, t) => {
303
+ if (r.preventDefault(), g)
298
304
  return void (u == null ? void 0 : u());
299
- const n = {};
300
- (t.extension === "md" || t.extension != null && de.includes(t.extension)) && (n.mode = "view"), I == null || I.openFile(t, n);
305
+ const i = {};
306
+ (t.extension === "md" || t.extension != null && ue.includes(t.extension)) && (i.mode = "view"), I == null || I.openFile(t, i);
301
307
  },
302
- onOpenFolder: (s, t) => {
303
- g(t.linkedPath ?? t.name);
308
+ onOpenFolder: (r, t) => {
309
+ x(t.linkedPath ?? t.name);
304
310
  },
305
311
  onContextMenuFile: J,
306
312
  onContextMenuFolder: Z,
307
- allowMultiSelect: i !== G.SINGLE,
313
+ allowMultiSelect: a !== G.SINGLE,
308
314
  onSelectionChange: p
309
315
  }
310
316
  )
311
317
  ] }),
312
- N ? /* @__PURE__ */ e("div", { className: a.Footer, children: /* @__PURE__ */ e(_, {}) }) : /* @__PURE__ */ e("span", { className: a.Footer, children: /* @__PURE__ */ e("p", { className: L.TextLight, children: A === 1 ? A + " item" : A + " items" }) })
318
+ g ? /* @__PURE__ */ e("div", { className: s.Footer, children: /* @__PURE__ */ e(N, {}) }) : /* @__PURE__ */ e("span", { className: s.Footer, children: /* @__PURE__ */ e("p", { className: w.TextLight, children: A === 1 ? A + " item" : A + " items" }) })
313
319
  ] });
314
320
  }
315
- var We = /* @__PURE__ */ ((o) => (o[o.None = 0] = "None", o[o.Single = 1] = "Single", o[o.Multi = 2] = "Multi", o))(We || {});
316
- const Ye = new ue("File Explorer", "file-explorer", Ge).setIconUrl("https://os.prozilla.dev/assets/apps/icons/file-explorer.svg").setRole(pe.APP_ROLES.fileExplorer).setCategory("Utilities & tools");
317
- Ye.setMetadata({ name: "@prozilla-os/file-explorer", version: "1.1.14", author: "Prozilla" });
321
+ var je = /* @__PURE__ */ ((n) => (n[n.None = 0] = "None", n[n.Single = 1] = "Single", n[n.Multi = 2] = "Multi", n))(je || {});
322
+ const Ke = new me("File Explorer", "file-explorer", Ye).setIconUrl("https://os.prozilla.dev/assets/apps/icons/file-explorer.svg").setRole(pe.APP_ROLES.fileExplorer).setCategory("Utilities & tools");
323
+ Ke.setMetadata({ name: "@prozilla-os/file-explorer", version: "1.1.16", author: "Prozilla" });
318
324
  export {
319
- We as FileSelectorMode,
320
- Ye as fileExplorer
325
+ je as FileSelectorMode,
326
+ Ke as fileExplorer
321
327
  };
322
328
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/components/QuickAccessButton.tsx","../src/components/ImportButton.tsx","../src/constants/fileExplorer.const.ts","../src/components/modals/file-properties/FileProperties.tsx","../src/components/FileExplorer.tsx","../src/types/utils.ts","../src/main.ts"],"sourcesContent":["import { FontAwesomeIcon, FontAwesomeIconProps } from \"@fortawesome/react-fontawesome\";\r\nimport styles from \"./FileExplorer.module.css\";\r\nimport { MouseEventHandler } from \"react\";\r\nimport { utilStyles } from \"@prozilla-os/core\";\r\n\r\ninterface QuickAcessButton {\r\n\tonClick: MouseEventHandler;\r\n\ticon: FontAwesomeIconProps[\"icon\"];\r\n\tname: string;\r\n}\r\n\r\nexport function QuickAccessButton({ onClick, icon, name }: QuickAcessButton) {\r\n\treturn (\r\n\t\t<button\r\n\t\t\ttabIndex={0}\r\n\t\t\tclassName={`${styles.NavButton} ${utilStyles.TextSemibold}`}\r\n\t\t\tonClick={onClick}\r\n\t\t>\r\n\t\t\t<FontAwesomeIcon icon={icon}/>\r\n\t\t\t{name}\r\n\t\t</button>\r\n\t);\r\n}","import { FormEventHandler, ReactElement } from \"react\";\r\nimport styles from \"./FileExplorer.module.css\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faDownload } from \"@fortawesome/free-solid-svg-icons\";\r\nimport { VirtualFolder, VirtualFile } from \"@prozilla-os/core\";\r\n\r\ninterface ImportButtonProps {\r\n\tdirectory: VirtualFolder;\r\n}\r\n\r\nexport function ImportButton({ directory }: ImportButtonProps): ReactElement {\r\n\tconst onChange = (event: InputEvent) => {\r\n\t\tconst files = (event.target as HTMLInputElement).files;\r\n\r\n\t\tif (files == null)\r\n\t\t\treturn;\r\n\r\n\t\tArray.from(files).forEach((file: File) => {\r\n\t\t\tconst { name, extension } = VirtualFile.splitId(file.name);\r\n\r\n\t\t\tconst reader = new FileReader();\r\n\t\t\treader.onload = (event: Event) => {\r\n\t\t\t\tconst { result } = event.target as FileReader;\r\n\r\n\t\t\t\t// Create a file with the same name and extension, with a base64 string as a source\r\n\t\t\t\tdirectory.createFile(name, extension as string | undefined, (virtualFile) => {\r\n\t\t\t\t\tvirtualFile.setSource(result as string);\r\n\t\t\t\t});\r\n\t\t\t};\r\n\t\t\treader.readAsDataURL(file);\r\n\t\t});\r\n\t};\r\n\r\n\treturn <label title=\"Import\" tabIndex={0} className={styles.IconButton}>\r\n\t\t<input\r\n\t\t\ttype=\"file\"\r\n\t\t\tid=\"import\"\r\n\t\t\tmultiple\r\n\t\t\tstyle={{ display: \"none\" }}\r\n\t\t\tonChange={onChange as unknown as FormEventHandler}\r\n\t\t/>\r\n\t\t<FontAwesomeIcon icon={faDownload}/>\r\n\t</label>;\r\n}","export const SELECTOR_MODE = {\n\tNONE: 0,\n\tSINGLE: 1,\n\tMULTIPLE: 2,\n};","import styles from \"./FileProperties.module.css\";\r\nimport { ImagePreview, ModalProps, StorageManager, useSystemManager, utilStyles, VirtualFile, WindowedModal } from \"@prozilla-os/core\";\r\n\r\ninterface FilePropetiesProps extends ModalProps {\r\n\tfile: VirtualFile;\r\n}\r\n\r\nexport function FileProperties({ modal, params, file, ...props }: FilePropetiesProps) {\r\n\tconst { appsConfig } = useSystemManager();\r\n\tconst associatedApp = file.extension != null ? appsConfig.getAppByFileExtension(file.extension) : null;\r\n\r\n\treturn <WindowedModal className={styles.FileProperties} modal={modal} params={params} {...props}>\r\n\t\t<span className={styles.Section}>\r\n\t\t\t<ImagePreview className={styles.Icon} source={file.getIconUrl()}/>\r\n\t\t\t<p className={`${styles.Line} ${utilStyles.TextBold}`}>{file.id}</p>\r\n\t\t</span>\r\n\t\t<span className={styles.Section}>\r\n\t\t\t<p className={styles.Line}>Type: {file.getType()}</p>\r\n\t\t\t{associatedApp != null &&\r\n\t\t\t\t<span className={styles.Line}>\r\n\t\t\t\t\tOpens with: \r\n\t\t\t\t\t<ImagePreview className={styles.AppIcon} source={associatedApp.iconUrl ?? \"\"}/>\r\n\t\t\t\t\t{associatedApp.name}\r\n\t\t\t\t</span>\r\n\t\t\t}\r\n\t\t</span>\r\n\t\t<span className={styles.Section}>\r\n\t\t\t<p className={styles.Line}>Location: {file.path}</p>\r\n\t\t\t<p className={styles.Line}>Size: {StorageManager.getByteSize(file.source ?? file.content as string | null)} bytes</p>\r\n\t\t\t<p className={styles.Line}>Size on drive: {StorageManager.getByteSize(file.toString())} bytes</p>\r\n\t\t</span>\r\n\t\t<span className={styles.Section}>\r\n\t\t\t<p className={styles.Line}>Attributes: {file.isProtected ? \"Protected\" : \"N/A\"}</p>\r\n\t\t</span>\r\n\t</WindowedModal>;\r\n}","import { ChangeEventHandler, FC, KeyboardEventHandler, useCallback, useEffect, useState } from \"react\";\nimport styles from \"./FileExplorer.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowUp, faCaretLeft, faCaretRight, faCircleInfo, faCog, faDesktop, faFileLines, faHouse, faImage, faPlus, faSearch, faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { QuickAccessButton } from \"./QuickAccessButton\";\nimport { ImportButton } from \"./ImportButton\";\nimport { Actions, ClickAction, CODE_EXTENSIONS, DialogBox, DirectoryList, Divider, FileEventHandler, FolderEventHandler, ModalProps, ModalsConfig, OnSelectionChangeParams, useAlert, useContextMenu, useHistory, useSystemManager, useVirtualRoot, useWindowedModal, useWindowsManager, utilStyles, Vector2, VirtualFile, VirtualFolder, VirtualFolderLink, VirtualRoot, WindowProps } from \"@prozilla-os/core\";\nimport { SELECTOR_MODE } from \"../constants/fileExplorer.const\";\nimport { FileProperties } from \"./modals/file-properties/FileProperties\";\nimport { JSX } from \"react/jsx-runtime\";\n\nexport interface FileExplorerProps extends WindowProps {\n\tpath?: string;\n\tselectorMode?: number;\n\tFooter?: FC;\n\tonSelectionChange?: (params: OnSelectionChangeParams) => void;\n\tonSelectionFinish?: () => void;\n}\n\nexport function FileExplorer({ app, path: startPath, selectorMode, Footer, onSelectionChange, onSelectionFinish }: FileExplorerProps) {\n\tconst isSelector = (Footer != null && selectorMode != null && selectorMode !== SELECTOR_MODE.NONE);\n\n\tconst virtualRoot = useVirtualRoot();\n\tconst windowsManager = useWindowsManager();\n\tconst { windowsConfig } = useSystemManager();\n\n\tconst [currentDirectory, setCurrentDirectory] = useState<VirtualFolder>(virtualRoot?.navigate(startPath ?? \"~\") as VirtualFolder);\n\tconst [path, setPath] = useState<string>(currentDirectory?.path ?? \"\");\n\tconst [showHidden] = useState(true);\n\tconst { history, stateIndex, pushState, undo, redo, undoAvailable, redoAvailable } = useHistory<string>(currentDirectory.path);\n\tconst { alert } = useAlert();\n\n\tconst { openWindowedModal } = useWindowedModal();\n\tconst { onContextMenu: onContextMenuFile } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label={!isSelector ? \"Open\" : \"Select\"} onTrigger={(_event, file) => {\n\t\t\t\tif (isSelector) {\n\t\t\t\t\tonSelectionChange?.({ files: [(file as VirtualFile).id], directory: currentDirectory });\n\t\t\t\t\tonSelectionFinish?.();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (windowsManager != null)\t(file as VirtualFile).open(windowsManager);\n\t\t\t}}/>\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, file) => {\n\t\t\t\t(file as VirtualFile).delete();\n\t\t\t}}/>\n\t\t\t<ClickAction label=\"Properties\" icon={faCircleInfo} onTrigger={(_event, file) => {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: `${(file as VirtualFile).id} ${windowsConfig.titleSeparator} Properties`,\n\t\t\t\t\ticonUrl: (file as VirtualFile).getIconUrl(),\n\t\t\t\t\tsize: new Vector2(400, 500),\n\t\t\t\t\tModal: (props: object) => <FileProperties file={file as VirtualFile} {...props}/>,\n\t\t\t\t});\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\tconst { onContextMenu: onContextMenuFolder } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label=\"Open\" onTrigger={(_event, folder) => {\n\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? (folder as VirtualFolder).name);\n\t\t\t}}/>\n\t\t\t{/* <ClickAction label={`Open in ${APP_NAMES.TERMINAL}`} icon={APP_ICONS.TERMINAL} onTrigger={(event, folder) => {\n\t\t\t\twindowsManager?.open(APPS.TERMINAL, { startPath: (folder as VirtualFolder).path });\n\t\t\t}}/> */}\n\t\t\t<Divider/>\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, folder) => {\n\t\t\t\t(folder as VirtualFolder).delete();\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\t// const { onContextMenu: onNew } = useContextMenu({\n\t// \tmodalsManager,\n\t// \toptions: {\n\t// \t\t\"File\": () => { currentDirectory.createFile(\"New File\"); },\n\t// \t\t\"Folder\": () => { currentDirectory.createFolder(\"New Folder\"); }\n\t// \t}\n\t// });\n\n\tconst changeDirectory = useCallback((path: string, absolute = false) => {\n\t\tif (path == null)\n\t\t\treturn;\n\n\t\tif (currentDirectory == null)\n\t\t\tabsolute = true;\n\n\t\tconst directory = absolute ? virtualRoot?.navigate(path) : currentDirectory.navigate(path);\n\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t\tpushState(directory.path);\n\t\t}\n\t}, [currentDirectory, pushState, virtualRoot]);\n\n\tuseEffect(() => {\n\t\tif (history.length === 0)\n\t\t\treturn;\n\n\t\tconst path = history[stateIndex];\n\t\tconst directory = virtualRoot?.navigate(path);\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t}\n\t}, [history, stateIndex, virtualRoot]);\n\n\tuseEffect(() => {\n\t\ttype Error = { message: string };\n\t\tconst onError = (error: unknown) => {\n\t\t\talert({\n\t\t\t\ttitle: (error as Error).message,\n\t\t\t\ttext: \"You have exceeded the virtual drive capacity. Files and folders will not be saved until more storage is freed.\",\n\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\tsize: new Vector2(300, 200),\n\t\t\t\tsingle: true,\n\t\t\t});\n\t\t};\n\n\t\tvirtualRoot?.on(VirtualRoot.EVENT_NAMES.error, onError);\n\n\t\treturn () => {\n\t\t\tvirtualRoot?.off(VirtualRoot.EVENT_NAMES.error, onError);\n\t\t};\n\t}, []);\n\n\tconst onPathChange = (event: Event) => {\n\t\tsetPath((event.target as HTMLInputElement).value);\n\t};\n\n\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\tlet value = (event.target as HTMLInputElement).value;\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tif (value === \"\")\n\t\t\t\tvalue = \"~\";\n\n\t\t\tconst directory = virtualRoot?.navigate(value);\n\n\t\t\tif (directory == null) {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t<p>Invalid path: \"{value}\"</p>\n\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t}\n\t};\n\n\tconst itemCount = currentDirectory.getItemCount(showHidden);\n\n\treturn (\n\t\t<div className={!isSelector ? styles.FileExplorer : `${styles.FileExplorer} ${styles.Selector}`}>\n\t\t\t<div className={styles.Header}>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Back\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { undo(); }}\n\t\t\t\t\tdisabled={!undoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretLeft}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Forward\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { redo(); }}\n\t\t\t\t\tdisabled={!redoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Up\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { changeDirectory(\"..\"); }}\n\t\t\t\t\tdisabled={currentDirectory.isRoot != null && currentDirectory.isRoot}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faArrowUp}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"New\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\topenWindowedModal({\n\t\t\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t\t\t<p>This folder is protected.</p>\n\t\t\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// if (currentDirectory.canBeEdited) {\n\t\t\t\t\t\t// \tonNew(event);\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// }\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={!currentDirectory.canBeEdited}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faPlus}/>\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tvalue={path}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label=\"Path\"\n\t\t\t\t\tclassName={styles.PathInput}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tonChange={onPathChange as unknown as ChangeEventHandler}\n\t\t\t\t\tonKeyDown={onKeyDown as unknown as KeyboardEventHandler}\n\t\t\t\t\tplaceholder=\"Enter a path...\"\n\t\t\t\t/>\n\t\t\t\t<ImportButton directory={currentDirectory}/>\n\t\t\t\t<button title=\"Search\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faSearch}/>\n\t\t\t\t</button>\n\t\t\t\t<button title=\"Settings\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faCog}/>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div className={styles.Body}>\n\t\t\t\t<div className={styles.Sidebar}>\n\t\t\t\t\t<QuickAccessButton name={\"Home\"} onClick={() => { changeDirectory(\"~\"); }} icon={faHouse}/>\n\t\t\t\t\t<QuickAccessButton name={\"Desktop\"} onClick={() => { changeDirectory(\"~/Desktop\"); }} icon={faDesktop}/>\n\t\t\t\t\t<QuickAccessButton name={\"Images\"} onClick={() => { changeDirectory(\"~/Pictures\"); }} icon={faImage}/>\n\t\t\t\t\t<QuickAccessButton name={\"Documents\"} onClick={() => { changeDirectory(\"~/Documents\"); }} icon={faFileLines}/>\n\t\t\t\t</div>\n\t\t\t\t<DirectoryList\n\t\t\t\t\tdirectory={currentDirectory} \n\t\t\t\t\tid=\"main\"\n\t\t\t\t\tclassName={styles.Main}\n\t\t\t\t\tshowHidden={showHidden}\n\t\t\t\t\tonOpenFile={(event, file) => {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tif (isSelector)\n\t\t\t\t\t\t\treturn void onSelectionFinish?.();\n\t\t\t\t\t\tconst options: Record<string, string> = {};\n\t\t\t\t\t\tif (file.extension === \"md\" || (file.extension != null && CODE_EXTENSIONS.includes(file.extension)))\n\t\t\t\t\t\t\toptions.mode = \"view\";\n\t\t\t\t\t\twindowsManager?.openFile(file, options);\n\t\t\t\t\t}}\n\t\t\t\t\tonOpenFolder={(_event, folder) => {\n\t\t\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? folder.name);\n\t\t\t\t\t}}\n\t\t\t\t\tonContextMenuFile={onContextMenuFile as unknown as FileEventHandler}\n\t\t\t\t\tonContextMenuFolder={onContextMenuFolder as unknown as FolderEventHandler}\n\t\t\t\t\tallowMultiSelect={selectorMode !== SELECTOR_MODE.SINGLE}\n\t\t\t\t\tonSelectionChange={onSelectionChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{!isSelector\n\t\t\t\t? <span className={styles.Footer}>\n\t\t\t\t\t<p className={utilStyles.TextLight}>\n\t\t\t\t\t\t{itemCount === 1\n\t\t\t\t\t\t\t? itemCount + \" item\"\n\t\t\t\t\t\t\t: itemCount + \" items\"\n\t\t\t\t\t\t}\n\t\t\t\t\t</p>\n\t\t\t\t</span>\n\t\t\t\t: <div className={styles.Footer}>\n\t\t\t\t\t<Footer/>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t);\n}","export enum FileSelectorMode {\r\n\tNone = 0,\r\n\tSingle = 1,\r\n\tMulti = 2\r\n}","import { App, AppsConfig } from \"@prozilla-os/core\";\nimport { FileExplorer, FileExplorerProps } from \"./components/FileExplorer\";\n\nconst fileExplorer = new App<FileExplorerProps>(\"File Explorer\", \"file-explorer\", FileExplorer)\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/file-explorer.svg\")\n\t.setRole(AppsConfig.APP_ROLES.fileExplorer)\n\t.setCategory(\"Utilities & tools\");\nfileExplorer.setMetadata({ name: \"@prozilla-os/file-explorer\", version: \"1.1.14\", author: \"Prozilla\" });\n\n\nexport { fileExplorer };\nexport { FileSelectorMode } from \"./types/utils\";"],"names":["QuickAccessButton","onClick","icon","name","jsxs","styles","utilStyles","jsx","FontAwesomeIcon","ImportButton","directory","onChange","event","files","file","extension","VirtualFile","reader","result","virtualFile","faDownload","SELECTOR_MODE","FileProperties","modal","params","props","appsConfig","useSystemManager","associatedApp","WindowedModal","ImagePreview","StorageManager","FileExplorer","app","startPath","selectorMode","Footer","onSelectionChange","onSelectionFinish","isSelector","virtualRoot","useVirtualRoot","windowsManager","useWindowsManager","windowsConfig","currentDirectory","setCurrentDirectory","useState","path","setPath","showHidden","history","stateIndex","pushState","undo","redo","undoAvailable","redoAvailable","useHistory","alert","useAlert","openWindowedModal","useWindowedModal","onContextMenuFile","useContextMenu","Actions","ClickAction","_event","faTrash","faCircleInfo","Vector2","onContextMenuFolder","folder","changeDirectory","Divider","useCallback","absolute","useEffect","onError","error","VirtualRoot","onPathChange","onKeyDown","value","DialogBox","ModalsConfig","itemCount","faCaretLeft","faCaretRight","faArrowUp","faPlus","faSearch","faCog","faHouse","faDesktop","faImage","faFileLines","DirectoryList","options","CODE_EXTENSIONS","FileSelectorMode","fileExplorer","App","AppsConfig"],"mappings":";;;;;;;;;;;;;;;;;AAWO,SAASA,EAAkB,EAAE,SAAAC,GAAS,MAAAC,GAAM,MAAAC,KAA0B;AAE3E,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,WAAW,GAAGC,EAAO,SAAS,IAAIC,EAAW,YAAY;AAAA,MACzD,SAAAL;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAM,EAACC,KAAgB,MAAAN,GAAW;AAAA,QAC3BC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGJ;ACZgB,SAAAM,GAAa,EAAE,WAAAC,KAA8C;AACtE,QAAAC,IAAW,CAACC,MAAsB;AACjC,UAAAC,IAASD,EAAM,OAA4B;AAEjD,IAAIC,KAAS,QAGb,MAAM,KAAKA,CAAK,EAAE,QAAQ,CAACC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AAA,UACA,mBAAAT;AAAA,UACA,qBAAAQ;AAAA,UACA,kBAAkBpC,MAAiBd,EAAc;AAAA,UACjD,mBAAAgB;AAAA,QAAA;AAAA,MACD;AAAA,IAAA,GACD;AAAA,IACEE,IASC,gBAAAhC,EAAC,OAAI,EAAA,WAAWF,EAAO,QACxB,UAAC,gBAAAE,EAAA6B,GAAA,CAAM,CAAA,GACR,IAVE,gBAAA7B,EAAC,QAAK,EAAA,WAAWF,EAAO,QACzB,UAAC,gBAAAE,EAAA,KAAA,EAAE,WAAWD,EAAW,WACvB,UAAAgF,MAAc,IACZA,IAAY,UACZA,IAAY,SAEhB,CAAA,EACD,CAAA;AAAA,EAKF,EAAA,CAAA;AAEF;ACtRY,IAAAc,uBAAAA,OACXA,EAAAA,EAAA,OAAO,CAAP,IAAA,QACAA,EAAAA,EAAA,SAAS,CAAT,IAAA,UACAA,EAAAA,EAAA,QAAQ,CAAR,IAAA,SAHWA,IAAAA,MAAA,CAAA,CAAA;ACGZ,MAAMC,KAAe,IAAIC,GAAuB,iBAAiB,iBAAiBtE,EAAY,EAC5F,WAAW,6DAA6D,EACxE,QAAQuE,GAAW,UAAU,YAAY,EACzC,YAAY,mBAAmB;AACjCF,GAAa,YAAY,EAAE,MAAM,8BAA8B,SAAS,UAAU,QAAQ,YAAY;"}
1
+ {"version":3,"file":"main.js","sources":["../src/components/QuickAccessButton.tsx","../src/components/ImportButton.tsx","../src/constants/fileExplorer.const.ts","../src/components/modals/file-properties/FileProperties.tsx","../src/components/FileExplorer.tsx","../src/types/utils.ts","../src/main.ts"],"sourcesContent":["import { FontAwesomeIcon, FontAwesomeIconProps } from \"@fortawesome/react-fontawesome\";\nimport styles from \"./FileExplorer.module.css\";\nimport { MouseEventHandler } from \"react\";\nimport { utilStyles } from \"@prozilla-os/core\";\n\ninterface QuickAcessButton {\n\tonClick: MouseEventHandler;\n\ticon: FontAwesomeIconProps[\"icon\"];\n\tname: string;\n}\n\nexport function QuickAccessButton({ onClick, icon, name }: QuickAcessButton) {\n\treturn (\n\t\t<button\n\t\t\ttabIndex={0}\n\t\t\tclassName={`${styles.NavButton} ${utilStyles.TextSemibold}`}\n\t\t\tonClick={onClick}\n\t\t>\n\t\t\t<FontAwesomeIcon icon={icon}/>\n\t\t\t{name}\n\t\t</button>\n\t);\n}","import { FormEventHandler, ReactElement } from \"react\";\nimport styles from \"./FileExplorer.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faDownload } from \"@fortawesome/free-solid-svg-icons\";\nimport { VirtualFolder, VirtualFile } from \"@prozilla-os/core\";\n\ninterface ImportButtonProps {\n\tdirectory: VirtualFolder;\n}\n\nexport function ImportButton({ directory }: ImportButtonProps): ReactElement {\n\tconst onChange = (event: InputEvent) => {\n\t\tconst files = (event.target as HTMLInputElement).files;\n\n\t\tif (files == null)\n\t\t\treturn;\n\n\t\tArray.from(files).forEach((file: File) => {\n\t\t\tconst { name, extension } = VirtualFile.splitId(file.name);\n\n\t\t\tconst reader = new FileReader();\n\t\t\treader.onload = (event: Event) => {\n\t\t\t\tconst { result } = event.target as FileReader;\n\n\t\t\t\t// Create a file with the same name and extension, with a base64 string as a source\n\t\t\t\tdirectory.createFile(name, extension as string | undefined, (virtualFile) => {\n\t\t\t\t\tvirtualFile.setSource(result as string);\n\t\t\t\t});\n\t\t\t};\n\t\t\treader.readAsDataURL(file);\n\t\t});\n\t};\n\n\treturn <label title=\"Import\" tabIndex={0} className={styles.IconButton}>\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\tid=\"import\"\n\t\t\tmultiple\n\t\t\tstyle={{ display: \"none\" }}\n\t\t\tonChange={onChange as unknown as FormEventHandler}\n\t\t/>\n\t\t<FontAwesomeIcon icon={faDownload}/>\n\t</label>;\n}","export const SELECTOR_MODE = {\n\tNONE: 0,\n\tSINGLE: 1,\n\tMULTIPLE: 2,\n};","import styles from \"./FileProperties.module.css\";\nimport { ImagePreview, ModalProps, StorageManager, useSystemManager, utilStyles, VirtualFile, WindowedModal } from \"@prozilla-os/core\";\n\ninterface FilePropetiesProps extends ModalProps {\n\tfile: VirtualFile;\n}\n\nexport function FileProperties({ modal, params, file, ...props }: FilePropetiesProps) {\n\tconst { appsConfig } = useSystemManager();\n\tconst associatedApp = file.extension != null ? appsConfig.getAppByFileExtension(file.extension) : null;\n\n\treturn <WindowedModal className={styles.FileProperties} modal={modal} params={params} {...props}>\n\t\t<span className={styles.Section}>\n\t\t\t<ImagePreview className={styles.Icon} source={file.getIconUrl()}/>\n\t\t\t<p className={`${styles.Line} ${utilStyles.TextBold}`}>{file.id}</p>\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Type: {file.getType()}</p>\n\t\t\t{associatedApp != null &&\n\t\t\t\t<span className={styles.Line}>\n\t\t\t\t\tOpens with: \n\t\t\t\t\t<ImagePreview className={styles.AppIcon} source={associatedApp.iconUrl ?? \"\"}/>\n\t\t\t\t\t{associatedApp.name}\n\t\t\t\t</span>\n\t\t\t}\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Location: {file.path}</p>\n\t\t\t<p className={styles.Line}>Size: {StorageManager.getByteSize(file.source ?? file.content as string | null)} bytes</p>\n\t\t\t<p className={styles.Line}>Size on drive: {StorageManager.getByteSize(file.toString())} bytes</p>\n\t\t</span>\n\t\t<span className={styles.Section}>\n\t\t\t<p className={styles.Line}>Attributes: {file.isProtected ? \"Protected\" : \"N/A\"}</p>\n\t\t</span>\n\t</WindowedModal>;\n}","import { ChangeEventHandler, FC, KeyboardEventHandler, useCallback, useEffect, useState } from \"react\";\nimport styles from \"./FileExplorer.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowUp, faCaretLeft, faCaretRight, faCircleInfo, faCog, faDesktop, faFileLines, faHouse, faImage, faPlus, faSearch, faTrash, faUpload } from \"@fortawesome/free-solid-svg-icons\";\nimport { QuickAccessButton } from \"./QuickAccessButton\";\nimport { ImportButton } from \"./ImportButton\";\nimport { Actions, ClickAction, CODE_EXTENSIONS, DialogBox, DirectoryList, Divider, FileEventHandler, FolderEventHandler, ModalProps, ModalsConfig, OnSelectionChangeParams, useAlert, useContextMenu, useHistory, useSystemManager, useVirtualRoot, useWindowedModal, useWindowsManager, utilStyles, Vector2, VirtualFile, VirtualFolder, VirtualFolderLink, VirtualRoot, WindowProps } from \"@prozilla-os/core\";\nimport { SELECTOR_MODE } from \"../constants/fileExplorer.const\";\nimport { FileProperties } from \"./modals/file-properties/FileProperties\";\nimport { JSX } from \"react/jsx-runtime\";\n\nexport interface FileExplorerProps extends WindowProps {\n\tpath?: string;\n\tselectorMode?: number;\n\tFooter?: FC;\n\tonSelectionChange?: (params: OnSelectionChangeParams) => void;\n\tonSelectionFinish?: () => void;\n}\n\nexport function FileExplorer({ app, path: startPath, selectorMode, Footer, onSelectionChange, onSelectionFinish }: FileExplorerProps) {\n\tconst isSelector = (Footer != null && selectorMode != null && selectorMode !== SELECTOR_MODE.NONE);\n\n\tconst virtualRoot = useVirtualRoot();\n\tconst windowsManager = useWindowsManager();\n\tconst { windowsConfig } = useSystemManager();\n\n\tconst [currentDirectory, setCurrentDirectory] = useState<VirtualFolder>(virtualRoot?.navigate(startPath ?? \"~\") as VirtualFolder);\n\tconst [path, setPath] = useState<string>(currentDirectory?.path ?? \"\");\n\tconst [showHidden] = useState(true);\n\tconst { history, stateIndex, pushState, undo, redo, undoAvailable, redoAvailable } = useHistory<string>(currentDirectory.path);\n\tconst { alert } = useAlert();\n\n\tconst { openWindowedModal } = useWindowedModal();\n\tconst { onContextMenu: onContextMenuFile } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label={!isSelector ? \"Open\" : \"Select\"} onTrigger={(_event, file) => {\n\t\t\t\tif (isSelector) {\n\t\t\t\t\tonSelectionChange?.({ files: [(file as VirtualFile).id], directory: currentDirectory });\n\t\t\t\t\tonSelectionFinish?.();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (windowsManager != null)\t(file as VirtualFile).open(windowsManager);\n\t\t\t}}/>\n\t\t\t{(props.triggerParams as VirtualFile)?.isDownloadable() && \n\t\t\t\t<ClickAction label=\"Export\" icon={faUpload} onTrigger={(_event, file) => {\n\t\t\t\t\t(file as VirtualFile).download();\n\t\t\t\t}}/>\n\t\t\t}\t\t\t\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, file) => {\n\t\t\t\t(file as VirtualFile).delete();\n\t\t\t}}/>\n\t\t\t<ClickAction label=\"Properties\" icon={faCircleInfo} onTrigger={(_event, file) => {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: `${(file as VirtualFile).id} ${windowsConfig.titleSeparator} Properties`,\n\t\t\t\t\ticonUrl: (file as VirtualFile).getIconUrl(),\n\t\t\t\t\tsize: new Vector2(400, 500),\n\t\t\t\t\tModal: (props: object) => <FileProperties file={file as VirtualFile} {...props}/>,\n\t\t\t\t});\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\tconst { onContextMenu: onContextMenuFolder } = useContextMenu({ Actions: (props) =>\n\t\t<Actions {...props}>\n\t\t\t<ClickAction label=\"Open\" onTrigger={(_event, folder) => {\n\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? (folder as VirtualFolder).name);\n\t\t\t}}/>\n\t\t\t{/* <ClickAction label={`Open in ${APP_NAMES.TERMINAL}`} icon={APP_ICONS.TERMINAL} onTrigger={(event, folder) => {\n\t\t\t\twindowsManager?.open(APPS.TERMINAL, { startPath: (folder as VirtualFolder).path });\n\t\t\t}}/> */}\n\t\t\t<Divider/>\n\t\t\t<ClickAction label=\"Delete\" icon={faTrash} onTrigger={(_event, folder) => {\n\t\t\t\t(folder as VirtualFolder).delete();\n\t\t\t}}/>\n\t\t</Actions>,\n\t});\n\t// const { onContextMenu: onNew } = useContextMenu({\n\t// \tmodalsManager,\n\t// \toptions: {\n\t// \t\t\"File\": () => { currentDirectory.createFile(\"New File\"); },\n\t// \t\t\"Folder\": () => { currentDirectory.createFolder(\"New Folder\"); }\n\t// \t}\n\t// });\n\n\tconst changeDirectory = useCallback((path: string, absolute = false) => {\n\t\tif (path == null)\n\t\t\treturn;\n\n\t\tif (currentDirectory == null)\n\t\t\tabsolute = true;\n\n\t\tconst directory = absolute ? virtualRoot?.navigate(path) : currentDirectory.navigate(path);\n\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t\tpushState(directory.path);\n\t\t}\n\t}, [currentDirectory, pushState, virtualRoot]);\n\n\tuseEffect(() => {\n\t\tif (history.length === 0)\n\t\t\treturn;\n\n\t\tconst path = history[stateIndex];\n\t\tconst directory = virtualRoot?.navigate(path);\n\t\tif (directory != null) {\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t}\n\t}, [history, stateIndex, virtualRoot]);\n\n\tuseEffect(() => {\n\t\ttype Error = { message: string };\n\t\tconst onError = (error: unknown) => {\n\t\t\talert({\n\t\t\t\ttitle: (error as Error).message,\n\t\t\t\ttext: \"You have exceeded the virtual drive capacity. Files and folders will not be saved until more storage is freed.\",\n\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\tsize: new Vector2(300, 200),\n\t\t\t\tsingle: true,\n\t\t\t});\n\t\t};\n\n\t\tvirtualRoot?.on(VirtualRoot.EVENT_NAMES.error, onError);\n\n\t\treturn () => {\n\t\t\tvirtualRoot?.off(VirtualRoot.EVENT_NAMES.error, onError);\n\t\t};\n\t}, []);\n\n\tconst onPathChange = (event: Event) => {\n\t\tsetPath((event.target as HTMLInputElement).value);\n\t};\n\n\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\tlet value = (event.target as HTMLInputElement).value;\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tif (value === \"\")\n\t\t\t\tvalue = \"~\";\n\n\t\t\tconst directory = virtualRoot?.navigate(value);\n\n\t\t\tif (directory == null) {\n\t\t\t\topenWindowedModal({\n\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t<p>Invalid path: \"{value}\"</p>\n\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetCurrentDirectory(directory as VirtualFolder);\n\t\t\tsetPath(directory.root ? \"/\" : directory.path);\n\t\t}\n\t};\n\n\tconst itemCount = currentDirectory.getItemCount(showHidden);\n\n\treturn (\n\t\t<div className={!isSelector ? styles.FileExplorer : `${styles.FileExplorer} ${styles.Selector}`}>\n\t\t\t<div className={styles.Header}>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Back\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { undo(); }}\n\t\t\t\t\tdisabled={!undoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretLeft}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Forward\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { redo(); }}\n\t\t\t\t\tdisabled={!redoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Up\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { changeDirectory(\"..\"); }}\n\t\t\t\t\tdisabled={currentDirectory.isRoot != null && currentDirectory.isRoot}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faArrowUp}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"New\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\topenWindowedModal({\n\t\t\t\t\t\t\ttitle: \"Error\",\n\t\t\t\t\t\t\ticonUrl: app?.iconUrl as string | undefined,\n\t\t\t\t\t\t\tsize: new Vector2(300, 150),\n\t\t\t\t\t\t\tModal: (props: JSX.IntrinsicAttributes & ModalProps) =>\n\t\t\t\t\t\t\t\t<DialogBox {...props}>\n\t\t\t\t\t\t\t\t\t<p>This folder is protected.</p>\n\t\t\t\t\t\t\t\t\t<button data-type={ModalsConfig.DIALOG_CONTENT_TYPES.closeButton}>Ok</button>\n\t\t\t\t\t\t\t\t</DialogBox>,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// if (currentDirectory.canBeEdited) {\n\t\t\t\t\t\t// \tonNew(event);\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// }\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={!currentDirectory.canBeEdited}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faPlus}/>\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tvalue={path}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label=\"Path\"\n\t\t\t\t\tclassName={styles.PathInput}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tonChange={onPathChange as unknown as ChangeEventHandler}\n\t\t\t\t\tonKeyDown={onKeyDown as unknown as KeyboardEventHandler}\n\t\t\t\t\tplaceholder=\"Enter a path...\"\n\t\t\t\t/>\n\t\t\t\t<ImportButton directory={currentDirectory}/>\n\t\t\t\t<button title=\"Search\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faSearch}/>\n\t\t\t\t</button>\n\t\t\t\t<button title=\"Settings\" tabIndex={0} className={styles.IconButton}>\n\t\t\t\t\t<FontAwesomeIcon icon={faCog}/>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div className={styles.Body}>\n\t\t\t\t<div className={styles.Sidebar}>\n\t\t\t\t\t<QuickAccessButton name={\"Home\"} onClick={() => { changeDirectory(\"~\"); }} icon={faHouse}/>\n\t\t\t\t\t<QuickAccessButton name={\"Desktop\"} onClick={() => { changeDirectory(\"~/Desktop\"); }} icon={faDesktop}/>\n\t\t\t\t\t<QuickAccessButton name={\"Images\"} onClick={() => { changeDirectory(\"~/Pictures\"); }} icon={faImage}/>\n\t\t\t\t\t<QuickAccessButton name={\"Documents\"} onClick={() => { changeDirectory(\"~/Documents\"); }} icon={faFileLines}/>\n\t\t\t\t</div>\n\t\t\t\t<DirectoryList\n\t\t\t\t\tdirectory={currentDirectory} \n\t\t\t\t\tid=\"main\"\n\t\t\t\t\tclassName={styles.Main}\n\t\t\t\t\tshowHidden={showHidden}\n\t\t\t\t\tonOpenFile={(event, file) => {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tif (isSelector)\n\t\t\t\t\t\t\treturn void onSelectionFinish?.();\n\t\t\t\t\t\tconst options: Record<string, string> = {};\n\t\t\t\t\t\tif (file.extension === \"md\" || (file.extension != null && CODE_EXTENSIONS.includes(file.extension)))\n\t\t\t\t\t\t\toptions.mode = \"view\";\n\t\t\t\t\t\twindowsManager?.openFile(file, options);\n\t\t\t\t\t}}\n\t\t\t\t\tonOpenFolder={(_event, folder) => {\n\t\t\t\t\t\tchangeDirectory((folder as VirtualFolderLink).linkedPath ?? folder.name);\n\t\t\t\t\t}}\n\t\t\t\t\tonContextMenuFile={onContextMenuFile as unknown as FileEventHandler}\n\t\t\t\t\tonContextMenuFolder={onContextMenuFolder as unknown as FolderEventHandler}\n\t\t\t\t\tallowMultiSelect={selectorMode !== SELECTOR_MODE.SINGLE}\n\t\t\t\t\tonSelectionChange={onSelectionChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{!isSelector\n\t\t\t\t? <span className={styles.Footer}>\n\t\t\t\t\t<p className={utilStyles.TextLight}>\n\t\t\t\t\t\t{itemCount === 1\n\t\t\t\t\t\t\t? itemCount + \" item\"\n\t\t\t\t\t\t\t: itemCount + \" items\"\n\t\t\t\t\t\t}\n\t\t\t\t\t</p>\n\t\t\t\t</span>\n\t\t\t\t: <div className={styles.Footer}>\n\t\t\t\t\t<Footer/>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t);\n}","export enum FileSelectorMode {\n\tNone = 0,\n\tSingle = 1,\n\tMulti = 2\n}","import { App, AppsConfig } from \"@prozilla-os/core\";\nimport { FileExplorer, FileExplorerProps } from \"./components/FileExplorer\";\n\nconst fileExplorer = new App<FileExplorerProps>(\"File Explorer\", \"file-explorer\", FileExplorer)\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/file-explorer.svg\")\n\t.setRole(AppsConfig.APP_ROLES.fileExplorer)\n\t.setCategory(\"Utilities & tools\");\nfileExplorer.setMetadata({ name: \"@prozilla-os/file-explorer\", version: \"1.1.16\", author: \"Prozilla\" });\n\n\nexport { fileExplorer };\nexport { FileSelectorMode } from \"./types/utils\";"],"names":["QuickAccessButton","onClick","icon","name","jsxs","styles","utilStyles","jsx","FontAwesomeIcon","ImportButton","directory","onChange","event","files","file","extension","VirtualFile","reader","result","virtualFile","faDownload","SELECTOR_MODE","FileProperties","modal","params","props","appsConfig","useSystemManager","associatedApp","WindowedModal","ImagePreview","StorageManager","FileExplorer","app","startPath","selectorMode","Footer","onSelectionChange","onSelectionFinish","isSelector","virtualRoot","useVirtualRoot","windowsManager","useWindowsManager","windowsConfig","currentDirectory","setCurrentDirectory","useState","path","setPath","showHidden","history","stateIndex","pushState","undo","redo","undoAvailable","redoAvailable","useHistory","alert","useAlert","openWindowedModal","useWindowedModal","onContextMenuFile","useContextMenu","Actions","ClickAction","_event","_a","faUpload","faTrash","faCircleInfo","Vector2","onContextMenuFolder","folder","changeDirectory","Divider","useCallback","absolute","useEffect","onError","error","VirtualRoot","onPathChange","onKeyDown","value","DialogBox","ModalsConfig","itemCount","faCaretLeft","faCaretRight","faArrowUp","faPlus","faSearch","faCog","faHouse","faDesktop","faImage","faFileLines","DirectoryList","options","CODE_EXTENSIONS","FileSelectorMode","fileExplorer","App","AppsConfig"],"mappings":";;;;;;;;;;;;;;;;;AAWO,SAASA,EAAkB,EAAE,SAAAC,GAAS,MAAAC,GAAM,MAAAC,KAA0B;AAE3E,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,WAAW,GAAGC,EAAO,SAAS,IAAIC,EAAW,YAAY;AAAA,MACzD,SAAAL;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAM,EAACC,KAAgB,MAAAN,GAAW;AAAA,QAC3BC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGJ;ACZgB,SAAAM,GAAa,EAAE,WAAAC,KAA8C;AACtE,QAAAC,IAAW,CAACC,MAAsB;AACjC,UAAAC,IAASD,EAAM,OAA4B;AAEjD,IAAIC,KAAS,QAGb,MAAM,KAAKA,CAAK,EAAE,QAAQ,CAACC,MAAe;AACzC,YAAM,EAAE,MAAAX,GAAM,WAAAY,MAAcC,GAAY,QAAQF,EAAK,IAAI,GAEnDG,IAAS,IAAI;AACZ,MAAAA,EAAA,SAAS,CAACL,MAAiB;AAC3B,cAAA,EAAE,QAAAM,EAAO,IAAIN,EAAM;AAGzB,QAAAF,EAAU,WAAWP,GAAMY,GAAiC,CAACI,MAAgB;AAC5E,UAAAA,EAAY,UAAUD,CAAgB;AAAA,QAAA,CACtC;AAAA,MAAA,GAEFD,EAAO,cAAcH,CAAI;AAAA,IAAA,CACzB;AAAA,EAAA;AAGK,SAAA,gBAAAV,EAAC,WAAM,OAAM,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BAAAE,EAAA6B,GAAA,CAAM,CAAA,GACR,IAVE,gBAAA7B,EAAC,QAAK,EAAA,WAAWF,EAAO,QACzB,UAAC,gBAAAE,EAAA,KAAA,EAAE,WAAWD,EAAW,WACvB,UAAAkF,MAAc,IACZA,IAAY,UACZA,IAAY,SAEhB,CAAA,EACD,CAAA;AAAA,EAKF,EAAA,CAAA;AAEF;AC3RY,IAAAc,uBAAAA,OACXA,EAAAA,EAAA,OAAO,CAAP,IAAA,QACAA,EAAAA,EAAA,SAAS,CAAT,IAAA,UACAA,EAAAA,EAAA,QAAQ,CAAR,IAAA,SAHWA,IAAAA,MAAA,CAAA,CAAA;ACGZ,MAAMC,KAAe,IAAIC,GAAuB,iBAAiB,iBAAiBxE,EAAY,EAC5F,WAAW,6DAA6D,EACxE,QAAQyE,GAAW,UAAU,YAAY,EACzC,YAAY,mBAAmB;AACjCF,GAAa,YAAY,EAAE,MAAM,8BAA8B,SAAS,UAAU,QAAQ,YAAY;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prozilla-os/file-explorer",
3
3
  "description": "A standard ProzillaOS application for browsing files.",
4
- "version": "1.1.15",
4
+ "version": "1.1.17",
5
5
  "homepage": "https://os.prozilla.dev/file-explorer",
6
6
  "author": {
7
7
  "name": "Prozilla",
@@ -23,7 +23,7 @@
23
23
  "@fortawesome/free-solid-svg-icons": "^6.5.2",
24
24
  "@fortawesome/react-fontawesome": "^0.2.2",
25
25
  "react": "^18.3.1",
26
- "@prozilla-os/core": "1.3.10"
26
+ "@prozilla-os/core": "1.3.12"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^20.14.5",
@@ -33,7 +33,7 @@
33
33
  "vite": "^5.4.8",
34
34
  "vite-plugin-dts": "^3.9.1",
35
35
  "vite-plugin-lib-inject-css": "^2.1.1",
36
- "@prozilla-os/dev-tools": "1.1.7"
36
+ "@prozilla-os/dev-tools": "1.1.9"
37
37
  },
38
38
  "files": [
39
39
  "dist"