@skippr/live-agent-sdk 0.41.0 → 0.42.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 +8 -14
- package/dist/skippr-sdk.js +81 -81
- package/package.json +1 -1
- package/dist/types/lib/react-compat.d.ts +0 -26
package/dist/esm/lib-exports.js
CHANGED
|
@@ -2037,16 +2037,10 @@ function HighlightOverlay() {
|
|
|
2037
2037
|
// src/components/MinimizedBubble.tsx
|
|
2038
2038
|
import { useEffect as useEffect7 } from "react";
|
|
2039
2039
|
|
|
2040
|
-
// src/lib/react-compat.ts
|
|
2041
|
-
import * as React from "react";
|
|
2042
|
-
function selectContextHook(use2, useContext3) {
|
|
2043
|
-
return use2 ?? useContext3;
|
|
2044
|
-
}
|
|
2045
|
-
var useContextValue = selectContextHook(React.use, React.useContext);
|
|
2046
|
-
|
|
2047
2040
|
// src/hooks/useLiveAgent.ts
|
|
2041
|
+
import { useContext as useContext2 } from "react";
|
|
2048
2042
|
function useLiveAgent() {
|
|
2049
|
-
const ctx =
|
|
2043
|
+
const ctx = useContext2(LiveAgentContext);
|
|
2050
2044
|
if (!ctx) {
|
|
2051
2045
|
throw new Error("useLiveAgent must be used within a <LiveAgent> provider");
|
|
2052
2046
|
}
|
|
@@ -2515,10 +2509,10 @@ function ShadowHost({ children }) {
|
|
|
2515
2509
|
}
|
|
2516
2510
|
|
|
2517
2511
|
// src/components/Sidebar.tsx
|
|
2518
|
-
import { useEffect as useEffect16 } from "react";
|
|
2512
|
+
import { useContext as useContext5, useEffect as useEffect16 } from "react";
|
|
2519
2513
|
|
|
2520
2514
|
// src/hooks/useCombinedMessages.ts
|
|
2521
|
-
import { useMemo as useMemo4 } from "react";
|
|
2515
|
+
import { useContext as useContext3, useMemo as useMemo4 } from "react";
|
|
2522
2516
|
|
|
2523
2517
|
// src/hooks/useChatMessages.ts
|
|
2524
2518
|
import { useChat, useLocalParticipant as useLocalParticipant4 } from "@livekit/components-react/hooks";
|
|
@@ -2586,7 +2580,7 @@ function useCombinedMessages() {
|
|
|
2586
2580
|
const { transcriptMessages } = useStreamingTranscript();
|
|
2587
2581
|
const { chatMessages, sendChatMessage, isSendingChat } = useChatMessages();
|
|
2588
2582
|
const { state: agentState } = useAgentVoiceState();
|
|
2589
|
-
const historyMessages =
|
|
2583
|
+
const historyMessages = useContext3(LiveAgentContext)?.historyMessages ?? [];
|
|
2590
2584
|
const liveMessages = useMemo4(() => {
|
|
2591
2585
|
if (chatMessages.length === 0)
|
|
2592
2586
|
return transcriptMessages;
|
|
@@ -2604,7 +2598,7 @@ function useCombinedMessages() {
|
|
|
2604
2598
|
}
|
|
2605
2599
|
|
|
2606
2600
|
// src/hooks/usePhaseUpdates.ts
|
|
2607
|
-
import { useCallback as useCallback6, useEffect as useEffect9 } from "react";
|
|
2601
|
+
import { useCallback as useCallback6, useContext as useContext4, useEffect as useEffect9 } from "react";
|
|
2608
2602
|
|
|
2609
2603
|
// src/hooks/useAgentState.ts
|
|
2610
2604
|
import { useRemoteParticipants } from "@livekit/components-react/hooks";
|
|
@@ -2660,7 +2654,7 @@ function parsePhases(json) {
|
|
|
2660
2654
|
function usePhaseUpdates() {
|
|
2661
2655
|
const parse = useCallback6(parsePhases, []);
|
|
2662
2656
|
const livePhases = useAgentState("phases", parse, []);
|
|
2663
|
-
const ctx =
|
|
2657
|
+
const ctx = useContext4(LiveAgentContext);
|
|
2664
2658
|
useEffect9(() => {
|
|
2665
2659
|
if (livePhases.length > 0)
|
|
2666
2660
|
ctx?.setPhasesSnapshot(livePhases);
|
|
@@ -3694,7 +3688,7 @@ function Sidebar({
|
|
|
3694
3688
|
agentMode,
|
|
3695
3689
|
agentControls
|
|
3696
3690
|
} = useLiveAgent();
|
|
3697
|
-
const internalCtx =
|
|
3691
|
+
const internalCtx = useContext5(LiveAgentContext);
|
|
3698
3692
|
const usesHostAuth = internalCtx?.usesHostAuth ?? false;
|
|
3699
3693
|
const authFailed = internalCtx?.authFailed ?? false;
|
|
3700
3694
|
const showAgenda = agentMode !== AGENT_MODE.AlwaysOn;
|