@hef2024/llmasaservice-ui 0.22.11 → 0.23.0
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.css +632 -1
- package/dist/index.d.mts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +3829 -3465
- package/dist/index.mjs +3760 -3398
- package/package.json +1 -1
- package/src/AIChatPanel.css +365 -0
- package/src/AIChatPanel.tsx +251 -88
- package/src/ChatPanel.css +379 -3
- package/src/ChatPanel.tsx +264 -190
- package/src/components/ui/ThinkingBlock.tsx +150 -0
- package/src/components/ui/WordFadeIn.tsx +101 -0
- package/src/components/ui/index.ts +6 -0
package/package.json
CHANGED
package/src/AIChatPanel.css
CHANGED
|
@@ -2352,4 +2352,369 @@
|
|
|
2352
2352
|
|
|
2353
2353
|
.dark-theme .ai-chat-email-edit-button:hover {
|
|
2354
2354
|
background-color: #374151;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
/* ============================================================================
|
|
2358
|
+
Streaming Thinking Blocks - New Collapsible Design
|
|
2359
|
+
============================================================================ */
|
|
2360
|
+
|
|
2361
|
+
/* Word Fade-In Animation */
|
|
2362
|
+
.word-fade-in {
|
|
2363
|
+
animation: wordFadeIn 150ms ease-out forwards;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
@keyframes wordFadeIn {
|
|
2367
|
+
from {
|
|
2368
|
+
opacity: 0;
|
|
2369
|
+
transform: translateY(2px);
|
|
2370
|
+
}
|
|
2371
|
+
to {
|
|
2372
|
+
opacity: 1;
|
|
2373
|
+
transform: translateY(0);
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
/* Streaming Text Chunk Animation - for text appearing as it streams */
|
|
2378
|
+
.streaming-text-chunk {
|
|
2379
|
+
animation: streamingFadeIn var(--fade-duration, 400ms) ease-out forwards;
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
@keyframes streamingFadeIn {
|
|
2383
|
+
0% {
|
|
2384
|
+
opacity: 0;
|
|
2385
|
+
background-color: rgba(99, 102, 241, 0.2);
|
|
2386
|
+
border-radius: 2px;
|
|
2387
|
+
}
|
|
2388
|
+
30% {
|
|
2389
|
+
opacity: 0.8;
|
|
2390
|
+
background-color: rgba(99, 102, 241, 0.15);
|
|
2391
|
+
}
|
|
2392
|
+
100% {
|
|
2393
|
+
opacity: 1;
|
|
2394
|
+
background-color: transparent;
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
/* Dark theme streaming highlight */
|
|
2399
|
+
.dark-theme .streaming-text-chunk {
|
|
2400
|
+
animation: streamingFadeInDark var(--fade-duration, 400ms) ease-out forwards;
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
@keyframes streamingFadeInDark {
|
|
2404
|
+
0% {
|
|
2405
|
+
opacity: 0;
|
|
2406
|
+
background-color: rgba(129, 140, 248, 0.25);
|
|
2407
|
+
border-radius: 2px;
|
|
2408
|
+
}
|
|
2409
|
+
30% {
|
|
2410
|
+
opacity: 0.8;
|
|
2411
|
+
background-color: rgba(129, 140, 248, 0.15);
|
|
2412
|
+
}
|
|
2413
|
+
100% {
|
|
2414
|
+
opacity: 1;
|
|
2415
|
+
background-color: transparent;
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
/* Thinking Block Container */
|
|
2420
|
+
.thinking-block {
|
|
2421
|
+
margin-bottom: 12px;
|
|
2422
|
+
border-radius: 8px;
|
|
2423
|
+
overflow: hidden;
|
|
2424
|
+
background-color: var(--ai-chat-thinking-bg);
|
|
2425
|
+
border: 1px solid var(--ai-chat-thinking-border);
|
|
2426
|
+
transition: all 0.2s ease-out;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
/* Type-specific themes */
|
|
2430
|
+
.thinking-block--thinking {
|
|
2431
|
+
--thinking-block-accent: #8b5cf6;
|
|
2432
|
+
--thinking-block-bg: #f5f3ff;
|
|
2433
|
+
--thinking-block-text: #5b21b6;
|
|
2434
|
+
background-color: var(--thinking-block-bg);
|
|
2435
|
+
border-color: var(--thinking-block-accent);
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
.thinking-block--reasoning {
|
|
2439
|
+
--thinking-block-accent: #3b82f6;
|
|
2440
|
+
--thinking-block-bg: #eff6ff;
|
|
2441
|
+
--thinking-block-text: #1d4ed8;
|
|
2442
|
+
background-color: var(--thinking-block-bg);
|
|
2443
|
+
border-color: var(--thinking-block-accent);
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
.thinking-block--searching {
|
|
2447
|
+
--thinking-block-accent: #22c55e;
|
|
2448
|
+
--thinking-block-bg: #f0fdf4;
|
|
2449
|
+
--thinking-block-text: #166534;
|
|
2450
|
+
background-color: var(--thinking-block-bg);
|
|
2451
|
+
border-color: var(--thinking-block-accent);
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
/* Dark theme type-specific */
|
|
2455
|
+
.dark-theme .thinking-block--thinking {
|
|
2456
|
+
--thinking-block-bg: #1e1b2e;
|
|
2457
|
+
--thinking-block-accent: #a78bfa;
|
|
2458
|
+
--thinking-block-text: #c4b5fd;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
.dark-theme .thinking-block--reasoning {
|
|
2462
|
+
--thinking-block-bg: #0c1929;
|
|
2463
|
+
--thinking-block-accent: #60a5fa;
|
|
2464
|
+
--thinking-block-text: #93c5fd;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
.dark-theme .thinking-block--searching {
|
|
2468
|
+
--thinking-block-bg: #052e16;
|
|
2469
|
+
--thinking-block-accent: #4ade80;
|
|
2470
|
+
--thinking-block-text: #86efac;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
/* Header (clickable toggle) */
|
|
2474
|
+
.thinking-block__header {
|
|
2475
|
+
display: flex;
|
|
2476
|
+
align-items: center;
|
|
2477
|
+
justify-content: space-between;
|
|
2478
|
+
width: 100%;
|
|
2479
|
+
padding: 10px 12px;
|
|
2480
|
+
background: none;
|
|
2481
|
+
border: none;
|
|
2482
|
+
cursor: pointer;
|
|
2483
|
+
font-family: inherit;
|
|
2484
|
+
text-align: left;
|
|
2485
|
+
transition: background-color 0.15s;
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
.thinking-block__header:hover {
|
|
2489
|
+
background-color: rgba(0, 0, 0, 0.03);
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
.dark-theme .thinking-block__header:hover {
|
|
2493
|
+
background-color: rgba(255, 255, 255, 0.03);
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
.thinking-block__header-left {
|
|
2497
|
+
display: flex;
|
|
2498
|
+
align-items: center;
|
|
2499
|
+
gap: 8px;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
/* Icon */
|
|
2503
|
+
.thinking-block__icon {
|
|
2504
|
+
width: 16px;
|
|
2505
|
+
height: 16px;
|
|
2506
|
+
color: var(--thinking-block-accent, var(--ai-chat-thinking-icon));
|
|
2507
|
+
flex-shrink: 0;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
/* Title */
|
|
2511
|
+
.thinking-block__title {
|
|
2512
|
+
font-weight: 600;
|
|
2513
|
+
font-size: 13px;
|
|
2514
|
+
color: var(--thinking-block-text, var(--ai-chat-thinking-text));
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
/* Chevron (collapse indicator) */
|
|
2518
|
+
.thinking-block__chevron {
|
|
2519
|
+
width: 16px;
|
|
2520
|
+
height: 16px;
|
|
2521
|
+
color: var(--thinking-block-text, var(--ai-chat-thinking-text));
|
|
2522
|
+
opacity: 0.6;
|
|
2523
|
+
transition: transform 0.2s ease-out;
|
|
2524
|
+
flex-shrink: 0;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
.thinking-block__chevron--collapsed {
|
|
2528
|
+
transform: rotate(-90deg);
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
/* Streaming Indicator (three pulsing dots) */
|
|
2532
|
+
.thinking-block__streaming-indicator {
|
|
2533
|
+
display: flex;
|
|
2534
|
+
align-items: center;
|
|
2535
|
+
gap: 3px;
|
|
2536
|
+
margin-left: 4px;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
.thinking-block__streaming-dot {
|
|
2540
|
+
width: 4px;
|
|
2541
|
+
height: 4px;
|
|
2542
|
+
border-radius: 50%;
|
|
2543
|
+
background-color: var(--thinking-block-accent, var(--ai-chat-thinking-icon));
|
|
2544
|
+
animation: streamingDotPulse 1.4s ease-in-out infinite;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
.thinking-block__streaming-dot:nth-child(1) {
|
|
2548
|
+
animation-delay: 0s;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
.thinking-block__streaming-dot:nth-child(2) {
|
|
2552
|
+
animation-delay: 0.2s;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
.thinking-block__streaming-dot:nth-child(3) {
|
|
2556
|
+
animation-delay: 0.4s;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
@keyframes streamingDotPulse {
|
|
2560
|
+
0%, 60%, 100% {
|
|
2561
|
+
opacity: 0.3;
|
|
2562
|
+
transform: scale(0.8);
|
|
2563
|
+
}
|
|
2564
|
+
30% {
|
|
2565
|
+
opacity: 1;
|
|
2566
|
+
transform: scale(1);
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
/* Blinking cursor for streaming content */
|
|
2571
|
+
.thinking-block__cursor {
|
|
2572
|
+
display: inline;
|
|
2573
|
+
color: var(--thinking-block-accent, var(--ai-chat-thinking-icon));
|
|
2574
|
+
animation: cursorBlink 0.8s step-end infinite;
|
|
2575
|
+
font-weight: bold;
|
|
2576
|
+
margin-left: 1px;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
@keyframes cursorBlink {
|
|
2580
|
+
0%, 100% { opacity: 1; }
|
|
2581
|
+
50% { opacity: 0; }
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
/* Thinking In Progress Indicator - shown during pauses between blocks */
|
|
2585
|
+
.thinking-in-progress {
|
|
2586
|
+
padding: 12px 16px;
|
|
2587
|
+
margin: 8px 0;
|
|
2588
|
+
background: linear-gradient(135deg,
|
|
2589
|
+
rgba(139, 92, 246, 0.08) 0%,
|
|
2590
|
+
rgba(99, 102, 241, 0.08) 100%
|
|
2591
|
+
);
|
|
2592
|
+
border: 1px solid rgba(139, 92, 246, 0.2);
|
|
2593
|
+
border-radius: 8px;
|
|
2594
|
+
animation: thinkingPulse 2s ease-in-out infinite;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
.thinking-in-progress__content {
|
|
2598
|
+
display: flex;
|
|
2599
|
+
align-items: center;
|
|
2600
|
+
gap: 8px;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
.thinking-in-progress__icon {
|
|
2604
|
+
width: 16px;
|
|
2605
|
+
height: 16px;
|
|
2606
|
+
color: var(--ai-chat-thinking-icon, #8b5cf6);
|
|
2607
|
+
animation: iconSpin 2s linear infinite;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
.thinking-in-progress__text {
|
|
2611
|
+
color: var(--ai-chat-text, #374151);
|
|
2612
|
+
font-size: 14px;
|
|
2613
|
+
font-weight: 500;
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
.thinking-in-progress__dots {
|
|
2617
|
+
display: flex;
|
|
2618
|
+
gap: 3px;
|
|
2619
|
+
margin-left: 2px;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
.thinking-in-progress__dot {
|
|
2623
|
+
width: 4px;
|
|
2624
|
+
height: 4px;
|
|
2625
|
+
border-radius: 50%;
|
|
2626
|
+
background-color: var(--ai-chat-thinking-icon, #8b5cf6);
|
|
2627
|
+
animation: dotPulse 1.4s ease-in-out infinite;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
.thinking-in-progress__dot:nth-child(1) { animation-delay: 0s; }
|
|
2631
|
+
.thinking-in-progress__dot:nth-child(2) { animation-delay: 0.2s; }
|
|
2632
|
+
.thinking-in-progress__dot:nth-child(3) { animation-delay: 0.4s; }
|
|
2633
|
+
|
|
2634
|
+
@keyframes thinkingPulse {
|
|
2635
|
+
0%, 100% {
|
|
2636
|
+
opacity: 1;
|
|
2637
|
+
border-color: rgba(139, 92, 246, 0.2);
|
|
2638
|
+
}
|
|
2639
|
+
50% {
|
|
2640
|
+
opacity: 0.85;
|
|
2641
|
+
border-color: rgba(139, 92, 246, 0.4);
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
@keyframes iconSpin {
|
|
2646
|
+
from { transform: rotate(0deg); }
|
|
2647
|
+
to { transform: rotate(360deg); }
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
@keyframes dotPulse {
|
|
2651
|
+
0%, 60%, 100% {
|
|
2652
|
+
opacity: 0.3;
|
|
2653
|
+
transform: scale(0.8);
|
|
2654
|
+
}
|
|
2655
|
+
30% {
|
|
2656
|
+
opacity: 1;
|
|
2657
|
+
transform: scale(1.1);
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
/* Dark theme */
|
|
2662
|
+
.dark-theme .thinking-in-progress {
|
|
2663
|
+
background: linear-gradient(135deg,
|
|
2664
|
+
rgba(139, 92, 246, 0.12) 0%,
|
|
2665
|
+
rgba(99, 102, 241, 0.12) 100%
|
|
2666
|
+
);
|
|
2667
|
+
border-color: rgba(139, 92, 246, 0.3);
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
.dark-theme .thinking-in-progress__text {
|
|
2671
|
+
color: var(--ai-chat-text, #e5e7eb);
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
/* Content Wrapper (for collapse animation) */
|
|
2675
|
+
.thinking-block__content-wrapper {
|
|
2676
|
+
display: grid;
|
|
2677
|
+
grid-template-rows: 1fr;
|
|
2678
|
+
transition: grid-template-rows 0.2s ease-out;
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
.thinking-block--collapsed .thinking-block__content-wrapper {
|
|
2682
|
+
grid-template-rows: 0fr;
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
/* Content */
|
|
2686
|
+
.thinking-block__content {
|
|
2687
|
+
overflow: hidden;
|
|
2688
|
+
padding: 0 12px 12px 12px;
|
|
2689
|
+
font-size: 13px;
|
|
2690
|
+
line-height: 1.6;
|
|
2691
|
+
color: var(--thinking-block-text, var(--ai-chat-thinking-text));
|
|
2692
|
+
white-space: pre-wrap;
|
|
2693
|
+
word-break: break-word;
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
.thinking-block--collapsed .thinking-block__content {
|
|
2697
|
+
padding-top: 0;
|
|
2698
|
+
padding-bottom: 0;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
/* Streaming state - subtle left border glow */
|
|
2702
|
+
.thinking-block:not(.thinking-block--collapsed) {
|
|
2703
|
+
border-left-width: 3px;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
/* Animation when block first appears */
|
|
2707
|
+
.thinking-block {
|
|
2708
|
+
animation: thinkingBlockAppear 0.2s ease-out;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
@keyframes thinkingBlockAppear {
|
|
2712
|
+
from {
|
|
2713
|
+
opacity: 0;
|
|
2714
|
+
transform: translateY(-4px);
|
|
2715
|
+
}
|
|
2716
|
+
to {
|
|
2717
|
+
opacity: 1;
|
|
2718
|
+
transform: translateY(0);
|
|
2719
|
+
}
|
|
2355
2720
|
}
|