@floegence/floe-webapp-core 0.35.13 → 0.35.14
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/deck/WidgetResizeHandle.js +34 -33
- package/dist/components/file-browser/FileBrowser.js +77 -70
- package/dist/components/file-browser/FileBrowserContext.js +141 -140
- package/dist/components/file-browser/types.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +21 -21
- package/dist/components/layout/MobileTabBar.js +12 -12
- package/dist/components/layout/ResizeHandle.d.ts +2 -0
- package/dist/components/layout/ResizeHandle.js +38 -37
- package/dist/components/layout/Shell.js +164 -140
- package/dist/components/layout/Sidebar.js +8 -8
- package/dist/components/layout/SidebarPane.d.ts +2 -0
- package/dist/components/layout/SidebarPane.js +22 -16
- package/dist/components/ui/CommandPalette.js +47 -46
- package/dist/components/ui/FloatingWindow.d.ts +5 -1
- package/dist/components/ui/FloatingWindow.js +267 -194
- package/dist/components/ui/floatingWindowGeometry.d.ts +41 -0
- package/dist/components/ui/floatingWindowGeometry.js +65 -0
- package/dist/context/FileBrowserDragContext.js +45 -43
- package/dist/context/LayoutContext.d.ts +1 -0
- package/dist/context/LayoutContext.js +20 -19
- package/dist/floe.css +12 -0
- package/dist/hooks/useDeckDrag.js +39 -35
- package/dist/hooks/useFileBrowserDrag.js +74 -81
- package/dist/styles.css +1 -1
- package/dist/utils/hotInteraction.d.ts +9 -0
- package/dist/utils/hotInteraction.js +34 -0
- package/package.json +10 -10
- package/LICENSE +0 -21
|
@@ -1,172 +1,194 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { useLayout as
|
|
4
|
-
import { useResolvedFloeConfig as
|
|
5
|
-
import { useMediaQuery as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { createComponent as o, Dynamic as k, insert as m, memo as p, effect as T, className as h, setStyleProperty as J, template as I, use as U, delegateEvents as X } from "solid-js/web";
|
|
2
|
+
import { createSignal as R, createEffect as B, createMemo as g, For as N, Show as f } from "solid-js";
|
|
3
|
+
import { useLayout as Y } from "../../context/LayoutContext.js";
|
|
4
|
+
import { useResolvedFloeConfig as Z } from "../../context/FloeConfigContext.js";
|
|
5
|
+
import { useMediaQuery as ee } from "../../hooks/useMediaQuery.js";
|
|
6
|
+
import { useOverlayMask as te } from "../../hooks/useOverlayMask.js";
|
|
7
|
+
import { cn as S } from "../../utils/cn.js";
|
|
8
|
+
import { deferNonBlocking as re } from "../../utils/defer.js";
|
|
9
|
+
import { useComponentRegistry as ie } from "../../context/ComponentRegistry.js";
|
|
10
|
+
import { Sidebar as ne } from "./Sidebar.js";
|
|
11
|
+
import { TopBar as oe } from "./TopBar.js";
|
|
12
|
+
import { TopBarIconButton as le } from "./TopBarIconButton.js";
|
|
13
|
+
import { BottomBar as ae } from "./BottomBar.js";
|
|
14
|
+
import { MobileTabBar as se } from "./MobileTabBar.js";
|
|
15
|
+
import { ActivityBar as de } from "./ActivityBar.js";
|
|
16
|
+
import { ResizeHandle as W } from "./ResizeHandle.js";
|
|
17
|
+
import { resolveMobileTabActiveId as ce, resolveMobileTabSelect as ue } from "./mobileTabs.js";
|
|
18
|
+
import { KeepAliveStack as me } from "./KeepAliveStack.js";
|
|
19
|
+
var P = /* @__PURE__ */ I('<div class="flex items-center gap-2">'), be = /* @__PURE__ */ I("<div data-floe-shell-slot=mobile-sidebar-backdrop>"), fe = /* @__PURE__ */ I('<div data-floe-shell-slot=mobile-sidebar-drawer tabindex=-1><div class="h-full overflow-auto overscroll-contain">'), ve = /* @__PURE__ */ I("<div data-floe-shell-slot=terminal-panel style=border-top-color:var(--terminal-panel-border)>"), he = /* @__PURE__ */ I('<div data-floe-shell><div data-floe-shell-slot=main-layout class="flex-1 min-h-0 flex overflow-hidden relative"><div data-floe-shell-slot=content-area><main data-floe-shell-slot=main>');
|
|
20
|
+
function Re(r) {
|
|
21
|
+
const i = Y(), F = Z(), d = ee(F.config.layout.mobileQuery), [y, v] = R(!1), [z, A] = R(null);
|
|
22
|
+
let M;
|
|
23
|
+
const c = () => r.sidebarMode === "hidden", s = (() => {
|
|
21
24
|
try {
|
|
22
|
-
return
|
|
25
|
+
return ie();
|
|
23
26
|
} catch {
|
|
24
27
|
return null;
|
|
25
28
|
}
|
|
26
|
-
})(),
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
openSidebar:
|
|
29
|
+
})(), x = (e, a) => {
|
|
30
|
+
const l = s?.getComponent(e)?.sidebar?.fullScreen ?? !1, n = c() ? !1 : a?.openSidebar ?? !l;
|
|
31
|
+
i.setSidebarActiveTab(e, {
|
|
32
|
+
openSidebar: n
|
|
30
33
|
});
|
|
31
34
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}),
|
|
35
|
-
const e =
|
|
36
|
-
|
|
37
|
-
}),
|
|
38
|
-
|
|
35
|
+
B(() => {
|
|
36
|
+
c() && v(!1);
|
|
37
|
+
}), B(() => {
|
|
38
|
+
const e = d();
|
|
39
|
+
i.isMobile() !== e && i.setIsMobile(e);
|
|
40
|
+
}), B(() => {
|
|
41
|
+
d() || v(!1);
|
|
39
42
|
});
|
|
40
|
-
const C =
|
|
43
|
+
const C = g(() => r.activityItems ? r.activityItems : s ? s.sidebarItems().filter((e) => !!e.icon).filter((e) => !(d() && e.sidebar?.hiddenOnMobile)).map((e) => ({
|
|
41
44
|
id: e.id,
|
|
42
45
|
icon: e.icon,
|
|
43
46
|
label: e.name,
|
|
44
47
|
badge: e.sidebar?.badge,
|
|
45
48
|
collapseBehavior: e.sidebar?.collapseBehavior ?? (e.sidebar?.fullScreen ? "preserve" : "toggle")
|
|
46
|
-
})) : []),
|
|
49
|
+
})) : []), H = g(() => c() ? [] : r.sidebarContent ? [] : s ? s.sidebarItems().filter((e) => !(d() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
|
|
47
50
|
id: e.id,
|
|
48
|
-
render: () =>
|
|
51
|
+
render: () => o(k, {
|
|
49
52
|
get component() {
|
|
50
53
|
return e.component;
|
|
51
54
|
}
|
|
52
55
|
})
|
|
53
|
-
})) : []),
|
|
54
|
-
if (!
|
|
56
|
+
})) : []), _ = (e) => {
|
|
57
|
+
if (!c()) {
|
|
55
58
|
if (r.sidebarContent) return r.sidebarContent(e);
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
59
|
+
if (s)
|
|
60
|
+
return o(me, {
|
|
58
61
|
get views() {
|
|
59
|
-
return
|
|
62
|
+
return H();
|
|
60
63
|
},
|
|
61
64
|
activeId: e
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
|
-
},
|
|
65
|
-
if (
|
|
66
|
-
if (!
|
|
67
|
-
const e =
|
|
67
|
+
}, $ = g(() => c() ? !0 : s ? s.getComponent(i.sidebarActiveTab())?.sidebar?.fullScreen ?? !1 : !1), E = g(() => {
|
|
68
|
+
if (c()) return !0;
|
|
69
|
+
if (!s) return !1;
|
|
70
|
+
const e = s.getComponent(i.sidebarActiveTab());
|
|
68
71
|
return e?.sidebar ? e.sidebar.fullScreen === !0 || e.sidebar.renderIn === "main" : !1;
|
|
69
72
|
});
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
B(() => {
|
|
74
|
+
d() && $() && v(!1);
|
|
72
75
|
});
|
|
73
|
-
const
|
|
76
|
+
const D = g(() => {
|
|
74
77
|
if (r.bottomBarItems) return r.bottomBarItems;
|
|
75
|
-
if (!
|
|
76
|
-
const e = [...
|
|
78
|
+
if (!s) return;
|
|
79
|
+
const e = [...s.statusBarItems()].sort((n, t) => (n.order ?? 100) - (t.order ?? 100)), a = e.filter((n) => n.position === "left"), l = e.filter((n) => n.position === "right");
|
|
77
80
|
return [(() => {
|
|
78
|
-
var
|
|
79
|
-
return
|
|
80
|
-
each:
|
|
81
|
-
children: (t) =>
|
|
81
|
+
var n = P();
|
|
82
|
+
return m(n, o(N, {
|
|
83
|
+
each: a,
|
|
84
|
+
children: (t) => o(k, {
|
|
82
85
|
get component() {
|
|
83
86
|
return t.component;
|
|
84
87
|
}
|
|
85
88
|
})
|
|
86
|
-
})),
|
|
89
|
+
})), n;
|
|
87
90
|
})(), (() => {
|
|
88
|
-
var
|
|
89
|
-
return
|
|
90
|
-
each:
|
|
91
|
-
children: (t) =>
|
|
91
|
+
var n = P();
|
|
92
|
+
return m(n, o(N, {
|
|
93
|
+
each: l,
|
|
94
|
+
children: (t) => o(k, {
|
|
92
95
|
get component() {
|
|
93
96
|
return t.component;
|
|
94
97
|
}
|
|
95
98
|
})
|
|
96
|
-
})),
|
|
99
|
+
})), n;
|
|
97
100
|
})()];
|
|
98
101
|
});
|
|
99
|
-
|
|
102
|
+
B(() => {
|
|
100
103
|
const e = C();
|
|
101
104
|
if (!e.length) return;
|
|
102
|
-
if (!
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
105
|
-
|
|
105
|
+
if (!i.sidebarActiveTab()) {
|
|
106
|
+
const l = e.find((n) => !n.onClick);
|
|
107
|
+
if (!l) return;
|
|
108
|
+
x(l.id);
|
|
106
109
|
}
|
|
107
110
|
});
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
nextActiveId:
|
|
111
|
-
nextMobileSidebarOpen:
|
|
112
|
-
} =
|
|
111
|
+
const O = (e) => {
|
|
112
|
+
const a = c() ? !0 : s?.getComponent(e)?.sidebar?.fullScreen ?? !1, {
|
|
113
|
+
nextActiveId: l,
|
|
114
|
+
nextMobileSidebarOpen: n
|
|
115
|
+
} = ue({
|
|
113
116
|
clickedId: e,
|
|
114
|
-
activeId:
|
|
115
|
-
mobileSidebarOpen:
|
|
116
|
-
clickedIsFullScreen:
|
|
117
|
+
activeId: i.sidebarActiveTab(),
|
|
118
|
+
mobileSidebarOpen: y(),
|
|
119
|
+
clickedIsFullScreen: a
|
|
117
120
|
});
|
|
118
|
-
|
|
119
|
-
},
|
|
121
|
+
i.sidebarActiveTab() !== l && x(l), v(n);
|
|
122
|
+
}, Q = (e) => {
|
|
120
123
|
if (e.onClick) {
|
|
121
|
-
|
|
124
|
+
re(() => e.onClick());
|
|
122
125
|
return;
|
|
123
126
|
}
|
|
124
|
-
|
|
125
|
-
},
|
|
127
|
+
O(e.id);
|
|
128
|
+
}, K = g(() => {
|
|
126
129
|
const e = r.topBarActions;
|
|
127
|
-
if (!
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
each:
|
|
131
|
-
children: (
|
|
130
|
+
if (!d() || (r.activityBottomItemsMobileMode ?? "hidden") !== "topBar") return e;
|
|
131
|
+
const l = r.activityBottomItems ?? [];
|
|
132
|
+
return l.length ? [o(N, {
|
|
133
|
+
each: l,
|
|
134
|
+
children: (n) => o(le, {
|
|
132
135
|
get label() {
|
|
133
|
-
return
|
|
136
|
+
return n.label;
|
|
134
137
|
},
|
|
135
|
-
onClick: () =>
|
|
138
|
+
onClick: () => Q(n),
|
|
136
139
|
get children() {
|
|
137
|
-
return
|
|
140
|
+
return o(k, {
|
|
138
141
|
get component() {
|
|
139
|
-
return
|
|
142
|
+
return n.icon;
|
|
140
143
|
},
|
|
141
144
|
class: "w-4 h-4"
|
|
142
145
|
});
|
|
143
146
|
}
|
|
144
147
|
})
|
|
145
148
|
}), e] : e;
|
|
146
|
-
}),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
}), L = () => c() ? !0 : i.sidebarCollapsed(), V = () => z() ?? i.sidebarWidth(), j = () => {
|
|
150
|
+
A(i.sidebarWidth());
|
|
151
|
+
}, q = (e) => {
|
|
152
|
+
A((a) => i.clampSidebarWidth((a ?? i.sidebarWidth()) + e));
|
|
153
|
+
}, G = () => {
|
|
154
|
+
const e = z();
|
|
155
|
+
e !== null && (i.setSidebarWidth(e), A(null));
|
|
156
|
+
};
|
|
157
|
+
return te({
|
|
158
|
+
open: () => d() && y() && !c(),
|
|
159
|
+
root: () => M,
|
|
160
|
+
onClose: () => v(!1),
|
|
161
|
+
lockBodyScroll: !0,
|
|
162
|
+
trapFocus: !0,
|
|
163
|
+
closeOnEscape: !0,
|
|
164
|
+
blockHotkeys: !0,
|
|
165
|
+
blockWheel: "outside",
|
|
166
|
+
blockTouchMove: "outside",
|
|
167
|
+
autoFocus: !1,
|
|
168
|
+
restoreFocus: !0
|
|
169
|
+
}), (() => {
|
|
170
|
+
var e = he(), a = e.firstChild, l = a.firstChild, n = l.firstChild;
|
|
171
|
+
return m(e, o(oe, {
|
|
150
172
|
get logo() {
|
|
151
173
|
return r.logo;
|
|
152
174
|
},
|
|
153
175
|
get actions() {
|
|
154
|
-
return
|
|
176
|
+
return K();
|
|
155
177
|
},
|
|
156
178
|
get class() {
|
|
157
179
|
return r.slotClassNames?.topBar;
|
|
158
180
|
}
|
|
159
|
-
}),
|
|
181
|
+
}), a), m(a, o(f, {
|
|
160
182
|
get when() {
|
|
161
|
-
return !
|
|
183
|
+
return !d();
|
|
162
184
|
},
|
|
163
185
|
get children() {
|
|
164
|
-
return [
|
|
186
|
+
return [o(f, {
|
|
165
187
|
get when() {
|
|
166
188
|
return C().length > 0;
|
|
167
189
|
},
|
|
168
190
|
get children() {
|
|
169
|
-
return
|
|
191
|
+
return o(de, {
|
|
170
192
|
get items() {
|
|
171
193
|
return C();
|
|
172
194
|
},
|
|
@@ -174,117 +196,119 @@ function Ae(r) {
|
|
|
174
196
|
return r.activityBottomItems;
|
|
175
197
|
},
|
|
176
198
|
get activeId() {
|
|
177
|
-
return
|
|
199
|
+
return i.sidebarActiveTab();
|
|
178
200
|
},
|
|
179
|
-
onActiveChange:
|
|
201
|
+
onActiveChange: x,
|
|
180
202
|
get collapsed() {
|
|
181
|
-
return
|
|
203
|
+
return L();
|
|
182
204
|
},
|
|
183
205
|
get onCollapsedChange() {
|
|
184
|
-
return
|
|
206
|
+
return p(() => !!c())() ? void 0 : i.setSidebarCollapsed;
|
|
185
207
|
},
|
|
186
208
|
get class() {
|
|
187
209
|
return r.slotClassNames?.activityBar;
|
|
188
210
|
}
|
|
189
211
|
});
|
|
190
212
|
}
|
|
191
|
-
}),
|
|
213
|
+
}), o(f, {
|
|
192
214
|
get when() {
|
|
193
|
-
return !
|
|
215
|
+
return !c();
|
|
194
216
|
},
|
|
195
217
|
get children() {
|
|
196
|
-
return
|
|
218
|
+
return o(ne, {
|
|
197
219
|
get width() {
|
|
198
|
-
return
|
|
220
|
+
return V();
|
|
199
221
|
},
|
|
200
222
|
get collapsed() {
|
|
201
|
-
return
|
|
223
|
+
return i.sidebarCollapsed() || $();
|
|
202
224
|
},
|
|
203
225
|
get resizer() {
|
|
204
|
-
return
|
|
226
|
+
return o(W, {
|
|
205
227
|
direction: "horizontal",
|
|
206
|
-
onResize:
|
|
228
|
+
onResize: q,
|
|
229
|
+
onResizeStart: j,
|
|
230
|
+
onResizeEnd: G
|
|
207
231
|
});
|
|
208
232
|
},
|
|
209
233
|
get class() {
|
|
210
234
|
return r.slotClassNames?.sidebar;
|
|
211
235
|
},
|
|
212
236
|
get children() {
|
|
213
|
-
return
|
|
237
|
+
return _(i.sidebarActiveTab());
|
|
214
238
|
}
|
|
215
239
|
});
|
|
216
240
|
}
|
|
217
241
|
})];
|
|
218
242
|
}
|
|
219
|
-
}),
|
|
243
|
+
}), l), m(a, o(f, {
|
|
220
244
|
get when() {
|
|
221
|
-
return
|
|
245
|
+
return p(() => !!(d() && y()))() && !c();
|
|
222
246
|
},
|
|
223
247
|
get children() {
|
|
224
248
|
return [(() => {
|
|
225
|
-
var t =
|
|
226
|
-
return t.$$click = () =>
|
|
249
|
+
var t = be();
|
|
250
|
+
return t.$$click = () => v(!1), T(() => h(t, S("absolute inset-0 z-40 bg-black/30 cursor-pointer", r.slotClassNames?.mobileSidebarBackdrop))), t;
|
|
227
251
|
})(), (() => {
|
|
228
|
-
var t =
|
|
229
|
-
return
|
|
252
|
+
var t = fe(), u = t.firstChild, b = M;
|
|
253
|
+
return typeof b == "function" ? U(b, t) : M = t, m(u, () => _(i.sidebarActiveTab())), T(() => h(t, S("absolute left-0 top-0 bottom-0 z-50", "w-72 max-w-[80vw]", "bg-sidebar border-r border-sidebar-border", "shadow-xl", "animate-in slide-in-from-left duration-200", r.slotClassNames?.mobileSidebarDrawer))), t;
|
|
230
254
|
})()];
|
|
231
255
|
}
|
|
232
|
-
}),
|
|
256
|
+
}), l), m(n, () => r.children), m(l, o(f, {
|
|
233
257
|
get when() {
|
|
234
|
-
return
|
|
258
|
+
return p(() => !!(!d() && i.terminalOpened()))() && r.terminalPanel;
|
|
235
259
|
},
|
|
236
260
|
get children() {
|
|
237
|
-
var t =
|
|
238
|
-
return
|
|
261
|
+
var t = ve();
|
|
262
|
+
return m(t, o(W, {
|
|
239
263
|
direction: "vertical",
|
|
240
|
-
onResize: (
|
|
241
|
-
}), null),
|
|
242
|
-
var
|
|
243
|
-
return
|
|
264
|
+
onResize: (u) => i.setTerminalHeight(i.terminalHeight() - u)
|
|
265
|
+
}), null), m(t, () => r.terminalPanel, null), T((u) => {
|
|
266
|
+
var b = S("relative shrink-0 border-t border-border bg-terminal-background overflow-hidden", r.slotClassNames?.terminalPanel), w = `${i.terminalHeight()}px`;
|
|
267
|
+
return b !== u.e && h(t, u.e = b), w !== u.t && J(t, "height", u.t = w), u;
|
|
244
268
|
}, {
|
|
245
269
|
e: void 0,
|
|
246
270
|
t: void 0
|
|
247
271
|
}), t;
|
|
248
272
|
}
|
|
249
|
-
}), null),
|
|
273
|
+
}), null), m(e, o(f, {
|
|
250
274
|
get when() {
|
|
251
|
-
return !
|
|
275
|
+
return !d();
|
|
252
276
|
},
|
|
253
277
|
get children() {
|
|
254
|
-
return
|
|
278
|
+
return o(ae, {
|
|
255
279
|
get class() {
|
|
256
280
|
return r.slotClassNames?.bottomBar;
|
|
257
281
|
},
|
|
258
282
|
get children() {
|
|
259
|
-
return
|
|
283
|
+
return D();
|
|
260
284
|
}
|
|
261
285
|
});
|
|
262
286
|
}
|
|
263
|
-
}), null),
|
|
287
|
+
}), null), m(e, o(f, {
|
|
264
288
|
get when() {
|
|
265
|
-
return
|
|
289
|
+
return p(() => !!d())() && C().length > 0;
|
|
266
290
|
},
|
|
267
291
|
get children() {
|
|
268
|
-
return
|
|
292
|
+
return o(se, {
|
|
269
293
|
get items() {
|
|
270
294
|
return C();
|
|
271
295
|
},
|
|
272
296
|
get activeId() {
|
|
273
|
-
return
|
|
274
|
-
activeId:
|
|
275
|
-
mobileSidebarOpen:
|
|
276
|
-
activeIsFullScreen:
|
|
277
|
-
activeIsPage:
|
|
297
|
+
return ce({
|
|
298
|
+
activeId: i.sidebarActiveTab(),
|
|
299
|
+
mobileSidebarOpen: y(),
|
|
300
|
+
activeIsFullScreen: $(),
|
|
301
|
+
activeIsPage: E()
|
|
278
302
|
});
|
|
279
303
|
},
|
|
280
|
-
onSelect:
|
|
304
|
+
onSelect: O,
|
|
281
305
|
get class() {
|
|
282
306
|
return r.slotClassNames?.mobileTabBar;
|
|
283
307
|
}
|
|
284
308
|
});
|
|
285
309
|
}
|
|
286
|
-
}), null),
|
|
287
|
-
var
|
|
310
|
+
}), null), T((t) => {
|
|
311
|
+
var u = S(
|
|
288
312
|
// Use dvh when supported to avoid mobile browser UI causing layout jumps.
|
|
289
313
|
"h-screen h-[100dvh] w-full flex flex-col overflow-hidden",
|
|
290
314
|
"bg-background text-foreground",
|
|
@@ -292,8 +316,8 @@ function Ae(r) {
|
|
|
292
316
|
"overscroll-none",
|
|
293
317
|
r.slotClassNames?.root,
|
|
294
318
|
r.class
|
|
295
|
-
),
|
|
296
|
-
return
|
|
319
|
+
), b = S("flex-1 min-w-0 flex flex-col overflow-hidden", r.slotClassNames?.contentArea), w = S("flex-1 min-h-0 overflow-auto overscroll-contain", r.slotClassNames?.main);
|
|
320
|
+
return u !== t.e && h(e, t.e = u), b !== t.t && h(l, t.t = b), w !== t.a && h(n, t.a = w), t;
|
|
297
321
|
}, {
|
|
298
322
|
e: void 0,
|
|
299
323
|
t: void 0,
|
|
@@ -301,7 +325,7 @@ function Ae(r) {
|
|
|
301
325
|
}), e;
|
|
302
326
|
})();
|
|
303
327
|
}
|
|
304
|
-
|
|
328
|
+
X(["click"]);
|
|
305
329
|
export {
|
|
306
|
-
|
|
330
|
+
Re as Shell
|
|
307
331
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { insert as l, effect as c, className as o, setStyleProperty as u, memo as
|
|
1
|
+
import { insert as l, effect as c, className as o, setStyleProperty as u, memo as x, template as d, delegateEvents as g } from "solid-js/web";
|
|
2
2
|
import "solid-js";
|
|
3
3
|
import { cn as s } from "../../utils/cn.js";
|
|
4
|
-
var
|
|
4
|
+
var $ = /* @__PURE__ */ d('<aside data-floe-shell-slot=sidebar data-floe-geometry-surface=shell-sidebar><div class="flex-1 overflow-auto overscroll-contain">'), m = /* @__PURE__ */ d("<div>"), _ = /* @__PURE__ */ d("<section><div class=flex-1>"), w = /* @__PURE__ */ d('<div class="flex items-center justify-between px-2.5 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60"><span>'), y = /* @__PURE__ */ d('<button type=button><span class="flex-1 truncate text-left">'), S = /* @__PURE__ */ d('<span class="flex-shrink-0 w-4 h-4 opacity-60">');
|
|
5
5
|
function j(e) {
|
|
6
6
|
const t = () => e.collapsed ?? !1, a = () => e.width ?? 350;
|
|
7
7
|
return (() => {
|
|
8
|
-
var i =
|
|
8
|
+
var i = $(), n = i.firstChild;
|
|
9
9
|
return l(n, () => e.children), l(i, () => e.resizer, null), c((r) => {
|
|
10
|
-
var
|
|
11
|
-
return
|
|
10
|
+
var f = s("relative h-full flex flex-col shrink-0 min-h-0", "bg-sidebar text-sidebar-foreground", "border-r border-sidebar-border", "overflow-hidden", "transition-[width] duration-150 ease-out", e.class), v = t() ? "0px" : `${a()}px`, b = t() ? "hidden" : "visible", h = t() ? "0px" : void 0;
|
|
11
|
+
return f !== r.e && o(i, r.e = f), v !== r.t && u(i, "width", r.t = v), b !== r.a && u(i, "visibility", r.a = b), h !== r.o && u(i, "border-right-width", r.o = h), r;
|
|
12
12
|
}, {
|
|
13
13
|
e: void 0,
|
|
14
14
|
t: void 0,
|
|
@@ -33,7 +33,7 @@ function L(e) {
|
|
|
33
33
|
return (() => {
|
|
34
34
|
var t = _(), a = t.firstChild;
|
|
35
35
|
return l(t, (() => {
|
|
36
|
-
var i =
|
|
36
|
+
var i = x(() => !!e.title);
|
|
37
37
|
return () => i() && (() => {
|
|
38
38
|
var n = w(), r = n.firstChild;
|
|
39
39
|
return l(r, () => e.title), l(n, () => e.actions, null), n;
|
|
@@ -45,7 +45,7 @@ function N(e) {
|
|
|
45
45
|
return (() => {
|
|
46
46
|
var t = y(), a = t.firstChild;
|
|
47
47
|
return t.$$click = () => e.onClick?.(), l(t, (() => {
|
|
48
|
-
var i =
|
|
48
|
+
var i = x(() => !!e.icon);
|
|
49
49
|
return () => i() && (() => {
|
|
50
50
|
var n = S();
|
|
51
51
|
return l(n, () => e.icon), n;
|
|
@@ -59,7 +59,7 @@ function N(e) {
|
|
|
59
59
|
}), t;
|
|
60
60
|
})();
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
g(["click"]);
|
|
63
63
|
export {
|
|
64
64
|
j as Sidebar,
|
|
65
65
|
z as SidebarContent,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { insert as i, createComponent as o, use as
|
|
1
|
+
import { insert as i, createComponent as o, use as B, effect as k, className as s, setStyleProperty as C, template as a, delegateEvents as M } from "solid-js/web";
|
|
2
2
|
import { Show as l } from "solid-js";
|
|
3
3
|
import { useLayout as j } from "../../context/LayoutContext.js";
|
|
4
4
|
import { cn as d } from "../../utils/cn.js";
|
|
5
5
|
import { ResizeHandle as A } from "./ResizeHandle.js";
|
|
6
|
-
var
|
|
6
|
+
var E = /* @__PURE__ */ a('<div class="min-w-0 flex items-center gap-1.5">'), O = /* @__PURE__ */ a('<button type=button class="flex items-center justify-center w-5 h-5 rounded cursor-pointer hover:bg-sidebar-accent/80 transition-colors"aria-label="Close sidebar"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class="w-3.5 h-3.5"><path d="M18 6 6 18"></path><path d="m6 6 12 12">'), P = /* @__PURE__ */ a('<div class="flex min-w-0 items-center gap-1.5">'), H = /* @__PURE__ */ a('<aside data-floe-geometry-surface=sidebar-pane><div><div class="flex items-center justify-between px-3 py-2 border-b border-sidebar-border"><span class="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60"></span></div><div>'), L = /* @__PURE__ */ a("<div>");
|
|
7
7
|
function I(e) {
|
|
8
|
-
const z = j(),
|
|
8
|
+
const z = j(), m = () => z.isMobile(), v = () => e.width ?? 240, c = () => e.open ?? !0, u = () => m() && e.mobileOverlay !== !1 && c(), w = () => u() && typeof e.onClose == "function", R = () => u() && e.mobileBackdrop !== !1 && typeof e.onClose == "function", _ = () => e.resizable && c() && !m() && typeof e.onResize == "function";
|
|
9
9
|
return [(() => {
|
|
10
|
-
var n = H(), h = n.firstChild, f = h.firstChild,
|
|
11
|
-
return i(
|
|
10
|
+
var n = H(), h = n.firstChild, f = h.firstChild, S = f.firstChild, b = f.nextSibling;
|
|
11
|
+
return i(S, () => e.title), i(f, o(l, {
|
|
12
12
|
get when() {
|
|
13
13
|
return e.headerActions || w();
|
|
14
14
|
},
|
|
15
15
|
get children() {
|
|
16
|
-
var t =
|
|
16
|
+
var t = P();
|
|
17
17
|
return i(t, o(l, {
|
|
18
18
|
get when() {
|
|
19
19
|
return e.headerActions;
|
|
20
20
|
},
|
|
21
21
|
get children() {
|
|
22
|
-
var r =
|
|
22
|
+
var r = E();
|
|
23
23
|
return i(r, () => e.headerActions), r;
|
|
24
24
|
}
|
|
25
25
|
}), null), i(t, o(l, {
|
|
@@ -27,24 +27,30 @@ function I(e) {
|
|
|
27
27
|
return w();
|
|
28
28
|
},
|
|
29
29
|
get children() {
|
|
30
|
-
var r =
|
|
30
|
+
var r = O();
|
|
31
31
|
return r.$$click = () => e.onClose?.(), r;
|
|
32
32
|
}
|
|
33
33
|
}), null), t;
|
|
34
34
|
}
|
|
35
|
-
}), null),
|
|
35
|
+
}), null), B((t) => e.bodyRef?.(t), b), i(b, () => e.children), i(n, o(l, {
|
|
36
36
|
get when() {
|
|
37
|
-
return
|
|
37
|
+
return _();
|
|
38
38
|
},
|
|
39
39
|
get children() {
|
|
40
40
|
return o(A, {
|
|
41
41
|
direction: "horizontal",
|
|
42
|
-
onResize: (t) => e.onResize?.(t)
|
|
42
|
+
onResize: (t) => e.onResize?.(t),
|
|
43
|
+
get onResizeStart() {
|
|
44
|
+
return e.onResizeStart;
|
|
45
|
+
},
|
|
46
|
+
get onResizeEnd() {
|
|
47
|
+
return e.onResizeEnd;
|
|
48
|
+
}
|
|
43
49
|
});
|
|
44
50
|
}
|
|
45
51
|
}), null), k((t) => {
|
|
46
|
-
var r = d("flex-shrink-0 border-r border-border bg-sidebar relative", "transition-
|
|
47
|
-
return r !== t.e &&
|
|
52
|
+
var r = d("flex-shrink-0 border-r border-border bg-sidebar relative", "transition-[width,transform,box-shadow] duration-200 ease-out", "overflow-hidden", u() && "absolute inset-y-0 left-0 z-10 shadow-lg", e.class), g = c() ? `${v()}px` : "0px", x = d("h-full flex flex-col", e.innerClass), y = `${v()}px`, $ = d("flex-1 min-h-0 overflow-auto", e.bodyClass);
|
|
53
|
+
return r !== t.e && s(n, t.e = r), g !== t.t && C(n, "width", t.t = g), x !== t.a && s(h, t.a = x), y !== t.o && C(h, "width", t.o = y), $ !== t.i && s(b, t.i = $), t;
|
|
48
54
|
}, {
|
|
49
55
|
e: void 0,
|
|
50
56
|
t: void 0,
|
|
@@ -54,15 +60,15 @@ function I(e) {
|
|
|
54
60
|
}), n;
|
|
55
61
|
})(), o(l, {
|
|
56
62
|
get when() {
|
|
57
|
-
return
|
|
63
|
+
return R();
|
|
58
64
|
},
|
|
59
65
|
get children() {
|
|
60
66
|
var n = L();
|
|
61
|
-
return n.$$click = () => e.onClose?.(), k(() =>
|
|
67
|
+
return n.$$click = () => e.onClose?.(), k(() => s(n, d("absolute inset-0 bg-background/60 backdrop-blur-sm z-[9]", e.backdropClass))), n;
|
|
62
68
|
}
|
|
63
69
|
})];
|
|
64
70
|
}
|
|
65
|
-
|
|
71
|
+
M(["click"]);
|
|
66
72
|
export {
|
|
67
73
|
I as SidebarPane
|
|
68
74
|
};
|