@floegence/floe-webapp-core 0.34.0 → 0.35.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,61 +1,61 @@
1
- import { insert as a, createComponent as l, effect as f, className as b, template as s, Dynamic as A, memo as k, setAttribute as x, delegateEvents as w } from "solid-js/web";
2
- import { createMemo as v, For as y, Show as m } from "solid-js";
3
- import { cn as g } from "../../utils/cn.js";
1
+ import { insert as o, createComponent as l, effect as f, className as b, template as u, Dynamic as A, memo as k, setAttribute as y, delegateEvents as w } from "solid-js/web";
2
+ import { createMemo as v, For as x, Show as g } from "solid-js";
3
+ import { cn as m } from "../../utils/cn.js";
4
4
  import { deferNonBlocking as I } from "../../utils/defer.js";
5
5
  import { Tooltip as $ } from "../ui/Tooltip.js";
6
6
  import { resolveActivityBarClick as _ } from "./activityBarBehavior.js";
7
- var B = /* @__PURE__ */ s('<div class="flex flex-col">'), p = /* @__PURE__ */ s('<div><div class="flex flex-col">'), S = /* @__PURE__ */ s('<div class="absolute left-0 top-0 w-1 h-full bg-primary rounded-r">'), j = /* @__PURE__ */ s("<span>"), N = /* @__PURE__ */ s("<button type=button>");
7
+ var B = /* @__PURE__ */ u('<div class="flex flex-col">'), p = /* @__PURE__ */ u('<div data-floe-shell-slot=activity-bar style=border-right-color:var(--activity-bar-border)><div class="flex flex-col">'), S = /* @__PURE__ */ u('<div class="absolute left-0 top-0 w-1 h-full bg-primary rounded-r">'), j = /* @__PURE__ */ u("<span>"), N = /* @__PURE__ */ u("<button type=button>");
8
8
  function V(e) {
9
- const o = v(() => e.activeId), n = v(() => e.collapsed ?? !1), t = v(() => e.onActiveChange), c = v(() => e.onCollapsedChange), u = (i) => {
9
+ const a = v(() => e.activeId), r = v(() => e.collapsed ?? !1), t = v(() => e.onActiveChange), c = v(() => e.onCollapsedChange), s = (i) => {
10
10
  if (i.onClick) {
11
11
  I(() => i.onClick());
12
12
  return;
13
13
  }
14
- const r = _({
14
+ const n = _({
15
15
  clickedId: i.id,
16
- activeId: o(),
17
- collapsed: n(),
16
+ activeId: a(),
17
+ collapsed: r(),
18
18
  behavior: i.collapseBehavior
19
19
  });
20
- r.nextActiveId !== o() && (typeof r.openSidebar == "boolean" ? t()(r.nextActiveId, {
21
- openSidebar: r.openSidebar
22
- }) : t()(r.nextActiveId)), typeof r.nextCollapsed == "boolean" && c()?.(r.nextCollapsed);
20
+ n.nextActiveId !== a() && (typeof n.openSidebar == "boolean" ? t()(n.nextActiveId, {
21
+ openSidebar: n.openSidebar
22
+ }) : t()(n.nextActiveId)), typeof n.nextCollapsed == "boolean" && c()?.(n.nextCollapsed);
23
23
  };
24
24
  return (() => {
25
- var i = p(), r = i.firstChild;
26
- return a(r, l(y, {
25
+ var i = p(), n = i.firstChild;
26
+ return o(n, l(x, {
27
27
  get each() {
28
28
  return e.items;
29
29
  },
30
30
  children: (d) => l(C, {
31
31
  item: d,
32
32
  get isActive() {
33
- return o() === d.id;
33
+ return a() === d.id;
34
34
  },
35
- onClick: () => u(d)
35
+ onClick: () => s(d)
36
36
  })
37
- })), a(i, l(m, {
37
+ })), o(i, l(g, {
38
38
  get when() {
39
39
  return e.bottomItems?.length;
40
40
  },
41
41
  get children() {
42
42
  var d = B();
43
- return a(d, l(y, {
43
+ return o(d, l(x, {
44
44
  get each() {
45
45
  return e.bottomItems;
46
46
  },
47
47
  children: (h) => l(C, {
48
48
  item: h,
49
49
  isActive: !1,
50
- onClick: () => u(h)
50
+ onClick: () => s(h)
51
51
  })
52
52
  })), d;
53
53
  }
54
- }), null), f(() => b(i, g("w-10 md:w-12 flex flex-col justify-between shrink-0 min-h-0", "bg-activity-bar border-r border-border", e.class))), i;
54
+ }), null), f(() => b(i, m("w-10 md:w-12 flex flex-col justify-between shrink-0 min-h-0", "bg-activity-bar border-r border-border", e.class))), i;
55
55
  })();
56
56
  }
57
57
  function C(e) {
58
- const o = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
58
+ const a = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
59
59
  return l($, {
60
60
  get content() {
61
61
  return e.item.label;
@@ -63,38 +63,38 @@ function C(e) {
63
63
  placement: "right",
64
64
  delay: 0,
65
65
  get children() {
66
- var n = N();
67
- return n.$$click = () => e.onClick(), a(n, l(m, {
66
+ var r = N();
67
+ return r.$$click = () => e.onClick(), o(r, l(g, {
68
68
  get when() {
69
69
  return e.isActive;
70
70
  },
71
71
  get children() {
72
72
  return S();
73
73
  }
74
- }), null), a(n, l(A, {
74
+ }), null), o(r, l(A, {
75
75
  get component() {
76
76
  return e.item.icon;
77
77
  },
78
78
  class: "w-5 h-5"
79
- }), null), a(n, l(m, {
79
+ }), null), o(r, l(g, {
80
80
  get when() {
81
- return o();
81
+ return a();
82
82
  },
83
83
  get children() {
84
84
  var t = j();
85
- return a(t, (() => {
86
- var c = k(() => typeof o() == "number" && o() > 99);
87
- return () => c() ? "99+" : o();
88
- })()), f(() => b(t, g("absolute top-0.5 right-0.5 min-w-3.5 h-3.5 px-1", "flex items-center justify-center", "text-[9px] font-medium rounded-full", "bg-activity-bar-badge text-activity-bar-badge-foreground"))), t;
85
+ return o(t, (() => {
86
+ var c = k(() => typeof a() == "number" && a() > 99);
87
+ return () => c() ? "99+" : a();
88
+ })()), f(() => b(t, m("absolute top-0.5 right-0.5 min-w-3.5 h-3.5 px-1", "flex items-center justify-center", "text-[9px] font-medium rounded-full", "bg-activity-bar-badge text-activity-bar-badge-foreground"))), t;
89
89
  }
90
90
  }), null), f((t) => {
91
- var c = g("relative w-full aspect-square flex items-center justify-center cursor-pointer", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset", e.isActive ? "text-activity-bar-foreground-active bg-accent/80" : "text-activity-bar-foreground hover:text-activity-bar-foreground-active hover:bg-accent/40"), u = e.item.label, i = e.isActive;
92
- return c !== t.e && b(n, t.e = c), u !== t.t && x(n, "aria-label", t.t = u), i !== t.a && x(n, "aria-pressed", t.a = i), t;
91
+ var c = m("relative w-full aspect-square flex items-center justify-center cursor-pointer", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset", e.isActive ? "text-activity-bar-foreground-active bg-accent/80" : "text-activity-bar-foreground hover:text-activity-bar-foreground-active hover:bg-accent/40"), s = e.item.label, i = e.isActive;
92
+ return c !== t.e && b(r, t.e = c), s !== t.t && y(r, "aria-label", t.t = s), i !== t.a && y(r, "aria-pressed", t.a = i), t;
93
93
  }, {
94
94
  e: void 0,
95
95
  t: void 0,
96
96
  a: void 0
97
- }), n;
97
+ }), r;
98
98
  }
99
99
  });
100
100
  }
@@ -1,16 +1,16 @@
1
- import { insert as r, effect as u, className as a, createComponent as c, template as i, delegateEvents as f } from "solid-js/web";
1
+ import { insert as n, effect as a, className as u, createComponent as c, template as i, delegateEvents as b } from "solid-js/web";
2
2
  import { Show as s } from "solid-js";
3
3
  import { cn as m } from "../../utils/cn.js";
4
- import { useResolvedFloeConfig as b } from "../../context/FloeConfigContext.js";
5
- var h = /* @__PURE__ */ i("<footer>"), g = /* @__PURE__ */ i('<span class="w-2.5 h-2.5">'), $ = /* @__PURE__ */ i("<button type=button>"), d = /* @__PURE__ */ i("<span>");
4
+ import { useResolvedFloeConfig as f } from "../../context/FloeConfigContext.js";
5
+ var h = /* @__PURE__ */ i("<footer data-floe-shell-slot=bottom-bar style=border-top-color:var(--bottom-bar-border)>"), g = /* @__PURE__ */ i('<span class="w-2.5 h-2.5">'), $ = /* @__PURE__ */ i("<button type=button>"), d = /* @__PURE__ */ i("<span>");
6
6
  function C(e) {
7
7
  return (() => {
8
- var n = h();
9
- return r(n, () => e.children), u(() => a(n, m("h-5 shrink-0 flex items-center justify-between px-1.5", "bg-background border-t border-border", "text-[10px] text-muted-foreground font-mono", e.class))), n;
8
+ var r = h();
9
+ return n(r, () => e.children), a(() => u(r, m("h-5 shrink-0 flex items-center justify-between px-1.5", "bg-background border-t border-border", "text-[10px] text-muted-foreground font-mono", e.class))), r;
10
10
  })();
11
11
  }
12
12
  function v(e) {
13
- const n = () => m("flex items-center gap-1 px-1 py-0.5 rounded-sm", e.onClick && "hover:bg-muted/80 cursor-pointer", "transition-colors duration-75", e.class);
13
+ const r = () => m("flex items-center gap-1 px-1 py-0.5 rounded-sm", e.onClick && "hover:bg-muted/80 cursor-pointer", "transition-colors duration-75", e.class);
14
14
  return c(s, {
15
15
  get when() {
16
16
  return e.onClick;
@@ -18,53 +18,53 @@ function v(e) {
18
18
  get fallback() {
19
19
  return (() => {
20
20
  var t = d();
21
- return r(t, c(s, {
21
+ return n(t, c(s, {
22
22
  get when() {
23
23
  return e.icon;
24
24
  },
25
25
  get children() {
26
26
  var o = g();
27
- return r(o, () => e.icon), o;
27
+ return n(o, () => e.icon), o;
28
28
  }
29
- }), null), r(t, () => e.children, null), u(() => a(t, n())), t;
29
+ }), null), n(t, () => e.children, null), a(() => u(t, r())), t;
30
30
  })();
31
31
  },
32
32
  get children() {
33
33
  var t = $();
34
- return t.$$click = () => e.onClick?.(), r(t, c(s, {
34
+ return t.$$click = () => e.onClick?.(), n(t, c(s, {
35
35
  get when() {
36
36
  return e.icon;
37
37
  },
38
38
  get children() {
39
39
  var o = g();
40
- return r(o, () => e.icon), o;
40
+ return n(o, () => e.icon), o;
41
41
  }
42
- }), null), r(t, () => e.children, null), u(() => a(t, n())), t;
42
+ }), null), n(t, () => e.children, null), a(() => u(t, r())), t;
43
43
  }
44
44
  });
45
45
  }
46
- function B(e) {
47
- const n = b(), t = {
46
+ function y(e) {
47
+ const r = f(), t = {
48
48
  connected: "bg-success",
49
49
  disconnected: "bg-muted-foreground",
50
50
  connecting: "bg-warning animate-pulse",
51
51
  error: "bg-error"
52
- }, o = () => n.config.strings.statusIndicator;
52
+ }, o = () => r.config.strings.statusIndicator;
53
53
  return c(v, {
54
54
  get children() {
55
55
  return [(() => {
56
56
  var l = d();
57
- return u(() => a(l, m("w-1.5 h-1.5 rounded-full", t[e.status]))), l;
57
+ return a(() => u(l, m("w-1.5 h-1.5 rounded-full", t[e.status]))), l;
58
58
  })(), (() => {
59
59
  var l = d();
60
- return r(l, () => e.label ?? o()[e.status]), l;
60
+ return n(l, () => e.label ?? o()[e.status]), l;
61
61
  })()];
62
62
  }
63
63
  });
64
64
  }
65
- f(["click"]);
65
+ b(["click"]);
66
66
  export {
67
67
  C as BottomBar,
68
68
  v as BottomBarItem,
69
- B as StatusIndicator
69
+ y as StatusIndicator
70
70
  };
@@ -1,53 +1,53 @@
1
- import { insert as a, createComponent as c, effect as k, className as v, template as f, Dynamic as I, memo as L, setAttribute as y, use as F, delegateEvents as W } from "solid-js/web";
1
+ import { insert as a, createComponent as c, effect as k, className as v, template as f, Dynamic as I, memo as L, setAttribute as w, use as F, delegateEvents as W } from "solid-js/web";
2
2
  import { createSignal as C, onMount as M, onCleanup as R, Show as x, For as j } from "solid-js";
3
3
  import { cn as b } from "../../utils/cn.js";
4
4
  import { deferNonBlocking as $ } from "../../utils/defer.js";
5
- var q = /* @__PURE__ */ f('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), z = /* @__PURE__ */ f('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), B = /* @__PURE__ */ f('<nav><div class="relative h-14"><div class="h-full flex items-center overflow-x-auto scrollbar-hide snap-x snap-mandatory"style=-webkit-overflow-scrolling:touch>'), E = /* @__PURE__ */ f("<span>"), N = /* @__PURE__ */ f('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), T = /* @__PURE__ */ f("<button type=button role=tab><div></div><span>");
5
+ var q = /* @__PURE__ */ f('<div class="absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none">'), z = /* @__PURE__ */ f('<div class="absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none">'), B = /* @__PURE__ */ f('<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"style=-webkit-overflow-scrolling:touch>'), E = /* @__PURE__ */ f("<span>"), N = /* @__PURE__ */ f('<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-primary rounded-t">'), T = /* @__PURE__ */ f("<button type=button role=tab><div></div><span>");
6
6
  function K(e) {
7
7
  let n;
8
- const [l, s] = C(!1), [g, t] = C(!1);
9
- let i = null;
10
- const u = () => {
8
+ const [i, s] = C(!1), [g, t] = C(!1);
9
+ let r = null;
10
+ const d = () => {
11
11
  n && (s(n.scrollLeft > 0), t(n.scrollLeft < n.scrollWidth - n.clientWidth - 1));
12
12
  }, h = () => {
13
- if (i === null) {
13
+ if (r === null) {
14
14
  if (typeof requestAnimationFrame > "u") {
15
- u();
15
+ d();
16
16
  return;
17
17
  }
18
- i = requestAnimationFrame(() => {
19
- i = null, u();
18
+ r = requestAnimationFrame(() => {
19
+ r = null, d();
20
20
  });
21
21
  }
22
22
  };
23
23
  return M(() => {
24
- u();
25
- const o = e.items.findIndex((r) => r.id === e.activeId);
24
+ d();
25
+ const o = e.items.findIndex((l) => l.id === e.activeId);
26
26
  if (o > 0 && n) {
27
- const r = n.scrollWidth / e.items.length;
28
- n.scrollLeft = Math.max(0, r * o - n.clientWidth / 2 + r / 2);
27
+ const l = n.scrollWidth / e.items.length;
28
+ n.scrollLeft = Math.max(0, l * o - n.clientWidth / 2 + l / 2);
29
29
  }
30
30
  }), R(() => {
31
- i !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(i), i = null);
31
+ r !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(r), r = null);
32
32
  }), (() => {
33
- var o = B(), r = o.firstChild, d = r.firstChild;
34
- a(r, c(x, {
33
+ var o = B(), l = o.firstChild, u = l.firstChild;
34
+ a(l, c(x, {
35
35
  get when() {
36
- return l();
36
+ return i();
37
37
  },
38
38
  get children() {
39
39
  return q();
40
40
  }
41
- }), d), a(r, c(x, {
41
+ }), u), a(l, c(x, {
42
42
  get when() {
43
43
  return g();
44
44
  },
45
45
  get children() {
46
46
  return z();
47
47
  }
48
- }), d), d.addEventListener("scroll", h);
49
- var w = n;
50
- return typeof w == "function" ? F(w, d) : n = d, a(d, c(j, {
48
+ }), u), u.addEventListener("scroll", h);
49
+ var y = n;
50
+ return typeof y == "function" ? F(y, u) : n = u, a(u, c(j, {
51
51
  get each() {
52
52
  return e.items;
53
53
  },
@@ -73,8 +73,8 @@ function K(e) {
73
73
  function D(e) {
74
74
  const n = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
75
75
  return (() => {
76
- var l = T(), s = l.firstChild, g = s.nextSibling;
77
- return l.$$click = () => e.onClick(), a(s, c(I, {
76
+ var i = T(), s = i.firstChild, g = s.nextSibling;
77
+ return i.$$click = () => e.onClick(), a(s, c(I, {
78
78
  get component() {
79
79
  return e.item.icon;
80
80
  },
@@ -86,11 +86,11 @@ function D(e) {
86
86
  get children() {
87
87
  var t = E();
88
88
  return a(t, (() => {
89
- var i = L(() => typeof n() == "number" && n() > 99);
90
- return () => i() ? "99+" : n();
89
+ var r = L(() => typeof n() == "number" && n() > 99);
90
+ return () => r() ? "99+" : n();
91
91
  })()), k(() => v(t, b("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;
92
92
  }
93
- }), null), a(g, () => e.item.label), a(l, c(x, {
93
+ }), null), a(g, () => e.item.label), a(i, c(x, {
94
94
  get when() {
95
95
  return e.isActive;
96
96
  },
@@ -98,15 +98,15 @@ function D(e) {
98
98
  return N();
99
99
  }
100
100
  }), null), k((t) => {
101
- var i = b("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-all duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), u = e.item.label, h = e.isActive, o = b("relative transition-transform duration-150", e.isActive && "scale-110"), r = b("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
102
- return i !== t.e && v(l, t.e = i), u !== t.t && y(l, "aria-label", t.t = u), h !== t.a && y(l, "aria-selected", t.a = h), o !== t.o && v(s, t.o = o), r !== t.i && v(g, t.i = r), t;
101
+ var r = b("relative flex-shrink-0 flex flex-col items-center justify-center", "min-w-16 h-full px-4 snap-center", "transition-all duration-150", "focus:outline-none focus-visible:bg-muted", e.isActive ? "text-primary" : "text-muted-foreground active:text-foreground"), d = e.item.label, h = e.isActive, o = b("relative transition-transform duration-150", e.isActive && "scale-110"), l = b("mt-1 text-[10px] font-medium truncate max-w-full", e.isActive && "font-semibold");
102
+ return r !== t.e && v(i, t.e = r), d !== t.t && w(i, "aria-label", t.t = d), h !== t.a && w(i, "aria-selected", t.a = h), o !== t.o && v(s, t.o = o), l !== t.i && v(g, t.i = l), t;
103
103
  }, {
104
104
  e: void 0,
105
105
  t: void 0,
106
106
  a: void 0,
107
107
  o: void 0,
108
108
  i: void 0
109
- }), l;
109
+ }), i;
110
110
  })();
111
111
  }
112
112
  W(["click"]);
@@ -1,5 +1,18 @@
1
1
  import { type JSX } from 'solid-js';
2
2
  import { type ActivityBarItem } from './ActivityBar';
3
+ export interface ShellSlotClassNames {
4
+ root?: string;
5
+ topBar?: string;
6
+ activityBar?: string;
7
+ sidebar?: string;
8
+ mobileSidebarBackdrop?: string;
9
+ mobileSidebarDrawer?: string;
10
+ contentArea?: string;
11
+ main?: string;
12
+ terminalPanel?: string;
13
+ bottomBar?: string;
14
+ mobileTabBar?: string;
15
+ }
3
16
  export interface ShellProps {
4
17
  children: JSX.Element;
5
18
  logo?: JSX.Element;
@@ -26,6 +39,7 @@ export interface ShellProps {
26
39
  */
27
40
  sidebarMode?: 'auto' | 'hidden';
28
41
  terminalPanel?: JSX.Element;
42
+ slotClassNames?: ShellSlotClassNames;
29
43
  class?: string;
30
44
  }
31
45
  /**