@prozilla-os/file-explorer 1.1.19 → 1.1.21
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.d.ts +1027 -3
- package/dist/main.js +192 -198
- package/dist/main.js.map +1 -1
- package/package.json +11 -9
package/dist/main.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
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
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { FontAwesomeIcon as
|
|
6
|
-
import { faDownload as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { utilStyles as A, VirtualFile as te, useSystemManager as G, WindowedModal as ne, ImagePreview as L, StorageManager as k, useVirtualRoot as oe, useWindowsManager as ie, useHistory as re, useAlert as ae, useWindowedModal as le, useContextMenu as O, Actions as M, ClickAction as x, Divider as se, VirtualRoot as R, DialogBox as U, ModalsConfig as z, DirectoryList as ce, CODE_EXTENSIONS as de, App as ue, AppsConfig as pe } from "@prozilla-os/core";
|
|
3
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { useState as P, useCallback as me, useEffect as $ } from "react";
|
|
5
|
+
import { FontAwesomeIcon as p } from "@fortawesome/react-fontawesome";
|
|
6
|
+
import { faDownload as he, faUpload as _e, faTrash as H, faCircleInfo as ge, faCaretLeft as Ne, faCaretRight as xe, faArrowUp as Ie, faPlus as be, faSearch as fe, faCog as ve, faHouse as Ee, faDesktop as ye, faImage as Se, faFileLines as Ce } from "@fortawesome/free-solid-svg-icons";
|
|
7
|
+
import { Vector2 as f } from "@prozilla-os/shared";
|
|
8
|
+
const Be = "_FileExplorer_lr5mr_1", we = "_Header_lr5mr_13", Pe = "_IconButton_lr5mr_23", Ae = "_PathInput_lr5mr_69", Fe = "_Body_lr5mr_80", Te = "_Sidebar_lr5mr_88", De = "_NavButton_lr5mr_102", Le = "_Main_lr5mr_125", ke = "_Footer_lr5mr_139", Oe = "_Selector_lr5mr_158", a = {
|
|
9
|
+
FileExplorer: Be,
|
|
10
|
+
Header: we,
|
|
11
|
+
IconButton: Pe,
|
|
12
|
+
PathInput: Ae,
|
|
13
|
+
Body: Fe,
|
|
14
|
+
Sidebar: Te,
|
|
14
15
|
NavButton: De,
|
|
15
|
-
Main:
|
|
16
|
-
Footer:
|
|
17
|
-
Selector:
|
|
16
|
+
Main: Le,
|
|
17
|
+
Footer: ke,
|
|
18
|
+
Selector: Oe
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
function v({ onClick: l, icon: m, name: r }) {
|
|
21
|
+
return /* @__PURE__ */ i(
|
|
21
22
|
"button",
|
|
22
23
|
{
|
|
23
24
|
tabIndex: 0,
|
|
24
|
-
className: `${
|
|
25
|
-
onClick:
|
|
25
|
+
className: `${a.NavButton} ${A.TextSemibold}`,
|
|
26
|
+
onClick: l,
|
|
26
27
|
children: [
|
|
27
|
-
/* @__PURE__ */ e(
|
|
28
|
-
|
|
28
|
+
/* @__PURE__ */ e(p, { icon: m }),
|
|
29
|
+
r
|
|
29
30
|
]
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const { name: u, extension: g } =
|
|
38
|
-
|
|
39
|
-
const { result:
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
function Me({ directory: l }) {
|
|
35
|
+
const m = (r) => {
|
|
36
|
+
const h = r.target.files;
|
|
37
|
+
h != null && Array.from(h).forEach((_) => {
|
|
38
|
+
const { name: u, extension: g } = te.splitId(_.name), d = new FileReader();
|
|
39
|
+
d.onload = (I) => {
|
|
40
|
+
const { result: E } = I.target;
|
|
41
|
+
l.createFile(u, g, (s) => {
|
|
42
|
+
s.setSource(E);
|
|
42
43
|
});
|
|
43
|
-
},
|
|
44
|
+
}, d.readAsDataURL(_);
|
|
44
45
|
});
|
|
45
46
|
};
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ i("label", { title: "Import", tabIndex: 0, className: a.IconButton, children: [
|
|
47
48
|
/* @__PURE__ */ e(
|
|
48
49
|
"input",
|
|
49
50
|
{
|
|
@@ -51,166 +52,159 @@ function Fe({ directory: n }) {
|
|
|
51
52
|
id: "import",
|
|
52
53
|
multiple: !0,
|
|
53
54
|
style: { display: "none" },
|
|
54
|
-
onChange:
|
|
55
|
+
onChange: m
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
|
-
/* @__PURE__ */ e(
|
|
58
|
+
/* @__PURE__ */ e(p, { icon: he })
|
|
58
59
|
] });
|
|
59
60
|
}
|
|
60
|
-
const
|
|
61
|
+
const V = {
|
|
61
62
|
NONE: 0,
|
|
62
|
-
SINGLE: 1
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
AppIcon: Ge
|
|
63
|
+
SINGLE: 1
|
|
64
|
+
}, Re = "_FileProperties_xi8b6_1", Ue = "_Icon_xi8b6_9", ze = "_Section_xi8b6_25", $e = "_Line_xi8b6_46", He = "_AppIcon_xi8b6_68", c = {
|
|
65
|
+
FileProperties: Re,
|
|
66
|
+
Icon: Ue,
|
|
67
|
+
Section: ze,
|
|
68
|
+
Line: $e,
|
|
69
|
+
AppIcon: He
|
|
70
70
|
};
|
|
71
|
-
function
|
|
72
|
-
const { appsConfig:
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */ e(
|
|
76
|
-
/* @__PURE__ */ e("p", { className: `${
|
|
71
|
+
function Ve({ modal: l, params: m, file: r, ...h }) {
|
|
72
|
+
const { appsConfig: _ } = G(), u = r.extension != null ? _.getAppByFileExtension(r.extension) : null;
|
|
73
|
+
return /* @__PURE__ */ i(ne, { className: c.FileProperties, modal: l, params: m, ...h, children: [
|
|
74
|
+
/* @__PURE__ */ i("span", { className: c.Section, children: [
|
|
75
|
+
/* @__PURE__ */ e(L, { className: c.Icon, source: r.getIconUrl() }),
|
|
76
|
+
/* @__PURE__ */ e("p", { className: `${c.Line} ${A.TextBold}`, children: r.id })
|
|
77
77
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ i("span", { className: c.Section, children: [
|
|
79
|
+
/* @__PURE__ */ i("p", { className: c.Line, children: [
|
|
80
80
|
"Type: ",
|
|
81
|
-
|
|
81
|
+
r.getType()
|
|
82
82
|
] }),
|
|
83
|
-
u != null && /* @__PURE__ */
|
|
83
|
+
u != null && /* @__PURE__ */ i("span", { className: c.Line, children: [
|
|
84
84
|
"Opens with:",
|
|
85
|
-
/* @__PURE__ */ e(
|
|
85
|
+
/* @__PURE__ */ e(L, { className: c.AppIcon, source: u.iconUrl ?? "" }),
|
|
86
86
|
u.name
|
|
87
87
|
] })
|
|
88
88
|
] }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ i("span", { className: c.Section, children: [
|
|
90
|
+
/* @__PURE__ */ i("p", { className: c.Line, children: [
|
|
91
91
|
"Location: ",
|
|
92
|
-
|
|
92
|
+
r.path
|
|
93
93
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ i("p", { className: c.Line, children: [
|
|
95
95
|
"Size: ",
|
|
96
|
-
|
|
96
|
+
k.getByteSize(r.source ?? r.content),
|
|
97
97
|
" bytes"
|
|
98
98
|
] }),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ i("p", { className: c.Line, children: [
|
|
100
100
|
"Size on drive: ",
|
|
101
|
-
|
|
101
|
+
k.getByteSize(r.toString()),
|
|
102
102
|
" bytes"
|
|
103
103
|
] })
|
|
104
104
|
] }),
|
|
105
|
-
/* @__PURE__ */ e("span", { className:
|
|
105
|
+
/* @__PURE__ */ e("span", { className: c.Section, children: /* @__PURE__ */ i("p", { className: c.Line, children: [
|
|
106
106
|
"Attributes: ",
|
|
107
|
-
|
|
107
|
+
r.isProtected ? "Protected" : "N/A"
|
|
108
108
|
] }) })
|
|
109
109
|
] });
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const g =
|
|
113
|
-
Actions: (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
}
|
|
139
|
-
}), { onContextMenu: Z } = O({
|
|
140
|
-
Actions: (r) => /* @__PURE__ */ l(U, { ...r, children: [
|
|
141
|
-
/* @__PURE__ */ e(b, { label: "Open", onTrigger: (t, i) => {
|
|
142
|
-
x(i.linkedPath ?? i.name);
|
|
111
|
+
function Ge({ app: l, path: m, selectorMode: r, Footer: h, onSelectionChange: _, onSelectionFinish: u }) {
|
|
112
|
+
const g = h != null && r != null && r !== V.NONE, d = oe(), I = ie(), { windowsConfig: E } = G(), [s, y] = P(d ? d.navigateToFolder(m ?? "~") : null), [W, b] = P(s?.path ?? ""), [F] = P(!0), { history: S, stateIndex: T, pushState: D, undo: Y, redo: j, undoAvailable: K, redoAvailable: Q } = re(s?.path ?? ""), { alert: X } = ae(), { openWindowedModal: C } = le(), { onContextMenu: q } = O({
|
|
113
|
+
Actions: (o) => /* @__PURE__ */ i(M, { ...o, children: [
|
|
114
|
+
/* @__PURE__ */ e(x, { label: g ? "Select" : "Open", onTrigger: (n, t) => {
|
|
115
|
+
if (g) {
|
|
116
|
+
_?.({ files: [t.id], directory: s }), u?.();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
I != null && t.open(I);
|
|
120
|
+
} }),
|
|
121
|
+
o.triggerParams.isDownloadable() && /* @__PURE__ */ e(x, { label: "Export", icon: _e, onTrigger: (n, t) => {
|
|
122
|
+
t.download();
|
|
123
|
+
} }),
|
|
124
|
+
/* @__PURE__ */ e(x, { label: "Delete", icon: H, onTrigger: (n, t) => {
|
|
125
|
+
t.delete();
|
|
143
126
|
} }),
|
|
144
|
-
/* @__PURE__ */ e(
|
|
145
|
-
|
|
146
|
-
|
|
127
|
+
/* @__PURE__ */ e(x, { label: "Properties", icon: ge, onTrigger: (n, t) => {
|
|
128
|
+
C({
|
|
129
|
+
title: `${t.id} ${E.titleSeparator} Properties`,
|
|
130
|
+
iconUrl: t.getIconUrl(),
|
|
131
|
+
size: new f(400, 500),
|
|
132
|
+
Modal: (w) => /* @__PURE__ */ e(Ve, { file: t, ...w })
|
|
133
|
+
});
|
|
147
134
|
} })
|
|
148
135
|
] })
|
|
149
|
-
}),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
136
|
+
}), { onContextMenu: J } = O({
|
|
137
|
+
Actions: (o) => /* @__PURE__ */ i(M, { ...o, children: [
|
|
138
|
+
/* @__PURE__ */ e(x, { label: "Open", onTrigger: (n, t) => {
|
|
139
|
+
N(t.linkedPath ?? t.name);
|
|
140
|
+
} }),
|
|
141
|
+
/* @__PURE__ */ e(se, {}),
|
|
142
|
+
/* @__PURE__ */ e(x, { label: "Delete", icon: H, onTrigger: (n, t) => {
|
|
143
|
+
t.delete();
|
|
144
|
+
} })
|
|
145
|
+
] })
|
|
146
|
+
}), N = me((o, n = !1) => {
|
|
147
|
+
s == null && (n = !0);
|
|
148
|
+
const t = n ? d?.navigate(o) : s?.navigate(o);
|
|
149
|
+
t != null && (y(t), b(t.root ? "/" : t.path), D(t.path));
|
|
150
|
+
}, [s, D, d]);
|
|
151
|
+
$(() => {
|
|
152
|
+
if (S.length === 0)
|
|
158
153
|
return;
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
}, [
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
title:
|
|
154
|
+
const o = S[T], n = d?.navigate(o);
|
|
155
|
+
n != null && (y(n), b(n.root ? "/" : n.path));
|
|
156
|
+
}, [S, T, d]), $(() => {
|
|
157
|
+
const o = (n) => {
|
|
158
|
+
X({
|
|
159
|
+
title: n.message,
|
|
165
160
|
text: "You have exceeded the virtual drive capacity. Files and folders will not be saved until more storage is freed.",
|
|
166
|
-
iconUrl:
|
|
167
|
-
size: new
|
|
161
|
+
iconUrl: l?.iconUrl,
|
|
162
|
+
size: new f(300, 200),
|
|
168
163
|
single: !0
|
|
169
164
|
});
|
|
170
165
|
};
|
|
171
|
-
return
|
|
172
|
-
|
|
166
|
+
return d?.on(R.ERROR_EVENT, o), () => {
|
|
167
|
+
d?.off(R.ERROR_EVENT, o);
|
|
173
168
|
};
|
|
174
169
|
}, []);
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
}, ee = (
|
|
178
|
-
let
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
-
|
|
170
|
+
const Z = (o) => {
|
|
171
|
+
b(o.target.value);
|
|
172
|
+
}, ee = (o) => {
|
|
173
|
+
let n = o.target.value;
|
|
174
|
+
if (o.key === "Enter") {
|
|
175
|
+
n === "" && (n = "~");
|
|
176
|
+
const t = d?.navigate(n);
|
|
177
|
+
if (t == null) {
|
|
178
|
+
C({
|
|
184
179
|
title: "Error",
|
|
185
|
-
iconUrl:
|
|
186
|
-
size: new
|
|
187
|
-
Modal: (
|
|
188
|
-
/* @__PURE__ */
|
|
180
|
+
iconUrl: l?.iconUrl,
|
|
181
|
+
size: new f(300, 150),
|
|
182
|
+
Modal: (w) => /* @__PURE__ */ i(U, { ...w, children: [
|
|
183
|
+
/* @__PURE__ */ i("p", { children: [
|
|
189
184
|
'Invalid path: "',
|
|
190
|
-
|
|
185
|
+
n,
|
|
191
186
|
'"'
|
|
192
187
|
] }),
|
|
193
|
-
/* @__PURE__ */ e("button", { "data-type":
|
|
188
|
+
/* @__PURE__ */ e("button", { "data-type": z.DIALOG_CONTENT_TYPES.closeButton, children: "Ok" })
|
|
194
189
|
] })
|
|
195
190
|
});
|
|
196
191
|
return;
|
|
197
|
-
}
|
|
198
|
-
B(i), f(i.root ? "/" : i.path);
|
|
192
|
+
} else t.isFolder() && (y(t), b(t.root ? "/" : t.path));
|
|
199
193
|
}
|
|
200
|
-
},
|
|
201
|
-
return /* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
194
|
+
}, B = s?.getItemCount(F) ?? 0;
|
|
195
|
+
return /* @__PURE__ */ i("div", { className: g ? `${a.FileExplorer} ${a.Selector}` : a.FileExplorer, children: [
|
|
196
|
+
/* @__PURE__ */ i("div", { className: a.Header, children: [
|
|
203
197
|
/* @__PURE__ */ e(
|
|
204
198
|
"button",
|
|
205
199
|
{
|
|
206
200
|
title: "Back",
|
|
207
201
|
tabIndex: 0,
|
|
208
|
-
className:
|
|
202
|
+
className: a.IconButton,
|
|
209
203
|
onClick: () => {
|
|
210
|
-
|
|
204
|
+
Y();
|
|
211
205
|
},
|
|
212
|
-
disabled: !
|
|
213
|
-
children: /* @__PURE__ */ e(
|
|
206
|
+
disabled: !K,
|
|
207
|
+
children: /* @__PURE__ */ e(p, { icon: Ne })
|
|
214
208
|
}
|
|
215
209
|
),
|
|
216
210
|
/* @__PURE__ */ e(
|
|
@@ -218,12 +212,12 @@ function Ye({ app: n, path: _, selectorMode: a, Footer: N, onSelectionChange: p,
|
|
|
218
212
|
{
|
|
219
213
|
title: "Forward",
|
|
220
214
|
tabIndex: 0,
|
|
221
|
-
className:
|
|
215
|
+
className: a.IconButton,
|
|
222
216
|
onClick: () => {
|
|
223
|
-
|
|
217
|
+
j();
|
|
224
218
|
},
|
|
225
|
-
disabled: !
|
|
226
|
-
children: /* @__PURE__ */ e(
|
|
219
|
+
disabled: !Q,
|
|
220
|
+
children: /* @__PURE__ */ e(p, { icon: xe })
|
|
227
221
|
}
|
|
228
222
|
),
|
|
229
223
|
/* @__PURE__ */ e(
|
|
@@ -231,12 +225,12 @@ function Ye({ app: n, path: _, selectorMode: a, Footer: N, onSelectionChange: p,
|
|
|
231
225
|
{
|
|
232
226
|
title: "Up",
|
|
233
227
|
tabIndex: 0,
|
|
234
|
-
className:
|
|
228
|
+
className: a.IconButton,
|
|
235
229
|
onClick: () => {
|
|
236
|
-
|
|
230
|
+
N("..");
|
|
237
231
|
},
|
|
238
|
-
disabled:
|
|
239
|
-
children: /* @__PURE__ */ e(
|
|
232
|
+
disabled: s?.isRoot != null && s.isRoot,
|
|
233
|
+
children: /* @__PURE__ */ e(p, { icon: Ie })
|
|
240
234
|
}
|
|
241
235
|
),
|
|
242
236
|
/* @__PURE__ */ e(
|
|
@@ -244,85 +238,85 @@ function Ye({ app: n, path: _, selectorMode: a, Footer: N, onSelectionChange: p,
|
|
|
244
238
|
{
|
|
245
239
|
title: "New",
|
|
246
240
|
tabIndex: 0,
|
|
247
|
-
className:
|
|
241
|
+
className: a.IconButton,
|
|
248
242
|
onClick: () => {
|
|
249
|
-
|
|
243
|
+
C({
|
|
250
244
|
title: "Error",
|
|
251
|
-
iconUrl:
|
|
252
|
-
size: new
|
|
253
|
-
Modal: (
|
|
245
|
+
iconUrl: l?.iconUrl,
|
|
246
|
+
size: new f(300, 150),
|
|
247
|
+
Modal: (o) => /* @__PURE__ */ i(U, { ...o, children: [
|
|
254
248
|
/* @__PURE__ */ e("p", { children: "This folder is protected." }),
|
|
255
|
-
/* @__PURE__ */ e("button", { "data-type":
|
|
249
|
+
/* @__PURE__ */ e("button", { "data-type": z.DIALOG_CONTENT_TYPES.closeButton, children: "Ok" })
|
|
256
250
|
] })
|
|
257
251
|
});
|
|
258
252
|
},
|
|
259
|
-
disabled: !
|
|
260
|
-
children: /* @__PURE__ */ e(
|
|
253
|
+
disabled: !s?.canBeEdited,
|
|
254
|
+
children: /* @__PURE__ */ e(p, { icon: be })
|
|
261
255
|
}
|
|
262
256
|
),
|
|
263
257
|
/* @__PURE__ */ e(
|
|
264
258
|
"input",
|
|
265
259
|
{
|
|
266
|
-
value:
|
|
260
|
+
value: W,
|
|
267
261
|
type: "text",
|
|
268
262
|
"aria-label": "Path",
|
|
269
|
-
className:
|
|
263
|
+
className: a.PathInput,
|
|
270
264
|
tabIndex: 0,
|
|
271
|
-
onChange:
|
|
265
|
+
onChange: Z,
|
|
272
266
|
onKeyDown: ee,
|
|
273
267
|
placeholder: "Enter a path..."
|
|
274
268
|
}
|
|
275
269
|
),
|
|
276
|
-
/* @__PURE__ */ e(
|
|
277
|
-
/* @__PURE__ */ e("button", { title: "Search", tabIndex: 0, className:
|
|
278
|
-
/* @__PURE__ */ e("button", { title: "Settings", tabIndex: 0, className:
|
|
270
|
+
/* @__PURE__ */ e(Me, { directory: s }),
|
|
271
|
+
/* @__PURE__ */ e("button", { title: "Search", tabIndex: 0, className: a.IconButton, children: /* @__PURE__ */ e(p, { icon: fe }) }),
|
|
272
|
+
/* @__PURE__ */ e("button", { title: "Settings", tabIndex: 0, className: a.IconButton, children: /* @__PURE__ */ e(p, { icon: ve }) })
|
|
279
273
|
] }),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */ e(
|
|
283
|
-
|
|
284
|
-
}, icon:
|
|
285
|
-
/* @__PURE__ */ e(
|
|
286
|
-
|
|
287
|
-
}, icon:
|
|
288
|
-
/* @__PURE__ */ e(
|
|
289
|
-
|
|
290
|
-
}, icon:
|
|
291
|
-
/* @__PURE__ */ e(
|
|
292
|
-
|
|
293
|
-
}, icon:
|
|
274
|
+
/* @__PURE__ */ i("div", { className: a.Body, children: [
|
|
275
|
+
/* @__PURE__ */ i("div", { className: a.Sidebar, children: [
|
|
276
|
+
/* @__PURE__ */ e(v, { name: "Home", onClick: () => {
|
|
277
|
+
N("~");
|
|
278
|
+
}, icon: Ee }),
|
|
279
|
+
/* @__PURE__ */ e(v, { name: "Desktop", onClick: () => {
|
|
280
|
+
N("~/Desktop");
|
|
281
|
+
}, icon: ye }),
|
|
282
|
+
/* @__PURE__ */ e(v, { name: "Images", onClick: () => {
|
|
283
|
+
N("~/Pictures");
|
|
284
|
+
}, icon: Se }),
|
|
285
|
+
/* @__PURE__ */ e(v, { name: "Documents", onClick: () => {
|
|
286
|
+
N("~/Documents");
|
|
287
|
+
}, icon: Ce })
|
|
294
288
|
] }),
|
|
295
289
|
/* @__PURE__ */ e(
|
|
296
|
-
|
|
290
|
+
ce,
|
|
297
291
|
{
|
|
298
|
-
directory:
|
|
292
|
+
directory: s,
|
|
299
293
|
id: "main",
|
|
300
|
-
className:
|
|
301
|
-
showHidden:
|
|
302
|
-
onOpenFile: (
|
|
303
|
-
if (
|
|
304
|
-
return void
|
|
305
|
-
const
|
|
306
|
-
(
|
|
294
|
+
className: a.Main,
|
|
295
|
+
showHidden: F,
|
|
296
|
+
onOpenFile: (o, n) => {
|
|
297
|
+
if (o.preventDefault(), g)
|
|
298
|
+
return void u?.();
|
|
299
|
+
const t = {};
|
|
300
|
+
(n.extension === "md" || n.extension != null && de.includes(n.extension)) && (t.mode = "view"), I?.openFile(n, t);
|
|
307
301
|
},
|
|
308
|
-
onOpenFolder: (
|
|
309
|
-
|
|
302
|
+
onOpenFolder: (o, n) => {
|
|
303
|
+
N(n.linkedPath ?? n.name);
|
|
310
304
|
},
|
|
311
|
-
onContextMenuFile:
|
|
312
|
-
onContextMenuFolder:
|
|
313
|
-
allowMultiSelect:
|
|
314
|
-
onSelectionChange:
|
|
305
|
+
onContextMenuFile: q,
|
|
306
|
+
onContextMenuFolder: J,
|
|
307
|
+
allowMultiSelect: r !== V.SINGLE,
|
|
308
|
+
onSelectionChange: _
|
|
315
309
|
}
|
|
316
310
|
)
|
|
317
311
|
] }),
|
|
318
|
-
g ? /* @__PURE__ */ e("div", { className:
|
|
312
|
+
g ? /* @__PURE__ */ e("div", { className: a.Footer, children: /* @__PURE__ */ e(h, {}) }) : /* @__PURE__ */ e("span", { className: a.Footer, children: /* @__PURE__ */ e("p", { className: A.TextLight, children: B === 1 ? B + " item" : B + " items" }) })
|
|
319
313
|
] });
|
|
320
314
|
}
|
|
321
|
-
var
|
|
322
|
-
const
|
|
323
|
-
|
|
315
|
+
var We = /* @__PURE__ */ ((l) => (l[l.None = 0] = "None", l[l.Single = 1] = "Single", l[l.Multi = 2] = "Multi", l))(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.19", author: "Prozilla" });
|
|
324
318
|
export {
|
|
325
|
-
|
|
326
|
-
|
|
319
|
+
We as FileSelectorMode,
|
|
320
|
+
Ye as fileExplorer
|
|
327
321
|
};
|
|
328
322
|
//# sourceMappingURL=main.js.map
|