@floegence/floe-webapp-core 0.26.1 → 0.26.2
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/Shell.js +69 -65
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as Q, createEffect as v, createMemo as
|
|
1
|
+
import { createComponent as r, Dynamic as S, insert as c, memo as C, effect as T, className as M, setStyleProperty as E, template as h, delegateEvents as N } from "solid-js/web";
|
|
2
|
+
import { createSignal as Q, createEffect as v, createMemo as f, For as $, Show as m } from "solid-js";
|
|
3
3
|
import { useLayout as D } from "../../context/LayoutContext.js";
|
|
4
4
|
import { useResolvedFloeConfig as K } from "../../context/FloeConfigContext.js";
|
|
5
5
|
import { useMediaQuery as L } from "../../hooks/useMediaQuery.js";
|
|
@@ -17,35 +17,35 @@ import { resolveMobileTabActiveId as Z, resolveMobileTabSelect as ee } from "./m
|
|
|
17
17
|
import { KeepAliveStack as te } from "./KeepAliveStack.js";
|
|
18
18
|
var k = /* @__PURE__ */ h('<div class="flex items-center gap-2">'), re = /* @__PURE__ */ h('<div class="absolute inset-0 z-40 bg-black/30 cursor-pointer">'), ie = /* @__PURE__ */ h('<div><div class="h-full overflow-auto overscroll-contain">'), ne = /* @__PURE__ */ h('<div class="relative shrink-0 border-t border-border bg-terminal-background overflow-hidden">'), oe = /* @__PURE__ */ h('<div><div class="flex-1 min-h-0 flex overflow-hidden relative"><div class="flex-1 min-w-0 flex flex-col overflow-hidden"><main class="flex-1 min-h-0 overflow-auto overscroll-contain">');
|
|
19
19
|
function Be(o) {
|
|
20
|
-
const
|
|
20
|
+
const i = D(), O = K(), d = L(O.config.layout.mobileQuery), [I, b] = Q(!1), u = () => o.sidebarMode === "hidden", a = (() => {
|
|
21
21
|
try {
|
|
22
22
|
return j();
|
|
23
23
|
} catch {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
})(), w = (e, s) => {
|
|
27
|
-
const l = a?.getComponent(e)?.sidebar?.fullScreen ?? !1,
|
|
28
|
-
|
|
29
|
-
openSidebar:
|
|
27
|
+
const l = a?.getComponent(e)?.sidebar?.fullScreen ?? !1, t = u() ? !1 : s?.openSidebar ?? !l;
|
|
28
|
+
i.setSidebarActiveTab(e, {
|
|
29
|
+
openSidebar: t
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
v(() => {
|
|
33
|
-
u() &&
|
|
33
|
+
u() && b(!1);
|
|
34
34
|
}), v(() => {
|
|
35
35
|
const e = d();
|
|
36
|
-
|
|
36
|
+
i.isMobile() !== e && i.setIsMobile(e);
|
|
37
37
|
}), v(() => {
|
|
38
|
-
d() ||
|
|
38
|
+
d() || b(!1);
|
|
39
39
|
});
|
|
40
|
-
const g =
|
|
40
|
+
const g = f(() => o.activityItems ? o.activityItems : a ? a.sidebarItems().filter((e) => !!e.icon).filter((e) => !(d() && 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?.fullScreen ? "preserve" : "toggle"
|
|
46
|
-
})) : []), z =
|
|
46
|
+
})) : []), z = f(() => u() ? [] : o.sidebarContent ? [] : a ? a.sidebarItems().filter((e) => !(d() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
|
|
47
47
|
id: e.id,
|
|
48
|
-
render: () =>
|
|
48
|
+
render: () => r(S, {
|
|
49
49
|
get component() {
|
|
50
50
|
return e.component;
|
|
51
51
|
}
|
|
@@ -54,112 +54,116 @@ function Be(o) {
|
|
|
54
54
|
if (!u()) {
|
|
55
55
|
if (o.sidebarContent) return o.sidebarContent(e);
|
|
56
56
|
if (a)
|
|
57
|
-
return
|
|
57
|
+
return r(te, {
|
|
58
58
|
get views() {
|
|
59
59
|
return z();
|
|
60
60
|
},
|
|
61
61
|
activeId: e
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
}, B =
|
|
64
|
+
}, B = f(() => u() ? !0 : a ? a.getComponent(i.sidebarActiveTab())?.sidebar?.fullScreen ?? !1 : !1), F = f(() => {
|
|
65
65
|
if (u()) return !0;
|
|
66
66
|
if (!a) return !1;
|
|
67
|
-
const e = a.getComponent(
|
|
67
|
+
const e = a.getComponent(i.sidebarActiveTab());
|
|
68
68
|
return e?.sidebar ? e.sidebar.fullScreen === !0 || e.sidebar.renderIn === "main" : !1;
|
|
69
69
|
});
|
|
70
70
|
v(() => {
|
|
71
|
-
d() && B() &&
|
|
71
|
+
d() && B() && b(!1);
|
|
72
72
|
});
|
|
73
|
-
const H =
|
|
73
|
+
const H = f(() => {
|
|
74
74
|
if (o.bottomBarItems) return o.bottomBarItems;
|
|
75
75
|
if (!a) return;
|
|
76
|
-
const e = [...a.statusBarItems()].sort((
|
|
76
|
+
const e = [...a.statusBarItems()].sort((t, n) => (t.order ?? 100) - (n.order ?? 100)), s = e.filter((t) => t.position === "left"), l = e.filter((t) => t.position === "right");
|
|
77
77
|
return [(() => {
|
|
78
|
-
var
|
|
79
|
-
return c(
|
|
78
|
+
var t = k();
|
|
79
|
+
return c(t, r($, {
|
|
80
80
|
each: s,
|
|
81
|
-
children: (n) =>
|
|
81
|
+
children: (n) => r(S, {
|
|
82
82
|
get component() {
|
|
83
83
|
return n.component;
|
|
84
84
|
}
|
|
85
85
|
})
|
|
86
|
-
})),
|
|
86
|
+
})), t;
|
|
87
87
|
})(), (() => {
|
|
88
|
-
var
|
|
89
|
-
return c(
|
|
88
|
+
var t = k();
|
|
89
|
+
return c(t, r($, {
|
|
90
90
|
each: l,
|
|
91
|
-
children: (n) =>
|
|
91
|
+
children: (n) => r(S, {
|
|
92
92
|
get component() {
|
|
93
93
|
return n.component;
|
|
94
94
|
}
|
|
95
95
|
})
|
|
96
|
-
})),
|
|
96
|
+
})), t;
|
|
97
97
|
})()];
|
|
98
98
|
});
|
|
99
99
|
v(() => {
|
|
100
100
|
const e = g();
|
|
101
101
|
if (!e.length) return;
|
|
102
|
-
|
|
102
|
+
if (!i.sidebarActiveTab()) {
|
|
103
|
+
const l = e.find((t) => !t.onClick);
|
|
104
|
+
if (!l) return;
|
|
105
|
+
w(l.id);
|
|
106
|
+
}
|
|
103
107
|
});
|
|
104
108
|
const A = (e) => {
|
|
105
109
|
const s = u() ? !0 : a?.getComponent(e)?.sidebar?.fullScreen ?? !1, {
|
|
106
110
|
nextActiveId: l,
|
|
107
|
-
nextMobileSidebarOpen:
|
|
111
|
+
nextMobileSidebarOpen: t
|
|
108
112
|
} = ee({
|
|
109
113
|
clickedId: e,
|
|
110
|
-
activeId:
|
|
114
|
+
activeId: i.sidebarActiveTab(),
|
|
111
115
|
mobileSidebarOpen: I(),
|
|
112
116
|
clickedIsFullScreen: s
|
|
113
117
|
});
|
|
114
|
-
|
|
118
|
+
i.sidebarActiveTab() !== l && w(l), b(t);
|
|
115
119
|
}, P = (e) => {
|
|
116
120
|
if (e.onClick) {
|
|
117
121
|
V(() => e.onClick());
|
|
118
122
|
return;
|
|
119
123
|
}
|
|
120
124
|
A(e.id);
|
|
121
|
-
}, R =
|
|
125
|
+
}, R = f(() => {
|
|
122
126
|
const e = o.topBarActions;
|
|
123
127
|
if (!d() || (o.activityBottomItemsMobileMode ?? "hidden") !== "topBar") return e;
|
|
124
128
|
const l = o.activityBottomItems ?? [];
|
|
125
|
-
return l.length ? [
|
|
129
|
+
return l.length ? [r($, {
|
|
126
130
|
each: l,
|
|
127
|
-
children: (
|
|
131
|
+
children: (t) => r(J, {
|
|
128
132
|
get label() {
|
|
129
|
-
return
|
|
133
|
+
return t.label;
|
|
130
134
|
},
|
|
131
|
-
onClick: () => P(
|
|
135
|
+
onClick: () => P(t),
|
|
132
136
|
get children() {
|
|
133
|
-
return
|
|
137
|
+
return r(S, {
|
|
134
138
|
get component() {
|
|
135
|
-
return
|
|
139
|
+
return t.icon;
|
|
136
140
|
},
|
|
137
141
|
class: "w-4 h-4"
|
|
138
142
|
});
|
|
139
143
|
}
|
|
140
144
|
})
|
|
141
145
|
}), e] : e;
|
|
142
|
-
}), W = () => u() ? !0 :
|
|
146
|
+
}), W = () => u() ? !0 : i.sidebarCollapsed();
|
|
143
147
|
return (() => {
|
|
144
|
-
var e = oe(), s = e.firstChild, l = s.firstChild,
|
|
145
|
-
return c(e,
|
|
148
|
+
var e = oe(), s = e.firstChild, l = s.firstChild, t = l.firstChild;
|
|
149
|
+
return c(e, r(G, {
|
|
146
150
|
get logo() {
|
|
147
151
|
return o.logo;
|
|
148
152
|
},
|
|
149
153
|
get actions() {
|
|
150
154
|
return R();
|
|
151
155
|
}
|
|
152
|
-
}), s), c(s,
|
|
156
|
+
}), s), c(s, r(m, {
|
|
153
157
|
get when() {
|
|
154
158
|
return !d();
|
|
155
159
|
},
|
|
156
160
|
get children() {
|
|
157
|
-
return [
|
|
161
|
+
return [r(m, {
|
|
158
162
|
get when() {
|
|
159
163
|
return g().length > 0;
|
|
160
164
|
},
|
|
161
165
|
get children() {
|
|
162
|
-
return
|
|
166
|
+
return r(Y, {
|
|
163
167
|
get items() {
|
|
164
168
|
return g();
|
|
165
169
|
},
|
|
@@ -167,89 +171,89 @@ function Be(o) {
|
|
|
167
171
|
return o.activityBottomItems;
|
|
168
172
|
},
|
|
169
173
|
get activeId() {
|
|
170
|
-
return
|
|
174
|
+
return i.sidebarActiveTab();
|
|
171
175
|
},
|
|
172
176
|
onActiveChange: w,
|
|
173
177
|
get collapsed() {
|
|
174
178
|
return W();
|
|
175
179
|
},
|
|
176
180
|
get onCollapsedChange() {
|
|
177
|
-
return C(() => !!u())() ? void 0 :
|
|
181
|
+
return C(() => !!u())() ? void 0 : i.setSidebarCollapsed;
|
|
178
182
|
}
|
|
179
183
|
});
|
|
180
184
|
}
|
|
181
|
-
}),
|
|
185
|
+
}), r(m, {
|
|
182
186
|
get when() {
|
|
183
187
|
return !u();
|
|
184
188
|
},
|
|
185
189
|
get children() {
|
|
186
|
-
return
|
|
190
|
+
return r(q, {
|
|
187
191
|
get width() {
|
|
188
|
-
return
|
|
192
|
+
return i.sidebarWidth();
|
|
189
193
|
},
|
|
190
194
|
get collapsed() {
|
|
191
|
-
return
|
|
195
|
+
return i.sidebarCollapsed() || B();
|
|
192
196
|
},
|
|
193
197
|
get resizer() {
|
|
194
|
-
return
|
|
198
|
+
return r(_, {
|
|
195
199
|
direction: "horizontal",
|
|
196
|
-
onResize: (n) =>
|
|
200
|
+
onResize: (n) => i.setSidebarWidth(i.sidebarWidth() + n)
|
|
197
201
|
});
|
|
198
202
|
},
|
|
199
203
|
get children() {
|
|
200
|
-
return y(
|
|
204
|
+
return y(i.sidebarActiveTab());
|
|
201
205
|
}
|
|
202
206
|
});
|
|
203
207
|
}
|
|
204
208
|
})];
|
|
205
209
|
}
|
|
206
|
-
}), l), c(s,
|
|
210
|
+
}), l), c(s, r(m, {
|
|
207
211
|
get when() {
|
|
208
212
|
return C(() => !!(d() && I()))() && !u();
|
|
209
213
|
},
|
|
210
214
|
get children() {
|
|
211
215
|
return [(() => {
|
|
212
216
|
var n = re();
|
|
213
|
-
return n.$$click = () =>
|
|
217
|
+
return n.$$click = () => b(!1), n;
|
|
214
218
|
})(), (() => {
|
|
215
219
|
var n = ie(), p = n.firstChild;
|
|
216
|
-
return c(p, () => y(
|
|
220
|
+
return c(p, () => y(i.sidebarActiveTab())), T(() => M(n, x("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"))), n;
|
|
217
221
|
})()];
|
|
218
222
|
}
|
|
219
|
-
}), l), c(
|
|
223
|
+
}), l), c(t, () => o.children), c(l, r(m, {
|
|
220
224
|
get when() {
|
|
221
|
-
return C(() => !!(!d() &&
|
|
225
|
+
return C(() => !!(!d() && i.terminalOpened()))() && o.terminalPanel;
|
|
222
226
|
},
|
|
223
227
|
get children() {
|
|
224
228
|
var n = ne();
|
|
225
|
-
return c(n,
|
|
229
|
+
return c(n, r(_, {
|
|
226
230
|
direction: "vertical",
|
|
227
|
-
onResize: (p) =>
|
|
228
|
-
}), null), c(n, () => o.terminalPanel, null), T((p) => E(n, "height", `${
|
|
231
|
+
onResize: (p) => i.setTerminalHeight(i.terminalHeight() - p)
|
|
232
|
+
}), null), c(n, () => o.terminalPanel, null), T((p) => E(n, "height", `${i.terminalHeight()}px`)), n;
|
|
229
233
|
}
|
|
230
|
-
}), null), c(e,
|
|
234
|
+
}), null), c(e, r(m, {
|
|
231
235
|
get when() {
|
|
232
236
|
return !d();
|
|
233
237
|
},
|
|
234
238
|
get children() {
|
|
235
|
-
return
|
|
239
|
+
return r(U, {
|
|
236
240
|
get children() {
|
|
237
241
|
return H();
|
|
238
242
|
}
|
|
239
243
|
});
|
|
240
244
|
}
|
|
241
|
-
}), null), c(e,
|
|
245
|
+
}), null), c(e, r(m, {
|
|
242
246
|
get when() {
|
|
243
247
|
return C(() => !!d())() && g().length > 0;
|
|
244
248
|
},
|
|
245
249
|
get children() {
|
|
246
|
-
return
|
|
250
|
+
return r(X, {
|
|
247
251
|
get items() {
|
|
248
252
|
return g();
|
|
249
253
|
},
|
|
250
254
|
get activeId() {
|
|
251
255
|
return Z({
|
|
252
|
-
activeId:
|
|
256
|
+
activeId: i.sidebarActiveTab(),
|
|
253
257
|
mobileSidebarOpen: I(),
|
|
254
258
|
activeIsFullScreen: B(),
|
|
255
259
|
activeIsPage: F()
|