@floegence/floe-webapp-core 0.26.1 → 0.26.2

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,5 +1,5 @@
1
- import { createComponent as t, Dynamic as S, insert as c, memo as C, effect as T, className as M, setStyleProperty as E, template as h, delegateEvents as N } from "solid-js/web";
2
- import { createSignal as Q, createEffect as v, createMemo as b, For as $, Show as m } from "solid-js";
1
+ import { createComponent as r, Dynamic as S, insert as c, memo as C, effect as T, className as M, setStyleProperty as E, template as h, delegateEvents as N } from "solid-js/web";
2
+ import { createSignal as Q, createEffect as v, createMemo as f, For as $, Show as m } from "solid-js";
3
3
  import { useLayout as D } from "../../context/LayoutContext.js";
4
4
  import { useResolvedFloeConfig as K } from "../../context/FloeConfigContext.js";
5
5
  import { useMediaQuery as L } from "../../hooks/useMediaQuery.js";
@@ -17,35 +17,35 @@ import { resolveMobileTabActiveId as Z, resolveMobileTabSelect as ee } from "./m
17
17
  import { KeepAliveStack as te } from "./KeepAliveStack.js";
18
18
  var k = /* @__PURE__ */ h('<div class="flex items-center gap-2">'), re = /* @__PURE__ */ h('<div class="absolute inset-0 z-40 bg-black/30 cursor-pointer">'), ie = /* @__PURE__ */ h('<div><div class="h-full overflow-auto overscroll-contain">'), ne = /* @__PURE__ */ h('<div class="relative shrink-0 border-t border-border bg-terminal-background overflow-hidden">'), oe = /* @__PURE__ */ h('<div><div class="flex-1 min-h-0 flex overflow-hidden relative"><div class="flex-1 min-w-0 flex flex-col overflow-hidden"><main class="flex-1 min-h-0 overflow-auto overscroll-contain">');
19
19
  function Be(o) {
20
- const r = D(), O = K(), d = L(O.config.layout.mobileQuery), [I, f] = Q(!1), u = () => o.sidebarMode === "hidden", a = (() => {
20
+ const i = D(), O = K(), d = L(O.config.layout.mobileQuery), [I, b] = Q(!1), u = () => o.sidebarMode === "hidden", a = (() => {
21
21
  try {
22
22
  return j();
23
23
  } catch {
24
24
  return null;
25
25
  }
26
26
  })(), w = (e, s) => {
27
- const l = a?.getComponent(e)?.sidebar?.fullScreen ?? !1, i = u() ? !1 : s?.openSidebar ?? !l;
28
- r.setSidebarActiveTab(e, {
29
- openSidebar: i
27
+ const l = a?.getComponent(e)?.sidebar?.fullScreen ?? !1, t = u() ? !1 : s?.openSidebar ?? !l;
28
+ i.setSidebarActiveTab(e, {
29
+ openSidebar: t
30
30
  });
31
31
  };
32
32
  v(() => {
33
- u() && f(!1);
33
+ u() && b(!1);
34
34
  }), v(() => {
35
35
  const e = d();
36
- r.isMobile() !== e && r.setIsMobile(e);
36
+ i.isMobile() !== e && i.setIsMobile(e);
37
37
  }), v(() => {
38
- d() || f(!1);
38
+ d() || b(!1);
39
39
  });
40
- const g = b(() => o.activityItems ? o.activityItems : a ? a.sidebarItems().filter((e) => !!e.icon).filter((e) => !(d() && e.sidebar?.hiddenOnMobile)).map((e) => ({
40
+ const g = f(() => o.activityItems ? o.activityItems : a ? a.sidebarItems().filter((e) => !!e.icon).filter((e) => !(d() && e.sidebar?.hiddenOnMobile)).map((e) => ({
41
41
  id: e.id,
42
42
  icon: e.icon,
43
43
  label: e.name,
44
44
  badge: e.sidebar?.badge,
45
45
  collapseBehavior: e.sidebar?.fullScreen ? "preserve" : "toggle"
46
- })) : []), z = b(() => u() ? [] : o.sidebarContent ? [] : a ? a.sidebarItems().filter((e) => !(d() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
46
+ })) : []), z = f(() => u() ? [] : o.sidebarContent ? [] : a ? a.sidebarItems().filter((e) => !(d() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
47
47
  id: e.id,
48
- render: () => t(S, {
48
+ render: () => r(S, {
49
49
  get component() {
50
50
  return e.component;
51
51
  }
@@ -54,112 +54,116 @@ function Be(o) {
54
54
  if (!u()) {
55
55
  if (o.sidebarContent) return o.sidebarContent(e);
56
56
  if (a)
57
- return t(te, {
57
+ return r(te, {
58
58
  get views() {
59
59
  return z();
60
60
  },
61
61
  activeId: e
62
62
  });
63
63
  }
64
- }, B = b(() => u() ? !0 : a ? a.getComponent(r.sidebarActiveTab())?.sidebar?.fullScreen ?? !1 : !1), F = b(() => {
64
+ }, B = f(() => u() ? !0 : a ? a.getComponent(i.sidebarActiveTab())?.sidebar?.fullScreen ?? !1 : !1), F = f(() => {
65
65
  if (u()) return !0;
66
66
  if (!a) return !1;
67
- const e = a.getComponent(r.sidebarActiveTab());
67
+ const e = a.getComponent(i.sidebarActiveTab());
68
68
  return e?.sidebar ? e.sidebar.fullScreen === !0 || e.sidebar.renderIn === "main" : !1;
69
69
  });
70
70
  v(() => {
71
- d() && B() && f(!1);
71
+ d() && B() && b(!1);
72
72
  });
73
- const H = b(() => {
73
+ const H = f(() => {
74
74
  if (o.bottomBarItems) return o.bottomBarItems;
75
75
  if (!a) return;
76
- const e = [...a.statusBarItems()].sort((i, n) => (i.order ?? 100) - (n.order ?? 100)), s = e.filter((i) => i.position === "left"), l = e.filter((i) => i.position === "right");
76
+ const e = [...a.statusBarItems()].sort((t, n) => (t.order ?? 100) - (n.order ?? 100)), s = e.filter((t) => t.position === "left"), l = e.filter((t) => t.position === "right");
77
77
  return [(() => {
78
- var i = k();
79
- return c(i, t($, {
78
+ var t = k();
79
+ return c(t, r($, {
80
80
  each: s,
81
- children: (n) => t(S, {
81
+ children: (n) => r(S, {
82
82
  get component() {
83
83
  return n.component;
84
84
  }
85
85
  })
86
- })), i;
86
+ })), t;
87
87
  })(), (() => {
88
- var i = k();
89
- return c(i, t($, {
88
+ var t = k();
89
+ return c(t, r($, {
90
90
  each: l,
91
- children: (n) => t(S, {
91
+ children: (n) => r(S, {
92
92
  get component() {
93
93
  return n.component;
94
94
  }
95
95
  })
96
- })), i;
96
+ })), t;
97
97
  })()];
98
98
  });
99
99
  v(() => {
100
100
  const e = g();
101
101
  if (!e.length) return;
102
- r.sidebarActiveTab() || w(e[0].id);
102
+ if (!i.sidebarActiveTab()) {
103
+ const l = e.find((t) => !t.onClick);
104
+ if (!l) return;
105
+ w(l.id);
106
+ }
103
107
  });
104
108
  const A = (e) => {
105
109
  const s = u() ? !0 : a?.getComponent(e)?.sidebar?.fullScreen ?? !1, {
106
110
  nextActiveId: l,
107
- nextMobileSidebarOpen: i
111
+ nextMobileSidebarOpen: t
108
112
  } = ee({
109
113
  clickedId: e,
110
- activeId: r.sidebarActiveTab(),
114
+ activeId: i.sidebarActiveTab(),
111
115
  mobileSidebarOpen: I(),
112
116
  clickedIsFullScreen: s
113
117
  });
114
- r.sidebarActiveTab() !== l && w(l), f(i);
118
+ i.sidebarActiveTab() !== l && w(l), b(t);
115
119
  }, P = (e) => {
116
120
  if (e.onClick) {
117
121
  V(() => e.onClick());
118
122
  return;
119
123
  }
120
124
  A(e.id);
121
- }, R = b(() => {
125
+ }, R = f(() => {
122
126
  const e = o.topBarActions;
123
127
  if (!d() || (o.activityBottomItemsMobileMode ?? "hidden") !== "topBar") return e;
124
128
  const l = o.activityBottomItems ?? [];
125
- return l.length ? [t($, {
129
+ return l.length ? [r($, {
126
130
  each: l,
127
- children: (i) => t(J, {
131
+ children: (t) => r(J, {
128
132
  get label() {
129
- return i.label;
133
+ return t.label;
130
134
  },
131
- onClick: () => P(i),
135
+ onClick: () => P(t),
132
136
  get children() {
133
- return t(S, {
137
+ return r(S, {
134
138
  get component() {
135
- return i.icon;
139
+ return t.icon;
136
140
  },
137
141
  class: "w-4 h-4"
138
142
  });
139
143
  }
140
144
  })
141
145
  }), e] : e;
142
- }), W = () => u() ? !0 : r.sidebarCollapsed();
146
+ }), W = () => u() ? !0 : i.sidebarCollapsed();
143
147
  return (() => {
144
- var e = oe(), s = e.firstChild, l = s.firstChild, i = l.firstChild;
145
- return c(e, t(G, {
148
+ var e = oe(), s = e.firstChild, l = s.firstChild, t = l.firstChild;
149
+ return c(e, r(G, {
146
150
  get logo() {
147
151
  return o.logo;
148
152
  },
149
153
  get actions() {
150
154
  return R();
151
155
  }
152
- }), s), c(s, t(m, {
156
+ }), s), c(s, r(m, {
153
157
  get when() {
154
158
  return !d();
155
159
  },
156
160
  get children() {
157
- return [t(m, {
161
+ return [r(m, {
158
162
  get when() {
159
163
  return g().length > 0;
160
164
  },
161
165
  get children() {
162
- return t(Y, {
166
+ return r(Y, {
163
167
  get items() {
164
168
  return g();
165
169
  },
@@ -167,89 +171,89 @@ function Be(o) {
167
171
  return o.activityBottomItems;
168
172
  },
169
173
  get activeId() {
170
- return r.sidebarActiveTab();
174
+ return i.sidebarActiveTab();
171
175
  },
172
176
  onActiveChange: w,
173
177
  get collapsed() {
174
178
  return W();
175
179
  },
176
180
  get onCollapsedChange() {
177
- return C(() => !!u())() ? void 0 : r.setSidebarCollapsed;
181
+ return C(() => !!u())() ? void 0 : i.setSidebarCollapsed;
178
182
  }
179
183
  });
180
184
  }
181
- }), t(m, {
185
+ }), r(m, {
182
186
  get when() {
183
187
  return !u();
184
188
  },
185
189
  get children() {
186
- return t(q, {
190
+ return r(q, {
187
191
  get width() {
188
- return r.sidebarWidth();
192
+ return i.sidebarWidth();
189
193
  },
190
194
  get collapsed() {
191
- return r.sidebarCollapsed() || B();
195
+ return i.sidebarCollapsed() || B();
192
196
  },
193
197
  get resizer() {
194
- return t(_, {
198
+ return r(_, {
195
199
  direction: "horizontal",
196
- onResize: (n) => r.setSidebarWidth(r.sidebarWidth() + n)
200
+ onResize: (n) => i.setSidebarWidth(i.sidebarWidth() + n)
197
201
  });
198
202
  },
199
203
  get children() {
200
- return y(r.sidebarActiveTab());
204
+ return y(i.sidebarActiveTab());
201
205
  }
202
206
  });
203
207
  }
204
208
  })];
205
209
  }
206
- }), l), c(s, t(m, {
210
+ }), l), c(s, r(m, {
207
211
  get when() {
208
212
  return C(() => !!(d() && I()))() && !u();
209
213
  },
210
214
  get children() {
211
215
  return [(() => {
212
216
  var n = re();
213
- return n.$$click = () => f(!1), n;
217
+ return n.$$click = () => b(!1), n;
214
218
  })(), (() => {
215
219
  var n = ie(), p = n.firstChild;
216
- return c(p, () => y(r.sidebarActiveTab())), T(() => M(n, x("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"))), n;
220
+ return c(p, () => y(i.sidebarActiveTab())), T(() => M(n, x("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"))), n;
217
221
  })()];
218
222
  }
219
- }), l), c(i, () => o.children), c(l, t(m, {
223
+ }), l), c(t, () => o.children), c(l, r(m, {
220
224
  get when() {
221
- return C(() => !!(!d() && r.terminalOpened()))() && o.terminalPanel;
225
+ return C(() => !!(!d() && i.terminalOpened()))() && o.terminalPanel;
222
226
  },
223
227
  get children() {
224
228
  var n = ne();
225
- return c(n, t(_, {
229
+ return c(n, r(_, {
226
230
  direction: "vertical",
227
- onResize: (p) => r.setTerminalHeight(r.terminalHeight() - p)
228
- }), null), c(n, () => o.terminalPanel, null), T((p) => E(n, "height", `${r.terminalHeight()}px`)), n;
231
+ onResize: (p) => i.setTerminalHeight(i.terminalHeight() - p)
232
+ }), null), c(n, () => o.terminalPanel, null), T((p) => E(n, "height", `${i.terminalHeight()}px`)), n;
229
233
  }
230
- }), null), c(e, t(m, {
234
+ }), null), c(e, r(m, {
231
235
  get when() {
232
236
  return !d();
233
237
  },
234
238
  get children() {
235
- return t(U, {
239
+ return r(U, {
236
240
  get children() {
237
241
  return H();
238
242
  }
239
243
  });
240
244
  }
241
- }), null), c(e, t(m, {
245
+ }), null), c(e, r(m, {
242
246
  get when() {
243
247
  return C(() => !!d())() && g().length > 0;
244
248
  },
245
249
  get children() {
246
- return t(X, {
250
+ return r(X, {
247
251
  get items() {
248
252
  return g();
249
253
  },
250
254
  get activeId() {
251
255
  return Z({
252
- activeId: r.sidebarActiveTab(),
256
+ activeId: i.sidebarActiveTab(),
253
257
  mobileSidebarOpen: I(),
254
258
  activeIsFullScreen: B(),
255
259
  activeIsPage: F()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.26.1",
3
+ "version": "0.26.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",