@akhilpulse/samadhaan-session-replay 0.6.5 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akhilpulse/samadhaan-session-replay",
3
- "version": "0.6.5",
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.5";
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
@@ -890,8 +890,11 @@ export function SessionReplayProvider({ config, children }: { config: Config; ch
890
890
  ))}
891
891
  </View>
892
892
  <View style={styles.assistStatusRow} pointerEvents="box-none">
893
- <VoiceWave phase={assistantPhase} />
894
- <Text style={styles.assistStatusText} numberOfLines={1}>
893
+ {/* Wave + text are display-only: pass touches through to the app. */}
894
+ <View pointerEvents="none">
895
+ <VoiceWave phase={assistantPhase} />
896
+ </View>
897
+ <Text style={styles.assistStatusText} numberOfLines={1} pointerEvents="none">
895
898
  {assistantStatusLabel(assistantPhase, assistMicStatus)}
896
899
  </Text>
897
900
  <Pressable
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
- function loadOptional<T = any>(name: string): T | null {
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
- // eslint-disable-next-line @typescript-eslint/no-var-requires, global-require
30
- return require(name) as T;
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
  }