@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.
@@ -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 upward from a measurable layout anchor.
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 R, className as ie, style as he, memo as ve, template as we } from "solid-js/web";
2
- import { createSignal as L, createEffect as X, untrack as k, onCleanup as K, Show as be } from "solid-js";
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 j(e, r) {
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 se(e) {
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 xe(e) {
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 Ee(e, r, u, f, N, F) {
45
- const A = r.ownerDocument.defaultView, m = A ? J(A).visible : null, D = m?.left ?? 0, q = m?.top ?? 0, O = m?.width ?? e.left + e.width, S = m?.height ?? e.top + e.height, P = xe(r), C = D + P.left + F, h = D + O - P.right - F, v = q + P.top + F, y = q + S - (A && J(A).keyboardOpen ? 0 : P.bottom), w = Math.max(0, h - C), b = Math.min(u, f, w), M = e.left + (e.width - b) / 2, V = Math.max(C, Math.min(M, h - b)), x = Math.min(e.top + e.height, y), H = Math.max(e.height, x - v), z = Math.min(N, H);
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: V,
48
- top: x - z,
49
- width: b,
50
- height: z
57
+ left: M,
58
+ top: R - I,
59
+ width: A,
60
+ height: I
51
61
  };
52
62
  }
53
- function ae(e, r) {
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 Pe(e, r) {
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] = L(null), [f, N] = L(!1), [F, A] = L(!1), [m, D] = L(null), [q, O] = L(null), [S, P] = L("collapsed");
71
- let C = null, h = 0, v = 0, y = null, w = null, b = null, M = !1, V = !1;
72
- const x = (i) => {
73
- S() !== i && (P(i), e.onPhaseChange?.(i));
74
- }, H = () => r()?.ownerDocument.defaultView ?? e.anchor?.ownerDocument.defaultView ?? null, z = () => H()?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1, Q = (i) => {
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 a = r();
78
- if (a) {
79
- N(a.isConnected);
80
- const l = !!(t && a === n);
81
- return A(l), {
82
- mount: a,
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 N(!1), A(!1), {
96
+ return P(!1), O(!1), {
87
97
  mount: null,
88
98
  ready: !1
89
99
  };
90
- }, Y = (i) => {
91
- const n = se(e.anchor);
92
- n && O(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
- } = Q(n), a = n ?? q();
97
- return !a || !o || !t ? null : i ? Ee(a, o, j(e.expandedWidth, a.width), j(e.maxWidth, ye), j(e.maxHeight, Fe), De(e.viewportPadding, Ae)) : a;
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
- h && y && y.cancelAnimationFrame(h), v && w && w.cancelAnimationFrame(v), h = 0, v = 0, y = null, w = null, b = null;
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 = Y(i);
111
+ const o = T(i);
102
112
  if (!o) return;
103
- const t = m(), a = i ? "expanded" : "collapsed";
104
- if (!n && ae(t, o) && b) return;
105
- if (!n || z() || ae(t, o)) {
106
- D(o), b = null, x(a);
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
- b = ["height", "width", "top", "left"].find((c) => t?.[c] !== o[c]) ?? null, x(i ? "expanding" : "collapsing");
110
- const l = H();
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
- D(o), x(a);
122
+ y(o), M(s);
113
123
  return;
114
124
  }
115
- v = l.requestAnimationFrame(() => {
116
- v = 0, w = null, D(k(() => Y(i)) ?? o);
117
- }), w = l;
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 && (h || v)) return;
120
- const o = H();
129
+ if (!i && (w || h)) return;
130
+ const o = R();
121
131
  if (!o) {
122
132
  $(n, i);
123
133
  return;
124
134
  }
125
- h && y && y.cancelAnimationFrame(h), v && w && w.cancelAnimationFrame(v), v = 0, w = null, h = o.requestAnimationFrame(() => {
126
- h = 0, y = null, k(() => $(n, i));
127
- }), y = o;
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
- X(() => {
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), N(!1), A(!1), D(null), O(null), C = null, e.surfaceRef?.(null), e.contentHostRef?.(null), M = !1, V = o;
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 = se(e.anchor);
136
- if (t && O(t), Q(t), !n) {
137
- M = !1, V = o;
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 a = !M, l = V !== o;
141
- M = !0, V = o, p(!a && l, o);
142
- }), X(() => {
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(), a = /* @__PURE__ */ new Set();
145
- for (const s of [i, n, o]) {
146
- if (!s) continue;
147
- t.add(s.ownerDocument);
148
- const d = s.ownerDocument.defaultView;
149
- d && a.add(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 (a.size === 0 || t.size === 0) return;
152
- const l = () => p(!1, k(() => e.open)), c = [];
153
- for (const s of /* @__PURE__ */ new Set([i, n, o])) {
154
- const d = s?.ownerDocument.defaultView;
155
- if (!s || !d || typeof d.ResizeObserver != "function") continue;
156
- const E = new d.ResizeObserver(l);
157
- E.observe(s), c.push(E);
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, I = n?.isConnected ?? !1, T = o?.isConnected ?? !1;
160
- const W = [];
161
- for (const s of t) {
162
- const d = s.defaultView;
163
- if (!d || typeof d.MutationObserver != "function" || !s.documentElement) continue;
164
- const E = new d.MutationObserver(() => {
165
- const B = i?.isConnected ?? !1, ee = n?.isConnected ?? !1, te = o?.isConnected ?? !1;
166
- g === B && I === ee && T === te || (g = B, I = ee, T = te, k(l));
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
- E.observe(s.documentElement, {
178
+ x.observe(a.documentElement, {
169
179
  childList: !0,
170
180
  subtree: !0
171
- }), W.push(E);
181
+ }), B.push(x);
172
182
  }
173
- const G = [...a].map((s) => {
174
- let d = JSON.stringify(J(s));
175
- return ge(s, (E) => {
176
- const B = JSON.stringify(E);
177
- B !== d && (d = B, k(l));
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 s of t) s.addEventListener("scroll", l, !0);
181
- K(() => {
182
- for (const s of c) s.disconnect();
183
- for (const s of W) s.disconnect();
184
- for (const s of G) s();
185
- for (const s of t) s.removeEventListener("scroll", l, !0);
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
- }), X(() => {
188
- if (!e.retained || !e.visible || !e.open || !f() || !F() || !m()) return;
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 C && g.includes(C) || e.anchor && g.includes(e.anchor) ? !0 : e.isOwnedInteraction?.(c) ?? !1;
194
- }, a = (c) => {
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
- !C?.contains(g) && !e.isOwnedInteraction?.(c) || (c.preventDefault(), e.onDismiss?.("escape"));
209
+ !m?.contains(g) && !e.isOwnedInteraction?.(c) || (c.preventDefault(), e.onDismiss?.("escape"));
200
210
  };
201
- n.addEventListener("pointerdown", a, !0), o.addEventListener("keydown", l), K(() => {
202
- n.removeEventListener("pointerdown", a, !0), o.removeEventListener("keydown", l);
211
+ n.addEventListener("pointerdown", s, !0), o.addEventListener("keydown", l), Q(() => {
212
+ n.removeEventListener("pointerdown", s, !0), o.removeEventListener("keydown", l);
203
213
  });
204
- }), K(() => {
214
+ }), Q(() => {
205
215
  Z(), e.surfaceRef?.(null), e.contentHostRef?.(null);
206
216
  });
207
217
  const ce = (i) => {
208
- C = i, e.surfaceRef?.(i);
218
+ m = i, e.surfaceRef?.(i);
209
219
  }, le = (i) => {
210
220
  e.contentHostRef?.(i);
211
221
  }, ue = (i) => {
212
- if (i.target !== C || i.propertyName !== b) return;
222
+ if (i.target !== m || i.propertyName !== D) return;
213
223
  const n = e.open ? "expanding" : "collapsing";
214
- S() === n && (b = null, x(e.open ? "expanded" : "collapsed"));
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 a = e.id, l = e.label, c = !e.visible || !f() || !F() || !m() ? "true" : void 0, g = !e.visible || !f() || !F() || !m(), I = re("floe-bottom-bar-companion", e.class), T = S(), W = e.visible && f() && F() ? "visible" : "hidden", G = m() ? "true" : "false", s = Pe(m(), r()), d = re("floe-bottom-bar-companion__content", e.contentClass);
228
- return a !== t.e && R(n, "id", t.e = a), l !== t.t && R(n, "aria-label", t.t = l), c !== t.a && R(n, "aria-hidden", t.a = c), g !== t.o && (n.inert = t.o = g), I !== t.i && ie(n, t.i = I), T !== t.n && R(n, "data-companion-phase", t.n = T), W !== t.s && R(n, "data-companion-visibility", t.s = W), G !== t.h && R(n, "data-companion-frame-ready", t.h = G), t.r = he(n, s, t.r), d !== t.d && ie(o, t.d = d), t;
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,
@@ -2,6 +2,7 @@ import { type Component, type JSX } from 'solid-js';
2
2
  export interface DisplayModePageShellProps {
3
3
  logo?: JSX.Element;
4
4
  actions?: JSX.Element;
5
+ topBarAccessory?: () => JSX.Element;
5
6
  title?: string;
6
7
  children: JSX.Element;
7
8
  }
@@ -1,10 +1,10 @@
1
- import { insert as r, createComponent as a, template as o } from "solid-js/web";
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 n = /* @__PURE__ */ o("<div class=display-mode-page-shell><main class=display-mode-page-shell__body>");
5
- const p = (e) => (() => {
6
- var t = n(), l = t.firstChild;
7
- return r(t, a(i, {
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
- }), l), r(l, () => e.children), t;
21
+ }), r), a(r, () => e.children), t;
19
22
  })();
20
23
  export {
21
- p as DisplayModePageShell
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 k, 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 A, createMemo as T, For as Fe, Show as m, batch as Ee } from "solid-js";
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
- A(() => {
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
- A(() => {
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
- A(() => {
94
+ k(() => {
95
95
  c() && S(!1);
96
- }), A(() => {
96
+ }), k(() => {
97
97
  l() || S(!1);
98
- }), A(() => {
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
- }))), ke = (e) => {
117
+ }))), Ae = (e) => {
118
118
  h() ? (e || W.get(r.sidebarActiveTab())?.focus({
119
119
  preventScroll: !0
120
120
  }), L(!e)) : r.setSidebarCollapsed(e);
121
- }, Ae = 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) => ({
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 Ae();
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
- A(() => {
145
+ k(() => {
146
146
  l() && N() && S(!1);
147
- }), A(() => {
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 : ke;
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(() => k(t, x("absolute inset-0 z-40 bg-black/30 cursor-pointer", i.slotClassNames?.mobileSidebarBackdrop))), t;
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 && k(t, v.e = O), R !== v.t && C(t, "aria-label", v.t = R), v;
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 && k(t, u.e = y), v !== u.t && j(t, "height", u.t = v), u;
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 && k(e, t.t = y), v !== t.a && C(a, "href", t.a = v), O !== t.o && k(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 && k(g, t.l = ie), re !== t.u && k(H, t.u = re), ne !== t.c && C(H, "id", t.c = ne), ae !== t.w && C(H, "aria-label", t.w = ae), 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,
@@ -3,6 +3,7 @@ export interface TopBarProps {
3
3
  logo?: JSX.Element;
4
4
  title?: string;
5
5
  actions?: JSX.Element;
6
+ accessory?: () => JSX.Element;
6
7
  ariaLabel?: string;
7
8
  class?: string;
8
9
  }
@@ -1,49 +1,70 @@
1
- import { insert as t, createComponent as d, effect as y, className as v, setAttribute as $, template as i, delegateEvents as w } from "solid-js/web";
2
- import { Show as h } from "solid-js";
3
- import { cn as p } from "../../utils/cn.js";
4
- import { useCommand as _ } from "../../context/CommandContext.js";
5
- import { Search as C } from "../icons/index.js";
6
- import { useResolvedFloeConfig as S } from "../../context/FloeConfigContext.js";
7
- var B = /* @__PURE__ */ i('<span class="font-medium text-caption tracking-tight hidden sm:inline">'), E = /* @__PURE__ */ i('<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">'), F = /* @__PURE__ */ i('<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><button type=button><span class="flex-1 text-left hidden sm:inline truncate"></span></button><div class="flex items-center gap-0.5">'), j = /* @__PURE__ */ i('<div class="w-6 h-6 rounded-xs bg-primary flex items-center justify-center text-primary-foreground text-xs font-bold">F');
8
- function R(o) {
9
- const c = _(), a = S(), n = () => a.config.commands.palette.enabled;
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 l = F(), x = l.firstChild, s = x.firstChild, r = s.nextSibling, f = r.firstChild, k = r.nextSibling;
12
- return t(s, () => o.logo || j(), null), t(s, d(h, {
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 o.title;
15
+ return l.title;
15
16
  },
16
17
  get children() {
17
18
  var e = B();
18
- return t(e, () => o.title), e;
19
+ return r(e, () => l.title), e;
19
20
  }
20
- }), null), r.$$click = () => n() && c.open(), t(r, d(C, {
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 n();
23
+ return l.accessory;
25
24
  },
26
- get children() {
27
- var e = E();
28
- return t(e, () => c.getKeybindDisplay(a.config.commands.palette.keybind)), e;
29
- }
30
- }), null), t(k, () => o.actions), y((e) => {
31
- var m = p(
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
- o.class
36
- ), b = o.ariaLabel, g = !n(), u = p("flex-1 max-w-sm flex items-center gap-2 h-[26px] px-2.5", n() ? "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", !n() && "opacity-50 hover:bg-transparent");
37
- return m !== e.e && v(l, e.e = m), b !== e.t && $(l, "aria-label", e.t = b), g !== e.a && (r.disabled = e.a = g), u !== e.o && v(r, e.o = u), e;
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
- o: void 0
43
- }), l;
63
+ a: void 0
64
+ }), a;
44
65
  })();
45
66
  }
46
67
  w(["click"]);
47
68
  export {
48
- R as TopBar
69
+ q as TopBar
49
70
  };