@floegence/floe-webapp-core 0.35.21 → 0.35.23

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.
Files changed (33) hide show
  1. package/dist/chat.css +33 -7
  2. package/dist/components/chat/blocks/FileBlock.js +42 -27
  3. package/dist/components/chat/blocks/ToolCallBlock.js +150 -149
  4. package/dist/components/file-browser/Breadcrumb.js +73 -72
  5. package/dist/components/file-browser/DragPreview.d.ts +2 -2
  6. package/dist/components/file-browser/DragPreview.js +15 -15
  7. package/dist/components/file-browser/FileBrowser.js +13 -13
  8. package/dist/components/file-browser/index.d.ts +1 -0
  9. package/dist/components/layout/ActivityBar.d.ts +1 -0
  10. package/dist/components/layout/ActivityBar.js +51 -45
  11. package/dist/components/layout/MobileTabBar.d.ts +1 -0
  12. package/dist/components/layout/MobileTabBar.js +109 -65
  13. package/dist/components/layout/Shell.js +190 -158
  14. package/dist/components/layout/Sidebar.d.ts +1 -0
  15. package/dist/components/layout/Sidebar.js +33 -31
  16. package/dist/components/layout/SidebarPane.d.ts +1 -0
  17. package/dist/components/layout/SidebarPane.js +40 -37
  18. package/dist/components/layout/TopBar.d.ts +1 -0
  19. package/dist/components/layout/TopBar.js +23 -22
  20. package/dist/components/ui/Dropdown.d.ts +13 -0
  21. package/dist/components/ui/Dropdown.js +263 -145
  22. package/dist/components/ui/Tabs.d.ts +4 -0
  23. package/dist/components/ui/Tabs.js +207 -149
  24. package/dist/context/FloeConfigContext.d.ts +17 -0
  25. package/dist/context/FloeConfigContext.js +34 -25
  26. package/dist/context/NotificationContext.js +76 -69
  27. package/dist/file-browser.js +19 -17
  28. package/dist/full.js +302 -300
  29. package/dist/styles/tokens.d.ts +4 -4
  30. package/dist/styles/tokens.js +55 -14
  31. package/dist/styles.css +1 -1
  32. package/dist/themes/light.css +2 -2
  33. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { createComponent as C } from "solid-js/web";
2
- import { createContext as F, createMemo as u, createEffect as I, onCleanup as E, useContext as h } from "solid-js";
2
+ import { createContext as L, createMemo as u, createEffect as F, onCleanup as I, useContext as v } from "solid-js";
3
3
  const m = {
4
4
  storage: {
5
5
  namespace: "floe",
@@ -46,6 +46,15 @@ const m = {
46
46
  storageKey: "theme",
47
47
  defaultTheme: "system"
48
48
  },
49
+ accessibility: {
50
+ mainContentId: "floe-main-content",
51
+ skipLinkLabel: "Skip to main content",
52
+ topBarLabel: "Application toolbar",
53
+ primaryNavigationLabel: "Primary navigation",
54
+ mobileNavigationLabel: "Primary navigation",
55
+ sidebarLabel: "Sidebar",
56
+ mainLabel: "Main content"
57
+ },
49
58
  deck: {
50
59
  storageKey: "deck"
51
60
  },
@@ -70,7 +79,7 @@ const m = {
70
79
  }
71
80
  }
72
81
  };
73
- function S() {
82
+ function k() {
74
83
  if (!(typeof window > "u"))
75
84
  return {
76
85
  getItem: (e) => localStorage.getItem(e),
@@ -79,8 +88,8 @@ function S() {
79
88
  keys: () => Object.keys(localStorage)
80
89
  };
81
90
  }
82
- function v(e) {
83
- const t = e.adapter ?? S(), c = e.namespace ? `${e.namespace}-` : "", r = (o) => `${c}${o}`, n = () => e.enabled && !!t, i = /* @__PURE__ */ new Map(), d = () => {
91
+ function h(e) {
92
+ const t = e.adapter ?? k(), c = e.namespace ? `${e.namespace}-` : "", r = (o) => `${c}${o}`, n = () => e.enabled && !!t, i = /* @__PURE__ */ new Map(), d = () => {
84
93
  if (n()) {
85
94
  for (const [o, a] of i.entries()) {
86
95
  clearTimeout(a.timer);
@@ -122,8 +131,8 @@ function v(e) {
122
131
  i.delete(l);
123
132
  try {
124
133
  t.setItem(l, JSON.stringify(f.value));
125
- } catch (b) {
126
- console.warn(`Failed to save ${l}:`, b);
134
+ } catch (w) {
135
+ console.warn(`Failed to save ${l}:`, w);
127
136
  }
128
137
  }
129
138
  }, s);
@@ -157,7 +166,7 @@ function v(e) {
157
166
  }
158
167
  };
159
168
  }
160
- function k(e) {
169
+ function S(e) {
161
170
  if (typeof window > "u") return () => {
162
171
  };
163
172
  const t = () => {
@@ -184,7 +193,7 @@ function k(e) {
184
193
  }
185
194
  };
186
195
  }
187
- function w(e, t) {
196
+ function b(e, t) {
188
197
  if (!t) return e;
189
198
  if (typeof e != "object" || e === null || Array.isArray(e)) return t ?? e;
190
199
  const c = {
@@ -193,17 +202,17 @@ function w(e, t) {
193
202
  for (const [r, n] of Object.entries(t)) {
194
203
  if (n === void 0) continue;
195
204
  const i = e[r];
196
- typeof i == "object" && i !== null && typeof n == "object" && n !== null && !Array.isArray(n) ? c[r] = w(i, n) : c[r] = n;
205
+ typeof i == "object" && i !== null && typeof n == "object" && n !== null && !Array.isArray(n) ? c[r] = b(i, n) : c[r] = n;
197
206
  }
198
207
  return c;
199
208
  }
200
- const y = F();
201
- function O(e) {
202
- const t = u(() => w(m, e.config)), c = u(() => v(t().storage));
203
- I(() => {
204
- const n = c(), d = t().storage.enabled ? k(n) : () => {
209
+ const y = L();
210
+ function N(e) {
211
+ const t = u(() => b(m, e.config)), c = u(() => h(t().storage));
212
+ F(() => {
213
+ const n = c(), d = t().storage.enabled ? S(n) : () => {
205
214
  };
206
- E(() => {
215
+ I(() => {
207
216
  d(), n.dispose?.();
208
217
  });
209
218
  });
@@ -220,23 +229,23 @@ function O(e) {
220
229
  }
221
230
  });
222
231
  }
223
- function D() {
224
- const e = h(y);
232
+ function O() {
233
+ const e = v(y);
225
234
  if (!e)
226
235
  throw new Error("FloeConfigContext not found. Make sure to wrap your app with FloeConfigProvider (or FloeProvider).");
227
236
  return e;
228
237
  }
229
- const L = v(m.storage), T = {
238
+ const E = h(m.storage), T = {
230
239
  config: m,
231
- persist: L
240
+ persist: E
232
241
  };
233
- function N() {
234
- return h(y) ?? T;
242
+ function D() {
243
+ return v(y) ?? T;
235
244
  }
236
245
  export {
237
246
  m as DEFAULT_FLOE_CONFIG,
238
- O as FloeConfigProvider,
239
- k as installPersistFlushListeners,
240
- D as useFloeConfig,
241
- N as useResolvedFloeConfig
247
+ N as FloeConfigProvider,
248
+ S as installPersistFlushListeners,
249
+ O as useFloeConfig,
250
+ D as useResolvedFloeConfig
242
251
  };
@@ -1,58 +1,58 @@
1
- import { insert as d, createComponent as u, template as r, effect as g, className as p, delegateEvents as x } from "solid-js/web";
2
- import { For as w, onCleanup as v, Show as m } from "solid-js";
3
- import { createStore as k, produce as h } from "solid-js/store";
4
- import { createSimpleContext as $ } from "./createSimpleContext.js";
5
- import { cn as b } from "../utils/cn.js";
6
- var _ = /* @__PURE__ */ r('<div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm">'), y = /* @__PURE__ */ r('<svg class="w-4 h-4 text-info"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path d="M12 16v-4M12 8h.01">'), C = /* @__PURE__ */ r('<svg class="w-4 h-4 text-success"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M5 13l4 4L19 7">'), M = /* @__PURE__ */ r('<svg class="w-4 h-4 text-warning"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z">'), S = /* @__PURE__ */ r('<svg class="w-4 h-4 text-error"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path stroke-linecap=round d="M15 9l-6 6M9 9l6 6">'), N = /* @__PURE__ */ r('<p class="mt-1 text-sm text-muted-foreground">'), T = /* @__PURE__ */ r('<button type=button class="mt-2 text-sm font-medium text-foreground hover:underline">'), D = /* @__PURE__ */ r('<div role=alert><div class="flex items-start gap-3"><span class="flex-shrink-0 mt-0.5"></span><div class="flex-1 min-w-0"><p class="font-medium text-sm"></p></div><button type=button class="flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors"aria-label=Dismiss><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M6 18L18 6M6 6l12 12">');
7
- const B = 5e3;
8
- function L() {
9
- const [o, s] = k({
1
+ import { insert as u, createComponent as d, template as l, effect as k, className as $, setAttribute as h, delegateEvents as y } from "solid-js/web";
2
+ import { For as _, onCleanup as C, Show as x } from "solid-js";
3
+ import { createStore as M, produce as w } from "solid-js/store";
4
+ import { createSimpleContext as S } from "./createSimpleContext.js";
5
+ import { cn as N } from "../utils/cn.js";
6
+ var T = /* @__PURE__ */ l('<div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm">'), D = /* @__PURE__ */ l('<svg class="w-4 h-4 text-info"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path d="M12 16v-4M12 8h.01">'), B = /* @__PURE__ */ l('<svg class="w-4 h-4 text-success"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M5 13l4 4L19 7">'), L = /* @__PURE__ */ l('<svg class="w-4 h-4 text-warning"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z">'), A = /* @__PURE__ */ l('<svg class="w-4 h-4 text-error"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path stroke-linecap=round d="M15 9l-6 6M9 9l6 6">'), E = /* @__PURE__ */ l('<p class="mt-1 text-sm text-muted-foreground">'), j = /* @__PURE__ */ l('<button type=button class="mt-2 text-sm font-medium text-foreground hover:underline focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2">'), z = /* @__PURE__ */ l('<div><div class="flex items-start gap-3"><span class="flex-shrink-0 mt-0.5"></span><div class="flex-1 min-w-0"><p class="font-medium text-sm"></p></div><button type=button class="flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2"aria-label=Dismiss><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M6 18L18 6M6 6l12 12">');
7
+ const F = 5e3;
8
+ function I() {
9
+ const [i, a] = M({
10
10
  notifications: []
11
- }), i = /* @__PURE__ */ new Map();
12
- v(() => {
13
- i.forEach((t) => clearTimeout(t)), i.clear();
11
+ }), n = /* @__PURE__ */ new Map();
12
+ C(() => {
13
+ n.forEach((t) => clearTimeout(t)), n.clear();
14
14
  });
15
- const n = (t) => {
16
- const e = i.get(t);
17
- e && (clearTimeout(e), i.delete(t)), s(h((l) => {
18
- l.notifications = l.notifications.filter((a) => a.id !== t);
15
+ const s = (t) => {
16
+ const e = n.get(t);
17
+ e && (clearTimeout(e), n.delete(t)), a(w((c) => {
18
+ c.notifications = c.notifications.filter((r) => r.id !== t);
19
19
  }));
20
- }, c = (t) => {
21
- const e = `notification-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, l = t.duration ?? B;
22
- if (s(h((a) => {
23
- a.notifications.push({
20
+ }, f = (t) => {
21
+ const e = `notification-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, c = t.duration ?? F;
22
+ if (a(w((r) => {
23
+ r.notifications.push({
24
24
  ...t,
25
25
  id: e
26
26
  });
27
- })), l > 0) {
28
- const a = setTimeout(() => n(e), l);
29
- i.set(e, a);
27
+ })), c > 0) {
28
+ const r = setTimeout(() => s(e), c);
29
+ n.set(e, r);
30
30
  }
31
31
  return e;
32
32
  };
33
33
  return {
34
- notifications: () => o.notifications,
35
- show: c,
36
- dismiss: n,
34
+ notifications: () => i.notifications,
35
+ show: f,
36
+ dismiss: s,
37
37
  dismissAll: () => {
38
- i.forEach((t) => clearTimeout(t)), i.clear(), s("notifications", []);
38
+ n.forEach((t) => clearTimeout(t)), n.clear(), a("notifications", []);
39
39
  },
40
- info: (t, e) => c({
40
+ info: (t, e) => f({
41
41
  type: "info",
42
42
  title: t,
43
43
  message: e
44
44
  }),
45
- success: (t, e) => c({
45
+ success: (t, e) => f({
46
46
  type: "success",
47
47
  title: t,
48
48
  message: e
49
49
  }),
50
- warning: (t, e) => c({
50
+ warning: (t, e) => f({
51
51
  type: "warning",
52
52
  title: t,
53
53
  message: e
54
54
  }),
55
- error: (t, e) => c({
55
+ error: (t, e) => f({
56
56
  type: "error",
57
57
  title: t,
58
58
  message: e
@@ -60,67 +60,74 @@ function L() {
60
60
  };
61
61
  }
62
62
  const {
63
- Provider: U,
64
- use: E
65
- } = $({
63
+ Provider: J,
64
+ use: P
65
+ } = S({
66
66
  name: "Notification",
67
- init: L
67
+ init: I
68
68
  });
69
- function O() {
69
+ function K() {
70
70
  const {
71
- notifications: o,
72
- dismiss: s
73
- } = E();
71
+ notifications: i,
72
+ dismiss: a
73
+ } = P();
74
74
  return (() => {
75
- var i = _();
76
- return d(i, u(w, {
75
+ var n = T();
76
+ return u(n, d(_, {
77
77
  get each() {
78
- return o();
78
+ return i();
79
79
  },
80
- children: (n) => u(j, {
81
- notification: n,
82
- onDismiss: () => s(n.id)
80
+ children: (s) => d(R, {
81
+ notification: s,
82
+ onDismiss: () => a(s.id)
83
83
  })
84
- })), i;
84
+ })), n;
85
85
  })();
86
86
  }
87
- function j(o) {
88
- const s = {
87
+ function R(i) {
88
+ const a = {
89
89
  info: "border-l-info",
90
90
  success: "border-l-success",
91
91
  warning: "border-l-warning",
92
92
  error: "border-l-error"
93
- }, i = {
94
- info: () => y(),
95
- success: () => C(),
96
- warning: () => M(),
97
- error: () => S()
98
- };
93
+ }, n = {
94
+ info: () => D(),
95
+ success: () => B(),
96
+ warning: () => L(),
97
+ error: () => A()
98
+ }, s = () => i.notification.type === "error" || i.notification.type === "warning" ? "alert" : "status", f = () => s() === "alert" ? "assertive" : "polite";
99
99
  return (() => {
100
- var n = D(), c = n.firstChild, t = c.firstChild, e = t.nextSibling, l = e.firstChild, a = e.nextSibling;
101
- return d(t, () => i[o.notification.type]()), d(l, () => o.notification.title), d(e, u(m, {
100
+ var t = z(), e = t.firstChild, c = e.firstChild, r = c.nextSibling, p = r.firstChild, b = r.nextSibling;
101
+ return u(c, () => n[i.notification.type]()), u(p, () => i.notification.title), u(r, d(x, {
102
102
  get when() {
103
- return o.notification.message;
103
+ return i.notification.message;
104
104
  },
105
105
  get children() {
106
- var f = N();
107
- return d(f, () => o.notification.message), f;
106
+ var o = E();
107
+ return u(o, () => i.notification.message), o;
108
108
  }
109
- }), null), d(e, u(m, {
109
+ }), null), u(r, d(x, {
110
110
  get when() {
111
- return o.notification.action;
111
+ return i.notification.action;
112
112
  },
113
113
  get children() {
114
- var f = T();
115
- return f.$$click = () => o.notification.action?.onClick(), d(f, () => o.notification.action.label), f;
114
+ var o = j();
115
+ return o.$$click = () => i.notification.action?.onClick(), u(o, () => i.notification.action.label), o;
116
116
  }
117
- }), null), a.$$click = () => o.onDismiss(), g(() => p(n, b("animate-in slide-in-from-right fade-in duration-200", "rounded-lg border border-border border-l-[3px] p-3.5", "shadow-md", "bg-card text-card-foreground", s[o.notification.type]))), n;
117
+ }), null), b.$$click = () => i.onDismiss(), k((o) => {
118
+ var m = N("animate-in slide-in-from-right fade-in duration-200", "rounded-lg border border-border border-l-[3px] p-3.5", "shadow-md", "bg-card text-card-foreground", a[i.notification.type]), v = s(), g = f();
119
+ return m !== o.e && $(t, o.e = m), v !== o.t && h(t, "role", o.t = v), g !== o.a && h(t, "aria-live", o.a = g), o;
120
+ }, {
121
+ e: void 0,
122
+ t: void 0,
123
+ a: void 0
124
+ }), t;
118
125
  })();
119
126
  }
120
- x(["click"]);
127
+ y(["click"]);
121
128
  export {
122
- O as NotificationContainer,
123
- U as NotificationProvider,
124
- L as createNotificationService,
125
- E as useNotification
129
+ K as NotificationContainer,
130
+ J as NotificationProvider,
131
+ I as createNotificationService,
132
+ P as useNotification
126
133
  };
@@ -1,34 +1,36 @@
1
1
  import { Breadcrumb as r } from "./components/file-browser/Breadcrumb.js";
2
- import { CodeFileIcon as l, ConfigFileIcon as t, DocumentFileIcon as F, FileIcon as c, FileItemIcon as n, FolderIcon as I, FolderOpenIcon as m, ImageFileIcon as p, JavaScriptFileIcon as f, ShellScriptFileIcon as x, StyleFileIcon as s, TypeScriptFileIcon as d, getFileIcon as w, resolveFileItemIcon as a } from "./components/file-browser/FileIcons.js";
2
+ import { CodeFileIcon as l, ConfigFileIcon as t, DocumentFileIcon as F, FileIcon as c, FileItemIcon as n, FolderIcon as I, FolderOpenIcon as m, ImageFileIcon as p, JavaScriptFileIcon as f, ShellScriptFileIcon as x, StyleFileIcon as s, TypeScriptFileIcon as w, getFileIcon as a, resolveFileItemIcon as d } from "./components/file-browser/FileIcons.js";
3
3
  import { DirectoryTree as S } from "./components/file-browser/DirectoryTree.js";
4
- import { FileBrowser as g } from "./components/file-browser/FileBrowser.js";
5
- import { FileBrowserProvider as y, useFileBrowser as C } from "./components/file-browser/FileBrowserContext.js";
6
- import { FileBrowserToolbar as b } from "./components/file-browser/FileBrowserToolbar.js";
7
- import { FileContextMenu as V } from "./components/file-browser/FileContextMenu.js";
8
- import { FileGridView as G } from "./components/file-browser/FileGridView.js";
9
- import { FileListView as L } from "./components/file-browser/FileListView.js";
4
+ import { FileBrowser as u } from "./components/file-browser/FileBrowser.js";
5
+ import { FileBrowserDragPreview as y } from "./components/file-browser/DragPreview.js";
6
+ import { FileBrowserProvider as D, useFileBrowser as T } from "./components/file-browser/FileBrowserContext.js";
7
+ import { FileBrowserToolbar as P } from "./components/file-browser/FileBrowserToolbar.js";
8
+ import { FileContextMenu as h } from "./components/file-browser/FileContextMenu.js";
9
+ import { FileGridView as J } from "./components/file-browser/FileGridView.js";
10
+ import { FileListView as M } from "./components/file-browser/FileListView.js";
10
11
  export {
11
12
  r as Breadcrumb,
12
13
  l as CodeFileIcon,
13
14
  t as ConfigFileIcon,
14
15
  S as DirectoryTree,
15
16
  F as DocumentFileIcon,
16
- g as FileBrowser,
17
- y as FileBrowserProvider,
18
- b as FileBrowserToolbar,
19
- V as FileContextMenu,
20
- G as FileGridView,
17
+ u as FileBrowser,
18
+ y as FileBrowserDragPreview,
19
+ D as FileBrowserProvider,
20
+ P as FileBrowserToolbar,
21
+ h as FileContextMenu,
22
+ J as FileGridView,
21
23
  c as FileIcon,
22
24
  n as FileItemIcon,
23
- L as FileListView,
25
+ M as FileListView,
24
26
  I as FolderIcon,
25
27
  m as FolderOpenIcon,
26
28
  p as ImageFileIcon,
27
29
  f as JavaScriptFileIcon,
28
30
  x as ShellScriptFileIcon,
29
31
  s as StyleFileIcon,
30
- d as TypeScriptFileIcon,
31
- w as getFileIcon,
32
- a as resolveFileItemIcon,
33
- C as useFileBrowser
32
+ w as TypeScriptFileIcon,
33
+ a as getFileIcon,
34
+ d as resolveFileItemIcon,
35
+ T as useFileBrowser
34
36
  };