@akhilpulse/samadhaan-session-replay 0.6.6 → 0.6.7
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/package.json +1 -1
- package/src/SessionReplayProvider.tsx +1 -1
- package/src/voice.ts +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akhilpulse/samadhaan-session-replay",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "React Native SDK for Samadhaan Guided Support — session recording, live remote screen-share, take-control, guided-tour overlays, and Shake-to-Assist AI voice guide.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -56,7 +56,7 @@ let pixelCopyDisabled = false; // turned true after repeated runtime failures to
|
|
|
56
56
|
let pixelCopyFailStreak = 0; // consecutive non-busy failures; resets on success
|
|
57
57
|
|
|
58
58
|
const STORAGE_KEY = "@akhilpulse/samadhaan-session-replay/sessionId";
|
|
59
|
-
const SDK_VERSION = "0.6.
|
|
59
|
+
const SDK_VERSION = "0.6.7";
|
|
60
60
|
|
|
61
61
|
// ---- Module-level session singleton --------------------------------------
|
|
62
62
|
// Multiple SessionReplayProvider mounts (intentional or via React StrictMode's
|
package/src/voice.ts
CHANGED
|
@@ -23,11 +23,26 @@
|
|
|
23
23
|
|
|
24
24
|
import { NativeModules, PermissionsAndroid, Platform } from "react-native";
|
|
25
25
|
|
|
26
|
+
type OptionalModuleName = "react-native-shake" | "react-native-live-audio-stream";
|
|
27
|
+
|
|
26
28
|
// Loads an optional native module without crashing Metro when it's absent.
|
|
27
|
-
|
|
29
|
+
// NOTE: `require()` must be called with a static string literal — Metro's
|
|
30
|
+
// bundler cannot resolve `require(someVariable)` (it throws "Dynamic require
|
|
31
|
+
// ... not supported by Metro" at runtime, every time, regardless of whether
|
|
32
|
+
// the package is actually installed). A switch over literal require() calls
|
|
33
|
+
// keeps each one statically analyzable.
|
|
34
|
+
function loadOptional<T = any>(name: OptionalModuleName): T | null {
|
|
28
35
|
try {
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
switch (name) {
|
|
37
|
+
case "react-native-shake":
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires, global-require
|
|
39
|
+
return require("react-native-shake") as T;
|
|
40
|
+
case "react-native-live-audio-stream":
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires, global-require
|
|
42
|
+
return require("react-native-live-audio-stream") as T;
|
|
43
|
+
default:
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
31
46
|
} catch {
|
|
32
47
|
return null;
|
|
33
48
|
}
|