@floegence/floe-webapp-core 0.35.19 → 0.35.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/components/file-browser/DragPreview.js +42 -44
- package/dist/components/file-browser/FileGridView.js +99 -97
- package/dist/components/file-browser/FileIcons.d.ts +15 -4
- package/dist/components/file-browser/FileIcons.js +386 -50
- package/dist/components/file-browser/FileListView.js +151 -151
- package/dist/components/file-browser/index.d.ts +2 -2
- package/dist/components/file-browser/types.d.ts +5 -2
- package/dist/components/ui/FileSavePicker.js +56 -58
- package/dist/file-browser.js +25 -21
- package/dist/full.js +396 -392
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { createComponent as i, insert as a, effect as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Dialog as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Input as
|
|
7
|
-
import {
|
|
8
|
-
import { deferNonBlocking as
|
|
9
|
-
import { usePickerTree as
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
const [u, f] =
|
|
1
|
+
import { createComponent as i, insert as a, effect as b, className as y, setAttribute as I, template as m, delegateEvents as N } from "solid-js/web";
|
|
2
|
+
import { createSignal as F, createMemo as $, createEffect as E, on as D, Show as g, For as B } from "solid-js";
|
|
3
|
+
import { cn as p } from "../../utils/cn.js";
|
|
4
|
+
import { Dialog as z } from "./Dialog.js";
|
|
5
|
+
import { Button as C } from "./Button.js";
|
|
6
|
+
import { Input as T } from "./Input.js";
|
|
7
|
+
import { FileItemIcon as K } from "../file-browser/FileIcons.js";
|
|
8
|
+
import { deferNonBlocking as L } from "../../utils/defer.js";
|
|
9
|
+
import { usePickerTree as O, normalizePath as R, PathInputBar as G, PickerBreadcrumb as M, PickerFolderTree as j, NewFolderSection as q } from "./picker/PickerBase.js";
|
|
10
|
+
var A = /* @__PURE__ */ m('<div class="flex flex-col gap-2 -mt-1"><div class="flex border border-border rounded overflow-hidden"style=height:260px><div class="w-1/2 min-w-0 overflow-y-auto">'), H = /* @__PURE__ */ m('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-xs text-muted-foreground flex-shrink-0">File name:</label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), J = /* @__PURE__ */ m('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">No files in this directory'), Q = /* @__PURE__ */ m('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), U = /* @__PURE__ */ m("<button type=button><span class=truncate>");
|
|
11
|
+
function ie(e) {
|
|
12
|
+
const [u, f] = F(e.initialFileName ?? ""), [w, s] = F(""), r = O({
|
|
13
13
|
initialPath: e.initialPath,
|
|
14
14
|
open: () => e.open,
|
|
15
15
|
files: () => e.files,
|
|
@@ -22,17 +22,17 @@ function ae(e) {
|
|
|
22
22
|
onReset: () => {
|
|
23
23
|
f(e.initialFileName ?? ""), s("");
|
|
24
24
|
}
|
|
25
|
-
}), x =
|
|
26
|
-
const t =
|
|
25
|
+
}), x = $(() => {
|
|
26
|
+
const t = R(r.selectedPath());
|
|
27
27
|
if (t === "/")
|
|
28
28
|
return e.files.filter((o) => o.type === "file");
|
|
29
29
|
const n = r.folderIndex().get(t);
|
|
30
30
|
return n?.children ? n.children.filter((o) => o.type === "file") : [];
|
|
31
31
|
});
|
|
32
|
-
D(
|
|
32
|
+
E(D(u, () => {
|
|
33
33
|
s("");
|
|
34
34
|
}));
|
|
35
|
-
const
|
|
35
|
+
const S = (t) => {
|
|
36
36
|
f(t.name), s("");
|
|
37
37
|
}, v = () => {
|
|
38
38
|
const t = u().trim();
|
|
@@ -48,16 +48,16 @@ function ae(e) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
const n = r.selectedPath(), o = e.onSave;
|
|
51
|
-
e.onOpenChange(!1),
|
|
52
|
-
},
|
|
51
|
+
e.onOpenChange(!1), L(() => o(n, t));
|
|
52
|
+
}, k = () => {
|
|
53
53
|
e.onOpenChange(!1);
|
|
54
|
-
},
|
|
54
|
+
}, _ = (t) => {
|
|
55
55
|
t.key === "Enter" && (t.preventDefault(), v());
|
|
56
|
-
}, P =
|
|
56
|
+
}, P = $(() => {
|
|
57
57
|
const t = r.toDisplayPath(r.selectedPath()), n = u().trim();
|
|
58
58
|
return n ? t === "/" ? `/${n}` : `${t}/${n}` : t;
|
|
59
59
|
});
|
|
60
|
-
return i(
|
|
60
|
+
return i(z, {
|
|
61
61
|
get open() {
|
|
62
62
|
return e.open;
|
|
63
63
|
},
|
|
@@ -68,30 +68,30 @@ function ae(e) {
|
|
|
68
68
|
return e.title ?? "Save File";
|
|
69
69
|
},
|
|
70
70
|
get class() {
|
|
71
|
-
return
|
|
71
|
+
return p("max-w-2xl", e.class);
|
|
72
72
|
},
|
|
73
73
|
get footer() {
|
|
74
74
|
return (() => {
|
|
75
|
-
var t =
|
|
76
|
-
return a(l, i(
|
|
75
|
+
var t = H(), n = t.firstChild, o = n.firstChild, l = o.nextSibling, c = n.nextSibling, d = c.firstChild;
|
|
76
|
+
return a(l, i(T, {
|
|
77
77
|
size: "sm",
|
|
78
78
|
get value() {
|
|
79
79
|
return u();
|
|
80
80
|
},
|
|
81
|
-
onInput: (
|
|
82
|
-
onKeyDown:
|
|
81
|
+
onInput: (h) => f(h.currentTarget.value),
|
|
82
|
+
onKeyDown: _,
|
|
83
83
|
placeholder: "filename.ext",
|
|
84
84
|
get error() {
|
|
85
|
-
return
|
|
85
|
+
return w();
|
|
86
86
|
}
|
|
87
|
-
})), a(
|
|
87
|
+
})), a(d, P), a(c, i(C, {
|
|
88
88
|
variant: "ghost",
|
|
89
89
|
size: "sm",
|
|
90
|
-
onClick:
|
|
90
|
+
onClick: k,
|
|
91
91
|
get children() {
|
|
92
92
|
return e.cancelText ?? "Cancel";
|
|
93
93
|
}
|
|
94
|
-
}), null), a(
|
|
94
|
+
}), null), a(c, i(C, {
|
|
95
95
|
variant: "primary",
|
|
96
96
|
size: "sm",
|
|
97
97
|
onClick: v,
|
|
@@ -101,12 +101,12 @@ function ae(e) {
|
|
|
101
101
|
get children() {
|
|
102
102
|
return e.confirmText ?? "Save";
|
|
103
103
|
}
|
|
104
|
-
}), null),
|
|
104
|
+
}), null), b(() => I(d, "title", P())), t;
|
|
105
105
|
})();
|
|
106
106
|
},
|
|
107
107
|
get children() {
|
|
108
|
-
var t =
|
|
109
|
-
return a(t, i(
|
|
108
|
+
var t = A(), n = t.firstChild, o = n.firstChild;
|
|
109
|
+
return a(t, i(G, {
|
|
110
110
|
get value() {
|
|
111
111
|
return r.pathInput;
|
|
112
112
|
},
|
|
@@ -122,14 +122,14 @@ function ae(e) {
|
|
|
122
122
|
get onKeyDown() {
|
|
123
123
|
return r.handlePathInputKeyDown;
|
|
124
124
|
}
|
|
125
|
-
}), n), a(t, i(
|
|
125
|
+
}), n), a(t, i(M, {
|
|
126
126
|
get segments() {
|
|
127
127
|
return r.breadcrumbSegments;
|
|
128
128
|
},
|
|
129
129
|
get onClick() {
|
|
130
130
|
return r.handleBreadcrumbClick;
|
|
131
131
|
}
|
|
132
|
-
}), n), a(n, i(
|
|
132
|
+
}), n), a(n, i(j, {
|
|
133
133
|
get rootFolders() {
|
|
134
134
|
return r.rootFolders;
|
|
135
135
|
},
|
|
@@ -164,30 +164,28 @@ function ae(e) {
|
|
|
164
164
|
return x().length > 0;
|
|
165
165
|
},
|
|
166
166
|
get fallback() {
|
|
167
|
-
return
|
|
167
|
+
return J();
|
|
168
168
|
},
|
|
169
169
|
get children() {
|
|
170
|
-
return i(
|
|
170
|
+
return i(B, {
|
|
171
171
|
get each() {
|
|
172
172
|
return x();
|
|
173
173
|
},
|
|
174
|
-
children: (l) => {
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})();
|
|
190
|
-
}
|
|
174
|
+
children: (l) => (() => {
|
|
175
|
+
var c = U(), d = c.firstChild;
|
|
176
|
+
return c.$$click = () => S(l), a(c, i(K, {
|
|
177
|
+
item: l,
|
|
178
|
+
class: "w-4 h-4 flex-shrink-0"
|
|
179
|
+
}), d), a(d, () => l.name), a(c, i(g, {
|
|
180
|
+
get when() {
|
|
181
|
+
return l.size != null;
|
|
182
|
+
},
|
|
183
|
+
get children() {
|
|
184
|
+
var h = Q();
|
|
185
|
+
return a(h, () => V(l.size)), h;
|
|
186
|
+
}
|
|
187
|
+
}), null), b(() => y(c, p("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-100", "hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", u() === l.name && "bg-accent text-accent-foreground font-medium"))), c;
|
|
188
|
+
})()
|
|
191
189
|
});
|
|
192
190
|
}
|
|
193
191
|
})), a(t, i(g, {
|
|
@@ -195,7 +193,7 @@ function ae(e) {
|
|
|
195
193
|
return e.onCreateFolder;
|
|
196
194
|
},
|
|
197
195
|
get children() {
|
|
198
|
-
return i(
|
|
196
|
+
return i(q, {
|
|
199
197
|
get parentPath() {
|
|
200
198
|
return r.selectedPath;
|
|
201
199
|
},
|
|
@@ -211,10 +209,10 @@ function ae(e) {
|
|
|
211
209
|
}
|
|
212
210
|
});
|
|
213
211
|
}
|
|
214
|
-
function
|
|
212
|
+
function V(e) {
|
|
215
213
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
216
214
|
}
|
|
217
|
-
|
|
215
|
+
N(["click"]);
|
|
218
216
|
export {
|
|
219
|
-
|
|
217
|
+
ie as FileSavePicker
|
|
220
218
|
};
|
package/dist/file-browser.js
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { Breadcrumb as r } from "./components/file-browser/Breadcrumb.js";
|
|
2
|
-
import { CodeFileIcon as l, ConfigFileIcon as t, DocumentFileIcon as F, FileIcon as n, FolderIcon as
|
|
3
|
-
import { DirectoryTree as
|
|
4
|
-
import { FileBrowser as
|
|
5
|
-
import { FileBrowserProvider as
|
|
6
|
-
import { FileBrowserToolbar as
|
|
7
|
-
import { FileContextMenu as
|
|
8
|
-
import { FileGridView as
|
|
9
|
-
import { FileListView as
|
|
2
|
+
import { CodeFileIcon as l, ConfigFileIcon as t, DocumentFileIcon as F, FileIcon as c, FileItemIcon as n, FolderIcon as I, FolderOpenIcon as m, ImageFileIcon as p, JavaScriptFileIcon as f, ShellScriptFileIcon as x, StyleFileIcon as s, TypeScriptFileIcon as d, getFileIcon as w, resolveFileItemIcon as a } from "./components/file-browser/FileIcons.js";
|
|
3
|
+
import { DirectoryTree as S } from "./components/file-browser/DirectoryTree.js";
|
|
4
|
+
import { FileBrowser as g } from "./components/file-browser/FileBrowser.js";
|
|
5
|
+
import { FileBrowserProvider as y, useFileBrowser as C } from "./components/file-browser/FileBrowserContext.js";
|
|
6
|
+
import { FileBrowserToolbar as b } from "./components/file-browser/FileBrowserToolbar.js";
|
|
7
|
+
import { FileContextMenu as V } from "./components/file-browser/FileContextMenu.js";
|
|
8
|
+
import { FileGridView as G } from "./components/file-browser/FileGridView.js";
|
|
9
|
+
import { FileListView as L } from "./components/file-browser/FileListView.js";
|
|
10
10
|
export {
|
|
11
11
|
r as Breadcrumb,
|
|
12
12
|
l as CodeFileIcon,
|
|
13
13
|
t as ConfigFileIcon,
|
|
14
|
-
|
|
14
|
+
S as DirectoryTree,
|
|
15
15
|
F as DocumentFileIcon,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
g as FileBrowser,
|
|
17
|
+
y as FileBrowserProvider,
|
|
18
|
+
b as FileBrowserToolbar,
|
|
19
|
+
V as FileContextMenu,
|
|
20
|
+
G as FileGridView,
|
|
21
|
+
c as FileIcon,
|
|
22
|
+
n as FileItemIcon,
|
|
23
|
+
L as FileListView,
|
|
24
|
+
I as FolderIcon,
|
|
24
25
|
m as FolderOpenIcon,
|
|
25
26
|
p as ImageFileIcon,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
f as JavaScriptFileIcon,
|
|
28
|
+
x as ShellScriptFileIcon,
|
|
29
|
+
s as StyleFileIcon,
|
|
30
|
+
d as TypeScriptFileIcon,
|
|
31
|
+
w as getFileIcon,
|
|
32
|
+
a as resolveFileItemIcon,
|
|
33
|
+
C as useFileBrowser
|
|
30
34
|
};
|