@saar-ai/web-widget 0.2.0 → 0.3.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/avatar-face.d.ts +33 -0
- package/dist/avatar-face.d.ts.map +1 -0
- package/dist/avatar.d.ts +17 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/bot-face.d.ts +17 -0
- package/dist/bot-face.d.ts.map +1 -1
- package/dist/chunks/{host-widget-iy3qC-1p.js → host-widget-BlihQKm5.js} +1362 -402
- package/dist/concierge-launcher.d.ts +4 -1
- package/dist/concierge-launcher.d.ts.map +1 -1
- package/dist/concierge-shell.d.ts +55 -6
- package/dist/concierge-shell.d.ts.map +1 -1
- package/dist/generated/widget-css.d.ts.map +1 -1
- package/dist/host-widget.d.ts +20 -1
- package/dist/host-widget.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/messages.d.ts +55 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/next/index.js +1 -1
- package/dist/rope-knot.d.ts +13 -0
- package/dist/rope-knot.d.ts.map +1 -0
- package/dist/session-log.d.ts +1 -1
- package/dist/session-log.d.ts.map +1 -1
- package/dist/use-chat-session.d.ts +65 -1
- package/dist/use-chat-session.d.ts.map +1 -1
- package/dist/voice-widget.d.ts +33 -4
- package/dist/voice-widget.d.ts.map +1 -1
- package/dist/widget-cards.d.ts +5 -2
- package/dist/widget-cards.d.ts.map +1 -1
- package/dist/widget.css +1 -1
- package/package.json +3 -2
- package/src/styles/concierge.css +377 -0
package/src/styles/concierge.css
CHANGED
|
@@ -271,6 +271,33 @@
|
|
|
271
271
|
animation: widget-portal 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
/* Scroll containers inside the widget hide their scrollbar but keep
|
|
275
|
+
* scrolling. The panel is a compact overlay on someone else's page: a
|
|
276
|
+
* visible bar eats a meaningful slice of its width and reads as host-page
|
|
277
|
+
* chrome bleeding into the widget. Wheel, touch, and keyboard scrolling are
|
|
278
|
+
* untouched — only the bar's pixels go. `scrollbar-width` covers Firefox,
|
|
279
|
+
* the pseudo-element covers WebKit/Blink. */
|
|
280
|
+
.no-scrollbar {
|
|
281
|
+
scrollbar-width: none;
|
|
282
|
+
-ms-overflow-style: none;
|
|
283
|
+
}
|
|
284
|
+
.no-scrollbar::-webkit-scrollbar {
|
|
285
|
+
display: none;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* Tailwind v4's preflight dropped v3's `button { cursor: pointer }`. The
|
|
289
|
+
* embed never loads the console's shared base layer (`@wesence/ui`'s
|
|
290
|
+
* globals.css, which restores the affordance for the apps), so the widget
|
|
291
|
+
* carries its own copy of the rule — same selectors, same reasoning: only
|
|
292
|
+
* things that can actually be clicked get the pointer. */
|
|
293
|
+
button:enabled,
|
|
294
|
+
[role='button']:not([aria-disabled='true']),
|
|
295
|
+
select:enabled,
|
|
296
|
+
summary,
|
|
297
|
+
label[for] {
|
|
298
|
+
cursor: pointer;
|
|
299
|
+
}
|
|
300
|
+
|
|
274
301
|
@keyframes bot-nod {
|
|
275
302
|
0% {
|
|
276
303
|
transform: translateY(0) scale(1);
|
|
@@ -349,3 +376,353 @@
|
|
|
349
376
|
opacity: var(--voice-max-opacity, 1);
|
|
350
377
|
}
|
|
351
378
|
}
|
|
379
|
+
|
|
380
|
+
/* ============================================================
|
|
381
|
+
* RopeKnot — the 'knot' avatar (rope-knot.tsx). Ported from the Lovable
|
|
382
|
+
* prototype's styles.css "RopeKnot" block, class names unchanged so a
|
|
383
|
+
* future re-port diffs cleanly.
|
|
384
|
+
* ========================================================== */
|
|
385
|
+
|
|
386
|
+
/*
|
|
387
|
+
* `--knot-ink`/`-faint`/`-halo`/`-surface` are declared in `rope-knot.tsx`
|
|
388
|
+
* itself (inline style on `RopeKnotFrame`'s own root), NOT here. A `:root`
|
|
389
|
+
* declaration of `--knot-ink: var(--brand-plum, …)` resolves `--brand-plum`
|
|
390
|
+
* using `:root`'s OWN cascade at declaration time — which never sees a
|
|
391
|
+
* tenant's override (that lives on a descendant, `ConciergeShell`'s
|
|
392
|
+
* `skinStyle` wrapper) — and matches nothing at all inside the CDN embed's
|
|
393
|
+
* shadow tree in the first place. See `rope-knot.tsx`'s module doc comment
|
|
394
|
+
* ("Why the colour vars are declared HERE, not in concierge.css") for the
|
|
395
|
+
* full reasoning; this comment exists so the fix isn't silently re-reverted
|
|
396
|
+
* by someone moving the vars back here to "keep colours in the stylesheet."
|
|
397
|
+
*/
|
|
398
|
+
|
|
399
|
+
/* Self-tying intro: the line draws itself into the knot */
|
|
400
|
+
@keyframes rk-draw-on {
|
|
401
|
+
from {
|
|
402
|
+
stroke-dasharray: 0 100;
|
|
403
|
+
}
|
|
404
|
+
to {
|
|
405
|
+
stroke-dasharray: 100 0;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
.rk-draw {
|
|
409
|
+
stroke-width: 3;
|
|
410
|
+
animation: rk-draw-on 1.3s cubic-bezier(0.5, 0, 0.2, 1) both;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/* Idle: the rope rests solid, then once per cycle it retreats from the
|
|
414
|
+
* center outward into two small dots at the tail ends, and each dot traces
|
|
415
|
+
* the ghost line back inward until the halves meet as a whole knot again.
|
|
416
|
+
* Dash values use the three-segment trick (dash gap dash, sum = pathLength)
|
|
417
|
+
* so the two ends grow/shrink symmetrically. 50 0 50 renders identically to
|
|
418
|
+
* 100 0 0, so the loop seam is invisible. */
|
|
419
|
+
@keyframes rk-idle-retie {
|
|
420
|
+
0%,
|
|
421
|
+
52% {
|
|
422
|
+
stroke-dasharray: 100 0 0;
|
|
423
|
+
animation-timing-function: cubic-bezier(0.6, 0, 0.3, 1); /* unwind */
|
|
424
|
+
}
|
|
425
|
+
58% {
|
|
426
|
+
stroke-dasharray: 4 92 4;
|
|
427
|
+
animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); /* dots settle */
|
|
428
|
+
}
|
|
429
|
+
62% {
|
|
430
|
+
stroke-dasharray: 3 94 3;
|
|
431
|
+
animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); /* trace in */
|
|
432
|
+
}
|
|
433
|
+
88%,
|
|
434
|
+
100% {
|
|
435
|
+
stroke-dasharray: 50 0 50;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
.rk-draw.rk-idle {
|
|
439
|
+
animation:
|
|
440
|
+
rk-draw-on 1.3s cubic-bezier(0.5, 0, 0.2, 1) both,
|
|
441
|
+
rk-idle-retie 9.5s ease-in-out 1.6s infinite;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/* Listening: the rope continuously traces itself over a faint ghost line,
|
|
445
|
+
like the self-tying intro replaying on a loop. */
|
|
446
|
+
@keyframes rk-listen-fill {
|
|
447
|
+
0% {
|
|
448
|
+
stroke-dasharray: 0 100;
|
|
449
|
+
}
|
|
450
|
+
45% {
|
|
451
|
+
stroke-dasharray: 100 0;
|
|
452
|
+
}
|
|
453
|
+
55% {
|
|
454
|
+
stroke-dasharray: 100 0;
|
|
455
|
+
}
|
|
456
|
+
100% {
|
|
457
|
+
stroke-dasharray: 0 100;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
.rk-draw.rk-listening {
|
|
461
|
+
animation:
|
|
462
|
+
rk-draw-on 1.3s cubic-bezier(0.5, 0, 0.2, 1) both,
|
|
463
|
+
rk-listen-fill 2.8s cubic-bezier(0.45, 0, 0.55, 1) 1.3s infinite;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/* Cross-state blending: on ANY state change the component freezes the dash
|
|
467
|
+
pattern currently on screen into --rk-from, and the incoming state eases
|
|
468
|
+
out of that exact shape into its own loop's first frame — so the rope never
|
|
469
|
+
snaps back to the self-tying intro when the widget changes state. */
|
|
470
|
+
@keyframes rk-blend-to-listen {
|
|
471
|
+
from {
|
|
472
|
+
stroke-dasharray: var(--rk-from, 100 0 0);
|
|
473
|
+
}
|
|
474
|
+
to {
|
|
475
|
+
stroke-dasharray: 0 100;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
@keyframes rk-blend-to-speak {
|
|
479
|
+
from {
|
|
480
|
+
stroke-dasharray: var(--rk-from, 100 0 0);
|
|
481
|
+
}
|
|
482
|
+
to {
|
|
483
|
+
stroke-dasharray: 10 80 10;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
@keyframes rk-blend-to-think {
|
|
487
|
+
from {
|
|
488
|
+
stroke-dasharray: var(--rk-from, 100 0 0);
|
|
489
|
+
}
|
|
490
|
+
to {
|
|
491
|
+
stroke-dasharray: 0.4 6.5;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
@keyframes rk-blend-to-idle {
|
|
495
|
+
from {
|
|
496
|
+
stroke-dasharray: var(--rk-from, 0 100);
|
|
497
|
+
}
|
|
498
|
+
to {
|
|
499
|
+
stroke-dasharray: 100 0 0;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
.rk-draw.rk-listening.rk-blend {
|
|
503
|
+
animation:
|
|
504
|
+
rk-blend-to-listen 0.5s cubic-bezier(0.4, 0, 0.2, 1) both,
|
|
505
|
+
rk-listen-fill 2.8s cubic-bezier(0.45, 0, 0.55, 1) 0.5s infinite;
|
|
506
|
+
}
|
|
507
|
+
.rk-draw.rk-speaking.rk-blend {
|
|
508
|
+
animation:
|
|
509
|
+
rk-blend-to-speak 0.5s cubic-bezier(0.4, 0, 0.2, 1) both,
|
|
510
|
+
rk-speak-ends 1.65s 0.5s infinite;
|
|
511
|
+
}
|
|
512
|
+
.rk-draw.rk-thread.rk-blend {
|
|
513
|
+
animation:
|
|
514
|
+
rk-blend-to-think 0.6s cubic-bezier(0.4, 0, 0.2, 1) both,
|
|
515
|
+
rk-thread-fill 3.8s ease-in-out 0.6s infinite;
|
|
516
|
+
}
|
|
517
|
+
.rk-draw.rk-idle.rk-blend {
|
|
518
|
+
animation:
|
|
519
|
+
rk-blend-to-idle 0.55s cubic-bezier(0.4, 0, 0.2, 1) both,
|
|
520
|
+
rk-idle-retie 9.5s ease-in-out 0.85s infinite;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/* Travelling pulse riding along the line */
|
|
524
|
+
@keyframes rk-pulse-run {
|
|
525
|
+
from {
|
|
526
|
+
stroke-dashoffset: 100;
|
|
527
|
+
}
|
|
528
|
+
to {
|
|
529
|
+
stroke-dashoffset: 0;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
.rk-pulse {
|
|
533
|
+
animation: rk-pulse-run 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/* Idle sway */
|
|
537
|
+
@keyframes rk-sway {
|
|
538
|
+
0%,
|
|
539
|
+
100% {
|
|
540
|
+
transform: rotate(-0.8deg) translateY(0) scale(1);
|
|
541
|
+
}
|
|
542
|
+
50% {
|
|
543
|
+
transform: rotate(0.8deg) translateY(-1px) scale(1.012);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
.rk-sway {
|
|
547
|
+
animation: rk-sway 7.5s ease-in-out infinite;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/* Tighten / cinch on click — elastic spring back */
|
|
551
|
+
@keyframes rk-tighten {
|
|
552
|
+
0% {
|
|
553
|
+
transform: scale(1) rotate(0deg);
|
|
554
|
+
}
|
|
555
|
+
28% {
|
|
556
|
+
transform: scale(0.9) rotate(-2.5deg);
|
|
557
|
+
}
|
|
558
|
+
55% {
|
|
559
|
+
transform: scale(1.035) rotate(1deg);
|
|
560
|
+
}
|
|
561
|
+
78% {
|
|
562
|
+
transform: scale(0.99) rotate(-0.4deg);
|
|
563
|
+
}
|
|
564
|
+
100% {
|
|
565
|
+
transform: scale(1) rotate(0deg);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
.rk-tighten {
|
|
569
|
+
animation: rk-tighten 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/* One-shot tail pulse on click: the rope briefly dips into the speaking
|
|
573
|
+
* tail shape (tails drawn in from both ends) and refills — click feedback. */
|
|
574
|
+
@keyframes rk-tap-fill {
|
|
575
|
+
0% {
|
|
576
|
+
stroke-dasharray: 100 0 0;
|
|
577
|
+
}
|
|
578
|
+
30% {
|
|
579
|
+
stroke-dasharray: 34 32 34;
|
|
580
|
+
}
|
|
581
|
+
55% {
|
|
582
|
+
stroke-dasharray: 42 16 42;
|
|
583
|
+
}
|
|
584
|
+
100% {
|
|
585
|
+
stroke-dasharray: 100 0 0;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
.rk-draw.rk-tap {
|
|
589
|
+
animation: rk-tap-fill 0.65s cubic-bezier(0.4, 0, 0.3, 1) both;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/* Thinking: rope under tension — slow strain into the cinch, quick elastic
|
|
593
|
+
release with a damped settle. Ease-in feels like pulling load onto the line;
|
|
594
|
+
the release snaps back with spring overshoot, not a symmetric sine wave. */
|
|
595
|
+
@keyframes rk-cinch {
|
|
596
|
+
0% {
|
|
597
|
+
transform: scale(1, 1) rotate(0deg);
|
|
598
|
+
animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); /* strain in */
|
|
599
|
+
}
|
|
600
|
+
38% {
|
|
601
|
+
transform: scale(0.955, 0.91) rotate(-1.3deg);
|
|
602
|
+
animation-timing-function: cubic-bezier(0.2, 1.1, 0.3, 1); /* snap out */
|
|
603
|
+
}
|
|
604
|
+
55% {
|
|
605
|
+
transform: scale(1.02, 1.028) rotate(0.5deg);
|
|
606
|
+
animation-timing-function: cubic-bezier(0.4, 0, 0.3, 1); /* settle once */
|
|
607
|
+
}
|
|
608
|
+
68%,
|
|
609
|
+
100% {
|
|
610
|
+
/* fully settled well before the loop point: no end-of-cycle twitch */
|
|
611
|
+
transform: scale(1, 1) rotate(0deg);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
.rk-thinking {
|
|
615
|
+
animation: rk-cinch 3.8s infinite;
|
|
616
|
+
transform-origin: 50% 50%;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/* Thinking thread: the line starts as a dotted pattern and fills itself
|
|
620
|
+
solid, then unravels back to dots — synced to the cinch cycle. */
|
|
621
|
+
@keyframes rk-thread-fill {
|
|
622
|
+
0%,
|
|
623
|
+
100% {
|
|
624
|
+
stroke-dasharray: 0.4 6.5;
|
|
625
|
+
}
|
|
626
|
+
50% {
|
|
627
|
+
stroke-dasharray: 100 0;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
.rk-draw.rk-thread {
|
|
631
|
+
stroke-linecap: round;
|
|
632
|
+
animation:
|
|
633
|
+
rk-draw-on 1.3s cubic-bezier(0.5, 0, 0.2, 1) both,
|
|
634
|
+
rk-thread-fill 3.8s ease-in-out 1.3s infinite;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/* Speaking: the rope's tails grow and shrink in length while a faint trace
|
|
638
|
+
of the full knot stays in the background. Re-declares the draw-on intro
|
|
639
|
+
so both can run on the same element.
|
|
640
|
+
|
|
641
|
+
The motion is modelled on a breath: a slow outward draw, a tiny overshoot,
|
|
642
|
+
a brief hold at full extension, then a soft elastic release. The tails fill
|
|
643
|
+
most of the knot at the peak so speaking reads as the rope lighting up from
|
|
644
|
+
the ends. All values are percentages of the path, so the bounce stays
|
|
645
|
+
proportionally the same at small, medium, and large sizes. */
|
|
646
|
+
@keyframes rk-speak-ends {
|
|
647
|
+
0%,
|
|
648
|
+
100% {
|
|
649
|
+
stroke-dasharray: 10 80 10;
|
|
650
|
+
animation-timing-function: cubic-bezier(0.45, 0, 0.2, 1);
|
|
651
|
+
}
|
|
652
|
+
35% {
|
|
653
|
+
stroke-dasharray: 40 20 40;
|
|
654
|
+
animation-timing-function: cubic-bezier(0.25, 0.5, 0.5, 1);
|
|
655
|
+
}
|
|
656
|
+
48% {
|
|
657
|
+
stroke-dasharray: 38 24 38;
|
|
658
|
+
animation-timing-function: linear;
|
|
659
|
+
}
|
|
660
|
+
62% {
|
|
661
|
+
stroke-dasharray: 38 24 38;
|
|
662
|
+
animation-timing-function: cubic-bezier(0.35, 0, 0.5, 1);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
.rk-draw.rk-speaking {
|
|
666
|
+
animation:
|
|
667
|
+
rk-draw-on 1.3s cubic-bezier(0.5, 0, 0.2, 1) both,
|
|
668
|
+
rk-speak-ends 1.65s 1.3s infinite;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/* Halo breathing for active states */
|
|
672
|
+
@keyframes rk-halo {
|
|
673
|
+
0%,
|
|
674
|
+
100% {
|
|
675
|
+
transform: scale(1);
|
|
676
|
+
opacity: 0.45;
|
|
677
|
+
}
|
|
678
|
+
50% {
|
|
679
|
+
transform: scale(1.15);
|
|
680
|
+
opacity: 0.75;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
.rk-halo {
|
|
684
|
+
animation: rk-halo 2.4s ease-in-out infinite;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/*
|
|
688
|
+
* `concierge.css` has no prior `prefers-reduced-motion` block — every other
|
|
689
|
+
* component here stops motion via Tailwind's `motion-reduce:` variant at the
|
|
690
|
+
* call site instead (see `concierge-shell.tsx`). The knot's animations are
|
|
691
|
+
* plain CSS `animation` declarations on bare classes, not Tailwind
|
|
692
|
+
* utilities, so there is no `motion-reduce:` form to reach for — this block
|
|
693
|
+
* is the equivalent for exactly those classes, added here rather than
|
|
694
|
+
* scattered per call site since every one of them lives in this file.
|
|
695
|
+
*
|
|
696
|
+
* The four `.rk-draw.rk-<state>.rk-blend` combos are listed EXPLICITLY,
|
|
697
|
+
* not folded into the plain `.rk-draw.rk-blend`/`.rk-draw.rk-<state>`
|
|
698
|
+
* entries below them. Selector specificity, not source order, decides which
|
|
699
|
+
* rule wins on a real conflict: those three-class combos are (0,3,0), one
|
|
700
|
+
* level above every other selector in this block (0,2,0), so on the FIRST
|
|
701
|
+
* state change after mount (`blend > 0`, `.rk-blend` now present) the
|
|
702
|
+
* two-class `animation: none` entries stopped losing to them — reduced-motion
|
|
703
|
+
* users got the full crossfade animation from the second state onward, with
|
|
704
|
+
* every earlier render looking correctly still. Matching each combo's exact
|
|
705
|
+
* specificity, rather than something broader like `[class*="rk-"]`, is what
|
|
706
|
+
* keeps this block failing loudly (a missing combo just doesn't match) if a
|
|
707
|
+
* future `rk-blend-to-*` rule is added without updating this list too.
|
|
708
|
+
*/
|
|
709
|
+
@media (prefers-reduced-motion: reduce) {
|
|
710
|
+
.rk-draw,
|
|
711
|
+
.rk-draw.rk-idle,
|
|
712
|
+
.rk-draw.rk-listening,
|
|
713
|
+
.rk-draw.rk-thread,
|
|
714
|
+
.rk-draw.rk-speaking,
|
|
715
|
+
.rk-draw.rk-tap,
|
|
716
|
+
.rk-draw.rk-blend,
|
|
717
|
+
.rk-draw.rk-idle.rk-blend,
|
|
718
|
+
.rk-draw.rk-listening.rk-blend,
|
|
719
|
+
.rk-draw.rk-thread.rk-blend,
|
|
720
|
+
.rk-draw.rk-speaking.rk-blend,
|
|
721
|
+
.rk-pulse,
|
|
722
|
+
.rk-sway,
|
|
723
|
+
.rk-tighten,
|
|
724
|
+
.rk-thinking,
|
|
725
|
+
.rk-halo {
|
|
726
|
+
animation: none;
|
|
727
|
+
}
|
|
728
|
+
}
|