@floegence/floe-webapp-core 0.8.0 → 0.8.2
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/FileBrowserContext.d.ts +2 -0
- package/dist/components/file-browser/types.d.ts +1 -0
- package/dist/components/ui/picker/PickerBase.d.ts +8 -8
- package/dist/index29.js +2 -2
- package/dist/index30.js +2 -2
- package/dist/index41.js +76 -75
- package/dist/index46.js +63 -63
- package/dist/index83.js +199 -193
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@ export interface FileBrowserProviderProps {
|
|
|
5
5
|
files: FileItem[];
|
|
6
6
|
initialPath?: string;
|
|
7
7
|
initialViewMode?: ViewMode;
|
|
8
|
+
/** Label for the root/home directory in breadcrumb (default: 'Root') */
|
|
9
|
+
homeLabel?: string;
|
|
8
10
|
onNavigate?: (path: string) => void;
|
|
9
11
|
onSelect?: (items: FileItem[]) => void;
|
|
10
12
|
onOpen?: (item: FileItem) => void;
|
|
@@ -133,6 +133,7 @@ export interface FileBrowserContextValue {
|
|
|
133
133
|
setCurrentPath: (path: string) => void;
|
|
134
134
|
navigateUp: () => void;
|
|
135
135
|
navigateTo: (item: FileItem) => void;
|
|
136
|
+
homeLabel: Accessor<string>;
|
|
136
137
|
selectedItems: Accessor<Set<string>>;
|
|
137
138
|
selectItem: (id: string, multi?: boolean) => void;
|
|
138
139
|
clearSelection: () => void;
|
|
@@ -21,14 +21,14 @@ export interface UsePickerTreeOptions {
|
|
|
21
21
|
filter?: (item: FileItem) => boolean;
|
|
22
22
|
/** Additional reset logic when the dialog opens */
|
|
23
23
|
onReset?: (initialPath: string) => void;
|
|
24
|
-
/** Label for the home/root directory in tree and breadcrumb (default: 'Root') */
|
|
25
|
-
homeLabel?: string
|
|
24
|
+
/** Label for the home/root directory in tree and breadcrumb (default: 'Root'). Supports accessor for reactivity. */
|
|
25
|
+
homeLabel?: string | Accessor<string | undefined>;
|
|
26
26
|
/**
|
|
27
27
|
* Real filesystem path of the home directory (e.g. '/home/user').
|
|
28
28
|
* When set, the path input bar and display paths will show real filesystem
|
|
29
|
-
* paths instead of internal tree-relative paths.
|
|
29
|
+
* paths instead of internal tree-relative paths. Supports accessor for reactivity.
|
|
30
30
|
*/
|
|
31
|
-
homePath?: string
|
|
31
|
+
homePath?: string | Accessor<string | undefined>;
|
|
32
32
|
}
|
|
33
33
|
export interface PickerTreeState {
|
|
34
34
|
selectedPath: Accessor<string>;
|
|
@@ -53,8 +53,8 @@ export interface PickerTreeState {
|
|
|
53
53
|
path: string;
|
|
54
54
|
}[]>;
|
|
55
55
|
handleBreadcrumbClick: (path: string) => void;
|
|
56
|
-
/** Home label for display */
|
|
57
|
-
homeLabel: string
|
|
56
|
+
/** Home label for display (reactive) */
|
|
57
|
+
homeLabel: Accessor<string>;
|
|
58
58
|
/** Convert internal tree path to display (real filesystem) path */
|
|
59
59
|
toDisplayPath: (internalPath: string) => string;
|
|
60
60
|
}
|
|
@@ -94,8 +94,8 @@ export interface PickerFolderTreeProps {
|
|
|
94
94
|
class?: string;
|
|
95
95
|
style?: JSX.CSSProperties;
|
|
96
96
|
emptyText?: string;
|
|
97
|
-
/** Label for the home/root directory (default: 'Root') */
|
|
98
|
-
homeLabel?: string
|
|
97
|
+
/** Label for the home/root directory (default: 'Root'). Supports accessor for reactivity. */
|
|
98
|
+
homeLabel?: string | Accessor<string>;
|
|
99
99
|
}
|
|
100
100
|
export declare function PickerFolderTree(props: PickerFolderTreeProps): JSX.Element;
|
|
101
101
|
export interface PickerTreeNodeProps {
|
package/dist/index29.js
CHANGED
|
@@ -13,8 +13,8 @@ function T(t) {
|
|
|
13
13
|
files: () => t.files,
|
|
14
14
|
// eslint-disable-next-line solid/reactivity -- filter is a static callback
|
|
15
15
|
filter: t.filter ? (r) => t.filter(r) : void 0,
|
|
16
|
-
homeLabel: t.homeLabel,
|
|
17
|
-
homePath: t.homePath
|
|
16
|
+
homeLabel: () => t.homeLabel,
|
|
17
|
+
homePath: () => t.homePath
|
|
18
18
|
}), c = () => {
|
|
19
19
|
const r = e.selectedPath(), a = t.onSelect;
|
|
20
20
|
t.onOpenChange(!1), f(() => a(r));
|
package/dist/index30.js
CHANGED
|
@@ -15,8 +15,8 @@ function ae(e) {
|
|
|
15
15
|
files: () => e.files,
|
|
16
16
|
// eslint-disable-next-line solid/reactivity -- filter is a static callback
|
|
17
17
|
filter: e.filter ? (t) => e.filter(t) : void 0,
|
|
18
|
-
homeLabel: e.homeLabel,
|
|
19
|
-
homePath: e.homePath,
|
|
18
|
+
homeLabel: () => e.homeLabel,
|
|
19
|
+
homePath: () => e.homePath,
|
|
20
20
|
onReset: () => {
|
|
21
21
|
f(e.initialFileName ?? ""), s("");
|
|
22
22
|
}
|
package/dist/index41.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { createComponent as me } from "solid-js/web";
|
|
2
|
+
import { createContext as we, createSignal as a, createMemo as N, useContext as Pe } from "solid-js";
|
|
3
3
|
import { deferNonBlocking as I } from "./index70.js";
|
|
4
|
-
const
|
|
5
|
-
function Q(r,
|
|
6
|
-
if (!
|
|
7
|
-
const x = r.toLowerCase(), w =
|
|
4
|
+
const R = we();
|
|
5
|
+
function Q(r, h) {
|
|
6
|
+
if (!h) return [];
|
|
7
|
+
const x = r.toLowerCase(), w = h.toLowerCase(), p = [];
|
|
8
8
|
let g = 0;
|
|
9
9
|
for (const S of w) {
|
|
10
10
|
const m = x.indexOf(S, g);
|
|
11
11
|
if (m === -1) return null;
|
|
12
|
-
|
|
12
|
+
p.push(m), g = m + 1;
|
|
13
13
|
}
|
|
14
|
-
return
|
|
14
|
+
return p;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const [
|
|
16
|
+
function ye(r) {
|
|
17
|
+
const [h, x] = a(r.initialPath ?? "/"), [w, p] = a(/* @__PURE__ */ new Set()), [g, S] = a(r.initialViewMode ?? "list"), [m, V] = a({
|
|
18
18
|
field: "name",
|
|
19
19
|
direction: "asc"
|
|
20
|
-
}), [M,
|
|
20
|
+
}), [M, b] = a(/* @__PURE__ */ new Set(["/"])), [j, D] = a(!1), [G, O] = a(null), [v, k] = a(""), [H, B] = a(!1), J = () => r.homeLabel ?? "Root", [z, P] = a([]);
|
|
21
21
|
let u = null, C = {
|
|
22
22
|
top: 0,
|
|
23
23
|
left: 0
|
|
@@ -25,12 +25,12 @@ function Ce(r) {
|
|
|
25
25
|
const A = () => r.files, c = (e) => {
|
|
26
26
|
const t = (e ?? "").trim();
|
|
27
27
|
return t === "" ? "/" : t;
|
|
28
|
-
},
|
|
28
|
+
}, L = (e) => {
|
|
29
29
|
const t = c(e);
|
|
30
30
|
if (t === "/") return "/";
|
|
31
31
|
const n = t.split("/").filter(Boolean);
|
|
32
32
|
return n.pop(), n.length ? "/" + n.join("/") : "/";
|
|
33
|
-
},
|
|
33
|
+
}, K = (e, t) => {
|
|
34
34
|
const n = z();
|
|
35
35
|
if (n.length === 0) return e;
|
|
36
36
|
let s = [...e];
|
|
@@ -46,13 +46,13 @@ function Ce(r) {
|
|
|
46
46
|
const l = c(o.oldPath), i = s.findIndex((f) => c(f.path) === l);
|
|
47
47
|
if (i !== -1) {
|
|
48
48
|
const f = o.updates.path ?? s[i].path;
|
|
49
|
-
|
|
49
|
+
L(f) === d ? s[i] = {
|
|
50
50
|
...s[i],
|
|
51
51
|
...o.updates
|
|
52
52
|
} : s.splice(i, 1);
|
|
53
53
|
} else {
|
|
54
54
|
const f = o.updates.path;
|
|
55
|
-
f &&
|
|
55
|
+
f && L(f);
|
|
56
56
|
}
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
@@ -62,17 +62,17 @@ function Ce(r) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
return s;
|
|
65
|
-
},
|
|
65
|
+
}, W = N(() => {
|
|
66
66
|
const e = /* @__PURE__ */ new Map(), t = (s) => {
|
|
67
67
|
var d;
|
|
68
68
|
for (const o of s)
|
|
69
69
|
o.type === "folder" && (e.set(c(o.path), o.children ?? []), (d = o.children) != null && d.length && t(o.children));
|
|
70
70
|
}, n = A();
|
|
71
71
|
return e.set("/", n), t(n), e;
|
|
72
|
-
}),
|
|
73
|
-
const e = c(
|
|
74
|
-
let t =
|
|
75
|
-
t =
|
|
72
|
+
}), T = N(() => {
|
|
73
|
+
const e = c(h());
|
|
74
|
+
let t = W().get(e) ?? [];
|
|
75
|
+
t = K(t, e);
|
|
76
76
|
const n = v().trim();
|
|
77
77
|
n && (t = t.filter((o) => Q(o.name, n) !== null));
|
|
78
78
|
const s = m();
|
|
@@ -100,69 +100,69 @@ function Ce(r) {
|
|
|
100
100
|
}), y = (e) => {
|
|
101
101
|
var s;
|
|
102
102
|
const t = c(e);
|
|
103
|
-
x(t),
|
|
103
|
+
x(t), p(/* @__PURE__ */ new Set()), k(""), B(!1);
|
|
104
104
|
const n = r.onSelect;
|
|
105
105
|
I(() => n == null ? void 0 : n([])), (s = r.onNavigate) == null || s.call(r, t);
|
|
106
|
-
},
|
|
107
|
-
const e =
|
|
106
|
+
}, X = () => {
|
|
107
|
+
const e = h();
|
|
108
108
|
if (e === "/" || e === "") return;
|
|
109
109
|
const t = e.split("/").filter(Boolean);
|
|
110
110
|
t.pop(), y(t.length ? "/" + t.join("/") : "/");
|
|
111
|
-
},
|
|
112
|
-
e.type === "folder" && (y(e.path),
|
|
111
|
+
}, U = (e) => {
|
|
112
|
+
e.type === "folder" && (y(e.path), b((t) => {
|
|
113
113
|
const n = new Set(t);
|
|
114
114
|
return n.add(e.path), n;
|
|
115
115
|
}));
|
|
116
|
-
},
|
|
116
|
+
}, Y = (e, t = !1) => {
|
|
117
117
|
const n = w(), s = t ? new Set(n) : /* @__PURE__ */ new Set();
|
|
118
|
-
t ? s.has(e) ? s.delete(e) : s.add(e) : (s.clear(), s.add(e)),
|
|
119
|
-
const d =
|
|
118
|
+
t ? s.has(e) ? s.delete(e) : s.add(e) : (s.clear(), s.add(e)), p(s);
|
|
119
|
+
const d = T().filter((l) => s.has(l.id)), o = r.onSelect;
|
|
120
120
|
I(() => o == null ? void 0 : o(d));
|
|
121
|
-
},
|
|
122
|
-
|
|
121
|
+
}, Z = () => {
|
|
122
|
+
p(/* @__PURE__ */ new Set());
|
|
123
123
|
const e = r.onSelect;
|
|
124
124
|
I(() => e == null ? void 0 : e([]));
|
|
125
|
-
},
|
|
126
|
-
|
|
125
|
+
}, _ = (e) => w().has(e), $ = (e) => {
|
|
126
|
+
b((t) => {
|
|
127
127
|
const n = new Set(t);
|
|
128
128
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
129
129
|
});
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
},
|
|
130
|
+
}, ee = (e) => M().has(e), te = () => D((e) => !e), ne = (e) => O(e), oe = () => O(null), se = (e) => {
|
|
131
|
+
k(e);
|
|
132
|
+
}, re = (e) => {
|
|
133
133
|
const t = v().trim();
|
|
134
134
|
if (!t) return null;
|
|
135
135
|
const n = Q(e, t);
|
|
136
136
|
return n ? {
|
|
137
137
|
matchedIndices: n
|
|
138
138
|
} : null;
|
|
139
|
-
}, re = (e) => {
|
|
140
|
-
var t;
|
|
141
|
-
e.type === "folder" ? E(e) : (t = r.onOpen) == null || t.call(r, e);
|
|
142
139
|
}, ie = (e) => {
|
|
140
|
+
var t;
|
|
141
|
+
e.type === "folder" ? U(e) : (t = r.onOpen) == null || t.call(r, e);
|
|
142
|
+
}, ce = (e) => {
|
|
143
143
|
e.length !== 0 && P((t) => [...t, {
|
|
144
144
|
type: "remove",
|
|
145
145
|
paths: e
|
|
146
146
|
}]);
|
|
147
|
-
},
|
|
147
|
+
}, le = (e, t) => {
|
|
148
148
|
P((n) => [...n, {
|
|
149
149
|
type: "update",
|
|
150
150
|
oldPath: e,
|
|
151
151
|
updates: t
|
|
152
152
|
}]);
|
|
153
|
-
},
|
|
153
|
+
}, ae = (e, t) => {
|
|
154
154
|
P((n) => [...n, {
|
|
155
155
|
type: "insert",
|
|
156
156
|
parentPath: e,
|
|
157
157
|
item: t
|
|
158
158
|
}]);
|
|
159
|
-
}, ae = () => {
|
|
160
|
-
P([]);
|
|
161
159
|
}, de = () => {
|
|
162
160
|
P([]);
|
|
163
|
-
}, fe = () =>
|
|
161
|
+
}, fe = () => {
|
|
162
|
+
P([]);
|
|
163
|
+
}, ue = () => z().length > 0, he = (e) => {
|
|
164
164
|
u = e;
|
|
165
|
-
},
|
|
165
|
+
}, E = () => u ? {
|
|
166
166
|
top: u.scrollTop,
|
|
167
167
|
left: u.scrollLeft
|
|
168
168
|
} : {
|
|
@@ -171,66 +171,67 @@ function Ce(r) {
|
|
|
171
171
|
}, q = (e) => {
|
|
172
172
|
u && (u.scrollTop = e.top, u.scrollLeft = e.left);
|
|
173
173
|
}, pe = {
|
|
174
|
-
currentPath:
|
|
174
|
+
currentPath: h,
|
|
175
175
|
setCurrentPath: y,
|
|
176
|
-
navigateUp:
|
|
177
|
-
navigateTo:
|
|
176
|
+
navigateUp: X,
|
|
177
|
+
navigateTo: U,
|
|
178
|
+
homeLabel: J,
|
|
178
179
|
selectedItems: () => w(),
|
|
179
|
-
selectItem:
|
|
180
|
-
clearSelection:
|
|
181
|
-
isSelected:
|
|
180
|
+
selectItem: Y,
|
|
181
|
+
clearSelection: Z,
|
|
182
|
+
isSelected: _,
|
|
182
183
|
viewMode: g,
|
|
183
184
|
setViewMode: S,
|
|
184
185
|
sortConfig: m,
|
|
185
|
-
setSortConfig:
|
|
186
|
+
setSortConfig: V,
|
|
186
187
|
expandedFolders: M,
|
|
187
|
-
toggleFolder:
|
|
188
|
-
isExpanded:
|
|
188
|
+
toggleFolder: $,
|
|
189
|
+
isExpanded: ee,
|
|
189
190
|
files: A,
|
|
190
|
-
currentFiles:
|
|
191
|
+
currentFiles: T,
|
|
191
192
|
filterQuery: v,
|
|
192
|
-
setFilterQuery:
|
|
193
|
+
setFilterQuery: se,
|
|
193
194
|
isFilterActive: H,
|
|
194
195
|
setFilterActive: B,
|
|
195
|
-
getFilterMatch:
|
|
196
|
-
sidebarCollapsed:
|
|
197
|
-
toggleSidebar:
|
|
196
|
+
getFilterMatch: re,
|
|
197
|
+
sidebarCollapsed: j,
|
|
198
|
+
toggleSidebar: te,
|
|
198
199
|
contextMenu: G,
|
|
199
|
-
showContextMenu:
|
|
200
|
-
hideContextMenu:
|
|
201
|
-
openItem:
|
|
200
|
+
showContextMenu: ne,
|
|
201
|
+
hideContextMenu: oe,
|
|
202
|
+
openItem: ie,
|
|
202
203
|
// Optimistic updates
|
|
203
|
-
optimisticRemove:
|
|
204
|
-
optimisticUpdate:
|
|
205
|
-
optimisticInsert:
|
|
206
|
-
clearOptimisticUpdates:
|
|
207
|
-
rollbackOptimisticUpdates:
|
|
208
|
-
hasOptimisticUpdates:
|
|
204
|
+
optimisticRemove: ce,
|
|
205
|
+
optimisticUpdate: le,
|
|
206
|
+
optimisticInsert: ae,
|
|
207
|
+
clearOptimisticUpdates: de,
|
|
208
|
+
rollbackOptimisticUpdates: fe,
|
|
209
|
+
hasOptimisticUpdates: ue,
|
|
209
210
|
// Scroll position management
|
|
210
|
-
setScrollContainer:
|
|
211
|
-
getScrollPosition:
|
|
211
|
+
setScrollContainer: he,
|
|
212
|
+
getScrollPosition: E,
|
|
212
213
|
setScrollPosition: q,
|
|
213
|
-
saveScrollPosition: () => (C =
|
|
214
|
+
saveScrollPosition: () => (C = E(), C),
|
|
214
215
|
restoreScrollPosition: () => {
|
|
215
216
|
requestAnimationFrame(() => {
|
|
216
217
|
q(C);
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
220
|
};
|
|
220
|
-
return
|
|
221
|
+
return me(R.Provider, {
|
|
221
222
|
value: pe,
|
|
222
223
|
get children() {
|
|
223
224
|
return r.children;
|
|
224
225
|
}
|
|
225
226
|
});
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
-
const r =
|
|
228
|
+
function Fe() {
|
|
229
|
+
const r = Pe(R);
|
|
229
230
|
if (!r)
|
|
230
231
|
throw new Error("useFileBrowser must be used within a FileBrowserProvider");
|
|
231
232
|
return r;
|
|
232
233
|
}
|
|
233
234
|
export {
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
ye as FileBrowserProvider,
|
|
236
|
+
Fe as useFileBrowser
|
|
236
237
|
};
|
package/dist/index46.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { delegateEvents as A, template as b, insert as R, createComponent as a, memo as H, effect as x, className as W, use as P } from "solid-js/web";
|
|
2
|
+
import { createSignal as y, onMount as B, createMemo as M, For as O, Show as T, onCleanup as F } from "solid-js";
|
|
3
|
+
import { cn as C } from "./index69.js";
|
|
4
4
|
import { useFileBrowser as G } from "./index41.js";
|
|
5
|
-
import { ChevronRight as
|
|
5
|
+
import { ChevronRight as E } from "./index34.js";
|
|
6
6
|
import { Dropdown as z } from "./index24.js";
|
|
7
|
-
var X = /* @__PURE__ */
|
|
8
|
-
const
|
|
9
|
-
function V(
|
|
10
|
-
const
|
|
11
|
-
return Math.min(
|
|
7
|
+
var X = /* @__PURE__ */ b("<nav aria-label=Breadcrumb>"), j = /* @__PURE__ */ b('<button type=button title="Show hidden path segments">…'), q = /* @__PURE__ */ b('<button type=button><span class="truncate max-w-[120px] block">');
|
|
8
|
+
const p = 16, J = 28, D = 12, K = 7, Q = 120, U = 100;
|
|
9
|
+
function V(r) {
|
|
10
|
+
const n = r.length * K;
|
|
11
|
+
return Math.min(n + D, Q + D);
|
|
12
12
|
}
|
|
13
|
-
function ce(
|
|
14
|
-
const
|
|
13
|
+
function ce(r) {
|
|
14
|
+
const n = G();
|
|
15
15
|
let s;
|
|
16
|
-
const [t, c] =
|
|
17
|
-
|
|
16
|
+
const [t, c] = y(0);
|
|
17
|
+
B(() => {
|
|
18
18
|
if (!s) return;
|
|
19
19
|
const e = () => {
|
|
20
20
|
s && c(s.offsetWidth);
|
|
@@ -23,25 +23,25 @@ function ce(n) {
|
|
|
23
23
|
const o = new ResizeObserver(e);
|
|
24
24
|
o.observe(s), F(() => o.disconnect());
|
|
25
25
|
});
|
|
26
|
-
const d =
|
|
27
|
-
const e =
|
|
26
|
+
const d = M(() => {
|
|
27
|
+
const e = n.currentPath(), o = n.homeLabel();
|
|
28
28
|
if (e === "/" || e === "")
|
|
29
29
|
return [{
|
|
30
|
-
name:
|
|
30
|
+
name: o,
|
|
31
31
|
path: "/"
|
|
32
32
|
}];
|
|
33
|
-
const
|
|
34
|
-
name:
|
|
33
|
+
const l = e.split("/").filter(Boolean), i = [{
|
|
34
|
+
name: o,
|
|
35
35
|
path: "/"
|
|
36
36
|
}];
|
|
37
|
-
let
|
|
38
|
-
for (const
|
|
39
|
-
|
|
40
|
-
name:
|
|
41
|
-
path:
|
|
37
|
+
let f = "";
|
|
38
|
+
for (const g of l)
|
|
39
|
+
f += "/" + g, i.push({
|
|
40
|
+
name: g,
|
|
41
|
+
path: f
|
|
42
42
|
});
|
|
43
43
|
return i;
|
|
44
|
-
}), m =
|
|
44
|
+
}), m = M(() => {
|
|
45
45
|
const e = d(), o = t();
|
|
46
46
|
if (o < U || e.length <= 2)
|
|
47
47
|
return {
|
|
@@ -49,73 +49,73 @@ function ce(n) {
|
|
|
49
49
|
visible: e,
|
|
50
50
|
shouldCollapse: !1
|
|
51
51
|
};
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
52
|
+
const l = e.map((u) => V(u.name)), i = l[0], f = l[e.length - 1], g = p, $ = e.length > 1 ? p : 0, _ = i + f + g + $;
|
|
53
|
+
if (_ > o && e.length > 2)
|
|
54
54
|
return {
|
|
55
55
|
collapsed: e.slice(1, -1),
|
|
56
56
|
visible: [e[0], e[e.length - 1]],
|
|
57
57
|
shouldCollapse: !0
|
|
58
58
|
};
|
|
59
|
-
const h = e.slice(1, -1),
|
|
60
|
-
let
|
|
61
|
-
const
|
|
59
|
+
const h = e.slice(1, -1), v = [];
|
|
60
|
+
let w = o - _;
|
|
61
|
+
const L = h.length > 0 ? J + p : 0;
|
|
62
62
|
for (let u = h.length - 1; u >= 0; u--) {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
63
|
+
const k = l[u + 1] + p, N = u > 0 ? L : 0;
|
|
64
|
+
if (w - N >= k)
|
|
65
|
+
v.unshift(h[u]), w -= k;
|
|
66
66
|
else
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const I = h.slice(0, h.length - v.length);
|
|
70
70
|
return {
|
|
71
|
-
collapsed:
|
|
72
|
-
visible: [e[0], ...
|
|
73
|
-
shouldCollapse:
|
|
71
|
+
collapsed: I,
|
|
72
|
+
visible: [e[0], ...v, e[e.length - 1]],
|
|
73
|
+
shouldCollapse: I.length > 0
|
|
74
74
|
};
|
|
75
|
-
}),
|
|
76
|
-
|
|
75
|
+
}), S = (e) => {
|
|
76
|
+
n.setCurrentPath(e.path);
|
|
77
77
|
};
|
|
78
78
|
return (() => {
|
|
79
79
|
var e = X(), o = s;
|
|
80
|
-
return typeof o == "function" ?
|
|
80
|
+
return typeof o == "function" ? P(o, e) : s = e, R(e, a(O, {
|
|
81
81
|
get each() {
|
|
82
82
|
return m().visible;
|
|
83
83
|
},
|
|
84
|
-
children: (
|
|
84
|
+
children: (l, i) => [a(T, {
|
|
85
85
|
get when() {
|
|
86
|
-
return
|
|
86
|
+
return i() > 0;
|
|
87
87
|
},
|
|
88
88
|
get children() {
|
|
89
|
-
return a(
|
|
89
|
+
return a(E, {
|
|
90
90
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
}), a(
|
|
93
|
+
}), a(T, {
|
|
94
94
|
get when() {
|
|
95
|
-
return
|
|
95
|
+
return H(() => !!m().shouldCollapse)() && i() === 1;
|
|
96
96
|
},
|
|
97
97
|
get children() {
|
|
98
98
|
return [a(Y, {
|
|
99
99
|
get segments() {
|
|
100
100
|
return m().collapsed;
|
|
101
101
|
},
|
|
102
|
-
onSelect:
|
|
103
|
-
}), a(
|
|
102
|
+
onSelect: S
|
|
103
|
+
}), a(E, {
|
|
104
104
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
105
105
|
})];
|
|
106
106
|
}
|
|
107
107
|
}), a(Z, {
|
|
108
|
-
segment:
|
|
108
|
+
segment: l,
|
|
109
109
|
get isLast() {
|
|
110
|
-
return
|
|
110
|
+
return i() === m().visible.length - 1;
|
|
111
111
|
},
|
|
112
|
-
onClick: () =>
|
|
112
|
+
onClick: () => S(l)
|
|
113
113
|
})]
|
|
114
|
-
})),
|
|
114
|
+
})), x(() => W(e, C("flex items-center gap-1 min-w-0 overflow-hidden", r.class))), e;
|
|
115
115
|
})();
|
|
116
116
|
}
|
|
117
|
-
function Y(
|
|
118
|
-
const
|
|
117
|
+
function Y(r) {
|
|
118
|
+
const n = () => r.segments.map((t) => ({
|
|
119
119
|
id: t.path,
|
|
120
120
|
label: t.name
|
|
121
121
|
}));
|
|
@@ -123,32 +123,32 @@ function Y(n) {
|
|
|
123
123
|
get trigger() {
|
|
124
124
|
return (() => {
|
|
125
125
|
var t = j();
|
|
126
|
-
return
|
|
126
|
+
return x(() => W(t, C("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "text-muted-foreground hover:text-foreground hover:bg-muted/50", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"))), t;
|
|
127
127
|
})();
|
|
128
128
|
},
|
|
129
129
|
get items() {
|
|
130
|
-
return
|
|
130
|
+
return n();
|
|
131
131
|
},
|
|
132
132
|
onSelect: (t) => {
|
|
133
|
-
const c =
|
|
134
|
-
c &&
|
|
133
|
+
const c = r.segments.find((d) => d.path === t);
|
|
134
|
+
c && r.onSelect(c);
|
|
135
135
|
},
|
|
136
136
|
align: "start"
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
function Z(
|
|
139
|
+
function Z(r) {
|
|
140
140
|
return (() => {
|
|
141
|
-
var
|
|
142
|
-
return
|
|
143
|
-
var c =
|
|
144
|
-
return c !== t.e && (
|
|
141
|
+
var n = q(), s = n.firstChild;
|
|
142
|
+
return n.$$click = () => r.onClick(), R(s, () => r.segment.name), x((t) => {
|
|
143
|
+
var c = r.isLast, d = C("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", r.isLast ? "font-medium text-foreground cursor-default" : "text-muted-foreground hover:text-foreground hover:bg-muted/50");
|
|
144
|
+
return c !== t.e && (n.disabled = t.e = c), d !== t.t && W(n, t.t = d), t;
|
|
145
145
|
}, {
|
|
146
146
|
e: void 0,
|
|
147
147
|
t: void 0
|
|
148
|
-
}),
|
|
148
|
+
}), n;
|
|
149
149
|
})();
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
A(["click"]);
|
|
152
152
|
export {
|
|
153
153
|
ce as Breadcrumb
|
|
154
154
|
};
|
package/dist/index83.js
CHANGED
|
@@ -1,218 +1,223 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
2
|
-
import { createSignal as C, createMemo as E, createEffect as
|
|
1
|
+
import { delegateEvents as Z, template as P, insert as h, createComponent as d, effect as T, className as _, style as ee, memo as B, setAttribute as te, setStyleProperty as ne } from "solid-js/web";
|
|
2
|
+
import { createSignal as C, createMemo as E, createEffect as A, on as G, For as N, Show as F } from "solid-js";
|
|
3
3
|
import { cn as I } from "./index69.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { ChevronRight as M, Check as
|
|
7
|
-
import { FolderOpenIcon as W, FolderIcon as
|
|
8
|
-
var O = /* @__PURE__ */ P('<div class="flex items-center gap-1.5"><div class=flex-1>'),
|
|
4
|
+
import { Button as z } from "./index20.js";
|
|
5
|
+
import { Input as H } from "./index21.js";
|
|
6
|
+
import { ChevronRight as M, Check as re, X as le, Plus as oe } from "./index34.js";
|
|
7
|
+
import { FolderOpenIcon as W, FolderIcon as ie } from "./index48.js";
|
|
8
|
+
var O = /* @__PURE__ */ P('<div class="flex items-center gap-1.5"><div class=flex-1>'), ae = /* @__PURE__ */ P('<p class="text-[11px] text-muted-foreground -mt-1">Creating in: '), ce = /* @__PURE__ */ P("<button type=button><span>New Folder"), se = /* @__PURE__ */ P('<nav class="flex items-center gap-0.5 min-w-0 overflow-x-auto py-0.5"aria-label="Selected path">'), V = /* @__PURE__ */ P("<button type=button>"), ue = /* @__PURE__ */ P('<div class="flex items-center justify-center py-6 text-xs text-muted-foreground">'), de = /* @__PURE__ */ P("<div><button type=button><span>"), he = /* @__PURE__ */ P("<div class=overflow-hidden>"), fe = /* @__PURE__ */ P('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), ge = /* @__PURE__ */ P('<span class="flex-shrink-0 w-4 h-4">');
|
|
9
9
|
function S(e) {
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
return
|
|
10
|
+
const l = (e ?? "").trim();
|
|
11
|
+
if (l === "" || l === "/") return "/";
|
|
12
|
+
const n = l.replace(/\/+$/, "");
|
|
13
|
+
return n.startsWith("/") ? n : "/" + n;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
for (let
|
|
19
|
-
|
|
20
|
-
return
|
|
15
|
+
function j(e) {
|
|
16
|
+
const l = e.split("/").filter(Boolean), n = [];
|
|
17
|
+
let a = "";
|
|
18
|
+
for (let i = 0; i < l.length - 1; i++)
|
|
19
|
+
a += "/" + l[i], n.push(a);
|
|
20
|
+
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function me(e) {
|
|
23
23
|
return E(() => {
|
|
24
|
-
const
|
|
25
|
-
var
|
|
26
|
-
for (const
|
|
27
|
-
|
|
24
|
+
const l = /* @__PURE__ */ new Map(), n = (a) => {
|
|
25
|
+
var i;
|
|
26
|
+
for (const o of a)
|
|
27
|
+
o.type === "folder" && (l.set(S(o.path), o), (i = o.children) != null && i.length && n(o.children));
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return n(e()), l;
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
return
|
|
41
|
-
},
|
|
42
|
-
|
|
32
|
+
function Se(e) {
|
|
33
|
+
const l = e.initialPath ?? "/", n = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root", a = () => {
|
|
34
|
+
const t = typeof e.homePath == "function" ? e.homePath() : e.homePath;
|
|
35
|
+
return t ? S(t) : void 0;
|
|
36
|
+
}, i = (t) => {
|
|
37
|
+
const s = a();
|
|
38
|
+
if (!s) return t;
|
|
39
|
+
const u = S(t);
|
|
40
|
+
return u === "/" ? s : s === "/" ? u : s + u;
|
|
41
|
+
}, o = (t) => {
|
|
42
|
+
const s = a();
|
|
43
|
+
if (!s) return S(t);
|
|
44
|
+
const u = S(t);
|
|
45
|
+
return u === s ? "/" : s !== "/" && u.startsWith(s + "/") ? u.slice(s.length) || "/" : S(t);
|
|
46
|
+
}, [b, v] = C(l), [f, g] = C(/* @__PURE__ */ new Set(["/"])), [x, r] = C(i(l)), [w, c] = C(""), m = me(e.files), k = E(() => e.files().filter((t) => t.type === "folder"));
|
|
47
|
+
A(G(e.open, (t) => {
|
|
43
48
|
var s;
|
|
44
49
|
if (t) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const $ =
|
|
48
|
-
|
|
50
|
+
const u = e.initialPath ?? "/";
|
|
51
|
+
v(u), r(i(u)), c("");
|
|
52
|
+
const $ = j(u);
|
|
53
|
+
g(/* @__PURE__ */ new Set(["/", ...$])), (s = e.onReset) == null || s.call(e, u);
|
|
49
54
|
}
|
|
50
|
-
})),
|
|
51
|
-
i(
|
|
55
|
+
})), A(G(b, (t) => {
|
|
56
|
+
r(i(t)), c("");
|
|
52
57
|
}));
|
|
53
58
|
const y = (t) => {
|
|
54
59
|
const s = S(t);
|
|
55
|
-
return s === "/" ||
|
|
56
|
-
},
|
|
57
|
-
const s =
|
|
58
|
-
|
|
59
|
-
const $ = new Set(
|
|
60
|
+
return s === "/" || m().has(s);
|
|
61
|
+
}, p = (t) => e.filter ? e.filter(t) : !0, L = (t) => {
|
|
62
|
+
const s = j(t);
|
|
63
|
+
g((u) => {
|
|
64
|
+
const $ = new Set(u);
|
|
60
65
|
for (const D of s) $.add(D);
|
|
61
66
|
return $.add(t), $;
|
|
62
67
|
});
|
|
63
68
|
}, q = (t) => {
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
return
|
|
69
|
+
g((s) => {
|
|
70
|
+
const u = new Set(s);
|
|
71
|
+
return u.has(t) ? u.delete(t) : u.add(t), u;
|
|
67
72
|
});
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
return
|
|
73
|
+
}, J = (t) => {
|
|
74
|
+
p(t) && (v(t.path), g((s) => {
|
|
75
|
+
const u = new Set(s);
|
|
76
|
+
return u.add(t.path), u;
|
|
72
77
|
}));
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
const t =
|
|
77
|
-
y(t) ? (
|
|
78
|
-
},
|
|
79
|
-
t.key === "Enter" && (t.preventDefault(),
|
|
80
|
-
},
|
|
81
|
-
const t =
|
|
78
|
+
}, Q = () => {
|
|
79
|
+
v("/");
|
|
80
|
+
}, R = () => {
|
|
81
|
+
const t = o(x().trim());
|
|
82
|
+
y(t) ? (v(t), c(""), L(t)) : c("Path not found");
|
|
83
|
+
}, U = (t) => {
|
|
84
|
+
t.key === "Enter" && (t.preventDefault(), R());
|
|
85
|
+
}, Y = E(() => {
|
|
86
|
+
const t = b(), s = n();
|
|
82
87
|
if (t === "/" || t === "") return [{
|
|
83
|
-
name:
|
|
88
|
+
name: s,
|
|
84
89
|
path: "/"
|
|
85
90
|
}];
|
|
86
|
-
const
|
|
87
|
-
name:
|
|
91
|
+
const u = t.split("/").filter(Boolean), $ = [{
|
|
92
|
+
name: s,
|
|
88
93
|
path: "/"
|
|
89
94
|
}];
|
|
90
|
-
let
|
|
91
|
-
for (const
|
|
92
|
-
|
|
93
|
-
name:
|
|
94
|
-
path:
|
|
95
|
+
let D = "";
|
|
96
|
+
for (const K of u)
|
|
97
|
+
D += "/" + K, $.push({
|
|
98
|
+
name: K,
|
|
99
|
+
path: D
|
|
95
100
|
});
|
|
96
|
-
return
|
|
101
|
+
return $;
|
|
97
102
|
});
|
|
98
103
|
return {
|
|
99
|
-
selectedPath:
|
|
100
|
-
setSelectedPath:
|
|
101
|
-
expandedPaths:
|
|
104
|
+
selectedPath: b,
|
|
105
|
+
setSelectedPath: v,
|
|
106
|
+
expandedPaths: f,
|
|
102
107
|
toggleExpand: q,
|
|
103
|
-
pathInput:
|
|
104
|
-
setPathInput:
|
|
108
|
+
pathInput: x,
|
|
109
|
+
setPathInput: r,
|
|
105
110
|
pathInputError: w,
|
|
106
|
-
setPathInputError:
|
|
107
|
-
folderIndex:
|
|
111
|
+
setPathInputError: c,
|
|
112
|
+
folderIndex: m,
|
|
108
113
|
rootFolders: k,
|
|
109
114
|
isValidPath: y,
|
|
110
|
-
isSelectable:
|
|
111
|
-
handleSelectFolder:
|
|
112
|
-
handleSelectRoot:
|
|
113
|
-
handlePathInputGo:
|
|
114
|
-
handlePathInputKeyDown:
|
|
115
|
-
expandToPath:
|
|
116
|
-
breadcrumbSegments:
|
|
115
|
+
isSelectable: p,
|
|
116
|
+
handleSelectFolder: J,
|
|
117
|
+
handleSelectRoot: Q,
|
|
118
|
+
handlePathInputGo: R,
|
|
119
|
+
handlePathInputKeyDown: U,
|
|
120
|
+
expandToPath: L,
|
|
121
|
+
breadcrumbSegments: Y,
|
|
117
122
|
handleBreadcrumbClick: (t) => {
|
|
118
|
-
|
|
123
|
+
v(t), L(t);
|
|
119
124
|
},
|
|
120
|
-
homeLabel:
|
|
121
|
-
toDisplayPath:
|
|
125
|
+
homeLabel: n,
|
|
126
|
+
toDisplayPath: i
|
|
122
127
|
};
|
|
123
128
|
}
|
|
124
|
-
function
|
|
125
|
-
const [
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
|
|
129
|
+
function Ce(e) {
|
|
130
|
+
const [l, n] = C(!1), [a, i] = C(""), [o, b] = C(!1), v = () => {
|
|
131
|
+
n(!0), i("");
|
|
132
|
+
}, f = () => {
|
|
133
|
+
n(!1), i("");
|
|
134
|
+
}, g = async () => {
|
|
135
|
+
const r = a().trim();
|
|
136
|
+
if (r) {
|
|
137
|
+
b(!0);
|
|
133
138
|
try {
|
|
134
|
-
await e.onCreateFolder(e.parentPath(),
|
|
139
|
+
await e.onCreateFolder(e.parentPath(), r), n(!1), i("");
|
|
135
140
|
} finally {
|
|
136
|
-
|
|
141
|
+
b(!1);
|
|
137
142
|
}
|
|
138
143
|
}
|
|
139
|
-
},
|
|
140
|
-
|
|
144
|
+
}, x = (r) => {
|
|
145
|
+
r.key === "Enter" ? (r.preventDefault(), g()) : r.key === "Escape" && (r.preventDefault(), f());
|
|
141
146
|
};
|
|
142
|
-
return
|
|
147
|
+
return d(F, {
|
|
143
148
|
get when() {
|
|
144
|
-
return
|
|
149
|
+
return l();
|
|
145
150
|
},
|
|
146
151
|
get fallback() {
|
|
147
152
|
return (() => {
|
|
148
|
-
var
|
|
149
|
-
return
|
|
153
|
+
var r = ce(), w = r.firstChild;
|
|
154
|
+
return r.$$click = v, h(r, d(oe, {
|
|
150
155
|
class: "w-3.5 h-3.5"
|
|
151
|
-
}), w), T(() => _(
|
|
156
|
+
}), w), T(() => _(r, I("flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", "hover:text-foreground transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded px-1 py-0.5"))), r;
|
|
152
157
|
})();
|
|
153
158
|
},
|
|
154
159
|
get children() {
|
|
155
160
|
return [(() => {
|
|
156
|
-
var
|
|
157
|
-
return
|
|
161
|
+
var r = O(), w = r.firstChild;
|
|
162
|
+
return h(w, d(H, {
|
|
158
163
|
size: "sm",
|
|
159
164
|
get value() {
|
|
160
|
-
return
|
|
165
|
+
return a();
|
|
161
166
|
},
|
|
162
|
-
onInput: (
|
|
163
|
-
onKeyDown:
|
|
167
|
+
onInput: (c) => i(c.currentTarget.value),
|
|
168
|
+
onKeyDown: x,
|
|
164
169
|
placeholder: "Folder name",
|
|
165
170
|
get disabled() {
|
|
166
|
-
return
|
|
171
|
+
return o();
|
|
167
172
|
},
|
|
168
173
|
autofocus: !0
|
|
169
|
-
})),
|
|
174
|
+
})), h(r, d(z, {
|
|
170
175
|
variant: "primary",
|
|
171
176
|
size: "sm",
|
|
172
|
-
onClick:
|
|
177
|
+
onClick: g,
|
|
173
178
|
get loading() {
|
|
174
|
-
return
|
|
179
|
+
return o();
|
|
175
180
|
},
|
|
176
181
|
get disabled() {
|
|
177
|
-
return !
|
|
182
|
+
return !a().trim();
|
|
178
183
|
},
|
|
179
184
|
get children() {
|
|
180
|
-
return
|
|
185
|
+
return d(re, {
|
|
181
186
|
class: "w-3.5 h-3.5"
|
|
182
187
|
});
|
|
183
188
|
}
|
|
184
|
-
}), null),
|
|
189
|
+
}), null), h(r, d(z, {
|
|
185
190
|
variant: "ghost",
|
|
186
191
|
size: "sm",
|
|
187
|
-
onClick:
|
|
192
|
+
onClick: f,
|
|
188
193
|
get disabled() {
|
|
189
|
-
return
|
|
194
|
+
return o();
|
|
190
195
|
},
|
|
191
196
|
get children() {
|
|
192
|
-
return
|
|
197
|
+
return d(le, {
|
|
193
198
|
class: "w-3.5 h-3.5"
|
|
194
199
|
});
|
|
195
200
|
}
|
|
196
|
-
}), null),
|
|
201
|
+
}), null), r;
|
|
197
202
|
})(), (() => {
|
|
198
|
-
var
|
|
199
|
-
return
|
|
200
|
-
var w =
|
|
203
|
+
var r = ae();
|
|
204
|
+
return r.firstChild, h(r, (() => {
|
|
205
|
+
var w = B(() => !!e.toDisplayPath);
|
|
201
206
|
return () => w() ? e.toDisplayPath(e.parentPath()) : e.parentPath();
|
|
202
|
-
})(), null),
|
|
207
|
+
})(), null), r;
|
|
203
208
|
})()];
|
|
204
209
|
}
|
|
205
210
|
});
|
|
206
211
|
}
|
|
207
|
-
function
|
|
212
|
+
function _e(e) {
|
|
208
213
|
return (() => {
|
|
209
|
-
var
|
|
210
|
-
return
|
|
214
|
+
var l = O(), n = l.firstChild;
|
|
215
|
+
return h(n, d(H, {
|
|
211
216
|
size: "sm",
|
|
212
217
|
get value() {
|
|
213
218
|
return e.value();
|
|
214
219
|
},
|
|
215
|
-
onInput: (
|
|
220
|
+
onInput: (a) => e.onInput(a.currentTarget.value),
|
|
216
221
|
get onKeyDown() {
|
|
217
222
|
return e.onKeyDown;
|
|
218
223
|
},
|
|
@@ -222,50 +227,51 @@ function Ce(e) {
|
|
|
222
227
|
get error() {
|
|
223
228
|
return e.error();
|
|
224
229
|
}
|
|
225
|
-
})),
|
|
230
|
+
})), h(l, d(z, {
|
|
226
231
|
variant: "outline",
|
|
227
232
|
size: "sm",
|
|
228
233
|
get onClick() {
|
|
229
234
|
return e.onGo;
|
|
230
235
|
},
|
|
231
236
|
children: "Go"
|
|
232
|
-
}), null),
|
|
237
|
+
}), null), l;
|
|
233
238
|
})();
|
|
234
239
|
}
|
|
235
|
-
function
|
|
240
|
+
function Ie(e) {
|
|
236
241
|
return (() => {
|
|
237
|
-
var
|
|
238
|
-
return
|
|
242
|
+
var l = se();
|
|
243
|
+
return h(l, d(N, {
|
|
239
244
|
get each() {
|
|
240
245
|
return e.segments();
|
|
241
246
|
},
|
|
242
|
-
children: (
|
|
247
|
+
children: (n, a) => [d(F, {
|
|
243
248
|
get when() {
|
|
244
|
-
return
|
|
249
|
+
return a() > 0;
|
|
245
250
|
},
|
|
246
251
|
get children() {
|
|
247
|
-
return
|
|
252
|
+
return d(M, {
|
|
248
253
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
249
254
|
});
|
|
250
255
|
}
|
|
251
256
|
}), (() => {
|
|
252
|
-
var
|
|
253
|
-
return
|
|
257
|
+
var i = V();
|
|
258
|
+
return i.$$click = () => e.onClick(n.path), h(i, () => n.name), T(() => _(i, I("text-xs px-1 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", a() === e.segments().length - 1 ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"))), i;
|
|
254
259
|
})()]
|
|
255
|
-
})),
|
|
260
|
+
})), l;
|
|
256
261
|
})();
|
|
257
262
|
}
|
|
258
|
-
function
|
|
263
|
+
function Fe(e) {
|
|
264
|
+
const l = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root";
|
|
259
265
|
return (() => {
|
|
260
|
-
var
|
|
261
|
-
return
|
|
266
|
+
var n = de(), a = n.firstChild, i = a.firstChild;
|
|
267
|
+
return a.$$click = () => e.onSelectRoot(), h(a, d(W, {
|
|
262
268
|
class: "w-4 h-4 flex-shrink-0"
|
|
263
|
-
}),
|
|
269
|
+
}), i), h(i, l), h(n, d(N, {
|
|
264
270
|
get each() {
|
|
265
271
|
return e.rootFolders();
|
|
266
272
|
},
|
|
267
|
-
children: (
|
|
268
|
-
item:
|
|
273
|
+
children: (o) => d(X, {
|
|
274
|
+
item: o,
|
|
269
275
|
depth: 1,
|
|
270
276
|
get selectedPath() {
|
|
271
277
|
return e.selectedPath;
|
|
@@ -283,80 +289,80 @@ function Ie(e) {
|
|
|
283
289
|
return e.isSelectable;
|
|
284
290
|
}
|
|
285
291
|
})
|
|
286
|
-
}), null),
|
|
292
|
+
}), null), h(n, d(F, {
|
|
287
293
|
get when() {
|
|
288
294
|
return e.rootFolders().length === 0;
|
|
289
295
|
},
|
|
290
296
|
get children() {
|
|
291
|
-
var
|
|
292
|
-
return
|
|
297
|
+
var o = ue();
|
|
298
|
+
return h(o, () => e.emptyText ?? "No directories available"), o;
|
|
293
299
|
}
|
|
294
|
-
}), null), T((
|
|
295
|
-
var
|
|
296
|
-
return
|
|
300
|
+
}), null), T((o) => {
|
|
301
|
+
var b = I("border border-border rounded overflow-y-auto", e.class), v = e.style, f = I("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", e.selectedPath() === "/" && "bg-accent text-accent-foreground font-medium");
|
|
302
|
+
return b !== o.e && _(n, o.e = b), o.t = ee(n, v, o.t), f !== o.a && _(a, o.a = f), o;
|
|
297
303
|
}, {
|
|
298
304
|
e: void 0,
|
|
299
305
|
t: void 0,
|
|
300
306
|
a: void 0
|
|
301
|
-
}),
|
|
307
|
+
}), n;
|
|
302
308
|
})();
|
|
303
309
|
}
|
|
304
310
|
function X(e) {
|
|
305
|
-
const
|
|
306
|
-
var
|
|
307
|
-
return ((
|
|
308
|
-
}),
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
+
const l = () => e.expandedPaths().has(e.item.path), n = () => e.selectedPath() === e.item.path, a = () => e.isSelectable(e.item), i = E(() => {
|
|
312
|
+
var f;
|
|
313
|
+
return ((f = e.item.children) == null ? void 0 : f.filter((g) => g.type === "folder")) ?? [];
|
|
314
|
+
}), o = () => i().length > 0, b = (f) => {
|
|
315
|
+
f.stopPropagation(), e.onToggle(e.item.path);
|
|
316
|
+
}, v = () => {
|
|
311
317
|
e.onSelect(e.item);
|
|
312
318
|
};
|
|
313
319
|
return (() => {
|
|
314
|
-
var
|
|
315
|
-
return
|
|
320
|
+
var f = fe(), g = f.firstChild, x = g.firstChild, r = x.firstChild, w = r.nextSibling;
|
|
321
|
+
return h(g, d(F, {
|
|
316
322
|
get when() {
|
|
317
|
-
return
|
|
323
|
+
return o();
|
|
318
324
|
},
|
|
319
325
|
get fallback() {
|
|
320
|
-
return
|
|
326
|
+
return ge();
|
|
321
327
|
},
|
|
322
328
|
get children() {
|
|
323
|
-
var
|
|
324
|
-
return
|
|
329
|
+
var c = V();
|
|
330
|
+
return c.$$click = b, h(c, d(M, {
|
|
325
331
|
class: "w-3 h-3 opacity-60"
|
|
326
|
-
})), T((
|
|
327
|
-
var k = I("flex-shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer", "transition-transform duration-150",
|
|
328
|
-
return k !==
|
|
332
|
+
})), T((m) => {
|
|
333
|
+
var k = I("flex-shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer", "transition-transform duration-150", l() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring"), y = l() ? "Collapse folder" : "Expand folder";
|
|
334
|
+
return k !== m.e && _(c, m.e = k), y !== m.t && te(c, "aria-label", m.t = y), m;
|
|
329
335
|
}, {
|
|
330
336
|
e: void 0,
|
|
331
337
|
t: void 0
|
|
332
|
-
}),
|
|
338
|
+
}), c;
|
|
333
339
|
}
|
|
334
|
-
}),
|
|
340
|
+
}), x), x.$$click = v, h(r, d(F, {
|
|
335
341
|
get when() {
|
|
336
|
-
return
|
|
342
|
+
return B(() => !!o())() && l();
|
|
337
343
|
},
|
|
338
344
|
get fallback() {
|
|
339
|
-
return
|
|
345
|
+
return d(ie, {
|
|
340
346
|
class: "w-4 h-4"
|
|
341
347
|
});
|
|
342
348
|
},
|
|
343
349
|
get children() {
|
|
344
|
-
return
|
|
350
|
+
return d(W, {
|
|
345
351
|
class: "w-4 h-4"
|
|
346
352
|
});
|
|
347
353
|
}
|
|
348
|
-
})),
|
|
354
|
+
})), h(w, () => e.item.name), h(f, d(F, {
|
|
349
355
|
get when() {
|
|
350
|
-
return
|
|
356
|
+
return B(() => !!l())() && o();
|
|
351
357
|
},
|
|
352
358
|
get children() {
|
|
353
|
-
var
|
|
354
|
-
return
|
|
359
|
+
var c = he();
|
|
360
|
+
return h(c, d(N, {
|
|
355
361
|
get each() {
|
|
356
|
-
return
|
|
362
|
+
return i();
|
|
357
363
|
},
|
|
358
|
-
children: (
|
|
359
|
-
item:
|
|
364
|
+
children: (m) => d(X, {
|
|
365
|
+
item: m,
|
|
360
366
|
get depth() {
|
|
361
367
|
return e.depth + 1;
|
|
362
368
|
},
|
|
@@ -376,28 +382,28 @@ function X(e) {
|
|
|
376
382
|
return e.isSelectable;
|
|
377
383
|
}
|
|
378
384
|
})
|
|
379
|
-
})),
|
|
385
|
+
})), c;
|
|
380
386
|
}
|
|
381
|
-
}), null), T((
|
|
382
|
-
var
|
|
383
|
-
return
|
|
387
|
+
}), null), T((c) => {
|
|
388
|
+
var m = I("group flex items-center w-full text-xs", "transition-colors duration-100", a() ? "hover:bg-accent/60" : "opacity-50", n() && a() && "bg-accent text-accent-foreground font-medium"), k = `${4 + e.depth * 14}px`, y = !a(), p = I("flex items-center gap-1 flex-1 min-w-0 text-left py-1.5 pl-0.5 pr-2", a() ? "cursor-pointer" : "cursor-not-allowed", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring");
|
|
389
|
+
return m !== c.e && _(g, c.e = m), k !== c.t && ne(g, "padding-left", c.t = k), y !== c.a && (x.disabled = c.a = y), p !== c.o && _(x, c.o = p), c;
|
|
384
390
|
}, {
|
|
385
391
|
e: void 0,
|
|
386
392
|
t: void 0,
|
|
387
393
|
a: void 0,
|
|
388
394
|
o: void 0
|
|
389
|
-
}),
|
|
395
|
+
}), f;
|
|
390
396
|
})();
|
|
391
397
|
}
|
|
392
|
-
|
|
398
|
+
Z(["click"]);
|
|
393
399
|
export {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
400
|
+
Ce as NewFolderSection,
|
|
401
|
+
_e as PathInputBar,
|
|
402
|
+
Ie as PickerBreadcrumb,
|
|
403
|
+
Fe as PickerFolderTree,
|
|
398
404
|
X as PickerTreeNode,
|
|
399
|
-
|
|
405
|
+
j as getAncestorPaths,
|
|
400
406
|
S as normalizePath,
|
|
401
|
-
|
|
402
|
-
|
|
407
|
+
me as useFolderIndex,
|
|
408
|
+
Se as usePickerTree
|
|
403
409
|
};
|