@floegence/floe-webapp-core 0.35.32 → 0.35.34
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/file-browser/DirectoryTree.js +84 -86
- package/dist/components/file-browser/FileContextMenu.d.ts +2 -2
- package/dist/components/file-browser/FileContextMenu.js +300 -142
- package/dist/components/file-browser/FileGridView.js +50 -45
- package/dist/components/file-browser/FileIcons.d.ts +10 -2
- package/dist/components/file-browser/FileIcons.js +289 -181
- package/dist/components/file-browser/FileListView.js +99 -94
- package/dist/components/file-browser/contextMenuEvent.d.ts +10 -0
- package/dist/components/file-browser/contextMenuEvent.js +19 -0
- package/dist/components/file-browser/index.d.ts +2 -2
- package/dist/components/file-browser/longPressContextMenu.d.ts +1 -0
- package/dist/components/file-browser/longPressContextMenu.js +45 -32
- package/dist/components/file-browser/types.d.ts +23 -1
- package/dist/components/layout/Shell.d.ts +8 -0
- package/dist/components/layout/Shell.js +157 -138
- package/dist/components/layout/Sidebar.d.ts +2 -0
- package/dist/components/layout/Sidebar.js +39 -38
- package/dist/components/layout/sidebarVisibilityMotion.d.ts +22 -0
- package/dist/components/layout/sidebarVisibilityMotion.js +16 -0
- package/dist/components/ui/Dropdown.d.ts +0 -1
- package/dist/components/ui/Dropdown.js +150 -204
- package/dist/components/ui/menuUtils.d.ts +15 -0
- package/dist/components/ui/menuUtils.js +60 -0
- package/dist/components/ui/picker/PickerBase.js +90 -96
- package/dist/context/LayoutContext.d.ts +5 -0
- package/dist/context/LayoutContext.js +58 -46
- package/dist/file-browser.js +35 -31
- package/dist/full.js +411 -407
- package/package.json +1 -1
|
@@ -2,6 +2,12 @@ import type { JSX, Accessor, Component } from 'solid-js';
|
|
|
2
2
|
export type FileItemIconOverride = Component<{
|
|
3
3
|
class?: string;
|
|
4
4
|
}> | JSX.Element;
|
|
5
|
+
export type FileItemLinkKind = 'symbolic';
|
|
6
|
+
export type FileItemLinkTargetType = 'file' | 'folder' | 'broken' | 'unknown';
|
|
7
|
+
export interface FileItemLinkMeta {
|
|
8
|
+
kind: FileItemLinkKind;
|
|
9
|
+
targetType: FileItemLinkTargetType;
|
|
10
|
+
}
|
|
5
11
|
/**
|
|
6
12
|
* Represents a file or folder item in the browser
|
|
7
13
|
*/
|
|
@@ -15,6 +21,8 @@ export interface FileItem {
|
|
|
15
21
|
extension?: string;
|
|
16
22
|
children?: FileItem[];
|
|
17
23
|
icon?: FileItemIconOverride;
|
|
24
|
+
/** Optional link metadata for rendering symbolic links distinctly from plain entries. */
|
|
25
|
+
link?: FileItemLinkMeta;
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
20
28
|
* View mode for the file browser main content area
|
|
@@ -42,6 +50,12 @@ export interface FileListColumnRatios {
|
|
|
42
50
|
* Built-in context menu action types
|
|
43
51
|
*/
|
|
44
52
|
export type ContextMenuActionType = 'duplicate' | 'copy-name' | 'ask-agent' | 'copy-to' | 'move-to' | 'delete' | 'rename' | 'custom';
|
|
53
|
+
export type ContextMenuTargetKind = 'item' | 'directory-background';
|
|
54
|
+
export type ContextMenuSource = 'list' | 'grid' | 'tree' | 'background' | 'custom';
|
|
55
|
+
export interface ContextMenuDirectory {
|
|
56
|
+
path: string;
|
|
57
|
+
item?: FileItem;
|
|
58
|
+
}
|
|
45
59
|
/**
|
|
46
60
|
* Context menu item definition
|
|
47
61
|
*/
|
|
@@ -63,7 +77,9 @@ export interface ContextMenuItem {
|
|
|
63
77
|
/** Keyboard shortcut hint (display only) */
|
|
64
78
|
shortcut?: string;
|
|
65
79
|
/** Custom handler for 'custom' type actions */
|
|
66
|
-
onAction?: (items: FileItem[]) => void;
|
|
80
|
+
onAction?: (items: FileItem[], event?: ContextMenuEvent) => void;
|
|
81
|
+
/** Cascade submenu items */
|
|
82
|
+
children?: ContextMenuItem[];
|
|
67
83
|
}
|
|
68
84
|
/**
|
|
69
85
|
* Context menu event with position and target items
|
|
@@ -75,6 +91,12 @@ export interface ContextMenuEvent {
|
|
|
75
91
|
y: number;
|
|
76
92
|
/** Target file/folder items */
|
|
77
93
|
items: FileItem[];
|
|
94
|
+
/** Semantic menu target category */
|
|
95
|
+
targetKind: ContextMenuTargetKind;
|
|
96
|
+
/** Source surface that opened the menu */
|
|
97
|
+
source: ContextMenuSource;
|
|
98
|
+
/** Resolved directory scope for directory-scoped actions */
|
|
99
|
+
directory: ContextMenuDirectory | null;
|
|
78
100
|
}
|
|
79
101
|
/**
|
|
80
102
|
* Callbacks for context menu actions
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
2
|
import { type ActivityBarItem } from './ActivityBar';
|
|
3
|
+
import type { SidebarVisibilityMotion } from '../../context/LayoutContext';
|
|
3
4
|
export interface ShellSlotClassNames {
|
|
4
5
|
root?: string;
|
|
5
6
|
topBar?: string;
|
|
@@ -31,6 +32,13 @@ export interface ShellProps {
|
|
|
31
32
|
topBarActions?: JSX.Element;
|
|
32
33
|
bottomBarItems?: JSX.Element;
|
|
33
34
|
sidebarContent?: (activeTab: string) => JSX.Element;
|
|
35
|
+
resolveSidebarVisibilityMotion?: (args: {
|
|
36
|
+
currentActiveId: string;
|
|
37
|
+
nextActiveId: string;
|
|
38
|
+
openSidebar: boolean;
|
|
39
|
+
source: 'activity-bar';
|
|
40
|
+
isMobile: boolean;
|
|
41
|
+
}) => SidebarVisibilityMotion | undefined;
|
|
34
42
|
/**
|
|
35
43
|
* Sidebar rendering mode.
|
|
36
44
|
*
|
|
@@ -1,161 +1,177 @@
|
|
|
1
|
-
import { createComponent as o, Dynamic as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { createComponent as o, Dynamic as T, insert as c, memo as p, effect as N, className as h, setAttribute as L, setStyleProperty as ie, template as x, use as ne, delegateEvents as oe } from "solid-js/web";
|
|
2
|
+
import { createSignal as D, createEffect as I, createMemo as w, For as P, Show as S } from "solid-js";
|
|
3
3
|
import { useLayout as ae } from "../../context/LayoutContext.js";
|
|
4
4
|
import { useResolvedFloeConfig as le } from "../../context/FloeConfigContext.js";
|
|
5
5
|
import { useMediaQuery as se } from "../../hooks/useMediaQuery.js";
|
|
6
6
|
import { useOverlayMask as de } from "../../hooks/useOverlayMask.js";
|
|
7
|
-
import { cn as
|
|
8
|
-
import {
|
|
7
|
+
import { cn as C } from "../../utils/cn.js";
|
|
8
|
+
import { deferAfterPaint as ce, deferNonBlocking as be } from "../../utils/defer.js";
|
|
9
9
|
import { useComponentRegistry as ue } from "../../context/ComponentRegistry.js";
|
|
10
|
-
import { Sidebar as
|
|
11
|
-
import { TopBar as
|
|
12
|
-
import { TopBarIconButton as
|
|
13
|
-
import { BottomBar as
|
|
14
|
-
import { MobileTabBar as
|
|
15
|
-
import { ActivityBar as
|
|
16
|
-
import { ResizeHandle as
|
|
17
|
-
import { resolveMobileTabActiveId as Ce, resolveMobileTabSelect as
|
|
18
|
-
import { KeepAliveStack as
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
import { Sidebar as me } from "./Sidebar.js";
|
|
11
|
+
import { TopBar as fe } from "./TopBar.js";
|
|
12
|
+
import { TopBarIconButton as ve } from "./TopBarIconButton.js";
|
|
13
|
+
import { BottomBar as ge } from "./BottomBar.js";
|
|
14
|
+
import { MobileTabBar as he } from "./MobileTabBar.js";
|
|
15
|
+
import { ActivityBar as Se } from "./ActivityBar.js";
|
|
16
|
+
import { ResizeHandle as Q } from "./ResizeHandle.js";
|
|
17
|
+
import { resolveMobileTabActiveId as Ce, resolveMobileTabSelect as ye } from "./mobileTabs.js";
|
|
18
|
+
import { KeepAliveStack as Ie } from "./KeepAliveStack.js";
|
|
19
|
+
import { resolveShellSidebarActiveTabChange as we } from "./sidebarVisibilityMotion.js";
|
|
20
|
+
var q = /* @__PURE__ */ x('<div class="flex items-center gap-2">'), Me = /* @__PURE__ */ x("<div data-floe-shell-slot=mobile-sidebar-backdrop>"), Be = /* @__PURE__ */ x('<div data-floe-shell-slot=mobile-sidebar-drawer tabindex=-1 role=dialog aria-modal=true><div class="h-full overflow-auto overscroll-contain">'), ke = /* @__PURE__ */ x("<div data-floe-shell-slot=terminal-panel style=border-top-color:var(--terminal-panel-border)>"), xe = /* @__PURE__ */ x('<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>');
|
|
21
|
+
function Ke(r) {
|
|
22
|
+
const i = ae(), W = le(), s = se(W.config.layout.mobileQuery), [A, y] = D(!1), [F, z] = D(null);
|
|
22
23
|
let $;
|
|
23
|
-
const
|
|
24
|
+
const b = () => r.sidebarMode === "hidden", d = (() => {
|
|
24
25
|
try {
|
|
25
26
|
return ue();
|
|
26
27
|
} catch {
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
29
|
-
})(), O = (e,
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
})(), O = (e, a) => {
|
|
31
|
+
const l = d?.getComponent(e)?.sidebar?.fullScreen ?? !1, {
|
|
32
|
+
openSidebar: n,
|
|
33
|
+
visibilityMotion: u
|
|
34
|
+
} = we({
|
|
35
|
+
currentActiveId: i.sidebarActiveTab(),
|
|
36
|
+
nextActiveId: e,
|
|
37
|
+
requestedOpenSidebar: a?.openSidebar,
|
|
38
|
+
sidebarHidden: b(),
|
|
39
|
+
nextActiveFullScreen: l,
|
|
40
|
+
isMobile: s(),
|
|
41
|
+
resolveSidebarVisibilityMotion: r.resolveSidebarVisibilityMotion
|
|
42
|
+
});
|
|
43
|
+
i.setSidebarActiveTab(e, {
|
|
44
|
+
openSidebar: n,
|
|
45
|
+
visibilityMotion: u
|
|
33
46
|
});
|
|
34
47
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}),
|
|
38
|
-
const e =
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
|
|
48
|
+
I(() => {
|
|
49
|
+
b() && y(!1);
|
|
50
|
+
}), I(() => {
|
|
51
|
+
const e = s();
|
|
52
|
+
i.isMobile() !== e && i.setIsMobile(e);
|
|
53
|
+
}), I(() => {
|
|
54
|
+
s() || y(!1);
|
|
55
|
+
}), I(() => {
|
|
56
|
+
const e = i.sidebarVisibilityMotion(), a = i.sidebarVisibilityMotionRevision();
|
|
57
|
+
e === "instant" && ce(() => i.clearSidebarVisibilityMotion(a));
|
|
42
58
|
});
|
|
43
|
-
const
|
|
59
|
+
const M = w(() => r.activityItems ? r.activityItems : d ? d.sidebarItems().filter((e) => !!e.icon).filter((e) => !(s() && e.sidebar?.hiddenOnMobile)).map((e) => ({
|
|
44
60
|
id: e.id,
|
|
45
61
|
icon: e.icon,
|
|
46
62
|
label: e.name,
|
|
47
63
|
badge: e.sidebar?.badge,
|
|
48
64
|
collapseBehavior: e.sidebar?.collapseBehavior ?? (e.sidebar?.fullScreen ? "preserve" : "toggle")
|
|
49
|
-
})) : []),
|
|
65
|
+
})) : []), K = w(() => b() ? [] : r.sidebarContent ? [] : d ? d.sidebarItems().filter((e) => !(s() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
|
|
50
66
|
id: e.id,
|
|
51
|
-
render: () => o(
|
|
67
|
+
render: () => o(T, {
|
|
52
68
|
get component() {
|
|
53
69
|
return e.component;
|
|
54
70
|
}
|
|
55
71
|
})
|
|
56
72
|
})) : []), H = (e) => {
|
|
57
|
-
if (!
|
|
73
|
+
if (!b()) {
|
|
58
74
|
if (r.sidebarContent) return r.sidebarContent(e);
|
|
59
|
-
if (
|
|
60
|
-
return o(
|
|
75
|
+
if (d)
|
|
76
|
+
return o(Ie, {
|
|
61
77
|
get views() {
|
|
62
|
-
return
|
|
78
|
+
return K();
|
|
63
79
|
},
|
|
64
80
|
activeId: e
|
|
65
81
|
});
|
|
66
82
|
}
|
|
67
|
-
}, R = w(() =>
|
|
68
|
-
if (
|
|
69
|
-
if (!
|
|
70
|
-
const e =
|
|
83
|
+
}, R = w(() => b() ? !0 : d ? d.getComponent(i.sidebarActiveTab())?.sidebar?.fullScreen ?? !1 : !1), j = w(() => {
|
|
84
|
+
if (b()) return !0;
|
|
85
|
+
if (!d) return !1;
|
|
86
|
+
const e = d.getComponent(i.sidebarActiveTab());
|
|
71
87
|
return e?.sidebar ? e.sidebar.fullScreen === !0 || e.sidebar.renderIn === "main" : !1;
|
|
72
88
|
});
|
|
73
|
-
|
|
74
|
-
|
|
89
|
+
I(() => {
|
|
90
|
+
s() && R() && y(!1);
|
|
75
91
|
});
|
|
76
92
|
const G = w(() => {
|
|
77
93
|
if (r.bottomBarItems) return r.bottomBarItems;
|
|
78
|
-
if (!
|
|
79
|
-
const e = [...
|
|
94
|
+
if (!d) return;
|
|
95
|
+
const e = [...d.statusBarItems()].sort((n, u) => (n.order ?? 100) - (u.order ?? 100)), a = e.filter((n) => n.position === "left"), l = e.filter((n) => n.position === "right");
|
|
80
96
|
return [(() => {
|
|
81
|
-
var
|
|
82
|
-
return
|
|
83
|
-
each:
|
|
84
|
-
children: (
|
|
97
|
+
var n = q();
|
|
98
|
+
return c(n, o(P, {
|
|
99
|
+
each: a,
|
|
100
|
+
children: (u) => o(T, {
|
|
85
101
|
get component() {
|
|
86
|
-
return
|
|
102
|
+
return u.component;
|
|
87
103
|
}
|
|
88
104
|
})
|
|
89
|
-
})),
|
|
105
|
+
})), n;
|
|
90
106
|
})(), (() => {
|
|
91
|
-
var
|
|
92
|
-
return
|
|
93
|
-
each:
|
|
94
|
-
children: (
|
|
107
|
+
var n = q();
|
|
108
|
+
return c(n, o(P, {
|
|
109
|
+
each: l,
|
|
110
|
+
children: (u) => o(T, {
|
|
95
111
|
get component() {
|
|
96
|
-
return
|
|
112
|
+
return u.component;
|
|
97
113
|
}
|
|
98
114
|
})
|
|
99
|
-
})),
|
|
115
|
+
})), n;
|
|
100
116
|
})()];
|
|
101
117
|
});
|
|
102
|
-
|
|
103
|
-
const e =
|
|
118
|
+
I(() => {
|
|
119
|
+
const e = M();
|
|
104
120
|
if (!e.length) return;
|
|
105
|
-
if (!
|
|
106
|
-
const
|
|
107
|
-
if (!
|
|
108
|
-
O(
|
|
121
|
+
if (!i.sidebarActiveTab()) {
|
|
122
|
+
const l = e.find((n) => !n.onClick);
|
|
123
|
+
if (!l) return;
|
|
124
|
+
O(l.id);
|
|
109
125
|
}
|
|
110
126
|
});
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
nextActiveId:
|
|
114
|
-
nextMobileSidebarOpen:
|
|
115
|
-
} =
|
|
127
|
+
const V = (e) => {
|
|
128
|
+
const a = b() ? !0 : d?.getComponent(e)?.sidebar?.fullScreen ?? !1, {
|
|
129
|
+
nextActiveId: l,
|
|
130
|
+
nextMobileSidebarOpen: n
|
|
131
|
+
} = ye({
|
|
116
132
|
clickedId: e,
|
|
117
|
-
activeId:
|
|
118
|
-
mobileSidebarOpen:
|
|
119
|
-
clickedIsFullScreen:
|
|
133
|
+
activeId: i.sidebarActiveTab(),
|
|
134
|
+
mobileSidebarOpen: A(),
|
|
135
|
+
clickedIsFullScreen: a
|
|
120
136
|
});
|
|
121
|
-
|
|
137
|
+
i.sidebarActiveTab() !== l && O(l), y(n);
|
|
122
138
|
}, J = (e) => {
|
|
123
139
|
if (e.onClick) {
|
|
124
|
-
|
|
140
|
+
be(() => e.onClick());
|
|
125
141
|
return;
|
|
126
142
|
}
|
|
127
|
-
|
|
143
|
+
V(e.id);
|
|
128
144
|
}, U = w(() => {
|
|
129
145
|
const e = r.topBarActions;
|
|
130
|
-
if (!
|
|
131
|
-
const
|
|
132
|
-
return
|
|
133
|
-
each:
|
|
134
|
-
children: (
|
|
146
|
+
if (!s() || (r.activityBottomItemsMobileMode ?? "hidden") !== "topBar") return e;
|
|
147
|
+
const l = r.activityBottomItems ?? [];
|
|
148
|
+
return l.length ? [o(P, {
|
|
149
|
+
each: l,
|
|
150
|
+
children: (n) => o(ve, {
|
|
135
151
|
get label() {
|
|
136
|
-
return
|
|
152
|
+
return n.label;
|
|
137
153
|
},
|
|
138
|
-
onClick: () => J(
|
|
154
|
+
onClick: () => J(n),
|
|
139
155
|
get children() {
|
|
140
|
-
return o(
|
|
156
|
+
return o(T, {
|
|
141
157
|
get component() {
|
|
142
|
-
return
|
|
158
|
+
return n.icon;
|
|
143
159
|
},
|
|
144
160
|
class: "w-4 h-4"
|
|
145
161
|
});
|
|
146
162
|
}
|
|
147
163
|
})
|
|
148
164
|
}), e] : e;
|
|
149
|
-
}), X = () =>
|
|
150
|
-
z(
|
|
165
|
+
}), X = () => b() ? !0 : i.sidebarCollapsed(), Y = () => F() ?? i.sidebarWidth(), v = () => W.config.accessibility, Z = () => {
|
|
166
|
+
z(i.sidebarWidth());
|
|
151
167
|
}, ee = (e) => {
|
|
152
|
-
z((
|
|
168
|
+
z((a) => i.clampSidebarWidth((a ?? i.sidebarWidth()) + e));
|
|
153
169
|
}, te = () => {
|
|
154
170
|
const e = F();
|
|
155
|
-
e !== null && (
|
|
171
|
+
e !== null && (i.setSidebarWidth(e), z(null));
|
|
156
172
|
};
|
|
157
173
|
de({
|
|
158
|
-
open: () =>
|
|
174
|
+
open: () => s() && A() && !b(),
|
|
159
175
|
root: () => $,
|
|
160
176
|
onClose: () => y(!1),
|
|
161
177
|
lockBodyScroll: !0,
|
|
@@ -169,7 +185,7 @@ function Qe(r) {
|
|
|
169
185
|
});
|
|
170
186
|
const re = () => {
|
|
171
187
|
if (typeof document > "u") return;
|
|
172
|
-
const e = document.getElementById(
|
|
188
|
+
const e = document.getElementById(v().mainContentId);
|
|
173
189
|
if (!(!e || !(e instanceof HTMLElement)))
|
|
174
190
|
try {
|
|
175
191
|
e.focus();
|
|
@@ -177,8 +193,8 @@ function Qe(r) {
|
|
|
177
193
|
}
|
|
178
194
|
};
|
|
179
195
|
return (() => {
|
|
180
|
-
var e =
|
|
181
|
-
return
|
|
196
|
+
var e = xe(), a = e.firstChild, l = a.nextSibling, n = l.firstChild, u = n.firstChild;
|
|
197
|
+
return a.$$click = () => re(), c(a, () => v().skipLinkLabel), c(e, o(fe, {
|
|
182
198
|
get logo() {
|
|
183
199
|
return r.logo;
|
|
184
200
|
},
|
|
@@ -186,63 +202,66 @@ function Qe(r) {
|
|
|
186
202
|
return U();
|
|
187
203
|
},
|
|
188
204
|
get ariaLabel() {
|
|
189
|
-
return
|
|
205
|
+
return v().topBarLabel;
|
|
190
206
|
},
|
|
191
207
|
get class() {
|
|
192
208
|
return r.slotClassNames?.topBar;
|
|
193
209
|
}
|
|
194
|
-
}),
|
|
210
|
+
}), l), c(l, o(S, {
|
|
195
211
|
get when() {
|
|
196
|
-
return !
|
|
212
|
+
return !s();
|
|
197
213
|
},
|
|
198
214
|
get children() {
|
|
199
|
-
return [o(
|
|
215
|
+
return [o(S, {
|
|
200
216
|
get when() {
|
|
201
|
-
return
|
|
217
|
+
return M().length > 0;
|
|
202
218
|
},
|
|
203
219
|
get children() {
|
|
204
|
-
return o(
|
|
220
|
+
return o(Se, {
|
|
205
221
|
get items() {
|
|
206
|
-
return
|
|
222
|
+
return M();
|
|
207
223
|
},
|
|
208
224
|
get bottomItems() {
|
|
209
225
|
return r.activityBottomItems;
|
|
210
226
|
},
|
|
211
227
|
get activeId() {
|
|
212
|
-
return
|
|
228
|
+
return i.sidebarActiveTab();
|
|
213
229
|
},
|
|
214
230
|
onActiveChange: O,
|
|
215
231
|
get collapsed() {
|
|
216
232
|
return X();
|
|
217
233
|
},
|
|
218
234
|
get onCollapsedChange() {
|
|
219
|
-
return
|
|
235
|
+
return p(() => !!b())() ? void 0 : i.setSidebarCollapsed;
|
|
220
236
|
},
|
|
221
237
|
get ariaLabel() {
|
|
222
|
-
return
|
|
238
|
+
return v().primaryNavigationLabel;
|
|
223
239
|
},
|
|
224
240
|
get class() {
|
|
225
241
|
return r.slotClassNames?.activityBar;
|
|
226
242
|
}
|
|
227
243
|
});
|
|
228
244
|
}
|
|
229
|
-
}), o(
|
|
245
|
+
}), o(S, {
|
|
230
246
|
get when() {
|
|
231
|
-
return !
|
|
247
|
+
return !b();
|
|
232
248
|
},
|
|
233
249
|
get children() {
|
|
234
|
-
return o(
|
|
250
|
+
return o(me, {
|
|
235
251
|
get width() {
|
|
236
252
|
return Y();
|
|
237
253
|
},
|
|
238
254
|
get collapsed() {
|
|
239
|
-
return
|
|
255
|
+
return i.sidebarCollapsed() || R();
|
|
256
|
+
},
|
|
257
|
+
get visibilityMotion() {
|
|
258
|
+
return i.sidebarVisibilityMotion();
|
|
240
259
|
},
|
|
241
260
|
get ariaLabel() {
|
|
242
|
-
return
|
|
261
|
+
return v().sidebarLabel;
|
|
243
262
|
},
|
|
244
263
|
get resizer() {
|
|
245
|
-
return o(
|
|
264
|
+
return o(Q, {
|
|
246
265
|
direction: "horizontal",
|
|
247
266
|
onResize: ee,
|
|
248
267
|
onResizeStart: Z,
|
|
@@ -253,54 +272,54 @@ function Qe(r) {
|
|
|
253
272
|
return r.slotClassNames?.sidebar;
|
|
254
273
|
},
|
|
255
274
|
get children() {
|
|
256
|
-
return H(
|
|
275
|
+
return H(i.sidebarActiveTab());
|
|
257
276
|
}
|
|
258
277
|
});
|
|
259
278
|
}
|
|
260
279
|
})];
|
|
261
280
|
}
|
|
262
|
-
}),
|
|
281
|
+
}), n), c(l, o(S, {
|
|
263
282
|
get when() {
|
|
264
|
-
return
|
|
283
|
+
return p(() => !!(s() && A()))() && !b();
|
|
265
284
|
},
|
|
266
285
|
get children() {
|
|
267
286
|
return [(() => {
|
|
268
|
-
var t =
|
|
269
|
-
return t.$$click = () => y(!1), N(() => h(t,
|
|
287
|
+
var t = Me();
|
|
288
|
+
return t.$$click = () => y(!1), N(() => h(t, C("absolute inset-0 z-40 bg-black/30 cursor-pointer", r.slotClassNames?.mobileSidebarBackdrop))), t;
|
|
270
289
|
})(), (() => {
|
|
271
|
-
var t =
|
|
272
|
-
return typeof g == "function" ? ne(g, t) : $ = t,
|
|
273
|
-
var B =
|
|
274
|
-
return B !==
|
|
290
|
+
var t = Be(), m = t.firstChild, g = $;
|
|
291
|
+
return typeof g == "function" ? ne(g, t) : $ = t, c(m, () => H(i.sidebarActiveTab())), N((f) => {
|
|
292
|
+
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), k = v().sidebarLabel;
|
|
293
|
+
return B !== f.e && h(t, f.e = B), k !== f.t && L(t, "aria-label", f.t = k), f;
|
|
275
294
|
}, {
|
|
276
295
|
e: void 0,
|
|
277
296
|
t: void 0
|
|
278
297
|
}), t;
|
|
279
298
|
})()];
|
|
280
299
|
}
|
|
281
|
-
}),
|
|
300
|
+
}), n), c(u, () => r.children), c(n, o(S, {
|
|
282
301
|
get when() {
|
|
283
|
-
return
|
|
302
|
+
return p(() => !!(!s() && i.terminalOpened()))() && r.terminalPanel;
|
|
284
303
|
},
|
|
285
304
|
get children() {
|
|
286
|
-
var t =
|
|
287
|
-
return
|
|
305
|
+
var t = ke();
|
|
306
|
+
return c(t, o(Q, {
|
|
288
307
|
direction: "vertical",
|
|
289
|
-
onResize: (
|
|
290
|
-
}), null),
|
|
291
|
-
var g =
|
|
292
|
-
return g !==
|
|
308
|
+
onResize: (m) => i.setTerminalHeight(i.terminalHeight() - m)
|
|
309
|
+
}), null), c(t, () => r.terminalPanel, null), N((m) => {
|
|
310
|
+
var g = C("relative shrink-0 border-t border-border bg-terminal-background overflow-hidden", r.slotClassNames?.terminalPanel), f = `${i.terminalHeight()}px`;
|
|
311
|
+
return g !== m.e && h(t, m.e = g), f !== m.t && ie(t, "height", m.t = f), m;
|
|
293
312
|
}, {
|
|
294
313
|
e: void 0,
|
|
295
314
|
t: void 0
|
|
296
315
|
}), t;
|
|
297
316
|
}
|
|
298
|
-
}), null),
|
|
317
|
+
}), null), c(e, o(S, {
|
|
299
318
|
get when() {
|
|
300
|
-
return !
|
|
319
|
+
return !s();
|
|
301
320
|
},
|
|
302
321
|
get children() {
|
|
303
|
-
return o(
|
|
322
|
+
return o(ge, {
|
|
304
323
|
get class() {
|
|
305
324
|
return r.slotClassNames?.bottomBar;
|
|
306
325
|
},
|
|
@@ -309,26 +328,26 @@ function Qe(r) {
|
|
|
309
328
|
}
|
|
310
329
|
});
|
|
311
330
|
}
|
|
312
|
-
}), null),
|
|
331
|
+
}), null), c(e, o(S, {
|
|
313
332
|
get when() {
|
|
314
|
-
return
|
|
333
|
+
return p(() => !!s())() && M().length > 0;
|
|
315
334
|
},
|
|
316
335
|
get children() {
|
|
317
|
-
return o(
|
|
336
|
+
return o(he, {
|
|
318
337
|
get items() {
|
|
319
|
-
return
|
|
338
|
+
return M();
|
|
320
339
|
},
|
|
321
340
|
get activeId() {
|
|
322
341
|
return Ce({
|
|
323
|
-
activeId:
|
|
324
|
-
mobileSidebarOpen:
|
|
342
|
+
activeId: i.sidebarActiveTab(),
|
|
343
|
+
mobileSidebarOpen: A(),
|
|
325
344
|
activeIsFullScreen: R(),
|
|
326
|
-
activeIsPage:
|
|
345
|
+
activeIsPage: j()
|
|
327
346
|
});
|
|
328
347
|
},
|
|
329
|
-
onSelect:
|
|
348
|
+
onSelect: V,
|
|
330
349
|
get ariaLabel() {
|
|
331
|
-
return
|
|
350
|
+
return v().mobileNavigationLabel;
|
|
332
351
|
},
|
|
333
352
|
get class() {
|
|
334
353
|
return r.slotClassNames?.mobileTabBar;
|
|
@@ -336,7 +355,7 @@ function Qe(r) {
|
|
|
336
355
|
});
|
|
337
356
|
}
|
|
338
357
|
}), null), N((t) => {
|
|
339
|
-
var
|
|
358
|
+
var m = C(
|
|
340
359
|
// Use dvh when supported to avoid mobile browser UI causing layout jumps.
|
|
341
360
|
"h-screen h-[100dvh] w-full flex flex-col overflow-hidden",
|
|
342
361
|
"bg-background text-foreground",
|
|
@@ -344,8 +363,8 @@ function Qe(r) {
|
|
|
344
363
|
"overscroll-none",
|
|
345
364
|
r.slotClassNames?.root,
|
|
346
365
|
r.class
|
|
347
|
-
), g = `#${
|
|
348
|
-
return
|
|
366
|
+
), g = `#${v().mainContentId}`, f = C("fixed left-3 top-3 z-[120] rounded-md bg-primary px-3 py-2 text-xs font-medium text-primary-foreground shadow-md", "transition-transform duration-150 motion-reduce:transition-none", "-translate-y-[200%] focus:translate-y-0"), B = C("flex-1 min-w-0 flex flex-col overflow-hidden", r.slotClassNames?.contentArea), k = C("flex-1 min-h-0 overflow-auto overscroll-contain", r.slotClassNames?.main), E = v().mainContentId, _ = v().mainLabel;
|
|
367
|
+
return m !== t.e && h(e, t.e = m), g !== t.t && L(a, "href", t.t = g), f !== t.a && h(a, t.a = f), B !== t.o && h(n, t.o = B), k !== t.i && h(u, t.i = k), E !== t.n && L(u, "id", t.n = E), _ !== t.s && L(u, "aria-label", t.s = _), t;
|
|
349
368
|
}, {
|
|
350
369
|
e: void 0,
|
|
351
370
|
t: void 0,
|
|
@@ -359,5 +378,5 @@ function Qe(r) {
|
|
|
359
378
|
}
|
|
360
379
|
oe(["click"]);
|
|
361
380
|
export {
|
|
362
|
-
|
|
381
|
+
Ke as Shell
|
|
363
382
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
+
import type { SidebarVisibilityMotion } from '../../context/LayoutContext';
|
|
2
3
|
export interface SidebarProps {
|
|
3
4
|
children: JSX.Element;
|
|
4
5
|
resizer?: JSX.Element;
|
|
5
6
|
width?: number;
|
|
6
7
|
collapsed?: boolean;
|
|
8
|
+
visibilityMotion?: SidebarVisibilityMotion;
|
|
7
9
|
ariaLabel?: string;
|
|
8
10
|
class?: string;
|
|
9
11
|
}
|