@floegence/floe-webapp-core 0.86.58 → 0.86.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/blocks/BlockRenderer.js +1 -1
- package/dist/components/chat/blocks/CodeDiffBlock.js +56 -56
- package/dist/components/chat/blocks/ImageBlock.js +1 -1
- package/dist/components/chat/blocks/ToolCallBlock.js +57 -57
- package/dist/components/chat/status/ConnectionStatus.js +10 -10
- package/dist/components/deck/DeckCell.js +25 -25
- package/dist/components/deck/DeckContextMenu.js +20 -20
- package/dist/components/deck/DeckGrid.js +1 -1
- package/dist/components/deck/DeckTopBar.js +42 -42
- package/dist/components/deck/DropZonePreview.js +6 -6
- package/dist/components/deck/LayoutSelector.js +53 -53
- package/dist/components/deck/WidgetFrame.js +28 -28
- package/dist/components/deck/WidgetPalette.js +31 -31
- package/dist/components/deck/WidgetTypeSwitcher.js +31 -31
- package/dist/components/file-browser/Breadcrumb.js +27 -27
- package/dist/components/file-browser/DirectoryTree.js +15 -15
- package/dist/components/file-browser/DragPreview.js +58 -58
- package/dist/components/file-browser/FileBrowser.js +17 -17
- package/dist/components/file-browser/FileBrowserStatusBar.js +18 -18
- package/dist/components/file-browser/FileBrowserToolbar.js +27 -27
- package/dist/components/file-browser/FileContextMenu.js +47 -47
- package/dist/components/file-browser/FileGridView.js +53 -51
- package/dist/components/file-browser/FileItemDecorations.js +30 -27
- package/dist/components/file-browser/FileListView.js +114 -114
- package/dist/components/icons/index.js +1357 -1357
- package/dist/components/launchpad/Launchpad.js +14 -14
- package/dist/components/launchpad/LaunchpadGrid.js +7 -7
- package/dist/components/launchpad/LaunchpadItem.js +11 -11
- package/dist/components/launchpad/LaunchpadPagination.js +16 -16
- package/dist/components/launchpad/LaunchpadSearch.js +9 -9
- package/dist/components/layout/ActivityBar.js +52 -55
- package/dist/components/layout/BottomBar.js +17 -17
- package/dist/components/layout/MobileNavigationPanel.js +36 -36
- package/dist/components/layout/MobileTabBar.js +39 -39
- package/dist/components/layout/Panel.js +16 -16
- package/dist/components/layout/ResizeHandle.js +19 -19
- package/dist/components/layout/Shell.js +50 -50
- package/dist/components/layout/Sidebar.js +37 -36
- package/dist/components/layout/SidebarPane.js +19 -19
- package/dist/components/layout/TopBar.js +16 -16
- package/dist/components/layout/TopBarIconButton.js +15 -15
- package/dist/components/loading/LoadingOverlay.js +9 -9
- package/dist/components/loading/Skeleton.js +11 -11
- package/dist/components/ui/Button.js +36 -36
- package/dist/components/ui/Card.d.ts +11 -62
- package/dist/components/ui/Card.js +64 -237
- package/dist/components/ui/Checkbox.js +79 -79
- package/dist/components/ui/CommandPalette.js +56 -55
- package/dist/components/ui/Dialog.js +91 -93
- package/dist/components/ui/DirectoryInput.js +22 -22
- package/dist/components/ui/DirectoryPicker.js +8 -8
- package/dist/components/ui/Dropdown.js +89 -87
- package/dist/components/ui/FeedbackIndicator.js +57 -57
- package/dist/components/ui/FileOpenPicker.js +37 -37
- package/dist/components/ui/FileSavePicker.js +41 -41
- package/dist/components/ui/FloatingWindow.js +266 -261
- package/dist/components/ui/Form.js +76 -76
- package/dist/components/ui/HighlightBlock.js +14 -14
- package/dist/components/ui/Input.js +106 -109
- package/dist/components/ui/Pagination.js +86 -86
- package/dist/components/ui/Popover.d.ts +33 -0
- package/dist/components/ui/Popover.js +133 -0
- package/dist/components/ui/ProcessingIndicator.js +344 -345
- package/dist/components/ui/Progress.js +94 -97
- package/dist/components/ui/QuoteBlock.js +25 -25
- package/dist/components/ui/Radio.js +91 -91
- package/dist/components/ui/SegmentedControl.js +24 -24
- package/dist/components/ui/Stepper.js +68 -60
- package/dist/components/ui/Switch.js +25 -25
- package/dist/components/ui/Tabs.js +99 -87
- package/dist/components/ui/Tag.js +12 -9
- package/dist/components/ui/Tooltip.js +30 -30
- package/dist/components/ui/floatingPresence.d.ts +7 -0
- package/dist/components/ui/floatingPresence.js +80 -39
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/picker/DirectoryFavorites.js +27 -27
- package/dist/components/ui/picker/PickerBase.js +107 -107
- package/dist/context/NotificationContext.js +4 -4
- package/dist/context/ThemeContext.js +71 -70
- package/dist/floe.css +205 -43
- package/dist/full.js +650 -652
- package/dist/language.css +320 -0
- package/dist/primitives.css +23 -17
- package/dist/standalone.css +1 -0
- package/dist/styles/themes/classicSemanticTokens.d.ts +122 -122
- package/dist/styles/themes/classicSemanticTokens.js +140 -138
- package/dist/styles/themes/index.d.ts +3 -1
- package/dist/styles/themes/index.js +10 -10
- package/dist/styles/themes/presets.d.ts +2 -2
- package/dist/styles/themes/presets.js +34 -34
- package/dist/styles/tokens.d.ts +152 -68
- package/dist/styles/tokens.js +87 -49
- package/dist/styles.css +1 -1
- package/dist/surface.css +161 -116
- package/dist/themes/dark.css +64 -64
- package/dist/themes/light.css +64 -64
- package/dist/ui.css +171 -255
- package/dist/ui.js +176 -178
- package/dist/utils/hotInteraction.d.ts +7 -0
- package/dist/utils/hotInteraction.js +12 -12
- package/dist/widgets/TerminalWidget.js +28 -28
- package/dist/workbench-composition.css +15 -15
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { insert as c, createComponent as
|
|
1
|
+
import { insert as c, createComponent as d, effect as I, setAttribute as b, setStyleProperty as w, spread as D, mergeProps as G, memo as J, className as Y, template as y, use as Z, delegateEvents as ee } from "solid-js/web";
|
|
2
2
|
import { createUniqueId as te, createSignal as p, createMemo as re, createEffect as N, untrack as ne, Show as $, For as oe, onCleanup as ie } from "solid-js";
|
|
3
|
-
import { AlertTriangle as
|
|
3
|
+
import { AlertTriangle as ae, Info as se, X as le } from "../icons/index.js";
|
|
4
4
|
import { useOverlayMask as ce } from "../../hooks/useOverlayMask.js";
|
|
5
|
-
import { useMediaQuery as
|
|
6
|
-
import { cn as
|
|
5
|
+
import { useMediaQuery as ue } from "../../hooks/useMediaQuery.js";
|
|
6
|
+
import { cn as de } from "../../utils/cn.js";
|
|
7
7
|
import { SurfaceFloatingLayer as fe } from "./SurfaceFloatingLayer.js";
|
|
8
|
-
import { calculateMenuPosition as
|
|
9
|
-
import { WORKBENCH_TEXT_SELECTION_SURFACE_ATTR as
|
|
10
|
-
import { resolveSurfacePortalHost as
|
|
11
|
-
var ye = /* @__PURE__ */ y('<div class="flex shrink-0 items-center justify-between gap-2 border-b border-
|
|
8
|
+
import { calculateMenuPosition as ve } from "./menuUtils.js";
|
|
9
|
+
import { WORKBENCH_TEXT_SELECTION_SURFACE_ATTR as me, CANVAS_WHEEL_INTERACTIVE_ATTR as he } from "./localInteractionSurface.js";
|
|
10
|
+
import { resolveSurfacePortalHost as ge, resolveSurfacePortalBoundaryRect as be, resolveSurfacePortalScale as we } from "./dialogSurfaceScope.js";
|
|
11
|
+
var ye = /* @__PURE__ */ y('<div class="flex shrink-0 items-center justify-between gap-2 border-b border-[var(--floe-line)] px-3 py-2"><span class="min-w-0 truncate text-xs font-medium"></span><button type=button class="flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-sm hover:bg-[var(--floe-state-hover)]">'), xe = /* @__PURE__ */ y("<div data-floe-status-details>"), Ee = /* @__PURE__ */ y('<span data-floe-status-indicator><button type=button class="inline-flex h-full w-full cursor-pointer items-center justify-center rounded-sm hover:bg-[var(--floe-state-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"aria-haspopup=dialog></button><span class=sr-only role=alert aria-atomic=true></span><span class=sr-only role=status aria-atomic=true>'), pe = /* @__PURE__ */ y("<div>"), Se = /* @__PURE__ */ y('<div class="flex flex-wrap items-center gap-2">'), Ce = /* @__PURE__ */ y('<section class="space-y-2 border-b border-[var(--floe-line)] pb-3 mb-3 last:border-0 last:pb-0 last:mb-0"><p class=font-medium>');
|
|
12
12
|
function Be(i) {
|
|
13
|
-
const A = te(), H =
|
|
13
|
+
const A = te(), H = ue("(pointer: coarse)"), S = () => H() ? "2.75rem" : i.size === "md" ? "2rem" : "1.75rem", [v, T] = p(!1), [C, q] = p(), [K, U] = p({
|
|
14
14
|
x: 0,
|
|
15
15
|
y: 0
|
|
16
16
|
}), [M, V] = p({
|
|
17
17
|
width: 360,
|
|
18
18
|
height: 384
|
|
19
19
|
}), [W, P] = p(!1);
|
|
20
|
-
let
|
|
21
|
-
const f = () => i.entries.length > 0, _ = re(() => i.entries.some((t) => t.severity === "error") ? "error" : i.entries.some((t) => t.severity === "warning") ? "warning" : "info"), R = (t) => i.entries.filter((r) => r.severity === "error" === t).map((r) => r.summary).join(". "), X = () => (f() ?
|
|
20
|
+
let m, h = !1;
|
|
21
|
+
const f = () => i.entries.length > 0, _ = re(() => i.entries.some((t) => t.severity === "error") ? "error" : i.entries.some((t) => t.severity === "warning") ? "warning" : "info"), R = (t) => i.entries.filter((r) => r.severity === "error" === t).map((r) => r.summary).join(". "), X = () => (f() ? m : i.restoreFocus())?.focus({
|
|
22
22
|
preventScroll: !0
|
|
23
23
|
}), k = (t) => {
|
|
24
24
|
T(!1), h = !1, t && X();
|
|
25
|
-
}, x = (t) => t instanceof Node && !!(
|
|
25
|
+
}, x = (t) => t instanceof Node && !!(m?.contains(t) || C()?.contains(t));
|
|
26
26
|
return ce({
|
|
27
|
-
open:
|
|
27
|
+
open: v,
|
|
28
28
|
root: C,
|
|
29
29
|
containsTarget: x,
|
|
30
30
|
onClose: () => k(!0),
|
|
@@ -37,8 +37,8 @@ function Be(i) {
|
|
|
37
37
|
blockHotkeys: !1
|
|
38
38
|
}), N(() => {
|
|
39
39
|
if (f()) {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
v() && queueMicrotask(() => ne(() => {
|
|
41
|
+
v() && h && document.activeElement === document.body && C()?.focus({
|
|
42
42
|
preventScroll: !0
|
|
43
43
|
});
|
|
44
44
|
}));
|
|
@@ -50,44 +50,44 @@ function Be(i) {
|
|
|
50
50
|
});
|
|
51
51
|
}), N(() => {
|
|
52
52
|
const t = C();
|
|
53
|
-
if (!
|
|
54
|
-
const r =
|
|
55
|
-
let
|
|
53
|
+
if (!v() || !t || !m) return;
|
|
54
|
+
const r = m;
|
|
55
|
+
let g = 0, F = !0;
|
|
56
56
|
const L = () => {
|
|
57
|
-
if (
|
|
57
|
+
if (g = 0, !r.isConnected) {
|
|
58
58
|
k(!1);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
const n =
|
|
61
|
+
const n = ge({
|
|
62
62
|
owner: r
|
|
63
|
-
}),
|
|
63
|
+
}), u = be(n), E = we(n);
|
|
64
64
|
V({
|
|
65
|
-
width: Math.max(0, Math.min(360,
|
|
66
|
-
height: Math.max(0, Math.min(384,
|
|
67
|
-
}), U(
|
|
65
|
+
width: Math.max(0, Math.min(360, u.right - u.left - 16)) / E.x,
|
|
66
|
+
height: Math.max(0, Math.min(384, u.bottom - u.top - 16)) / E.y
|
|
67
|
+
}), U(ve(r.getBoundingClientRect(), t.getBoundingClientRect(), "end", u)), P(!0), F && (F = !1, t.focus({
|
|
68
68
|
preventScroll: !0
|
|
69
69
|
}));
|
|
70
70
|
}, e = () => {
|
|
71
|
-
cancelAnimationFrame(
|
|
72
|
-
},
|
|
73
|
-
|
|
71
|
+
cancelAnimationFrame(g), g = requestAnimationFrame(L);
|
|
72
|
+
}, a = new ResizeObserver(e);
|
|
73
|
+
a.observe(r), a.observe(t);
|
|
74
74
|
const o = new MutationObserver(e);
|
|
75
75
|
for (let n = r.parentElement; n; n = n.parentElement) o.observe(n, {
|
|
76
76
|
attributes: !0,
|
|
77
77
|
attributeFilter: ["style", "class"]
|
|
78
78
|
});
|
|
79
|
-
const
|
|
79
|
+
const s = (n) => {
|
|
80
80
|
h = x(n.target);
|
|
81
81
|
};
|
|
82
|
-
document.addEventListener("focusin",
|
|
82
|
+
document.addEventListener("focusin", s);
|
|
83
83
|
const l = (n) => {
|
|
84
84
|
x(n.target) || k(!1);
|
|
85
85
|
};
|
|
86
86
|
window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), document.addEventListener("pointerdown", l, !0), e(), ie(() => {
|
|
87
|
-
cancelAnimationFrame(
|
|
87
|
+
cancelAnimationFrame(g), document.removeEventListener("focusin", s), a.disconnect(), o.disconnect(), window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0), document.removeEventListener("pointerdown", l, !0);
|
|
88
88
|
});
|
|
89
89
|
}), (() => {
|
|
90
|
-
var t = Ee(), r = t.firstChild,
|
|
90
|
+
var t = Ee(), r = t.firstChild, g = r.nextSibling, F = g.nextSibling;
|
|
91
91
|
r.$$click = () => {
|
|
92
92
|
f() && (P(!1), T((e) => !e));
|
|
93
93
|
}, r.addEventListener("blur", (e) => {
|
|
@@ -95,30 +95,30 @@ function Be(i) {
|
|
|
95
95
|
}), r.addEventListener("focus", () => {
|
|
96
96
|
h = !0;
|
|
97
97
|
});
|
|
98
|
-
var L =
|
|
99
|
-
return typeof L == "function" ? Z(L, r) :
|
|
98
|
+
var L = m;
|
|
99
|
+
return typeof L == "function" ? Z(L, r) : m = r, c(r, d($, {
|
|
100
100
|
get when() {
|
|
101
101
|
return _() !== "info";
|
|
102
102
|
},
|
|
103
103
|
get fallback() {
|
|
104
|
-
return
|
|
104
|
+
return d(se, {
|
|
105
105
|
class: "h-4 w-4",
|
|
106
106
|
"aria-hidden": "true"
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
109
|
get children() {
|
|
110
|
-
return
|
|
110
|
+
return d(ae, {
|
|
111
111
|
class: "h-4 w-4",
|
|
112
112
|
"aria-hidden": "true"
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
})), c(
|
|
115
|
+
})), c(g, () => R(!0)), c(F, () => R(!1)), c(t, d($, {
|
|
116
116
|
get when() {
|
|
117
|
-
return J(() => !!
|
|
117
|
+
return J(() => !!v())() && f();
|
|
118
118
|
},
|
|
119
119
|
get children() {
|
|
120
|
-
return
|
|
121
|
-
owner:
|
|
120
|
+
return d(fe, {
|
|
121
|
+
owner: m,
|
|
122
122
|
get position() {
|
|
123
123
|
return K();
|
|
124
124
|
},
|
|
@@ -130,7 +130,7 @@ function Be(i) {
|
|
|
130
130
|
},
|
|
131
131
|
tabindex: -1,
|
|
132
132
|
"data-floe-surface": "floating",
|
|
133
|
-
class: "flex flex-col overflow-hidden rounded-
|
|
133
|
+
class: "flex flex-col overflow-hidden rounded-group border border-[var(--floe-line)] bg-popover text-popover-foreground shadow-[var(--floe-elevation-float)]",
|
|
134
134
|
get style() {
|
|
135
135
|
return {
|
|
136
136
|
width: `${M().width}px`,
|
|
@@ -140,12 +140,12 @@ function Be(i) {
|
|
|
140
140
|
},
|
|
141
141
|
get children() {
|
|
142
142
|
return [(() => {
|
|
143
|
-
var e = ye(),
|
|
144
|
-
return c(
|
|
143
|
+
var e = ye(), a = e.firstChild, o = a.nextSibling;
|
|
144
|
+
return c(a, () => i.label), o.$$click = () => k(!0), c(o, d(le, {
|
|
145
145
|
class: "h-4 w-4"
|
|
146
|
-
})), I((
|
|
147
|
-
var l = i.closeLabel, n = S(),
|
|
148
|
-
return l !==
|
|
146
|
+
})), I((s) => {
|
|
147
|
+
var l = i.closeLabel, n = S(), u = S();
|
|
148
|
+
return l !== s.e && b(o, "aria-label", s.e = l), n !== s.t && w(o, "width", s.t = n), u !== s.a && w(o, "height", s.a = u), s;
|
|
149
149
|
}, {
|
|
150
150
|
e: void 0,
|
|
151
151
|
t: void 0,
|
|
@@ -155,33 +155,33 @@ function Be(i) {
|
|
|
155
155
|
var e = xe();
|
|
156
156
|
return D(e, G({
|
|
157
157
|
[he]: "true",
|
|
158
|
-
[
|
|
158
|
+
[me]: "true"
|
|
159
159
|
}, {
|
|
160
160
|
class: "min-h-0 overflow-auto overscroll-contain p-3 text-xs",
|
|
161
161
|
style: {
|
|
162
162
|
"overflow-wrap": "anywhere"
|
|
163
163
|
}
|
|
164
|
-
}), !1, !0), c(e,
|
|
164
|
+
}), !1, !0), c(e, d(oe, {
|
|
165
165
|
get each() {
|
|
166
166
|
return i.entries;
|
|
167
167
|
},
|
|
168
|
-
children: (
|
|
169
|
-
var o = Ce(),
|
|
170
|
-
return c(
|
|
168
|
+
children: (a) => (() => {
|
|
169
|
+
var o = Ce(), s = o.firstChild;
|
|
170
|
+
return c(s, () => a.summary), c(o, d($, {
|
|
171
171
|
get when() {
|
|
172
|
-
return
|
|
172
|
+
return a.detail;
|
|
173
173
|
},
|
|
174
174
|
get children() {
|
|
175
175
|
var l = pe();
|
|
176
|
-
return c(l, () =>
|
|
176
|
+
return c(l, () => a.detail), l;
|
|
177
177
|
}
|
|
178
|
-
}), null), c(o,
|
|
178
|
+
}), null), c(o, d($, {
|
|
179
179
|
get when() {
|
|
180
|
-
return
|
|
180
|
+
return a.actions;
|
|
181
181
|
},
|
|
182
182
|
get children() {
|
|
183
183
|
var l = Se();
|
|
184
|
-
return c(l, () =>
|
|
184
|
+
return c(l, () => a.actions), l;
|
|
185
185
|
}
|
|
186
186
|
}), null), o;
|
|
187
187
|
})()
|
|
@@ -191,8 +191,8 @@ function Be(i) {
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
}), null), I((e) => {
|
|
194
|
-
var
|
|
195
|
-
return
|
|
194
|
+
var a = de("inline-flex shrink-0 items-center justify-center align-middle", i.class), o = S(), s = S(), l = f() ? "visible" : "hidden", n = _() === "error" ? "var(--error)" : _() === "warning" ? "var(--warning)" : "var(--muted-foreground)", u = f() ? 0 : -1, E = !f() || void 0, B = `${i.label}${f() ? `: ${i.entries.map((Q) => Q.summary).join("; ")}` : ""}`, O = i.label, j = v(), z = v() ? A : void 0;
|
|
195
|
+
return a !== e.e && Y(t, e.e = a), o !== e.t && w(t, "width", e.t = o), s !== e.a && w(t, "height", e.a = s), l !== e.o && w(r, "visibility", e.o = l), n !== e.i && w(r, "color", e.i = n), u !== e.n && b(r, "tabindex", e.n = u), E !== e.s && b(r, "aria-hidden", e.s = E), B !== e.h && b(r, "aria-label", e.h = B), O !== e.r && b(r, "title", e.r = O), j !== e.d && b(r, "aria-expanded", e.d = j), z !== e.l && b(r, "aria-controls", e.l = z), e;
|
|
196
196
|
}, {
|
|
197
197
|
e: void 0,
|
|
198
198
|
t: void 0,
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { createComponent as a, insert as c, mergeProps as z, spread as K, use as L, effect as j, setAttribute as M, className as V, memo as H, template as
|
|
2
|
-
import { createSignal as U, mergeProps as Y, createMemo as q, Show as
|
|
1
|
+
import { createComponent as a, insert as c, mergeProps as z, spread as K, use as L, effect as j, setAttribute as M, className as V, memo as H, template as v, delegateEvents as R } from "solid-js/web";
|
|
2
|
+
import { createSignal as U, mergeProps as Y, createMemo as q, Show as b, For as G } from "solid-js";
|
|
3
3
|
import { cn as N } from "../../utils/cn.js";
|
|
4
4
|
import { deferNonBlocking as J } from "../../utils/defer.js";
|
|
5
5
|
import { Check as Q } from "../icons/index.js";
|
|
6
6
|
import { FileItemIcon as W } from "../file-browser/FileIcons.js";
|
|
7
7
|
import { Button as D } from "./Button.js";
|
|
8
8
|
import { Dialog as X } from "./Dialog.js";
|
|
9
|
-
import { usePickerNavigation as Z, PickerPanel as ee, normalizePath as k, pickerCopy as
|
|
9
|
+
import { usePickerNavigation as Z, PickerPanel as ee, normalizePath as k, pickerCopy as w } from "./picker/PickerBase.js";
|
|
10
10
|
import { pickerParentPath as te } from "./picker/PickerNavigation.js";
|
|
11
|
-
var ne = /* @__PURE__ */
|
|
11
|
+
var ne = /* @__PURE__ */ v('<div class="flex min-h-[140px] overflow-hidden rounded-xs border border-[var(--floe-line)]"><div>'), ie = /* @__PURE__ */ v('<div class="flex flex-col gap-2 -mt-1">'), le = /* @__PURE__ */ v('<div class="flex items-center w-full gap-2"><span class="flex-1 text-[length:var(--floe-type-caption)] text-[var(--floe-ink-soft)] truncate">'), re = /* @__PURE__ */ v('<div class="flex h-full items-center justify-center px-4 text-center text-[length:var(--floe-type-supporting)] text-[var(--floe-ink-soft)]">'), oe = /* @__PURE__ */ v('<span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-caption text-primary-foreground">'), ae = /* @__PURE__ */ v("<button type=button role=option><span class=truncate>");
|
|
12
12
|
function ce(e, s) {
|
|
13
|
-
const u = y(s),
|
|
14
|
-
for (const
|
|
15
|
-
const i = k(
|
|
16
|
-
if (!(i === "/" ||
|
|
13
|
+
const u = y(s), d = /* @__PURE__ */ new Set(), f = [];
|
|
14
|
+
for (const h of e ?? []) {
|
|
15
|
+
const i = k(h);
|
|
16
|
+
if (!(i === "/" || d.has(i)) && (d.add(i), f.push(i), f.length >= u))
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return f;
|
|
20
20
|
}
|
|
21
|
-
function se(e, s, u,
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
if (u === "single") return [
|
|
25
|
-
const
|
|
26
|
-
return
|
|
21
|
+
function se(e, s, u, d) {
|
|
22
|
+
const f = k(s);
|
|
23
|
+
if (f === "/") return [...e];
|
|
24
|
+
if (u === "single") return [f];
|
|
25
|
+
const h = e.indexOf(f);
|
|
26
|
+
return h >= 0 ? e.filter((i, g) => g !== h) : e.length >= y(d) ? [...e] : [...e, f];
|
|
27
27
|
}
|
|
28
28
|
function y(e) {
|
|
29
29
|
return e == null || !Number.isFinite(e) ? Number.POSITIVE_INFINITY : Math.max(1, Math.floor(e));
|
|
30
30
|
}
|
|
31
31
|
function ke(e) {
|
|
32
|
-
const s = () => e.selectionMode ?? "single", [u,
|
|
32
|
+
const s = () => e.selectionMode ?? "single", [u, d] = U([]), f = () => {
|
|
33
33
|
if (e.initialPath) return e.initialPath;
|
|
34
34
|
const t = e.initialSelectedPaths?.[0];
|
|
35
35
|
return t ? te(t) : void 0;
|
|
36
|
-
},
|
|
36
|
+
}, h = Y(e, {
|
|
37
37
|
get initialPath() {
|
|
38
|
-
return
|
|
38
|
+
return f();
|
|
39
39
|
},
|
|
40
40
|
get scopeKey() {
|
|
41
41
|
return e.scopeKey;
|
|
42
42
|
}
|
|
43
|
-
}), i = Z(
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
|
|
43
|
+
}), i = Z(h, () => e.open, void 0, () => {
|
|
44
|
+
d(ce(e.initialSelectedPaths, s() === "single" ? 1 : e.maxSelections));
|
|
45
|
+
}), g = q(() => i.entries().filter((t) => t.type === "file" && (!e.fileFilter || e.fileFilter(t)))), T = (t) => u().indexOf(k(t)), A = () => s() === "multiple" && u().length >= y(e.maxSelections), B = (t) => {
|
|
46
|
+
d((o) => se(o, t.path, s(), e.maxSelections));
|
|
47
47
|
}, P = (t = u()) => {
|
|
48
48
|
if (e.disabled || t.length === 0 || i.view() !== "browse" || !i.valid()) return;
|
|
49
49
|
const o = e.onSelect;
|
|
50
50
|
e.onOpenChange(!1), J(() => o([...t]));
|
|
51
51
|
}, E = (t, o) => {
|
|
52
52
|
let l;
|
|
53
|
-
t.key === "ArrowDown" && (l = Math.min(o + 1,
|
|
53
|
+
t.key === "ArrowDown" && (l = Math.min(o + 1, g().length - 1)), t.key === "ArrowUp" && (l = Math.max(o - 1, 0)), t.key === "Home" && (l = 0), t.key === "End" && (l = g().length - 1), !(l == null || l < 0) && (t.preventDefault(), $[l]?.focus());
|
|
54
54
|
}, $ = [];
|
|
55
55
|
return a(X, {
|
|
56
56
|
get open() {
|
|
@@ -70,13 +70,13 @@ function ke(e) {
|
|
|
70
70
|
var t = le(), o = t.firstChild;
|
|
71
71
|
return c(o, (() => {
|
|
72
72
|
var l = H(() => u().length === 0);
|
|
73
|
-
return () => l() ?
|
|
73
|
+
return () => l() ? w(e).noFilesSelected : w(e).selectedCount(u().length);
|
|
74
74
|
})()), c(t, a(D, {
|
|
75
75
|
variant: "ghost",
|
|
76
76
|
size: "sm",
|
|
77
77
|
onClick: () => e.onOpenChange(!1),
|
|
78
78
|
get children() {
|
|
79
|
-
return e.cancelText ??
|
|
79
|
+
return e.cancelText ?? w(e).cancel;
|
|
80
80
|
}
|
|
81
81
|
}), null), c(t, a(D, {
|
|
82
82
|
variant: "primary",
|
|
@@ -95,7 +95,7 @@ function ke(e) {
|
|
|
95
95
|
var t = ie();
|
|
96
96
|
return c(t, a(ee, z(e, {
|
|
97
97
|
source: i
|
|
98
|
-
})), null), c(t, a(
|
|
98
|
+
})), null), c(t, a(b, {
|
|
99
99
|
get when() {
|
|
100
100
|
return i.view() === "browse";
|
|
101
101
|
},
|
|
@@ -107,23 +107,23 @@ function ke(e) {
|
|
|
107
107
|
get "aria-multiselectable"() {
|
|
108
108
|
return s() === "multiple" ? "true" : void 0;
|
|
109
109
|
}
|
|
110
|
-
}), !1, !0), c(l, a(
|
|
110
|
+
}), !1, !0), c(l, a(b, {
|
|
111
111
|
get when() {
|
|
112
|
-
return
|
|
112
|
+
return g().length > 0;
|
|
113
113
|
},
|
|
114
114
|
get fallback() {
|
|
115
115
|
return (() => {
|
|
116
116
|
var m = re();
|
|
117
|
-
return c(m, () => e.emptyText ??
|
|
117
|
+
return c(m, () => e.emptyText ?? w(e).emptyFiles), m;
|
|
118
118
|
})();
|
|
119
119
|
},
|
|
120
120
|
get children() {
|
|
121
121
|
return a(G, {
|
|
122
122
|
get each() {
|
|
123
|
-
return
|
|
123
|
+
return g();
|
|
124
124
|
},
|
|
125
125
|
children: (m, S) => {
|
|
126
|
-
const
|
|
126
|
+
const x = () => T(m.path), F = () => A() && x() < 0;
|
|
127
127
|
return (() => {
|
|
128
128
|
var r = ae(), _ = r.firstChild;
|
|
129
129
|
return r.$$keydown = (n) => E(n, S()), r.$$dblclick = () => {
|
|
@@ -134,13 +134,13 @@ function ke(e) {
|
|
|
134
134
|
item: m,
|
|
135
135
|
size: 16,
|
|
136
136
|
class: "w-4 h-4 flex-shrink-0"
|
|
137
|
-
}), _), c(_, () => m.name), c(r, a(
|
|
137
|
+
}), _), c(_, () => m.name), c(r, a(b, {
|
|
138
138
|
get when() {
|
|
139
|
-
return
|
|
139
|
+
return x() >= 0;
|
|
140
140
|
},
|
|
141
141
|
get children() {
|
|
142
142
|
var n = oe();
|
|
143
|
-
return c(n, a(
|
|
143
|
+
return c(n, a(b, {
|
|
144
144
|
get when() {
|
|
145
145
|
return s() === "multiple";
|
|
146
146
|
},
|
|
@@ -150,13 +150,13 @@ function ke(e) {
|
|
|
150
150
|
});
|
|
151
151
|
},
|
|
152
152
|
get children() {
|
|
153
|
-
return
|
|
153
|
+
return x() + 1;
|
|
154
154
|
}
|
|
155
155
|
})), n;
|
|
156
156
|
}
|
|
157
157
|
}), null), j((n) => {
|
|
158
|
-
var C =
|
|
159
|
-
return C !== n.e && M(r, "aria-selected", n.e = C),
|
|
158
|
+
var C = x() >= 0, p = F(), I = F() ? w(e).selectionLimit : m.name, O = N("flex min-h-9 w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left text-xs", "transition-colors duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] hover:bg-[var(--floe-state-hover)]", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", "disabled:cursor-not-allowed disabled:opacity-45", x() >= 0 && "bg-[var(--floe-state-selected)] text-foreground font-medium");
|
|
159
|
+
return C !== n.e && M(r, "aria-selected", n.e = C), p !== n.t && (r.disabled = n.t = p), I !== n.a && M(r, "title", n.a = I), O !== n.o && V(r, n.o = O), n;
|
|
160
160
|
}, {
|
|
161
161
|
e: void 0,
|
|
162
162
|
t: void 0,
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { createComponent as a, insert as n, mergeProps as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { createComponent as a, insert as n, mergeProps as p, spread as z, effect as k, className as B, setAttribute as E, template as f, delegateEvents as D } from "solid-js/web";
|
|
2
|
+
import { createSignal as _, createMemo as F, createEffect as I, on as O, Show as h, For as K } from "solid-js";
|
|
3
|
+
import { cn as b } from "../../utils/cn.js";
|
|
4
4
|
import { Dialog as T } from "./Dialog.js";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as C } from "./Button.js";
|
|
6
6
|
import { Input as M } from "./Input.js";
|
|
7
7
|
import { FileItemIcon as j } from "../file-browser/FileIcons.js";
|
|
8
8
|
import { deferNonBlocking as q } from "../../utils/defer.js";
|
|
9
|
-
import { usePickerNavigation as A, PickerPanel as R, pickerCopy as
|
|
10
|
-
var V = /* @__PURE__ */
|
|
9
|
+
import { usePickerNavigation as A, PickerPanel as R, pickerCopy as d } from "./picker/PickerBase.js";
|
|
10
|
+
var V = /* @__PURE__ */ f('<div class="flex min-h-[100px] overflow-hidden rounded-xs border border-[var(--floe-line)]"><div>'), G = /* @__PURE__ */ f('<div class="flex flex-col gap-2 -mt-1">'), H = /* @__PURE__ */ f('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-[length:var(--floe-type-supporting)] text-[var(--floe-ink-soft)] flex-shrink-0"></label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[length:var(--floe-type-caption)] text-[var(--floe-ink-soft)] truncate">'), J = /* @__PURE__ */ f('<div class="flex items-center justify-center h-full text-[length:var(--floe-type-supporting)] text-[var(--floe-ink-soft)]">'), L = /* @__PURE__ */ f('<span class="ml-auto text-[length:var(--floe-type-caption)] text-[var(--floe-ink-ghost)] flex-shrink-0">'), Q = /* @__PURE__ */ f("<button type=button><span class=truncate>");
|
|
11
11
|
function ie(e) {
|
|
12
|
-
const [s,
|
|
13
|
-
|
|
14
|
-
}),
|
|
12
|
+
const [s, g] = _(e.initialFileName ?? ""), [N, u] = _(""), o = A(e, () => e.open, void 0, () => {
|
|
13
|
+
g(e.initialFileName ?? ""), u("");
|
|
14
|
+
}), x = F(() => o.entries().filter((t) => t.type === "file"));
|
|
15
15
|
I(O(s, () => {
|
|
16
|
-
|
|
16
|
+
u("");
|
|
17
17
|
}));
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const y = (t) => {
|
|
19
|
+
g(t.name), u("");
|
|
20
20
|
}, $ = () => {
|
|
21
21
|
if (e.disabled || o.view() !== "browse" || !o.valid()) return;
|
|
22
22
|
const t = s().trim();
|
|
23
23
|
if (!t) {
|
|
24
|
-
|
|
24
|
+
u(d(e).fileNameRequired);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
if (e.validateFileName) {
|
|
28
28
|
const r = e.validateFileName(t);
|
|
29
29
|
if (r) {
|
|
30
|
-
|
|
30
|
+
u(r);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
const l = o.currentPath(), c = e.onSave;
|
|
35
35
|
e.onOpenChange(!1), q(() => c(l, t));
|
|
36
|
-
},
|
|
36
|
+
}, S = () => {
|
|
37
37
|
e.onOpenChange(!1);
|
|
38
|
-
},
|
|
38
|
+
}, P = (t) => {
|
|
39
39
|
t.key === "Enter" && (t.preventDefault(), $());
|
|
40
|
-
}, w =
|
|
40
|
+
}, w = F(() => {
|
|
41
41
|
const t = o.currentPath(), l = s().trim();
|
|
42
42
|
return l ? t === "/" ? `/${l}` : `${t}/${l}` : t;
|
|
43
43
|
});
|
|
@@ -52,30 +52,30 @@ function ie(e) {
|
|
|
52
52
|
return e.title ?? "Save File";
|
|
53
53
|
},
|
|
54
54
|
get class() {
|
|
55
|
-
return
|
|
55
|
+
return b("max-w-2xl", e.class);
|
|
56
56
|
},
|
|
57
57
|
get footer() {
|
|
58
58
|
return (() => {
|
|
59
|
-
var t = H(), l = t.firstChild, c = l.firstChild, r = c.nextSibling, i = l.nextSibling,
|
|
60
|
-
return n(c, () =>
|
|
59
|
+
var t = H(), l = t.firstChild, c = l.firstChild, r = c.nextSibling, i = l.nextSibling, m = i.firstChild;
|
|
60
|
+
return n(c, () => d(e).fileName), n(r, a(M, {
|
|
61
61
|
size: "sm",
|
|
62
62
|
get value() {
|
|
63
63
|
return s();
|
|
64
64
|
},
|
|
65
|
-
onInput: (
|
|
66
|
-
onKeyDown:
|
|
65
|
+
onInput: (v) => g(v.currentTarget.value),
|
|
66
|
+
onKeyDown: P,
|
|
67
67
|
placeholder: "filename.ext",
|
|
68
68
|
get error() {
|
|
69
|
-
return
|
|
69
|
+
return N();
|
|
70
70
|
}
|
|
71
|
-
})), n(
|
|
71
|
+
})), n(m, w), n(i, a(C, {
|
|
72
72
|
variant: "ghost",
|
|
73
73
|
size: "sm",
|
|
74
|
-
onClick:
|
|
74
|
+
onClick: S,
|
|
75
75
|
get children() {
|
|
76
|
-
return e.cancelText ??
|
|
76
|
+
return e.cancelText ?? d(e).cancel;
|
|
77
77
|
}
|
|
78
|
-
}), null), n(i, a(
|
|
78
|
+
}), null), n(i, a(C, {
|
|
79
79
|
variant: "primary",
|
|
80
80
|
size: "sm",
|
|
81
81
|
onClick: $,
|
|
@@ -85,51 +85,51 @@ function ie(e) {
|
|
|
85
85
|
get children() {
|
|
86
86
|
return e.confirmText ?? "Save";
|
|
87
87
|
}
|
|
88
|
-
}), null),
|
|
88
|
+
}), null), k(() => E(m, "title", w())), t;
|
|
89
89
|
})();
|
|
90
90
|
},
|
|
91
91
|
get children() {
|
|
92
92
|
var t = G();
|
|
93
|
-
return n(t, a(R,
|
|
93
|
+
return n(t, a(R, p(e, {
|
|
94
94
|
source: o
|
|
95
|
-
})), null), n(t, a(
|
|
95
|
+
})), null), n(t, a(h, {
|
|
96
96
|
get when() {
|
|
97
97
|
return o.view() === "browse";
|
|
98
98
|
},
|
|
99
99
|
get children() {
|
|
100
100
|
var l = V(), c = l.firstChild;
|
|
101
|
-
return z(c,
|
|
101
|
+
return z(c, p(() => e.scrollViewportProps, {
|
|
102
102
|
class: "max-h-[160px] w-full min-w-0 overflow-y-auto"
|
|
103
|
-
}), !1, !0), n(c, a(
|
|
103
|
+
}), !1, !0), n(c, a(h, {
|
|
104
104
|
get when() {
|
|
105
|
-
return
|
|
105
|
+
return x().length > 0;
|
|
106
106
|
},
|
|
107
107
|
get fallback() {
|
|
108
108
|
return (() => {
|
|
109
109
|
var r = J();
|
|
110
|
-
return n(r, () =>
|
|
110
|
+
return n(r, () => d(e).emptyFiles), r;
|
|
111
111
|
})();
|
|
112
112
|
},
|
|
113
113
|
get children() {
|
|
114
114
|
return a(K, {
|
|
115
115
|
get each() {
|
|
116
|
-
return
|
|
116
|
+
return x();
|
|
117
117
|
},
|
|
118
118
|
children: (r) => (() => {
|
|
119
|
-
var i = Q(),
|
|
120
|
-
return i.$$click = () =>
|
|
119
|
+
var i = Q(), m = i.firstChild;
|
|
120
|
+
return i.$$click = () => y(r), n(i, a(j, {
|
|
121
121
|
item: r,
|
|
122
122
|
size: 16,
|
|
123
123
|
class: "w-4 h-4 flex-shrink-0"
|
|
124
|
-
}),
|
|
124
|
+
}), m), n(m, () => r.name), n(i, a(h, {
|
|
125
125
|
get when() {
|
|
126
126
|
return r.size != null;
|
|
127
127
|
},
|
|
128
128
|
get children() {
|
|
129
|
-
var
|
|
130
|
-
return n(
|
|
129
|
+
var v = L();
|
|
130
|
+
return n(v, () => U(r.size)), v;
|
|
131
131
|
}
|
|
132
|
-
}), null),
|
|
132
|
+
}), null), k(() => B(i, b("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-[var(--floe-duration-instant)]", "hover:bg-[var(--floe-state-hover)]", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", s() === r.name && "bg-[var(--floe-state-selected)] text-foreground font-medium"))), i;
|
|
133
133
|
})()
|
|
134
134
|
});
|
|
135
135
|
}
|