@skippr/live-agent-sdk 0.6.0 → 0.7.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/esm/lib-exports.js +156 -156
- package/package.json +1 -1
package/dist/esm/lib-exports.js
CHANGED
|
@@ -210,7 +210,7 @@ import { Bot, X } from "lucide-react";
|
|
|
210
210
|
|
|
211
211
|
// src/components/ui/button.tsx
|
|
212
212
|
import { forwardRef } from "react";
|
|
213
|
-
import {
|
|
213
|
+
import { jsx } from "react/jsx-runtime";
|
|
214
214
|
var variantClasses = {
|
|
215
215
|
default: "skippr:bg-primary skippr:text-primary-foreground skippr:hover:bg-primary/90",
|
|
216
216
|
destructive: "skippr:bg-destructive skippr:text-white skippr:hover:bg-destructive/90",
|
|
@@ -229,44 +229,44 @@ var sizeClasses = {
|
|
|
229
229
|
"icon-lg": "skippr:size-10"
|
|
230
230
|
};
|
|
231
231
|
var Button = forwardRef(({ className, variant = "default", size = "default", ...props }, ref) => {
|
|
232
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ jsx("button", {
|
|
233
233
|
className: cn("skippr:inline-flex skippr:items-center skippr:justify-center skippr:gap-2 skippr:whitespace-nowrap skippr:rounded-md skippr:text-sm skippr:font-medium skippr:ring-offset-background skippr:transition-all skippr:focus-visible:outline-none skippr:focus-visible:ring-2 skippr:focus-visible:ring-ring skippr:focus-visible:ring-offset-2 skippr:disabled:pointer-events-none skippr:disabled:opacity-50 skippr:shrink-0 skippr:[&_svg]:pointer-events-none skippr:[&_svg:not([class*='size-'])]:size-4 skippr:[&_svg]:shrink-0", variantClasses[variant], sizeClasses[size], className),
|
|
234
234
|
ref,
|
|
235
235
|
...props
|
|
236
|
-
}
|
|
236
|
+
});
|
|
237
237
|
});
|
|
238
238
|
Button.displayName = "Button";
|
|
239
239
|
|
|
240
240
|
// src/components/ChatHeader.tsx
|
|
241
|
-
import {
|
|
241
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
242
242
|
function ChatHeader({ onClose }) {
|
|
243
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
244
244
|
className: "skippr:flex skippr:items-center skippr:gap-3 skippr:bg-primary skippr:px-4 skippr:py-3 skippr:text-primary-foreground",
|
|
245
245
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ jsx2("div", {
|
|
247
247
|
className: "skippr:flex skippr:size-6 skippr:items-center skippr:justify-center skippr:rounded-full skippr:bg-primary-foreground/20",
|
|
248
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ jsx2(Bot, {
|
|
249
249
|
className: "skippr:size-3.5 skippr:text-primary-foreground"
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/* @__PURE__ */
|
|
250
|
+
})
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ jsx2("div", {
|
|
253
253
|
className: "skippr:flex-1",
|
|
254
|
-
children: /* @__PURE__ */
|
|
254
|
+
children: /* @__PURE__ */ jsx2("p", {
|
|
255
255
|
className: "skippr:text-sm skippr:font-semibold skippr:leading-none",
|
|
256
256
|
children: "AI Agent"
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
/* @__PURE__ */
|
|
257
|
+
})
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ jsx2(Button, {
|
|
260
260
|
variant: "ghost",
|
|
261
261
|
size: "icon-xs",
|
|
262
262
|
onClick: onClose,
|
|
263
263
|
className: "skippr:text-primary-foreground skippr:hover:bg-primary-foreground/20 skippr:hover:text-primary-foreground",
|
|
264
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ jsx2(X, {
|
|
265
265
|
className: "skippr:size-4"
|
|
266
|
-
}
|
|
267
|
-
}
|
|
266
|
+
})
|
|
267
|
+
})
|
|
268
268
|
]
|
|
269
|
-
}
|
|
269
|
+
});
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
// src/components/MeetingControls.tsx
|
|
@@ -283,7 +283,7 @@ function formatTime(seconds) {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
// src/components/MeetingControls.tsx
|
|
286
|
-
import {
|
|
286
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
287
287
|
function MeetingControls({ onHangUp }) {
|
|
288
288
|
const { localParticipant } = useLocalParticipant2();
|
|
289
289
|
const isMuted = !localParticipant.isMicrophoneEnabled;
|
|
@@ -314,197 +314,197 @@ function MeetingControls({ onHangUp }) {
|
|
|
314
314
|
useEffect2(() => {
|
|
315
315
|
toggleMute().then(() => toggleScreenShare());
|
|
316
316
|
}, []);
|
|
317
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
318
318
|
className: "skippr:flex skippr:items-center skippr:justify-between skippr:border-b skippr:px-4 skippr:py-3",
|
|
319
319
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
321
321
|
className: "skippr:flex skippr:items-center skippr:gap-2",
|
|
322
322
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ jsx3(Button, {
|
|
324
324
|
size: "icon-sm",
|
|
325
325
|
variant: isMuted ? "destructive" : "outline",
|
|
326
326
|
onClick: toggleMute,
|
|
327
327
|
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
328
|
-
children: isMuted ? /* @__PURE__ */
|
|
328
|
+
children: isMuted ? /* @__PURE__ */ jsx3(MicOff, {
|
|
329
329
|
className: "skippr:size-4"
|
|
330
|
-
}
|
|
330
|
+
}) : /* @__PURE__ */ jsx3(Mic, {
|
|
331
331
|
className: "skippr:size-4"
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
/* @__PURE__ */
|
|
332
|
+
})
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ jsx3(Button, {
|
|
335
335
|
size: "icon-sm",
|
|
336
336
|
variant: isScreenSharing ? "default" : "outline",
|
|
337
337
|
onClick: toggleScreenShare,
|
|
338
338
|
"aria-label": isScreenSharing ? "Stop sharing" : "Share screen",
|
|
339
|
-
children: isScreenSharing ? /* @__PURE__ */
|
|
339
|
+
children: isScreenSharing ? /* @__PURE__ */ jsx3(MonitorOff, {
|
|
340
340
|
className: "skippr:size-4"
|
|
341
|
-
}
|
|
341
|
+
}) : /* @__PURE__ */ jsx3(Monitor, {
|
|
342
342
|
className: "skippr:size-4"
|
|
343
|
-
}
|
|
344
|
-
}
|
|
343
|
+
})
|
|
344
|
+
})
|
|
345
345
|
]
|
|
346
|
-
}
|
|
347
|
-
/* @__PURE__ */
|
|
346
|
+
}),
|
|
347
|
+
/* @__PURE__ */ jsx3("span", {
|
|
348
348
|
className: "skippr:text-sm skippr:font-medium skippr:tabular-nums skippr:text-muted-foreground",
|
|
349
349
|
children: formatTime(elapsed)
|
|
350
|
-
}
|
|
351
|
-
/* @__PURE__ */
|
|
350
|
+
}),
|
|
351
|
+
/* @__PURE__ */ jsx3(Button, {
|
|
352
352
|
size: "icon-sm",
|
|
353
353
|
variant: "destructive",
|
|
354
354
|
onClick: onHangUp,
|
|
355
355
|
"aria-label": "Hang up",
|
|
356
|
-
children: /* @__PURE__ */
|
|
356
|
+
children: /* @__PURE__ */ jsx3(PhoneOff, {
|
|
357
357
|
className: "skippr:size-4"
|
|
358
|
-
}
|
|
359
|
-
}
|
|
358
|
+
})
|
|
359
|
+
})
|
|
360
360
|
]
|
|
361
|
-
}
|
|
361
|
+
});
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
// src/components/MessageList.tsx
|
|
365
365
|
import { useCallback as useCallback5 } from "react";
|
|
366
366
|
|
|
367
367
|
// src/components/ChatMessage.tsx
|
|
368
|
-
import {
|
|
368
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
369
369
|
function ChatMessage({ message }) {
|
|
370
370
|
const isUser = message.role === "user";
|
|
371
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
372
372
|
className: cn("skippr:flex skippr:w-full skippr:px-4 skippr:py-1", isUser ? "skippr:justify-end" : "skippr:justify-start"),
|
|
373
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ jsx4("div", {
|
|
374
374
|
className: cn("skippr:max-w-[85%] skippr:whitespace-pre-wrap skippr:rounded-2xl skippr:px-4 skippr:py-2.5 skippr:text-sm skippr:leading-relaxed", isUser ? "skippr:rounded-br-sm skippr:bg-primary skippr:text-primary-foreground" : "skippr:rounded-bl-sm skippr:bg-muted skippr:text-foreground"),
|
|
375
375
|
children: message.content
|
|
376
|
-
}
|
|
377
|
-
}
|
|
376
|
+
})
|
|
377
|
+
});
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
// src/components/TypingIndicator.tsx
|
|
381
|
-
import {
|
|
381
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
382
382
|
function TypingIndicator() {
|
|
383
|
-
return /* @__PURE__ */
|
|
383
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
384
384
|
className: "skippr:flex skippr:items-center skippr:gap-1 skippr:px-4 skippr:py-3",
|
|
385
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ jsxs3("div", {
|
|
386
386
|
className: "skippr:flex skippr:items-center skippr:gap-1 skippr:rounded-2xl skippr:rounded-bl-sm skippr:bg-muted skippr:px-4 skippr:py-2.5",
|
|
387
387
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ jsx5("span", {
|
|
389
389
|
className: "skippr:size-1.5 skippr:animate-bounce skippr:rounded-full skippr:bg-muted-foreground/60 skippr:[animation-delay:0ms]"
|
|
390
|
-
}
|
|
391
|
-
/* @__PURE__ */
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ jsx5("span", {
|
|
392
392
|
className: "skippr:size-1.5 skippr:animate-bounce skippr:rounded-full skippr:bg-muted-foreground/60 skippr:[animation-delay:150ms]"
|
|
393
|
-
}
|
|
394
|
-
/* @__PURE__ */
|
|
393
|
+
}),
|
|
394
|
+
/* @__PURE__ */ jsx5("span", {
|
|
395
395
|
className: "skippr:size-1.5 skippr:animate-bounce skippr:rounded-full skippr:bg-muted-foreground/60 skippr:[animation-delay:300ms]"
|
|
396
|
-
}
|
|
396
|
+
})
|
|
397
397
|
]
|
|
398
|
-
}
|
|
399
|
-
}
|
|
398
|
+
})
|
|
399
|
+
});
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
// src/components/MessageList.tsx
|
|
403
|
-
import {
|
|
403
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
404
404
|
function MessageList({ messages, isStreaming }) {
|
|
405
405
|
const scrollRef = useCallback5((node) => {
|
|
406
406
|
node?.scrollIntoView({ behavior: "smooth" });
|
|
407
407
|
}, []);
|
|
408
408
|
const lastMessage = messages.length > 0 ? messages[messages.length - 1] : undefined;
|
|
409
409
|
const showTyping = isStreaming && lastMessage?.role === "assistant" && lastMessage.content === "";
|
|
410
|
-
return /* @__PURE__ */
|
|
410
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
411
411
|
className: "skippr:flex-1 skippr:overflow-y-auto",
|
|
412
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ jsxs4("div", {
|
|
413
413
|
className: "skippr:flex skippr:flex-col skippr:gap-1 skippr:py-3",
|
|
414
414
|
children: [
|
|
415
|
-
messages.map((message) => /* @__PURE__ */
|
|
415
|
+
messages.map((message) => /* @__PURE__ */ jsx6(ChatMessage, {
|
|
416
416
|
message
|
|
417
|
-
}, message.id
|
|
418
|
-
showTyping && /* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
417
|
+
}, message.id)),
|
|
418
|
+
showTyping && /* @__PURE__ */ jsx6(TypingIndicator, {}),
|
|
419
|
+
/* @__PURE__ */ jsx6("div", {
|
|
420
420
|
ref: scrollRef
|
|
421
|
-
}, `scroll-${messages.length}
|
|
421
|
+
}, `scroll-${messages.length}`)
|
|
422
422
|
]
|
|
423
|
-
}
|
|
424
|
-
}
|
|
423
|
+
})
|
|
424
|
+
});
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// src/components/QuickActions.tsx
|
|
428
428
|
import { Loader2, MessageCircleQuestion } from "lucide-react";
|
|
429
|
-
import {
|
|
429
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
430
430
|
function QuickActions({ onStartSession, isStarting, error }) {
|
|
431
|
-
return /* @__PURE__ */
|
|
431
|
+
return /* @__PURE__ */ jsxs5("div", {
|
|
432
432
|
className: "skippr:flex skippr:flex-1 skippr:flex-col skippr:items-center skippr:gap-6 skippr:overflow-y-auto skippr:px-4 skippr:py-4",
|
|
433
433
|
children: [
|
|
434
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ jsx7("p", {
|
|
435
435
|
className: "skippr:mb-1 skippr:text-sm skippr:text-muted-foreground",
|
|
436
436
|
children: "How can I help you today?"
|
|
437
|
-
}
|
|
438
|
-
/* @__PURE__ */
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ jsxs5(Button, {
|
|
439
439
|
variant: "outline",
|
|
440
440
|
className: "skippr:h-auto skippr:flex-col skippr:gap-1.5 skippr:whitespace-normal skippr:py-3 skippr:text-xs",
|
|
441
441
|
onClick: onStartSession,
|
|
442
442
|
disabled: isStarting,
|
|
443
443
|
children: [
|
|
444
|
-
isStarting ? /* @__PURE__ */
|
|
444
|
+
isStarting ? /* @__PURE__ */ jsx7(Loader2, {
|
|
445
445
|
className: "skippr:size-4 skippr:animate-spin skippr:text-primary"
|
|
446
|
-
}
|
|
446
|
+
}) : /* @__PURE__ */ jsx7(MessageCircleQuestion, {
|
|
447
447
|
className: "skippr:size-4 skippr:text-primary"
|
|
448
|
-
}
|
|
448
|
+
}),
|
|
449
449
|
isStarting ? "Starting..." : "Start Session"
|
|
450
450
|
]
|
|
451
|
-
}
|
|
452
|
-
error && /* @__PURE__ */
|
|
451
|
+
}),
|
|
452
|
+
error && /* @__PURE__ */ jsx7("p", {
|
|
453
453
|
className: "skippr:text-xs skippr:text-destructive",
|
|
454
454
|
children: error
|
|
455
|
-
}
|
|
455
|
+
})
|
|
456
456
|
]
|
|
457
|
-
}
|
|
457
|
+
});
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
// src/components/SessionAgenda.tsx
|
|
461
461
|
import { Check, Circle, Loader2 as Loader22 } from "lucide-react";
|
|
462
|
-
import {
|
|
462
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
463
463
|
function SessionAgenda({ phases, questions = [] }) {
|
|
464
464
|
if (phases.length === 0) {
|
|
465
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ jsxs6("div", {
|
|
466
466
|
className: "skippr:flex skippr:flex-col skippr:gap-3 skippr:p-4",
|
|
467
467
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ jsx8("h3", {
|
|
469
469
|
className: "skippr:text-sm skippr:font-semibold",
|
|
470
470
|
children: "Agenda"
|
|
471
|
-
}
|
|
472
|
-
/* @__PURE__ */
|
|
471
|
+
}),
|
|
472
|
+
/* @__PURE__ */ jsx8("p", {
|
|
473
473
|
className: "skippr:text-xs skippr:text-muted-foreground",
|
|
474
474
|
children: "Waiting for session..."
|
|
475
|
-
}
|
|
475
|
+
})
|
|
476
476
|
]
|
|
477
|
-
}
|
|
477
|
+
});
|
|
478
478
|
}
|
|
479
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ jsxs6("div", {
|
|
480
480
|
className: "skippr:flex skippr:flex-col skippr:gap-3 skippr:p-4",
|
|
481
481
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ jsx8("h3", {
|
|
483
483
|
className: "skippr:text-sm skippr:font-semibold",
|
|
484
484
|
children: "Agenda"
|
|
485
|
-
}
|
|
486
|
-
/* @__PURE__ */
|
|
485
|
+
}),
|
|
486
|
+
/* @__PURE__ */ jsx8("ul", {
|
|
487
487
|
className: "skippr:flex skippr:flex-col skippr:gap-2",
|
|
488
488
|
children: phases.map((phase) => {
|
|
489
489
|
const phaseQuestions = questions.filter((q) => q.phaseName === phase.name);
|
|
490
490
|
const answeredCount = phaseQuestions.filter((q) => q.status === "answered").length;
|
|
491
491
|
const totalCount = phaseQuestions.length;
|
|
492
|
-
return /* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ jsxs6("li", {
|
|
493
493
|
className: "skippr:flex skippr:flex-col skippr:gap-0.5",
|
|
494
494
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
496
496
|
className: "skippr:flex skippr:items-center skippr:gap-2 skippr:text-sm",
|
|
497
497
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ jsx8(PhaseIcon, {
|
|
499
499
|
status: phase.status
|
|
500
|
-
}
|
|
501
|
-
/* @__PURE__ */
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ jsx8("span", {
|
|
502
502
|
className: cn(phase.status === "completed" && "skippr:text-muted-foreground skippr:line-through", phase.status === "active" && "skippr:font-medium skippr:text-primary"),
|
|
503
503
|
children: phase.name
|
|
504
|
-
}
|
|
504
|
+
})
|
|
505
505
|
]
|
|
506
|
-
}
|
|
507
|
-
totalCount > 0 && /* @__PURE__ */
|
|
506
|
+
}),
|
|
507
|
+
totalCount > 0 && /* @__PURE__ */ jsxs6("span", {
|
|
508
508
|
className: "skippr:ml-6 skippr:text-xs skippr:text-muted-foreground",
|
|
509
509
|
children: [
|
|
510
510
|
answeredCount,
|
|
@@ -512,36 +512,36 @@ function SessionAgenda({ phases, questions = [] }) {
|
|
|
512
512
|
totalCount,
|
|
513
513
|
" answered"
|
|
514
514
|
]
|
|
515
|
-
}
|
|
515
|
+
})
|
|
516
516
|
]
|
|
517
|
-
}, phase.name
|
|
517
|
+
}, phase.name);
|
|
518
518
|
})
|
|
519
|
-
}
|
|
519
|
+
})
|
|
520
520
|
]
|
|
521
|
-
}
|
|
521
|
+
});
|
|
522
522
|
}
|
|
523
523
|
function PhaseIcon({ status }) {
|
|
524
524
|
if (status === "completed") {
|
|
525
|
-
return /* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ jsx8("div", {
|
|
526
526
|
className: "skippr:flex skippr:size-4 skippr:shrink-0 skippr:items-center skippr:justify-center skippr:rounded-full skippr:bg-primary",
|
|
527
|
-
children: /* @__PURE__ */
|
|
527
|
+
children: /* @__PURE__ */ jsx8(Check, {
|
|
528
528
|
className: "skippr:size-2.5 skippr:text-primary-foreground",
|
|
529
529
|
strokeWidth: 3
|
|
530
|
-
}
|
|
531
|
-
}
|
|
530
|
+
})
|
|
531
|
+
});
|
|
532
532
|
}
|
|
533
533
|
if (status === "active") {
|
|
534
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ jsx8(Loader22, {
|
|
535
535
|
className: "skippr:size-4 skippr:shrink-0 skippr:text-primary skippr:animate-spin"
|
|
536
|
-
}
|
|
536
|
+
});
|
|
537
537
|
}
|
|
538
|
-
return /* @__PURE__ */
|
|
538
|
+
return /* @__PURE__ */ jsx8(Circle, {
|
|
539
539
|
className: "skippr:size-4 skippr:shrink-0 skippr:text-muted-foreground"
|
|
540
|
-
}
|
|
540
|
+
});
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
// src/components/Sidebar.tsx
|
|
544
|
-
import {
|
|
544
|
+
import { jsx as jsx9, jsxs as jsxs7, Fragment } from "react/jsx-runtime";
|
|
545
545
|
function Sidebar() {
|
|
546
546
|
const { isConnected, isStarting, error, startSession, disconnect, isPanelOpen, closePanel } = useLiveAgent();
|
|
547
547
|
useEffect3(() => {
|
|
@@ -554,31 +554,31 @@ function Sidebar() {
|
|
|
554
554
|
document.body.style.transition = "";
|
|
555
555
|
};
|
|
556
556
|
}, []);
|
|
557
|
-
return /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ jsx9("div", {
|
|
558
558
|
className: cn("skippr:fixed skippr:top-0 skippr:right-0 skippr:h-full skippr:z-[9999]", "skippr:bg-background skippr:border-l skippr:border-border", "skippr:flex skippr:flex-col", "skippr:transition-all skippr:duration-300 skippr:ease-in-out skippr:overflow-hidden", !isPanelOpen && "skippr:w-0 skippr:border-l-0"),
|
|
559
559
|
style: { width: isPanelOpen ? SIDEBAR_WIDTH : undefined },
|
|
560
|
-
children: isConnected ? /* @__PURE__ */
|
|
560
|
+
children: isConnected ? /* @__PURE__ */ jsxs7(Fragment, {
|
|
561
561
|
children: [
|
|
562
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ jsx9(ChatHeader, {
|
|
563
563
|
onClose: closePanel
|
|
564
|
-
}
|
|
565
|
-
/* @__PURE__ */
|
|
564
|
+
}),
|
|
565
|
+
/* @__PURE__ */ jsx9(ConnectedContent, {
|
|
566
566
|
onDisconnect: disconnect
|
|
567
|
-
}
|
|
567
|
+
})
|
|
568
568
|
]
|
|
569
|
-
}
|
|
569
|
+
}) : /* @__PURE__ */ jsxs7(Fragment, {
|
|
570
570
|
children: [
|
|
571
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsx9(ChatHeader, {
|
|
572
572
|
onClose: closePanel
|
|
573
|
-
}
|
|
574
|
-
/* @__PURE__ */
|
|
573
|
+
}),
|
|
574
|
+
/* @__PURE__ */ jsx9(QuickActions, {
|
|
575
575
|
onStartSession: startSession,
|
|
576
576
|
isStarting,
|
|
577
577
|
error
|
|
578
|
-
}
|
|
578
|
+
})
|
|
579
579
|
]
|
|
580
|
-
}
|
|
581
|
-
}
|
|
580
|
+
})
|
|
581
|
+
});
|
|
582
582
|
}
|
|
583
583
|
function ConnectedContent({ onDisconnect }) {
|
|
584
584
|
const connectionState = useConnectionState();
|
|
@@ -587,66 +587,66 @@ function ConnectedContent({ onDisconnect }) {
|
|
|
587
587
|
const { phases } = usePhaseUpdates();
|
|
588
588
|
const { questions } = useQuestionUpdates();
|
|
589
589
|
if (!isConnected) {
|
|
590
|
-
return /* @__PURE__ */
|
|
590
|
+
return /* @__PURE__ */ jsx9("div", {
|
|
591
591
|
className: "skippr:flex skippr:flex-1 skippr:items-center skippr:justify-center",
|
|
592
|
-
children: /* @__PURE__ */
|
|
592
|
+
children: /* @__PURE__ */ jsx9("p", {
|
|
593
593
|
className: "skippr:text-sm skippr:text-muted-foreground",
|
|
594
594
|
children: "Connecting..."
|
|
595
|
-
}
|
|
596
|
-
}
|
|
595
|
+
})
|
|
596
|
+
});
|
|
597
597
|
}
|
|
598
598
|
const isAgentSpeaking = agentState === "speaking";
|
|
599
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ jsxs7(Fragment, {
|
|
600
600
|
children: [
|
|
601
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ jsx9(MeetingControls, {
|
|
602
602
|
onHangUp: onDisconnect
|
|
603
|
-
}
|
|
604
|
-
/* @__PURE__ */
|
|
603
|
+
}),
|
|
604
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
605
605
|
className: "skippr:flex skippr:min-h-0 skippr:flex-1",
|
|
606
606
|
children: [
|
|
607
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ jsx9("div", {
|
|
608
608
|
className: "skippr:w-[260px] skippr:shrink-0 skippr:overflow-y-auto skippr:border-r",
|
|
609
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ jsx9(SessionAgenda, {
|
|
610
610
|
phases,
|
|
611
611
|
questions
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
/* @__PURE__ */
|
|
612
|
+
})
|
|
613
|
+
}),
|
|
614
|
+
/* @__PURE__ */ jsx9("div", {
|
|
615
615
|
className: "skippr:flex skippr:min-w-0 skippr:flex-1 skippr:flex-col",
|
|
616
|
-
children: /* @__PURE__ */
|
|
616
|
+
children: /* @__PURE__ */ jsx9(MessageList, {
|
|
617
617
|
messages,
|
|
618
618
|
isStreaming: isAgentSpeaking
|
|
619
|
-
}
|
|
620
|
-
}
|
|
619
|
+
})
|
|
620
|
+
})
|
|
621
621
|
]
|
|
622
|
-
}
|
|
622
|
+
})
|
|
623
623
|
]
|
|
624
|
-
}
|
|
624
|
+
});
|
|
625
625
|
}
|
|
626
626
|
|
|
627
627
|
// src/components/SidebarTrigger.tsx
|
|
628
628
|
import { MessageCircle, X as X2 } from "lucide-react";
|
|
629
|
-
import {
|
|
629
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
630
630
|
var TRIGGER_GAP = 16;
|
|
631
631
|
var TRIGGER_DEFAULT_RIGHT = 24;
|
|
632
632
|
function SidebarTrigger() {
|
|
633
633
|
const { isPanelOpen, togglePanel } = useLiveAgent();
|
|
634
|
-
return /* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */ jsx10(Button, {
|
|
635
635
|
size: "icon-lg",
|
|
636
636
|
onClick: togglePanel,
|
|
637
637
|
className: "skippr:fixed skippr:bottom-6 skippr:z-[9998] skippr:size-14 skippr:rounded-full skippr:shadow-lg skippr:transition-all skippr:duration-300",
|
|
638
638
|
style: { right: isPanelOpen ? SIDEBAR_WIDTH + TRIGGER_GAP : TRIGGER_DEFAULT_RIGHT },
|
|
639
639
|
title: isPanelOpen ? "Close chat" : "Chat with us",
|
|
640
|
-
children: isPanelOpen ? /* @__PURE__ */
|
|
640
|
+
children: isPanelOpen ? /* @__PURE__ */ jsx10(X2, {
|
|
641
641
|
className: "skippr:size-6"
|
|
642
|
-
}
|
|
642
|
+
}) : /* @__PURE__ */ jsx10(MessageCircle, {
|
|
643
643
|
className: "skippr:size-6"
|
|
644
|
-
}
|
|
645
|
-
}
|
|
644
|
+
})
|
|
645
|
+
});
|
|
646
646
|
}
|
|
647
647
|
|
|
648
648
|
// src/components/LiveAgent.tsx
|
|
649
|
-
import {
|
|
649
|
+
import { jsx as jsx11, jsxs as jsxs8, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
650
650
|
function LiveAgent({
|
|
651
651
|
organizationId,
|
|
652
652
|
agentId,
|
|
@@ -687,25 +687,25 @@ function LiveAgent({
|
|
|
687
687
|
closePanel,
|
|
688
688
|
togglePanel
|
|
689
689
|
]);
|
|
690
|
-
const widgetContent = /* @__PURE__ */
|
|
690
|
+
const widgetContent = /* @__PURE__ */ jsxs8(Fragment2, {
|
|
691
691
|
children: [
|
|
692
|
-
connection && /* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
692
|
+
connection && /* @__PURE__ */ jsx11(RoomAudioRenderer, {}),
|
|
693
|
+
/* @__PURE__ */ jsx11(SidebarTrigger, {}),
|
|
694
|
+
/* @__PURE__ */ jsx11(Sidebar, {}),
|
|
695
695
|
children
|
|
696
696
|
]
|
|
697
|
-
}
|
|
698
|
-
return /* @__PURE__ */
|
|
697
|
+
});
|
|
698
|
+
return /* @__PURE__ */ jsx11(LiveAgentContext.Provider, {
|
|
699
699
|
value: ctx,
|
|
700
|
-
children: connection ? /* @__PURE__ */
|
|
700
|
+
children: connection ? /* @__PURE__ */ jsx11(LiveKitRoom, {
|
|
701
701
|
serverUrl: connection.livekitUrl,
|
|
702
702
|
token: connection.token,
|
|
703
703
|
connect: shouldConnect,
|
|
704
704
|
audio: true,
|
|
705
705
|
onDisconnected: disconnect,
|
|
706
706
|
children: widgetContent
|
|
707
|
-
}
|
|
708
|
-
}
|
|
707
|
+
}) : widgetContent
|
|
708
|
+
});
|
|
709
709
|
}
|
|
710
710
|
export {
|
|
711
711
|
useLiveAgent,
|