@floegence/floe-webapp-core 0.26.2 → 0.26.4

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.
@@ -1,47 +1,60 @@
1
- import { addEventListener as h, insert as s, createComponent as o, effect as C, className as D, setAttribute as B, template as c, use as H, delegateEvents as M } from "solid-js/web";
2
- import { createSignal as S, Show as v } from "solid-js";
3
- import { cn as _ } from "../../../utils/cn.js";
4
- import { useChatContext as z } from "../ChatProvider.js";
5
- import { useAttachments as K } from "../hooks/useAttachments.js";
6
- import { AttachmentPreview as R } from "./AttachmentPreview.js";
7
- var U = /* @__PURE__ */ c("<div class=chat-input-drop-overlay><span>Drop files here"), j = /* @__PURE__ */ c('<button type=button class=chat-input-attachment-btn title="Add attachments">'), N = /* @__PURE__ */ c('<div><div class=chat-input-row><textarea class=chat-input-textarea rows=1></textarea><button type=button title="Send message">'), O = /* @__PURE__ */ c('<svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'), q = /* @__PURE__ */ c('<svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=22 y1=2 x2=11 y2=13></line><polygon points="22 2 15 22 11 13 2 9 22 2">'), G = /* @__PURE__ */ c('<svg width=32 height=32 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1=12 y1=3 x2=12 y2=15>');
8
- const nt = (d) => {
9
- const r = z(), [g, f] = S(""), [E, w] = S(!1);
10
- let i;
11
- const n = K({
12
- maxAttachments: r.config().maxAttachments,
13
- maxSize: r.config().maxAttachmentSize,
14
- acceptedTypes: r.config().acceptedFileTypes,
15
- onUpload: r.config().allowAttachments ? (t) => r.uploadAttachment(t) : void 0
16
- }), I = () => d.placeholder || r.config().placeholder || "Type a message...", p = () => (g().trim() || n.attachments().length > 0) && !d.disabled, L = () => {
17
- i && (i.style.height = "auto", i.style.height = `${Math.min(i.scrollHeight, 200)}px`);
18
- }, P = (t) => {
19
- f(t.currentTarget.value), L();
1
+ import { addEventListener as h, insert as s, createComponent as r, effect as S, className as _, setAttribute as M, template as c, use as j, delegateEvents as q } from "solid-js/web";
2
+ import { createSignal as F, onCleanup as z, Show as v } from "solid-js";
3
+ import { cn as E } from "../../../utils/cn.js";
4
+ import { useChatContext as K } from "../ChatProvider.js";
5
+ import { useAttachments as R } from "../hooks/useAttachments.js";
6
+ import { AttachmentPreview as U } from "./AttachmentPreview.js";
7
+ var N = /* @__PURE__ */ c("<div class=chat-input-drop-overlay><span>Drop files here"), O = /* @__PURE__ */ c('<button type=button class=chat-input-attachment-btn title="Add attachments">'), G = /* @__PURE__ */ c('<div><div class=chat-input-row><textarea class=chat-input-textarea rows=1></textarea><button type=button title="Send message">'), J = /* @__PURE__ */ c('<svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'), Q = /* @__PURE__ */ c('<svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=22 y1=2 x2=11 y2=13></line><polygon points="22 2 15 22 11 13 2 9 22 2">'), V = /* @__PURE__ */ c('<svg width=32 height=32 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1=12 y1=3 x2=12 y2=15>');
8
+ const rt = (u) => {
9
+ const i = K(), [p, y] = F(""), [I, w] = F(!1);
10
+ let d, o = null;
11
+ const n = R({
12
+ maxAttachments: i.config().maxAttachments,
13
+ maxSize: i.config().maxAttachmentSize,
14
+ acceptedTypes: i.config().acceptedFileTypes,
15
+ onUpload: i.config().allowAttachments ? (t) => i.uploadAttachment(t) : void 0
16
+ }), L = () => u.placeholder || i.config().placeholder || "Type a message...", f = () => (p().trim() || n.attachments().length > 0) && !u.disabled, x = () => {
17
+ const t = d;
18
+ t && (t.style.height = "auto", t.style.height = `${Math.min(t.scrollHeight, 200)}px`);
19
+ }, P = () => {
20
+ if (o === null) {
21
+ if (typeof requestAnimationFrame > "u") {
22
+ x();
23
+ return;
24
+ }
25
+ o = requestAnimationFrame(() => {
26
+ o = null, x();
27
+ });
28
+ }
20
29
  }, T = (t) => {
21
- t.key === "Enter" && !t.shiftKey && (t.preventDefault(), y());
22
- }, y = async () => {
23
- if (!p()) return;
24
- const t = g().trim(), l = n.attachments();
25
- f(""), n.clearAttachments(), i && (i.style.height = "auto"), await r.sendMessage(t, l);
26
- }, F = async (t) => {
27
- r.config().allowAttachments && await n.handlePaste(t);
30
+ y(t.currentTarget.value), P();
31
+ }, H = (t) => {
32
+ t.key === "Enter" && !t.shiftKey && (t.preventDefault(), A());
33
+ }, A = async () => {
34
+ if (!f()) return;
35
+ const t = p().trim(), l = n.attachments();
36
+ y(""), n.clearAttachments(), d && (d.style.height = "auto"), await i.sendMessage(t, l);
37
+ }, B = async (t) => {
38
+ i.config().allowAttachments && await n.handlePaste(t);
28
39
  };
29
- return (() => {
30
- var t = N(), l = t.firstChild, a = l.firstChild, u = a.nextSibling;
31
- h(t, "drop", n.handleDrop), h(t, "dragover", n.handleDragOver), h(t, "dragleave", n.handleDragLeave), h(t, "dragenter", n.handleDragEnter), s(t, o(v, {
40
+ return z(() => {
41
+ o !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(o), o = null);
42
+ }), (() => {
43
+ var t = G(), l = t.firstChild, a = l.firstChild, m = a.nextSibling;
44
+ h(t, "drop", n.handleDrop), h(t, "dragover", n.handleDragOver), h(t, "dragleave", n.handleDragLeave), h(t, "dragenter", n.handleDragEnter), s(t, r(v, {
32
45
  get when() {
33
46
  return n.isDragging();
34
47
  },
35
48
  get children() {
36
- var e = U(), m = e.firstChild;
37
- return s(e, o(V, {}), m), e;
49
+ var e = N(), g = e.firstChild;
50
+ return s(e, r(Y, {}), g), e;
38
51
  }
39
- }), l), s(t, o(v, {
52
+ }), l), s(t, r(v, {
40
53
  get when() {
41
54
  return n.attachments().length > 0;
42
55
  },
43
56
  get children() {
44
- return o(R, {
57
+ return r(U, {
45
58
  get attachments() {
46
59
  return n.attachments();
47
60
  },
@@ -50,29 +63,29 @@ const nt = (d) => {
50
63
  }
51
64
  });
52
65
  }
53
- }), l), s(l, o(v, {
66
+ }), l), s(l, r(v, {
54
67
  get when() {
55
- return r.config().allowAttachments;
68
+ return i.config().allowAttachments;
56
69
  },
57
70
  get children() {
58
- var e = j();
59
- return h(e, "click", n.openFilePicker, !0), s(e, o(J, {})), e;
71
+ var e = O();
72
+ return h(e, "click", n.openFilePicker, !0), s(e, r(W, {})), e;
60
73
  }
61
- }), a), a.addEventListener("blur", () => w(!1)), a.addEventListener("focus", () => w(!0)), a.addEventListener("paste", F), a.$$keydown = T, a.$$input = P;
62
- var x = i;
63
- return typeof x == "function" ? H(x, a) : i = a, u.$$click = y, s(u, o(Q, {})), C((e) => {
64
- var m = _("chat-input-container", E() && "chat-input-container-focused", n.isDragging() && "chat-input-container-dragging", d.class), $ = I(), b = d.disabled, k = _("chat-input-send-btn", p() && "chat-input-send-btn-active"), A = !p();
65
- return m !== e.e && D(t, e.e = m), $ !== e.t && B(a, "placeholder", e.t = $), b !== e.a && (a.disabled = e.a = b), k !== e.o && D(u, e.o = k), A !== e.i && (u.disabled = e.i = A), e;
74
+ }), a), a.addEventListener("blur", () => w(!1)), a.addEventListener("focus", () => w(!0)), a.addEventListener("paste", B), a.$$keydown = H, a.$$input = T;
75
+ var $ = d;
76
+ return typeof $ == "function" ? j($, a) : d = a, m.$$click = A, s(m, r(X, {})), S((e) => {
77
+ var g = E("chat-input-container", I() && "chat-input-container-focused", n.isDragging() && "chat-input-container-dragging", u.class), b = L(), k = u.disabled, C = E("chat-input-send-btn", f() && "chat-input-send-btn-active"), D = !f();
78
+ return g !== e.e && _(t, e.e = g), b !== e.t && M(a, "placeholder", e.t = b), k !== e.a && (a.disabled = e.a = k), C !== e.o && _(m, e.o = C), D !== e.i && (m.disabled = e.i = D), e;
66
79
  }, {
67
80
  e: void 0,
68
81
  t: void 0,
69
82
  a: void 0,
70
83
  o: void 0,
71
84
  i: void 0
72
- }), C(() => a.value = g()), t;
85
+ }), S(() => a.value = p()), t;
73
86
  })();
74
- }, J = () => O(), Q = () => q(), V = () => G();
75
- M(["click", "input", "keydown"]);
87
+ }, W = () => J(), X = () => Q(), Y = () => V();
88
+ q(["click", "input", "keydown"]);
76
89
  export {
77
- nt as ChatInput
90
+ rt as ChatInput
78
91
  };
@@ -1,12 +1,12 @@
1
- import { effect as x, className as B, setAttribute as L, template as _, use as N, delegateEvents as O } from "solid-js/web";
2
- import { createSignal as U, onCleanup as j } from "solid-js";
3
- import { cn as J } from "../../utils/cn.js";
4
- import { useDeck as K } from "../../context/DeckContext.js";
5
- import { applyResizeDelta as Q } from "../../utils/gridLayout.js";
6
- import { getGridConfigFromElement as V } from "./DeckGrid.js";
7
- import { lockBodyStyle as Z } from "../../utils/bodyStyleLock.js";
8
- var ee = /* @__PURE__ */ _("<div style=touch-action:none>");
9
- const te = {
1
+ import { effect as x, className as L, setAttribute as _, template as N, use as O, delegateEvents as U } from "solid-js/web";
2
+ import { createSignal as j, onCleanup as J } from "solid-js";
3
+ import { cn as K } from "../../utils/cn.js";
4
+ import { useDeck as Q } from "../../context/DeckContext.js";
5
+ import { applyResizeDelta as V } from "../../utils/gridLayout.js";
6
+ import { getGridConfigFromElement as Z } from "./DeckGrid.js";
7
+ import { lockBodyStyle as ee } from "../../utils/bodyStyleLock.js";
8
+ var te = /* @__PURE__ */ N("<div style=touch-action:none>");
9
+ const ne = {
10
10
  n: "top-0 left-2 right-2 h-2 cursor-ns-resize",
11
11
  s: "bottom-0 left-2 right-2 h-2 cursor-ns-resize",
12
12
  e: "right-0 top-2 bottom-2 w-2 cursor-ew-resize",
@@ -15,7 +15,7 @@ const te = {
15
15
  nw: "top-0 left-0 w-4 h-4 cursor-nwse-resize",
16
16
  se: "bottom-0 right-0 w-4 h-4 cursor-nwse-resize",
17
17
  sw: "bottom-0 left-0 w-4 h-4 cursor-nesw-resize"
18
- }, ne = {
18
+ }, re = {
19
19
  n: "ns-resize",
20
20
  s: "ns-resize",
21
21
  e: "ew-resize",
@@ -25,84 +25,84 @@ const te = {
25
25
  se: "nwse-resize",
26
26
  sw: "nesw-resize"
27
27
  };
28
- function de(i) {
29
- const f = K(), [m, T] = U(!1);
30
- let g, h = null, d = 0, u = 0, y = 0, p = 0, s = 0, b = 0, S = 0, A = 0, l = null, w = null, r = null, P = 0, C = 0;
31
- const F = (e) => {
28
+ function ue(i) {
29
+ const f = Q(), [m, C] = j(!1);
30
+ let g, h = null, d = 0, u = 0, y = 0, p = 0, s = 0, R = 0, b = 0, S = 0, l = null, w = null, r = null, A = null, P = 0, F = 0;
31
+ const E = (e) => {
32
32
  if (!e) {
33
33
  w?.(), w = null;
34
34
  return;
35
35
  }
36
- w?.(), w = Z({
37
- cursor: ne[i.edge],
36
+ w?.(), w = ee({
37
+ cursor: re[i.edge],
38
38
  "user-select": "none"
39
39
  });
40
- }, E = () => {
41
- m() && (l !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(l), l = null), T(!1), h = null, r = null, F(!1), f.endResize(!0));
42
- }, k = () => {
40
+ }, D = () => {
41
+ m() && (l !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(l), l = null), C(!1), h = null, r = null, A = null, E(!1), f.endResize(!0));
42
+ }, Y = () => {
43
43
  if (!r) return;
44
- const e = r.getBoundingClientRect(), t = 48, n = 24, o = s - e.top, a = e.bottom - s;
45
- let c = 0;
46
- if (o < t ? c = -Math.ceil((t - o) / t * n) : a < t && (c = Math.ceil((t - a) / t * n)), c === 0) return;
47
- const z = r.scrollTop, v = Math.max(0, Math.min(z + c, r.scrollHeight - r.clientHeight));
44
+ const e = A ?? r.getBoundingClientRect(), t = 48, n = 24, o = s - e.top, c = e.bottom - s;
45
+ let a = 0;
46
+ if (o < t ? a = -Math.ceil((t - o) / t * n) : c < t && (a = Math.ceil((t - c) / t * n)), a === 0) return;
47
+ const z = r.scrollTop, v = Math.max(0, Math.min(z + a, r.scrollHeight - r.clientHeight));
48
48
  v !== z && (r.scrollTop = v);
49
- }, Y = () => {
49
+ }, $ = () => {
50
50
  if (l !== null || typeof requestAnimationFrame > "u") return;
51
51
  const e = () => {
52
52
  if (!m()) {
53
53
  l = null;
54
54
  return;
55
55
  }
56
- D(), l = requestAnimationFrame(e);
56
+ I(), l = requestAnimationFrame(e);
57
57
  };
58
58
  l = requestAnimationFrame(e);
59
- }, $ = (e) => {
59
+ }, G = (e) => {
60
60
  if (e.pointerType === "mouse" && e.button !== 0) return;
61
61
  e.preventDefault(), e.stopPropagation();
62
62
  const t = e.currentTarget?.closest(".deck-grid");
63
63
  if (!t) return;
64
- h = e.pointerId, d = e.clientX, u = e.clientY, p = d, s = u, b = d, S = u, T(!0), F(!0), r = t, y = t.scrollTop, A = y;
64
+ h = e.pointerId, d = e.clientX, u = e.clientY, p = d, s = u, R = d, b = u, C(!0), E(!0), r = t, A = t.getBoundingClientRect(), y = t.scrollTop, S = y;
65
65
  const n = window.getComputedStyle(t);
66
- P = parseFloat(n.paddingLeft) || 0, C = parseFloat(n.paddingRight) || 0, f.startResize(i.widget.id, i.edge, d, u), g?.setPointerCapture(e.pointerId), Y();
67
- }, G = (e) => {
68
- !m() || h !== e.pointerId || (p = e.clientX, s = e.clientY, typeof requestAnimationFrame > "u" && D());
69
- }, D = () => {
66
+ P = parseFloat(n.paddingLeft) || 0, F = parseFloat(n.paddingRight) || 0, f.startResize(i.widget.id, i.edge, d, u), g?.setPointerCapture(e.pointerId), $();
67
+ }, W = (e) => {
68
+ !m() || h !== e.pointerId || (p = e.clientX, s = e.clientY, typeof requestAnimationFrame > "u" && I());
69
+ }, I = () => {
70
70
  if (!r) return;
71
- k();
71
+ Y();
72
72
  const e = r.scrollTop;
73
- if (p === b && s === S && e === A) return;
74
- b = p, S = s, A = e;
73
+ if (p === R && s === b && e === S) return;
74
+ R = p, b = s, S = e;
75
75
  const t = p - d, n = s - u + (e - y), {
76
76
  cols: o,
77
- rowHeight: a,
78
- gap: c
79
- } = V(r), z = r.clientWidth - P - C, v = c * (o - 1), R = (z - v) / o;
80
- if (!Number.isFinite(R) || R <= 0) return;
81
- const W = a + c, X = Math.round(t / R), H = Math.round(n / W), M = f.getWidgetMinConstraints(i.widget.type), q = Q(i.widget.position, i.edge, X, H, M.minColSpan, M.minRowSpan, o);
77
+ rowHeight: c,
78
+ gap: a
79
+ } = Z(r), z = r.clientWidth - P - F, v = a * (o - 1), T = (z - v) / o;
80
+ if (!Number.isFinite(T) || T <= 0) return;
81
+ const X = c + a, B = Math.round(t / T), H = Math.round(n / X), k = f.getWidgetMinConstraints(i.widget.type), q = V(i.widget.position, i.edge, B, H, k.minColSpan, k.minRowSpan, o);
82
82
  f.updateResize(q);
83
- }, I = (e) => {
83
+ }, M = (e) => {
84
84
  if (h === e.pointerId) {
85
85
  try {
86
86
  g?.releasePointerCapture(e.pointerId);
87
87
  } catch {
88
88
  }
89
- E();
89
+ D();
90
90
  }
91
91
  };
92
- return j(() => E()), (() => {
93
- var e = ee();
94
- e.addEventListener("pointercancel", I), e.$$pointerup = I, e.$$pointermove = G, e.$$pointerdown = $;
92
+ return J(() => D()), (() => {
93
+ var e = te();
94
+ e.addEventListener("pointercancel", M), e.$$pointerup = M, e.$$pointermove = W, e.$$pointerdown = G;
95
95
  var t = g;
96
- return typeof t == "function" ? N(t, e) : g = e, x((n) => {
97
- var o = J("absolute z-30", te[i.edge], "hover:bg-primary/30 transition-colors", m() && "bg-primary/50"), a = i.edge;
98
- return o !== n.e && B(e, n.e = o), a !== n.t && L(e, "data-widget-resize-handle", n.t = a), n;
96
+ return typeof t == "function" ? O(t, e) : g = e, x((n) => {
97
+ var o = K("absolute z-30", ne[i.edge], "hover:bg-primary/30 transition-colors", m() && "bg-primary/50"), c = i.edge;
98
+ return o !== n.e && L(e, n.e = o), c !== n.t && _(e, "data-widget-resize-handle", n.t = c), n;
99
99
  }, {
100
100
  e: void 0,
101
101
  t: void 0
102
102
  }), e;
103
103
  })();
104
104
  }
105
- O(["pointerdown", "pointermove", "pointerup"]);
105
+ U(["pointerdown", "pointermove", "pointerup"]);
106
106
  export {
107
- de as WidgetResizeHandle
107
+ ue as WidgetResizeHandle
108
108
  };
@@ -1,19 +1,20 @@
1
- import { createComponent as n, insert as l, addEventListener as L, use as P, memo as w, effect as A, className as W, setStyleProperty as B, template as m, delegateEvents as G } from "solid-js/web";
2
- import { onMount as H, onCleanup as Q, createEffect as p, Show as o } from "solid-js";
1
+ import { createComponent as n, insert as l, addEventListener as P, use as L, memo as w, effect as T, className as W, setStyleProperty as B, template as m, delegateEvents as p } from "solid-js/web";
2
+ import { onMount as G, onCleanup as H, createEffect as Q, Show as o } from "solid-js";
3
3
  import { cn as K } from "../../utils/cn.js";
4
4
  import { useLayout as q } from "../../context/LayoutContext.js";
5
5
  import { useFileBrowserDrag as J } from "../../context/FileBrowserDragContext.js";
6
- import { FileBrowserProvider as U, useFileBrowser as X } from "./FileBrowserContext.js";
7
- import { ResizeHandle as Y } from "../layout/ResizeHandle.js";
8
- import { DirectoryTree as Z } from "./DirectoryTree.js";
9
- import { FileListView as ee } from "./FileListView.js";
10
- import { FileGridView as te } from "./FileGridView.js";
11
- import { FileBrowserToolbar as re } from "./FileBrowserToolbar.js";
12
- import { FileContextMenu as ie } from "./FileContextMenu.js";
13
- import { DragPreview as ne } from "./DragPreview.js";
14
- var le = /* @__PURE__ */ m('<div class="border-b border-border">'), oe = /* @__PURE__ */ m('<button type=button class="flex items-center justify-center w-5 h-5 rounded cursor-pointer hover:bg-sidebar-accent/80 transition-colors"aria-label="Close sidebar"><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 class="w-3.5 h-3.5"><path d="M18 6 6 18"></path><path d="m6 6 12 12">'), ae = /* @__PURE__ */ m('<div class="absolute inset-0 bg-background/60 backdrop-blur-sm z-[9]">'), se = /* @__PURE__ */ m('<div><div class="flex flex-1 min-h-0 relative"><aside><div class="h-full flex flex-col"><div class="flex items-center justify-between px-3 py-2 border-b border-sidebar-border"><span class="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60">Explorer</span></div><div class="flex-1 min-h-0 overflow-auto py-1"></div></div></aside><div class="flex-1 min-w-0 flex flex-col"><div class="flex-1 min-h-0"></div><div class="flex items-center justify-between px-3 py-1 border-t border-border text-[10px] text-muted-foreground"><span> items</span><span class="truncate max-w-[200px]">');
15
- function Se(e) {
16
- return n(U, {
6
+ import { deferAfterPaint as U } from "../../utils/defer.js";
7
+ import { FileBrowserProvider as X, useFileBrowser as Y } from "./FileBrowserContext.js";
8
+ import { ResizeHandle as Z } from "../layout/ResizeHandle.js";
9
+ import { DirectoryTree as ee } from "./DirectoryTree.js";
10
+ import { FileListView as te } from "./FileListView.js";
11
+ import { FileGridView as re } from "./FileGridView.js";
12
+ import { FileBrowserToolbar as ie } from "./FileBrowserToolbar.js";
13
+ import { FileContextMenu as ne } from "./FileContextMenu.js";
14
+ import { DragPreview as le } from "./DragPreview.js";
15
+ var oe = /* @__PURE__ */ m('<div class="border-b border-border">'), ae = /* @__PURE__ */ m('<button type=button class="flex items-center justify-center w-5 h-5 rounded cursor-pointer hover:bg-sidebar-accent/80 transition-colors"aria-label="Close sidebar"><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 class="w-3.5 h-3.5"><path d="M18 6 6 18"></path><path d="m6 6 12 12">'), se = /* @__PURE__ */ m('<div class="absolute inset-0 bg-background/60 backdrop-blur-sm z-[9]">'), de = /* @__PURE__ */ m('<div><div class="flex flex-1 min-h-0 relative"><aside><div class="h-full flex flex-col"><div class="flex items-center justify-between px-3 py-2 border-b border-sidebar-border"><span class="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60">Explorer</span></div><div class="flex-1 min-h-0 overflow-auto py-1"></div></div></aside><div class="flex-1 min-w-0 flex flex-col"><div class="flex-1 min-h-0"></div><div class="flex items-center justify-between px-3 py-1 border-t border-border text-[10px] text-muted-foreground"><span> items</span><span class="truncate max-w-[200px]">');
16
+ function De(e) {
17
+ return n(X, {
17
18
  get files() {
18
19
  return e.files;
19
20
  },
@@ -48,7 +49,7 @@ function Se(e) {
48
49
  return e.onOpen;
49
50
  },
50
51
  get children() {
51
- return n(de, {
52
+ return n(ue, {
52
53
  get class() {
53
54
  return e.class;
54
55
  },
@@ -86,10 +87,10 @@ function Se(e) {
86
87
  }
87
88
  });
88
89
  }
89
- function de(e) {
90
- const r = X(), O = q(), d = J(), a = () => O.isMobile(), C = () => r.sidebarWidth(), E = () => e.sidebarResizable ?? !0, s = () => (e.enableDragDrop ?? !0) && !!d, u = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
90
+ function ue(e) {
91
+ const r = Y(), O = q(), d = J(), a = () => O.isMobile(), C = () => r.sidebarWidth(), E = () => e.sidebarResizable ?? !0, s = () => (e.enableDragDrop ?? !0) && !!d, u = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
91
92
  let M, I = null, S = null;
92
- H(() => {
93
+ G(() => {
93
94
  if (!d || !s()) return;
94
95
  const i = {
95
96
  instanceId: u(),
@@ -102,11 +103,11 @@ function de(e) {
102
103
  optimisticInsert: r.optimisticInsert
103
104
  };
104
105
  d.registerInstance(i);
105
- }), Q(() => {
106
+ }), H(() => {
106
107
  d && s() && d.unregisterInstance(u());
107
108
  });
108
109
  let y = !1, f = !1;
109
- p(() => {
110
+ Q(() => {
110
111
  const i = a();
111
112
  if (!y) {
112
113
  y = !0, f = i, i && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar();
@@ -115,18 +116,18 @@ function de(e) {
115
116
  !f && i && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), f = i;
116
117
  });
117
118
  const j = (i) => {
118
- (i.metaKey || i.ctrlKey) && i.key.toLowerCase() === "f" && (i.preventDefault(), r.setFilterActive(!0), setTimeout(() => M?.focus(), 50));
119
+ (i.metaKey || i.ctrlKey) && i.key.toLowerCase() === "f" && (i.preventDefault(), r.setFilterActive(!0), U(() => M?.focus()));
119
120
  }, D = () => !r.sidebarCollapsed() || !a();
120
121
  return (() => {
121
- var i = se(), h = i.firstChild, c = h.firstChild, k = c.firstChild, v = k.firstChild;
122
+ var i = de(), h = i.firstChild, c = h.firstChild, k = c.firstChild, v = k.firstChild;
122
123
  v.firstChild;
123
- var $ = v.nextSibling, x = c.nextSibling, b = x.firstChild, V = b.nextSibling, g = V.firstChild, N = g.firstChild, T = g.nextSibling;
124
+ var $ = v.nextSibling, x = c.nextSibling, b = x.firstChild, V = b.nextSibling, g = V.firstChild, A = g.firstChild, N = g.nextSibling;
124
125
  return i.$$keydown = j, l(i, n(o, {
125
126
  get when() {
126
127
  return e.header;
127
128
  },
128
129
  get children() {
129
- var t = le();
130
+ var t = oe();
130
131
  return l(t, () => e.header), t;
131
132
  }
132
133
  }), h), l(v, n(o, {
@@ -134,12 +135,12 @@ function de(e) {
134
135
  return a();
135
136
  },
136
137
  get children() {
137
- var t = oe();
138
- return L(t, "click", r.toggleSidebar, !0), t;
138
+ var t = ae();
139
+ return P(t, "click", r.toggleSidebar, !0), t;
139
140
  }
140
- }), null), P((t) => {
141
+ }), null), L((t) => {
141
142
  S = t;
142
- }, $), l($, n(Z, {
143
+ }, $), l($, n(ee, {
143
144
  get instanceId() {
144
145
  return u();
145
146
  },
@@ -151,7 +152,7 @@ function de(e) {
151
152
  return w(() => !!(E() && D()))() && !a();
152
153
  },
153
154
  get children() {
154
- return n(Y, {
155
+ return n(Z, {
155
156
  direction: "horizontal",
156
157
  onResize: (t) => {
157
158
  r.setSidebarWidth(r.sidebarWidth() + t);
@@ -163,19 +164,19 @@ function de(e) {
163
164
  return w(() => !!a())() && !r.sidebarCollapsed();
164
165
  },
165
166
  get children() {
166
- var t = ae();
167
- return L(t, "click", r.toggleSidebar, !0), t;
167
+ var t = se();
168
+ return P(t, "click", r.toggleSidebar, !0), t;
168
169
  }
169
- }), x), l(x, n(re, {
170
+ }), x), l(x, n(ie, {
170
171
  filterInputRef: (t) => M = t
171
- }), b), P((t) => {
172
+ }), b), L((t) => {
172
173
  I = t;
173
174
  }, b), l(b, n(o, {
174
175
  get when() {
175
176
  return r.viewMode() === "list";
176
177
  },
177
178
  get fallback() {
178
- return n(te, {
179
+ return n(re, {
179
180
  get instanceId() {
180
181
  return u();
181
182
  },
@@ -185,7 +186,7 @@ function de(e) {
185
186
  });
186
187
  },
187
188
  get children() {
188
- return n(ee, {
189
+ return n(te, {
189
190
  get instanceId() {
190
191
  return u();
191
192
  },
@@ -194,7 +195,7 @@ function de(e) {
194
195
  }
195
196
  });
196
197
  }
197
- })), l(g, () => r.currentFiles().length, N), l(g, n(o, {
198
+ })), l(g, () => r.currentFiles().length, A), l(g, n(o, {
198
199
  get when() {
199
200
  return r.filterQueryApplied().trim();
200
201
  },
@@ -208,7 +209,7 @@ function de(e) {
208
209
  get children() {
209
210
  return [" · ", w(() => r.selectedItems().size), " selected"];
210
211
  }
211
- }), null), l(T, () => r.currentPath()), l(i, n(ie, {
212
+ }), null), l(N, () => r.currentPath()), l(i, n(ne, {
212
213
  get callbacks() {
213
214
  return e.contextMenuCallbacks;
214
215
  },
@@ -226,9 +227,9 @@ function de(e) {
226
227
  return s();
227
228
  },
228
229
  get children() {
229
- return n(ne, {});
230
+ return n(le, {});
230
231
  }
231
- }), null), A((t) => {
232
+ }), null), T((t) => {
232
233
  var _ = K("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class), R = K(
233
234
  "flex-shrink-0 border-r border-border bg-sidebar relative",
234
235
  "transition-all duration-200 ease-out",
@@ -245,7 +246,7 @@ function de(e) {
245
246
  }), i;
246
247
  })();
247
248
  }
248
- G(["keydown", "click"]);
249
+ p(["keydown", "click"]);
249
250
  export {
250
- Se as FileBrowser
251
+ De as FileBrowser
251
252
  };
@@ -1,34 +1,35 @@
1
- import { addEventListener as M, insert as o, createComponent as l, use as S, effect as s, className as d, template as u, setAttribute as g, delegateEvents as Q } from "solid-js/web";
2
- import { onMount as R, Show as A } from "solid-js";
1
+ import { addEventListener as A, insert as o, createComponent as l, use as S, effect as s, className as d, template as u, setAttribute as g, delegateEvents as Q } from "solid-js/web";
2
+ import { onMount as R, Show as M } from "solid-js";
3
3
  import { cn as f } from "../../utils/cn.js";
4
- import { useFileBrowser as T } from "./FileBrowserContext.js";
5
- import { Breadcrumb as E } from "./Breadcrumb.js";
6
- import { Grid as L } from "../icons/index.js";
7
- var V = /* @__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>'), 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><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">'), 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><rect width=18 height=18 x=3 y=3 rx=2 ry=2></rect><line x1=9 y1=3 x2=9 y2=21>'), 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><circle cx=11 cy=11 r=8></circle><path d="m21 21-4.3-4.3">'), 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><path d="M18 6 6 18"></path><path d="m6 6 12 12">'), H = /* @__PURE__ */ u('<button type=button aria-label="Clear filter">'), K = /* @__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">'), P = /* @__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 = V();
10
- return s(() => g(e, "class", r.class)), e;
11
- })(), z = (r) => (() => {
4
+ import { deferAfterPaint as E } from "../../utils/defer.js";
5
+ import { useFileBrowser as L } from "./FileBrowserContext.js";
6
+ import { Breadcrumb as T } from "./Breadcrumb.js";
7
+ import { Grid as V } from "../icons/index.js";
8
+ 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>'), P = /* @__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">'), 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><path d="M18 6 6 18"></path><path d="m6 6 12 12">'), H = /* @__PURE__ */ u('<button type=button aria-label="Clear filter">'), K = /* @__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">'), X = /* @__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">'), Z = /* @__PURE__ */ u('<button type=button aria-label="Filter files">'), q = /* @__PURE__ */ u("<button type=button>");
9
+ const z = (r) => (() => {
12
10
  var e = N();
13
11
  return s(() => g(e, "class", r.class)), e;
14
12
  })(), J = (r) => (() => {
15
13
  var e = U();
16
14
  return s(() => g(e, "class", r.class)), e;
17
- })(), j = (r) => (() => {
15
+ })(), O = (r) => (() => {
18
16
  var e = G();
19
17
  return s(() => g(e, "class", r.class)), e;
20
- })(), O = (r) => (() => {
18
+ })(), j = (r) => (() => {
19
+ var e = P();
20
+ return s(() => g(e, "class", r.class)), e;
21
+ })(), W = (r) => (() => {
21
22
  var e = D();
22
23
  return s(() => g(e, "class", r.class)), e;
23
24
  })();
24
- function ie(r) {
25
- const e = T();
25
+ function le(r) {
26
+ const e = L();
26
27
  let n;
27
28
  const c = () => {
28
29
  const v = e.currentPath();
29
30
  return v !== "/" && v !== "";
30
31
  }, m = () => {
31
- e.isFilterActive() ? (e.setFilterQuery(""), e.setFilterActive(!1)) : (e.setFilterActive(!0), setTimeout(() => n?.focus(), 50));
32
+ e.isFilterActive() ? (e.setFilterQuery(""), e.setFilterActive(!1)) : (e.setFilterActive(!0), E(() => n?.focus()));
32
33
  }, w = () => {
33
34
  e.setFilterQuery(""), n?.focus();
34
35
  }, h = (v) => {
@@ -39,18 +40,18 @@ function ie(r) {
39
40
  return R(() => {
40
41
  r.filterInputRef && n && r.filterInputRef(n);
41
42
  }), (() => {
42
- var v = P(), x = v.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, {
43
+ var v = X(), x = v.firstChild, b = x.nextSibling, p = b.nextSibling, y = p.nextSibling, k = y.nextSibling;
44
+ return A(x, "click", e.toggleSidebar, !0), o(x, l(O, {
44
45
  class: "w-4 h-4"
45
- })), M(b, "click", e.navigateUp, !0), o(b, l(z, {
46
+ })), A(b, "click", e.navigateUp, !0), o(b, l(J, {
46
47
  class: "w-4 h-4"
47
- })), o(p, l(E, {})), o(y, l(A, {
48
+ })), o(p, l(T, {})), o(y, l(M, {
48
49
  get when() {
49
50
  return e.isFilterActive();
50
51
  },
51
52
  get fallback() {
52
53
  return (() => {
53
- var t = X();
54
+ var t = Z();
54
55
  return t.$$click = m, o(t, l(j, {
55
56
  class: "w-4 h-4"
56
57
  })), s(() => d(t, f("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;
@@ -62,13 +63,13 @@ function ie(r) {
62
63
  class: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0"
63
64
  }), a), a.addEventListener("blur", I), a.$$keydown = h, a.$$input = (i) => e.setFilterQuery(i.currentTarget.value), S((i) => {
64
65
  n = i, r.filterInputRef && r.filterInputRef(i);
65
- }, a), o(t, l(A, {
66
+ }, a), o(t, l(M, {
66
67
  get when() {
67
68
  return e.filterQuery();
68
69
  },
69
70
  get children() {
70
71
  var i = H();
71
- return i.$$click = w, o(i, l(O, {
72
+ return i.$$click = w, o(i, l(W, {
72
73
  class: "w-3 h-3"
73
74
  })), s(() => d(i, f("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
  }
@@ -80,7 +81,7 @@ function ie(r) {
80
81
  return e.viewMode();
81
82
  },
82
83
  onClick: () => e.setViewMode("list"),
83
- icon: q,
84
+ icon: z,
84
85
  label: "List view"
85
86
  }), null), o(k, l(B, {
86
87
  mode: "grid",
@@ -88,7 +89,7 @@ function ie(r) {
88
89
  return e.viewMode();
89
90
  },
90
91
  onClick: () => e.setViewMode("grid"),
91
- icon: L,
92
+ icon: V,
92
93
  label: "Grid view"
93
94
  }), null), s((t) => {
94
95
  var a = f("flex items-center gap-2 px-2 py-1.5 border-b border-border", "bg-background/50 backdrop-blur-sm", r.class), i = f("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 = f("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"), _ = f("flex-1 min-w-0 overflow-hidden transition-all duration-200", e.isFilterActive() && "hidden sm:block sm:flex-1"), C = f("flex items-center gap-1 transition-all duration-200 ease-out", e.isFilterActive() ? "flex-1 sm:flex-none sm:w-48" : "w-7");
@@ -106,7 +107,7 @@ function ie(r) {
106
107
  function B(r) {
107
108
  const e = () => r.currentMode === r.mode;
108
109
  return (() => {
109
- var n = Z();
110
+ var n = q();
110
111
  return n.$$click = () => r.onClick(), o(n, l(r.icon, {
111
112
  class: "w-3.5 h-3.5"
112
113
  })), s((c) => {
@@ -121,5 +122,5 @@ function B(r) {
121
122
  }
122
123
  Q(["click", "input", "keydown"]);
123
124
  export {
124
- ie as FileBrowserToolbar
125
+ le as FileBrowserToolbar
125
126
  };