@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.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 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,
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: Me,
16
- Footer: Oe,
17
- Selector: Ue
16
+ Main: Le,
17
+ Footer: ke,
18
+ Selector: Oe
18
19
  };
19
- function y({ onClick: n, icon: _, name: a }) {
20
- return /* @__PURE__ */ l(
20
+ function v({ onClick: l, icon: m, name: r }) {
21
+ return /* @__PURE__ */ i(
21
22
  "button",
22
23
  {
23
24
  tabIndex: 0,
24
- className: `${s.NavButton} ${w.TextSemibold}`,
25
- onClick: n,
25
+ className: `${a.NavButton} ${A.TextSemibold}`,
26
+ onClick: l,
26
27
  children: [
27
- /* @__PURE__ */ e(h, { icon: _ }),
28
- a
28
+ /* @__PURE__ */ e(p, { icon: m }),
29
+ r
29
30
  ]
30
31
  }
31
32
  );
32
33
  }
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);
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
- }, o.readAsDataURL(p);
44
+ }, d.readAsDataURL(_);
44
45
  });
45
46
  };
46
- return /* @__PURE__ */ l("label", { title: "Import", tabIndex: 0, className: s.IconButton, children: [
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(h, { icon: _e })
58
+ /* @__PURE__ */ e(p, { icon: he })
58
59
  ] });
59
60
  }
60
- const G = {
61
+ const V = {
61
62
  NONE: 0,
62
- SINGLE: 1,
63
- MULTIPLE: 2
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
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 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 })
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__ */ l("span", { className: d.Section, children: [
79
- /* @__PURE__ */ l("p", { className: d.Line, children: [
78
+ /* @__PURE__ */ i("span", { className: c.Section, children: [
79
+ /* @__PURE__ */ i("p", { className: c.Line, children: [
80
80
  "Type: ",
81
- a.getType()
81
+ r.getType()
82
82
  ] }),
83
- u != null && /* @__PURE__ */ l("span", { className: d.Line, children: [
83
+ u != null && /* @__PURE__ */ i("span", { className: c.Line, children: [
84
84
  "Opens with:",
85
- /* @__PURE__ */ e(D, { className: d.AppIcon, source: u.iconUrl ?? "" }),
85
+ /* @__PURE__ */ e(L, { className: c.AppIcon, source: u.iconUrl ?? "" }),
86
86
  u.name
87
87
  ] })
88
88
  ] }),
89
- /* @__PURE__ */ l("span", { className: d.Section, children: [
90
- /* @__PURE__ */ l("p", { className: d.Line, children: [
89
+ /* @__PURE__ */ i("span", { className: c.Section, children: [
90
+ /* @__PURE__ */ i("p", { className: c.Line, children: [
91
91
  "Location: ",
92
- a.path
92
+ r.path
93
93
  ] }),
94
- /* @__PURE__ */ l("p", { className: d.Line, children: [
94
+ /* @__PURE__ */ i("p", { className: c.Line, children: [
95
95
  "Size: ",
96
- M.getByteSize(a.source ?? a.content),
96
+ k.getByteSize(r.source ?? r.content),
97
97
  " bytes"
98
98
  ] }),
99
- /* @__PURE__ */ l("p", { className: d.Line, children: [
99
+ /* @__PURE__ */ i("p", { className: c.Line, children: [
100
100
  "Size on drive: ",
101
- M.getByteSize(a.toString()),
101
+ k.getByteSize(r.toString()),
102
102
  " bytes"
103
103
  ] })
104
104
  ] }),
105
- /* @__PURE__ */ e("span", { className: d.Section, children: /* @__PURE__ */ l("p", { className: d.Line, children: [
105
+ /* @__PURE__ */ e("span", { className: c.Section, children: /* @__PURE__ */ i("p", { className: c.Line, children: [
106
106
  "Attributes: ",
107
- a.isProtected ? "Protected" : "N/A"
107
+ r.isProtected ? "Protected" : "N/A"
108
108
  ] }) })
109
109
  ] });
110
110
  }
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
- }
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(ce, {}),
145
- /* @__PURE__ */ e(b, { label: "Delete", icon: V, onTrigger: (t, i) => {
146
- i.delete();
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
- }), x = he((r, t = !1) => {
150
- if (r == null)
151
- return;
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]);
156
- H(() => {
157
- if (C.length === 0)
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 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) => {
163
- q({
164
- title: t.message,
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: n == null ? void 0 : n.iconUrl,
167
- size: new E(300, 200),
161
+ iconUrl: l?.iconUrl,
162
+ size: new f(300, 200),
168
163
  single: !0
169
164
  });
170
165
  };
171
- return o == null || o.on(F.EVENT_NAMES.error, r), () => {
172
- o == null || o.off(F.EVENT_NAMES.error, r);
166
+ return d?.on(R.ERROR_EVENT, o), () => {
167
+ d?.off(R.ERROR_EVENT, o);
173
168
  };
174
169
  }, []);
175
- const R = (r) => {
176
- f(r.target.value);
177
- }, ee = (r) => {
178
- let t = r.target.value;
179
- if (r.key === "Enter") {
180
- t === "" && (t = "~");
181
- const i = o == null ? void 0 : o.navigate(t);
182
- if (i == null) {
183
- P({
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: 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: [
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
- t,
185
+ n,
191
186
  '"'
192
187
  ] }),
193
- /* @__PURE__ */ e("button", { "data-type": $.DIALOG_CONTENT_TYPES.closeButton, children: "Ok" })
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
- }, 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: [
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: s.IconButton,
202
+ className: a.IconButton,
209
203
  onClick: () => {
210
- j();
204
+ Y();
211
205
  },
212
- disabled: !Q,
213
- children: /* @__PURE__ */ e(h, { icon: Ie })
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: s.IconButton,
215
+ className: a.IconButton,
222
216
  onClick: () => {
223
- K();
217
+ j();
224
218
  },
225
- disabled: !X,
226
- children: /* @__PURE__ */ e(h, { icon: xe })
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: s.IconButton,
228
+ className: a.IconButton,
235
229
  onClick: () => {
236
- x("..");
230
+ N("..");
237
231
  },
238
- disabled: c.isRoot != null && c.isRoot,
239
- children: /* @__PURE__ */ e(h, { icon: be })
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: s.IconButton,
241
+ className: a.IconButton,
248
242
  onClick: () => {
249
- P({
243
+ C({
250
244
  title: "Error",
251
- iconUrl: n == null ? void 0 : n.iconUrl,
252
- size: new E(300, 150),
253
- Modal: (r) => /* @__PURE__ */ l(z, { ...r, children: [
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": $.DIALOG_CONTENT_TYPES.closeButton, children: "Ok" })
249
+ /* @__PURE__ */ e("button", { "data-type": z.DIALOG_CONTENT_TYPES.closeButton, children: "Ok" })
256
250
  ] })
257
251
  });
258
252
  },
259
- disabled: !c.canBeEdited,
260
- children: /* @__PURE__ */ e(h, { icon: fe })
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: Y,
260
+ value: W,
267
261
  type: "text",
268
262
  "aria-label": "Path",
269
- className: s.PathInput,
263
+ className: a.PathInput,
270
264
  tabIndex: 0,
271
- onChange: R,
265
+ onChange: Z,
272
266
  onKeyDown: ee,
273
267
  placeholder: "Enter a path..."
274
268
  }
275
269
  ),
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 }) })
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__ */ l("div", { className: s.Body, children: [
281
- /* @__PURE__ */ l("div", { className: s.Sidebar, children: [
282
- /* @__PURE__ */ e(y, { name: "Home", onClick: () => {
283
- x("~");
284
- }, icon: ve }),
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 })
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
- de,
290
+ ce,
297
291
  {
298
- directory: c,
292
+ directory: s,
299
293
  id: "main",
300
- className: s.Main,
301
- showHidden: L,
302
- onOpenFile: (r, t) => {
303
- if (r.preventDefault(), g)
304
- return void (u == null ? void 0 : u());
305
- const i = {};
306
- (t.extension === "md" || t.extension != null && ue.includes(t.extension)) && (i.mode = "view"), I == null || I.openFile(t, i);
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: (r, t) => {
309
- x(t.linkedPath ?? t.name);
302
+ onOpenFolder: (o, n) => {
303
+ N(n.linkedPath ?? n.name);
310
304
  },
311
- onContextMenuFile: J,
312
- onContextMenuFolder: Z,
313
- allowMultiSelect: a !== G.SINGLE,
314
- onSelectionChange: p
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: 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" }) })
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 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.17", author: "Prozilla" });
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
- je as FileSelectorMode,
326
- Ke as fileExplorer
319
+ We as FileSelectorMode,
320
+ Ye as fileExplorer
327
321
  };
328
322
  //# sourceMappingURL=main.js.map