@floegence/floe-webapp-core 0.8.0 → 0.8.1
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/ui/picker/PickerBase.d.ts +8 -8
- package/dist/index29.js +2 -2
- package/dist/index30.js +2 -2
- package/dist/index83.js +199 -193
- package/package.json +1 -1
|
@@ -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/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
|
};
|