@usecrow/ui 0.1.73 → 0.1.75
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/index.cjs +309 -103
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +309 -103
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1275,6 +1275,20 @@ function useCrowAPI({ onIdentified, onReset } = {}) {
|
|
|
1275
1275
|
case "close":
|
|
1276
1276
|
window.dispatchEvent(new CustomEvent("crow:close"));
|
|
1277
1277
|
break;
|
|
1278
|
+
case "sendMessage": {
|
|
1279
|
+
const msgText = typeof options === "string" ? options : opts?.text ?? opts?.message;
|
|
1280
|
+
if (!msgText) {
|
|
1281
|
+
console.error("[Crow] sendMessage() requires a text string or { text }");
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
window.dispatchEvent(new CustomEvent("crow:open"));
|
|
1285
|
+
setTimeout(() => {
|
|
1286
|
+
window.dispatchEvent(
|
|
1287
|
+
new CustomEvent("crow:sendMessage", { detail: { text: msgText } })
|
|
1288
|
+
);
|
|
1289
|
+
}, 50);
|
|
1290
|
+
break;
|
|
1291
|
+
}
|
|
1278
1292
|
case "setToolStatus":
|
|
1279
1293
|
if (typeof options !== "string") {
|
|
1280
1294
|
console.error("[Crow] setToolStatus() requires a string");
|
|
@@ -2385,6 +2399,13 @@ function useCopilotStyles2() {
|
|
|
2385
2399
|
const context = React3.useContext(CopilotStyleContext);
|
|
2386
2400
|
return context?.styles ?? DEFAULT_COPILOT_STYLES;
|
|
2387
2401
|
}
|
|
2402
|
+
function useActiveStyles() {
|
|
2403
|
+
const copilotContext = React3.useContext(CopilotStyleContext);
|
|
2404
|
+
const widgetContext = React3.useContext(WidgetStyleContext);
|
|
2405
|
+
if (copilotContext) return copilotContext.styles;
|
|
2406
|
+
if (widgetContext) return widgetContext.styles;
|
|
2407
|
+
return DEFAULT_COPILOT_STYLES;
|
|
2408
|
+
}
|
|
2388
2409
|
var PASSTHROUGH_KEYS = /* @__PURE__ */ new Set(["Escape", "Tab"]);
|
|
2389
2410
|
function ShadowContainer({
|
|
2390
2411
|
children,
|
|
@@ -2922,6 +2943,7 @@ function ReasoningTrace({
|
|
|
2922
2943
|
] }) });
|
|
2923
2944
|
}
|
|
2924
2945
|
function WaitingIndicator() {
|
|
2946
|
+
const mutedColor = useActiveStyles().colors.text + "80";
|
|
2925
2947
|
const [messageIndex, setMessageIndex] = React3.useState(
|
|
2926
2948
|
() => Math.floor(Math.random() * THINKING_MESSAGES.length)
|
|
2927
2949
|
);
|
|
@@ -2932,7 +2954,7 @@ function WaitingIndicator() {
|
|
|
2932
2954
|
return () => clearInterval(interval);
|
|
2933
2955
|
}, []);
|
|
2934
2956
|
const message = THINKING_MESSAGES[messageIndex] + "...";
|
|
2935
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "crow-flex crow-items-center crow-gap-1.5 crow-text-xs
|
|
2957
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "crow-flex crow-items-center crow-gap-1.5 crow-text-xs", style: { color: mutedColor }, children: [
|
|
2936
2958
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "crow-flex crow-items-center crow-justify-center crow-w-4 crow-h-4", children: /* @__PURE__ */ jsxRuntime.jsx(ShimmeringContent, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Brain, { className: "crow-w-3.5 crow-h-3.5" }) }) }),
|
|
2937
2959
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-font-medium", children: /* @__PURE__ */ jsxRuntime.jsx(ShimmeringContent, { children: message }) })
|
|
2938
2960
|
] });
|
|
@@ -2941,6 +2963,8 @@ function ThinkingBlock({
|
|
|
2941
2963
|
thinking,
|
|
2942
2964
|
isComplete
|
|
2943
2965
|
}) {
|
|
2966
|
+
const themeColors = useActiveStyles().colors;
|
|
2967
|
+
const mutedColor = themeColors.text + "80";
|
|
2944
2968
|
const [isExpanded, setIsExpanded] = React3.useState(!isComplete);
|
|
2945
2969
|
const [messageIndex, setMessageIndex] = React3.useState(
|
|
2946
2970
|
() => Math.floor(Math.random() * THINKING_MESSAGES.length)
|
|
@@ -2962,7 +2986,8 @@ function ThinkingBlock({
|
|
|
2962
2986
|
"button",
|
|
2963
2987
|
{
|
|
2964
2988
|
onClick: () => setIsExpanded(!isExpanded),
|
|
2965
|
-
className:
|
|
2989
|
+
className: "crow-flex crow-items-center crow-gap-1.5 crow-select-none crow-transition-colors crow-cursor-pointer",
|
|
2990
|
+
style: { color: mutedColor },
|
|
2966
2991
|
children: [
|
|
2967
2992
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "crow-flex crow-items-center crow-justify-center crow-w-4 crow-h-4", children: isInProgress ? /* @__PURE__ */ jsxRuntime.jsx(ShimmeringContent, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Brain, { className: "crow-w-3.5 crow-h-3.5" }) }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Brain, { className: "crow-w-3.5 crow-h-3.5" }) }),
|
|
2968
2993
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-font-medium", children: isInProgress ? /* @__PURE__ */ jsxRuntime.jsx(ShimmeringContent, { children: message }) : "Thought" }),
|
|
@@ -2987,10 +3012,11 @@ function ThinkingBlock({
|
|
|
2987
3012
|
exit: { height: 0, opacity: 0 },
|
|
2988
3013
|
transition: { duration: 0.15 },
|
|
2989
3014
|
className: "crow-overflow-hidden",
|
|
2990
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "crow-border-l-2 crow-
|
|
3015
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "crow-border-l-2 crow-pl-3 crow-ml-2", style: { borderColor: themeColors.border }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2991
3016
|
"div",
|
|
2992
3017
|
{
|
|
2993
|
-
className:
|
|
3018
|
+
className: "crow-text-xs crow-leading-relaxed crow-whitespace-pre-wrap",
|
|
3019
|
+
style: { color: mutedColor },
|
|
2994
3020
|
children: thinking
|
|
2995
3021
|
}
|
|
2996
3022
|
) })
|
|
@@ -3020,6 +3046,8 @@ function ToolCallBlock({
|
|
|
3020
3046
|
toolRenderers,
|
|
3021
3047
|
onToolConsent
|
|
3022
3048
|
}) {
|
|
3049
|
+
const themeColors = useActiveStyles().colors;
|
|
3050
|
+
const mutedColor = themeColors.text + "80";
|
|
3023
3051
|
const [expanded, setExpanded] = React3.useState(false);
|
|
3024
3052
|
const hasArgs = Object.keys(toolCall.arguments || {}).length > 0;
|
|
3025
3053
|
const isExecuting = toolCall.status === "executing";
|
|
@@ -3033,13 +3061,15 @@ function ToolCallBlock({
|
|
|
3033
3061
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3034
3062
|
"div",
|
|
3035
3063
|
{
|
|
3036
|
-
className:
|
|
3064
|
+
className: "crow-flex crow-items-center crow-gap-1.5 crow-select-none crow-transition-colors",
|
|
3065
|
+
style: { color: mutedColor },
|
|
3037
3066
|
children: [
|
|
3038
3067
|
hasArgs && !isAwaitingConsent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3039
3068
|
"button",
|
|
3040
3069
|
{
|
|
3041
3070
|
onClick: () => setExpanded(!expanded),
|
|
3042
|
-
className: "crow-cursor-pointer
|
|
3071
|
+
className: "crow-cursor-pointer",
|
|
3072
|
+
style: { color: mutedColor },
|
|
3043
3073
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3044
3074
|
framerMotion.motion.div,
|
|
3045
3075
|
{
|
|
@@ -3054,7 +3084,7 @@ function ToolCallBlock({
|
|
|
3054
3084
|
isExecuting && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "crow-w-3 crow-h-3 crow-animate-spin crow-text-blue-500" }),
|
|
3055
3085
|
isComplete && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "crow-w-3 crow-h-3 crow-text-green-500" }),
|
|
3056
3086
|
isError && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-w-3 crow-h-3 crow-text-red-500", children: "\u2715" }),
|
|
3057
|
-
isDenied && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-w-3 crow-h-3
|
|
3087
|
+
isDenied && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-w-3 crow-h-3", style: { color: mutedColor }, children: "\u2715" }),
|
|
3058
3088
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-font-medium", children: toolCall.displayName || toolCall.name }),
|
|
3059
3089
|
isAwaitingConsent && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3060
3090
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-text-amber-500", children: "needs permission" }),
|
|
@@ -3071,16 +3101,16 @@ function ToolCallBlock({
|
|
|
3071
3101
|
"button",
|
|
3072
3102
|
{
|
|
3073
3103
|
onClick: () => onToolConsent?.(toolCall.id, false),
|
|
3074
|
-
className: "crow-px-2 crow-py-0.5 crow-rounded crow-border crow-text-xs crow-font-medium crow-
|
|
3075
|
-
style: { borderColor:
|
|
3104
|
+
className: "crow-px-2 crow-py-0.5 crow-rounded crow-border crow-text-xs crow-font-medium crow-cursor-pointer",
|
|
3105
|
+
style: { borderColor: themeColors.border, backgroundColor: "transparent", color: mutedColor },
|
|
3076
3106
|
children: "Deny"
|
|
3077
3107
|
}
|
|
3078
3108
|
)
|
|
3079
3109
|
] }),
|
|
3080
|
-
isExecuting && /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
3081
|
-
isComplete && /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
3082
|
-
isError && /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
3083
|
-
isDenied && /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
3110
|
+
isExecuting && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: mutedColor }, children: "running..." }),
|
|
3111
|
+
isComplete && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: mutedColor }, children: "done" }),
|
|
3112
|
+
isError && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: mutedColor }, children: "failed" }),
|
|
3113
|
+
isDenied && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: mutedColor }, children: "denied" })
|
|
3084
3114
|
]
|
|
3085
3115
|
}
|
|
3086
3116
|
),
|
|
@@ -3181,7 +3211,7 @@ function MessageBubble({
|
|
|
3181
3211
|
toolRenderers,
|
|
3182
3212
|
onToolConsent
|
|
3183
3213
|
}) {
|
|
3184
|
-
const styles =
|
|
3214
|
+
const styles = useActiveStyles();
|
|
3185
3215
|
const showThinkingSetting = useShowThinking();
|
|
3186
3216
|
const isWaiting = message.content === "Thinking..." || message.isBot && isLoading && !message.content;
|
|
3187
3217
|
const hasThinking = message.isBot && message.thinking;
|
|
@@ -3300,7 +3330,7 @@ function MessageList({
|
|
|
3300
3330
|
}) });
|
|
3301
3331
|
}
|
|
3302
3332
|
var MessagesContainer = React3.forwardRef(({ children }, ref) => {
|
|
3303
|
-
const styles =
|
|
3333
|
+
const styles = useActiveStyles();
|
|
3304
3334
|
const internalRef = React3.useRef(null);
|
|
3305
3335
|
const lastScrollHeightRef = React3.useRef(0);
|
|
3306
3336
|
const isUserScrollingRef = React3.useRef(false);
|
|
@@ -3362,26 +3392,92 @@ function ConversationList({
|
|
|
3362
3392
|
onSelect,
|
|
3363
3393
|
onClose
|
|
3364
3394
|
}) {
|
|
3395
|
+
const styles = useActiveStyles();
|
|
3365
3396
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3366
3397
|
framerMotion.motion.div,
|
|
3367
3398
|
{
|
|
3368
3399
|
initial: { opacity: 0, height: 0 },
|
|
3369
3400
|
animate: { opacity: 1, height: "auto" },
|
|
3370
3401
|
exit: { opacity: 0, height: 0 },
|
|
3371
|
-
className: "crow-mb-3 crow-rounded-xl crow-
|
|
3402
|
+
className: "crow-mb-3 crow-rounded-xl crow-border",
|
|
3403
|
+
style: {
|
|
3404
|
+
background: styles.colors.text + "08",
|
|
3405
|
+
borderColor: styles.colors.border
|
|
3406
|
+
},
|
|
3372
3407
|
children: [
|
|
3373
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3408
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3409
|
+
"div",
|
|
3410
|
+
{
|
|
3411
|
+
className: "crow-p-2 crow-border-b crow-flex crow-justify-between crow-items-center",
|
|
3412
|
+
style: { borderColor: styles.colors.border },
|
|
3413
|
+
children: [
|
|
3414
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3415
|
+
"span",
|
|
3416
|
+
{
|
|
3417
|
+
className: "crow-text-sm crow-font-medium",
|
|
3418
|
+
style: { color: styles.colors.text + "cc" },
|
|
3419
|
+
children: "Recent Conversations"
|
|
3420
|
+
}
|
|
3421
|
+
),
|
|
3422
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3423
|
+
"button",
|
|
3424
|
+
{
|
|
3425
|
+
onClick: onClose,
|
|
3426
|
+
className: "crow-p-1 crow-rounded",
|
|
3427
|
+
style: { color: styles.colors.text + "80" },
|
|
3428
|
+
onMouseEnter: (e) => {
|
|
3429
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
3430
|
+
},
|
|
3431
|
+
onMouseLeave: (e) => {
|
|
3432
|
+
e.currentTarget.style.background = "transparent";
|
|
3433
|
+
},
|
|
3434
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14 })
|
|
3435
|
+
}
|
|
3436
|
+
)
|
|
3437
|
+
]
|
|
3438
|
+
}
|
|
3439
|
+
),
|
|
3440
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "crow-max-h-[200px] crow-overflow-y-auto", children: conversations.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3441
|
+
"div",
|
|
3442
|
+
{
|
|
3443
|
+
className: "crow-p-4 crow-text-center crow-text-sm",
|
|
3444
|
+
style: { color: styles.colors.text + "80" },
|
|
3445
|
+
children: "No conversations yet"
|
|
3446
|
+
}
|
|
3447
|
+
) : conversations.map((conv) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3378
3448
|
"button",
|
|
3379
3449
|
{
|
|
3380
3450
|
onClick: () => onSelect(conv.id),
|
|
3381
|
-
className:
|
|
3451
|
+
className: "crow-w-full crow-p-3 crow-text-left crow-transition-colors crow-border-b last:crow-border-0",
|
|
3452
|
+
style: {
|
|
3453
|
+
borderColor: styles.colors.border,
|
|
3454
|
+
background: currentConversationId === conv.id ? styles.colors.primary + "18" : "transparent"
|
|
3455
|
+
},
|
|
3456
|
+
onMouseEnter: (e) => {
|
|
3457
|
+
if (currentConversationId !== conv.id) {
|
|
3458
|
+
e.currentTarget.style.background = styles.colors.text + "08";
|
|
3459
|
+
}
|
|
3460
|
+
},
|
|
3461
|
+
onMouseLeave: (e) => {
|
|
3462
|
+
e.currentTarget.style.background = currentConversationId === conv.id ? styles.colors.primary + "18" : "transparent";
|
|
3463
|
+
},
|
|
3382
3464
|
children: [
|
|
3383
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3384
|
-
|
|
3465
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3466
|
+
"div",
|
|
3467
|
+
{
|
|
3468
|
+
className: "crow-text-sm crow-font-medium crow-truncate",
|
|
3469
|
+
style: { color: styles.colors.text },
|
|
3470
|
+
children: conv.name || "Untitled conversation"
|
|
3471
|
+
}
|
|
3472
|
+
),
|
|
3473
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3474
|
+
"div",
|
|
3475
|
+
{
|
|
3476
|
+
className: "crow-text-xs crow-mt-0.5",
|
|
3477
|
+
style: { color: styles.colors.text + "80" },
|
|
3478
|
+
children: formatConversationDate(conv.updated_at)
|
|
3479
|
+
}
|
|
3480
|
+
)
|
|
3385
3481
|
]
|
|
3386
3482
|
},
|
|
3387
3483
|
conv.id
|
|
@@ -3398,14 +3494,26 @@ function WorkflowPanel({ workflow, onExit }) {
|
|
|
3398
3494
|
animate: { opacity: 1, y: 0 },
|
|
3399
3495
|
exit: { opacity: 0, y: -10 },
|
|
3400
3496
|
transition: { duration: 0.3 },
|
|
3401
|
-
className: "crow-mb-3 crow-p-3 crow-rounded-xl crow-
|
|
3497
|
+
className: "crow-mb-3 crow-p-3 crow-rounded-xl crow-border",
|
|
3498
|
+
style: {
|
|
3499
|
+
background: "var(--crow-bg-hover, rgba(0,0,0,0.04))",
|
|
3500
|
+
borderColor: "var(--crow-border, #e5e7eb)"
|
|
3501
|
+
},
|
|
3402
3502
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "crow-flex crow-items-center crow-justify-between", children: [
|
|
3403
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3503
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3504
|
+
"span",
|
|
3505
|
+
{
|
|
3506
|
+
className: "crow-text-sm crow-font-medium crow-flex crow-items-center crow-gap-1",
|
|
3507
|
+
style: { color: "var(--crow-text, #111827)" },
|
|
3508
|
+
children: workflow.name
|
|
3509
|
+
}
|
|
3510
|
+
),
|
|
3404
3511
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3405
3512
|
"button",
|
|
3406
3513
|
{
|
|
3407
3514
|
onClick: onExit,
|
|
3408
|
-
className: "crow-text-xs crow-
|
|
3515
|
+
className: "crow-text-xs crow-underline",
|
|
3516
|
+
style: { color: "var(--crow-text-muted, #6b7280)" },
|
|
3409
3517
|
children: "Exit"
|
|
3410
3518
|
}
|
|
3411
3519
|
)
|
|
@@ -3414,12 +3522,14 @@ function WorkflowPanel({ workflow, onExit }) {
|
|
|
3414
3522
|
);
|
|
3415
3523
|
}
|
|
3416
3524
|
function PoweredByBadge({ apiUrl = "" }) {
|
|
3417
|
-
const styles =
|
|
3525
|
+
const styles = useActiveStyles();
|
|
3418
3526
|
const branding = styles.branding;
|
|
3419
3527
|
if (!branding.showPoweredBy) return null;
|
|
3420
|
-
const
|
|
3421
|
-
|
|
3422
|
-
|
|
3528
|
+
const showLogo = "showLogo" in branding ? branding.showLogo : false;
|
|
3529
|
+
const rawLogoUrl = "logoUrl" in branding ? branding.logoUrl : void 0;
|
|
3530
|
+
const logoUrl = rawLogoUrl?.startsWith("http") ? rawLogoUrl : rawLogoUrl ? `${apiUrl}${rawLogoUrl}` : void 0;
|
|
3531
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "crow-flex crow-items-center crow-justify-center crow-gap-1.5 crow-mb-3 crow-text-xs", style: { color: "var(--crow-text-muted, #9ca3af)" }, children: [
|
|
3532
|
+
showLogo && logoUrl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3423
3533
|
"img",
|
|
3424
3534
|
{
|
|
3425
3535
|
src: logoUrl,
|
|
@@ -3466,10 +3576,10 @@ var ModelSelector = ({
|
|
|
3466
3576
|
disabled,
|
|
3467
3577
|
className: cn(
|
|
3468
3578
|
"crow-flex crow-items-center crow-gap-1 crow-px-2 crow-py-1 crow-rounded-md crow-text-xs",
|
|
3469
|
-
"crow-bg-transparent crow-
|
|
3470
|
-
"hover:crow-text-gray-700 crow-transition-colors",
|
|
3579
|
+
"crow-bg-transparent crow-transition-colors",
|
|
3471
3580
|
disabled ? "crow-opacity-50 crow-cursor-not-allowed" : "crow-cursor-pointer"
|
|
3472
3581
|
),
|
|
3582
|
+
style: { color: "var(--crow-text-muted, #9ca3af)" },
|
|
3473
3583
|
children: [
|
|
3474
3584
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: selectedModelData?.name || "Select Model" }),
|
|
3475
3585
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3484,28 +3594,48 @@ var ModelSelector = ({
|
|
|
3484
3594
|
]
|
|
3485
3595
|
}
|
|
3486
3596
|
),
|
|
3487
|
-
isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
"
|
|
3491
|
-
{
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3597
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3598
|
+
"div",
|
|
3599
|
+
{
|
|
3600
|
+
className: "crow-absolute crow-bottom-full crow-mb-2 crow-left-0 crow-min-w-[180px] crow-rounded-xl crow-shadow-lg crow-z-50 crow-overflow-hidden crow-border",
|
|
3601
|
+
style: { background: "var(--crow-bg, #ffffff)", borderColor: "var(--crow-border, #e5e7eb)" },
|
|
3602
|
+
children: Object.entries(groupedModels).map(([provider, providerModels]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3603
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3604
|
+
"div",
|
|
3605
|
+
{
|
|
3606
|
+
className: "crow-px-3 crow-py-1.5 crow-text-xs crow-font-medium crow-uppercase crow-tracking-wide",
|
|
3607
|
+
style: {
|
|
3608
|
+
color: "var(--crow-text-muted, #9ca3af)",
|
|
3609
|
+
background: "var(--crow-bg-hover, rgba(0,0,0,0.04))"
|
|
3610
|
+
},
|
|
3611
|
+
children: provider
|
|
3612
|
+
}
|
|
3500
3613
|
),
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3614
|
+
providerModels.map((model) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3615
|
+
"button",
|
|
3616
|
+
{
|
|
3617
|
+
onClick: () => {
|
|
3618
|
+
onModelChange(model.id);
|
|
3619
|
+
setIsOpen(false);
|
|
3620
|
+
},
|
|
3621
|
+
className: "crow-w-full crow-flex crow-items-center crow-justify-between crow-px-3 crow-py-1.5 crow-text-sm crow-transition-colors",
|
|
3622
|
+
style: { color: model.id === selectedModel ? "var(--crow-text, #111827)" : "var(--crow-text-muted, #4b5563)" },
|
|
3623
|
+
onMouseEnter: (e) => {
|
|
3624
|
+
e.currentTarget.style.background = "var(--crow-bg-hover, rgba(0,0,0,0.04))";
|
|
3625
|
+
},
|
|
3626
|
+
onMouseLeave: (e) => {
|
|
3627
|
+
e.currentTarget.style.background = "transparent";
|
|
3628
|
+
},
|
|
3629
|
+
children: [
|
|
3630
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: model.name }),
|
|
3631
|
+
model.id === selectedModel && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "crow-w-4 crow-h-4 crow-text-green-500" })
|
|
3632
|
+
]
|
|
3633
|
+
},
|
|
3634
|
+
model.id
|
|
3635
|
+
))
|
|
3636
|
+
] }, provider))
|
|
3637
|
+
}
|
|
3638
|
+
)
|
|
3509
3639
|
] });
|
|
3510
3640
|
};
|
|
3511
3641
|
var isMediaRecorderSupported = () => {
|
|
@@ -3706,9 +3836,12 @@ var Textarea = React3__default.default.forwardRef(
|
|
|
3706
3836
|
"textarea",
|
|
3707
3837
|
{
|
|
3708
3838
|
className: cn(
|
|
3709
|
-
"crow-flex crow-w-full crow-rounded-md crow-border-none crow-bg-transparent crow-px-3 crow-py-1.5 crow-text-base
|
|
3839
|
+
"crow-flex crow-w-full crow-rounded-md crow-border-none crow-bg-transparent crow-px-3 crow-py-1.5 crow-text-base focus-visible:crow-outline-none focus-visible:crow-ring-0 disabled:crow-cursor-not-allowed disabled:crow-opacity-50 crow-min-h-[32px] crow-resize-none",
|
|
3710
3840
|
className
|
|
3711
3841
|
),
|
|
3842
|
+
style: {
|
|
3843
|
+
color: "inherit"
|
|
3844
|
+
},
|
|
3712
3845
|
ref,
|
|
3713
3846
|
rows: 1,
|
|
3714
3847
|
...props
|
|
@@ -3725,9 +3858,10 @@ var TooltipContent = React3__default.default.forwardRef(({ className, sideOffset
|
|
|
3725
3858
|
ref,
|
|
3726
3859
|
sideOffset,
|
|
3727
3860
|
className: cn(
|
|
3728
|
-
"crow-z-50 crow-overflow-hidden crow-rounded-md crow-border crow-
|
|
3861
|
+
"crow-z-50 crow-overflow-hidden crow-rounded-md crow-border crow-px-3 crow-py-1.5 crow-text-sm crow-shadow-md",
|
|
3729
3862
|
className
|
|
3730
3863
|
),
|
|
3864
|
+
style: { background: "var(--crow-bg, #ffffff)", borderColor: "var(--crow-border, #d1d5db)", color: "var(--crow-text, #111827)" },
|
|
3731
3865
|
...props
|
|
3732
3866
|
}
|
|
3733
3867
|
));
|
|
@@ -3735,9 +3869,9 @@ TooltipContent.displayName = "TooltipContent";
|
|
|
3735
3869
|
var Button = React3__default.default.forwardRef(
|
|
3736
3870
|
({ className, variant = "default", size = "default", ...props }, ref) => {
|
|
3737
3871
|
const variantClasses = {
|
|
3738
|
-
default: "crow-
|
|
3739
|
-
outline: "crow-border crow-bg-transparent
|
|
3740
|
-
ghost: "crow-bg-transparent
|
|
3872
|
+
default: "crow-text-white",
|
|
3873
|
+
outline: "crow-border crow-bg-transparent",
|
|
3874
|
+
ghost: "crow-bg-transparent"
|
|
3741
3875
|
};
|
|
3742
3876
|
const sizeClasses = {
|
|
3743
3877
|
default: "crow-h-10 crow-px-4 crow-py-2",
|
|
@@ -3810,11 +3944,16 @@ var PromptInput = React3__default.default.forwardRef(
|
|
|
3810
3944
|
{
|
|
3811
3945
|
ref,
|
|
3812
3946
|
className: cn(
|
|
3813
|
-
"crow-rounded-3xl crow-border crow-
|
|
3947
|
+
"crow-rounded-3xl crow-border crow-p-1.5 crow-shadow-lg crow-transition-all crow-duration-300",
|
|
3814
3948
|
isLoading && "crow-border-red-500",
|
|
3815
3949
|
className
|
|
3816
3950
|
),
|
|
3817
|
-
style
|
|
3951
|
+
style: {
|
|
3952
|
+
background: "var(--crow-bg, #ffffff)",
|
|
3953
|
+
color: "var(--crow-text, #111827)",
|
|
3954
|
+
borderColor: isLoading ? void 0 : "var(--crow-border, #d1d5db)",
|
|
3955
|
+
...style
|
|
3956
|
+
},
|
|
3818
3957
|
children
|
|
3819
3958
|
}
|
|
3820
3959
|
)
|
|
@@ -3897,6 +4036,7 @@ var PromptInputBox = React3__default.default.forwardRef(
|
|
|
3897
4036
|
backendUrl = "",
|
|
3898
4037
|
triggerVoiceRecording = 0
|
|
3899
4038
|
}, ref) => {
|
|
4039
|
+
const themeStyles = useActiveStyles();
|
|
3900
4040
|
const [input, setInput] = React3__default.default.useState("");
|
|
3901
4041
|
const promptBoxRef = React3__default.default.useRef(null);
|
|
3902
4042
|
const voice = useVoiceInput({ backendUrl, silenceTimeoutMs: 1500 });
|
|
@@ -3950,10 +4090,15 @@ var PromptInputBox = React3__default.default.forwardRef(
|
|
|
3950
4090
|
highlighted && "crow-ring-4 crow-ring-offset-2 crow-animate-pulse crow-shadow-[0_0_20px_rgba(0,0,0,0.25)]",
|
|
3951
4091
|
className
|
|
3952
4092
|
),
|
|
3953
|
-
style:
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
4093
|
+
style: {
|
|
4094
|
+
background: themeStyles.colors.background,
|
|
4095
|
+
color: themeStyles.colors.text,
|
|
4096
|
+
borderColor: themeStyles.colors.border,
|
|
4097
|
+
...highlighted ? {
|
|
4098
|
+
"--tw-ring-color": themeStyles.colors.userBubble,
|
|
4099
|
+
"--tw-ring-offset-color": themeStyles.colors.background
|
|
4100
|
+
} : {}
|
|
4101
|
+
},
|
|
3957
4102
|
disabled: isLoading,
|
|
3958
4103
|
ref: ref || promptBoxRef,
|
|
3959
4104
|
children: [
|
|
@@ -3993,10 +4138,8 @@ var PromptInputBox = React3__default.default.forwardRef(
|
|
|
3993
4138
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3994
4139
|
lucideReact.Mic,
|
|
3995
4140
|
{
|
|
3996
|
-
className:
|
|
3997
|
-
|
|
3998
|
-
voice.isRecording ? "crow-text-red-500" : "crow-text-gray-400"
|
|
3999
|
-
)
|
|
4141
|
+
className: "crow-h-3.5 crow-w-3.5 crow-transition-colors",
|
|
4142
|
+
style: { color: voice.isRecording ? "#ef4444" : "var(--crow-text-muted, #9ca3af)" }
|
|
4000
4143
|
}
|
|
4001
4144
|
),
|
|
4002
4145
|
voice.isRecording && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "crow-absolute crow-top-0 crow-right-0 crow-h-2 crow-w-2 crow-rounded-full crow-bg-red-500 crow-animate-pulse" })
|
|
@@ -4014,12 +4157,10 @@ var PromptInputBox = React3__default.default.forwardRef(
|
|
|
4014
4157
|
{
|
|
4015
4158
|
variant: "default",
|
|
4016
4159
|
size: "icon",
|
|
4017
|
-
className:
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
!hasContent && !isLoading && !showStopButton && "crow-bg-transparent"
|
|
4022
|
-
),
|
|
4160
|
+
className: "crow-h-7 crow-w-7 crow-rounded-full crow-transition-all crow-duration-200",
|
|
4161
|
+
style: {
|
|
4162
|
+
background: isLoading || showStopButton ? "#ef4444" : hasContent ? "var(--crow-primary, #000000)" : "transparent"
|
|
4163
|
+
},
|
|
4023
4164
|
onClick: () => {
|
|
4024
4165
|
if ((isLoading || showStopButton) && onStop) {
|
|
4025
4166
|
onStop();
|
|
@@ -4036,10 +4177,8 @@ var PromptInputBox = React3__default.default.forwardRef(
|
|
|
4036
4177
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4037
4178
|
lucideReact.ArrowUp,
|
|
4038
4179
|
{
|
|
4039
|
-
className:
|
|
4040
|
-
|
|
4041
|
-
hasContent ? "crow-text-white" : "crow-text-gray-400"
|
|
4042
|
-
)
|
|
4180
|
+
className: "crow-h-3.5 crow-w-3.5",
|
|
4181
|
+
style: { color: hasContent ? "white" : "var(--crow-text-muted, #9ca3af)" }
|
|
4043
4182
|
}
|
|
4044
4183
|
)
|
|
4045
4184
|
}
|
|
@@ -4059,7 +4198,7 @@ function BrowserUseConfirmation({
|
|
|
4059
4198
|
onAllow,
|
|
4060
4199
|
onDeny
|
|
4061
4200
|
}) {
|
|
4062
|
-
const styles =
|
|
4201
|
+
const styles = useActiveStyles();
|
|
4063
4202
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4064
4203
|
"div",
|
|
4065
4204
|
{
|
|
@@ -4141,7 +4280,7 @@ function BrowserUseQuestion({
|
|
|
4141
4280
|
question,
|
|
4142
4281
|
onSubmit
|
|
4143
4282
|
}) {
|
|
4144
|
-
const styles =
|
|
4283
|
+
const styles = useActiveStyles();
|
|
4145
4284
|
const [answer, setAnswer] = React3.useState("");
|
|
4146
4285
|
const [isSubmitting, setIsSubmitting] = React3.useState(false);
|
|
4147
4286
|
const handleSubmit = React3.useCallback(() => {
|
|
@@ -4228,15 +4367,15 @@ function SuggestedActions({
|
|
|
4228
4367
|
actions,
|
|
4229
4368
|
onActionClick
|
|
4230
4369
|
}) {
|
|
4231
|
-
const styles =
|
|
4370
|
+
const styles = useActiveStyles();
|
|
4232
4371
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "crow-flex crow-flex-wrap crow-gap-2 crow-px-1 crow-pb-2", children: actions.map((action, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4233
4372
|
"button",
|
|
4234
4373
|
{
|
|
4235
4374
|
onClick: () => onActionClick(action),
|
|
4236
4375
|
className: "crow-rounded-full crow-border crow-px-3 crow-py-1.5 crow-text-sm crow-font-medium crow-transition-colors hover:crow-opacity-80 crow-cursor-pointer",
|
|
4237
4376
|
style: {
|
|
4238
|
-
borderColor: styles.colors.
|
|
4239
|
-
color: styles.colors.
|
|
4377
|
+
borderColor: styles.colors.border,
|
|
4378
|
+
color: styles.colors.text,
|
|
4240
4379
|
background: "transparent"
|
|
4241
4380
|
},
|
|
4242
4381
|
children: action.label
|
|
@@ -4917,6 +5056,10 @@ function CrowWidget({
|
|
|
4917
5056
|
React3.useEffect(() => {
|
|
4918
5057
|
const handleOpen = () => setIsCollapsed(false);
|
|
4919
5058
|
const handleClose = () => setIsCollapsed(true);
|
|
5059
|
+
const handleSendMessage = (e) => {
|
|
5060
|
+
const text = e.detail?.text;
|
|
5061
|
+
if (text) handleSend(text);
|
|
5062
|
+
};
|
|
4920
5063
|
const handleSetSuggestions = (e) => {
|
|
4921
5064
|
const actions = e.detail;
|
|
4922
5065
|
if (Array.isArray(actions)) {
|
|
@@ -4926,6 +5069,7 @@ function CrowWidget({
|
|
|
4926
5069
|
};
|
|
4927
5070
|
window.addEventListener("crow:open", handleOpen);
|
|
4928
5071
|
window.addEventListener("crow:close", handleClose);
|
|
5072
|
+
window.addEventListener("crow:sendMessage", handleSendMessage);
|
|
4929
5073
|
window.addEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
4930
5074
|
const pending = window.__crow_suggested_actions;
|
|
4931
5075
|
if (Array.isArray(pending) && pending.length > 0) {
|
|
@@ -4935,6 +5079,7 @@ function CrowWidget({
|
|
|
4935
5079
|
return () => {
|
|
4936
5080
|
window.removeEventListener("crow:open", handleOpen);
|
|
4937
5081
|
window.removeEventListener("crow:close", handleClose);
|
|
5082
|
+
window.removeEventListener("crow:sendMessage", handleSendMessage);
|
|
4938
5083
|
window.removeEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
4939
5084
|
};
|
|
4940
5085
|
}, []);
|
|
@@ -5546,6 +5691,10 @@ function CrowCopilot({
|
|
|
5546
5691
|
React3.useEffect(() => {
|
|
5547
5692
|
const handleOpen = () => setIsCollapsed(false);
|
|
5548
5693
|
const handleClose = () => setIsCollapsed(true);
|
|
5694
|
+
const handleSendMessage = (e) => {
|
|
5695
|
+
const text = e.detail?.text;
|
|
5696
|
+
if (text) handleSend(text);
|
|
5697
|
+
};
|
|
5549
5698
|
const handleSetSuggestions = (e) => {
|
|
5550
5699
|
const actions = e.detail;
|
|
5551
5700
|
if (Array.isArray(actions)) {
|
|
@@ -5555,6 +5704,7 @@ function CrowCopilot({
|
|
|
5555
5704
|
};
|
|
5556
5705
|
window.addEventListener("crow:open", handleOpen);
|
|
5557
5706
|
window.addEventListener("crow:close", handleClose);
|
|
5707
|
+
window.addEventListener("crow:sendMessage", handleSendMessage);
|
|
5558
5708
|
window.addEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
5559
5709
|
const pending = window.__crow_suggested_actions;
|
|
5560
5710
|
if (Array.isArray(pending) && pending.length > 0) {
|
|
@@ -5564,6 +5714,7 @@ function CrowCopilot({
|
|
|
5564
5714
|
return () => {
|
|
5565
5715
|
window.removeEventListener("crow:open", handleOpen);
|
|
5566
5716
|
window.removeEventListener("crow:close", handleClose);
|
|
5717
|
+
window.removeEventListener("crow:sendMessage", handleSendMessage);
|
|
5567
5718
|
window.removeEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
5568
5719
|
};
|
|
5569
5720
|
}, []);
|
|
@@ -6095,7 +6246,20 @@ function CrowCopilot({
|
|
|
6095
6246
|
lineHeight: styles.typography.lineHeight,
|
|
6096
6247
|
letterSpacing: styles.typography.letterSpacing,
|
|
6097
6248
|
background: styles.colors.background,
|
|
6098
|
-
borderColor: styles.colors.border
|
|
6249
|
+
borderColor: styles.colors.border,
|
|
6250
|
+
// CSS variables for dark mode / theme propagation
|
|
6251
|
+
"--crow-primary": styles.colors.primary,
|
|
6252
|
+
"--crow-bg": styles.colors.background,
|
|
6253
|
+
"--crow-text": styles.colors.text,
|
|
6254
|
+
"--crow-border": styles.colors.border,
|
|
6255
|
+
"--crow-bot-bubble": styles.colors.botBubble,
|
|
6256
|
+
"--crow-bot-text": styles.colors.botText,
|
|
6257
|
+
"--crow-user-bubble": styles.colors.userBubble,
|
|
6258
|
+
"--crow-user-text": styles.colors.userText,
|
|
6259
|
+
"--crow-messages-bg": styles.colors.messagesBackground,
|
|
6260
|
+
"--crow-text-muted": styles.colors.text + "80",
|
|
6261
|
+
"--crow-bg-hover": styles.colors.text + "10",
|
|
6262
|
+
"--crow-bg-active": styles.colors.text + "18"
|
|
6099
6263
|
},
|
|
6100
6264
|
children: [
|
|
6101
6265
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6121,8 +6285,10 @@ function CrowCopilot({
|
|
|
6121
6285
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6122
6286
|
"div",
|
|
6123
6287
|
{
|
|
6124
|
-
className:
|
|
6288
|
+
className: "crow-relative crow-flex-shrink-0 crow-flex crow-items-center crow-text-[13px] crow-leading-tight crow-py-2.5 crow-transition-colors crow-select-none crow-cursor-pointer",
|
|
6125
6289
|
style: {
|
|
6290
|
+
color: isActive ? styles.colors.text : styles.colors.text + "80",
|
|
6291
|
+
fontWeight: isActive ? 500 : void 0,
|
|
6126
6292
|
maxWidth: "180px",
|
|
6127
6293
|
borderRight: idx < tabs.length - 1 ? `1px solid ${styles.colors.border}` : "none",
|
|
6128
6294
|
paddingLeft: "16px",
|
|
@@ -6154,7 +6320,7 @@ function CrowCopilot({
|
|
|
6154
6320
|
isCloseable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6155
6321
|
"span",
|
|
6156
6322
|
{
|
|
6157
|
-
className: "crow-rounded crow-p-0.5 crow-flex-shrink-0 crow-inline-flex crow-items-center crow-justify-center crow-transition-opacity
|
|
6323
|
+
className: "crow-rounded crow-p-0.5 crow-flex-shrink-0 crow-inline-flex crow-items-center crow-justify-center crow-transition-opacity",
|
|
6158
6324
|
style: {
|
|
6159
6325
|
marginLeft: "6px",
|
|
6160
6326
|
opacity: isHovered ? 1 : 0,
|
|
@@ -6166,7 +6332,7 @@ function CrowCopilot({
|
|
|
6166
6332
|
},
|
|
6167
6333
|
role: "button",
|
|
6168
6334
|
"aria-label": `Close ${tab.name}`,
|
|
6169
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(TabCloseIcon, { className: "crow-w-3 crow-h-3
|
|
6335
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TabCloseIcon, { className: "crow-w-3 crow-h-3", style: { color: styles.colors.text + "80" } })
|
|
6170
6336
|
}
|
|
6171
6337
|
),
|
|
6172
6338
|
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6196,10 +6362,17 @@ function CrowCopilot({
|
|
|
6196
6362
|
"button",
|
|
6197
6363
|
{
|
|
6198
6364
|
onClick: handleNewChat,
|
|
6199
|
-
className: "crow-p-2
|
|
6365
|
+
className: "crow-p-2 crow-transition-colors crow-rounded",
|
|
6366
|
+
style: { color: styles.colors.text + "80" },
|
|
6367
|
+
onMouseEnter: (e) => {
|
|
6368
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
6369
|
+
},
|
|
6370
|
+
onMouseLeave: (e) => {
|
|
6371
|
+
e.currentTarget.style.background = "transparent";
|
|
6372
|
+
},
|
|
6200
6373
|
"aria-label": "New Chat",
|
|
6201
6374
|
title: "New Chat",
|
|
6202
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(PlusIcon, { className: "crow-w-4 crow-h-4
|
|
6375
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PlusIcon, { className: "crow-w-4 crow-h-4" })
|
|
6203
6376
|
}
|
|
6204
6377
|
),
|
|
6205
6378
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6208,29 +6381,53 @@ function CrowCopilot({
|
|
|
6208
6381
|
onClick: handleToggleHistory,
|
|
6209
6382
|
disabled: !isVerifiedUser,
|
|
6210
6383
|
"aria-disabled": !isVerifiedUser,
|
|
6211
|
-
className: `crow-p-2 crow-transition-colors
|
|
6384
|
+
className: `crow-p-2 crow-transition-colors crow-rounded ${!isVerifiedUser ? "crow-opacity-40 crow-cursor-not-allowed" : ""}`,
|
|
6385
|
+
style: {
|
|
6386
|
+
color: styles.colors.text + "80",
|
|
6387
|
+
background: showConversationList ? styles.colors.text + "10" : "transparent"
|
|
6388
|
+
},
|
|
6389
|
+
onMouseEnter: (e) => {
|
|
6390
|
+
if (isVerifiedUser) e.currentTarget.style.background = styles.colors.text + "10";
|
|
6391
|
+
},
|
|
6392
|
+
onMouseLeave: (e) => {
|
|
6393
|
+
if (!showConversationList) e.currentTarget.style.background = "transparent";
|
|
6394
|
+
},
|
|
6212
6395
|
"aria-label": "Conversation History",
|
|
6213
6396
|
title: isVerifiedUser ? "Conversation History" : "Sign in to view history",
|
|
6214
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(HistoryIcon, { className: "crow-w-4 crow-h-4
|
|
6397
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(HistoryIcon, { className: "crow-w-4 crow-h-4" })
|
|
6215
6398
|
}
|
|
6216
6399
|
),
|
|
6217
6400
|
canScrollRight && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6218
6401
|
"button",
|
|
6219
6402
|
{
|
|
6220
6403
|
onClick: handleScrollRight,
|
|
6221
|
-
className: "crow-p-2
|
|
6404
|
+
className: "crow-p-2 crow-transition-colors crow-rounded",
|
|
6405
|
+
style: { color: styles.colors.text + "80" },
|
|
6406
|
+
onMouseEnter: (e) => {
|
|
6407
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
6408
|
+
},
|
|
6409
|
+
onMouseLeave: (e) => {
|
|
6410
|
+
e.currentTarget.style.background = "transparent";
|
|
6411
|
+
},
|
|
6222
6412
|
"aria-label": "Scroll tabs",
|
|
6223
6413
|
title: "Scroll tabs",
|
|
6224
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "crow-w-4 crow-h-4
|
|
6414
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "crow-w-4 crow-h-4" })
|
|
6225
6415
|
}
|
|
6226
6416
|
),
|
|
6227
6417
|
(forceShowClose ?? showClose) && (overrideOnClose ?? onClose) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6228
6418
|
"button",
|
|
6229
6419
|
{
|
|
6230
6420
|
onClick: overrideOnClose ?? onClose,
|
|
6231
|
-
className: "crow-p-2
|
|
6421
|
+
className: "crow-p-2 crow-transition-colors crow-rounded",
|
|
6422
|
+
style: { color: styles.colors.text + "80" },
|
|
6423
|
+
onMouseEnter: (e) => {
|
|
6424
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
6425
|
+
},
|
|
6426
|
+
onMouseLeave: (e) => {
|
|
6427
|
+
e.currentTarget.style.background = "transparent";
|
|
6428
|
+
},
|
|
6232
6429
|
"aria-label": "Close",
|
|
6233
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { className: "crow-w-4 crow-h-4
|
|
6430
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { className: "crow-w-4 crow-h-4" })
|
|
6234
6431
|
}
|
|
6235
6432
|
)
|
|
6236
6433
|
]
|
|
@@ -6244,7 +6441,7 @@ function CrowCopilot({
|
|
|
6244
6441
|
{
|
|
6245
6442
|
className: "crow-flex crow-items-center crow-gap-1.5 crow-px-3 crow-py-1.5 crow-border-b crow-text-xs",
|
|
6246
6443
|
style: {
|
|
6247
|
-
color: "
|
|
6444
|
+
color: styles.colors.text + "80",
|
|
6248
6445
|
borderColor: styles.colors.border
|
|
6249
6446
|
},
|
|
6250
6447
|
children: [
|
|
@@ -6281,7 +6478,14 @@ function CrowCopilot({
|
|
|
6281
6478
|
onClose: handleCloseConversationList
|
|
6282
6479
|
}
|
|
6283
6480
|
),
|
|
6284
|
-
showConversationList && !isVerifiedUser && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6481
|
+
showConversationList && !isVerifiedUser && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6482
|
+
"div",
|
|
6483
|
+
{
|
|
6484
|
+
className: "crow-mb-3 crow-rounded-xl crow-border crow-p-4",
|
|
6485
|
+
style: { background: styles.colors.text + "08", borderColor: styles.colors.border },
|
|
6486
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "crow-text-sm", style: { color: styles.colors.text + "99" }, children: "Sign in to view conversation history." })
|
|
6487
|
+
}
|
|
6488
|
+
)
|
|
6285
6489
|
] }),
|
|
6286
6490
|
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: activeWorkflow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6287
6491
|
WorkflowPanel,
|
|
@@ -6334,7 +6538,7 @@ function CrowCopilot({
|
|
|
6334
6538
|
className: "crow-p-3 crow-border-t",
|
|
6335
6539
|
style: { borderColor: styles.colors.border },
|
|
6336
6540
|
children: [
|
|
6337
|
-
toolStatus && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "crow-mb-1 crow-flex crow-items-center crow-gap-2 crow-rounded-lg crow-border crow-
|
|
6541
|
+
toolStatus && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "crow-mb-1 crow-flex crow-items-center crow-gap-2 crow-rounded-lg crow-border crow-px-3 crow-py-2 crow-text-sm", style: { borderColor: styles.colors.border, background: styles.colors.border + "30" }, children: [
|
|
6338
6542
|
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "crow-animate-spin crow-h-4 crow-w-4 crow-shrink-0 crow-text-[var(--crow-primary,#7c3aed)]", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
6339
6543
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { className: "crow-opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
6340
6544
|
/* @__PURE__ */ jsxRuntime.jsx("path", { className: "crow-opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
@@ -6383,7 +6587,8 @@ function CrowCopilot({
|
|
|
6383
6587
|
}
|
|
6384
6588
|
const isRight = position === "right";
|
|
6385
6589
|
const edgeSide = isRight ? "left" : "right";
|
|
6386
|
-
const
|
|
6590
|
+
const toggleIconColor = styles.colors.text + "80";
|
|
6591
|
+
const toggleIcon = isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: toggleIconColor, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }) }) : /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: toggleIconColor, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: isRight ? /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" }) : /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" }) });
|
|
6387
6592
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", flexShrink: 0, height: "100%" }, children: [
|
|
6388
6593
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6389
6594
|
"button",
|
|
@@ -6402,8 +6607,8 @@ function CrowCopilot({
|
|
|
6402
6607
|
display: "flex",
|
|
6403
6608
|
alignItems: "center",
|
|
6404
6609
|
justifyContent: "center",
|
|
6405
|
-
background:
|
|
6406
|
-
border:
|
|
6610
|
+
background: styles.colors.background,
|
|
6611
|
+
border: `1px solid ${styles.colors.border}`,
|
|
6407
6612
|
[isRight ? "borderRight" : "borderLeft"]: "none",
|
|
6408
6613
|
borderRadius: isRight ? "8px 0 0 8px" : "0 8px 8px 0",
|
|
6409
6614
|
cursor: isCollapsed ? "pointer" : "col-resize",
|
|
@@ -6473,7 +6678,7 @@ function HistoryIcon({ className }) {
|
|
|
6473
6678
|
}
|
|
6474
6679
|
);
|
|
6475
6680
|
}
|
|
6476
|
-
function TabCloseIcon({ className }) {
|
|
6681
|
+
function TabCloseIcon({ className, style }) {
|
|
6477
6682
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6478
6683
|
"svg",
|
|
6479
6684
|
{
|
|
@@ -6487,6 +6692,7 @@ function TabCloseIcon({ className }) {
|
|
|
6487
6692
|
strokeLinecap: "round",
|
|
6488
6693
|
strokeLinejoin: "round",
|
|
6489
6694
|
className,
|
|
6695
|
+
style,
|
|
6490
6696
|
children: [
|
|
6491
6697
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
|
|
6492
6698
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|