@skippr/live-agent-sdk 0.98.0 → 0.99.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
CHANGED
|
@@ -3146,6 +3146,7 @@ function useSessionHold({
|
|
|
3146
3146
|
const [countdown, setCountdown] = useState9(timeoutSeconds);
|
|
3147
3147
|
const screenWasSharedBeforeHoldRef = useRef11(false);
|
|
3148
3148
|
const holdTransitionInFlightRef = useRef11(false);
|
|
3149
|
+
const clearPausedCaptureRef = useRef11(null);
|
|
3149
3150
|
const publish = useCallback10(async (type) => {
|
|
3150
3151
|
await localParticipant.publishData(textEncoder2.encode(JSON.stringify({ type })), {
|
|
3151
3152
|
reliable: true,
|
|
@@ -3192,6 +3193,7 @@ function useSessionHold({
|
|
|
3192
3193
|
try {
|
|
3193
3194
|
await localParticipant.setMicrophoneEnabled(true);
|
|
3194
3195
|
await resumeScreenShareOnResume();
|
|
3196
|
+
clearPausedCaptureRef.current?.();
|
|
3195
3197
|
await publish("resume");
|
|
3196
3198
|
setIsHeld(false);
|
|
3197
3199
|
} catch (error) {
|
|
@@ -3223,7 +3225,7 @@ function useSessionHold({
|
|
|
3223
3225
|
holdTransitionInFlightRef.current = false;
|
|
3224
3226
|
});
|
|
3225
3227
|
}, [isHeld, hold, release]);
|
|
3226
|
-
return { isHeld, countdown, toggle };
|
|
3228
|
+
return { isHeld, countdown, toggle, clearPausedCaptureRef };
|
|
3227
3229
|
}
|
|
3228
3230
|
|
|
3229
3231
|
// src/context/SessionHoldContext.tsx
|
|
@@ -3231,7 +3233,8 @@ import { jsx as jsx13 } from "react/jsx-runtime";
|
|
|
3231
3233
|
var SessionHoldContext = createContext3({
|
|
3232
3234
|
isHeld: false,
|
|
3233
3235
|
countdown: 0,
|
|
3234
|
-
toggle: () => {}
|
|
3236
|
+
toggle: () => {},
|
|
3237
|
+
clearPausedCaptureRef: { current: null }
|
|
3235
3238
|
});
|
|
3236
3239
|
function SessionHoldProvider({ children }) {
|
|
3237
3240
|
const { pauseSession } = useLiveAgent();
|
|
@@ -6036,7 +6039,7 @@ async function unpublishAndStopTrack(localParticipant, videoTrack) {
|
|
|
6036
6039
|
function DomCapture({ pushOrTapMicMode = false }) {
|
|
6037
6040
|
const { localParticipant } = useLocalParticipant5();
|
|
6038
6041
|
const connectionState = useConnectionState2();
|
|
6039
|
-
const { isHeld } = useSessionHoldContext();
|
|
6042
|
+
const { isHeld, clearPausedCaptureRef } = useSessionHoldContext();
|
|
6040
6043
|
const accentColor = useContext9(LiveAgentContext)?.appearance?.accentColor ?? null;
|
|
6041
6044
|
const brand = useMemo4(() => resolveBrandPalette(accentColor), [accentColor]);
|
|
6042
6045
|
const brandRef = useRef17(brand);
|
|
@@ -6250,16 +6253,22 @@ function DomCapture({ pushOrTapMicMode = false }) {
|
|
|
6250
6253
|
pausedRef.current = true;
|
|
6251
6254
|
drawPausedOverlay(canvas, ctx);
|
|
6252
6255
|
};
|
|
6253
|
-
|
|
6256
|
+
const repaintCleanFrameFromCachedPage = () => {
|
|
6254
6257
|
pausedRef.current = false;
|
|
6258
|
+
compositePageAndCursorOverlay(ctx, canvas, cachedPage, brandRef.current);
|
|
6259
|
+
};
|
|
6260
|
+
resumeCaptureRef.current = () => {
|
|
6261
|
+
repaintCleanFrameFromCachedPage();
|
|
6255
6262
|
tickA11yPublish();
|
|
6256
6263
|
refreshPageAndComposite();
|
|
6257
6264
|
};
|
|
6265
|
+
clearPausedCaptureRef.current = repaintCleanFrameFromCachedPage;
|
|
6258
6266
|
return () => {
|
|
6259
6267
|
cancelled = true;
|
|
6260
6268
|
didStartRef.current = false;
|
|
6261
6269
|
freezeCaptureRef.current = null;
|
|
6262
6270
|
resumeCaptureRef.current = null;
|
|
6271
|
+
clearPausedCaptureRef.current = null;
|
|
6263
6272
|
if (snapshotTimer)
|
|
6264
6273
|
clearTimeout(snapshotTimer);
|
|
6265
6274
|
if (scrollSettleTimer)
|
|
@@ -6275,7 +6284,7 @@ function DomCapture({ pushOrTapMicMode = false }) {
|
|
|
6275
6284
|
for (const track of canvasStream.getTracks())
|
|
6276
6285
|
track.stop();
|
|
6277
6286
|
};
|
|
6278
|
-
}, [connectionState, localParticipant, pushOrTapMicMode]);
|
|
6287
|
+
}, [connectionState, localParticipant, pushOrTapMicMode, clearPausedCaptureRef]);
|
|
6279
6288
|
useEffect22(() => {
|
|
6280
6289
|
if (isHeld) {
|
|
6281
6290
|
freezeCaptureRef.current?.();
|