@floegence/floe-webapp-core 0.52.13 → 0.53.1
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/components/chat/ChatProvider.js +31 -30
- package/dist/components/chat/hooks/useAttachments.js +27 -26
- package/dist/components/chat/hooks/useCodeDiff.js +24 -23
- package/dist/components/chat/hooks/useCodeHighlight.js +21 -20
- package/dist/components/chat/hooks/useMarkdown.js +27 -26
- package/dist/components/chat/hooks/useMermaid.js +21 -20
- package/dist/components/layout/BottomBar.js +22 -22
- package/dist/components/layout/TopBar.js +7 -7
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Card.js +1 -1
- package/dist/components/ui/Checkbox.js +69 -69
- package/dist/components/ui/CommandPalette.js +29 -30
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/Dropdown.js +36 -38
- package/dist/components/ui/FloatingWindow.js +2 -3
- package/dist/components/ui/Input.js +3 -3
- package/dist/components/ui/Radio.js +26 -26
- package/dist/components/ui/SegmentedControl.js +6 -6
- package/dist/components/ui/Tabs.js +43 -43
- package/dist/components/ui/floatingPresence.js +1 -1
- package/dist/components/workbench/workbenchHelpers.js +96 -96
- package/dist/context/ThemeContext.js +75 -65
- package/dist/floe.css +27 -55
- package/dist/full.js +61 -59
- package/dist/index.js +26 -24
- package/dist/styles/themes/classicSemanticTokens.d.ts +142 -0
- package/dist/styles/themes/classicSemanticTokens.js +100 -94
- package/dist/styles/themes/presets.d.ts +3 -1
- package/dist/styles/themes/presets.js +126 -63
- package/dist/styles/tokens.d.ts +252 -252
- package/dist/styles/tokens.js +165 -164
- package/dist/styles.css +1 -1
- package/dist/surface.css +17 -42
- package/dist/themes/dark.css +41 -95
- package/dist/themes/light.css +43 -95
- package/dist/themes/shell-presets.generated.css +146 -4
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/secureRandom.d.ts +2 -0
- package/dist/utils/secureRandom.js +11 -0
- package/dist/utils/secureRandom.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spread as _, mergeProps as k, insert as
|
|
1
|
+
import { spread as _, mergeProps as k, insert as a, createComponent as v, memo as w, effect as z, setAttribute as b, className as $, template as p, delegateEvents as S } from "solid-js/web";
|
|
2
2
|
import { splitProps as P, For as A } from "solid-js";
|
|
3
3
|
import { cn as g } from "../../utils/cn.js";
|
|
4
4
|
var D = /* @__PURE__ */ p("<div role=group data-floe-surface=inset data-floe-surface-part=rail>"), E = /* @__PURE__ */ p('<button type=button role=radio data-floe-surface-part=segment><span class="inline-flex items-center gap-1.5">');
|
|
@@ -29,23 +29,23 @@ function B(x) {
|
|
|
29
29
|
get class() {
|
|
30
30
|
return g("floe-segmented-control inline-flex items-center rounded-lg border", s().container, t.disabled && "opacity-50 pointer-events-none", t.class);
|
|
31
31
|
}
|
|
32
|
-
}, h), !1, !0),
|
|
32
|
+
}, h), !1, !0), a(n, v(A, {
|
|
33
33
|
get each() {
|
|
34
34
|
return t.options;
|
|
35
35
|
},
|
|
36
36
|
children: (r) => {
|
|
37
|
-
const
|
|
37
|
+
const l = () => t.value === r.value, i = () => t.disabled || r.disabled;
|
|
38
38
|
return (() => {
|
|
39
39
|
var o = E(), c = o.firstChild;
|
|
40
|
-
return o.$$click = () => C(r.value, r.disabled),
|
|
40
|
+
return o.$$click = () => C(r.value, r.disabled), a(c, (() => {
|
|
41
41
|
var e = w(() => !!r.icon);
|
|
42
42
|
return () => e() && v(r.icon, {
|
|
43
43
|
get class() {
|
|
44
44
|
return s().icon;
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
})(), null),
|
|
48
|
-
var d =
|
|
47
|
+
})(), null), a(c, () => r.label, null), z((e) => {
|
|
48
|
+
var d = l() ? "raised" : "flat", u = l(), f = i(), m = g("floe-segmented-control__item font-medium rounded-md transition-[background-color,border-color,color] duration-120 cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1", s().button, "border", l() && "floe-segmented-control__item--active", i() && "cursor-not-allowed opacity-50");
|
|
49
49
|
return d !== e.e && b(o, "data-floe-surface", e.e = d), u !== e.t && b(o, "aria-checked", e.t = u), f !== e.a && (o.disabled = e.a = f), m !== e.o && $(o, e.o = m), e;
|
|
50
50
|
}, {
|
|
51
51
|
e: void 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createComponent as v, spread as de, mergeProps as ce, insert as f, effect as x, className as y, setStyleProperty as ne, memo as se, use as
|
|
2
|
-
import { splitProps as ue, Show as B, createSignal as L, untrack as
|
|
1
|
+
import { createComponent as v, spread as de, mergeProps as ce, insert as f, effect as x, className as y, setStyleProperty as ne, memo as se, use as ae, setAttribute as k, template as w, delegateEvents as Ne } from "solid-js/web";
|
|
2
|
+
import { splitProps as ue, Show as B, createSignal as L, untrack as le, createEffect as X, For as Le, onCleanup as ie } from "solid-js";
|
|
3
3
|
import { cn as g } from "../../utils/cn.js";
|
|
4
4
|
import { deferAfterPaint as M } from "../../utils/defer.js";
|
|
5
5
|
import { createUIFirstSelection as Re } from "../../utils/uiFirstSelection.js";
|
|
@@ -105,7 +105,7 @@ function Je(i) {
|
|
|
105
105
|
visible: z > 0
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function at(i) {
|
|
109
109
|
const [e, h] = ue(i, ["items", "activeId", "defaultActiveId", "onChange", "onActiveIdChange", "onClose", "onAdd", "showAdd", "closable", "size", "features", "slotClassNames", "ariaLabel", "class"]), d = () => e.features?.indicator?.mode ?? "activeBorder", C = () => Ve(e.features?.indicator?.thicknessPx), b = () => e.features?.indicator?.colorToken ?? "primary", p = () => e.features?.indicator?.animated ?? !0, R = () => e.features?.containerBorder ?? !0, I = () => e.features?.scrollButtons ?? "auto", T = () => e.features?.closeButton?.dangerHover ?? !0, z = () => e.features?.closeButton?.enabledByDefault ?? e.closable ?? !1, fe = () => e.features?.addButton?.enabled ?? e.showAdd ?? !1, q = () => qe(C()), O = () => Ke(b());
|
|
110
110
|
let u;
|
|
111
111
|
const K = (() => {
|
|
@@ -122,11 +122,11 @@ function lt(i) {
|
|
|
122
122
|
if (!u || !P()) return !1;
|
|
123
123
|
const o = H.get(n);
|
|
124
124
|
if (!o) return !1;
|
|
125
|
-
const
|
|
125
|
+
const a = Je({
|
|
126
126
|
container: u,
|
|
127
127
|
tab: o
|
|
128
128
|
});
|
|
129
|
-
return F(
|
|
129
|
+
return F(a), a.visible;
|
|
130
130
|
}, ve = () => {
|
|
131
131
|
if (!P()) {
|
|
132
132
|
F(V);
|
|
@@ -135,11 +135,11 @@ function lt(i) {
|
|
|
135
135
|
Y(G()) || F(V);
|
|
136
136
|
}, _ = () => {
|
|
137
137
|
j || (j = !0, M(() => {
|
|
138
|
-
j = !1,
|
|
138
|
+
j = !1, le(() => {
|
|
139
139
|
S() && ve();
|
|
140
140
|
});
|
|
141
141
|
}));
|
|
142
|
-
}, J = () => e.activeId !== void 0, he = () => e.onChange ?? e.onActiveIdChange, [be, ge] = L(
|
|
142
|
+
}, J = () => e.activeId !== void 0, he = () => e.onChange ?? e.onActiveIdChange, [be, ge] = L(le(() => e.defaultActiveId ?? e.items[0]?.id ?? "")), Q = Re({
|
|
143
143
|
committed: () => J() ? e.activeId : be(),
|
|
144
144
|
commit: (n) => {
|
|
145
145
|
J() || ge(n), he()?.(n);
|
|
@@ -153,9 +153,9 @@ function lt(i) {
|
|
|
153
153
|
const {
|
|
154
154
|
scrollLeft: n,
|
|
155
155
|
scrollWidth: o,
|
|
156
|
-
clientWidth:
|
|
157
|
-
} = u, t = o >
|
|
158
|
-
pe(t), me(n > 0), we(n +
|
|
156
|
+
clientWidth: a
|
|
157
|
+
} = u, t = o > a;
|
|
158
|
+
pe(t), me(n > 0), we(n + a < o - 1);
|
|
159
159
|
}, D = () => {
|
|
160
160
|
W || (W = !0, M(() => {
|
|
161
161
|
W = !1, S() && xe();
|
|
@@ -179,9 +179,9 @@ function lt(i) {
|
|
|
179
179
|
const o = () => {
|
|
180
180
|
D(), _();
|
|
181
181
|
};
|
|
182
|
-
let
|
|
183
|
-
typeof ResizeObserver < "u" ? (
|
|
184
|
-
u?.removeEventListener("scroll", n),
|
|
182
|
+
let a;
|
|
183
|
+
typeof ResizeObserver < "u" ? (a = new ResizeObserver(o), a.observe(u)) : typeof window < "u" && window.addEventListener("resize", o), ie(() => {
|
|
184
|
+
u?.removeEventListener("scroll", n), a?.disconnect(), typeof window < "u" && window.removeEventListener("resize", o);
|
|
185
185
|
});
|
|
186
186
|
}), X(() => {
|
|
187
187
|
S() && (e.items.length, D(), _());
|
|
@@ -192,31 +192,31 @@ function lt(i) {
|
|
|
192
192
|
const o = e.items.find((t) => t.id === n);
|
|
193
193
|
if (!o) return;
|
|
194
194
|
U(o.id, o.disabled);
|
|
195
|
-
const
|
|
196
|
-
|
|
195
|
+
const a = H.get(o.id);
|
|
196
|
+
a?.focus({
|
|
197
197
|
preventScroll: !0
|
|
198
|
-
}),
|
|
198
|
+
}), a?.scrollIntoView({
|
|
199
199
|
block: "nearest",
|
|
200
200
|
inline: "nearest"
|
|
201
201
|
});
|
|
202
202
|
}, Ie = (n, o) => {
|
|
203
|
-
const
|
|
204
|
-
|
|
203
|
+
const a = Xe(e.items, o.id, n.key);
|
|
204
|
+
a && (n.preventDefault(), Be(a));
|
|
205
205
|
}, Se = (n, o) => {
|
|
206
206
|
n.stopPropagation();
|
|
207
|
-
const
|
|
208
|
-
if (!
|
|
207
|
+
const a = e.onClose;
|
|
208
|
+
if (!a) return;
|
|
209
209
|
const t = o;
|
|
210
|
-
M(() =>
|
|
210
|
+
M(() => a(t));
|
|
211
211
|
}, Ae = {
|
|
212
212
|
sm: "h-7 px-2 text-[11px]",
|
|
213
213
|
md: "h-8 px-3 text-xs"
|
|
214
214
|
}, $e = (n, o) => {
|
|
215
|
-
const
|
|
215
|
+
const a = "inline-flex items-center gap-1.5 font-medium transition-colors duration-120 whitespace-nowrap", t = o ? "cursor-not-allowed opacity-50" : "cursor-pointer", r = (() => {
|
|
216
216
|
const c = d();
|
|
217
217
|
return c === "none" || c === "slider" && E().visible ? "border-transparent" : O().tabBorderClass;
|
|
218
218
|
})();
|
|
219
|
-
return g(
|
|
219
|
+
return g(a, t, Ae[e.size ?? "md"], "rounded-t", q().tabBorderClass, n ? g(r, "text-foreground bg-background", e.slotClassNames?.tabActive) : g("border-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50", e.slotClassNames?.tabInactive), o && "hover:bg-transparent hover:text-muted-foreground hover:border-transparent", e.slotClassNames?.tab);
|
|
220
220
|
};
|
|
221
221
|
return (() => {
|
|
222
222
|
var n = We(), o = n.firstChild;
|
|
@@ -233,24 +233,24 @@ function lt(i) {
|
|
|
233
233
|
return t.$$click = ye, f(t, v(Ye, {
|
|
234
234
|
class: "w-4 h-4"
|
|
235
235
|
})), x((r) => {
|
|
236
|
-
var c = !Z(),
|
|
237
|
-
return c !== r.e && (t.disabled = r.e = c),
|
|
236
|
+
var c = !Z(), l = g("flex-shrink-0 flex items-center justify-center", "w-6 h-6 rounded cursor-pointer", "transition-[color,background-color,opacity] duration-120", Z() ? "text-muted-foreground hover:text-foreground hover:bg-muted/80 opacity-100" : "opacity-0 pointer-events-none", e.slotClassNames?.scrollButton);
|
|
237
|
+
return c !== r.e && (t.disabled = r.e = c), l !== r.t && y(t, r.t = l), r;
|
|
238
238
|
}, {
|
|
239
239
|
e: void 0,
|
|
240
240
|
t: void 0
|
|
241
241
|
}), t;
|
|
242
242
|
}
|
|
243
243
|
}), o);
|
|
244
|
-
var
|
|
245
|
-
return typeof
|
|
244
|
+
var a = u;
|
|
245
|
+
return typeof a == "function" ? ae(a, o) : u = o, f(o, v(B, {
|
|
246
246
|
get when() {
|
|
247
247
|
return se(() => !!P())() && E().visible;
|
|
248
248
|
},
|
|
249
249
|
get children() {
|
|
250
250
|
var t = De();
|
|
251
251
|
return x((r) => {
|
|
252
|
-
var c = g("pointer-events-none absolute bottom-0 left-0 z-10", q().sliderHeightClass, O().sliderBgClass, p() ? "transition-[transform,width] duration-200 ease-out motion-reduce:transition-none" : "transition-none", "will-change-transform", e.slotClassNames?.indicator),
|
|
253
|
-
return c !== r.e && y(t, r.e = c),
|
|
252
|
+
var c = g("pointer-events-none absolute bottom-0 left-0 z-10", q().sliderHeightClass, O().sliderBgClass, p() ? "transition-[transform,width] duration-200 ease-out motion-reduce:transition-none" : "transition-none", "will-change-transform", e.slotClassNames?.indicator), l = `translate3d(${E().x}px, 0, 0)`, A = `${E().width}px`;
|
|
253
|
+
return c !== r.e && y(t, r.e = c), l !== r.t && ne(t, "transform", r.t = l), A !== r.a && ne(t, "width", r.a = A), r;
|
|
254
254
|
}, {
|
|
255
255
|
e: void 0,
|
|
256
256
|
t: void 0,
|
|
@@ -264,16 +264,16 @@ function lt(i) {
|
|
|
264
264
|
children: (t) => {
|
|
265
265
|
const r = () => t.id === G(), c = () => t.closable ?? z();
|
|
266
266
|
return (() => {
|
|
267
|
-
var
|
|
268
|
-
return
|
|
267
|
+
var l = Ge(), A = l.firstChild;
|
|
268
|
+
return l.$$keydown = (s) => {
|
|
269
269
|
if (s.key === "Enter" || s.key === " ") {
|
|
270
270
|
s.preventDefault(), U(t.id, t.disabled);
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
Ie(s, t);
|
|
274
|
-
},
|
|
274
|
+
}, l.$$click = () => U(t.id, t.disabled), ae((s) => {
|
|
275
275
|
H.set(t.id, s), ie(() => H.delete(t.id));
|
|
276
|
-
},
|
|
276
|
+
}, l), f(l, v(B, {
|
|
277
277
|
get when() {
|
|
278
278
|
return t.icon;
|
|
279
279
|
},
|
|
@@ -281,7 +281,7 @@ function lt(i) {
|
|
|
281
281
|
var s = Fe();
|
|
282
282
|
return f(s, () => t.icon), s;
|
|
283
283
|
}
|
|
284
|
-
}), A), f(A, () => t.label), f(
|
|
284
|
+
}), A), f(A, () => t.label), f(l, v(B, {
|
|
285
285
|
get when() {
|
|
286
286
|
return se(() => !!c())() && !t.disabled;
|
|
287
287
|
},
|
|
@@ -290,7 +290,7 @@ function lt(i) {
|
|
|
290
290
|
return s.$$click = (m) => Se(m, t.id), f(s, v(ze, {
|
|
291
291
|
class: "w-3 h-3"
|
|
292
292
|
})), x((m) => {
|
|
293
|
-
var $ = g("flex-shrink-0 flex items-center justify-center", "w-5 h-5 rounded cursor-pointer", "bg-transparent text-muted-foreground", T() ? "hover:bg-error hover:text-error-foreground" : "hover:bg-muted/80 hover:text-foreground", "transition-colors duration-
|
|
293
|
+
var $ = g("flex-shrink-0 flex items-center justify-center", "w-5 h-5 rounded cursor-pointer", "bg-transparent text-muted-foreground", T() ? "hover:bg-error hover:text-error-foreground" : "hover:bg-muted/80 hover:text-foreground", "transition-colors duration-120", "ml-1.5", e.slotClassNames?.closeButton), N = `Close ${t.label}`;
|
|
294
294
|
return $ !== m.e && y(s, m.e = $), N !== m.t && k(s, "aria-label", m.t = N), m;
|
|
295
295
|
}, {
|
|
296
296
|
e: void 0,
|
|
@@ -299,14 +299,14 @@ function lt(i) {
|
|
|
299
299
|
}
|
|
300
300
|
}), null), x((s) => {
|
|
301
301
|
var m = $e(r(), t.disabled), $ = r() ? "raised" : "flat", N = r(), re = t.disabled, oe = t.disabled ? -1 : r() ? 0 : -1;
|
|
302
|
-
return m !== s.e && y(
|
|
302
|
+
return m !== s.e && y(l, s.e = m), $ !== s.t && k(l, "data-floe-surface", s.t = $), N !== s.a && k(l, "aria-selected", s.a = N), re !== s.o && k(l, "aria-disabled", s.o = re), oe !== s.i && k(l, "tabindex", s.i = oe), s;
|
|
303
303
|
}, {
|
|
304
304
|
e: void 0,
|
|
305
305
|
t: void 0,
|
|
306
306
|
a: void 0,
|
|
307
307
|
o: void 0,
|
|
308
308
|
i: void 0
|
|
309
|
-
}),
|
|
309
|
+
}), l;
|
|
310
310
|
})();
|
|
311
311
|
}
|
|
312
312
|
}), null), f(n, v(B, {
|
|
@@ -322,7 +322,7 @@ function lt(i) {
|
|
|
322
322
|
get class() {
|
|
323
323
|
return e.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4";
|
|
324
324
|
}
|
|
325
|
-
})), x(() => y(t, g("flex-shrink-0 flex items-center justify-center", "rounded hover:bg-muted/80 cursor-pointer", "text-muted-foreground hover:text-foreground", "transition-colors duration-
|
|
325
|
+
})), x(() => y(t, g("flex-shrink-0 flex items-center justify-center", "rounded hover:bg-muted/80 cursor-pointer", "text-muted-foreground hover:text-foreground", "transition-colors duration-120", e.size === "sm" ? "w-6 h-6" : "w-7 h-7", e.slotClassNames?.addButton))), t;
|
|
326
326
|
}
|
|
327
327
|
}), null), f(n, v(B, {
|
|
328
328
|
get when() {
|
|
@@ -333,8 +333,8 @@ function lt(i) {
|
|
|
333
333
|
return t.$$click = ke, f(t, v(He, {
|
|
334
334
|
class: "w-4 h-4"
|
|
335
335
|
})), x((r) => {
|
|
336
|
-
var c = !ee(),
|
|
337
|
-
return c !== r.e && (t.disabled = r.e = c),
|
|
336
|
+
var c = !ee(), l = g("flex-shrink-0 flex items-center justify-center", "w-6 h-6 rounded cursor-pointer", "transition-[color,background-color,opacity] duration-120", ee() ? "text-muted-foreground hover:text-foreground hover:bg-muted/80 opacity-100" : "opacity-0 pointer-events-none", e.slotClassNames?.scrollButton);
|
|
337
|
+
return c !== r.e && (t.disabled = r.e = c), l !== r.t && y(t, r.t = l), r;
|
|
338
338
|
}, {
|
|
339
339
|
e: void 0,
|
|
340
340
|
t: void 0
|
|
@@ -355,7 +355,7 @@ function lt(i) {
|
|
|
355
355
|
}), n;
|
|
356
356
|
})();
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function lt(i) {
|
|
359
359
|
const [e, h] = ue(i, ["active", "keepMounted", "labelledBy", "class", "children"]);
|
|
360
360
|
return v(B, {
|
|
361
361
|
get when() {
|
|
@@ -382,7 +382,7 @@ function at(i) {
|
|
|
382
382
|
}
|
|
383
383
|
Ne(["click", "keydown"]);
|
|
384
384
|
export {
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
lt as TabPanel,
|
|
386
|
+
at as Tabs,
|
|
387
387
|
Xe as resolveTabNavigationTargetId
|
|
388
388
|
};
|
|
@@ -13,7 +13,7 @@ function F(e) {
|
|
|
13
13
|
globalThis.clearTimeout(e);
|
|
14
14
|
}
|
|
15
15
|
function y(e) {
|
|
16
|
-
return h() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ??
|
|
16
|
+
return h() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ?? 160);
|
|
17
17
|
}
|
|
18
18
|
function A(e) {
|
|
19
19
|
const o = g(() => e.open()), s = t(o), [a, m] = p(s), [l, i] = p(s ? "entering" : "exiting");
|