@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 +0 -6
- package/dist/components/chat/input/ChatInput.js +50 -49
- package/dist/components/file-browser/FileBrowserToolbar.js +2 -2
- package/dist/components/ui/CommandPalette.js +1 -1
- package/dist/components/ui/Dialog.d.ts +7 -0
- package/dist/components/ui/Dialog.js +82 -76
- package/dist/components/ui/DirectoryInput.js +31 -30
- package/dist/components/ui/Input.js +133 -129
- package/dist/components/ui/Pagination.js +2 -2
- package/dist/floe.css +43 -1
- package/dist/hooks/useOverlayMask.d.ts +2 -0
- package/dist/hooks/useOverlayMask.js +61 -41
- package/dist/styles.css +1 -1
- package/dist/workbench.css +0 -4
- package/package.json +1 -1
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
|
|
2
|
-
import { createSignal as
|
|
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
|
|
5
|
-
import { useAttachments as
|
|
6
|
-
import { AttachmentPreview as
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
let
|
|
11
|
-
const n =
|
|
12
|
-
maxAttachments:
|
|
13
|
-
maxSize:
|
|
14
|
-
acceptedTypes:
|
|
15
|
-
onUpload:
|
|
16
|
-
}), P = () =>
|
|
17
|
-
const t =
|
|
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 <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 (
|
|
20
|
+
if (r === null) {
|
|
21
21
|
if (typeof requestAnimationFrame > "u") {
|
|
22
|
-
|
|
22
|
+
b();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
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(),
|
|
33
|
-
},
|
|
34
|
-
if (!
|
|
35
|
-
const t =
|
|
36
|
-
y(""), n.clearAttachments(),
|
|
37
|
-
},
|
|
38
|
-
|
|
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
|
|
41
|
-
|
|
40
|
+
return U(() => {
|
|
41
|
+
r !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(r), r = null);
|
|
42
42
|
}), (() => {
|
|
43
|
-
var t =
|
|
44
|
-
|
|
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 =
|
|
50
|
-
return s(e,
|
|
49
|
+
var e = J(), g = e.firstChild;
|
|
50
|
+
return s(e, l(et, {}), g), e;
|
|
51
51
|
}
|
|
52
|
-
}), o), s(t,
|
|
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
|
|
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),
|
|
67
|
-
var
|
|
68
|
-
return typeof
|
|
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
|
|
70
|
+
return a.config().allowAttachments;
|
|
71
71
|
},
|
|
72
72
|
get children() {
|
|
73
|
-
var e =
|
|
74
|
-
return
|
|
73
|
+
var e = Q();
|
|
74
|
+
return u(e, "click", n.openFilePicker, !0), s(e, l(Z, {})), e;
|
|
75
75
|
}
|
|
76
|
-
})), m.$$click =
|
|
77
|
-
var
|
|
78
|
-
return
|
|
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
|
-
|
|
84
|
+
i: void 0,
|
|
85
|
+
n: void 0
|
|
86
|
+
}), D(() => i.value = p()), t;
|
|
86
87
|
})();
|
|
87
|
-
},
|
|
88
|
-
|
|
88
|
+
}, Z = () => W(), tt = () => X(), et = () => Y();
|
|
89
|
+
K(["input", "keydown", "click"]);
|
|
89
90
|
export {
|
|
90
|
-
|
|
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
|
|
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:
|
|
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
|
|
2
|
-
import { createUniqueId as J, createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
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
|
|
9
|
-
import { LOCAL_INTERACTION_SURFACE_ATTR as
|
|
10
|
-
import { createFloatingPresence as
|
|
11
|
-
import { useDialogPlacement as
|
|
12
|
-
var fe = /* @__PURE__ */
|
|
13
|
-
const
|
|
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
|
|
37
|
-
const g =
|
|
38
|
-
let
|
|
39
|
-
const [
|
|
40
|
-
open: () => e.open && !!
|
|
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
|
-
}),
|
|
42
|
+
}), v = () => u.mounted() && !!y() && M() > 0, Z = (t) => {
|
|
43
43
|
G(t), xe(() => {
|
|
44
|
-
te(
|
|
44
|
+
te(y) === t && K((l) => l + 1);
|
|
45
45
|
});
|
|
46
|
-
}, x = H(() =>
|
|
47
|
-
owner:
|
|
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-${
|
|
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 (!
|
|
56
|
+
if (!v() || !n() || typeof window > "u")
|
|
57
57
|
return;
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
58
|
+
let l = !1, m = null, i = q(A(t));
|
|
59
|
+
const C = () => {
|
|
60
|
+
if (l || !j(t))
|
|
61
61
|
return;
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const r = q(A(t));
|
|
63
|
+
r !== i && (i = r, z((_) => _ + 1));
|
|
64
64
|
}, h = () => {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
l || (m = pe(() => {
|
|
66
|
+
C(), h();
|
|
67
67
|
}));
|
|
68
68
|
};
|
|
69
69
|
h(), ee(() => {
|
|
70
|
-
|
|
70
|
+
l = !0, m !== null && $e(m);
|
|
71
71
|
});
|
|
72
72
|
}), oe({
|
|
73
|
-
open:
|
|
74
|
-
root: () =>
|
|
75
|
-
containsTarget: (t) => n() ? W(t) : typeof Node < "u" && t instanceof Node ? !!
|
|
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(
|
|
88
|
-
})(),
|
|
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
|
|
91
|
+
return v();
|
|
91
92
|
},
|
|
92
93
|
get children() {
|
|
93
|
-
return
|
|
94
|
+
return o(X, {
|
|
94
95
|
get mount() {
|
|
95
|
-
return
|
|
96
|
+
return U();
|
|
96
97
|
},
|
|
97
98
|
get children() {
|
|
98
|
-
var t =
|
|
99
|
-
f(t, "data-floe-dialog-overlay-root",
|
|
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
|
|
105
|
+
return u.state();
|
|
105
106
|
},
|
|
106
107
|
get "aria-hidden"() {
|
|
107
|
-
return
|
|
108
|
+
return u.exiting() ? "true" : void 0;
|
|
108
109
|
}
|
|
109
110
|
}, () => ({
|
|
110
|
-
[
|
|
111
|
+
[de]: n() ? "true" : void 0
|
|
111
112
|
}), {
|
|
112
113
|
get class() {
|
|
113
|
-
return
|
|
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
|
|
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(
|
|
126
|
-
[
|
|
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
|
|
130
|
+
return u.state();
|
|
130
131
|
},
|
|
131
132
|
get class() {
|
|
132
|
-
return
|
|
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: () =>
|
|
135
|
+
onClick: () => {
|
|
136
|
+
e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
|
|
137
|
+
}
|
|
135
138
|
}), !1, !1);
|
|
136
|
-
var h =
|
|
137
|
-
return typeof h == "function" ? E(h,
|
|
138
|
-
[
|
|
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
|
|
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
|
|
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
|
|
154
|
+
return B(() => !!e.title)() ? I() : void 0;
|
|
152
155
|
},
|
|
153
156
|
get "aria-describedby"() {
|
|
154
|
-
return
|
|
157
|
+
return B(() => !!e.description)() ? F() : void 0;
|
|
155
158
|
},
|
|
159
|
+
onKeyDown: (r) => e.onKeyDown?.(r),
|
|
156
160
|
tabIndex: -1
|
|
157
|
-
}), !1, !0), a(
|
|
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
|
|
163
|
-
return a(
|
|
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
|
|
169
|
-
return a(
|
|
172
|
+
var d = ge();
|
|
173
|
+
return a(d, () => e.title), N(() => f(d, "id", I())), d;
|
|
170
174
|
}
|
|
171
|
-
}), null), a(
|
|
175
|
+
}), null), a(_, o(b, {
|
|
172
176
|
get when() {
|
|
173
177
|
return e.description;
|
|
174
178
|
},
|
|
175
179
|
get children() {
|
|
176
|
-
var
|
|
177
|
-
return a(
|
|
180
|
+
var d = me();
|
|
181
|
+
return a(d, () => e.description), N(() => f(d, "id", F())), d;
|
|
178
182
|
}
|
|
179
|
-
}), null), a(
|
|
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"
|
|
188
|
+
get "aria-label"() {
|
|
189
|
+
return e.closeLabel ?? "Close";
|
|
190
|
+
},
|
|
185
191
|
get children() {
|
|
186
|
-
return
|
|
192
|
+
return o(ne, {
|
|
187
193
|
class: "w-3.5 h-3.5"
|
|
188
194
|
});
|
|
189
195
|
}
|
|
190
|
-
}), null),
|
|
196
|
+
}), null), r;
|
|
191
197
|
}
|
|
192
|
-
}),
|
|
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
|
|
198
|
-
return a(
|
|
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
|
|
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 [
|
|
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
|
-
}),
|
|
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 ??
|
|
256
|
+
return e.children ?? ye();
|
|
251
257
|
}
|
|
252
258
|
});
|
|
253
259
|
}
|
|
254
260
|
export {
|
|
255
261
|
Te as ConfirmDialog,
|
|
256
|
-
|
|
262
|
+
Ce as Dialog
|
|
257
263
|
};
|
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
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
|
|
5
|
-
import { formatPickerPath as
|
|
6
|
-
import { usePickerNavigation as
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
const [o,
|
|
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
|
-
}),
|
|
13
|
+
}), c = D(k, () => t.open ?? !0, (n) => t.onChange?.(n)), $ = () => T(t.value ?? "", c.context()?.homePathAbs ?? t.homePath);
|
|
14
14
|
return (() => {
|
|
15
|
-
var
|
|
16
|
-
return
|
|
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
|
-
}),
|
|
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),
|
|
22
|
+
}), null), a(n, i(u, {
|
|
23
23
|
get when() {
|
|
24
24
|
return o();
|
|
25
25
|
},
|
|
26
26
|
get children() {
|
|
27
|
-
var e =
|
|
28
|
-
return
|
|
29
|
-
source:
|
|
27
|
+
var e = I();
|
|
28
|
+
return a(e, i(F, y(t, {
|
|
29
|
+
source: c
|
|
30
30
|
}))), e;
|
|
31
31
|
}
|
|
32
|
-
}), null),
|
|
32
|
+
}), null), a(n, i(u, {
|
|
33
33
|
get when() {
|
|
34
34
|
return t.error;
|
|
35
35
|
},
|
|
36
36
|
get children() {
|
|
37
|
-
var e =
|
|
38
|
-
return
|
|
37
|
+
var e = R();
|
|
38
|
+
return a(e, () => t.error), e;
|
|
39
39
|
}
|
|
40
|
-
}), null),
|
|
40
|
+
}), null), a(n, i(u, {
|
|
41
41
|
get when() {
|
|
42
|
-
return
|
|
42
|
+
return C(() => !!t.helperText)() && !t.error;
|
|
43
43
|
},
|
|
44
44
|
get children() {
|
|
45
|
-
var e =
|
|
46
|
-
return
|
|
45
|
+
var e = V();
|
|
46
|
+
return a(e, () => t.helperText), e;
|
|
47
47
|
}
|
|
48
|
-
}), null),
|
|
49
|
-
var
|
|
50
|
-
return
|
|
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
|
-
|
|
56
|
+
i: void 0,
|
|
57
|
+
n: void 0
|
|
58
|
+
}), n;
|
|
58
59
|
})();
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
+
E(["click"]);
|
|
61
62
|
export {
|
|
62
|
-
|
|
63
|
+
L as DirectoryInput
|
|
63
64
|
};
|