@floegence/floe-webapp-core 0.2.3 → 0.3.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/file-browser/Breadcrumb.d.ts +1 -0
- package/dist/components/file-browser/FileBrowserToolbar.d.ts +3 -1
- package/dist/components/file-browser/FileContextMenu.d.ts +22 -3
- package/dist/components/file-browser/index.d.ts +1 -1
- package/dist/components/file-browser/types.d.ts +12 -0
- package/dist/index38.js +62 -48
- package/dist/index39.js +99 -70
- package/dist/index41.js +145 -77
- package/dist/index42.js +121 -56
- package/dist/index43.js +54 -46
- package/dist/index44.js +123 -38
- package/dist/index45.js +91 -40
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index43.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { delegateEvents as D, createComponent as u, Portal as E, template as l, insert as w, Dynamic as L, effect as c, className as $, setStyleProperty as
|
|
2
|
-
import { createEffect as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { delegateEvents as D, createComponent as u, Portal as E, template as l, insert as w, Dynamic as L, effect as c, className as $, setStyleProperty as I, setAttribute as p, use as j } from "solid-js/web";
|
|
2
|
+
import { createEffect as H, onCleanup as P, Show as g, For as F } from "solid-js";
|
|
3
|
+
import { cn as _ } from "./index67.js";
|
|
4
4
|
import { deferAfterPaint as R } from "./index68.js";
|
|
5
|
-
import { useFileBrowser as
|
|
6
|
-
var
|
|
5
|
+
import { useFileBrowser as T } from "./index39.js";
|
|
6
|
+
var V = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><rect width=14 height=14 x=8 y=8 rx=2 ry=2></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2">'), S = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3Z">'), Z = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"></path><path d="M8 10v4"></path><path d="M12 10v2"></path><path d="M16 10v6">'), z = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M12 3v18"></path><path d="m8 7-4 4 4 4"></path><path d="m16 7 4 4-4 4">'), W = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2">'), K = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"></path><path d="m15 5 4 4">'), N = /* @__PURE__ */ l("<div role=menu aria-orientation=vertical>"), O = /* @__PURE__ */ l('<span class="text-[10px] text-muted-foreground opacity-60">'), q = /* @__PURE__ */ l('<button type=button role=menuitem><span class="flex-1 text-left">'), G = /* @__PURE__ */ l('<div class="my-1 h-px bg-border">');
|
|
7
7
|
const J = (r) => (() => {
|
|
8
|
-
var o =
|
|
8
|
+
var o = V();
|
|
9
9
|
return c(() => p(o, "class", r.class)), o;
|
|
10
10
|
})(), Q = (r) => (() => {
|
|
11
|
-
var o =
|
|
11
|
+
var o = S();
|
|
12
12
|
return c(() => p(o, "class", r.class)), o;
|
|
13
13
|
})(), U = (r) => (() => {
|
|
14
14
|
var o = Z();
|
|
@@ -24,7 +24,7 @@ const J = (r) => (() => {
|
|
|
24
24
|
return c(() => p(o, "class", r.class)), o;
|
|
25
25
|
})();
|
|
26
26
|
function se(r) {
|
|
27
|
-
const o =
|
|
27
|
+
const o = T();
|
|
28
28
|
let h;
|
|
29
29
|
const b = [{
|
|
30
30
|
id: "duplicate",
|
|
@@ -62,22 +62,30 @@ function se(r) {
|
|
|
62
62
|
icon: Y,
|
|
63
63
|
shortcut: "Del"
|
|
64
64
|
}], A = () => {
|
|
65
|
-
var
|
|
65
|
+
var t;
|
|
66
66
|
if (r.overrideItems)
|
|
67
67
|
return r.overrideItems;
|
|
68
|
+
const a = () => {
|
|
69
|
+
var s;
|
|
70
|
+
const e = r.hideItems;
|
|
71
|
+
if (!e) return [];
|
|
72
|
+
if (typeof e == "function") {
|
|
73
|
+
const i = ((s = o.contextMenu()) == null ? void 0 : s.items) ?? [];
|
|
74
|
+
return e(i);
|
|
75
|
+
}
|
|
76
|
+
return e;
|
|
77
|
+
};
|
|
68
78
|
let n = b;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})), (d = r.customItems) != null && d.length && (n = [...n, ...r.customItems]), n;
|
|
73
|
-
}, B = (n, i) => {
|
|
79
|
+
const d = a();
|
|
80
|
+
return d.length > 0 && (n = n.filter((e) => !d.includes(e.type))), (t = r.customItems) != null && t.length && (n = [...n, ...r.customItems]), n;
|
|
81
|
+
}, B = (a, n) => {
|
|
74
82
|
o.hideContextMenu();
|
|
75
|
-
const d =
|
|
83
|
+
const d = a.type, t = [...n], e = r.callbacks, s = a.onAction;
|
|
76
84
|
R(() => {
|
|
77
|
-
var
|
|
85
|
+
var i, v, m, k, M, C;
|
|
78
86
|
switch (d) {
|
|
79
87
|
case "duplicate":
|
|
80
|
-
(
|
|
88
|
+
(i = e == null ? void 0 : e.onDuplicate) == null || i.call(e, t);
|
|
81
89
|
break;
|
|
82
90
|
case "ask-agent":
|
|
83
91
|
(v = e == null ? void 0 : e.onAskAgent) == null || v.call(e, t);
|
|
@@ -95,67 +103,67 @@ function se(r) {
|
|
|
95
103
|
t.length === 1 && ((C = e == null ? void 0 : e.onRename) == null || C.call(e, t[0]));
|
|
96
104
|
break;
|
|
97
105
|
case "custom":
|
|
98
|
-
|
|
106
|
+
s == null || s(t);
|
|
99
107
|
break;
|
|
100
108
|
}
|
|
101
109
|
});
|
|
102
|
-
}, f = (
|
|
103
|
-
h && !h.contains(
|
|
104
|
-
}, x = (
|
|
105
|
-
|
|
110
|
+
}, f = (a) => {
|
|
111
|
+
h && !h.contains(a.target) && o.hideContextMenu();
|
|
112
|
+
}, x = (a) => {
|
|
113
|
+
a.key === "Escape" && o.hideContextMenu();
|
|
106
114
|
};
|
|
107
|
-
|
|
108
|
-
o.contextMenu() && (document.addEventListener("click", f), document.addEventListener("keydown", x),
|
|
115
|
+
H(() => {
|
|
116
|
+
o.contextMenu() && (document.addEventListener("click", f), document.addEventListener("keydown", x), P(() => {
|
|
109
117
|
document.removeEventListener("click", f), document.removeEventListener("keydown", x);
|
|
110
118
|
}));
|
|
111
119
|
});
|
|
112
120
|
const y = () => {
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
121
|
+
const a = o.contextMenu();
|
|
122
|
+
if (!a || !h) return {
|
|
115
123
|
x: 0,
|
|
116
124
|
y: 0
|
|
117
125
|
};
|
|
118
|
-
const
|
|
119
|
-
let e =
|
|
120
|
-
return e +
|
|
126
|
+
const n = h.getBoundingClientRect(), d = window.innerWidth, t = window.innerHeight;
|
|
127
|
+
let e = a.x, s = a.y;
|
|
128
|
+
return e + n.width > d && (e = d - n.width - 8), s + n.height > t && (s = t - n.height - 8), {
|
|
121
129
|
x: Math.max(8, e),
|
|
122
|
-
y: Math.max(8,
|
|
130
|
+
y: Math.max(8, s)
|
|
123
131
|
};
|
|
124
132
|
};
|
|
125
133
|
return u(g, {
|
|
126
134
|
get when() {
|
|
127
135
|
return o.contextMenu();
|
|
128
136
|
},
|
|
129
|
-
children: (
|
|
137
|
+
children: (a) => u(E, {
|
|
130
138
|
get children() {
|
|
131
|
-
var
|
|
132
|
-
return typeof d == "function" ? j(d,
|
|
139
|
+
var n = N(), d = h;
|
|
140
|
+
return typeof d == "function" ? j(d, n) : h = n, w(n, u(F, {
|
|
133
141
|
get each() {
|
|
134
142
|
return A();
|
|
135
143
|
},
|
|
136
144
|
children: (t) => [(() => {
|
|
137
|
-
var e = q(),
|
|
138
|
-
return e.$$click = () => B(t,
|
|
145
|
+
var e = q(), s = e.firstChild;
|
|
146
|
+
return e.$$click = () => B(t, a().items), w(e, u(g, {
|
|
139
147
|
get when() {
|
|
140
148
|
return t.icon;
|
|
141
149
|
},
|
|
142
|
-
children: (
|
|
150
|
+
children: (i) => u(L, {
|
|
143
151
|
get component() {
|
|
144
|
-
return
|
|
152
|
+
return i();
|
|
145
153
|
},
|
|
146
154
|
class: "w-3.5 h-3.5 opacity-60"
|
|
147
155
|
})
|
|
148
|
-
}),
|
|
156
|
+
}), s), w(s, () => t.label), w(e, u(g, {
|
|
149
157
|
get when() {
|
|
150
158
|
return t.shortcut;
|
|
151
159
|
},
|
|
152
160
|
get children() {
|
|
153
|
-
var
|
|
154
|
-
return w(
|
|
161
|
+
var i = O();
|
|
162
|
+
return w(i, () => t.shortcut), i;
|
|
155
163
|
}
|
|
156
|
-
}), null), c((
|
|
157
|
-
var v = t.disabled || t.type === "rename" &&
|
|
158
|
-
return v !==
|
|
164
|
+
}), null), c((i) => {
|
|
165
|
+
var v = t.disabled || t.type === "rename" && a().items.length > 1, m = _("w-full flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer", "transition-colors duration-75", "hover:bg-accent hover:text-accent-foreground", "focus:outline-none focus-visible:bg-accent focus-visible:text-accent-foreground", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent", t.type === "delete" && "text-error hover:bg-error/10 hover:text-error");
|
|
166
|
+
return v !== i.e && (e.disabled = i.e = v), m !== i.t && $(e, i.t = m), i;
|
|
159
167
|
}, {
|
|
160
168
|
e: void 0,
|
|
161
169
|
t: void 0
|
|
@@ -169,13 +177,13 @@ function se(r) {
|
|
|
169
177
|
}
|
|
170
178
|
})]
|
|
171
179
|
})), c((t) => {
|
|
172
|
-
var e =
|
|
173
|
-
return e !== t.e && $(
|
|
180
|
+
var e = _("fixed z-50 min-w-[180px] py-1", "bg-popover border border-border rounded-lg shadow-lg", "animate-in fade-in zoom-in-95 duration-100"), s = `${y().x}px`, i = `${y().y}px`;
|
|
181
|
+
return e !== t.e && $(n, t.e = e), s !== t.t && I(n, "left", t.t = s), i !== t.a && I(n, "top", t.a = i), t;
|
|
174
182
|
}, {
|
|
175
183
|
e: void 0,
|
|
176
184
|
t: void 0,
|
|
177
185
|
a: void 0
|
|
178
|
-
}),
|
|
186
|
+
}), n;
|
|
179
187
|
}
|
|
180
188
|
})
|
|
181
189
|
});
|
package/dist/index44.js
CHANGED
|
@@ -1,69 +1,154 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
2
|
-
import { createMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useFileBrowser as
|
|
5
|
-
import { ChevronRight as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { delegateEvents as H, template as v, insert as E, createComponent as a, memo as P, effect as b, className as x, use as y } from "solid-js/web";
|
|
2
|
+
import { createSignal as B, onMount as L, createMemo as k, For as O, Show as M, onCleanup as F } from "solid-js";
|
|
3
|
+
import { cn as W } from "./index67.js";
|
|
4
|
+
import { useFileBrowser as G } from "./index39.js";
|
|
5
|
+
import { ChevronRight as T } from "./index32.js";
|
|
6
|
+
import { Dropdown as z } from "./index24.js";
|
|
7
|
+
var X = /* @__PURE__ */ v("<nav aria-label=Breadcrumb>"), j = /* @__PURE__ */ v('<button type=button title="Show hidden path segments">…'), q = /* @__PURE__ */ v('<button type=button><span class="truncate max-w-[120px] block">');
|
|
8
|
+
const g = 16, J = 28, R = 12, K = 7, Q = 120, U = 100;
|
|
9
|
+
function V(n) {
|
|
10
|
+
const r = n.length * K;
|
|
11
|
+
return Math.min(r + R, Q + R);
|
|
12
|
+
}
|
|
13
|
+
function ce(n) {
|
|
14
|
+
const r = G();
|
|
15
|
+
let s;
|
|
16
|
+
const [t, c] = B(0);
|
|
17
|
+
L(() => {
|
|
18
|
+
if (!s) return;
|
|
19
|
+
const e = () => {
|
|
20
|
+
s && c(s.offsetWidth);
|
|
21
|
+
};
|
|
22
|
+
e();
|
|
23
|
+
const o = new ResizeObserver(e);
|
|
24
|
+
o.observe(s), F(() => o.disconnect());
|
|
25
|
+
});
|
|
26
|
+
const d = k(() => {
|
|
27
|
+
const e = r.currentPath();
|
|
28
|
+
if (e === "/" || e === "")
|
|
11
29
|
return [{
|
|
12
30
|
name: "Root",
|
|
13
31
|
path: "/"
|
|
14
32
|
}];
|
|
15
|
-
const
|
|
33
|
+
const o = e.split("/").filter(Boolean), i = [{
|
|
16
34
|
name: "Root",
|
|
17
35
|
path: "/"
|
|
18
36
|
}];
|
|
19
|
-
let
|
|
20
|
-
for (const
|
|
21
|
-
|
|
22
|
-
name:
|
|
23
|
-
path:
|
|
37
|
+
let l = "";
|
|
38
|
+
for (const f of o)
|
|
39
|
+
l += "/" + f, i.push({
|
|
40
|
+
name: f,
|
|
41
|
+
path: l
|
|
24
42
|
});
|
|
25
|
-
return
|
|
26
|
-
}),
|
|
27
|
-
e
|
|
43
|
+
return i;
|
|
44
|
+
}), m = k(() => {
|
|
45
|
+
const e = d(), o = t();
|
|
46
|
+
if (o < U || e.length <= 2)
|
|
47
|
+
return {
|
|
48
|
+
collapsed: [],
|
|
49
|
+
visible: e,
|
|
50
|
+
shouldCollapse: !1
|
|
51
|
+
};
|
|
52
|
+
const i = e.map((u) => V(u.name)), l = i[0], f = i[e.length - 1], D = g, $ = e.length > 1 ? g : 0, S = l + f + D + $;
|
|
53
|
+
if (S > o && e.length > 2)
|
|
54
|
+
return {
|
|
55
|
+
collapsed: e.slice(1, -1),
|
|
56
|
+
visible: [e[0], e[e.length - 1]],
|
|
57
|
+
shouldCollapse: !0
|
|
58
|
+
};
|
|
59
|
+
const h = e.slice(1, -1), p = [];
|
|
60
|
+
let _ = o - S;
|
|
61
|
+
const N = h.length > 0 ? J + g : 0;
|
|
62
|
+
for (let u = h.length - 1; u >= 0; u--) {
|
|
63
|
+
const I = i[u + 1] + g, A = u > 0 ? N : 0;
|
|
64
|
+
if (_ - A >= I)
|
|
65
|
+
p.unshift(h[u]), _ -= I;
|
|
66
|
+
else
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
const w = h.slice(0, h.length - p.length);
|
|
70
|
+
return {
|
|
71
|
+
collapsed: w,
|
|
72
|
+
visible: [e[0], ...p, e[e.length - 1]],
|
|
73
|
+
shouldCollapse: w.length > 0
|
|
74
|
+
};
|
|
75
|
+
}), C = (e) => {
|
|
76
|
+
r.setCurrentPath(e.path);
|
|
28
77
|
};
|
|
29
78
|
return (() => {
|
|
30
|
-
var
|
|
31
|
-
return
|
|
79
|
+
var e = X(), o = s;
|
|
80
|
+
return typeof o == "function" ? y(o, e) : s = e, E(e, a(O, {
|
|
32
81
|
get each() {
|
|
33
|
-
return
|
|
82
|
+
return m().visible;
|
|
34
83
|
},
|
|
35
|
-
children: (
|
|
84
|
+
children: (i, l) => [a(M, {
|
|
36
85
|
get when() {
|
|
37
|
-
return
|
|
86
|
+
return l() > 0;
|
|
38
87
|
},
|
|
39
88
|
get children() {
|
|
40
|
-
return
|
|
89
|
+
return a(T, {
|
|
41
90
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
42
91
|
});
|
|
43
92
|
}
|
|
44
|
-
}),
|
|
45
|
-
|
|
93
|
+
}), a(M, {
|
|
94
|
+
get when() {
|
|
95
|
+
return P(() => !!m().shouldCollapse)() && l() === 1;
|
|
96
|
+
},
|
|
97
|
+
get children() {
|
|
98
|
+
return [a(Y, {
|
|
99
|
+
get segments() {
|
|
100
|
+
return m().collapsed;
|
|
101
|
+
},
|
|
102
|
+
onSelect: C
|
|
103
|
+
}), a(T, {
|
|
104
|
+
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
105
|
+
})];
|
|
106
|
+
}
|
|
107
|
+
}), a(Z, {
|
|
108
|
+
segment: i,
|
|
46
109
|
get isLast() {
|
|
47
|
-
return
|
|
110
|
+
return l() === m().visible.length - 1;
|
|
48
111
|
},
|
|
49
|
-
onClick: () =>
|
|
112
|
+
onClick: () => C(i)
|
|
50
113
|
})]
|
|
51
|
-
})),
|
|
114
|
+
})), b(() => x(e, W("flex items-center gap-1 min-w-0 overflow-hidden", n.class))), e;
|
|
52
115
|
})();
|
|
53
116
|
}
|
|
54
|
-
function
|
|
117
|
+
function Y(n) {
|
|
118
|
+
const r = () => n.segments.map((t) => ({
|
|
119
|
+
id: t.path,
|
|
120
|
+
label: t.name
|
|
121
|
+
}));
|
|
122
|
+
return a(z, {
|
|
123
|
+
get trigger() {
|
|
124
|
+
return (() => {
|
|
125
|
+
var t = j();
|
|
126
|
+
return b(() => x(t, W("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
|
+
})();
|
|
128
|
+
},
|
|
129
|
+
get items() {
|
|
130
|
+
return r();
|
|
131
|
+
},
|
|
132
|
+
onSelect: (t) => {
|
|
133
|
+
const c = n.segments.find((d) => d.path === t);
|
|
134
|
+
c && n.onSelect(c);
|
|
135
|
+
},
|
|
136
|
+
align: "start"
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function Z(n) {
|
|
55
140
|
return (() => {
|
|
56
|
-
var
|
|
57
|
-
return
|
|
58
|
-
var
|
|
59
|
-
return
|
|
141
|
+
var r = q(), s = r.firstChild;
|
|
142
|
+
return r.$$click = () => n.onClick(), E(s, () => n.segment.name), b((t) => {
|
|
143
|
+
var c = n.isLast, d = W("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", n.isLast ? "font-medium text-foreground cursor-default" : "text-muted-foreground hover:text-foreground hover:bg-muted/50");
|
|
144
|
+
return c !== t.e && (r.disabled = t.e = c), d !== t.t && x(r, t.t = d), t;
|
|
60
145
|
}, {
|
|
61
146
|
e: void 0,
|
|
62
147
|
t: void 0
|
|
63
|
-
}),
|
|
148
|
+
}), r;
|
|
64
149
|
})();
|
|
65
150
|
}
|
|
66
|
-
|
|
151
|
+
H(["click"]);
|
|
67
152
|
export {
|
|
68
|
-
|
|
153
|
+
ce as Breadcrumb
|
|
69
154
|
};
|
package/dist/index45.js
CHANGED
|
@@ -1,66 +1,117 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { delegateEvents as S, template as u, addEventListener as M, insert as o, createComponent as l, use as Q, effect as s, className as d, setAttribute as g } from "solid-js/web";
|
|
2
|
+
import { onMount as T, Show as A } from "solid-js";
|
|
3
|
+
import { cn as v } from "./index67.js";
|
|
4
|
+
import { useFileBrowser as E } from "./index39.js";
|
|
5
|
+
import { Breadcrumb as L } from "./index44.js";
|
|
6
|
+
import { Grid as V } from "./index32.js";
|
|
7
|
+
var N = /* @__PURE__ */ u('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=8 y1=6 x2=21 y2=6></line><line x1=8 y1=12 x2=21 y2=12></line><line x1=8 y1=18 x2=21 y2=18></line><line x1=3 y1=6 x2=3.01 y2=6></line><line x1=3 y1=12 x2=3.01 y2=12></line><line x1=3 y1=18 x2=3.01 y2=18>'), U = /* @__PURE__ */ u('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"></path><path d="M12 10v6"></path><path d="m9 13 3-3 3 3">'), G = /* @__PURE__ */ u('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><rect width=18 height=18 x=3 y=3 rx=2 ry=2></rect><line x1=9 y1=3 x2=9 y2=21>'), D = /* @__PURE__ */ u('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><circle cx=11 cy=11 r=8></circle><path d="m21 21-4.3-4.3">'), H = /* @__PURE__ */ u('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M18 6 6 18"></path><path d="m6 6 12 12">'), K = /* @__PURE__ */ u('<button type=button aria-label="Clear filter">'), P = /* @__PURE__ */ u('<div class="flex items-center flex-1 gap-1 px-2 py-1 bg-muted/50 rounded-md border border-border/50 focus-within:border-ring focus-within:ring-1 focus-within:ring-ring"><input type=text placeholder=Filter... aria-label="Filter files by name">'), R = /* @__PURE__ */ u('<div><button type=button aria-label="Toggle sidebar"></button><button type=button aria-label="Navigate to parent folder"></button><div></div><div></div><div class="flex items-center gap-0.5 p-0.5 bg-muted/50 rounded-md">'), X = /* @__PURE__ */ u('<button type=button aria-label="Filter files">'), Z = /* @__PURE__ */ u("<button type=button>");
|
|
8
|
+
const q = (r) => (() => {
|
|
9
|
+
var e = N();
|
|
10
|
+
return s(() => g(e, "class", r.class)), e;
|
|
11
|
+
})(), z = (r) => (() => {
|
|
12
|
+
var e = U();
|
|
13
|
+
return s(() => g(e, "class", r.class)), e;
|
|
14
|
+
})(), J = (r) => (() => {
|
|
15
|
+
var e = G();
|
|
16
|
+
return s(() => g(e, "class", r.class)), e;
|
|
17
|
+
})(), j = (r) => (() => {
|
|
18
|
+
var e = D();
|
|
19
|
+
return s(() => g(e, "class", r.class)), e;
|
|
20
|
+
})(), O = (r) => (() => {
|
|
21
|
+
var e = H();
|
|
22
|
+
return s(() => g(e, "class", r.class)), e;
|
|
16
23
|
})();
|
|
17
|
-
function
|
|
18
|
-
const e =
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
function ie(r) {
|
|
25
|
+
const e = E();
|
|
26
|
+
let n;
|
|
27
|
+
const c = () => {
|
|
28
|
+
const f = e.currentPath();
|
|
29
|
+
return f !== "/" && f !== "";
|
|
30
|
+
}, m = () => {
|
|
31
|
+
e.isFilterActive() ? (e.setFilterQuery(""), e.setFilterActive(!1)) : (e.setFilterActive(!0), setTimeout(() => n == null ? void 0 : n.focus(), 50));
|
|
32
|
+
}, w = () => {
|
|
33
|
+
e.setFilterQuery(""), n == null || n.focus();
|
|
34
|
+
}, h = (f) => {
|
|
35
|
+
f.key === "Escape" && (e.setFilterQuery(""), e.setFilterActive(!1));
|
|
36
|
+
}, I = () => {
|
|
37
|
+
e.filterQuery().trim() || e.setFilterActive(!1);
|
|
21
38
|
};
|
|
22
|
-
return (() => {
|
|
23
|
-
|
|
24
|
-
|
|
39
|
+
return T(() => {
|
|
40
|
+
r.filterInputRef && n && r.filterInputRef(n);
|
|
41
|
+
}), (() => {
|
|
42
|
+
var f = R(), x = f.firstChild, b = x.nextSibling, p = b.nextSibling, y = p.nextSibling, k = y.nextSibling;
|
|
43
|
+
return M(x, "click", e.toggleSidebar, !0), o(x, l(J, {
|
|
25
44
|
class: "w-4 h-4"
|
|
26
|
-
})),
|
|
45
|
+
})), M(b, "click", e.navigateUp, !0), o(b, l(z, {
|
|
27
46
|
class: "w-4 h-4"
|
|
28
|
-
})),
|
|
47
|
+
})), o(p, l(L, {})), o(y, l(A, {
|
|
48
|
+
get when() {
|
|
49
|
+
return e.isFilterActive();
|
|
50
|
+
},
|
|
51
|
+
get fallback() {
|
|
52
|
+
return (() => {
|
|
53
|
+
var t = X();
|
|
54
|
+
return t.$$click = m, o(t, l(j, {
|
|
55
|
+
class: "w-4 h-4"
|
|
56
|
+
})), s(() => d(t, v("flex items-center justify-center w-7 h-7 rounded cursor-pointer", "transition-colors duration-100", "hover:bg-muted/70", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"))), t;
|
|
57
|
+
})();
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
var t = P(), a = t.firstChild;
|
|
61
|
+
return o(t, l(j, {
|
|
62
|
+
class: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0"
|
|
63
|
+
}), a), a.addEventListener("blur", I), a.$$keydown = h, a.$$input = (i) => e.setFilterQuery(i.currentTarget.value), Q((i) => {
|
|
64
|
+
n = i, r.filterInputRef && r.filterInputRef(i);
|
|
65
|
+
}, a), o(t, l(A, {
|
|
66
|
+
get when() {
|
|
67
|
+
return e.filterQuery();
|
|
68
|
+
},
|
|
69
|
+
get children() {
|
|
70
|
+
var i = K();
|
|
71
|
+
return i.$$click = w, o(i, l(O, {
|
|
72
|
+
class: "w-3 h-3"
|
|
73
|
+
})), s(() => d(i, v("flex items-center justify-center w-4 h-4 rounded-sm cursor-pointer", "text-muted-foreground hover:text-foreground", "transition-colors duration-100"))), i;
|
|
74
|
+
}
|
|
75
|
+
}), null), s(() => d(a, v("flex-1 min-w-0 bg-transparent text-xs", "outline-none border-0 ring-0 shadow-none appearance-none", "focus:outline-none focus:border-0 focus:ring-0", "placeholder:text-muted-foreground/60"))), s(() => a.value = e.filterQuery()), t;
|
|
76
|
+
}
|
|
77
|
+
})), o(k, l(B, {
|
|
29
78
|
mode: "list",
|
|
30
79
|
get currentMode() {
|
|
31
80
|
return e.viewMode();
|
|
32
81
|
},
|
|
33
82
|
onClick: () => e.setViewMode("list"),
|
|
34
|
-
icon:
|
|
83
|
+
icon: q,
|
|
35
84
|
label: "List view"
|
|
36
|
-
}), null),
|
|
85
|
+
}), null), o(k, l(B, {
|
|
37
86
|
mode: "grid",
|
|
38
87
|
get currentMode() {
|
|
39
88
|
return e.viewMode();
|
|
40
89
|
},
|
|
41
90
|
onClick: () => e.setViewMode("grid"),
|
|
42
|
-
icon:
|
|
91
|
+
icon: V,
|
|
43
92
|
label: "Grid view"
|
|
44
|
-
}), null),
|
|
45
|
-
var
|
|
46
|
-
return
|
|
93
|
+
}), null), s((t) => {
|
|
94
|
+
var a = v("flex items-center gap-2 px-2 py-1.5 border-b border-border", "bg-background/50 backdrop-blur-sm", r.class), i = v("md:hidden flex items-center justify-center w-7 h-7 rounded cursor-pointer", "transition-colors duration-100", "hover:bg-muted/70", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", !e.sidebarCollapsed() && "bg-muted/50"), $ = !c(), F = v("flex items-center justify-center w-7 h-7 rounded cursor-pointer", "transition-colors duration-100", "hover:bg-muted/70", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent"), _ = v("flex-1 min-w-0 overflow-hidden transition-all duration-200", e.isFilterActive() && "hidden sm:block sm:flex-1"), C = v("flex items-center gap-1 transition-all duration-200 ease-out", e.isFilterActive() ? "flex-1 sm:flex-none sm:w-48" : "w-7");
|
|
95
|
+
return a !== t.e && d(f, t.e = a), i !== t.t && d(x, t.t = i), $ !== t.a && (b.disabled = t.a = $), F !== t.o && d(b, t.o = F), _ !== t.i && d(p, t.i = _), C !== t.n && d(y, t.n = C), t;
|
|
47
96
|
}, {
|
|
48
97
|
e: void 0,
|
|
49
98
|
t: void 0,
|
|
50
99
|
a: void 0,
|
|
51
|
-
o: void 0
|
|
52
|
-
|
|
100
|
+
o: void 0,
|
|
101
|
+
i: void 0,
|
|
102
|
+
n: void 0
|
|
103
|
+
}), f;
|
|
53
104
|
})();
|
|
54
105
|
}
|
|
55
|
-
function
|
|
106
|
+
function B(r) {
|
|
56
107
|
const e = () => r.currentMode === r.mode;
|
|
57
108
|
return (() => {
|
|
58
|
-
var n =
|
|
59
|
-
return n.$$click = () => r.onClick(),
|
|
109
|
+
var n = Z();
|
|
110
|
+
return n.$$click = () => r.onClick(), o(n, l(r.icon, {
|
|
60
111
|
class: "w-3.5 h-3.5"
|
|
61
|
-
})),
|
|
62
|
-
var
|
|
63
|
-
return
|
|
112
|
+
})), s((c) => {
|
|
113
|
+
var m = v("flex items-center justify-center w-6 h-6 rounded cursor-pointer", "transition-all duration-150", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", e() ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"), w = r.label, h = e();
|
|
114
|
+
return m !== c.e && d(n, c.e = m), w !== c.t && g(n, "aria-label", c.t = w), h !== c.a && g(n, "aria-pressed", c.a = h), c;
|
|
64
115
|
}, {
|
|
65
116
|
e: void 0,
|
|
66
117
|
t: void 0,
|
|
@@ -68,7 +119,7 @@ function p(r) {
|
|
|
68
119
|
}), n;
|
|
69
120
|
})();
|
|
70
121
|
}
|
|
71
|
-
|
|
122
|
+
S(["click", "input", "keydown"]);
|
|
72
123
|
export {
|
|
73
|
-
|
|
124
|
+
ie as FileBrowserToolbar
|
|
74
125
|
};
|