@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.js
CHANGED
|
@@ -1248,6 +1248,20 @@ function useCrowAPI({ onIdentified, onReset } = {}) {
|
|
|
1248
1248
|
case "close":
|
|
1249
1249
|
window.dispatchEvent(new CustomEvent("crow:close"));
|
|
1250
1250
|
break;
|
|
1251
|
+
case "sendMessage": {
|
|
1252
|
+
const msgText = typeof options === "string" ? options : opts?.text ?? opts?.message;
|
|
1253
|
+
if (!msgText) {
|
|
1254
|
+
console.error("[Crow] sendMessage() requires a text string or { text }");
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
window.dispatchEvent(new CustomEvent("crow:open"));
|
|
1258
|
+
setTimeout(() => {
|
|
1259
|
+
window.dispatchEvent(
|
|
1260
|
+
new CustomEvent("crow:sendMessage", { detail: { text: msgText } })
|
|
1261
|
+
);
|
|
1262
|
+
}, 50);
|
|
1263
|
+
break;
|
|
1264
|
+
}
|
|
1251
1265
|
case "setToolStatus":
|
|
1252
1266
|
if (typeof options !== "string") {
|
|
1253
1267
|
console.error("[Crow] setToolStatus() requires a string");
|
|
@@ -2358,6 +2372,13 @@ function useCopilotStyles2() {
|
|
|
2358
2372
|
const context = useContext(CopilotStyleContext);
|
|
2359
2373
|
return context?.styles ?? DEFAULT_COPILOT_STYLES;
|
|
2360
2374
|
}
|
|
2375
|
+
function useActiveStyles() {
|
|
2376
|
+
const copilotContext = useContext(CopilotStyleContext);
|
|
2377
|
+
const widgetContext = useContext(WidgetStyleContext);
|
|
2378
|
+
if (copilotContext) return copilotContext.styles;
|
|
2379
|
+
if (widgetContext) return widgetContext.styles;
|
|
2380
|
+
return DEFAULT_COPILOT_STYLES;
|
|
2381
|
+
}
|
|
2361
2382
|
var PASSTHROUGH_KEYS = /* @__PURE__ */ new Set(["Escape", "Tab"]);
|
|
2362
2383
|
function ShadowContainer({
|
|
2363
2384
|
children,
|
|
@@ -2895,6 +2916,7 @@ function ReasoningTrace({
|
|
|
2895
2916
|
] }) });
|
|
2896
2917
|
}
|
|
2897
2918
|
function WaitingIndicator() {
|
|
2919
|
+
const mutedColor = useActiveStyles().colors.text + "80";
|
|
2898
2920
|
const [messageIndex, setMessageIndex] = useState(
|
|
2899
2921
|
() => Math.floor(Math.random() * THINKING_MESSAGES.length)
|
|
2900
2922
|
);
|
|
@@ -2905,7 +2927,7 @@ function WaitingIndicator() {
|
|
|
2905
2927
|
return () => clearInterval(interval);
|
|
2906
2928
|
}, []);
|
|
2907
2929
|
const message = THINKING_MESSAGES[messageIndex] + "...";
|
|
2908
|
-
return /* @__PURE__ */ jsxs("div", { className: "crow-flex crow-items-center crow-gap-1.5 crow-text-xs
|
|
2930
|
+
return /* @__PURE__ */ jsxs("div", { className: "crow-flex crow-items-center crow-gap-1.5 crow-text-xs", style: { color: mutedColor }, children: [
|
|
2909
2931
|
/* @__PURE__ */ jsx("div", { className: "crow-flex crow-items-center crow-justify-center crow-w-4 crow-h-4", children: /* @__PURE__ */ jsx(ShimmeringContent, { children: /* @__PURE__ */ jsx(Brain, { className: "crow-w-3.5 crow-h-3.5" }) }) }),
|
|
2910
2932
|
/* @__PURE__ */ jsx("span", { className: "crow-font-medium", children: /* @__PURE__ */ jsx(ShimmeringContent, { children: message }) })
|
|
2911
2933
|
] });
|
|
@@ -2914,6 +2936,8 @@ function ThinkingBlock({
|
|
|
2914
2936
|
thinking,
|
|
2915
2937
|
isComplete
|
|
2916
2938
|
}) {
|
|
2939
|
+
const themeColors = useActiveStyles().colors;
|
|
2940
|
+
const mutedColor = themeColors.text + "80";
|
|
2917
2941
|
const [isExpanded, setIsExpanded] = useState(!isComplete);
|
|
2918
2942
|
const [messageIndex, setMessageIndex] = useState(
|
|
2919
2943
|
() => Math.floor(Math.random() * THINKING_MESSAGES.length)
|
|
@@ -2935,7 +2959,8 @@ function ThinkingBlock({
|
|
|
2935
2959
|
"button",
|
|
2936
2960
|
{
|
|
2937
2961
|
onClick: () => setIsExpanded(!isExpanded),
|
|
2938
|
-
className:
|
|
2962
|
+
className: "crow-flex crow-items-center crow-gap-1.5 crow-select-none crow-transition-colors crow-cursor-pointer",
|
|
2963
|
+
style: { color: mutedColor },
|
|
2939
2964
|
children: [
|
|
2940
2965
|
/* @__PURE__ */ jsx("div", { className: "crow-flex crow-items-center crow-justify-center crow-w-4 crow-h-4", children: isInProgress ? /* @__PURE__ */ jsx(ShimmeringContent, { children: /* @__PURE__ */ jsx(Brain, { className: "crow-w-3.5 crow-h-3.5" }) }) : /* @__PURE__ */ jsx(Brain, { className: "crow-w-3.5 crow-h-3.5" }) }),
|
|
2941
2966
|
/* @__PURE__ */ jsx("span", { className: "crow-font-medium", children: isInProgress ? /* @__PURE__ */ jsx(ShimmeringContent, { children: message }) : "Thought" }),
|
|
@@ -2960,10 +2985,11 @@ function ThinkingBlock({
|
|
|
2960
2985
|
exit: { height: 0, opacity: 0 },
|
|
2961
2986
|
transition: { duration: 0.15 },
|
|
2962
2987
|
className: "crow-overflow-hidden",
|
|
2963
|
-
children: /* @__PURE__ */ jsx("div", { className: "crow-border-l-2 crow-
|
|
2988
|
+
children: /* @__PURE__ */ jsx("div", { className: "crow-border-l-2 crow-pl-3 crow-ml-2", style: { borderColor: themeColors.border }, children: /* @__PURE__ */ jsx(
|
|
2964
2989
|
"div",
|
|
2965
2990
|
{
|
|
2966
|
-
className:
|
|
2991
|
+
className: "crow-text-xs crow-leading-relaxed crow-whitespace-pre-wrap",
|
|
2992
|
+
style: { color: mutedColor },
|
|
2967
2993
|
children: thinking
|
|
2968
2994
|
}
|
|
2969
2995
|
) })
|
|
@@ -2993,6 +3019,8 @@ function ToolCallBlock({
|
|
|
2993
3019
|
toolRenderers,
|
|
2994
3020
|
onToolConsent
|
|
2995
3021
|
}) {
|
|
3022
|
+
const themeColors = useActiveStyles().colors;
|
|
3023
|
+
const mutedColor = themeColors.text + "80";
|
|
2996
3024
|
const [expanded, setExpanded] = useState(false);
|
|
2997
3025
|
const hasArgs = Object.keys(toolCall.arguments || {}).length > 0;
|
|
2998
3026
|
const isExecuting = toolCall.status === "executing";
|
|
@@ -3006,13 +3034,15 @@ function ToolCallBlock({
|
|
|
3006
3034
|
/* @__PURE__ */ jsxs(
|
|
3007
3035
|
"div",
|
|
3008
3036
|
{
|
|
3009
|
-
className:
|
|
3037
|
+
className: "crow-flex crow-items-center crow-gap-1.5 crow-select-none crow-transition-colors",
|
|
3038
|
+
style: { color: mutedColor },
|
|
3010
3039
|
children: [
|
|
3011
3040
|
hasArgs && !isAwaitingConsent && /* @__PURE__ */ jsx(
|
|
3012
3041
|
"button",
|
|
3013
3042
|
{
|
|
3014
3043
|
onClick: () => setExpanded(!expanded),
|
|
3015
|
-
className: "crow-cursor-pointer
|
|
3044
|
+
className: "crow-cursor-pointer",
|
|
3045
|
+
style: { color: mutedColor },
|
|
3016
3046
|
children: /* @__PURE__ */ jsx(
|
|
3017
3047
|
motion.div,
|
|
3018
3048
|
{
|
|
@@ -3027,7 +3057,7 @@ function ToolCallBlock({
|
|
|
3027
3057
|
isExecuting && /* @__PURE__ */ jsx(Loader2, { className: "crow-w-3 crow-h-3 crow-animate-spin crow-text-blue-500" }),
|
|
3028
3058
|
isComplete && /* @__PURE__ */ jsx(Check, { className: "crow-w-3 crow-h-3 crow-text-green-500" }),
|
|
3029
3059
|
isError && /* @__PURE__ */ jsx("span", { className: "crow-w-3 crow-h-3 crow-text-red-500", children: "\u2715" }),
|
|
3030
|
-
isDenied && /* @__PURE__ */ jsx("span", { className: "crow-w-3 crow-h-3
|
|
3060
|
+
isDenied && /* @__PURE__ */ jsx("span", { className: "crow-w-3 crow-h-3", style: { color: mutedColor }, children: "\u2715" }),
|
|
3031
3061
|
/* @__PURE__ */ jsx("span", { className: "crow-font-medium", children: toolCall.displayName || toolCall.name }),
|
|
3032
3062
|
isAwaitingConsent && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3033
3063
|
/* @__PURE__ */ jsx("span", { className: "crow-text-amber-500", children: "needs permission" }),
|
|
@@ -3044,16 +3074,16 @@ function ToolCallBlock({
|
|
|
3044
3074
|
"button",
|
|
3045
3075
|
{
|
|
3046
3076
|
onClick: () => onToolConsent?.(toolCall.id, false),
|
|
3047
|
-
className: "crow-px-2 crow-py-0.5 crow-rounded crow-border crow-text-xs crow-font-medium crow-
|
|
3048
|
-
style: { borderColor:
|
|
3077
|
+
className: "crow-px-2 crow-py-0.5 crow-rounded crow-border crow-text-xs crow-font-medium crow-cursor-pointer",
|
|
3078
|
+
style: { borderColor: themeColors.border, backgroundColor: "transparent", color: mutedColor },
|
|
3049
3079
|
children: "Deny"
|
|
3050
3080
|
}
|
|
3051
3081
|
)
|
|
3052
3082
|
] }),
|
|
3053
|
-
isExecuting && /* @__PURE__ */ jsx("span", {
|
|
3054
|
-
isComplete && /* @__PURE__ */ jsx("span", {
|
|
3055
|
-
isError && /* @__PURE__ */ jsx("span", {
|
|
3056
|
-
isDenied && /* @__PURE__ */ jsx("span", {
|
|
3083
|
+
isExecuting && /* @__PURE__ */ jsx("span", { style: { color: mutedColor }, children: "running..." }),
|
|
3084
|
+
isComplete && /* @__PURE__ */ jsx("span", { style: { color: mutedColor }, children: "done" }),
|
|
3085
|
+
isError && /* @__PURE__ */ jsx("span", { style: { color: mutedColor }, children: "failed" }),
|
|
3086
|
+
isDenied && /* @__PURE__ */ jsx("span", { style: { color: mutedColor }, children: "denied" })
|
|
3057
3087
|
]
|
|
3058
3088
|
}
|
|
3059
3089
|
),
|
|
@@ -3154,7 +3184,7 @@ function MessageBubble({
|
|
|
3154
3184
|
toolRenderers,
|
|
3155
3185
|
onToolConsent
|
|
3156
3186
|
}) {
|
|
3157
|
-
const styles =
|
|
3187
|
+
const styles = useActiveStyles();
|
|
3158
3188
|
const showThinkingSetting = useShowThinking();
|
|
3159
3189
|
const isWaiting = message.content === "Thinking..." || message.isBot && isLoading && !message.content;
|
|
3160
3190
|
const hasThinking = message.isBot && message.thinking;
|
|
@@ -3273,7 +3303,7 @@ function MessageList({
|
|
|
3273
3303
|
}) });
|
|
3274
3304
|
}
|
|
3275
3305
|
var MessagesContainer = forwardRef(({ children }, ref) => {
|
|
3276
|
-
const styles =
|
|
3306
|
+
const styles = useActiveStyles();
|
|
3277
3307
|
const internalRef = useRef(null);
|
|
3278
3308
|
const lastScrollHeightRef = useRef(0);
|
|
3279
3309
|
const isUserScrollingRef = useRef(false);
|
|
@@ -3335,26 +3365,92 @@ function ConversationList({
|
|
|
3335
3365
|
onSelect,
|
|
3336
3366
|
onClose
|
|
3337
3367
|
}) {
|
|
3368
|
+
const styles = useActiveStyles();
|
|
3338
3369
|
return /* @__PURE__ */ jsxs(
|
|
3339
3370
|
motion.div,
|
|
3340
3371
|
{
|
|
3341
3372
|
initial: { opacity: 0, height: 0 },
|
|
3342
3373
|
animate: { opacity: 1, height: "auto" },
|
|
3343
3374
|
exit: { opacity: 0, height: 0 },
|
|
3344
|
-
className: "crow-mb-3 crow-rounded-xl crow-
|
|
3375
|
+
className: "crow-mb-3 crow-rounded-xl crow-border",
|
|
3376
|
+
style: {
|
|
3377
|
+
background: styles.colors.text + "08",
|
|
3378
|
+
borderColor: styles.colors.border
|
|
3379
|
+
},
|
|
3345
3380
|
children: [
|
|
3346
|
-
/* @__PURE__ */ jsxs(
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3381
|
+
/* @__PURE__ */ jsxs(
|
|
3382
|
+
"div",
|
|
3383
|
+
{
|
|
3384
|
+
className: "crow-p-2 crow-border-b crow-flex crow-justify-between crow-items-center",
|
|
3385
|
+
style: { borderColor: styles.colors.border },
|
|
3386
|
+
children: [
|
|
3387
|
+
/* @__PURE__ */ jsx(
|
|
3388
|
+
"span",
|
|
3389
|
+
{
|
|
3390
|
+
className: "crow-text-sm crow-font-medium",
|
|
3391
|
+
style: { color: styles.colors.text + "cc" },
|
|
3392
|
+
children: "Recent Conversations"
|
|
3393
|
+
}
|
|
3394
|
+
),
|
|
3395
|
+
/* @__PURE__ */ jsx(
|
|
3396
|
+
"button",
|
|
3397
|
+
{
|
|
3398
|
+
onClick: onClose,
|
|
3399
|
+
className: "crow-p-1 crow-rounded",
|
|
3400
|
+
style: { color: styles.colors.text + "80" },
|
|
3401
|
+
onMouseEnter: (e) => {
|
|
3402
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
3403
|
+
},
|
|
3404
|
+
onMouseLeave: (e) => {
|
|
3405
|
+
e.currentTarget.style.background = "transparent";
|
|
3406
|
+
},
|
|
3407
|
+
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
3408
|
+
}
|
|
3409
|
+
)
|
|
3410
|
+
]
|
|
3411
|
+
}
|
|
3412
|
+
),
|
|
3413
|
+
/* @__PURE__ */ jsx("div", { className: "crow-max-h-[200px] crow-overflow-y-auto", children: conversations.length === 0 ? /* @__PURE__ */ jsx(
|
|
3414
|
+
"div",
|
|
3415
|
+
{
|
|
3416
|
+
className: "crow-p-4 crow-text-center crow-text-sm",
|
|
3417
|
+
style: { color: styles.colors.text + "80" },
|
|
3418
|
+
children: "No conversations yet"
|
|
3419
|
+
}
|
|
3420
|
+
) : conversations.map((conv) => /* @__PURE__ */ jsxs(
|
|
3351
3421
|
"button",
|
|
3352
3422
|
{
|
|
3353
3423
|
onClick: () => onSelect(conv.id),
|
|
3354
|
-
className:
|
|
3424
|
+
className: "crow-w-full crow-p-3 crow-text-left crow-transition-colors crow-border-b last:crow-border-0",
|
|
3425
|
+
style: {
|
|
3426
|
+
borderColor: styles.colors.border,
|
|
3427
|
+
background: currentConversationId === conv.id ? styles.colors.primary + "18" : "transparent"
|
|
3428
|
+
},
|
|
3429
|
+
onMouseEnter: (e) => {
|
|
3430
|
+
if (currentConversationId !== conv.id) {
|
|
3431
|
+
e.currentTarget.style.background = styles.colors.text + "08";
|
|
3432
|
+
}
|
|
3433
|
+
},
|
|
3434
|
+
onMouseLeave: (e) => {
|
|
3435
|
+
e.currentTarget.style.background = currentConversationId === conv.id ? styles.colors.primary + "18" : "transparent";
|
|
3436
|
+
},
|
|
3355
3437
|
children: [
|
|
3356
|
-
/* @__PURE__ */ jsx(
|
|
3357
|
-
|
|
3438
|
+
/* @__PURE__ */ jsx(
|
|
3439
|
+
"div",
|
|
3440
|
+
{
|
|
3441
|
+
className: "crow-text-sm crow-font-medium crow-truncate",
|
|
3442
|
+
style: { color: styles.colors.text },
|
|
3443
|
+
children: conv.name || "Untitled conversation"
|
|
3444
|
+
}
|
|
3445
|
+
),
|
|
3446
|
+
/* @__PURE__ */ jsx(
|
|
3447
|
+
"div",
|
|
3448
|
+
{
|
|
3449
|
+
className: "crow-text-xs crow-mt-0.5",
|
|
3450
|
+
style: { color: styles.colors.text + "80" },
|
|
3451
|
+
children: formatConversationDate(conv.updated_at)
|
|
3452
|
+
}
|
|
3453
|
+
)
|
|
3358
3454
|
]
|
|
3359
3455
|
},
|
|
3360
3456
|
conv.id
|
|
@@ -3371,14 +3467,26 @@ function WorkflowPanel({ workflow, onExit }) {
|
|
|
3371
3467
|
animate: { opacity: 1, y: 0 },
|
|
3372
3468
|
exit: { opacity: 0, y: -10 },
|
|
3373
3469
|
transition: { duration: 0.3 },
|
|
3374
|
-
className: "crow-mb-3 crow-p-3 crow-rounded-xl crow-
|
|
3470
|
+
className: "crow-mb-3 crow-p-3 crow-rounded-xl crow-border",
|
|
3471
|
+
style: {
|
|
3472
|
+
background: "var(--crow-bg-hover, rgba(0,0,0,0.04))",
|
|
3473
|
+
borderColor: "var(--crow-border, #e5e7eb)"
|
|
3474
|
+
},
|
|
3375
3475
|
children: /* @__PURE__ */ jsxs("div", { className: "crow-flex crow-items-center crow-justify-between", children: [
|
|
3376
|
-
/* @__PURE__ */ jsx(
|
|
3476
|
+
/* @__PURE__ */ jsx(
|
|
3477
|
+
"span",
|
|
3478
|
+
{
|
|
3479
|
+
className: "crow-text-sm crow-font-medium crow-flex crow-items-center crow-gap-1",
|
|
3480
|
+
style: { color: "var(--crow-text, #111827)" },
|
|
3481
|
+
children: workflow.name
|
|
3482
|
+
}
|
|
3483
|
+
),
|
|
3377
3484
|
/* @__PURE__ */ jsx(
|
|
3378
3485
|
"button",
|
|
3379
3486
|
{
|
|
3380
3487
|
onClick: onExit,
|
|
3381
|
-
className: "crow-text-xs crow-
|
|
3488
|
+
className: "crow-text-xs crow-underline",
|
|
3489
|
+
style: { color: "var(--crow-text-muted, #6b7280)" },
|
|
3382
3490
|
children: "Exit"
|
|
3383
3491
|
}
|
|
3384
3492
|
)
|
|
@@ -3387,12 +3495,14 @@ function WorkflowPanel({ workflow, onExit }) {
|
|
|
3387
3495
|
);
|
|
3388
3496
|
}
|
|
3389
3497
|
function PoweredByBadge({ apiUrl = "" }) {
|
|
3390
|
-
const styles =
|
|
3498
|
+
const styles = useActiveStyles();
|
|
3391
3499
|
const branding = styles.branding;
|
|
3392
3500
|
if (!branding.showPoweredBy) return null;
|
|
3393
|
-
const
|
|
3394
|
-
|
|
3395
|
-
|
|
3501
|
+
const showLogo = "showLogo" in branding ? branding.showLogo : false;
|
|
3502
|
+
const rawLogoUrl = "logoUrl" in branding ? branding.logoUrl : void 0;
|
|
3503
|
+
const logoUrl = rawLogoUrl?.startsWith("http") ? rawLogoUrl : rawLogoUrl ? `${apiUrl}${rawLogoUrl}` : void 0;
|
|
3504
|
+
return /* @__PURE__ */ 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: [
|
|
3505
|
+
showLogo && logoUrl && /* @__PURE__ */ jsx(
|
|
3396
3506
|
"img",
|
|
3397
3507
|
{
|
|
3398
3508
|
src: logoUrl,
|
|
@@ -3439,10 +3549,10 @@ var ModelSelector = ({
|
|
|
3439
3549
|
disabled,
|
|
3440
3550
|
className: cn(
|
|
3441
3551
|
"crow-flex crow-items-center crow-gap-1 crow-px-2 crow-py-1 crow-rounded-md crow-text-xs",
|
|
3442
|
-
"crow-bg-transparent crow-
|
|
3443
|
-
"hover:crow-text-gray-700 crow-transition-colors",
|
|
3552
|
+
"crow-bg-transparent crow-transition-colors",
|
|
3444
3553
|
disabled ? "crow-opacity-50 crow-cursor-not-allowed" : "crow-cursor-pointer"
|
|
3445
3554
|
),
|
|
3555
|
+
style: { color: "var(--crow-text-muted, #9ca3af)" },
|
|
3446
3556
|
children: [
|
|
3447
3557
|
/* @__PURE__ */ jsx("span", { children: selectedModelData?.name || "Select Model" }),
|
|
3448
3558
|
/* @__PURE__ */ jsx(
|
|
@@ -3457,28 +3567,48 @@ var ModelSelector = ({
|
|
|
3457
3567
|
]
|
|
3458
3568
|
}
|
|
3459
3569
|
),
|
|
3460
|
-
isOpen && /* @__PURE__ */ jsx(
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
"
|
|
3464
|
-
{
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3570
|
+
isOpen && /* @__PURE__ */ jsx(
|
|
3571
|
+
"div",
|
|
3572
|
+
{
|
|
3573
|
+
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",
|
|
3574
|
+
style: { background: "var(--crow-bg, #ffffff)", borderColor: "var(--crow-border, #e5e7eb)" },
|
|
3575
|
+
children: Object.entries(groupedModels).map(([provider, providerModels]) => /* @__PURE__ */ jsxs("div", { children: [
|
|
3576
|
+
/* @__PURE__ */ jsx(
|
|
3577
|
+
"div",
|
|
3578
|
+
{
|
|
3579
|
+
className: "crow-px-3 crow-py-1.5 crow-text-xs crow-font-medium crow-uppercase crow-tracking-wide",
|
|
3580
|
+
style: {
|
|
3581
|
+
color: "var(--crow-text-muted, #9ca3af)",
|
|
3582
|
+
background: "var(--crow-bg-hover, rgba(0,0,0,0.04))"
|
|
3583
|
+
},
|
|
3584
|
+
children: provider
|
|
3585
|
+
}
|
|
3473
3586
|
),
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3587
|
+
providerModels.map((model) => /* @__PURE__ */ jsxs(
|
|
3588
|
+
"button",
|
|
3589
|
+
{
|
|
3590
|
+
onClick: () => {
|
|
3591
|
+
onModelChange(model.id);
|
|
3592
|
+
setIsOpen(false);
|
|
3593
|
+
},
|
|
3594
|
+
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",
|
|
3595
|
+
style: { color: model.id === selectedModel ? "var(--crow-text, #111827)" : "var(--crow-text-muted, #4b5563)" },
|
|
3596
|
+
onMouseEnter: (e) => {
|
|
3597
|
+
e.currentTarget.style.background = "var(--crow-bg-hover, rgba(0,0,0,0.04))";
|
|
3598
|
+
},
|
|
3599
|
+
onMouseLeave: (e) => {
|
|
3600
|
+
e.currentTarget.style.background = "transparent";
|
|
3601
|
+
},
|
|
3602
|
+
children: [
|
|
3603
|
+
/* @__PURE__ */ jsx("span", { children: model.name }),
|
|
3604
|
+
model.id === selectedModel && /* @__PURE__ */ jsx(Check, { className: "crow-w-4 crow-h-4 crow-text-green-500" })
|
|
3605
|
+
]
|
|
3606
|
+
},
|
|
3607
|
+
model.id
|
|
3608
|
+
))
|
|
3609
|
+
] }, provider))
|
|
3610
|
+
}
|
|
3611
|
+
)
|
|
3482
3612
|
] });
|
|
3483
3613
|
};
|
|
3484
3614
|
var isMediaRecorderSupported = () => {
|
|
@@ -3679,9 +3809,12 @@ var Textarea = React3.forwardRef(
|
|
|
3679
3809
|
"textarea",
|
|
3680
3810
|
{
|
|
3681
3811
|
className: cn(
|
|
3682
|
-
"crow-flex crow-w-full crow-rounded-md crow-border-none crow-bg-transparent crow-px-3 crow-py-1.5 crow-text-base
|
|
3812
|
+
"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",
|
|
3683
3813
|
className
|
|
3684
3814
|
),
|
|
3815
|
+
style: {
|
|
3816
|
+
color: "inherit"
|
|
3817
|
+
},
|
|
3685
3818
|
ref,
|
|
3686
3819
|
rows: 1,
|
|
3687
3820
|
...props
|
|
@@ -3698,9 +3831,10 @@ var TooltipContent = React3.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
3698
3831
|
ref,
|
|
3699
3832
|
sideOffset,
|
|
3700
3833
|
className: cn(
|
|
3701
|
-
"crow-z-50 crow-overflow-hidden crow-rounded-md crow-border crow-
|
|
3834
|
+
"crow-z-50 crow-overflow-hidden crow-rounded-md crow-border crow-px-3 crow-py-1.5 crow-text-sm crow-shadow-md",
|
|
3702
3835
|
className
|
|
3703
3836
|
),
|
|
3837
|
+
style: { background: "var(--crow-bg, #ffffff)", borderColor: "var(--crow-border, #d1d5db)", color: "var(--crow-text, #111827)" },
|
|
3704
3838
|
...props
|
|
3705
3839
|
}
|
|
3706
3840
|
));
|
|
@@ -3708,9 +3842,9 @@ TooltipContent.displayName = "TooltipContent";
|
|
|
3708
3842
|
var Button = React3.forwardRef(
|
|
3709
3843
|
({ className, variant = "default", size = "default", ...props }, ref) => {
|
|
3710
3844
|
const variantClasses = {
|
|
3711
|
-
default: "crow-
|
|
3712
|
-
outline: "crow-border crow-bg-transparent
|
|
3713
|
-
ghost: "crow-bg-transparent
|
|
3845
|
+
default: "crow-text-white",
|
|
3846
|
+
outline: "crow-border crow-bg-transparent",
|
|
3847
|
+
ghost: "crow-bg-transparent"
|
|
3714
3848
|
};
|
|
3715
3849
|
const sizeClasses = {
|
|
3716
3850
|
default: "crow-h-10 crow-px-4 crow-py-2",
|
|
@@ -3783,11 +3917,16 @@ var PromptInput = React3.forwardRef(
|
|
|
3783
3917
|
{
|
|
3784
3918
|
ref,
|
|
3785
3919
|
className: cn(
|
|
3786
|
-
"crow-rounded-3xl crow-border crow-
|
|
3920
|
+
"crow-rounded-3xl crow-border crow-p-1.5 crow-shadow-lg crow-transition-all crow-duration-300",
|
|
3787
3921
|
isLoading && "crow-border-red-500",
|
|
3788
3922
|
className
|
|
3789
3923
|
),
|
|
3790
|
-
style
|
|
3924
|
+
style: {
|
|
3925
|
+
background: "var(--crow-bg, #ffffff)",
|
|
3926
|
+
color: "var(--crow-text, #111827)",
|
|
3927
|
+
borderColor: isLoading ? void 0 : "var(--crow-border, #d1d5db)",
|
|
3928
|
+
...style
|
|
3929
|
+
},
|
|
3791
3930
|
children
|
|
3792
3931
|
}
|
|
3793
3932
|
)
|
|
@@ -3870,6 +4009,7 @@ var PromptInputBox = React3.forwardRef(
|
|
|
3870
4009
|
backendUrl = "",
|
|
3871
4010
|
triggerVoiceRecording = 0
|
|
3872
4011
|
}, ref) => {
|
|
4012
|
+
const themeStyles = useActiveStyles();
|
|
3873
4013
|
const [input, setInput] = React3.useState("");
|
|
3874
4014
|
const promptBoxRef = React3.useRef(null);
|
|
3875
4015
|
const voice = useVoiceInput({ backendUrl, silenceTimeoutMs: 1500 });
|
|
@@ -3923,10 +4063,15 @@ var PromptInputBox = React3.forwardRef(
|
|
|
3923
4063
|
highlighted && "crow-ring-4 crow-ring-offset-2 crow-animate-pulse crow-shadow-[0_0_20px_rgba(0,0,0,0.25)]",
|
|
3924
4064
|
className
|
|
3925
4065
|
),
|
|
3926
|
-
style:
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
4066
|
+
style: {
|
|
4067
|
+
background: themeStyles.colors.background,
|
|
4068
|
+
color: themeStyles.colors.text,
|
|
4069
|
+
borderColor: themeStyles.colors.border,
|
|
4070
|
+
...highlighted ? {
|
|
4071
|
+
"--tw-ring-color": themeStyles.colors.userBubble,
|
|
4072
|
+
"--tw-ring-offset-color": themeStyles.colors.background
|
|
4073
|
+
} : {}
|
|
4074
|
+
},
|
|
3930
4075
|
disabled: isLoading,
|
|
3931
4076
|
ref: ref || promptBoxRef,
|
|
3932
4077
|
children: [
|
|
@@ -3966,10 +4111,8 @@ var PromptInputBox = React3.forwardRef(
|
|
|
3966
4111
|
/* @__PURE__ */ jsx(
|
|
3967
4112
|
Mic,
|
|
3968
4113
|
{
|
|
3969
|
-
className:
|
|
3970
|
-
|
|
3971
|
-
voice.isRecording ? "crow-text-red-500" : "crow-text-gray-400"
|
|
3972
|
-
)
|
|
4114
|
+
className: "crow-h-3.5 crow-w-3.5 crow-transition-colors",
|
|
4115
|
+
style: { color: voice.isRecording ? "#ef4444" : "var(--crow-text-muted, #9ca3af)" }
|
|
3973
4116
|
}
|
|
3974
4117
|
),
|
|
3975
4118
|
voice.isRecording && /* @__PURE__ */ 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" })
|
|
@@ -3987,12 +4130,10 @@ var PromptInputBox = React3.forwardRef(
|
|
|
3987
4130
|
{
|
|
3988
4131
|
variant: "default",
|
|
3989
4132
|
size: "icon",
|
|
3990
|
-
className:
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
!hasContent && !isLoading && !showStopButton && "crow-bg-transparent"
|
|
3995
|
-
),
|
|
4133
|
+
className: "crow-h-7 crow-w-7 crow-rounded-full crow-transition-all crow-duration-200",
|
|
4134
|
+
style: {
|
|
4135
|
+
background: isLoading || showStopButton ? "#ef4444" : hasContent ? "var(--crow-primary, #000000)" : "transparent"
|
|
4136
|
+
},
|
|
3996
4137
|
onClick: () => {
|
|
3997
4138
|
if ((isLoading || showStopButton) && onStop) {
|
|
3998
4139
|
onStop();
|
|
@@ -4009,10 +4150,8 @@ var PromptInputBox = React3.forwardRef(
|
|
|
4009
4150
|
) : /* @__PURE__ */ jsx(
|
|
4010
4151
|
ArrowUp,
|
|
4011
4152
|
{
|
|
4012
|
-
className:
|
|
4013
|
-
|
|
4014
|
-
hasContent ? "crow-text-white" : "crow-text-gray-400"
|
|
4015
|
-
)
|
|
4153
|
+
className: "crow-h-3.5 crow-w-3.5",
|
|
4154
|
+
style: { color: hasContent ? "white" : "var(--crow-text-muted, #9ca3af)" }
|
|
4016
4155
|
}
|
|
4017
4156
|
)
|
|
4018
4157
|
}
|
|
@@ -4032,7 +4171,7 @@ function BrowserUseConfirmation({
|
|
|
4032
4171
|
onAllow,
|
|
4033
4172
|
onDeny
|
|
4034
4173
|
}) {
|
|
4035
|
-
const styles =
|
|
4174
|
+
const styles = useActiveStyles();
|
|
4036
4175
|
return /* @__PURE__ */ jsx(
|
|
4037
4176
|
"div",
|
|
4038
4177
|
{
|
|
@@ -4114,7 +4253,7 @@ function BrowserUseQuestion({
|
|
|
4114
4253
|
question,
|
|
4115
4254
|
onSubmit
|
|
4116
4255
|
}) {
|
|
4117
|
-
const styles =
|
|
4256
|
+
const styles = useActiveStyles();
|
|
4118
4257
|
const [answer, setAnswer] = useState("");
|
|
4119
4258
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
4120
4259
|
const handleSubmit = useCallback(() => {
|
|
@@ -4201,15 +4340,15 @@ function SuggestedActions({
|
|
|
4201
4340
|
actions,
|
|
4202
4341
|
onActionClick
|
|
4203
4342
|
}) {
|
|
4204
|
-
const styles =
|
|
4343
|
+
const styles = useActiveStyles();
|
|
4205
4344
|
return /* @__PURE__ */ jsx("div", { className: "crow-flex crow-flex-wrap crow-gap-2 crow-px-1 crow-pb-2", children: actions.map((action, idx) => /* @__PURE__ */ jsx(
|
|
4206
4345
|
"button",
|
|
4207
4346
|
{
|
|
4208
4347
|
onClick: () => onActionClick(action),
|
|
4209
4348
|
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",
|
|
4210
4349
|
style: {
|
|
4211
|
-
borderColor: styles.colors.
|
|
4212
|
-
color: styles.colors.
|
|
4350
|
+
borderColor: styles.colors.border,
|
|
4351
|
+
color: styles.colors.text,
|
|
4213
4352
|
background: "transparent"
|
|
4214
4353
|
},
|
|
4215
4354
|
children: action.label
|
|
@@ -4890,6 +5029,10 @@ function CrowWidget({
|
|
|
4890
5029
|
useEffect(() => {
|
|
4891
5030
|
const handleOpen = () => setIsCollapsed(false);
|
|
4892
5031
|
const handleClose = () => setIsCollapsed(true);
|
|
5032
|
+
const handleSendMessage = (e) => {
|
|
5033
|
+
const text = e.detail?.text;
|
|
5034
|
+
if (text) handleSend(text);
|
|
5035
|
+
};
|
|
4893
5036
|
const handleSetSuggestions = (e) => {
|
|
4894
5037
|
const actions = e.detail;
|
|
4895
5038
|
if (Array.isArray(actions)) {
|
|
@@ -4899,6 +5042,7 @@ function CrowWidget({
|
|
|
4899
5042
|
};
|
|
4900
5043
|
window.addEventListener("crow:open", handleOpen);
|
|
4901
5044
|
window.addEventListener("crow:close", handleClose);
|
|
5045
|
+
window.addEventListener("crow:sendMessage", handleSendMessage);
|
|
4902
5046
|
window.addEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
4903
5047
|
const pending = window.__crow_suggested_actions;
|
|
4904
5048
|
if (Array.isArray(pending) && pending.length > 0) {
|
|
@@ -4908,6 +5052,7 @@ function CrowWidget({
|
|
|
4908
5052
|
return () => {
|
|
4909
5053
|
window.removeEventListener("crow:open", handleOpen);
|
|
4910
5054
|
window.removeEventListener("crow:close", handleClose);
|
|
5055
|
+
window.removeEventListener("crow:sendMessage", handleSendMessage);
|
|
4911
5056
|
window.removeEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
4912
5057
|
};
|
|
4913
5058
|
}, []);
|
|
@@ -5519,6 +5664,10 @@ function CrowCopilot({
|
|
|
5519
5664
|
useEffect(() => {
|
|
5520
5665
|
const handleOpen = () => setIsCollapsed(false);
|
|
5521
5666
|
const handleClose = () => setIsCollapsed(true);
|
|
5667
|
+
const handleSendMessage = (e) => {
|
|
5668
|
+
const text = e.detail?.text;
|
|
5669
|
+
if (text) handleSend(text);
|
|
5670
|
+
};
|
|
5522
5671
|
const handleSetSuggestions = (e) => {
|
|
5523
5672
|
const actions = e.detail;
|
|
5524
5673
|
if (Array.isArray(actions)) {
|
|
@@ -5528,6 +5677,7 @@ function CrowCopilot({
|
|
|
5528
5677
|
};
|
|
5529
5678
|
window.addEventListener("crow:open", handleOpen);
|
|
5530
5679
|
window.addEventListener("crow:close", handleClose);
|
|
5680
|
+
window.addEventListener("crow:sendMessage", handleSendMessage);
|
|
5531
5681
|
window.addEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
5532
5682
|
const pending = window.__crow_suggested_actions;
|
|
5533
5683
|
if (Array.isArray(pending) && pending.length > 0) {
|
|
@@ -5537,6 +5687,7 @@ function CrowCopilot({
|
|
|
5537
5687
|
return () => {
|
|
5538
5688
|
window.removeEventListener("crow:open", handleOpen);
|
|
5539
5689
|
window.removeEventListener("crow:close", handleClose);
|
|
5690
|
+
window.removeEventListener("crow:sendMessage", handleSendMessage);
|
|
5540
5691
|
window.removeEventListener("crow:setSuggestedActions", handleSetSuggestions);
|
|
5541
5692
|
};
|
|
5542
5693
|
}, []);
|
|
@@ -6068,7 +6219,20 @@ function CrowCopilot({
|
|
|
6068
6219
|
lineHeight: styles.typography.lineHeight,
|
|
6069
6220
|
letterSpacing: styles.typography.letterSpacing,
|
|
6070
6221
|
background: styles.colors.background,
|
|
6071
|
-
borderColor: styles.colors.border
|
|
6222
|
+
borderColor: styles.colors.border,
|
|
6223
|
+
// CSS variables for dark mode / theme propagation
|
|
6224
|
+
"--crow-primary": styles.colors.primary,
|
|
6225
|
+
"--crow-bg": styles.colors.background,
|
|
6226
|
+
"--crow-text": styles.colors.text,
|
|
6227
|
+
"--crow-border": styles.colors.border,
|
|
6228
|
+
"--crow-bot-bubble": styles.colors.botBubble,
|
|
6229
|
+
"--crow-bot-text": styles.colors.botText,
|
|
6230
|
+
"--crow-user-bubble": styles.colors.userBubble,
|
|
6231
|
+
"--crow-user-text": styles.colors.userText,
|
|
6232
|
+
"--crow-messages-bg": styles.colors.messagesBackground,
|
|
6233
|
+
"--crow-text-muted": styles.colors.text + "80",
|
|
6234
|
+
"--crow-bg-hover": styles.colors.text + "10",
|
|
6235
|
+
"--crow-bg-active": styles.colors.text + "18"
|
|
6072
6236
|
},
|
|
6073
6237
|
children: [
|
|
6074
6238
|
/* @__PURE__ */ jsxs(
|
|
@@ -6094,8 +6258,10 @@ function CrowCopilot({
|
|
|
6094
6258
|
return /* @__PURE__ */ jsxs(
|
|
6095
6259
|
"div",
|
|
6096
6260
|
{
|
|
6097
|
-
className:
|
|
6261
|
+
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",
|
|
6098
6262
|
style: {
|
|
6263
|
+
color: isActive ? styles.colors.text : styles.colors.text + "80",
|
|
6264
|
+
fontWeight: isActive ? 500 : void 0,
|
|
6099
6265
|
maxWidth: "180px",
|
|
6100
6266
|
borderRight: idx < tabs.length - 1 ? `1px solid ${styles.colors.border}` : "none",
|
|
6101
6267
|
paddingLeft: "16px",
|
|
@@ -6127,7 +6293,7 @@ function CrowCopilot({
|
|
|
6127
6293
|
isCloseable && /* @__PURE__ */ jsx(
|
|
6128
6294
|
"span",
|
|
6129
6295
|
{
|
|
6130
|
-
className: "crow-rounded crow-p-0.5 crow-flex-shrink-0 crow-inline-flex crow-items-center crow-justify-center crow-transition-opacity
|
|
6296
|
+
className: "crow-rounded crow-p-0.5 crow-flex-shrink-0 crow-inline-flex crow-items-center crow-justify-center crow-transition-opacity",
|
|
6131
6297
|
style: {
|
|
6132
6298
|
marginLeft: "6px",
|
|
6133
6299
|
opacity: isHovered ? 1 : 0,
|
|
@@ -6139,7 +6305,7 @@ function CrowCopilot({
|
|
|
6139
6305
|
},
|
|
6140
6306
|
role: "button",
|
|
6141
6307
|
"aria-label": `Close ${tab.name}`,
|
|
6142
|
-
children: /* @__PURE__ */ jsx(TabCloseIcon, { className: "crow-w-3 crow-h-3
|
|
6308
|
+
children: /* @__PURE__ */ jsx(TabCloseIcon, { className: "crow-w-3 crow-h-3", style: { color: styles.colors.text + "80" } })
|
|
6143
6309
|
}
|
|
6144
6310
|
),
|
|
6145
6311
|
isActive && /* @__PURE__ */ jsx(
|
|
@@ -6169,10 +6335,17 @@ function CrowCopilot({
|
|
|
6169
6335
|
"button",
|
|
6170
6336
|
{
|
|
6171
6337
|
onClick: handleNewChat,
|
|
6172
|
-
className: "crow-p-2
|
|
6338
|
+
className: "crow-p-2 crow-transition-colors crow-rounded",
|
|
6339
|
+
style: { color: styles.colors.text + "80" },
|
|
6340
|
+
onMouseEnter: (e) => {
|
|
6341
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
6342
|
+
},
|
|
6343
|
+
onMouseLeave: (e) => {
|
|
6344
|
+
e.currentTarget.style.background = "transparent";
|
|
6345
|
+
},
|
|
6173
6346
|
"aria-label": "New Chat",
|
|
6174
6347
|
title: "New Chat",
|
|
6175
|
-
children: /* @__PURE__ */ jsx(PlusIcon, { className: "crow-w-4 crow-h-4
|
|
6348
|
+
children: /* @__PURE__ */ jsx(PlusIcon, { className: "crow-w-4 crow-h-4" })
|
|
6176
6349
|
}
|
|
6177
6350
|
),
|
|
6178
6351
|
/* @__PURE__ */ jsx(
|
|
@@ -6181,29 +6354,53 @@ function CrowCopilot({
|
|
|
6181
6354
|
onClick: handleToggleHistory,
|
|
6182
6355
|
disabled: !isVerifiedUser,
|
|
6183
6356
|
"aria-disabled": !isVerifiedUser,
|
|
6184
|
-
className: `crow-p-2 crow-transition-colors
|
|
6357
|
+
className: `crow-p-2 crow-transition-colors crow-rounded ${!isVerifiedUser ? "crow-opacity-40 crow-cursor-not-allowed" : ""}`,
|
|
6358
|
+
style: {
|
|
6359
|
+
color: styles.colors.text + "80",
|
|
6360
|
+
background: showConversationList ? styles.colors.text + "10" : "transparent"
|
|
6361
|
+
},
|
|
6362
|
+
onMouseEnter: (e) => {
|
|
6363
|
+
if (isVerifiedUser) e.currentTarget.style.background = styles.colors.text + "10";
|
|
6364
|
+
},
|
|
6365
|
+
onMouseLeave: (e) => {
|
|
6366
|
+
if (!showConversationList) e.currentTarget.style.background = "transparent";
|
|
6367
|
+
},
|
|
6185
6368
|
"aria-label": "Conversation History",
|
|
6186
6369
|
title: isVerifiedUser ? "Conversation History" : "Sign in to view history",
|
|
6187
|
-
children: /* @__PURE__ */ jsx(HistoryIcon, { className: "crow-w-4 crow-h-4
|
|
6370
|
+
children: /* @__PURE__ */ jsx(HistoryIcon, { className: "crow-w-4 crow-h-4" })
|
|
6188
6371
|
}
|
|
6189
6372
|
),
|
|
6190
6373
|
canScrollRight && /* @__PURE__ */ jsx(
|
|
6191
6374
|
"button",
|
|
6192
6375
|
{
|
|
6193
6376
|
onClick: handleScrollRight,
|
|
6194
|
-
className: "crow-p-2
|
|
6377
|
+
className: "crow-p-2 crow-transition-colors crow-rounded",
|
|
6378
|
+
style: { color: styles.colors.text + "80" },
|
|
6379
|
+
onMouseEnter: (e) => {
|
|
6380
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
6381
|
+
},
|
|
6382
|
+
onMouseLeave: (e) => {
|
|
6383
|
+
e.currentTarget.style.background = "transparent";
|
|
6384
|
+
},
|
|
6195
6385
|
"aria-label": "Scroll tabs",
|
|
6196
6386
|
title: "Scroll tabs",
|
|
6197
|
-
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "crow-w-4 crow-h-4
|
|
6387
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "crow-w-4 crow-h-4" })
|
|
6198
6388
|
}
|
|
6199
6389
|
),
|
|
6200
6390
|
(forceShowClose ?? showClose) && (overrideOnClose ?? onClose) && /* @__PURE__ */ jsx(
|
|
6201
6391
|
"button",
|
|
6202
6392
|
{
|
|
6203
6393
|
onClick: overrideOnClose ?? onClose,
|
|
6204
|
-
className: "crow-p-2
|
|
6394
|
+
className: "crow-p-2 crow-transition-colors crow-rounded",
|
|
6395
|
+
style: { color: styles.colors.text + "80" },
|
|
6396
|
+
onMouseEnter: (e) => {
|
|
6397
|
+
e.currentTarget.style.background = styles.colors.text + "10";
|
|
6398
|
+
},
|
|
6399
|
+
onMouseLeave: (e) => {
|
|
6400
|
+
e.currentTarget.style.background = "transparent";
|
|
6401
|
+
},
|
|
6205
6402
|
"aria-label": "Close",
|
|
6206
|
-
children: /* @__PURE__ */ jsx(CloseIcon, { className: "crow-w-4 crow-h-4
|
|
6403
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "crow-w-4 crow-h-4" })
|
|
6207
6404
|
}
|
|
6208
6405
|
)
|
|
6209
6406
|
]
|
|
@@ -6217,7 +6414,7 @@ function CrowCopilot({
|
|
|
6217
6414
|
{
|
|
6218
6415
|
className: "crow-flex crow-items-center crow-gap-1.5 crow-px-3 crow-py-1.5 crow-border-b crow-text-xs",
|
|
6219
6416
|
style: {
|
|
6220
|
-
color: "
|
|
6417
|
+
color: styles.colors.text + "80",
|
|
6221
6418
|
borderColor: styles.colors.border
|
|
6222
6419
|
},
|
|
6223
6420
|
children: [
|
|
@@ -6254,7 +6451,14 @@ function CrowCopilot({
|
|
|
6254
6451
|
onClose: handleCloseConversationList
|
|
6255
6452
|
}
|
|
6256
6453
|
),
|
|
6257
|
-
showConversationList && !isVerifiedUser && /* @__PURE__ */ jsx(
|
|
6454
|
+
showConversationList && !isVerifiedUser && /* @__PURE__ */ jsx(
|
|
6455
|
+
"div",
|
|
6456
|
+
{
|
|
6457
|
+
className: "crow-mb-3 crow-rounded-xl crow-border crow-p-4",
|
|
6458
|
+
style: { background: styles.colors.text + "08", borderColor: styles.colors.border },
|
|
6459
|
+
children: /* @__PURE__ */ jsx("div", { className: "crow-text-sm", style: { color: styles.colors.text + "99" }, children: "Sign in to view conversation history." })
|
|
6460
|
+
}
|
|
6461
|
+
)
|
|
6258
6462
|
] }),
|
|
6259
6463
|
/* @__PURE__ */ jsx(AnimatePresence, { children: activeWorkflow && /* @__PURE__ */ jsx(
|
|
6260
6464
|
WorkflowPanel,
|
|
@@ -6307,7 +6511,7 @@ function CrowCopilot({
|
|
|
6307
6511
|
className: "crow-p-3 crow-border-t",
|
|
6308
6512
|
style: { borderColor: styles.colors.border },
|
|
6309
6513
|
children: [
|
|
6310
|
-
toolStatus && /* @__PURE__ */ jsxs("div", { className: "crow-mb-1 crow-flex crow-items-center crow-gap-2 crow-rounded-lg crow-border crow-
|
|
6514
|
+
toolStatus && /* @__PURE__ */ 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: [
|
|
6311
6515
|
/* @__PURE__ */ 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: [
|
|
6312
6516
|
/* @__PURE__ */ jsx("circle", { className: "crow-opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
6313
6517
|
/* @__PURE__ */ jsx("path", { className: "crow-opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
@@ -6356,7 +6560,8 @@ function CrowCopilot({
|
|
|
6356
6560
|
}
|
|
6357
6561
|
const isRight = position === "right";
|
|
6358
6562
|
const edgeSide = isRight ? "left" : "right";
|
|
6359
|
-
const
|
|
6563
|
+
const toggleIconColor = styles.colors.text + "80";
|
|
6564
|
+
const toggleIcon = isCollapsed ? /* @__PURE__ */ 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__ */ jsx("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }) }) : /* @__PURE__ */ 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__ */ jsx("path", { d: "m9 18 6-6-6-6" }) : /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" }) });
|
|
6360
6565
|
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", flexShrink: 0, height: "100%" }, children: [
|
|
6361
6566
|
/* @__PURE__ */ jsx(
|
|
6362
6567
|
"button",
|
|
@@ -6375,8 +6580,8 @@ function CrowCopilot({
|
|
|
6375
6580
|
display: "flex",
|
|
6376
6581
|
alignItems: "center",
|
|
6377
6582
|
justifyContent: "center",
|
|
6378
|
-
background:
|
|
6379
|
-
border:
|
|
6583
|
+
background: styles.colors.background,
|
|
6584
|
+
border: `1px solid ${styles.colors.border}`,
|
|
6380
6585
|
[isRight ? "borderRight" : "borderLeft"]: "none",
|
|
6381
6586
|
borderRadius: isRight ? "8px 0 0 8px" : "0 8px 8px 0",
|
|
6382
6587
|
cursor: isCollapsed ? "pointer" : "col-resize",
|
|
@@ -6446,7 +6651,7 @@ function HistoryIcon({ className }) {
|
|
|
6446
6651
|
}
|
|
6447
6652
|
);
|
|
6448
6653
|
}
|
|
6449
|
-
function TabCloseIcon({ className }) {
|
|
6654
|
+
function TabCloseIcon({ className, style }) {
|
|
6450
6655
|
return /* @__PURE__ */ jsxs(
|
|
6451
6656
|
"svg",
|
|
6452
6657
|
{
|
|
@@ -6460,6 +6665,7 @@ function TabCloseIcon({ className }) {
|
|
|
6460
6665
|
strokeLinecap: "round",
|
|
6461
6666
|
strokeLinejoin: "round",
|
|
6462
6667
|
className,
|
|
6668
|
+
style,
|
|
6463
6669
|
children: [
|
|
6464
6670
|
/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }),
|
|
6465
6671
|
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|