@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.
- package/dist/chat.css +33 -7
- package/dist/components/chat/blocks/FileBlock.js +42 -27
- package/dist/components/chat/blocks/ToolCallBlock.js +150 -149
- package/dist/components/file-browser/Breadcrumb.js +73 -72
- package/dist/components/file-browser/DragPreview.d.ts +2 -2
- package/dist/components/file-browser/DragPreview.js +15 -15
- package/dist/components/file-browser/FileBrowser.js +13 -13
- package/dist/components/file-browser/index.d.ts +1 -0
- package/dist/components/layout/ActivityBar.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +51 -45
- package/dist/components/layout/MobileTabBar.d.ts +1 -0
- package/dist/components/layout/MobileTabBar.js +109 -65
- package/dist/components/layout/Shell.js +190 -158
- package/dist/components/layout/Sidebar.d.ts +1 -0
- package/dist/components/layout/Sidebar.js +33 -31
- package/dist/components/layout/SidebarPane.d.ts +1 -0
- package/dist/components/layout/SidebarPane.js +40 -37
- package/dist/components/layout/TopBar.d.ts +1 -0
- package/dist/components/layout/TopBar.js +23 -22
- package/dist/components/ui/Dropdown.d.ts +13 -0
- package/dist/components/ui/Dropdown.js +263 -145
- package/dist/components/ui/Tabs.d.ts +4 -0
- package/dist/components/ui/Tabs.js +207 -149
- package/dist/context/FloeConfigContext.d.ts +17 -0
- package/dist/context/FloeConfigContext.js +34 -25
- package/dist/context/NotificationContext.js +76 -69
- package/dist/file-browser.js +19 -17
- package/dist/full.js +302 -300
- package/dist/styles/tokens.d.ts +4 -4
- package/dist/styles/tokens.js +55 -14
- package/dist/styles.css +1 -1
- package/dist/themes/light.css +2 -2
- package/package.json +1 -1
|
@@ -1,115 +1,159 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { deferNonBlocking as
|
|
5
|
-
var q = /* @__PURE__ */
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
const [
|
|
9
|
-
let
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
if (
|
|
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";
|
|
3
|
+
import { cn as g } from "../../utils/cn.js";
|
|
4
|
+
import { deferNonBlocking as L } from "../../utils/defer.js";
|
|
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
|
+
function P(e) {
|
|
7
|
+
let i;
|
|
8
|
+
const [o, u] = I(!1), [h, t] = I(!1);
|
|
9
|
+
let n = null;
|
|
10
|
+
const s = () => {
|
|
11
|
+
i && (u(i.scrollLeft > 0), t(i.scrollLeft < i.scrollWidth - i.clientWidth - 1));
|
|
12
|
+
}, x = () => {
|
|
13
|
+
if (n === null) {
|
|
14
14
|
if (typeof requestAnimationFrame > "u") {
|
|
15
|
-
|
|
15
|
+
s();
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
n = requestAnimationFrame(() => {
|
|
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());
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
e.onSelect(r.id);
|
|
30
|
+
}
|
|
22
31
|
};
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
|
|
32
|
+
return D(() => {
|
|
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);
|
|
29
38
|
}
|
|
30
|
-
}),
|
|
31
|
-
|
|
39
|
+
}), E(() => {
|
|
40
|
+
n !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(n), n = null);
|
|
32
41
|
}), (() => {
|
|
33
|
-
var
|
|
34
|
-
|
|
42
|
+
var l = K(), r = l.firstChild, m = r.firstChild;
|
|
43
|
+
c(r, d(A, {
|
|
35
44
|
get when() {
|
|
36
|
-
return
|
|
45
|
+
return o();
|
|
37
46
|
},
|
|
38
47
|
get children() {
|
|
39
48
|
return q();
|
|
40
49
|
}
|
|
41
|
-
}),
|
|
50
|
+
}), m), c(r, d(A, {
|
|
42
51
|
get when() {
|
|
43
|
-
return
|
|
52
|
+
return h();
|
|
44
53
|
},
|
|
45
54
|
get children() {
|
|
46
|
-
return
|
|
55
|
+
return B();
|
|
47
56
|
}
|
|
48
|
-
}),
|
|
49
|
-
var
|
|
50
|
-
return typeof
|
|
57
|
+
}), m), m.addEventListener("scroll", x);
|
|
58
|
+
var $ = i;
|
|
59
|
+
return typeof $ == "function" ? R($, m) : i = m, c(m, d(j, {
|
|
51
60
|
get each() {
|
|
52
61
|
return e.items;
|
|
53
62
|
},
|
|
54
|
-
children: (
|
|
55
|
-
item:
|
|
63
|
+
children: (a, y) => d(U, {
|
|
64
|
+
item: a,
|
|
56
65
|
get isActive() {
|
|
57
|
-
return e.activeId ===
|
|
66
|
+
return e.activeId === a.id;
|
|
67
|
+
},
|
|
68
|
+
get index() {
|
|
69
|
+
return y();
|
|
70
|
+
},
|
|
71
|
+
get itemCount() {
|
|
72
|
+
return e.items.length;
|
|
58
73
|
},
|
|
59
74
|
onClick: () => {
|
|
60
75
|
"vibrate" in navigator && navigator.vibrate(10);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
}
|
|
76
|
+
const f = a.onClick, _ = e.onSelect, F = a.id;
|
|
77
|
+
a.onClick ? L(() => f()) : _(F);
|
|
78
|
+
},
|
|
79
|
+
onKeyboardSelect: (f) => w(f)
|
|
64
80
|
})
|
|
65
|
-
})),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
})), S((a) => {
|
|
82
|
+
var y = g(
|
|
83
|
+
// Same safe-area rule as TopBar: keep the visual bar height stable, and
|
|
84
|
+
// add safe-area padding on an outer wrapper (avoid squeezing content).
|
|
85
|
+
"relative shrink-0 bg-background border-t border-border safe-bottom safe-left safe-right",
|
|
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;
|
|
89
|
+
}, {
|
|
90
|
+
e: void 0,
|
|
91
|
+
t: void 0
|
|
92
|
+
}), l;
|
|
71
93
|
})();
|
|
72
94
|
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
95
|
+
function U(e) {
|
|
96
|
+
const i = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
|
|
75
97
|
return (() => {
|
|
76
|
-
var
|
|
77
|
-
return
|
|
98
|
+
var o = H(), u = o.firstChild, h = u.nextSibling;
|
|
99
|
+
return o.$$keydown = (t) => {
|
|
100
|
+
let n = null;
|
|
101
|
+
switch (t.key) {
|
|
102
|
+
case "ArrowRight":
|
|
103
|
+
case "ArrowDown":
|
|
104
|
+
n = (e.index + 1) % e.itemCount;
|
|
105
|
+
break;
|
|
106
|
+
case "ArrowLeft":
|
|
107
|
+
case "ArrowUp":
|
|
108
|
+
n = (e.index - 1 + e.itemCount) % e.itemCount;
|
|
109
|
+
break;
|
|
110
|
+
case "Home":
|
|
111
|
+
n = 0;
|
|
112
|
+
break;
|
|
113
|
+
case "End":
|
|
114
|
+
n = e.itemCount - 1;
|
|
115
|
+
break;
|
|
116
|
+
default:
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
t.preventDefault(), e.onKeyboardSelect(n);
|
|
120
|
+
}, o.$$click = () => e.onClick(), c(u, d(W, {
|
|
78
121
|
get component() {
|
|
79
122
|
return e.item.icon;
|
|
80
123
|
},
|
|
81
124
|
class: "w-6 h-6"
|
|
82
|
-
}), null),
|
|
125
|
+
}), null), c(u, d(A, {
|
|
83
126
|
get when() {
|
|
84
|
-
return
|
|
127
|
+
return i();
|
|
85
128
|
},
|
|
86
129
|
get children() {
|
|
87
|
-
var t =
|
|
88
|
-
return
|
|
89
|
-
var
|
|
90
|
-
return () =>
|
|
91
|
-
})()),
|
|
130
|
+
var t = N();
|
|
131
|
+
return c(t, (() => {
|
|
132
|
+
var n = M(() => typeof i() == "number" && i() > 99);
|
|
133
|
+
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;
|
|
92
135
|
}
|
|
93
|
-
}), null),
|
|
136
|
+
}), null), c(h, () => e.item.label), c(o, d(A, {
|
|
94
137
|
get when() {
|
|
95
138
|
return e.isActive;
|
|
96
139
|
},
|
|
97
140
|
get children() {
|
|
98
|
-
return
|
|
141
|
+
return T();
|
|
99
142
|
}
|
|
100
|
-
}), null),
|
|
101
|
-
var
|
|
102
|
-
return
|
|
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;
|
|
103
146
|
}, {
|
|
104
147
|
e: void 0,
|
|
105
148
|
t: void 0,
|
|
106
149
|
a: void 0,
|
|
107
150
|
o: void 0,
|
|
108
|
-
i: void 0
|
|
109
|
-
|
|
151
|
+
i: void 0,
|
|
152
|
+
n: void 0
|
|
153
|
+
}), o;
|
|
110
154
|
})();
|
|
111
155
|
}
|
|
112
|
-
|
|
156
|
+
z(["click", "keydown"]);
|
|
113
157
|
export {
|
|
114
|
-
|
|
158
|
+
P as MobileTabBar
|
|
115
159
|
};
|