@rekayasa/erica-bubble 1.0.2 → 1.0.3
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/erica-bubble.css +1 -1
- package/dist/index.cjs +1 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +37 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2342,42 +2342,33 @@ function Ft({ onSend: e, inProgress: t, threadId: n }) {
|
|
|
2342
2342
|
onDrop: E,
|
|
2343
2343
|
children: [
|
|
2344
2344
|
f && /* @__PURE__ */ u("div", {
|
|
2345
|
-
className: "
|
|
2345
|
+
className: "erica-drag-overlay",
|
|
2346
2346
|
children: /* @__PURE__ */ u("p", {
|
|
2347
|
-
className: "
|
|
2347
|
+
className: "erica-drag-overlay-text",
|
|
2348
2348
|
children: "Drop files to attach"
|
|
2349
2349
|
})
|
|
2350
2350
|
}),
|
|
2351
2351
|
a.length > 0 && /* @__PURE__ */ u("div", {
|
|
2352
|
-
className: "
|
|
2352
|
+
className: "erica-file-list",
|
|
2353
2353
|
children: a.map((e) => /* @__PURE__ */ d("div", {
|
|
2354
|
-
className: `
|
|
2355
|
-
px-3 py-2 rounded-lg flex items-center justify-between
|
|
2356
|
-
${e.status === "error" ? "bg-red-50" : e.status === "done" ? "bg-green-50" : "bg-gray-100"}
|
|
2357
|
-
`,
|
|
2354
|
+
className: `erica-file-item ${e.status === "error" ? "erica-file-item--error" : e.status === "done" ? "erica-file-item--done" : "erica-file-item--uploading"}`,
|
|
2358
2355
|
children: [/* @__PURE__ */ d("div", {
|
|
2359
|
-
className: `
|
|
2360
|
-
flex items-center gap-2 flex-1 rounded-lg transition-colors
|
|
2361
|
-
${e.status === "done" ? "cursor-pointer hover:bg-green-100 -mx-3 -my-2 px-3 py-2" : ""}
|
|
2362
|
-
`,
|
|
2356
|
+
className: `erica-file-content ${e.status === "done" ? "erica-file-content--clickable" : ""}`,
|
|
2363
2357
|
onClick: () => e.status === "done" && S(e),
|
|
2364
2358
|
role: e.status === "done" ? "button" : void 0,
|
|
2365
2359
|
tabIndex: e.status === "done" ? 0 : void 0,
|
|
2366
2360
|
children: [
|
|
2367
|
-
e.status === "uploading" ? /* @__PURE__ */ u("div", { className: "
|
|
2361
|
+
e.status === "uploading" ? /* @__PURE__ */ u("div", { className: "erica-spinner erica-spinner--gray" }) : m === e.id ? /* @__PURE__ */ u("div", { className: "erica-spinner erica-spinner--green" }) : e.status === "done" ? /* @__PURE__ */ u(X, { className: "erica-icon-sm erica-icon-green" }) : /* @__PURE__ */ u(X, { className: "erica-icon-sm erica-icon-red" }),
|
|
2368
2362
|
/* @__PURE__ */ d("div", {
|
|
2369
|
-
className: "
|
|
2363
|
+
className: "erica-file-info",
|
|
2370
2364
|
children: [/* @__PURE__ */ d("div", {
|
|
2371
|
-
className: `
|
|
2372
|
-
text-sm font-medium truncate
|
|
2373
|
-
${e.status === "error" ? "text-red-700" : e.status === "done" ? "text-green-700" : "text-gray-700"}
|
|
2374
|
-
`,
|
|
2365
|
+
className: `erica-file-name ${e.status === "error" ? "erica-file-name--error" : e.status === "done" ? "erica-file-name--done" : "erica-file-name--uploading"}`,
|
|
2375
2366
|
children: [e.name, m === e.id && /* @__PURE__ */ u("span", {
|
|
2376
|
-
className: "
|
|
2367
|
+
className: "erica-downloading-badge",
|
|
2377
2368
|
children: "Downloading..."
|
|
2378
2369
|
})]
|
|
2379
2370
|
}), /* @__PURE__ */ d("div", {
|
|
2380
|
-
className: "
|
|
2371
|
+
className: "erica-file-status",
|
|
2381
2372
|
children: [
|
|
2382
2373
|
e.status === "uploading" && "Uploading...",
|
|
2383
2374
|
e.status === "done" && "Ready · Click to download",
|
|
@@ -2385,16 +2376,16 @@ function Ft({ onSend: e, inProgress: t, threadId: n }) {
|
|
|
2385
2376
|
]
|
|
2386
2377
|
})]
|
|
2387
2378
|
}),
|
|
2388
|
-
e.status === "done" && !m && /* @__PURE__ */ u(et, { className: "
|
|
2379
|
+
e.status === "done" && !m && /* @__PURE__ */ u(et, { className: "erica-download-icon" })
|
|
2389
2380
|
]
|
|
2390
2381
|
}), /* @__PURE__ */ u("button", {
|
|
2391
2382
|
onClick: (t) => {
|
|
2392
2383
|
t.stopPropagation(), x(e.id);
|
|
2393
2384
|
},
|
|
2394
2385
|
disabled: e.status === "uploading",
|
|
2395
|
-
className: "
|
|
2386
|
+
className: "erica-remove-button",
|
|
2396
2387
|
"aria-label": `Remove ${e.name}`,
|
|
2397
|
-
children: /* @__PURE__ */ u(nt, { className: "
|
|
2388
|
+
children: /* @__PURE__ */ u(nt, { className: "erica-icon-sm erica-icon-gray" })
|
|
2398
2389
|
})]
|
|
2399
2390
|
}, e.id))
|
|
2400
2391
|
}),
|
|
@@ -2407,7 +2398,7 @@ function Ft({ onSend: e, inProgress: t, threadId: n }) {
|
|
|
2407
2398
|
onChange: (e) => i(e.target.value),
|
|
2408
2399
|
onKeyDown: O,
|
|
2409
2400
|
placeholder: a.length > 0 ? `Ask about ${a.length} file${a.length > 1 ? "s" : ""}...` : "Type a message or attach files...",
|
|
2410
|
-
className: "
|
|
2401
|
+
className: "erica-textarea",
|
|
2411
2402
|
rows: 1,
|
|
2412
2403
|
disabled: t
|
|
2413
2404
|
}), /* @__PURE__ */ d("div", {
|
|
@@ -2417,19 +2408,19 @@ function Ft({ onSend: e, inProgress: t, threadId: n }) {
|
|
|
2417
2408
|
ref: _,
|
|
2418
2409
|
type: "file",
|
|
2419
2410
|
onChange: b,
|
|
2420
|
-
className: "
|
|
2411
|
+
className: "erica-file-input",
|
|
2421
2412
|
disabled: t,
|
|
2422
2413
|
multiple: !0
|
|
2423
2414
|
}),
|
|
2424
2415
|
/* @__PURE__ */ u("button", {
|
|
2425
2416
|
onClick: () => _.current?.click(),
|
|
2426
2417
|
disabled: t,
|
|
2427
|
-
className: "copilotKitInputControlButton
|
|
2418
|
+
className: "copilotKitInputControlButton erica-attach-button",
|
|
2428
2419
|
"aria-label": "Attach files",
|
|
2429
2420
|
title: "Attach files (drag & drop supported)",
|
|
2430
|
-
children: /* @__PURE__ */ u(X, { className: "
|
|
2421
|
+
children: /* @__PURE__ */ u(X, { className: "erica-icon-md" })
|
|
2431
2422
|
}),
|
|
2432
|
-
/* @__PURE__ */ u("div", { className: "
|
|
2423
|
+
/* @__PURE__ */ u("div", { className: "erica-spacer" }),
|
|
2433
2424
|
/* @__PURE__ */ u("button", {
|
|
2434
2425
|
onClick: D,
|
|
2435
2426
|
disabled: t || !r.trim() && a.filter((e) => e.status === "done").length === 0,
|
|
@@ -2511,63 +2502,63 @@ function Vt({ onNewChat: e, onThreadSelect: t }) {
|
|
|
2511
2502
|
r(!1), t?.(e);
|
|
2512
2503
|
}
|
|
2513
2504
|
return /* @__PURE__ */ d("div", {
|
|
2514
|
-
className: "
|
|
2505
|
+
className: "erica-header",
|
|
2515
2506
|
children: [/* @__PURE__ */ u("h2", {
|
|
2516
|
-
className: "
|
|
2507
|
+
className: "erica-header-title",
|
|
2517
2508
|
children: "Erica Assistant"
|
|
2518
2509
|
}), /* @__PURE__ */ d("div", {
|
|
2519
|
-
className: "
|
|
2510
|
+
className: "erica-header-controls",
|
|
2520
2511
|
ref: i,
|
|
2521
2512
|
children: [
|
|
2522
2513
|
/* @__PURE__ */ u("button", {
|
|
2523
2514
|
onClick: e,
|
|
2524
|
-
className: "
|
|
2515
|
+
className: "erica-new-chat-button",
|
|
2525
2516
|
title: "Start new chat",
|
|
2526
|
-
children: /* @__PURE__ */ u(tt, { className: "
|
|
2517
|
+
children: /* @__PURE__ */ u(tt, { className: "erica-icon-sm" })
|
|
2527
2518
|
}),
|
|
2528
2519
|
/* @__PURE__ */ d("button", {
|
|
2529
2520
|
onClick: () => r(!n),
|
|
2530
|
-
className: "
|
|
2521
|
+
className: "erica-threads-toggle",
|
|
2531
2522
|
title: "Recent threads",
|
|
2532
2523
|
children: [/* @__PURE__ */ d("span", {
|
|
2533
|
-
className: "
|
|
2524
|
+
className: "erica-threads-toggle-text",
|
|
2534
2525
|
children: ["Threads ", a.length > 0 && `(${a.length})`]
|
|
2535
|
-
}), /* @__PURE__ */ u($e, { className: `
|
|
2526
|
+
}), /* @__PURE__ */ u($e, { className: `erica-threads-toggle-icon ${n ? "erica-threads-toggle-icon--open" : ""}` })]
|
|
2536
2527
|
}),
|
|
2537
2528
|
n && /* @__PURE__ */ u("div", {
|
|
2538
|
-
className: "
|
|
2529
|
+
className: "erica-threads-dropdown",
|
|
2539
2530
|
children: /* @__PURE__ */ d("div", {
|
|
2540
|
-
className: "
|
|
2531
|
+
className: "erica-threads-dropdown-content",
|
|
2541
2532
|
children: [
|
|
2542
2533
|
/* @__PURE__ */ u("div", {
|
|
2543
|
-
className: "
|
|
2534
|
+
className: "erica-threads-dropdown-header",
|
|
2544
2535
|
children: "Recent Threads"
|
|
2545
2536
|
}),
|
|
2546
2537
|
s && /* @__PURE__ */ u("div", {
|
|
2547
|
-
className: "
|
|
2538
|
+
className: "erica-threads-empty",
|
|
2548
2539
|
children: "Loading threads..."
|
|
2549
2540
|
}),
|
|
2550
2541
|
!s && a.length === 0 && /* @__PURE__ */ u("div", {
|
|
2551
|
-
className: "
|
|
2542
|
+
className: "erica-threads-empty",
|
|
2552
2543
|
children: "No conversations yet"
|
|
2553
2544
|
}),
|
|
2554
2545
|
!s && a.map((e) => {
|
|
2555
2546
|
let t = zt(e.agent), n = Bt(e.last_run_at ?? e.created_at);
|
|
2556
2547
|
return /* @__PURE__ */ u("button", {
|
|
2557
2548
|
onClick: () => f(e.uid),
|
|
2558
|
-
className: "
|
|
2549
|
+
className: "erica-thread-item",
|
|
2559
2550
|
children: /* @__PURE__ */ d("div", {
|
|
2560
|
-
className: "
|
|
2551
|
+
className: "erica-thread-item-content",
|
|
2561
2552
|
children: [/* @__PURE__ */ u("span", {
|
|
2562
|
-
className: "
|
|
2553
|
+
className: "erica-thread-title",
|
|
2563
2554
|
children: typeof e.thread_metadata?.title == "string" ? e.thread_metadata.title : e.last_message ?? "New conversation"
|
|
2564
2555
|
}), /* @__PURE__ */ d("div", {
|
|
2565
|
-
className: "
|
|
2556
|
+
className: "erica-thread-meta",
|
|
2566
2557
|
children: [t && /* @__PURE__ */ u("span", {
|
|
2567
|
-
className: "
|
|
2558
|
+
className: "erica-thread-agent",
|
|
2568
2559
|
children: t
|
|
2569
2560
|
}), n && /* @__PURE__ */ u("span", {
|
|
2570
|
-
className: "
|
|
2561
|
+
className: "erica-thread-time",
|
|
2571
2562
|
children: n
|
|
2572
2563
|
})]
|
|
2573
2564
|
})]
|