@floegence/floe-webapp-core 0.71.0 → 0.72.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,11 +1,11 @@
1
- import { insert as c, createComponent as d, effect as S, className as v, setAttribute as C, template as b, Dynamic as W, memo as M, use as R, delegateEvents as z } from "solid-js/web";
2
- import { createSignal as I, onMount as D, onCleanup as E, Show as A, For as j } from "solid-js";
1
+ import { insert as c, createComponent as d, effect as $, className as v, setAttribute as A, template as b, Dynamic as W, memo as M, use as R, delegateEvents as z } from "solid-js/web";
2
+ import { createSignal as L, onMount as D, onCleanup as E, Show as S, For as j } from "solid-js";
3
3
  import { cn as g } from "../../utils/cn.js";
4
- import { deferNonBlocking as L } from "../../utils/defer.js";
4
+ import { deferNonBlocking as _ } from "../../utils/defer.js";
5
5
  var q = /* @__PURE__ */ b('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), B = /* @__PURE__ */ b('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), K = /* @__PURE__ */ b('<nav data-floe-shell-slot=mobile-tab-bar style=border-top-color:var(--bottom-bar-border)><div class="relative h-14"><div class="h-full flex items-center overflow-x-auto scrollbar-hide snap-x snap-mandatory"role=tablist aria-orientation=horizontal style=-webkit-overflow-scrolling:touch>'), N = /* @__PURE__ */ b("<span>"), T = /* @__PURE__ */ b('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), H = /* @__PURE__ */ b("<button type=button role=tab><div></div><span>");
6
6
  function P(e) {
7
7
  let i;
8
- const [o, u] = I(!1), [h, t] = I(!1);
8
+ const [a, u] = L(!1), [h, t] = L(!1);
9
9
  let n = null;
10
10
  const s = () => {
11
11
  i && (u(i.scrollLeft > 0), t(i.scrollLeft < i.scrollWidth - i.clientWidth - 1));
@@ -19,35 +19,35 @@ function P(e) {
19
19
  n = null, s();
20
20
  });
21
21
  }
22
- }, k = () => e.items, w = (l) => {
23
- const r = k()[l];
24
- if (r) {
25
- if (r.onClick) {
26
- L(() => r.onClick());
22
+ }, k = () => e.items, w = (r) => {
23
+ const l = k()[r];
24
+ if (l) {
25
+ if (l.onClick) {
26
+ _(() => l.onClick());
27
27
  return;
28
28
  }
29
- e.onSelect(r.id);
29
+ e.onSelect(l.id);
30
30
  }
31
31
  };
32
32
  return D(() => {
33
33
  s();
34
- const l = e.items.findIndex((r) => r.id === e.activeId);
35
- if (l > 0 && i) {
36
- const r = i.scrollWidth / e.items.length;
37
- i.scrollLeft = Math.max(0, r * l - i.clientWidth / 2 + r / 2);
34
+ const r = e.items.findIndex((l) => l.id === e.activeId);
35
+ if (r > 0 && i) {
36
+ const l = i.scrollWidth / e.items.length;
37
+ i.scrollLeft = Math.max(0, l * r - i.clientWidth / 2 + l / 2);
38
38
  }
39
39
  }), E(() => {
40
40
  n !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(n), n = null);
41
41
  }), (() => {
42
- var l = K(), r = l.firstChild, m = r.firstChild;
43
- c(r, d(A, {
42
+ var r = K(), l = r.firstChild, m = l.firstChild;
43
+ c(l, d(S, {
44
44
  get when() {
45
- return o();
45
+ return a();
46
46
  },
47
47
  get children() {
48
48
  return q();
49
49
  }
50
- }), m), c(r, d(A, {
50
+ }), m), c(l, d(S, {
51
51
  get when() {
52
52
  return h();
53
53
  },
@@ -55,15 +55,15 @@ function P(e) {
55
55
  return B();
56
56
  }
57
57
  }), m), m.addEventListener("scroll", x);
58
- var $ = i;
59
- return typeof $ == "function" ? R($, m) : i = m, c(m, d(j, {
58
+ var I = i;
59
+ return typeof I == "function" ? R(I, m) : i = m, c(m, d(j, {
60
60
  get each() {
61
61
  return e.items;
62
62
  },
63
- children: (a, y) => d(U, {
64
- item: a,
63
+ children: (o, y) => d(U, {
64
+ item: o,
65
65
  get isActive() {
66
- return e.activeId === a.id;
66
+ return e.activeId === o.id;
67
67
  },
68
68
  get index() {
69
69
  return y();
@@ -73,30 +73,31 @@ function P(e) {
73
73
  },
74
74
  onClick: () => {
75
75
  "vibrate" in navigator && navigator.vibrate(10);
76
- const f = a.onClick, _ = e.onSelect, F = a.id;
77
- a.onClick ? L(() => f()) : _(F);
76
+ const f = o.onClick, C = e.onSelect, F = o.id;
77
+ o.onClick ? _(() => f()) : C(F);
78
78
  },
79
79
  onKeyboardSelect: (f) => w(f)
80
80
  })
81
- })), S((a) => {
82
- var y = g(
81
+ })), $((o) => {
82
+ var y = e.hidden, f = g(
83
83
  // Same safe-area rule as TopBar: keep the visual bar height stable, and
84
84
  // add safe-area padding on an outer wrapper (avoid squeezing content).
85
85
  "relative shrink-0 bg-background border-t border-border safe-bottom safe-left safe-right",
86
86
  e.class
87
- ), f = e.ariaLabel;
88
- return y !== a.e && v(l, a.e = y), f !== a.t && C(l, "aria-label", a.t = f), a;
87
+ ), C = e.ariaLabel;
88
+ return y !== o.e && (r.hidden = o.e = y), f !== o.t && v(r, o.t = f), C !== o.a && A(r, "aria-label", o.a = C), o;
89
89
  }, {
90
90
  e: void 0,
91
- t: void 0
92
- }), l;
91
+ t: void 0,
92
+ a: void 0
93
+ }), r;
93
94
  })();
94
95
  }
95
96
  function U(e) {
96
97
  const i = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
97
98
  return (() => {
98
- var o = H(), u = o.firstChild, h = u.nextSibling;
99
- return o.$$keydown = (t) => {
99
+ var a = H(), u = a.firstChild, h = u.nextSibling;
100
+ return a.$$keydown = (t) => {
100
101
  let n = null;
101
102
  switch (t.key) {
102
103
  case "ArrowRight":
@@ -117,12 +118,12 @@ function U(e) {
117
118
  return;
118
119
  }
119
120
  t.preventDefault(), e.onKeyboardSelect(n);
120
- }, o.$$click = () => e.onClick(), c(u, d(W, {
121
+ }, a.$$click = () => e.onClick(), c(u, d(W, {
121
122
  get component() {
122
123
  return e.item.icon;
123
124
  },
124
125
  class: "w-6 h-6"
125
- }), null), c(u, d(A, {
126
+ }), null), c(u, d(S, {
126
127
  get when() {
127
128
  return i();
128
129
  },
@@ -131,18 +132,18 @@ function U(e) {
131
132
  return c(t, (() => {
132
133
  var n = M(() => typeof i() == "number" && i() > 99);
133
134
  return () => n() ? "99+" : i();
134
- })()), S(() => v(t, g("absolute -top-1 -right-2 min-w-4 h-4 px-1", "flex items-center justify-center", "text-[10px] font-medium rounded-full", "bg-primary text-primary-foreground"))), t;
135
+ })()), $(() => v(t, g("absolute -top-1 -right-2 min-w-4 h-4 px-1", "flex items-center justify-center", "text-[10px] font-medium rounded-full", "bg-primary text-primary-foreground"))), t;
135
136
  }
136
- }), null), c(h, () => e.item.label), c(o, d(A, {
137
+ }), null), c(h, () => e.item.label), c(a, d(S, {
137
138
  get when() {
138
139
  return e.isActive;
139
140
  },
140
141
  get children() {
141
142
  return T();
142
143
  }
143
- }), null), S((t) => {
144
- var n = g("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-[color] duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), s = e.item.label, x = e.isActive, k = e.isActive ? 0 : -1, w = g("relative transition-transform duration-150", e.isActive && "scale-110"), l = g("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
145
- return n !== t.e && v(o, t.e = n), s !== t.t && C(o, "aria-label", t.t = s), x !== t.a && C(o, "aria-selected", t.a = x), k !== t.o && C(o, "tabindex", t.o = k), w !== t.i && v(u, t.i = w), l !== t.n && v(h, t.n = l), t;
144
+ }), null), $((t) => {
145
+ var n = g("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-[color] duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), s = e.item.label, x = e.isActive, k = e.isActive ? 0 : -1, w = g("relative transition-transform duration-150", e.isActive && "scale-110"), r = g("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
146
+ return n !== t.e && v(a, t.e = n), s !== t.t && A(a, "aria-label", t.t = s), x !== t.a && A(a, "aria-selected", t.a = x), k !== t.o && A(a, "tabindex", t.o = k), w !== t.i && v(u, t.i = w), r !== t.n && v(h, t.n = r), t;
146
147
  }, {
147
148
  e: void 0,
148
149
  t: void 0,
@@ -150,7 +151,7 @@ function U(e) {
150
151
  o: void 0,
151
152
  i: void 0,
152
153
  n: void 0
153
- }), o;
154
+ }), a;
154
155
  })();
155
156
  }
156
157
  z(["click", "keydown"]);
@@ -26,6 +26,8 @@ export interface ShellSlotClassNames {
26
26
  }
27
27
  export interface ShellProps {
28
28
  children: JSX.Element;
29
+ /** Fill a containing AppViewport or embedded host instead of the document viewport. */
30
+ fillParent?: boolean;
29
31
  logo?: JSX.Element;
30
32
  activityItems?: ActivityBarItem[];
31
33
  activityBottomItems?: ActivityBarItem[];
@@ -41,6 +43,10 @@ export interface ShellProps {
41
43
  activityBottomItemsMobileMode?: 'hidden' | 'topBar';
42
44
  topBarActions?: JSX.Element;
43
45
  bottomBarItems?: JSX.Element;
46
+ /** Stable content directly above mobile navigation, such as a composer anchor. */
47
+ mobileAccessory?: JSX.Element;
48
+ /** Hide navigation only while a focused editor is occluded by the soft keyboard. */
49
+ hideMobileNavigationWhenKeyboardOpen?: boolean;
44
50
  sidebarContent?: (activeTab: string) => JSX.Element;
45
51
  /** Defer user-requested Activity content commits until the selected control has painted. */
46
52
  activitySelectionMode?: 'sync' | 'ui-first';