@floegence/floe-webapp-core 0.103.4 → 0.103.6
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/BottomBarCompanion.d.ts +2 -1
- package/dist/components/layout/BottomBarCompanion.js +113 -103
- package/dist/components/layout/DisplayModePageShell.d.ts +1 -0
- package/dist/components/layout/DisplayModePageShell.js +10 -7
- package/dist/components/layout/Shell.d.ts +1 -0
- package/dist/components/layout/Shell.js +20 -17
- package/dist/components/layout/TopBar.d.ts +1 -0
- package/dist/components/layout/TopBar.js +51 -30
- package/dist/components/ui/InfiniteCanvas.js +89 -90
- package/dist/context/ViewActivationContext.d.ts +1 -0
- package/dist/context/ViewActivationContext.js +13 -9
- package/dist/styles.css +1 -1
- package/dist/ui.css +6 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ export interface BottomBarCompanionProps {
|
|
|
12
12
|
children?: JSX.Element;
|
|
13
13
|
/** Preferred expanded width in pixels; defaults to the anchor width and respects maxWidth. */
|
|
14
14
|
expandedWidth?: number;
|
|
15
|
+
anchorEdge?: 'top' | 'bottom';
|
|
15
16
|
maxWidth?: number;
|
|
16
17
|
maxHeight?: number;
|
|
17
18
|
viewportPadding?: number;
|
|
@@ -24,7 +25,7 @@ export interface BottomBarCompanionProps {
|
|
|
24
25
|
onPhaseChange?: (phase: BottomBarCompanionPhase) => void;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
|
-
* A non-modal surface that grows
|
|
28
|
+
* A non-modal surface that grows inward from a measurable layout anchor.
|
|
28
29
|
* The anchor may live in a Bottom Bar or independently within an AppViewport.
|
|
29
30
|
*
|
|
30
31
|
* This is intentionally distinct from windows, popovers, and modal drawers:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createComponent as ne, Portal as de, use as oe, insert as fe, effect as me, setAttribute as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { createComponent as ne, Portal as de, use as oe, insert as fe, effect as me, setAttribute as L, className as ie, style as he, memo as ve, template as we } from "solid-js/web";
|
|
2
|
+
import { createSignal as N, createEffect as j, untrack as q, onCleanup as Q, Show as be } from "solid-js";
|
|
3
3
|
import { readViewportSnapshot as J, observeViewport as ge } from "../../viewport.js";
|
|
4
4
|
import { cn as re } from "../../utils/cn.js";
|
|
5
5
|
var Ce = /* @__PURE__ */ we("<section role=region data-floe-bottom-bar-companion=true><div data-floe-bottom-bar-companion-content=true>");
|
|
@@ -9,7 +9,7 @@ const ye = 544, Fe = 544, Ae = 12, U = {
|
|
|
9
9
|
bottom: "--floe-bottom-bar-companion-safe-area-bottom",
|
|
10
10
|
left: "--floe-bottom-bar-companion-safe-area-left"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function Y(e, r) {
|
|
13
13
|
const u = Number(e);
|
|
14
14
|
return Number.isFinite(u) && u > 0 ? u : r;
|
|
15
15
|
}
|
|
@@ -17,7 +17,7 @@ function De(e, r) {
|
|
|
17
17
|
const u = Number(e);
|
|
18
18
|
return Number.isFinite(u) && u >= 0 ? u : r;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function ae(e) {
|
|
21
21
|
if (!e?.isConnected) return null;
|
|
22
22
|
const r = e.getBoundingClientRect();
|
|
23
23
|
return !Number.isFinite(r.left) || !Number.isFinite(r.top) || r.width <= 0 || r.height <= 0 ? null : {
|
|
@@ -33,7 +33,7 @@ function _(e, r) {
|
|
|
33
33
|
const f = Number.parseFloat(u.getComputedStyle(e).getPropertyValue(r));
|
|
34
34
|
return Number.isFinite(f) && f > 0 ? f : 0;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ee(e) {
|
|
37
37
|
return {
|
|
38
38
|
top: _(e, U.top),
|
|
39
39
|
right: _(e, U.right),
|
|
@@ -41,19 +41,29 @@ function xe(e) {
|
|
|
41
41
|
left: _(e, U.left)
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
44
|
+
function Me(e, r, u, f, P, C, O) {
|
|
45
|
+
const v = r.ownerDocument.defaultView, y = v ? J(v).visible : null, z = y?.left ?? 0, E = y?.top ?? 0, S = y?.width ?? e.left + e.width, X = y?.height ?? e.top + e.height, m = Ee(r), w = z + m.left + C, h = z + S - m.right - C, F = E + m.top + C, b = E + X - (v && J(v).keyboardOpen ? 0 : m.bottom), D = Math.max(0, h - w), A = Math.min(u, f, D), V = e.left + (e.width - A) / 2, M = Math.max(w, Math.min(V, h - A));
|
|
46
|
+
if (O === "top") {
|
|
47
|
+
const T = Math.max(e.top, E + m.top);
|
|
48
|
+
return {
|
|
49
|
+
left: M,
|
|
50
|
+
top: T,
|
|
51
|
+
width: A,
|
|
52
|
+
height: Math.min(P, Math.max(e.height, b - C - T))
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const R = Math.min(e.top + e.height, b), K = Math.max(e.height, R - F), I = Math.min(P, K);
|
|
46
56
|
return {
|
|
47
|
-
left:
|
|
48
|
-
top:
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
57
|
+
left: M,
|
|
58
|
+
top: R - I,
|
|
59
|
+
width: A,
|
|
60
|
+
height: I
|
|
51
61
|
};
|
|
52
62
|
}
|
|
53
|
-
function
|
|
63
|
+
function se(e, r) {
|
|
54
64
|
return !!(e && e.left === r.left && e.top === r.top && e.width === r.width && e.height === r.height);
|
|
55
65
|
}
|
|
56
|
-
function
|
|
66
|
+
function xe(e, r) {
|
|
57
67
|
if (!e) return {};
|
|
58
68
|
const u = r?.ownerDocument.defaultView, f = u ? J(u).fixedOffset : {
|
|
59
69
|
left: 0,
|
|
@@ -67,151 +77,151 @@ function Pe(e, r) {
|
|
|
67
77
|
};
|
|
68
78
|
}
|
|
69
79
|
function Ne(e) {
|
|
70
|
-
const [r, u] =
|
|
71
|
-
let
|
|
72
|
-
const
|
|
73
|
-
S() !== i && (
|
|
74
|
-
},
|
|
80
|
+
const [r, u] = N(null), [f, P] = N(!1), [C, O] = N(!1), [v, y] = N(null), [z, E] = N(null), [S, X] = N("collapsed");
|
|
81
|
+
let m = null, w = 0, h = 0, F = null, b = null, D = null, A = !1, V = !1;
|
|
82
|
+
const M = (i) => {
|
|
83
|
+
S() !== i && (X(i), e.onPhaseChange?.(i));
|
|
84
|
+
}, R = () => r()?.ownerDocument.defaultView ?? e.anchor?.ownerDocument.defaultView ?? null, K = () => R()?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1, I = (i) => {
|
|
75
85
|
const n = e.mount, o = e.anchor, t = !!(n?.isConnected && i && o?.ownerDocument === n.ownerDocument);
|
|
76
86
|
t && u(n);
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
const l = !!(t &&
|
|
81
|
-
return
|
|
82
|
-
mount:
|
|
87
|
+
const s = r();
|
|
88
|
+
if (s) {
|
|
89
|
+
P(s.isConnected);
|
|
90
|
+
const l = !!(t && s === n);
|
|
91
|
+
return O(l), {
|
|
92
|
+
mount: s,
|
|
83
93
|
ready: l
|
|
84
94
|
};
|
|
85
95
|
}
|
|
86
|
-
return
|
|
96
|
+
return P(!1), O(!1), {
|
|
87
97
|
mount: null,
|
|
88
98
|
ready: !1
|
|
89
99
|
};
|
|
90
|
-
},
|
|
91
|
-
const n =
|
|
92
|
-
n &&
|
|
100
|
+
}, T = (i) => {
|
|
101
|
+
const n = ae(e.anchor);
|
|
102
|
+
n && E(n);
|
|
93
103
|
const {
|
|
94
104
|
mount: o,
|
|
95
105
|
ready: t
|
|
96
|
-
} =
|
|
97
|
-
return !
|
|
106
|
+
} = I(n), s = n ?? z();
|
|
107
|
+
return !s || !o || !t ? null : i ? Me(s, o, Y(e.expandedWidth, s.width), Y(e.maxWidth, ye), Y(e.maxHeight, Fe), De(e.viewportPadding, Ae), e.anchorEdge ?? "bottom") : s;
|
|
98
108
|
}, Z = () => {
|
|
99
|
-
|
|
109
|
+
w && F && F.cancelAnimationFrame(w), h && b && b.cancelAnimationFrame(h), w = 0, h = 0, F = null, b = null, D = null;
|
|
100
110
|
}, $ = (i, n) => {
|
|
101
|
-
const o =
|
|
111
|
+
const o = T(i);
|
|
102
112
|
if (!o) return;
|
|
103
|
-
const t =
|
|
104
|
-
if (!n &&
|
|
105
|
-
if (!n ||
|
|
106
|
-
|
|
113
|
+
const t = v(), s = i ? "expanded" : "collapsed";
|
|
114
|
+
if (!n && se(t, o) && D) return;
|
|
115
|
+
if (!n || K() || se(t, o)) {
|
|
116
|
+
y(o), D = null, M(s);
|
|
107
117
|
return;
|
|
108
118
|
}
|
|
109
|
-
|
|
110
|
-
const l =
|
|
119
|
+
D = ["height", "width", "top", "left"].find((c) => t?.[c] !== o[c]) ?? null, M(i ? "expanding" : "collapsing");
|
|
120
|
+
const l = R();
|
|
111
121
|
if (!l) {
|
|
112
|
-
|
|
122
|
+
y(o), M(s);
|
|
113
123
|
return;
|
|
114
124
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}),
|
|
125
|
+
h = l.requestAnimationFrame(() => {
|
|
126
|
+
h = 0, b = null, y(q(() => T(i)) ?? o);
|
|
127
|
+
}), b = l;
|
|
118
128
|
}, p = (i, n) => {
|
|
119
|
-
if (!i && (
|
|
120
|
-
const o =
|
|
129
|
+
if (!i && (w || h)) return;
|
|
130
|
+
const o = R();
|
|
121
131
|
if (!o) {
|
|
122
132
|
$(n, i);
|
|
123
133
|
return;
|
|
124
134
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}),
|
|
135
|
+
w && F && F.cancelAnimationFrame(w), h && b && b.cancelAnimationFrame(h), h = 0, b = null, w = o.requestAnimationFrame(() => {
|
|
136
|
+
w = 0, F = null, q(() => $(n, i));
|
|
137
|
+
}), F = o;
|
|
128
138
|
};
|
|
129
|
-
|
|
139
|
+
j(() => {
|
|
130
140
|
const i = e.retained, n = e.visible, o = e.open;
|
|
131
|
-
if (e.anchor, e.mount, e.expandedWidth, e.maxWidth, e.maxHeight, e.viewportPadding, !i) {
|
|
132
|
-
Z(), u(null),
|
|
141
|
+
if (e.anchor, e.mount, e.expandedWidth, e.maxWidth, e.maxHeight, e.viewportPadding, e.anchorEdge, !i) {
|
|
142
|
+
Z(), u(null), P(!1), O(!1), y(null), E(null), m = null, e.surfaceRef?.(null), e.contentHostRef?.(null), A = !1, V = o;
|
|
133
143
|
return;
|
|
134
144
|
}
|
|
135
|
-
const t =
|
|
136
|
-
if (t &&
|
|
137
|
-
|
|
145
|
+
const t = ae(e.anchor);
|
|
146
|
+
if (t && E(t), I(t), !n) {
|
|
147
|
+
A = !1, V = o;
|
|
138
148
|
return;
|
|
139
149
|
}
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
}),
|
|
150
|
+
const s = !A, l = V !== o;
|
|
151
|
+
A = !0, V = o, p(!s && l, o);
|
|
152
|
+
}), j(() => {
|
|
143
153
|
if (!e.retained) return;
|
|
144
|
-
const i = e.anchor, n = r(), o = e.mount, t = /* @__PURE__ */ new Set(),
|
|
145
|
-
for (const
|
|
146
|
-
if (!
|
|
147
|
-
t.add(
|
|
148
|
-
const d =
|
|
149
|
-
d &&
|
|
154
|
+
const i = e.anchor, n = r(), o = e.mount, t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
155
|
+
for (const a of [i, n, o]) {
|
|
156
|
+
if (!a) continue;
|
|
157
|
+
t.add(a.ownerDocument);
|
|
158
|
+
const d = a.ownerDocument.defaultView;
|
|
159
|
+
d && s.add(d);
|
|
150
160
|
}
|
|
151
|
-
if (
|
|
152
|
-
const l = () => p(!1,
|
|
153
|
-
for (const
|
|
154
|
-
const d =
|
|
155
|
-
if (!
|
|
156
|
-
const
|
|
157
|
-
|
|
161
|
+
if (s.size === 0 || t.size === 0) return;
|
|
162
|
+
const l = () => p(!1, q(() => e.open)), c = [];
|
|
163
|
+
for (const a of /* @__PURE__ */ new Set([i, n, o])) {
|
|
164
|
+
const d = a?.ownerDocument.defaultView;
|
|
165
|
+
if (!a || !d || typeof d.ResizeObserver != "function") continue;
|
|
166
|
+
const x = new d.ResizeObserver(l);
|
|
167
|
+
x.observe(a), c.push(x);
|
|
158
168
|
}
|
|
159
|
-
let g = i?.isConnected ?? !1,
|
|
160
|
-
const
|
|
161
|
-
for (const
|
|
162
|
-
const d =
|
|
163
|
-
if (!d || typeof d.MutationObserver != "function" || !
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
g ===
|
|
169
|
+
let g = i?.isConnected ?? !1, W = n?.isConnected ?? !1, H = o?.isConnected ?? !1;
|
|
170
|
+
const B = [];
|
|
171
|
+
for (const a of t) {
|
|
172
|
+
const d = a.defaultView;
|
|
173
|
+
if (!d || typeof d.MutationObserver != "function" || !a.documentElement) continue;
|
|
174
|
+
const x = new d.MutationObserver(() => {
|
|
175
|
+
const k = i?.isConnected ?? !1, ee = n?.isConnected ?? !1, te = o?.isConnected ?? !1;
|
|
176
|
+
g === k && W === ee && H === te || (g = k, W = ee, H = te, q(l));
|
|
167
177
|
});
|
|
168
|
-
|
|
178
|
+
x.observe(a.documentElement, {
|
|
169
179
|
childList: !0,
|
|
170
180
|
subtree: !0
|
|
171
|
-
}),
|
|
181
|
+
}), B.push(x);
|
|
172
182
|
}
|
|
173
|
-
const G = [...
|
|
174
|
-
let d = JSON.stringify(J(
|
|
175
|
-
return ge(
|
|
176
|
-
const
|
|
177
|
-
|
|
183
|
+
const G = [...s].map((a) => {
|
|
184
|
+
let d = JSON.stringify(J(a));
|
|
185
|
+
return ge(a, (x) => {
|
|
186
|
+
const k = JSON.stringify(x);
|
|
187
|
+
k !== d && (d = k, q(l));
|
|
178
188
|
});
|
|
179
189
|
});
|
|
180
|
-
for (const
|
|
181
|
-
|
|
182
|
-
for (const
|
|
183
|
-
for (const
|
|
184
|
-
for (const
|
|
185
|
-
for (const
|
|
190
|
+
for (const a of t) a.addEventListener("scroll", l, !0);
|
|
191
|
+
Q(() => {
|
|
192
|
+
for (const a of c) a.disconnect();
|
|
193
|
+
for (const a of B) a.disconnect();
|
|
194
|
+
for (const a of G) a();
|
|
195
|
+
for (const a of t) a.removeEventListener("scroll", l, !0);
|
|
186
196
|
});
|
|
187
|
-
}),
|
|
188
|
-
if (!e.retained || !e.visible || !e.open || !f() || !
|
|
197
|
+
}), j(() => {
|
|
198
|
+
if (!e.retained || !e.visible || !e.open || !f() || !C() || !v()) return;
|
|
189
199
|
const n = r()?.ownerDocument, o = n?.defaultView;
|
|
190
200
|
if (!n || !o) return;
|
|
191
201
|
const t = (c) => {
|
|
192
202
|
const g = typeof c.composedPath == "function" ? c.composedPath() : [];
|
|
193
|
-
return
|
|
194
|
-
},
|
|
203
|
+
return m && g.includes(m) || e.anchor && g.includes(e.anchor) ? !0 : e.isOwnedInteraction?.(c) ?? !1;
|
|
204
|
+
}, s = (c) => {
|
|
195
205
|
t(c) || e.onDismiss?.("outside-pointer");
|
|
196
206
|
}, l = (c) => {
|
|
197
207
|
if (c.key !== "Escape" || c.defaultPrevented || c.isComposing || c.keyCode === 229) return;
|
|
198
208
|
const g = n.activeElement;
|
|
199
|
-
!
|
|
209
|
+
!m?.contains(g) && !e.isOwnedInteraction?.(c) || (c.preventDefault(), e.onDismiss?.("escape"));
|
|
200
210
|
};
|
|
201
|
-
n.addEventListener("pointerdown",
|
|
202
|
-
n.removeEventListener("pointerdown",
|
|
211
|
+
n.addEventListener("pointerdown", s, !0), o.addEventListener("keydown", l), Q(() => {
|
|
212
|
+
n.removeEventListener("pointerdown", s, !0), o.removeEventListener("keydown", l);
|
|
203
213
|
});
|
|
204
|
-
}),
|
|
214
|
+
}), Q(() => {
|
|
205
215
|
Z(), e.surfaceRef?.(null), e.contentHostRef?.(null);
|
|
206
216
|
});
|
|
207
217
|
const ce = (i) => {
|
|
208
|
-
|
|
218
|
+
m = i, e.surfaceRef?.(i);
|
|
209
219
|
}, le = (i) => {
|
|
210
220
|
e.contentHostRef?.(i);
|
|
211
221
|
}, ue = (i) => {
|
|
212
|
-
if (i.target !==
|
|
222
|
+
if (i.target !== m || i.propertyName !== D) return;
|
|
213
223
|
const n = e.open ? "expanding" : "collapsing";
|
|
214
|
-
S() === n && (
|
|
224
|
+
S() === n && (D = null, M(e.open ? "expanded" : "collapsed"));
|
|
215
225
|
};
|
|
216
226
|
return ne(be, {
|
|
217
227
|
get when() {
|
|
@@ -224,8 +234,8 @@ function Ne(e) {
|
|
|
224
234
|
get children() {
|
|
225
235
|
var n = Ce(), o = n.firstChild;
|
|
226
236
|
return n.addEventListener("transitionend", ue), oe((t) => ce(t), n), oe((t) => le(t), o), fe(o, () => e.children), me((t) => {
|
|
227
|
-
var
|
|
228
|
-
return
|
|
237
|
+
var s = e.id, l = e.label, c = !e.visible || !f() || !C() || !v() ? "true" : void 0, g = !e.visible || !f() || !C() || !v(), W = re("floe-bottom-bar-companion", e.class), H = S(), B = e.visible && f() && C() ? "visible" : "hidden", G = v() ? "true" : "false", a = xe(v(), r()), d = re("floe-bottom-bar-companion__content", e.contentClass);
|
|
238
|
+
return s !== t.e && L(n, "id", t.e = s), l !== t.t && L(n, "aria-label", t.t = l), c !== t.a && L(n, "aria-hidden", t.a = c), g !== t.o && (n.inert = t.o = g), W !== t.i && ie(n, t.i = W), H !== t.n && L(n, "data-companion-phase", t.n = H), B !== t.s && L(n, "data-companion-visibility", t.s = B), G !== t.h && L(n, "data-companion-frame-ready", t.h = G), t.r = he(n, a, t.r), d !== t.d && ie(o, t.d = d), t;
|
|
229
239
|
}, {
|
|
230
240
|
e: void 0,
|
|
231
241
|
t: void 0,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { insert as
|
|
1
|
+
import { insert as a, createComponent as l, template as o } from "solid-js/web";
|
|
2
2
|
import "solid-js";
|
|
3
3
|
import { TopBar as i } from "./TopBar.js";
|
|
4
|
-
var
|
|
5
|
-
const
|
|
6
|
-
var t =
|
|
7
|
-
return
|
|
4
|
+
var s = /* @__PURE__ */ o("<div class=display-mode-page-shell><main class=display-mode-page-shell__body>");
|
|
5
|
+
const d = (e) => (() => {
|
|
6
|
+
var t = s(), r = t.firstChild;
|
|
7
|
+
return a(t, l(i, {
|
|
8
8
|
get logo() {
|
|
9
9
|
return e.logo;
|
|
10
10
|
},
|
|
@@ -14,9 +14,12 @@ const p = (e) => (() => {
|
|
|
14
14
|
get actions() {
|
|
15
15
|
return e.actions;
|
|
16
16
|
},
|
|
17
|
+
get accessory() {
|
|
18
|
+
return e.topBarAccessory;
|
|
19
|
+
},
|
|
17
20
|
ariaLabel: "Display mode top bar"
|
|
18
|
-
}),
|
|
21
|
+
}), r), a(r, () => e.children), t;
|
|
19
22
|
})();
|
|
20
23
|
export {
|
|
21
|
-
|
|
24
|
+
d as DisplayModePageShell
|
|
22
25
|
};
|
|
@@ -50,6 +50,7 @@ export interface ShellProps {
|
|
|
50
50
|
*/
|
|
51
51
|
activityBottomItemsMobileMode?: 'hidden' | 'topBar';
|
|
52
52
|
topBarActions?: JSX.Element;
|
|
53
|
+
topBarAccessory?: () => JSX.Element;
|
|
53
54
|
/** Stable content directly above mobile navigation, such as a composer anchor. */
|
|
54
55
|
mobileAccessory?: JSX.Element;
|
|
55
56
|
/** Hide navigation only while a focused editor is occluded by the soft keyboard. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createComponent as n, Dynamic as oe, insert as d, use as U, effect as I, setStyleProperty as j, memo as P, className as
|
|
2
|
-
import { createSignal as w, onMount as ze, onCleanup as $e, createEffect as
|
|
1
|
+
import { createComponent as n, Dynamic as oe, insert as d, use as U, effect as I, setStyleProperty as j, memo as P, className as A, setAttribute as C, mergeProps as Le, template as M, delegateEvents as pe } from "solid-js/web";
|
|
2
|
+
import { createSignal as w, onMount as ze, onCleanup as $e, createEffect as k, createMemo as T, For as Fe, Show as m, batch as Ee } from "solid-js";
|
|
3
3
|
import { observeViewport as He } from "../../viewport.js";
|
|
4
4
|
import { useLayout as Ve } from "../../context/LayoutContext.js";
|
|
5
5
|
import { useResolvedFloeConfig as De } from "../../context/FloeConfigContext.js";
|
|
@@ -34,13 +34,13 @@ function Dt(i) {
|
|
|
34
34
|
sidebarWidth: () => (D() ?? r.sidebarWidth()) + (me()?.width ?? 0),
|
|
35
35
|
minContentWidth: () => i.sidebarMinContentWidth ?? 0
|
|
36
36
|
}), h = () => !l() && !!i.sidebarMinContentWidth && !c() && Se() === "overlay";
|
|
37
|
-
|
|
37
|
+
k(() => {
|
|
38
38
|
(!h() || N()) && L(!1);
|
|
39
39
|
});
|
|
40
40
|
const [p, S] = w(!1), [z, ye] = w(!1);
|
|
41
41
|
let G;
|
|
42
42
|
const Ce = () => l() && !!i.mobileNavigationPanel?.open;
|
|
43
|
-
|
|
43
|
+
k(() => {
|
|
44
44
|
!l() && i.mobileNavigationPanel?.open && i.mobileNavigationPanel.onOpenChange(!1), Ce() && S(!1);
|
|
45
45
|
});
|
|
46
46
|
const [D, _] = w(null);
|
|
@@ -91,11 +91,11 @@ function Dt(i) {
|
|
|
91
91
|
}
|
|
92
92
|
$(e, a);
|
|
93
93
|
};
|
|
94
|
-
|
|
94
|
+
k(() => {
|
|
95
95
|
c() && S(!1);
|
|
96
|
-
}),
|
|
96
|
+
}), k(() => {
|
|
97
97
|
l() || S(!1);
|
|
98
|
-
}),
|
|
98
|
+
}), k(() => {
|
|
99
99
|
const e = r.sidebarVisibilityMotion(), a = r.sidebarVisibilityMotionRevision();
|
|
100
100
|
e === "instant" && Je(() => r.clearSidebarVisibilityMotion(a));
|
|
101
101
|
});
|
|
@@ -114,11 +114,11 @@ function Dt(i) {
|
|
|
114
114
|
ariaExpanded: () => V() && r.sidebarActiveTab() === e.id,
|
|
115
115
|
ariaHasPopup: "dialog"
|
|
116
116
|
} : {}
|
|
117
|
-
}))),
|
|
117
|
+
}))), Ae = (e) => {
|
|
118
118
|
h() ? (e || W.get(r.sidebarActiveTab())?.focus({
|
|
119
119
|
preventScroll: !0
|
|
120
120
|
}), L(!e)) : r.setSidebarCollapsed(e);
|
|
121
|
-
},
|
|
121
|
+
}, ke = T(() => c() ? [] : i.sidebarContent ? [] : b ? b.sidebarItems().filter((e) => !(l() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
|
|
122
122
|
id: e.id,
|
|
123
123
|
render: () => n(oe, {
|
|
124
124
|
get component() {
|
|
@@ -131,7 +131,7 @@ function Dt(i) {
|
|
|
131
131
|
if (b)
|
|
132
132
|
return n(ot, {
|
|
133
133
|
get views() {
|
|
134
|
-
return
|
|
134
|
+
return ke();
|
|
135
135
|
},
|
|
136
136
|
activeId: e
|
|
137
137
|
});
|
|
@@ -142,9 +142,9 @@ function Dt(i) {
|
|
|
142
142
|
const e = b.getComponent(r.sidebarActiveTab());
|
|
143
143
|
return e?.sidebar ? e.sidebar.fullScreen === !0 || e.sidebar.renderIn === "main" : !1;
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
k(() => {
|
|
146
146
|
l() && N() && S(!1);
|
|
147
|
-
}),
|
|
147
|
+
}), k(() => {
|
|
148
148
|
const e = B();
|
|
149
149
|
if (!e.length) return;
|
|
150
150
|
if (!r.sidebarActiveTab()) {
|
|
@@ -245,6 +245,9 @@ function Dt(i) {
|
|
|
245
245
|
get logo() {
|
|
246
246
|
return i.logo;
|
|
247
247
|
},
|
|
248
|
+
get accessory() {
|
|
249
|
+
return i.topBarAccessory;
|
|
250
|
+
},
|
|
248
251
|
get actions() {
|
|
249
252
|
return Te();
|
|
250
253
|
},
|
|
@@ -285,7 +288,7 @@ function Dt(i) {
|
|
|
285
288
|
return Be();
|
|
286
289
|
},
|
|
287
290
|
get onCollapsedChange() {
|
|
288
|
-
return c() ? void 0 :
|
|
291
|
+
return c() ? void 0 : Ae;
|
|
289
292
|
},
|
|
290
293
|
get ariaLabel() {
|
|
291
294
|
return f().primaryNavigationLabel;
|
|
@@ -370,12 +373,12 @@ function Dt(i) {
|
|
|
370
373
|
get children() {
|
|
371
374
|
return [(() => {
|
|
372
375
|
var t = ut();
|
|
373
|
-
return t.$$click = () => S(!1), I(() =>
|
|
376
|
+
return t.$$click = () => S(!1), I(() => A(t, x("absolute inset-0 z-40 bg-black/30 cursor-pointer", i.slotClassNames?.mobileSidebarBackdrop))), t;
|
|
374
377
|
})(), (() => {
|
|
375
378
|
var t = ft(), u = t.firstChild, y = q;
|
|
376
379
|
return typeof y == "function" ? U(y, t) : q = t, d(u, n(K, {})), I((v) => {
|
|
377
380
|
var O = x("absolute left-0 top-0 bottom-0 z-50", "w-72 max-w-[80vw]", "bg-sidebar border-r border-sidebar-border", "shadow-[var(--floe-elevation-float-strong)]", "animate-in slide-in-from-left duration-[var(--floe-duration-base)]", i.slotClassNames?.mobileSidebarDrawer), R = f().sidebarLabel;
|
|
378
|
-
return O !== v.e &&
|
|
381
|
+
return O !== v.e && A(t, v.e = O), R !== v.t && C(t, "aria-label", v.t = R), v;
|
|
379
382
|
}, {
|
|
380
383
|
e: void 0,
|
|
381
384
|
t: void 0
|
|
@@ -393,7 +396,7 @@ function Dt(i) {
|
|
|
393
396
|
onResize: (u) => r.setTerminalHeight(r.terminalHeight() - u)
|
|
394
397
|
}), null), d(t, () => i.terminalPanel, null), I((u) => {
|
|
395
398
|
var y = x("relative shrink-0 border-t border-[var(--floe-line)] bg-terminal-background overflow-hidden", i.slotClassNames?.terminalPanel), v = `${r.terminalHeight()}px`;
|
|
396
|
-
return y !== u.e &&
|
|
399
|
+
return y !== u.e && A(t, u.e = y), v !== u.t && j(t, "height", u.t = v), u;
|
|
397
400
|
}, {
|
|
398
401
|
e: void 0,
|
|
399
402
|
t: void 0
|
|
@@ -468,7 +471,7 @@ function Dt(i) {
|
|
|
468
471
|
i.slotClassNames?.root,
|
|
469
472
|
i.class
|
|
470
473
|
), v = `#${f().mainContentId}`, O = x("fixed left-3 top-3 z-[120] rounded-md bg-primary px-3 py-2 text-xs font-medium text-primary-foreground shadow-[var(--floe-elevation-raised)]", "transition-transform duration-[var(--floe-duration-fast)] motion-reduce:transition-none", "-translate-y-[200%] focus:translate-y-0"), R = z(), X = z() ? "true" : void 0, Y = i.sidebarMinContentWidth ? "true" : void 0, Z = i.sidebarMinContentWidth ? "true" : void 0, ee = h() ? "overlay" : "inline", te = ge(), ie = x("flex-1 min-w-0 flex flex-col overflow-hidden", i.slotClassNames?.contentArea), re = x("flex-1 min-h-0 overflow-auto overscroll-contain", i.slotClassNames?.main), ne = f().mainContentId, ae = f().mainLabel;
|
|
471
|
-
return u !== t.e && j(e, "height", t.e = u), y !== t.t &&
|
|
474
|
+
return u !== t.e && j(e, "height", t.e = u), y !== t.t && A(e, t.t = y), v !== t.a && C(a, "href", t.a = v), O !== t.o && A(a, t.o = O), R !== t.i && (o.inert = t.i = R), X !== t.n && C(o, "aria-hidden", t.n = X), Y !== t.s && C(o, "data-floe-dialog-surface-host", t.s = Y), Z !== t.h && C(o, "data-floe-surface-portal-layer", t.h = Z), ee !== t.r && C(o, "data-floe-shell-sidebar-presentation", t.r = ee), te !== t.d && (g.inert = t.d = te), ie !== t.l && A(g, t.l = ie), re !== t.u && A(H, t.u = re), ne !== t.c && C(H, "id", t.c = ne), ae !== t.w && C(H, "aria-label", t.w = ae), t;
|
|
472
475
|
}, {
|
|
473
476
|
e: void 0,
|
|
474
477
|
t: void 0,
|
|
@@ -1,49 +1,70 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { Show as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useCommand as
|
|
5
|
-
import { Search as
|
|
6
|
-
import { useResolvedFloeConfig as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { insert as r, createComponent as c, effect as h, className as x, setAttribute as p, template as n, delegateEvents as w } from "solid-js/web";
|
|
2
|
+
import { Show as m } from "solid-js";
|
|
3
|
+
import { cn as k } from "../../utils/cn.js";
|
|
4
|
+
import { useCommand as $ } from "../../context/CommandContext.js";
|
|
5
|
+
import { Search as _ } from "../icons/index.js";
|
|
6
|
+
import { useResolvedFloeConfig as C } from "../../context/FloeConfigContext.js";
|
|
7
|
+
import { useViewVisibility as S } from "../../context/ViewActivationContext.js";
|
|
8
|
+
var B = /* @__PURE__ */ n('<span class="font-medium text-caption tracking-tight hidden sm:inline">'), E = /* @__PURE__ */ n('<header data-floe-shell-slot=top-bar style=background-color:var(--activity-bar);border-bottom-color:var(--top-bar-border)><div class="h-10 flex items-center gap-2 px-3"><div class="flex items-center gap-2 flex-shrink-0"></div><div class="flex items-center gap-0.5">'), F = /* @__PURE__ */ n('<div class="w-6 h-6 rounded-xs bg-primary flex items-center justify-center text-primary-foreground text-xs font-bold">F'), V = /* @__PURE__ */ n('<kbd class="hidden md:inline text-caption px-1 py-0.5 rounded-xs bg-background/60 border border-[var(--floe-line)] font-mono shrink-0 leading-none">'), j = /* @__PURE__ */ n('<button type=button><span class="flex-1 text-left hidden sm:inline truncate">'), A = /* @__PURE__ */ n('<div data-floe-top-bar-accessory class="relative min-w-0 flex-1 self-stretch">');
|
|
9
|
+
function q(l) {
|
|
10
|
+
const v = $(), d = C(), y = S(), i = () => d.config.commands.palette.enabled;
|
|
10
11
|
return (() => {
|
|
11
|
-
var
|
|
12
|
-
return
|
|
12
|
+
var a = E(), b = a.firstChild, f = b.firstChild, u = f.nextSibling;
|
|
13
|
+
return r(f, () => l.logo || F(), null), r(f, c(m, {
|
|
13
14
|
get when() {
|
|
14
|
-
return
|
|
15
|
+
return l.title;
|
|
15
16
|
},
|
|
16
17
|
get children() {
|
|
17
18
|
var e = B();
|
|
18
|
-
return
|
|
19
|
+
return r(e, () => l.title), e;
|
|
19
20
|
}
|
|
20
|
-
}), null), r
|
|
21
|
-
class: "w-3 h-3 shrink-0"
|
|
22
|
-
}), f), t(f, () => a.config.strings.topBar.searchPlaceholder), t(r, d(h, {
|
|
21
|
+
}), null), r(b, c(m, {
|
|
23
22
|
get when() {
|
|
24
|
-
return
|
|
23
|
+
return l.accessory;
|
|
25
24
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
keyed: !0,
|
|
26
|
+
get fallback() {
|
|
27
|
+
return (() => {
|
|
28
|
+
var e = j(), o = e.firstChild;
|
|
29
|
+
return e.$$click = () => i() && v.open(), r(e, c(_, {
|
|
30
|
+
class: "w-3 h-3 shrink-0"
|
|
31
|
+
}), o), r(o, () => d.config.strings.topBar.searchPlaceholder), r(e, c(m, {
|
|
32
|
+
get when() {
|
|
33
|
+
return i();
|
|
34
|
+
},
|
|
35
|
+
get children() {
|
|
36
|
+
var t = V();
|
|
37
|
+
return r(t, () => v.getKeybindDisplay(d.config.commands.palette.keybind)), t;
|
|
38
|
+
}
|
|
39
|
+
}), null), h((t) => {
|
|
40
|
+
var s = !i(), g = k("flex-1 max-w-sm flex items-center gap-2 h-[26px] px-2.5", i() ? "cursor-pointer" : "cursor-not-allowed", "text-caption text-[var(--floe-ink-soft)] tracking-tight", "bg-[var(--floe-well)] hover:bg-[var(--floe-well-strong)] rounded-control", "border border-[var(--floe-line)]", "transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-in-out)]", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", !i() && "opacity-50 hover:bg-transparent");
|
|
41
|
+
return s !== t.e && (e.disabled = t.e = s), g !== t.t && x(e, t.t = g), t;
|
|
42
|
+
}, {
|
|
43
|
+
e: void 0,
|
|
44
|
+
t: void 0
|
|
45
|
+
}), e;
|
|
46
|
+
})();
|
|
47
|
+
},
|
|
48
|
+
children: (e) => (() => {
|
|
49
|
+
var o = A();
|
|
50
|
+
return r(o, e), o;
|
|
51
|
+
})()
|
|
52
|
+
}), u), r(u, () => l.actions), h((e) => {
|
|
53
|
+
var o = y() ? "" : void 0, t = k(
|
|
32
54
|
// Safe-area padding must not be applied on a fixed-height element (border-box),
|
|
33
55
|
// otherwise the content gets squeezed on iOS notch devices.
|
|
34
56
|
"shrink-0 bg-background border-b border-[var(--floe-line)] safe-top safe-left safe-right",
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
-
return
|
|
57
|
+
l.class
|
|
58
|
+
), s = l.ariaLabel;
|
|
59
|
+
return o !== e.e && p(a, "data-floe-visible-header", e.e = o), t !== e.t && x(a, e.t = t), s !== e.a && p(a, "aria-label", e.a = s), e;
|
|
38
60
|
}, {
|
|
39
61
|
e: void 0,
|
|
40
62
|
t: void 0,
|
|
41
|
-
a: void 0
|
|
42
|
-
|
|
43
|
-
}), l;
|
|
63
|
+
a: void 0
|
|
64
|
+
}), a;
|
|
44
65
|
})();
|
|
45
66
|
}
|
|
46
67
|
w(["click"]);
|
|
47
68
|
export {
|
|
48
|
-
|
|
69
|
+
q as TopBar
|
|
49
70
|
};
|