@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/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 _, setAttribute as p, use as j } from "solid-js/web";
2
- import { createEffect as P, onCleanup as F, Show as g, For as H } from "solid-js";
3
- import { cn as I } from "./index67.js";
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 V } from "./index39.js";
6
- var 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><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">'), T = /* @__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">');
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 = S();
8
+ var o = V();
9
9
  return c(() => p(o, "class", r.class)), o;
10
10
  })(), Q = (r) => (() => {
11
- var o = T();
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 = V();
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 i, d;
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
- return (i = r.hideItems) != null && i.length && (n = n.filter((t) => {
70
- var e;
71
- return !((e = r.hideItems) != null && e.includes(t.type));
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 = n.type, t = [...i], e = r.callbacks, a = n.onAction;
83
+ const d = a.type, t = [...n], e = r.callbacks, s = a.onAction;
76
84
  R(() => {
77
- var s, v, m, k, M, C;
85
+ var i, v, m, k, M, C;
78
86
  switch (d) {
79
87
  case "duplicate":
80
- (s = e == null ? void 0 : e.onDuplicate) == null || s.call(e, t);
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
- a == null || a(t);
106
+ s == null || s(t);
99
107
  break;
100
108
  }
101
109
  });
102
- }, f = (n) => {
103
- h && !h.contains(n.target) && o.hideContextMenu();
104
- }, x = (n) => {
105
- n.key === "Escape" && o.hideContextMenu();
110
+ }, f = (a) => {
111
+ h && !h.contains(a.target) && o.hideContextMenu();
112
+ }, x = (a) => {
113
+ a.key === "Escape" && o.hideContextMenu();
106
114
  };
107
- P(() => {
108
- o.contextMenu() && (document.addEventListener("click", f), document.addEventListener("keydown", x), F(() => {
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 n = o.contextMenu();
114
- if (!n || !h) return {
121
+ const a = o.contextMenu();
122
+ if (!a || !h) return {
115
123
  x: 0,
116
124
  y: 0
117
125
  };
118
- const i = h.getBoundingClientRect(), d = window.innerWidth, t = window.innerHeight;
119
- let e = n.x, a = n.y;
120
- return e + i.width > d && (e = d - i.width - 8), a + i.height > t && (a = t - i.height - 8), {
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, a)
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: (n) => u(E, {
137
+ children: (a) => u(E, {
130
138
  get children() {
131
- var i = N(), d = h;
132
- return typeof d == "function" ? j(d, i) : h = i, w(i, u(H, {
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(), a = e.firstChild;
138
- return e.$$click = () => B(t, n().items), w(e, u(g, {
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: (s) => u(L, {
150
+ children: (i) => u(L, {
143
151
  get component() {
144
- return s();
152
+ return i();
145
153
  },
146
154
  class: "w-3.5 h-3.5 opacity-60"
147
155
  })
148
- }), a), w(a, () => t.label), w(e, u(g, {
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 s = O();
154
- return w(s, () => t.shortcut), s;
161
+ var i = O();
162
+ return w(i, () => t.shortcut), i;
155
163
  }
156
- }), null), c((s) => {
157
- var v = t.disabled || t.type === "rename" && n().items.length > 1, m = I("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");
158
- return v !== s.e && (e.disabled = s.e = v), m !== s.t && $(e, s.t = m), s;
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 = I("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"), a = `${y().x}px`, s = `${y().y}px`;
173
- return e !== t.e && $(i, t.e = e), a !== t.t && _(i, "left", t.t = a), s !== t.a && _(i, "top", t.a = s), t;
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
- }), i;
186
+ }), n;
179
187
  }
180
188
  })
181
189
  });
package/dist/index44.js CHANGED
@@ -1,69 +1,154 @@
1
- import { delegateEvents as g, template as l, insert as m, createComponent as s, effect as f, className as d } from "solid-js/web";
2
- import { createMemo as p, For as v, Show as x } from "solid-js";
3
- import { cn as h } from "./index67.js";
4
- import { useFileBrowser as b } from "./index39.js";
5
- import { ChevronRight as k } from "./index32.js";
6
- var C = /* @__PURE__ */ l("<nav aria-label=Breadcrumb>"), w = /* @__PURE__ */ l('<button type=button><span class="truncate max-w-[120px] block">');
7
- function y(o) {
8
- const e = b(), i = p(() => {
9
- const t = e.currentPath();
10
- if (t === "/" || t === "")
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 n = t.split("/").filter(Boolean), a = [{
33
+ const o = e.split("/").filter(Boolean), i = [{
16
34
  name: "Root",
17
35
  path: "/"
18
36
  }];
19
- let u = "";
20
- for (const c of n)
21
- u += "/" + c, a.push({
22
- name: c,
23
- path: u
37
+ let l = "";
38
+ for (const f of o)
39
+ l += "/" + f, i.push({
40
+ name: f,
41
+ path: l
24
42
  });
25
- return a;
26
- }), r = (t) => {
27
- e.setCurrentPath(t.path);
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 t = C();
31
- return m(t, s(v, {
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 i();
82
+ return m().visible;
34
83
  },
35
- children: (n, a) => [s(x, {
84
+ children: (i, l) => [a(M, {
36
85
  get when() {
37
- return a() > 0;
86
+ return l() > 0;
38
87
  },
39
88
  get children() {
40
- return s(k, {
89
+ return a(T, {
41
90
  class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
42
91
  });
43
92
  }
44
- }), s(B, {
45
- segment: n,
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 a() === i().length - 1;
110
+ return l() === m().visible.length - 1;
48
111
  },
49
- onClick: () => r(n)
112
+ onClick: () => C(i)
50
113
  })]
51
- })), f(() => d(t, h("flex items-center gap-1 min-w-0", o.class))), t;
114
+ })), b(() => x(e, W("flex items-center gap-1 min-w-0 overflow-hidden", n.class))), e;
52
115
  })();
53
116
  }
54
- function B(o) {
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 e = w(), i = e.firstChild;
57
- return e.$$click = () => o.onClick(), m(i, () => o.segment.name), f((r) => {
58
- var t = o.isLast, n = h("text-xs px-1.5 py-0.5 rounded cursor-pointer", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", o.isLast ? "font-medium text-foreground cursor-default" : "text-muted-foreground hover:text-foreground hover:bg-muted/50");
59
- return t !== r.e && (e.disabled = r.e = t), n !== r.t && d(e, r.t = n), r;
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
- }), e;
148
+ }), r;
64
149
  })();
65
150
  }
66
- g(["click"]);
151
+ H(["click"]);
67
152
  export {
68
- y as Breadcrumb
153
+ ce as Breadcrumb
69
154
  };
package/dist/index45.js CHANGED
@@ -1,66 +1,117 @@
1
- import { delegateEvents as k, template as u, addEventListener as y, insert as s, createComponent as a, effect as v, className as b, setAttribute as c } from "solid-js/web";
2
- import { cn as g } from "./index67.js";
3
- import { useFileBrowser as M } from "./index39.js";
4
- import { Breadcrumb as C } from "./index44.js";
5
- import { Grid as $ } from "./index32.js";
6
- var B = /* @__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>'), _ = /* @__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">'), j = /* @__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>'), S = /* @__PURE__ */ u('<div><button type=button aria-label="Toggle sidebar"></button><button type=button aria-label="Navigate to parent folder"></button><div class="flex-1 min-w-0 overflow-hidden"></div><div class="flex items-center gap-0.5 p-0.5 bg-muted/50 rounded-md">'), V = /* @__PURE__ */ u("<button type=button>");
7
- const A = (r) => (() => {
8
- var e = B();
9
- return v(() => c(e, "class", r.class)), e;
10
- })(), F = (r) => (() => {
11
- var e = _();
12
- return v(() => c(e, "class", r.class)), e;
13
- })(), I = (r) => (() => {
14
- var e = j();
15
- return v(() => c(e, "class", r.class)), e;
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 T(r) {
18
- const e = M(), n = () => {
19
- const t = e.currentPath();
20
- return t !== "/" && t !== "";
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
- var t = S(), l = t.firstChild, i = l.nextSibling, d = i.nextSibling, m = d.nextSibling;
24
- return y(l, "click", e.toggleSidebar, !0), s(l, a(I, {
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
- })), y(i, "click", e.navigateUp, !0), s(i, a(F, {
45
+ })), M(b, "click", e.navigateUp, !0), o(b, l(z, {
27
46
  class: "w-4 h-4"
28
- })), s(d, a(C, {})), s(m, a(p, {
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: A,
83
+ icon: q,
35
84
  label: "List view"
36
- }), null), s(m, a(p, {
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), v((o) => {
45
- var w = g("flex items-center gap-2 px-2 py-1.5 border-b border-border", "bg-background/50 backdrop-blur-sm", r.class), x = g("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"), f = !n(), h = g("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");
46
- return w !== o.e && b(t, o.e = w), x !== o.t && b(l, o.t = x), f !== o.a && (i.disabled = o.a = f), h !== o.o && b(i, o.o = h), o;
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
- }), t;
100
+ o: void 0,
101
+ i: void 0,
102
+ n: void 0
103
+ }), f;
53
104
  })();
54
105
  }
55
- function p(r) {
106
+ function B(r) {
56
107
  const e = () => r.currentMode === r.mode;
57
108
  return (() => {
58
- var n = V();
59
- return n.$$click = () => r.onClick(), s(n, a(r.icon, {
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
- })), v((t) => {
62
- var l = g("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"), i = r.label, d = e();
63
- return l !== t.e && b(n, t.e = l), i !== t.t && c(n, "aria-label", t.t = i), d !== t.a && c(n, "aria-pressed", t.a = d), t;
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
- k(["click"]);
122
+ S(["click", "input", "keydown"]);
72
123
  export {
73
- T as FileBrowserToolbar
124
+ ie as FileBrowserToolbar
74
125
  };