@floegence/floe-webapp-core 0.50.2 → 0.50.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.
package/dist/chat.css CHANGED
@@ -1506,12 +1506,6 @@ pre.chat-md-code-block code {
1506
1506
  overflow: hidden;
1507
1507
  }
1508
1508
 
1509
- .chat-input-container-focused {
1510
- border-color: var(--primary);
1511
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent),
1512
- 0 1px 3px rgb(0 0 0 / 0.06);
1513
- }
1514
-
1515
1509
  .chat-input-container-dragging {
1516
1510
  box-shadow: inset 0 0 0 2px var(--primary);
1517
1511
  }
@@ -1,60 +1,60 @@
1
- import { addEventListener as h, insert as s, createComponent as r, effect as D, className as E, setAttribute as K, template as c, use as R, delegateEvents as U } from "solid-js/web";
2
- import { createSignal as F, onCleanup as N, Show as v } from "solid-js";
1
+ import { addEventListener as u, insert as s, createComponent as l, effect as D, setAttribute as E, className as F, template as c, use as z, delegateEvents as K } from "solid-js/web";
2
+ import { createSignal as R, onCleanup as U, Show as f } from "solid-js";
3
3
  import { cn as I } from "../../../utils/cn.js";
4
- import { useChatContext as O } from "../ChatProvider.js";
5
- import { useAttachments as G } from "../hooks/useAttachments.js";
6
- import { AttachmentPreview as J } from "./AttachmentPreview.js";
7
- var Q = /* @__PURE__ */ c("<div class=chat-input-drop-overlay><span>Drop files here"), V = /* @__PURE__ */ c('<button type=button class=chat-input-attachment-btn title="Add attachments">'), W = /* @__PURE__ */ c('<div><div class=chat-input-body><textarea class=chat-input-textarea rows=2></textarea></div><div class=chat-input-toolbar><div class=chat-input-toolbar-left></div><div class=chat-input-toolbar-right><span class=chat-input-hint><kbd>Enter</kbd> send &nbsp; <kbd>Shift+Enter</kbd> newline</span><button type=button title="Send message">'), X = /* @__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">'), Y = /* @__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">'), Z = /* @__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 ct = (u) => {
9
- const i = O(), [g, y] = F(""), [L, b] = F(!1);
10
- let d, l = null;
11
- const n = G({
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
- }), P = () => u.placeholder || i.config().placeholder || "Type a message...", f = () => (g().trim() || n.attachments().length > 0) && !u.disabled, w = () => {
17
- const t = d;
4
+ import { useChatContext as N } from "../ChatProvider.js";
5
+ import { useAttachments as O } from "../hooks/useAttachments.js";
6
+ import { AttachmentPreview as G } from "./AttachmentPreview.js";
7
+ var J = /* @__PURE__ */ c("<div class=chat-input-drop-overlay><span>Drop files here"), Q = /* @__PURE__ */ c('<button type=button class=chat-input-attachment-btn title="Add attachments">'), V = /* @__PURE__ */ c('<div data-floe-input-surface><div class=chat-input-body><textarea class=chat-input-textarea rows=2></textarea></div><div class=chat-input-toolbar><div class=chat-input-toolbar-left></div><div class=chat-input-toolbar-right><span class=chat-input-hint><kbd>Enter</kbd> send &nbsp; <kbd>Shift+Enter</kbd> newline</span><button type=button title="Send message">'), W = /* @__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">'), X = /* @__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">'), Y = /* @__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 st = (d) => {
9
+ const a = N(), [p, y] = R("");
10
+ let h, r = null;
11
+ const n = O({
12
+ maxAttachments: a.config().maxAttachments,
13
+ maxSize: a.config().maxAttachmentSize,
14
+ acceptedTypes: a.config().acceptedFileTypes,
15
+ onUpload: a.config().allowAttachments ? (t) => a.uploadAttachment(t) : void 0
16
+ }), P = () => d.placeholder || a.config().placeholder || "Type a message...", v = () => (p().trim() || n.attachments().length > 0) && !d.disabled, b = () => {
17
+ const t = h;
18
18
  t && (t.style.height = "auto", t.style.height = `${Math.min(t.scrollHeight, 320)}px`);
19
19
  }, T = () => {
20
- if (l === null) {
20
+ if (r === null) {
21
21
  if (typeof requestAnimationFrame > "u") {
22
- w();
22
+ b();
23
23
  return;
24
24
  }
25
- l = requestAnimationFrame(() => {
26
- l = null, w();
25
+ r = requestAnimationFrame(() => {
26
+ r = null, b();
27
27
  });
28
28
  }
29
29
  }, H = (t) => {
30
30
  y(t.currentTarget.value), T();
31
31
  }, B = (t) => {
32
- t.isComposing || t.key === "Enter" && !t.shiftKey && (t.preventDefault(), x());
33
- }, x = async () => {
34
- if (!f()) return;
35
- const t = g().trim(), o = n.attachments();
36
- y(""), n.clearAttachments(), d && (d.style.height = "auto"), await i.sendMessage(t, o);
37
- }, M = async (t) => {
38
- i.config().allowAttachments && await n.handlePaste(t);
32
+ t.isComposing || t.key === "Enter" && !t.shiftKey && (t.preventDefault(), w());
33
+ }, w = async () => {
34
+ if (!v()) return;
35
+ const t = p().trim(), o = n.attachments();
36
+ y(""), n.clearAttachments(), h && (h.style.height = "auto"), await a.sendMessage(t, o);
37
+ }, L = async (t) => {
38
+ a.config().allowAttachments && await n.handlePaste(t);
39
39
  };
40
- return N(() => {
41
- l !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(l), l = null);
40
+ return U(() => {
41
+ r !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(r), r = null);
42
42
  }), (() => {
43
- var t = W(), o = t.firstChild, a = o.firstChild, j = o.nextSibling, $ = j.firstChild, q = $.nextSibling, z = q.firstChild, m = z.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, {
43
+ var t = V(), o = t.firstChild, i = o.firstChild, M = o.nextSibling, x = M.firstChild, j = x.nextSibling, q = j.firstChild, m = q.nextSibling;
44
+ u(t, "drop", n.handleDrop), u(t, "dragover", n.handleDragOver), u(t, "dragleave", n.handleDragLeave), u(t, "dragenter", n.handleDragEnter), s(t, l(f, {
45
45
  get when() {
46
46
  return n.isDragging();
47
47
  },
48
48
  get children() {
49
- var e = Q(), p = e.firstChild;
50
- return s(e, r(nt, {}), p), e;
49
+ var e = J(), g = e.firstChild;
50
+ return s(e, l(et, {}), g), e;
51
51
  }
52
- }), o), s(t, r(v, {
52
+ }), o), s(t, l(f, {
53
53
  get when() {
54
54
  return n.attachments().length > 0;
55
55
  },
56
56
  get children() {
57
- return r(J, {
57
+ return l(G, {
58
58
  get attachments() {
59
59
  return n.attachments();
60
60
  },
@@ -63,29 +63,30 @@ const ct = (u) => {
63
63
  }
64
64
  });
65
65
  }
66
- }), o), a.addEventListener("blur", () => b(!1)), a.addEventListener("focus", () => b(!0)), a.addEventListener("paste", M), a.$$keydown = B, a.$$input = H;
67
- var A = d;
68
- return typeof A == "function" ? R(A, a) : d = a, s($, r(v, {
66
+ }), o), i.addEventListener("paste", L), i.$$keydown = B, i.$$input = H;
67
+ var $ = h;
68
+ return typeof $ == "function" ? z($, i) : h = i, s(x, l(f, {
69
69
  get when() {
70
- return i.config().allowAttachments;
70
+ return a.config().allowAttachments;
71
71
  },
72
72
  get children() {
73
- var e = V();
74
- return h(e, "click", n.openFilePicker, !0), s(e, r(tt, {})), e;
73
+ var e = Q();
74
+ return u(e, "click", n.openFilePicker, !0), s(e, l(Z, {})), e;
75
75
  }
76
- })), m.$$click = x, s(m, r(et, {})), D((e) => {
77
- var p = I("chat-input-container", L() && "chat-input-container-focused", n.isDragging() && "chat-input-container-dragging", u.class), k = P(), C = u.disabled, _ = I("chat-input-send-btn", f() && "chat-input-send-btn-active"), S = !f();
78
- return p !== e.e && E(t, e.e = p), k !== e.t && K(a, "placeholder", e.t = k), C !== e.a && (a.disabled = e.a = C), _ !== e.o && E(m, e.o = _), S !== e.i && (m.disabled = e.i = S), e;
76
+ })), m.$$click = w, s(m, l(tt, {})), D((e) => {
77
+ var g = d.disabled ? !0 : void 0, A = I("chat-input-container", n.isDragging() && "chat-input-container-dragging", d.class), k = P(), C = d.disabled, S = I("chat-input-send-btn", v() && "chat-input-send-btn-active"), _ = !v();
78
+ return g !== e.e && E(t, "aria-disabled", e.e = g), A !== e.t && F(t, e.t = A), k !== e.a && E(i, "placeholder", e.a = k), C !== e.o && (i.disabled = e.o = C), S !== e.i && F(m, e.i = S), _ !== e.n && (m.disabled = e.n = _), e;
79
79
  }, {
80
80
  e: void 0,
81
81
  t: void 0,
82
82
  a: void 0,
83
83
  o: void 0,
84
- i: void 0
85
- }), D(() => a.value = g()), t;
84
+ i: void 0,
85
+ n: void 0
86
+ }), D(() => i.value = p()), t;
86
87
  })();
87
- }, tt = () => X(), et = () => Y(), nt = () => Z();
88
- U(["input", "keydown", "click"]);
88
+ }, Z = () => W(), tt = () => X(), et = () => Y();
89
+ K(["input", "keydown", "click"]);
89
90
  export {
90
- ct as ChatInput
91
+ st as ChatInput
91
92
  };
@@ -5,7 +5,7 @@ import { deferAfterPaint as E } from "../../utils/defer.js";
5
5
  import { useFileBrowser as L } from "./FileBrowserContext.js";
6
6
  import { Breadcrumb as T } from "./Breadcrumb.js";
7
7
  import { Grid as V } from "../icons/index.js";
8
- var N = /* @__PURE__ */ a('<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__ */ a('<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__ */ a('<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__ */ a('<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__ */ a('<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__ */ a('<button type=button aria-label="Clear filter">'), K = /* @__PURE__ */ a('<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__ */ a('<div class="ml-0.5 flex shrink-0 items-center gap-1">'), Z = /* @__PURE__ */ a('<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">'), q = /* @__PURE__ */ a('<button type=button aria-label="Filter files">'), z = /* @__PURE__ */ a("<button type=button>");
8
+ var N = /* @__PURE__ */ a('<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__ */ a('<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__ */ a('<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__ */ a('<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__ */ a('<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__ */ a('<button type=button aria-label="Clear filter">'), K = /* @__PURE__ */ a('<div data-floe-input-surface class="flex items-center flex-1 gap-1 px-2 py-1 bg-muted/50 rounded-md border border-border/50"><input type=text placeholder=Filter... aria-label="Filter files by name">'), X = /* @__PURE__ */ a('<div class="ml-0.5 flex shrink-0 items-center gap-1">'), Z = /* @__PURE__ */ a('<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">'), q = /* @__PURE__ */ a('<button type=button aria-label="Filter files">'), z = /* @__PURE__ */ a("<button type=button>");
9
9
  const J = (r) => (() => {
10
10
  var e = N();
11
11
  return s(() => g(e, "class", r.class)), e;
@@ -73,7 +73,7 @@ function se(r) {
73
73
  class: "w-3 h-3"
74
74
  })), s(() => f(o, v("flex items-center justify-center w-4 h-4 rounded-sm cursor-pointer", "text-muted-foreground hover:text-foreground", "transition-colors duration-100"))), o;
75
75
  }
76
- }), null), s(() => f(u, 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(() => u.value = e.filterQuery()), t;
76
+ }), null), s(() => f(u, v("flex-1 min-w-0 bg-transparent text-xs", "outline-none border-0 ring-0 shadow-none appearance-none", "focus:outline-none focus:ring-0", "placeholder:text-muted-foreground/60"))), s(() => u.value = e.filterQuery()), t;
77
77
  }
78
78
  })), n($, l(B, {
79
79
  mode: "list",
@@ -7,7 +7,7 @@ import { useResolvedFloeConfig as W } from "../../context/FloeConfigContext.js";
7
7
  import { useOverlayMask as q } from "../../hooks/useOverlayMask.js";
8
8
  import { matchKeybind as G } from "../../utils/keybind.js";
9
9
  import { createFloatingPresence as J } from "./floatingPresence.js";
10
- var Q = /* @__PURE__ */ m("<div>"), V = /* @__PURE__ */ m('<div><div class="flex items-center gap-3 px-4 pt-1 border-b border-border"><input type=text><kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono"></kbd></div><div class="max-h-80 overflow-y-auto overscroll-contain py-2">'), X = /* @__PURE__ */ m('<div class="px-4 py-8 text-center text-sm text-muted-foreground">'), Y = /* @__PURE__ */ m('<div><div class="px-4 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wider">'), Z = /* @__PURE__ */ m('<span class="w-5 h-5 flex items-center justify-center text-muted-foreground">'), ee = /* @__PURE__ */ m('<span class="ml-2 text-muted-foreground text-xs">'), te = /* @__PURE__ */ m('<kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono">'), re = /* @__PURE__ */ m('<button type=button><div class="flex-1 text-left"><span>');
10
+ var Q = /* @__PURE__ */ m("<div>"), V = /* @__PURE__ */ m('<div><div data-floe-input-surface class="flex items-center gap-3 px-4 pt-1 border-b border-border"><input type=text><kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono"></kbd></div><div class="max-h-80 overflow-y-auto overscroll-contain py-2">'), X = /* @__PURE__ */ m('<div class="px-4 py-8 text-center text-sm text-muted-foreground">'), Y = /* @__PURE__ */ m('<div><div class="px-4 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wider">'), Z = /* @__PURE__ */ m('<span class="w-5 h-5 flex items-center justify-center text-muted-foreground">'), ee = /* @__PURE__ */ m('<span class="ml-2 text-muted-foreground text-xs">'), te = /* @__PURE__ */ m('<kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono">'), re = /* @__PURE__ */ m('<button type=button><div class="flex-1 text-left"><span>');
11
11
  function me(b = {}) {
12
12
  const n = N(), k = W();
13
13
  let z, M;
@@ -5,6 +5,13 @@ export interface DialogProps {
5
5
  /** Dialog title - can be a string or JSX element for custom headers */
6
6
  title?: string | JSX.Element;
7
7
  description?: string;
8
+ /** Localized accessible name for the close button. */
9
+ closeLabel?: string;
10
+ /** Whether clicking the backdrop requests dismissal. Defaults to true. */
11
+ closeOnBackdropClick?: boolean;
12
+ /** Bubble lets nested inputs consume Escape before the dialog handles it. */
13
+ escapeKeyPhase?: 'capture' | 'bubble';
14
+ onKeyDown?: JSX.EventHandler<HTMLDivElement, KeyboardEvent>;
8
15
  children: JSX.Element;
9
16
  footer?: JSX.Element;
10
17
  class?: string;
@@ -1,16 +1,16 @@
1
- import { createComponent as r, use as E, setAttribute as f, style as Y, Portal as X, spread as k, mergeProps as P, memo as S, insert as a, effect as N, template as u } from "solid-js/web";
2
- import { createUniqueId as J, createSignal as I, createMemo as H, createEffect as Q, onCleanup as ee, Show as b, untrack as te } from "solid-js";
3
- import { cn as A } from "../../utils/cn.js";
4
- import { Button as B } from "./Button.js";
1
+ import { createComponent as o, use as E, setAttribute as f, style as Y, Portal as X, spread as P, mergeProps as R, memo as B, insert as a, effect as N, template as s } from "solid-js/web";
2
+ import { createUniqueId as J, createSignal as S, createMemo as H, createEffect as Q, onCleanup as ee, Show as b, untrack as te } from "solid-js";
3
+ import { cn as O } from "../../utils/cn.js";
4
+ import { Button as D } from "./Button.js";
5
5
  import { X as ne } from "../icons/index.js";
6
6
  import { useResolvedFloeConfig as re } from "../../context/FloeConfigContext.js";
7
7
  import { useOverlayMask as oe } from "../../hooks/useOverlayMask.js";
8
- import { resolveSurfacePortalHost as ie, DIALOG_SURFACE_BOUNDARY_ATTR as O, isSurfacePortalMode as j, projectSurfacePortalRect as le, resolveSurfacePortalBoundaryRect as ae, resolveSurfacePortalMount as de } from "./dialogSurfaceScope.js";
9
- import { LOCAL_INTERACTION_SURFACE_ATTR as ce } from "./localInteractionSurface.js";
10
- import { createFloatingPresence as ue } from "./floatingPresence.js";
11
- import { useDialogPlacement as se } from "./DialogPlacementContext.js";
12
- var fe = /* @__PURE__ */ u("<span aria-hidden=true>"), ge = /* @__PURE__ */ u('<h2 class="text-sm font-semibold">'), me = /* @__PURE__ */ u('<p class="mt-0.5 text-xs text-muted-foreground">'), he = /* @__PURE__ */ u('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), be = /* @__PURE__ */ u('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), ve = /* @__PURE__ */ u('<div><div></div><div class="pointer-events-none relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), we = /* @__PURE__ */ u("<div>");
13
- const ye = {
8
+ import { resolveSurfacePortalHost as ie, DIALOG_SURFACE_BOUNDARY_ATTR as k, isSurfacePortalMode as j, projectSurfacePortalRect as le, resolveSurfacePortalBoundaryRect as ae, resolveSurfacePortalMount as ce } from "./dialogSurfaceScope.js";
9
+ import { LOCAL_INTERACTION_SURFACE_ATTR as de } from "./localInteractionSurface.js";
10
+ import { createFloatingPresence as se } from "./floatingPresence.js";
11
+ import { useDialogPlacement as ue } from "./DialogPlacementContext.js";
12
+ var fe = /* @__PURE__ */ s("<span aria-hidden=true>"), ge = /* @__PURE__ */ s('<h2 class="text-sm font-semibold">'), me = /* @__PURE__ */ s('<p class="mt-0.5 text-xs text-muted-foreground">'), he = /* @__PURE__ */ s('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), be = /* @__PURE__ */ s('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), we = /* @__PURE__ */ s('<div><div></div><div class="pointer-events-none relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), ye = /* @__PURE__ */ s("<div>");
13
+ const ve = {
14
14
  display: "none"
15
15
  };
16
16
  function xe(e) {
@@ -33,50 +33,51 @@ function $e(e) {
33
33
  }
34
34
  window.clearTimeout(e);
35
35
  }
36
- function _e(e) {
37
- const g = se(), d = J(), F = () => `dialog-${d}-title`, D = () => `dialog-${d}-description`;
38
- let v;
39
- const [w, G] = I(null), [M, z] = I(0), [L, Z] = I(0), s = ue({
40
- open: () => e.open && !!w() && M() > 0,
36
+ function Ce(e) {
37
+ const g = ue(), c = J(), I = () => `dialog-${c}-title`, F = () => `dialog-${c}-description`;
38
+ let w;
39
+ const [y, G] = S(null), [M, K] = S(0), [L, z] = S(0), u = se({
40
+ open: () => e.open && !!y() && M() > 0,
41
41
  exitDurationMs: 120
42
- }), y = () => s.mounted() && !!w() && M() > 0, U = (t) => {
42
+ }), v = () => u.mounted() && !!y() && M() > 0, Z = (t) => {
43
43
  G(t), xe(() => {
44
- te(w) === t && z((i) => i + 1);
44
+ te(y) === t && K((l) => l + 1);
45
45
  });
46
- }, x = H(() => y() ? ie({
47
- owner: w()
46
+ }, x = H(() => v() ? ie({
47
+ owner: y()
48
48
  }) : {
49
49
  host: null,
50
50
  boundaryHost: null,
51
51
  mountHost: null,
52
52
  mode: "global"
53
- }), p = () => `dialog-boundary-${d}`, n = () => g.mode() === "auto" && j(x()), V = () => n() ? de(x()) : void 0, T = () => e.globalZIndex ?? g.globalZIndex(), R = (t) => le(ae(t), t), K = () => R(x()), $ = H(() => (L(), K())), W = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${O}="${p()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${O}="${p()}"]`) : !1;
53
+ }), p = () => `dialog-boundary-${c}`, n = () => g.mode() === "auto" && j(x()), U = () => n() ? ce(x()) : void 0, T = () => e.globalZIndex ?? g.globalZIndex(), A = (t) => le(ae(t), t), V = () => A(x()), $ = H(() => (L(), V())), W = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${k}="${p()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${k}="${p()}"]`) : !1;
54
54
  return Q(() => {
55
55
  const t = x();
56
- if (!y() || !n() || typeof window > "u")
56
+ if (!v() || !n() || typeof window > "u")
57
57
  return;
58
- let i = !1, m = null, o = q(R(t));
59
- const _ = () => {
60
- if (i || !j(t))
58
+ let l = !1, m = null, i = q(A(t));
59
+ const C = () => {
60
+ if (l || !j(t))
61
61
  return;
62
- const l = q(R(t));
63
- l !== o && (o = l, Z((C) => C + 1));
62
+ const r = q(A(t));
63
+ r !== i && (i = r, z((_) => _ + 1));
64
64
  }, h = () => {
65
- i || (m = pe(() => {
66
- _(), h();
65
+ l || (m = pe(() => {
66
+ C(), h();
67
67
  }));
68
68
  };
69
69
  h(), ee(() => {
70
- i = !0, m !== null && $e(m);
70
+ l = !0, m !== null && $e(m);
71
71
  });
72
72
  }), oe({
73
- open: y,
74
- root: () => v,
75
- containsTarget: (t) => n() ? W(t) : typeof Node < "u" && t instanceof Node ? !!v?.contains(t) : !1,
73
+ open: v,
74
+ root: () => w,
75
+ containsTarget: (t) => n() ? W(t) : typeof Node < "u" && t instanceof Node ? !!w?.contains(t) : !1,
76
76
  onClose: () => e.onOpenChange(!1),
77
77
  lockBodyScroll: () => !n(),
78
78
  trapFocus: !0,
79
79
  closeOnEscape: () => n() ? "inside" : !0,
80
+ escapeKeyPhase: () => e.escapeKeyPhase ?? "capture",
80
81
  blockHotkeys: !0,
81
82
  // Block scroll bleed outside the dialog while keeping the dialog content scrollable.
82
83
  blockWheel: () => n() ? "none" : "outside",
@@ -84,36 +85,36 @@ function _e(e) {
84
85
  restoreFocus: !0
85
86
  }), [(() => {
86
87
  var t = fe();
87
- return E(U, t), f(t, "data-floe-dialog-owner-anchor", d), Y(t, ye), t;
88
- })(), r(b, {
88
+ return E(Z, t), f(t, "data-floe-dialog-owner-anchor", c), Y(t, ve), t;
89
+ })(), o(b, {
89
90
  get when() {
90
- return y();
91
+ return v();
91
92
  },
92
93
  get children() {
93
- return r(X, {
94
+ return o(X, {
94
95
  get mount() {
95
- return V();
96
+ return U();
96
97
  },
97
98
  get children() {
98
- var t = ve(), i = t.firstChild, m = i.nextSibling, o = m.firstChild, _ = o.firstChild;
99
- f(t, "data-floe-dialog-overlay-root", d), k(t, P({
99
+ var t = we(), l = t.firstChild, m = l.nextSibling, i = m.firstChild, C = i.firstChild;
100
+ f(t, "data-floe-dialog-overlay-root", c), P(t, R({
100
101
  get "data-floe-dialog-mode"() {
101
102
  return n() ? "surface" : "global";
102
103
  },
103
104
  get "data-floating-presence"() {
104
- return s.state();
105
+ return u.state();
105
106
  },
106
107
  get "aria-hidden"() {
107
- return s.exiting() ? "true" : void 0;
108
+ return u.exiting() ? "true" : void 0;
108
109
  }
109
110
  }, () => ({
110
- [ce]: n() ? "true" : void 0
111
+ [de]: n() ? "true" : void 0
111
112
  }), {
112
113
  get class() {
113
- return A(n() ? "absolute z-20 box-border p-3" : A("fixed inset-0 box-border p-4", T() === void 0 && "z-50"), s.exiting() && "pointer-events-none");
114
+ return O(n() ? "absolute z-20 box-border p-3" : O("fixed inset-0 box-border p-4", T() === void 0 && "z-50"), u.exiting() && "pointer-events-none");
114
115
  },
115
116
  get style() {
116
- return S(() => !!n())() ? {
117
+ return B(() => !!n())() ? {
117
118
  left: `${$().left}px`,
118
119
  top: `${$().top}px`,
119
120
  width: `${$().width}px`,
@@ -122,80 +123,85 @@ function _e(e) {
122
123
  "z-index": T()
123
124
  };
124
125
  }
125
- }), !1, !0), f(i, "data-floe-dialog-backdrop", d), k(i, P(() => ({
126
- [O]: p()
126
+ }), !1, !0), f(l, "data-floe-dialog-backdrop", c), P(l, R(() => ({
127
+ [k]: p()
127
128
  }), {
128
129
  get "data-floating-presence"() {
129
- return s.state();
130
+ return u.state();
130
131
  },
131
132
  get class() {
132
- return A("absolute inset-0 cursor-pointer floe-floating-presence floe-floating-backdrop", n() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
133
+ return O("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", n() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
133
134
  },
134
- onClick: () => e.onOpenChange(!1)
135
+ onClick: () => {
136
+ e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
137
+ }
135
138
  }), !1, !1);
136
- var h = v;
137
- return typeof h == "function" ? E(h, o) : v = o, f(o, "data-floe-dialog-panel", d), k(o, P(() => ({
138
- [O]: p()
139
+ var h = w;
140
+ return typeof h == "function" ? E(h, i) : w = i, f(i, "data-floe-dialog-panel", c), P(i, R(() => ({
141
+ [k]: p()
139
142
  }), {
140
143
  get class() {
141
- return A(n() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
144
+ return O(n() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
142
145
  },
143
146
  get "data-floating-presence"() {
144
- return s.state();
147
+ return u.state();
145
148
  },
146
149
  role: "dialog",
147
150
  get "aria-modal"() {
148
151
  return n() ? void 0 : "true";
149
152
  },
150
153
  get "aria-labelledby"() {
151
- return S(() => !!e.title)() ? F() : void 0;
154
+ return B(() => !!e.title)() ? I() : void 0;
152
155
  },
153
156
  get "aria-describedby"() {
154
- return S(() => !!e.description)() ? D() : void 0;
157
+ return B(() => !!e.description)() ? F() : void 0;
155
158
  },
159
+ onKeyDown: (r) => e.onKeyDown?.(r),
156
160
  tabIndex: -1
157
- }), !1, !0), a(o, r(b, {
161
+ }), !1, !0), a(i, o(b, {
158
162
  get when() {
159
163
  return e.title || e.description;
160
164
  },
161
165
  get children() {
162
- var l = he(), C = l.firstChild;
163
- return a(C, r(b, {
166
+ var r = he(), _ = r.firstChild;
167
+ return a(_, o(b, {
164
168
  get when() {
165
169
  return e.title;
166
170
  },
167
171
  get children() {
168
- var c = ge();
169
- return a(c, () => e.title), N(() => f(c, "id", F())), c;
172
+ var d = ge();
173
+ return a(d, () => e.title), N(() => f(d, "id", I())), d;
170
174
  }
171
- }), null), a(C, r(b, {
175
+ }), null), a(_, o(b, {
172
176
  get when() {
173
177
  return e.description;
174
178
  },
175
179
  get children() {
176
- var c = me();
177
- return a(c, () => e.description), N(() => f(c, "id", D())), c;
180
+ var d = me();
181
+ return a(d, () => e.description), N(() => f(d, "id", F())), d;
178
182
  }
179
- }), null), a(l, r(B, {
183
+ }), null), a(r, o(D, {
180
184
  variant: "ghost-destructive",
181
185
  size: "icon",
182
186
  class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
183
187
  onClick: () => e.onOpenChange(!1),
184
- "aria-label": "Close",
188
+ get "aria-label"() {
189
+ return e.closeLabel ?? "Close";
190
+ },
185
191
  get children() {
186
- return r(ne, {
192
+ return o(ne, {
187
193
  class: "w-3.5 h-3.5"
188
194
  });
189
195
  }
190
- }), null), l;
196
+ }), null), r;
191
197
  }
192
- }), _), a(_, () => e.children), a(o, r(b, {
198
+ }), C), a(C, () => e.children), a(i, o(b, {
193
199
  get when() {
194
200
  return e.footer;
195
201
  },
196
202
  get children() {
197
- var l = be();
198
- return a(l, () => e.footer), l;
203
+ var r = be();
204
+ return a(r, () => e.footer), r;
199
205
  }
200
206
  }), null), t;
201
207
  }
@@ -205,7 +211,7 @@ function _e(e) {
205
211
  }
206
212
  function Te(e) {
207
213
  const g = re();
208
- return r(_e, {
214
+ return o(Ce, {
209
215
  get open() {
210
216
  return e.open;
211
217
  },
@@ -222,7 +228,7 @@ function Te(e) {
222
228
  return e.globalZIndex;
223
229
  },
224
230
  get footer() {
225
- return [r(B, {
231
+ return [o(D, {
226
232
  variant: "ghost",
227
233
  onClick: () => e.onOpenChange(!1),
228
234
  get disabled() {
@@ -231,7 +237,7 @@ function Te(e) {
231
237
  get children() {
232
238
  return e.cancelText ?? g.config.strings.confirmDialog.cancel;
233
239
  }
234
- }), r(B, {
240
+ }), o(D, {
235
241
  get variant() {
236
242
  return e.variant === "destructive" ? "destructive" : "primary";
237
243
  },
@@ -247,11 +253,11 @@ function Te(e) {
247
253
  })];
248
254
  },
249
255
  get children() {
250
- return e.children ?? we();
256
+ return e.children ?? ye();
251
257
  }
252
258
  });
253
259
  }
254
260
  export {
255
261
  Te as ConfirmDialog,
256
- _e as Dialog
262
+ Ce as Dialog
257
263
  };
@@ -1,63 +1,64 @@
1
- import { insert as r, createComponent as l, mergeProps as $, memo as y, effect as C, className as x, setAttribute as f, template as a, delegateEvents as _ } from "solid-js/web";
2
- import { createSignal as E, mergeProps as S, Show as d } from "solid-js";
1
+ import { insert as a, createComponent as i, mergeProps as y, memo as C, effect as _, className as P, setAttribute as d, template as l, delegateEvents as E } from "solid-js/web";
2
+ import { createSignal as S, mergeProps as z, Show as u } from "solid-js";
3
3
  import { cn as b } from "../../utils/cn.js";
4
- import { Folder as z, ChevronRight as A } from "../icons/index.js";
5
- import { formatPickerPath as N } from "./picker/PickerNavigation.js";
6
- import { usePickerNavigation as T, PickerPanel as D } from "./picker/PickerBase.js";
7
- var F = /* @__PURE__ */ a("<div class=mt-2>"), I = /* @__PURE__ */ a('<p role=alert class="mt-1 text-xs text-error">'), R = /* @__PURE__ */ a('<p class="mt-1 text-xs text-muted-foreground">'), V = /* @__PURE__ */ a('<div><button type=button><span class="min-w-0 flex-1 truncate">');
8
- function K(t) {
9
- const [o, P] = E(t.defaultExpanded !== !1), w = S(t, {
4
+ import { Folder as A, ChevronRight as N } from "../icons/index.js";
5
+ import { formatPickerPath as T } from "./picker/PickerNavigation.js";
6
+ import { usePickerNavigation as D, PickerPanel as F } from "./picker/PickerBase.js";
7
+ var I = /* @__PURE__ */ l("<div class=mt-2>"), R = /* @__PURE__ */ l('<p role=alert class="mt-1 text-xs text-error">'), V = /* @__PURE__ */ l('<p class="mt-1 text-xs text-muted-foreground">'), j = /* @__PURE__ */ l('<div><button data-floe-input-surface type=button><span class="min-w-0 flex-1 truncate">');
8
+ function L(t) {
9
+ const [o, w] = S(t.defaultExpanded !== !1), k = z(t, {
10
10
  get initialPath() {
11
11
  return t.value || t.initialPath;
12
12
  }
13
- }), s = T(w, () => t.open ?? !0, (i) => t.onChange?.(i)), k = () => N(t.value ?? "", s.context()?.homePathAbs ?? t.homePath);
13
+ }), c = D(k, () => t.open ?? !0, (n) => t.onChange?.(n)), $ = () => T(t.value ?? "", c.context()?.homePathAbs ?? t.homePath);
14
14
  return (() => {
15
- var i = V(), n = i.firstChild, c = n.firstChild;
16
- return n.$$click = () => P((e) => !e), r(n, l(z, {
15
+ var n = j(), r = n.firstChild, m = r.firstChild;
16
+ return r.$$click = () => w((e) => !e), a(r, i(A, {
17
17
  class: "h-4 w-4 shrink-0 text-muted-foreground"
18
- }), c), r(c, () => k() || t.placeholder || "Select a directory…"), r(n, l(A, {
18
+ }), m), a(m, () => $() || t.placeholder || "Select a directory…"), a(r, i(N, {
19
19
  get class() {
20
20
  return b("h-3.5 w-3.5 shrink-0 transition-transform", o() && "rotate-90");
21
21
  }
22
- }), null), r(i, l(d, {
22
+ }), null), a(n, i(u, {
23
23
  get when() {
24
24
  return o();
25
25
  },
26
26
  get children() {
27
- var e = F();
28
- return r(e, l(D, $(t, {
29
- source: s
27
+ var e = I();
28
+ return a(e, i(F, y(t, {
29
+ source: c
30
30
  }))), e;
31
31
  }
32
- }), null), r(i, l(d, {
32
+ }), null), a(n, i(u, {
33
33
  get when() {
34
34
  return t.error;
35
35
  },
36
36
  get children() {
37
- var e = I();
38
- return r(e, () => t.error), e;
37
+ var e = R();
38
+ return a(e, () => t.error), e;
39
39
  }
40
- }), null), r(i, l(d, {
40
+ }), null), a(n, i(u, {
41
41
  get when() {
42
- return y(() => !!t.helperText)() && !t.error;
42
+ return C(() => !!t.helperText)() && !t.error;
43
43
  },
44
44
  get children() {
45
- var e = R();
46
- return r(e, () => t.helperText), e;
45
+ var e = V();
46
+ return a(e, () => t.helperText), e;
47
47
  }
48
- }), null), C((e) => {
49
- var u = t.class, m = t.disabled, h = o(), v = t.value, g = b("flex w-full cursor-pointer items-center gap-2 rounded border border-input bg-background px-2 text-left shadow-sm focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", t.size === "lg" ? "h-9 text-sm" : t.size === "md" ? "h-8 text-xs" : "h-7 text-xs");
50
- return u !== e.e && x(i, e.e = u), m !== e.t && (n.disabled = e.t = m), h !== e.a && f(n, "aria-expanded", e.a = h), v !== e.o && f(n, "title", e.o = v), g !== e.i && x(n, e.i = g), e;
48
+ }), null), _((e) => {
49
+ var s = t.class, h = t.error ? !0 : void 0, v = t.disabled, x = o(), f = t.value, g = b("flex w-full cursor-pointer items-center gap-2 rounded border border-input bg-background px-2 text-left shadow-sm disabled:cursor-not-allowed disabled:opacity-50", t.size === "lg" ? "h-9 text-sm" : t.size === "md" ? "h-8 text-xs" : "h-7 text-xs");
50
+ return s !== e.e && P(n, e.e = s), h !== e.t && d(r, "aria-invalid", e.t = h), v !== e.a && (r.disabled = e.a = v), x !== e.o && d(r, "aria-expanded", e.o = x), f !== e.i && d(r, "title", e.i = f), g !== e.n && P(r, e.n = g), e;
51
51
  }, {
52
52
  e: void 0,
53
53
  t: void 0,
54
54
  a: void 0,
55
55
  o: void 0,
56
- i: void 0
57
- }), i;
56
+ i: void 0,
57
+ n: void 0
58
+ }), n;
58
59
  })();
59
60
  }
60
- _(["click"]);
61
+ E(["click"]);
61
62
  export {
62
- K as DirectoryInput
63
+ L as DirectoryInput
63
64
  };