@floegence/floe-webapp-core 0.34.0 → 0.35.0
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/layout/ActivityBar.js +32 -32
- package/dist/components/layout/BottomBar.js +19 -19
- package/dist/components/layout/MobileTabBar.js +29 -29
- package/dist/components/layout/Shell.d.ts +14 -0
- package/dist/components/layout/Shell.js +173 -144
- package/dist/components/layout/Sidebar.js +7 -7
- package/dist/components/layout/TopBar.js +18 -18
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/context/FloeConfigContext.d.ts +8 -1
- package/dist/context/ThemeContext.js +32 -27
- package/dist/full.js +601 -599
- package/dist/index.js +113 -111
- package/dist/styles/themes/index.d.ts +20 -1
- package/dist/styles/themes/index.js +34 -7
- package/dist/styles.css +1 -1
- package/dist/themes/dark.css +5 -0
- package/dist/themes/light.css +5 -0
- package/package.json +1 -1
|
@@ -1,278 +1,307 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { useLayout as
|
|
4
|
-
import { useResolvedFloeConfig as
|
|
5
|
-
import { useMediaQuery as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { deferNonBlocking as
|
|
8
|
-
import { useComponentRegistry as
|
|
9
|
-
import { Sidebar as
|
|
10
|
-
import { TopBar as
|
|
11
|
-
import { TopBarIconButton as
|
|
12
|
-
import { BottomBar as
|
|
13
|
-
import { MobileTabBar as
|
|
14
|
-
import { ActivityBar as
|
|
1
|
+
import { createComponent as n, Dynamic as y, insert as c, memo as T, effect as A, className as f, setStyleProperty as E, template as B, delegateEvents as Q } from "solid-js/web";
|
|
2
|
+
import { createSignal as K, createEffect as w, createMemo as v, For as p, Show as u } from "solid-js";
|
|
3
|
+
import { useLayout as L } from "../../context/LayoutContext.js";
|
|
4
|
+
import { useResolvedFloeConfig as V } from "../../context/FloeConfigContext.js";
|
|
5
|
+
import { useMediaQuery as j } from "../../hooks/useMediaQuery.js";
|
|
6
|
+
import { cn as g } from "../../utils/cn.js";
|
|
7
|
+
import { deferNonBlocking as q } from "../../utils/defer.js";
|
|
8
|
+
import { useComponentRegistry as G } from "../../context/ComponentRegistry.js";
|
|
9
|
+
import { Sidebar as J } from "./Sidebar.js";
|
|
10
|
+
import { TopBar as U } from "./TopBar.js";
|
|
11
|
+
import { TopBarIconButton as X } from "./TopBarIconButton.js";
|
|
12
|
+
import { BottomBar as Y } from "./BottomBar.js";
|
|
13
|
+
import { MobileTabBar as Z } from "./MobileTabBar.js";
|
|
14
|
+
import { ActivityBar as ee } from "./ActivityBar.js";
|
|
15
15
|
import { ResizeHandle as _ } from "./ResizeHandle.js";
|
|
16
|
-
import { resolveMobileTabActiveId as
|
|
17
|
-
import { KeepAliveStack as
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
const
|
|
16
|
+
import { resolveMobileTabActiveId as te, resolveMobileTabSelect as re } from "./mobileTabs.js";
|
|
17
|
+
import { KeepAliveStack as ie } from "./KeepAliveStack.js";
|
|
18
|
+
var O = /* @__PURE__ */ B('<div class="flex items-center gap-2">'), ne = /* @__PURE__ */ B("<div data-floe-shell-slot=mobile-sidebar-backdrop>"), le = /* @__PURE__ */ B('<div data-floe-shell-slot=mobile-sidebar-drawer><div class="h-full overflow-auto overscroll-contain">'), oe = /* @__PURE__ */ B("<div data-floe-shell-slot=terminal-panel style=border-top-color:var(--terminal-panel-border)>"), ae = /* @__PURE__ */ B('<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>');
|
|
19
|
+
function Ae(r) {
|
|
20
|
+
const l = L(), z = V(), m = j(z.config.layout.mobileQuery), [k, h] = K(!1), b = () => r.sidebarMode === "hidden", a = (() => {
|
|
21
21
|
try {
|
|
22
|
-
return
|
|
22
|
+
return G();
|
|
23
23
|
} catch {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
})(),
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
openSidebar:
|
|
26
|
+
})(), M = (e, s) => {
|
|
27
|
+
const o = a?.getComponent(e)?.sidebar?.fullScreen ?? !1, i = b() ? !1 : s?.openSidebar ?? !o;
|
|
28
|
+
l.setSidebarActiveTab(e, {
|
|
29
|
+
openSidebar: i
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}),
|
|
35
|
-
const e =
|
|
36
|
-
|
|
37
|
-
}),
|
|
38
|
-
|
|
32
|
+
w(() => {
|
|
33
|
+
b() && h(!1);
|
|
34
|
+
}), w(() => {
|
|
35
|
+
const e = m();
|
|
36
|
+
l.isMobile() !== e && l.setIsMobile(e);
|
|
37
|
+
}), w(() => {
|
|
38
|
+
m() || h(!1);
|
|
39
39
|
});
|
|
40
|
-
const
|
|
40
|
+
const C = v(() => r.activityItems ? r.activityItems : a ? a.sidebarItems().filter((e) => !!e.icon).filter((e) => !(m() && e.sidebar?.hiddenOnMobile)).map((e) => ({
|
|
41
41
|
id: e.id,
|
|
42
42
|
icon: e.icon,
|
|
43
43
|
label: e.name,
|
|
44
44
|
badge: e.sidebar?.badge,
|
|
45
45
|
collapseBehavior: e.sidebar?.collapseBehavior ?? (e.sidebar?.fullScreen ? "preserve" : "toggle")
|
|
46
|
-
})) : []),
|
|
46
|
+
})) : []), P = v(() => b() ? [] : r.sidebarContent ? [] : a ? a.sidebarItems().filter((e) => !(m() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
|
|
47
47
|
id: e.id,
|
|
48
|
-
render: () =>
|
|
48
|
+
render: () => n(y, {
|
|
49
49
|
get component() {
|
|
50
50
|
return e.component;
|
|
51
51
|
}
|
|
52
52
|
})
|
|
53
|
-
})) : []),
|
|
54
|
-
if (!
|
|
55
|
-
if (
|
|
53
|
+
})) : []), N = (e) => {
|
|
54
|
+
if (!b()) {
|
|
55
|
+
if (r.sidebarContent) return r.sidebarContent(e);
|
|
56
56
|
if (a)
|
|
57
|
-
return
|
|
57
|
+
return n(ie, {
|
|
58
58
|
get views() {
|
|
59
|
-
return
|
|
59
|
+
return P();
|
|
60
60
|
},
|
|
61
61
|
activeId: e
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
if (
|
|
64
|
+
}, x = v(() => b() ? !0 : a ? a.getComponent(l.sidebarActiveTab())?.sidebar?.fullScreen ?? !1 : !1), F = v(() => {
|
|
65
|
+
if (b()) return !0;
|
|
66
66
|
if (!a) return !1;
|
|
67
|
-
const e = a.getComponent(
|
|
67
|
+
const e = a.getComponent(l.sidebarActiveTab());
|
|
68
68
|
return e?.sidebar ? e.sidebar.fullScreen === !0 || e.sidebar.renderIn === "main" : !1;
|
|
69
69
|
});
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
w(() => {
|
|
71
|
+
m() && x() && h(!1);
|
|
72
72
|
});
|
|
73
|
-
const H =
|
|
74
|
-
if (
|
|
73
|
+
const H = v(() => {
|
|
74
|
+
if (r.bottomBarItems) return r.bottomBarItems;
|
|
75
75
|
if (!a) return;
|
|
76
|
-
const e = [...a.statusBarItems()].sort((
|
|
76
|
+
const e = [...a.statusBarItems()].sort((i, t) => (i.order ?? 100) - (t.order ?? 100)), s = e.filter((i) => i.position === "left"), o = e.filter((i) => i.position === "right");
|
|
77
77
|
return [(() => {
|
|
78
|
-
var
|
|
79
|
-
return c(
|
|
78
|
+
var i = O();
|
|
79
|
+
return c(i, n(p, {
|
|
80
80
|
each: s,
|
|
81
|
-
children: (
|
|
81
|
+
children: (t) => n(y, {
|
|
82
82
|
get component() {
|
|
83
|
-
return
|
|
83
|
+
return t.component;
|
|
84
84
|
}
|
|
85
85
|
})
|
|
86
|
-
})),
|
|
86
|
+
})), i;
|
|
87
87
|
})(), (() => {
|
|
88
|
-
var
|
|
89
|
-
return c(
|
|
90
|
-
each:
|
|
91
|
-
children: (
|
|
88
|
+
var i = O();
|
|
89
|
+
return c(i, n(p, {
|
|
90
|
+
each: o,
|
|
91
|
+
children: (t) => n(y, {
|
|
92
92
|
get component() {
|
|
93
|
-
return
|
|
93
|
+
return t.component;
|
|
94
94
|
}
|
|
95
95
|
})
|
|
96
|
-
})),
|
|
96
|
+
})), i;
|
|
97
97
|
})()];
|
|
98
98
|
});
|
|
99
|
-
|
|
100
|
-
const e =
|
|
99
|
+
w(() => {
|
|
100
|
+
const e = C();
|
|
101
101
|
if (!e.length) return;
|
|
102
|
-
if (!
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
105
|
-
|
|
102
|
+
if (!l.sidebarActiveTab()) {
|
|
103
|
+
const o = e.find((i) => !i.onClick);
|
|
104
|
+
if (!o) return;
|
|
105
|
+
M(o.id);
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
const
|
|
109
|
-
const s =
|
|
110
|
-
nextActiveId:
|
|
111
|
-
nextMobileSidebarOpen:
|
|
112
|
-
} =
|
|
108
|
+
const $ = (e) => {
|
|
109
|
+
const s = b() ? !0 : a?.getComponent(e)?.sidebar?.fullScreen ?? !1, {
|
|
110
|
+
nextActiveId: o,
|
|
111
|
+
nextMobileSidebarOpen: i
|
|
112
|
+
} = re({
|
|
113
113
|
clickedId: e,
|
|
114
|
-
activeId:
|
|
115
|
-
mobileSidebarOpen:
|
|
114
|
+
activeId: l.sidebarActiveTab(),
|
|
115
|
+
mobileSidebarOpen: k(),
|
|
116
116
|
clickedIsFullScreen: s
|
|
117
117
|
});
|
|
118
|
-
|
|
119
|
-
},
|
|
118
|
+
l.sidebarActiveTab() !== o && M(o), h(i);
|
|
119
|
+
}, R = (e) => {
|
|
120
120
|
if (e.onClick) {
|
|
121
|
-
|
|
121
|
+
q(() => e.onClick());
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
const e =
|
|
127
|
-
if (!
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
each:
|
|
131
|
-
children: (
|
|
124
|
+
$(e.id);
|
|
125
|
+
}, W = v(() => {
|
|
126
|
+
const e = r.topBarActions;
|
|
127
|
+
if (!m() || (r.activityBottomItemsMobileMode ?? "hidden") !== "topBar") return e;
|
|
128
|
+
const o = r.activityBottomItems ?? [];
|
|
129
|
+
return o.length ? [n(p, {
|
|
130
|
+
each: o,
|
|
131
|
+
children: (i) => n(X, {
|
|
132
132
|
get label() {
|
|
133
|
-
return
|
|
133
|
+
return i.label;
|
|
134
134
|
},
|
|
135
|
-
onClick: () =>
|
|
135
|
+
onClick: () => R(i),
|
|
136
136
|
get children() {
|
|
137
|
-
return
|
|
137
|
+
return n(y, {
|
|
138
138
|
get component() {
|
|
139
|
-
return
|
|
139
|
+
return i.icon;
|
|
140
140
|
},
|
|
141
141
|
class: "w-4 h-4"
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
})
|
|
145
145
|
}), e] : e;
|
|
146
|
-
}),
|
|
146
|
+
}), D = () => b() ? !0 : l.sidebarCollapsed();
|
|
147
147
|
return (() => {
|
|
148
|
-
var e =
|
|
149
|
-
return c(e,
|
|
148
|
+
var e = ae(), s = e.firstChild, o = s.firstChild, i = o.firstChild;
|
|
149
|
+
return c(e, n(U, {
|
|
150
150
|
get logo() {
|
|
151
|
-
return
|
|
151
|
+
return r.logo;
|
|
152
152
|
},
|
|
153
153
|
get actions() {
|
|
154
|
-
return
|
|
154
|
+
return W();
|
|
155
|
+
},
|
|
156
|
+
get class() {
|
|
157
|
+
return r.slotClassNames?.topBar;
|
|
155
158
|
}
|
|
156
|
-
}), s), c(s,
|
|
159
|
+
}), s), c(s, n(u, {
|
|
157
160
|
get when() {
|
|
158
|
-
return !
|
|
161
|
+
return !m();
|
|
159
162
|
},
|
|
160
163
|
get children() {
|
|
161
|
-
return [
|
|
164
|
+
return [n(u, {
|
|
162
165
|
get when() {
|
|
163
|
-
return
|
|
166
|
+
return C().length > 0;
|
|
164
167
|
},
|
|
165
168
|
get children() {
|
|
166
|
-
return
|
|
169
|
+
return n(ee, {
|
|
167
170
|
get items() {
|
|
168
|
-
return
|
|
171
|
+
return C();
|
|
169
172
|
},
|
|
170
173
|
get bottomItems() {
|
|
171
|
-
return
|
|
174
|
+
return r.activityBottomItems;
|
|
172
175
|
},
|
|
173
176
|
get activeId() {
|
|
174
|
-
return
|
|
177
|
+
return l.sidebarActiveTab();
|
|
175
178
|
},
|
|
176
|
-
onActiveChange:
|
|
179
|
+
onActiveChange: M,
|
|
177
180
|
get collapsed() {
|
|
178
|
-
return
|
|
181
|
+
return D();
|
|
179
182
|
},
|
|
180
183
|
get onCollapsedChange() {
|
|
181
|
-
return
|
|
184
|
+
return T(() => !!b())() ? void 0 : l.setSidebarCollapsed;
|
|
185
|
+
},
|
|
186
|
+
get class() {
|
|
187
|
+
return r.slotClassNames?.activityBar;
|
|
182
188
|
}
|
|
183
189
|
});
|
|
184
190
|
}
|
|
185
|
-
}),
|
|
191
|
+
}), n(u, {
|
|
186
192
|
get when() {
|
|
187
|
-
return !
|
|
193
|
+
return !b();
|
|
188
194
|
},
|
|
189
195
|
get children() {
|
|
190
|
-
return
|
|
196
|
+
return n(J, {
|
|
191
197
|
get width() {
|
|
192
|
-
return
|
|
198
|
+
return l.sidebarWidth();
|
|
193
199
|
},
|
|
194
200
|
get collapsed() {
|
|
195
|
-
return
|
|
201
|
+
return l.sidebarCollapsed() || x();
|
|
196
202
|
},
|
|
197
203
|
get resizer() {
|
|
198
|
-
return
|
|
204
|
+
return n(_, {
|
|
199
205
|
direction: "horizontal",
|
|
200
|
-
onResize: (
|
|
206
|
+
onResize: (t) => l.setSidebarWidth(l.sidebarWidth() + t)
|
|
201
207
|
});
|
|
202
208
|
},
|
|
209
|
+
get class() {
|
|
210
|
+
return r.slotClassNames?.sidebar;
|
|
211
|
+
},
|
|
203
212
|
get children() {
|
|
204
|
-
return
|
|
213
|
+
return N(l.sidebarActiveTab());
|
|
205
214
|
}
|
|
206
215
|
});
|
|
207
216
|
}
|
|
208
217
|
})];
|
|
209
218
|
}
|
|
210
|
-
}),
|
|
219
|
+
}), o), c(s, n(u, {
|
|
211
220
|
get when() {
|
|
212
|
-
return
|
|
221
|
+
return T(() => !!(m() && k()))() && !b();
|
|
213
222
|
},
|
|
214
223
|
get children() {
|
|
215
224
|
return [(() => {
|
|
216
|
-
var
|
|
217
|
-
return
|
|
225
|
+
var t = ne();
|
|
226
|
+
return t.$$click = () => h(!1), A(() => f(t, g("absolute inset-0 z-40 bg-black/30 cursor-pointer", r.slotClassNames?.mobileSidebarBackdrop))), t;
|
|
218
227
|
})(), (() => {
|
|
219
|
-
var
|
|
220
|
-
return c(
|
|
228
|
+
var t = le(), d = t.firstChild;
|
|
229
|
+
return c(d, () => N(l.sidebarActiveTab())), A(() => f(t, g("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;
|
|
221
230
|
})()];
|
|
222
231
|
}
|
|
223
|
-
}),
|
|
232
|
+
}), o), c(i, () => r.children), c(o, n(u, {
|
|
224
233
|
get when() {
|
|
225
|
-
return
|
|
234
|
+
return T(() => !!(!m() && l.terminalOpened()))() && r.terminalPanel;
|
|
226
235
|
},
|
|
227
236
|
get children() {
|
|
228
|
-
var
|
|
229
|
-
return c(
|
|
237
|
+
var t = oe();
|
|
238
|
+
return c(t, n(_, {
|
|
230
239
|
direction: "vertical",
|
|
231
|
-
onResize: (
|
|
232
|
-
}), null), c(
|
|
240
|
+
onResize: (d) => l.setTerminalHeight(l.terminalHeight() - d)
|
|
241
|
+
}), null), c(t, () => r.terminalPanel, null), A((d) => {
|
|
242
|
+
var S = g("relative shrink-0 border-t border-border bg-terminal-background overflow-hidden", r.slotClassNames?.terminalPanel), I = `${l.terminalHeight()}px`;
|
|
243
|
+
return S !== d.e && f(t, d.e = S), I !== d.t && E(t, "height", d.t = I), d;
|
|
244
|
+
}, {
|
|
245
|
+
e: void 0,
|
|
246
|
+
t: void 0
|
|
247
|
+
}), t;
|
|
233
248
|
}
|
|
234
|
-
}), null), c(e,
|
|
249
|
+
}), null), c(e, n(u, {
|
|
235
250
|
get when() {
|
|
236
|
-
return !
|
|
251
|
+
return !m();
|
|
237
252
|
},
|
|
238
253
|
get children() {
|
|
239
|
-
return
|
|
254
|
+
return n(Y, {
|
|
255
|
+
get class() {
|
|
256
|
+
return r.slotClassNames?.bottomBar;
|
|
257
|
+
},
|
|
240
258
|
get children() {
|
|
241
259
|
return H();
|
|
242
260
|
}
|
|
243
261
|
});
|
|
244
262
|
}
|
|
245
|
-
}), null), c(e,
|
|
263
|
+
}), null), c(e, n(u, {
|
|
246
264
|
get when() {
|
|
247
|
-
return
|
|
265
|
+
return T(() => !!m())() && C().length > 0;
|
|
248
266
|
},
|
|
249
267
|
get children() {
|
|
250
|
-
return
|
|
268
|
+
return n(Z, {
|
|
251
269
|
get items() {
|
|
252
|
-
return
|
|
270
|
+
return C();
|
|
253
271
|
},
|
|
254
272
|
get activeId() {
|
|
255
|
-
return
|
|
256
|
-
activeId:
|
|
257
|
-
mobileSidebarOpen:
|
|
258
|
-
activeIsFullScreen:
|
|
273
|
+
return te({
|
|
274
|
+
activeId: l.sidebarActiveTab(),
|
|
275
|
+
mobileSidebarOpen: k(),
|
|
276
|
+
activeIsFullScreen: x(),
|
|
259
277
|
activeIsPage: F()
|
|
260
278
|
});
|
|
261
279
|
},
|
|
262
|
-
onSelect:
|
|
280
|
+
onSelect: $,
|
|
281
|
+
get class() {
|
|
282
|
+
return r.slotClassNames?.mobileTabBar;
|
|
283
|
+
}
|
|
263
284
|
});
|
|
264
285
|
}
|
|
265
|
-
}), null),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
286
|
+
}), null), A((t) => {
|
|
287
|
+
var d = g(
|
|
288
|
+
// Use dvh when supported to avoid mobile browser UI causing layout jumps.
|
|
289
|
+
"h-screen h-[100dvh] w-full flex flex-col overflow-hidden",
|
|
290
|
+
"bg-background text-foreground",
|
|
291
|
+
// Prevent overscroll on the shell container
|
|
292
|
+
"overscroll-none",
|
|
293
|
+
r.slotClassNames?.root,
|
|
294
|
+
r.class
|
|
295
|
+
), S = g("flex-1 min-w-0 flex flex-col overflow-hidden", r.slotClassNames?.contentArea), I = g("flex-1 min-h-0 overflow-auto overscroll-contain", r.slotClassNames?.main);
|
|
296
|
+
return d !== t.e && f(e, t.e = d), S !== t.t && f(o, t.t = S), I !== t.a && f(i, t.a = I), t;
|
|
297
|
+
}, {
|
|
298
|
+
e: void 0,
|
|
299
|
+
t: void 0,
|
|
300
|
+
a: void 0
|
|
301
|
+
}), e;
|
|
273
302
|
})();
|
|
274
303
|
}
|
|
275
|
-
|
|
304
|
+
Q(["click"]);
|
|
276
305
|
export {
|
|
277
|
-
|
|
306
|
+
Ae as Shell
|
|
278
307
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { insert as l, effect as
|
|
1
|
+
import { insert as l, effect as c, className as o, setStyleProperty as u, memo as h, template as d, delegateEvents as $ } from "solid-js/web";
|
|
2
2
|
import "solid-js";
|
|
3
3
|
import { cn as s } from "../../utils/cn.js";
|
|
4
|
-
var g = /* @__PURE__ */
|
|
4
|
+
var g = /* @__PURE__ */ d('<aside data-floe-shell-slot=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
8
|
var i = g(), n = i.firstChild;
|
|
9
|
-
return l(n, () => e.children), l(i, () => e.resizer, null),
|
|
9
|
+
return l(n, () => e.children), l(i, () => e.resizer, null), c((r) => {
|
|
10
10
|
var v = 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), f = t() ? "0px" : `${a()}px`, b = t() ? "hidden" : "visible", x = t() ? "0px" : void 0;
|
|
11
11
|
return v !== r.e && o(i, r.e = v), f !== r.t && u(i, "width", r.t = f), b !== r.a && u(i, "visibility", r.a = b), x !== r.o && u(i, "border-right-width", r.o = x), r;
|
|
12
12
|
}, {
|
|
@@ -20,13 +20,13 @@ function j(e) {
|
|
|
20
20
|
function z(e) {
|
|
21
21
|
return (() => {
|
|
22
22
|
var t = m();
|
|
23
|
-
return l(t, () => e.children),
|
|
23
|
+
return l(t, () => e.children), c(() => o(t, s("p-2.5 space-y-3", e.class))), t;
|
|
24
24
|
})();
|
|
25
25
|
}
|
|
26
26
|
function E(e) {
|
|
27
27
|
return (() => {
|
|
28
28
|
var t = m();
|
|
29
|
-
return l(t, () => e.children),
|
|
29
|
+
return l(t, () => e.children), c(() => o(t, s("space-y-0.5", e.class))), t;
|
|
30
30
|
})();
|
|
31
31
|
}
|
|
32
32
|
function L(e) {
|
|
@@ -38,7 +38,7 @@ function L(e) {
|
|
|
38
38
|
var n = w(), r = n.firstChild;
|
|
39
39
|
return l(r, () => e.title), l(n, () => e.actions, null), n;
|
|
40
40
|
})();
|
|
41
|
-
})(), a), l(a, () => e.children),
|
|
41
|
+
})(), a), l(a, () => e.children), c(() => o(t, s("flex flex-col", e.class))), t;
|
|
42
42
|
})();
|
|
43
43
|
}
|
|
44
44
|
function N(e) {
|
|
@@ -50,7 +50,7 @@ function N(e) {
|
|
|
50
50
|
var n = S();
|
|
51
51
|
return l(n, () => e.icon), n;
|
|
52
52
|
})();
|
|
53
|
-
})(), a), l(a, () => e.children),
|
|
53
|
+
})(), a), l(a, () => e.children), c((i) => {
|
|
54
54
|
var n = s("w-full flex items-center gap-2 px-2.5 py-1.5 text-xs cursor-pointer", "transition-colors duration-75", "hover:bg-sidebar-accent/80 hover:text-sidebar-accent-foreground", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring", e.active && "bg-sidebar-accent text-sidebar-accent-foreground font-medium", e.class), r = e.indent ? `${10 + e.indent * 10}px` : void 0;
|
|
55
55
|
return n !== i.e && o(t, i.e = n), r !== i.t && u(t, "padding-left", i.t = r), i;
|
|
56
56
|
}, {
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { insert as t, createComponent as
|
|
1
|
+
import { insert as t, createComponent as d, effect as $, className as g, template as l, delegateEvents as k } from "solid-js/web";
|
|
2
2
|
import { Show as h } from "solid-js";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as p } from "../../utils/cn.js";
|
|
4
4
|
import { useCommand as y } from "../../context/CommandContext.js";
|
|
5
5
|
import { Search as _ } from "../icons/index.js";
|
|
6
6
|
import { useResolvedFloeConfig as w } from "../../context/FloeConfigContext.js";
|
|
7
|
-
var C = /* @__PURE__ */
|
|
8
|
-
function R(
|
|
9
|
-
const c = y(),
|
|
7
|
+
var C = /* @__PURE__ */ l('<span class="font-medium text-xs hidden sm:inline">'), S = /* @__PURE__ */ l('<kbd class="hidden md:inline text-[10px] px-1 py-0.5 rounded bg-background/80 border border-border/50 font-mono shrink-0">'), B = /* @__PURE__ */ l('<header data-floe-shell-slot=top-bar style=border-bottom-color:var(--top-bar-border)><div class="h-10 flex items-center gap-3 px-3"><div class="flex items-center gap-2 flex-shrink-0"></div><button type=button><span class="flex-1 text-left hidden sm:inline truncate"></span></button><div class="flex items-center gap-1">'), E = /* @__PURE__ */ l('<div class="w-6 h-6 rounded bg-primary flex items-center justify-center text-primary-foreground text-xs font-bold">F');
|
|
8
|
+
function R(o) {
|
|
9
|
+
const c = y(), i = w(), n = () => i.config.commands.palette.enabled;
|
|
10
10
|
return (() => {
|
|
11
|
-
var s = B(),
|
|
12
|
-
return t(
|
|
11
|
+
var s = B(), x = s.firstChild, a = x.firstChild, r = a.nextSibling, m = r.firstChild, v = r.nextSibling;
|
|
12
|
+
return t(a, () => o.logo || E(), null), t(a, d(h, {
|
|
13
13
|
get when() {
|
|
14
|
-
return
|
|
14
|
+
return o.title;
|
|
15
15
|
},
|
|
16
16
|
get children() {
|
|
17
17
|
var e = C();
|
|
18
|
-
return t(e, () =>
|
|
18
|
+
return t(e, () => o.title), e;
|
|
19
19
|
}
|
|
20
|
-
}), null), r.$$click = () =>
|
|
20
|
+
}), null), r.$$click = () => n() && c.open(), t(r, d(_, {
|
|
21
21
|
class: "w-3.5 h-3.5 shrink-0"
|
|
22
|
-
}), m), t(m, () =>
|
|
22
|
+
}), m), t(m, () => i.config.strings.topBar.searchPlaceholder), t(r, d(h, {
|
|
23
23
|
get when() {
|
|
24
|
-
return
|
|
24
|
+
return n();
|
|
25
25
|
},
|
|
26
26
|
get children() {
|
|
27
27
|
var e = S();
|
|
28
|
-
return t(e, () => c.getKeybindDisplay(
|
|
28
|
+
return t(e, () => c.getKeybindDisplay(i.config.commands.palette.keybind)), e;
|
|
29
29
|
}
|
|
30
|
-
}), null), t(v, () =>
|
|
31
|
-
var f =
|
|
30
|
+
}), null), t(v, () => o.actions), $((e) => {
|
|
31
|
+
var f = p(
|
|
32
32
|
// Safe-area padding must not be applied on a fixed-height element (border-box),
|
|
33
33
|
// otherwise the content gets squeezed on iOS notch devices.
|
|
34
34
|
"shrink-0 bg-background border-b border-border safe-top safe-left safe-right",
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
-
return f !== e.e && g(s, e.e = f),
|
|
35
|
+
o.class
|
|
36
|
+
), b = !n(), u = p("flex-1 max-w-sm flex items-center gap-2 h-7 px-2.5", n() ? "cursor-pointer" : "cursor-not-allowed", "text-xs text-muted-foreground", "bg-muted/40 hover:bg-muted/70 rounded", "border border-transparent hover:border-border/50", "transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", !n() && "opacity-60 hover:bg-muted/40");
|
|
37
|
+
return f !== e.e && g(s, e.e = f), b !== e.t && (r.disabled = e.t = b), u !== e.a && g(r, e.a = u), e;
|
|
38
38
|
}, {
|
|
39
39
|
e: void 0,
|
|
40
40
|
t: void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Shell, type ShellProps } from './Shell';
|
|
1
|
+
export { Shell, type ShellProps, type ShellSlotClassNames } from './Shell';
|
|
2
2
|
export { ActivityBar, type ActivityBarItem, type ActivityBarProps } from './ActivityBar';
|
|
3
3
|
export { Sidebar, SidebarContent, SidebarItemList, SidebarSection, SidebarItem, type SidebarProps, type SidebarContentProps, type SidebarItemListProps, type SidebarSectionProps, type SidebarItemProps, } from './Sidebar';
|
|
4
4
|
export { TopBar, type TopBarProps } from './TopBar';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
+
import type { FloeThemeTokenOverrides, ThemeType } from '../styles/themes';
|
|
2
3
|
export interface FloeStorageAdapter {
|
|
3
4
|
getItem: (key: string) => string | null;
|
|
4
5
|
setItem: (key: string, value: string) => void;
|
|
@@ -71,7 +72,13 @@ export interface FloeLayoutConfig {
|
|
|
71
72
|
}
|
|
72
73
|
export interface FloeThemeConfig {
|
|
73
74
|
storageKey: string;
|
|
74
|
-
defaultTheme:
|
|
75
|
+
defaultTheme: ThemeType;
|
|
76
|
+
/**
|
|
77
|
+
* Optional CSS variable overrides applied at the document root.
|
|
78
|
+
* `shared` applies to both themes, while `light` / `dark` only apply
|
|
79
|
+
* when that resolved theme is active.
|
|
80
|
+
*/
|
|
81
|
+
tokens?: FloeThemeTokenOverrides;
|
|
75
82
|
}
|
|
76
83
|
export interface FloeDeckConfig {
|
|
77
84
|
storageKey: string;
|