@prozilla-os/file-explorer 1.1.12 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +87 -87
- package/dist/main.js.map +1 -1
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import { utilStyles as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useState as
|
|
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
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
|
|
7
|
-
const
|
|
8
|
-
FileExplorer:
|
|
9
|
-
Header:
|
|
10
|
-
IconButton:
|
|
11
|
-
PathInput:
|
|
12
|
-
Body:
|
|
13
|
-
Sidebar:
|
|
14
|
-
NavButton:
|
|
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
15
|
Main: ke,
|
|
16
16
|
Footer: De,
|
|
17
17
|
Selector: Me
|
|
18
18
|
};
|
|
19
|
-
function E({ onClick: o, icon: h, name:
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
function E({ onClick: o, icon: h, name: i }) {
|
|
20
|
+
return /* @__PURE__ */ c(
|
|
21
21
|
"button",
|
|
22
22
|
{
|
|
23
23
|
tabIndex: 0,
|
|
24
|
-
className: `${
|
|
24
|
+
className: `${a.NavButton} ${L.TextSemibold}`,
|
|
25
25
|
onClick: o,
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ e(m, { icon: h }),
|
|
28
|
-
|
|
28
|
+
i
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
function Oe({ directory: o }) {
|
|
34
|
-
const h = (
|
|
35
|
-
const _ =
|
|
34
|
+
const h = (i) => {
|
|
35
|
+
const _ = i.target.files;
|
|
36
36
|
_ != null && Array.from(_).forEach((p) => {
|
|
37
37
|
const { name: u, extension: N } = te.splitId(p.name), r = new FileReader();
|
|
38
38
|
r.onload = (I) => {
|
|
39
39
|
const { result: y } = I.target;
|
|
40
|
-
o.createFile(u, N, (
|
|
41
|
-
|
|
40
|
+
o.createFile(u, N, (l) => {
|
|
41
|
+
l.setSource(y);
|
|
42
42
|
});
|
|
43
43
|
}, r.readAsDataURL(p);
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ c("label", { title: "Import", tabIndex: 0, className: a.IconButton, children: [
|
|
47
47
|
/* @__PURE__ */ e(
|
|
48
48
|
"input",
|
|
49
49
|
{
|
|
@@ -68,52 +68,52 @@ const G = {
|
|
|
68
68
|
Line: $e,
|
|
69
69
|
AppIcon: He
|
|
70
70
|
};
|
|
71
|
-
function Ve({ modal: o, params: h, file:
|
|
72
|
-
const { appsConfig: p } = W(), u =
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */ e(D, { className: d.Icon, source:
|
|
76
|
-
/* @__PURE__ */ e("p", { className: `${d.Line} ${
|
|
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 })
|
|
77
77
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ c("span", { className: d.Section, children: [
|
|
79
|
+
/* @__PURE__ */ c("p", { className: d.Line, children: [
|
|
80
80
|
"Type: ",
|
|
81
|
-
|
|
81
|
+
i.getType()
|
|
82
82
|
] }),
|
|
83
|
-
u != null && /* @__PURE__ */
|
|
83
|
+
u != null && /* @__PURE__ */ c("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__ */
|
|
90
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ c("span", { className: d.Section, children: [
|
|
90
|
+
/* @__PURE__ */ c("p", { className: d.Line, children: [
|
|
91
91
|
"Location: ",
|
|
92
|
-
|
|
92
|
+
i.path
|
|
93
93
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ c("p", { className: d.Line, children: [
|
|
95
95
|
"Size: ",
|
|
96
|
-
M.getByteSize(
|
|
96
|
+
M.getByteSize(i.source ?? i.content),
|
|
97
97
|
" bytes"
|
|
98
98
|
] }),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ c("p", { className: d.Line, children: [
|
|
100
100
|
"Size on drive: ",
|
|
101
|
-
M.getByteSize(
|
|
101
|
+
M.getByteSize(i.toString()),
|
|
102
102
|
" bytes"
|
|
103
103
|
] })
|
|
104
104
|
] }),
|
|
105
|
-
/* @__PURE__ */ e("span", { className: d.Section, children: /* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ e("span", { className: d.Section, children: /* @__PURE__ */ c("p", { className: d.Line, children: [
|
|
106
106
|
"Attributes: ",
|
|
107
|
-
|
|
107
|
+
i.isProtected ? "Protected" : "N/A"
|
|
108
108
|
] }) })
|
|
109
109
|
] });
|
|
110
110
|
}
|
|
111
|
-
function Ge({ app: o, path: h, selectorMode:
|
|
112
|
-
const N = _ != null &&
|
|
113
|
-
Actions: (s) => /* @__PURE__ */
|
|
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
114
|
/* @__PURE__ */ e(x, { label: N ? "Select" : "Open", onTrigger: (t, n) => {
|
|
115
115
|
if (N) {
|
|
116
|
-
p == null || p({ files: [n.id], directory:
|
|
116
|
+
p == null || p({ files: [n.id], directory: l }), u == null || u();
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
I != null && n.open(I);
|
|
@@ -122,20 +122,20 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
122
122
|
n.delete();
|
|
123
123
|
} }),
|
|
124
124
|
/* @__PURE__ */ e(x, { label: "Properties", icon: _e, onTrigger: (t, n) => {
|
|
125
|
-
|
|
125
|
+
C({
|
|
126
126
|
title: `${n.id} ${y.titleSeparator} Properties`,
|
|
127
127
|
iconUrl: n.getIconUrl(),
|
|
128
128
|
size: new b(400, 500),
|
|
129
|
-
Modal: (
|
|
129
|
+
Modal: (P) => /* @__PURE__ */ e(Ve, { file: n, ...P })
|
|
130
130
|
});
|
|
131
131
|
} })
|
|
132
132
|
] })
|
|
133
133
|
}), { onContextMenu: Z } = O({
|
|
134
|
-
Actions: (s) => /* @__PURE__ */
|
|
134
|
+
Actions: (s) => /* @__PURE__ */ c(U, { ...s, children: [
|
|
135
135
|
/* @__PURE__ */ e(x, { label: "Open", onTrigger: (t, n) => {
|
|
136
136
|
g(n.linkedPath ?? n.name);
|
|
137
137
|
} }),
|
|
138
|
-
/* @__PURE__ */ e(
|
|
138
|
+
/* @__PURE__ */ e(ae, {}),
|
|
139
139
|
/* @__PURE__ */ e(x, { label: "Delete", icon: V, onTrigger: (t, n) => {
|
|
140
140
|
n.delete();
|
|
141
141
|
} })
|
|
@@ -143,16 +143,16 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
143
143
|
}), g = me((s, t = !1) => {
|
|
144
144
|
if (s == null)
|
|
145
145
|
return;
|
|
146
|
-
|
|
147
|
-
const n = t ? r == null ? void 0 : r.navigate(s) :
|
|
148
|
-
n != null && (
|
|
149
|
-
}, [
|
|
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]);
|
|
150
150
|
H(() => {
|
|
151
|
-
if (
|
|
151
|
+
if (B.length === 0)
|
|
152
152
|
return;
|
|
153
|
-
const s =
|
|
154
|
-
t != null && (
|
|
155
|
-
}, [
|
|
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
156
|
const s = (t) => {
|
|
157
157
|
q({
|
|
158
158
|
title: t.message,
|
|
@@ -174,12 +174,12 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
174
174
|
t === "" && (t = "~");
|
|
175
175
|
const n = r == null ? void 0 : r.navigate(t);
|
|
176
176
|
if (n == null) {
|
|
177
|
-
|
|
177
|
+
C({
|
|
178
178
|
title: "Error",
|
|
179
179
|
iconUrl: o == null ? void 0 : o.iconUrl,
|
|
180
180
|
size: new b(300, 150),
|
|
181
|
-
Modal: (
|
|
182
|
-
/* @__PURE__ */
|
|
181
|
+
Modal: (P) => /* @__PURE__ */ c(z, { ...P, children: [
|
|
182
|
+
/* @__PURE__ */ c("p", { children: [
|
|
183
183
|
'Invalid path: "',
|
|
184
184
|
t,
|
|
185
185
|
'"'
|
|
@@ -189,17 +189,17 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
189
189
|
});
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
v(n), f(n.root ? "/" : n.path);
|
|
193
193
|
}
|
|
194
|
-
},
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
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: [
|
|
197
197
|
/* @__PURE__ */ e(
|
|
198
198
|
"button",
|
|
199
199
|
{
|
|
200
200
|
title: "Back",
|
|
201
201
|
tabIndex: 0,
|
|
202
|
-
className:
|
|
202
|
+
className: a.IconButton,
|
|
203
203
|
onClick: () => {
|
|
204
204
|
j();
|
|
205
205
|
},
|
|
@@ -212,7 +212,7 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
212
212
|
{
|
|
213
213
|
title: "Forward",
|
|
214
214
|
tabIndex: 0,
|
|
215
|
-
className:
|
|
215
|
+
className: a.IconButton,
|
|
216
216
|
onClick: () => {
|
|
217
217
|
K();
|
|
218
218
|
},
|
|
@@ -225,11 +225,11 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
225
225
|
{
|
|
226
226
|
title: "Up",
|
|
227
227
|
tabIndex: 0,
|
|
228
|
-
className:
|
|
228
|
+
className: a.IconButton,
|
|
229
229
|
onClick: () => {
|
|
230
230
|
g("..");
|
|
231
231
|
},
|
|
232
|
-
disabled:
|
|
232
|
+
disabled: l.isRoot != null && l.isRoot,
|
|
233
233
|
children: /* @__PURE__ */ e(m, { icon: ge })
|
|
234
234
|
}
|
|
235
235
|
),
|
|
@@ -238,19 +238,19 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
238
238
|
{
|
|
239
239
|
title: "New",
|
|
240
240
|
tabIndex: 0,
|
|
241
|
-
className:
|
|
241
|
+
className: a.IconButton,
|
|
242
242
|
onClick: () => {
|
|
243
|
-
|
|
243
|
+
C({
|
|
244
244
|
title: "Error",
|
|
245
245
|
iconUrl: o == null ? void 0 : o.iconUrl,
|
|
246
246
|
size: new b(300, 150),
|
|
247
|
-
Modal: (s) => /* @__PURE__ */
|
|
247
|
+
Modal: (s) => /* @__PURE__ */ c(z, { ...s, children: [
|
|
248
248
|
/* @__PURE__ */ e("p", { children: "This folder is protected." }),
|
|
249
249
|
/* @__PURE__ */ e("button", { "data-type": $.DIALOG_CONTENT_TYPES.closeButton, children: "Ok" })
|
|
250
250
|
] })
|
|
251
251
|
});
|
|
252
252
|
},
|
|
253
|
-
disabled: !
|
|
253
|
+
disabled: !l.canBeEdited,
|
|
254
254
|
children: /* @__PURE__ */ e(m, { icon: xe })
|
|
255
255
|
}
|
|
256
256
|
),
|
|
@@ -260,19 +260,19 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
260
260
|
value: Y,
|
|
261
261
|
type: "text",
|
|
262
262
|
"aria-label": "Path",
|
|
263
|
-
className:
|
|
263
|
+
className: a.PathInput,
|
|
264
264
|
tabIndex: 0,
|
|
265
265
|
onChange: R,
|
|
266
266
|
onKeyDown: ee,
|
|
267
267
|
placeholder: "Enter a path..."
|
|
268
268
|
}
|
|
269
269
|
),
|
|
270
|
-
/* @__PURE__ */ e(Oe, { directory:
|
|
271
|
-
/* @__PURE__ */ e("button", { title: "Search", tabIndex: 0, className:
|
|
272
|
-
/* @__PURE__ */ e("button", { title: "Settings", tabIndex: 0, className:
|
|
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 }) })
|
|
273
273
|
] }),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ c("div", { className: a.Body, children: [
|
|
275
|
+
/* @__PURE__ */ c("div", { className: a.Sidebar, children: [
|
|
276
276
|
/* @__PURE__ */ e(E, { name: "Home", onClick: () => {
|
|
277
277
|
g("~");
|
|
278
278
|
}, icon: Ee }),
|
|
@@ -281,18 +281,18 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
281
281
|
}, icon: ye }),
|
|
282
282
|
/* @__PURE__ */ e(E, { name: "Images", onClick: () => {
|
|
283
283
|
g("~/Pictures");
|
|
284
|
-
}, icon:
|
|
284
|
+
}, icon: ve }),
|
|
285
285
|
/* @__PURE__ */ e(E, { name: "Documents", onClick: () => {
|
|
286
286
|
g("~/Documents");
|
|
287
|
-
}, icon:
|
|
287
|
+
}, icon: Be })
|
|
288
288
|
] }),
|
|
289
289
|
/* @__PURE__ */ e(
|
|
290
|
-
|
|
290
|
+
le,
|
|
291
291
|
{
|
|
292
|
-
directory:
|
|
292
|
+
directory: l,
|
|
293
293
|
id: "main",
|
|
294
|
-
className:
|
|
295
|
-
showHidden:
|
|
294
|
+
className: a.Main,
|
|
295
|
+
showHidden: T,
|
|
296
296
|
onOpenFile: (s, t) => {
|
|
297
297
|
if (s.preventDefault(), N)
|
|
298
298
|
return void (u == null ? void 0 : u());
|
|
@@ -304,17 +304,17 @@ function Ge({ app: o, path: h, selectorMode: a, Footer: _, onSelectionChange: p,
|
|
|
304
304
|
},
|
|
305
305
|
onContextMenuFile: J,
|
|
306
306
|
onContextMenuFolder: Z,
|
|
307
|
-
allowMultiSelect:
|
|
307
|
+
allowMultiSelect: i !== G.SINGLE,
|
|
308
308
|
onSelectionChange: p
|
|
309
309
|
}
|
|
310
310
|
)
|
|
311
311
|
] }),
|
|
312
|
-
N ? /* @__PURE__ */ e("div", { className:
|
|
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" }) })
|
|
313
313
|
] });
|
|
314
314
|
}
|
|
315
315
|
var We = /* @__PURE__ */ ((o) => (o[o.None = 0] = "None", o[o.Single = 1] = "Single", o[o.Multi = 2] = "Multi", o))(We || {});
|
|
316
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.
|
|
317
|
+
Ye.setMetadata({ name: "@prozilla-os/file-explorer", version: "1.1.12", author: "Prozilla" });
|
|
318
318
|
export {
|
|
319
319
|
We as FileSelectorMode,
|
|
320
320
|
Ye as fileExplorer
|
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.11\", 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;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,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\";\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.12\", 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,IAA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;AAAA,UAChC;AAAA,UACA,cAAc,CAAC/B,GAAQK,MAAW;AAChB,YAAAC,EAAAD,EAA6B,cAAcA,EAAO,IAAI;AAAA,UACxE;AAAA,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;"}
|
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.
|
|
4
|
+
"version": "1.1.14",
|
|
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.
|
|
26
|
+
"@prozilla-os/core": "1.3.9"
|
|
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.
|
|
36
|
+
"@prozilla-os/dev-tools": "1.1.6"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist"
|