@floegence/floe-webapp-core 0.36.76 → 0.37.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.
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
2
|
import { type ActivityBarItem } from './ActivityBar';
|
|
3
3
|
import type { SidebarVisibilityMotion } from '../../context/LayoutContext';
|
|
4
|
+
import { type UIFirstSelectionEvent } from '../../utils/uiFirstSelection';
|
|
5
|
+
export type ActivitySelectionMetadata = {
|
|
6
|
+
source: 'activity-bar' | 'mobile-tab-bar';
|
|
7
|
+
opts?: {
|
|
8
|
+
openSidebar?: boolean;
|
|
9
|
+
};
|
|
10
|
+
mobileSidebarOpen?: boolean;
|
|
11
|
+
};
|
|
4
12
|
export interface ShellSlotClassNames {
|
|
5
13
|
root?: string;
|
|
6
14
|
topBar?: string;
|
|
@@ -36,6 +44,7 @@ export interface ShellProps {
|
|
|
36
44
|
sidebarContent?: (activeTab: string) => JSX.Element;
|
|
37
45
|
/** Defer user-requested Activity content commits until the selected control has painted. */
|
|
38
46
|
activitySelectionMode?: 'sync' | 'ui-first';
|
|
47
|
+
onActivitySelectionEvent?: (event: UIFirstSelectionEvent<string, ActivitySelectionMetadata>) => void;
|
|
39
48
|
resolveSidebarVisibilityMotion?: (args: {
|
|
40
49
|
currentActiveId: string;
|
|
41
50
|
nextActiveId: string;
|
|
@@ -20,7 +20,7 @@ import { resolveShellSidebarActiveTabChange as ke } from "./sidebarVisibilityMot
|
|
|
20
20
|
import { createUIFirstSelection as xe } from "../../utils/uiFirstSelection.js";
|
|
21
21
|
var U = /* @__PURE__ */ k('<div class="flex items-center gap-2">'), Te = /* @__PURE__ */ k("<div data-floe-shell-slot=mobile-sidebar-backdrop>"), pe = /* @__PURE__ */ k('<div data-floe-shell-slot=mobile-sidebar-drawer tabindex=-1 role=dialog aria-modal=true><div class="h-full overflow-auto overscroll-contain">'), Ne = /* @__PURE__ */ k("<div data-floe-shell-slot=terminal-panel style=border-top-color:var(--terminal-panel-border)>"), Le = /* @__PURE__ */ k('<div data-floe-shell><a></a><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 tabindex=-1>');
|
|
22
22
|
function Ye(r) {
|
|
23
|
-
const i = ce(), H = be(), d = ue(H.config.layout.mobileQuery), [x, h] = Q(!1), [
|
|
23
|
+
const i = ce(), H = be(), d = ue(H.config.layout.mobileQuery), [x, h] = Q(!1), [E, R] = Q(null);
|
|
24
24
|
let F;
|
|
25
25
|
const b = () => r.sidebarMode === "hidden", s = (() => {
|
|
26
26
|
try {
|
|
@@ -51,10 +51,12 @@ function Ye(r) {
|
|
|
51
51
|
de(() => {
|
|
52
52
|
T(e, o?.opts), typeof o?.mobileSidebarOpen == "boolean" && h(o.mobileSidebarOpen);
|
|
53
53
|
});
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
|
+
onEvent: (e) => r.onActivitySelectionEvent?.(e)
|
|
55
56
|
}), N = () => r.activitySelectionMode === "ui-first" ? p.visual() : i.sidebarActiveTab(), j = (e, o) => {
|
|
56
57
|
if (r.activitySelectionMode === "ui-first") {
|
|
57
58
|
p.request(e, {
|
|
59
|
+
source: "activity-bar",
|
|
58
60
|
opts: o
|
|
59
61
|
});
|
|
60
62
|
return;
|
|
@@ -85,7 +87,7 @@ function Ye(r) {
|
|
|
85
87
|
return e.component;
|
|
86
88
|
}
|
|
87
89
|
})
|
|
88
|
-
})) : []),
|
|
90
|
+
})) : []), V = (e) => {
|
|
89
91
|
if (!b()) {
|
|
90
92
|
if (r.sidebarContent) return r.sidebarContent(e);
|
|
91
93
|
if (s)
|
|
@@ -153,6 +155,7 @@ function Ye(r) {
|
|
|
153
155
|
if (i.sidebarActiveTab() !== l) {
|
|
154
156
|
if (r.activitySelectionMode === "ui-first") {
|
|
155
157
|
p.request(l, {
|
|
158
|
+
source: "mobile-tab-bar",
|
|
156
159
|
mobileSidebarOpen: n
|
|
157
160
|
});
|
|
158
161
|
return;
|
|
@@ -187,12 +190,12 @@ function Ye(r) {
|
|
|
187
190
|
}
|
|
188
191
|
})
|
|
189
192
|
}), e] : e;
|
|
190
|
-
}), ee = () => b() ? !0 : i.sidebarCollapsed(), te = () =>
|
|
193
|
+
}), ee = () => b() ? !0 : i.sidebarCollapsed(), te = () => E() ?? i.sidebarWidth(), v = () => H.config.accessibility, re = () => {
|
|
191
194
|
R(i.sidebarWidth());
|
|
192
195
|
}, ie = (e) => {
|
|
193
196
|
R((o) => i.clampSidebarWidth((o ?? i.sidebarWidth()) + e));
|
|
194
197
|
}, ne = () => {
|
|
195
|
-
const e =
|
|
198
|
+
const e = E();
|
|
196
199
|
e !== null && (i.setSidebarWidth(e), R(null));
|
|
197
200
|
};
|
|
198
201
|
me({
|
|
@@ -297,7 +300,7 @@ function Ye(r) {
|
|
|
297
300
|
return r.slotClassNames?.sidebar;
|
|
298
301
|
},
|
|
299
302
|
get children() {
|
|
300
|
-
return
|
|
303
|
+
return V(i.sidebarActiveTab());
|
|
301
304
|
}
|
|
302
305
|
});
|
|
303
306
|
}
|
|
@@ -313,7 +316,7 @@ function Ye(r) {
|
|
|
313
316
|
return t.$$click = () => h(!1), z(() => S(t, C("absolute inset-0 z-40 bg-black/30 cursor-pointer", r.slotClassNames?.mobileSidebarBackdrop))), t;
|
|
314
317
|
})(), (() => {
|
|
315
318
|
var t = pe(), m = t.firstChild, g = F;
|
|
316
|
-
return typeof g == "function" ? le(g, t) : F = t, c(m, () =>
|
|
319
|
+
return typeof g == "function" ? le(g, t) : F = t, c(m, () => V(i.sidebarActiveTab())), z((f) => {
|
|
317
320
|
var B = C("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), A = v().sidebarLabel;
|
|
318
321
|
return B !== f.e && S(t, f.e = B), A !== f.t && $(t, "aria-label", f.t = A), f;
|
|
319
322
|
}, {
|