@revrag-ai/embed-react-native 1.0.31 → 1.0.32

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.
Files changed (79) hide show
  1. package/dist/commonjs/api/api.js +49 -21
  2. package/dist/commonjs/api/api.js.map +1 -1
  3. package/dist/commonjs/components/DynamicComponent/Typewriter.js +6 -5
  4. package/dist/commonjs/components/DynamicComponent/Typewriter.js.map +1 -1
  5. package/dist/commonjs/components/Embed/EmbedAudioWave.js +87 -130
  6. package/dist/commonjs/components/Embed/EmbedAudioWave.js.map +1 -1
  7. package/dist/commonjs/components/Embed/EmbedButton.js +166 -66
  8. package/dist/commonjs/components/Embed/EmbedButton.js.map +1 -1
  9. package/dist/commonjs/components/styles/EmbedButton.style.js +25 -22
  10. package/dist/commonjs/components/styles/EmbedButton.style.js.map +1 -1
  11. package/dist/commonjs/context/EmbedProvider.js +5 -10
  12. package/dist/commonjs/context/EmbedProvider.js.map +1 -1
  13. package/dist/commonjs/events/clickEventTracker.js +15 -4
  14. package/dist/commonjs/events/clickEventTracker.js.map +1 -1
  15. package/dist/commonjs/events/embed.event.js +18 -7
  16. package/dist/commonjs/events/embed.event.js.map +1 -1
  17. package/dist/commonjs/hooks/EmbedButton.animations.js +6 -6
  18. package/dist/commonjs/hooks/EmbedButton.animations.js.map +1 -1
  19. package/dist/commonjs/hooks/EmbedButton.helpers.js +37 -1
  20. package/dist/commonjs/hooks/EmbedButton.helpers.js.map +1 -1
  21. package/dist/commonjs/hooks/initialize.js +10 -0
  22. package/dist/commonjs/hooks/initialize.js.map +1 -1
  23. package/dist/commonjs/hooks/voiceagent.js +41 -24
  24. package/dist/commonjs/hooks/voiceagent.js.map +1 -1
  25. package/dist/commonjs/store/store.key.js +22 -4
  26. package/dist/commonjs/store/store.key.js.map +1 -1
  27. package/dist/commonjs/utils/constant.js +1 -1
  28. package/dist/commonjs/utils/permision.js +1 -1
  29. package/dist/commonjs/utils/permision.js.map +1 -1
  30. package/dist/module/api/api.js +49 -21
  31. package/dist/module/api/api.js.map +1 -1
  32. package/dist/module/components/DynamicComponent/Typewriter.js +6 -5
  33. package/dist/module/components/DynamicComponent/Typewriter.js.map +1 -1
  34. package/dist/module/components/Embed/EmbedAudioWave.js +88 -132
  35. package/dist/module/components/Embed/EmbedAudioWave.js.map +1 -1
  36. package/dist/module/components/Embed/EmbedButton.js +171 -71
  37. package/dist/module/components/Embed/EmbedButton.js.map +1 -1
  38. package/dist/module/components/styles/EmbedButton.style.js +25 -22
  39. package/dist/module/components/styles/EmbedButton.style.js.map +1 -1
  40. package/dist/module/context/EmbedProvider.js +5 -10
  41. package/dist/module/context/EmbedProvider.js.map +1 -1
  42. package/dist/module/events/clickEventTracker.js +15 -4
  43. package/dist/module/events/clickEventTracker.js.map +1 -1
  44. package/dist/module/events/embed.event.js +18 -7
  45. package/dist/module/events/embed.event.js.map +1 -1
  46. package/dist/module/hooks/EmbedButton.animations.js +5 -6
  47. package/dist/module/hooks/EmbedButton.animations.js.map +1 -1
  48. package/dist/module/hooks/EmbedButton.helpers.js +35 -0
  49. package/dist/module/hooks/EmbedButton.helpers.js.map +1 -1
  50. package/dist/module/hooks/initialize.js +10 -0
  51. package/dist/module/hooks/initialize.js.map +1 -1
  52. package/dist/module/hooks/voiceagent.js +41 -24
  53. package/dist/module/hooks/voiceagent.js.map +1 -1
  54. package/dist/module/store/store.key.js +20 -3
  55. package/dist/module/store/store.key.js.map +1 -1
  56. package/dist/module/utils/constant.js +1 -1
  57. package/dist/module/utils/permision.js +1 -1
  58. package/dist/module/utils/permision.js.map +1 -1
  59. package/dist/typescript/src/api/api.d.ts.map +1 -1
  60. package/dist/typescript/src/components/DynamicComponent/Typewriter.d.ts.map +1 -1
  61. package/dist/typescript/src/components/Embed/EmbedAudioWave.d.ts +11 -1
  62. package/dist/typescript/src/components/Embed/EmbedAudioWave.d.ts.map +1 -1
  63. package/dist/typescript/src/components/Embed/EmbedButton.d.ts.map +1 -1
  64. package/dist/typescript/src/components/styles/EmbedButton.style.d.ts +2 -0
  65. package/dist/typescript/src/components/styles/EmbedButton.style.d.ts.map +1 -1
  66. package/dist/typescript/src/context/EmbedProvider.d.ts.map +1 -1
  67. package/dist/typescript/src/events/clickEventTracker.d.ts.map +1 -1
  68. package/dist/typescript/src/events/embed.event.d.ts +4 -0
  69. package/dist/typescript/src/events/embed.event.d.ts.map +1 -1
  70. package/dist/typescript/src/hooks/EmbedButton.animations.d.ts +3 -3
  71. package/dist/typescript/src/hooks/EmbedButton.animations.d.ts.map +1 -1
  72. package/dist/typescript/src/hooks/EmbedButton.helpers.d.ts +5 -4
  73. package/dist/typescript/src/hooks/EmbedButton.helpers.d.ts.map +1 -1
  74. package/dist/typescript/src/hooks/initialize.d.ts.map +1 -1
  75. package/dist/typescript/src/hooks/voiceagent.d.ts.map +1 -1
  76. package/dist/typescript/src/store/store.key.d.ts +2 -0
  77. package/dist/typescript/src/store/store.key.d.ts.map +1 -1
  78. package/dist/typescript/src/utils/constant.d.ts +1 -1
  79. package/package.json +1 -1
@@ -1,149 +1,110 @@
1
1
  "use strict";
2
2
 
3
- // This module defines a custom hook for generating and animating a waveform visualization
4
- // based on the audio activity in a LiveKit room. It uses the LiveKit SDK to track
5
- // audio levels and update the waveform accordingly. The hook provides a set of animated
6
- // values that can be used to render the waveform in a React Native component.
7
-
8
- // The hook takes a room reference as an input and uses it to track the audio activity
9
- // of the remote participants in the room. It checks the audio level of each participant
10
- // and updates the waveform accordingly. The hook also handles the animation of the waveform
11
- // by updating the heights of the bars based on the audio activity.
12
-
13
- import { useEffect, useRef, useState } from 'react';
14
- import { View, Animated, StyleSheet } from 'react-native';
3
+ /**
4
+ * EmbedAudioWave Waveform visualizer for the voice agent.
5
+ *
6
+ * Replaced the original implementation which used two JS-thread setInterval loops
7
+ * and useNativeDriver:false (causing jank on iOS physical devices) with:
8
+ * - A single 500ms interval that only writes to a Reanimated shared value
9
+ * (no React state updates, no re-renders from audio polling)
10
+ * - Per-bar Reanimated useAnimatedStyle running on the UI thread (no JS thread animation)
11
+ */
12
+
13
+ import { useEffect, useRef } from 'react';
14
+ import { StyleSheet, View } from 'react-native';
15
+ import Animated, { cancelAnimation, useAnimatedStyle, useSharedValue, withRepeat, withSequence, withTiming } from 'react-native-reanimated';
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
- // React Native compatible waveform simulator
17
- const useReactNativeAudioWaveform = roomRef => {
18
- const [isAudioActive, setIsAudioActive] = useState(false);
17
+ const BAR_COUNT = 10;
18
+
19
+ // Max height (px) for each bar — edge bars are shorter for a natural wave shape
20
+ const BAR_MAX_HEIGHTS = [6, 10, 16, 22, 25, 22, 16, 10, 6, 4];
21
+
22
+ // Phase offset per bar so bars animate at staggered times (creates wave effect)
23
+ const BAR_PHASE_OFFSETS = [0, 60, 120, 180, 240, 180, 120, 60, 0, 30];
24
+ const AnimatedBar = ({
25
+ waveProgress,
26
+ isActive,
27
+ maxHeight,
28
+ phaseOffset,
29
+ isEdge
30
+ }) => {
31
+ const barStyle = useAnimatedStyle(() => {
32
+ 'worklet';
33
+
34
+ if (!isActive.value) {
35
+ return {
36
+ height: 2
37
+ };
38
+ }
39
+ // Compute a sine-wave height from the shared progress value + per-bar phase offset
40
+ const phase = (waveProgress.value + phaseOffset) % 1000 / 1000;
41
+ const height = Math.max(2, Math.abs(Math.sin(phase * Math.PI * 2)) * maxHeight);
42
+ return {
43
+ height
44
+ };
45
+ });
46
+ return /*#__PURE__*/_jsx(Animated.View, {
47
+ style: [styles.bar, isEdge ? styles.barEdge : styles.barCenter, barStyle]
48
+ });
49
+ };
50
+ export const WaveformVisualizer = ({
51
+ roomRef
52
+ }) => {
53
+ // Shared values live on the UI thread — no React re-renders needed
54
+ const isActive = useSharedValue(false);
55
+ const waveProgress = useSharedValue(0);
56
+ const lastActiveState = useRef(false);
19
57
  const intervalRef = useRef(null);
20
- const [currentHeights, setCurrentHeights] = useState(Array(10).fill(0));
21
-
22
- // Create animated values for each bar
23
- const barCount = 10;
24
- const animatedBars = useRef(Array(barCount).fill(0).map(() => new Animated.Value(0))).current;
25
58
  useEffect(() => {
26
- // Check if there's an active room connection AND if agent is talking
27
59
  const checkAudioActivity = () => {
28
60
  const room = roomRef.current;
29
- if (room?.state !== 'connected') {
30
- setIsAudioActive(false);
31
- return;
32
- }
33
-
34
- // Check if any remote participant is currently speaking
35
- let isAgentSpeaking = false;
36
-
37
- // Loop through all remote participants
38
- room.remoteParticipants.forEach(participant => {
39
- const audioTrackPublications = Array.from(participant.getTrackPublications().values());
40
- const remoteAudioTrack = audioTrackPublications.find(pub => pub.track?.kind === 'audio');
41
-
42
- // Check if this participant has audio track, is not muted, and is actively speaking
43
- if (remoteAudioTrack?.track && !remoteAudioTrack?.isMuted) {
44
- // Check audio level to detect actual speech (optional but more accurate)
61
+ let speaking = false;
62
+ if (room?.state === 'connected') {
63
+ room.remoteParticipants.forEach(participant => {
45
64
  const audioLevel = participant.audioLevel || 0;
46
- if (audioLevel > 0.05) {
47
- // Threshold for detecting speech
48
- isAgentSpeaking = true;
65
+ if (audioLevel > 0.05 || participant.isSpeaking) {
66
+ speaking = true;
49
67
  }
50
- }
51
- });
52
- setIsAudioActive(isAgentSpeaking);
68
+ });
69
+ }
70
+ if (speaking === lastActiveState.current) return;
71
+ lastActiveState.current = speaking;
72
+ if (speaking) {
73
+ isActive.value = true;
74
+ // Run the wave progress counter continuously on the UI thread
75
+ waveProgress.value = withRepeat(withSequence(withTiming(1000, {
76
+ duration: 1200
77
+ }), withTiming(0, {
78
+ duration: 0
79
+ })), -1, false);
80
+ } else {
81
+ isActive.value = false;
82
+ cancelAnimation(waveProgress);
83
+ waveProgress.value = withTiming(0, {
84
+ duration: 400
85
+ });
86
+ }
53
87
  };
54
-
55
- // Initial check
56
88
  checkAudioActivity();
57
-
58
- // Set up periodic checking for room state changes
59
89
  intervalRef.current = setInterval(checkAudioActivity, 500);
60
-
61
- // Clean up on unmount
62
90
  return () => {
63
91
  if (intervalRef.current) {
64
92
  clearInterval(intervalRef.current);
65
93
  intervalRef.current = null;
66
94
  }
67
- setIsAudioActive(false);
68
- };
69
- }, [roomRef]);
70
-
71
- // Continuous smooth animation
72
- useEffect(() => {
73
- const animateWaveform = () => {
74
- // Generate smooth waveform data - stop animation completely when not active
75
- const targetHeights = isAudioActive ? Array(barCount).fill(0).map((_, index) => {
76
- const timeOffset = Date.now() / 800 + index * 0.3;
77
- const baseHeight = 0.5;
78
- const amplitude = 0.5;
79
- const height = baseHeight + amplitude * Math.abs(Math.sin(timeOffset));
80
- return Math.max(0.1, Math.min(1.0, height));
81
- }) : Array(barCount).fill(0); // Completely freeze animation when mic is muted
82
-
83
- // Update current heights for conditional logic
84
- setCurrentHeights(targetHeights);
85
- const animations = animatedBars.map((animatedValue, index) => {
86
- const targetHeight = targetHeights[index] || 0;
87
- return Animated.timing(animatedValue, {
88
- toValue: targetHeight,
89
- duration: isAudioActive ? 400 : 600,
90
- // Slower fade out when going inactive
91
- useNativeDriver: false
92
- });
93
- });
94
- Animated.parallel(animations).start();
95
+ cancelAnimation(waveProgress);
96
+ isActive.value = false;
95
97
  };
96
-
97
- // Start animation immediately and repeat
98
- animateWaveform();
99
- const animationInterval = setInterval(animateWaveform, 300);
100
- return () => {
101
- clearInterval(animationInterval);
102
- };
103
- }, [isAudioActive, animatedBars]);
104
- return {
105
- animatedBars,
106
- currentHeights,
107
- isActive: isAudioActive
108
- };
109
- };
110
- export const WaveformVisualizer = ({
111
- roomRef
112
- }) => {
113
- const {
114
- animatedBars,
115
- currentHeights
116
- } = useReactNativeAudioWaveform(roomRef);
98
+ }, [roomRef, isActive, waveProgress]);
117
99
  return /*#__PURE__*/_jsx(View, {
118
100
  style: styles.container,
119
- children: animatedBars.map((animatedHeight, idx) => {
120
- // Use the tracked height values instead of trying to access animated value directly
121
- const currentHeightValue = currentHeights[idx] || 0.1;
122
-
123
- // Apply conditional logic based on height
124
- let conditionalValue;
125
- if (currentHeightValue > 0.7) {
126
- conditionalValue = 1;
127
- } else if (currentHeightValue >= 0.4 && currentHeightValue <= 0.5) {
128
- conditionalValue = 5;
129
- } else {
130
- conditionalValue = 1;
131
- }
132
-
133
- // Determine bar style based on position
134
- const isEdgeBar = idx <= 1 || idx >= 8;
135
- const barStyle = [styles.bar, conditionalValue === 10 ? styles.barWide : styles.barNormal, isEdgeBar ? styles.barEdge : styles.barCenter];
136
-
137
- // You can use conditionalValue for width, color, or other properties
138
- return /*#__PURE__*/_jsx(Animated.View, {
139
- style: [barStyle, {
140
- height: animatedHeight.interpolate({
141
- inputRange: [0, 1],
142
- outputRange: [0, 25]
143
- })
144
- }]
145
- }, idx);
146
- })
101
+ children: BAR_MAX_HEIGHTS.map((maxH, idx) => /*#__PURE__*/_jsx(AnimatedBar, {
102
+ waveProgress: waveProgress,
103
+ isActive: isActive,
104
+ maxHeight: maxH,
105
+ phaseOffset: BAR_PHASE_OFFSETS[idx] ?? 0,
106
+ isEdge: idx <= 1 || idx >= BAR_COUNT - 2
107
+ }, idx))
147
108
  });
148
109
  };
149
110
  const styles = StyleSheet.create({
@@ -158,12 +119,7 @@ const styles = StyleSheet.create({
158
119
  bar: {
159
120
  borderRadius: 100,
160
121
  alignSelf: 'center',
161
- margin: 1.5
162
- },
163
- barNormal: {
164
- width: 4
165
- },
166
- barWide: {
122
+ margin: 1.5,
167
123
  width: 4
168
124
  },
169
125
  barEdge: {
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","useState","View","Animated","StyleSheet","jsx","_jsx","useReactNativeAudioWaveform","roomRef","isAudioActive","setIsAudioActive","intervalRef","currentHeights","setCurrentHeights","Array","fill","barCount","animatedBars","map","Value","current","checkAudioActivity","room","state","isAgentSpeaking","remoteParticipants","forEach","participant","audioTrackPublications","from","getTrackPublications","values","remoteAudioTrack","find","pub","track","kind","isMuted","audioLevel","setInterval","clearInterval","animateWaveform","targetHeights","_","index","timeOffset","Date","now","baseHeight","amplitude","height","Math","abs","sin","max","min","animations","animatedValue","targetHeight","timing","toValue","duration","useNativeDriver","parallel","start","animationInterval","isActive","WaveformVisualizer","style","styles","container","children","animatedHeight","idx","currentHeightValue","conditionalValue","isEdgeBar","barStyle","bar","barWide","barNormal","barEdge","barCenter","interpolate","inputRange","outputRange","create","flexDirection","alignItems","alignSelf","justifyContent","zIndex","borderRadius","margin","width","backgroundColor"],"sourceRoot":"../../../../src","sources":["components/Embed/EmbedAudioWave.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAM1D;AACA,MAAMC,2BAA2B,GAAIC,OAA8B,IAAK;EACtE,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGT,QAAQ,CAAC,KAAK,CAAC;EACzD,MAAMU,WAAW,GAAGX,MAAM,CAAwB,IAAI,CAAC;EACvD,MAAM,CAACY,cAAc,EAAEC,iBAAiB,CAAC,GAAGZ,QAAQ,CAClDa,KAAK,CAAC,EAAE,CAAC,CAACC,IAAI,CAAC,CAAC,CAClB,CAAC;;EAED;EACA,MAAMC,QAAQ,GAAG,EAAE;EACnB,MAAMC,YAAY,GAAGjB,MAAM,CACzBc,KAAK,CAACE,QAAQ,CAAC,CACZD,IAAI,CAAC,CAAC,CAAC,CACPG,GAAG,CAAC,MAAM,IAAIf,QAAQ,CAACgB,KAAK,CAAC,CAAC,CAAC,CACpC,CAAC,CAACC,OAAO;EAETrB,SAAS,CAAC,MAAM;IACd;IACA,MAAMsB,kBAAkB,GAAGA,CAAA,KAAM;MAC/B,MAAMC,IAAI,GAAGd,OAAO,CAACY,OAAO;MAC5B,IAAIE,IAAI,EAAEC,KAAK,KAAK,WAAW,EAAE;QAC/Bb,gBAAgB,CAAC,KAAK,CAAC;QACvB;MACF;;MAEA;MACA,IAAIc,eAAe,GAAG,KAAK;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,SAAS,EAAE;IACTiB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBtC,MAAM,EAAE,MAAM;IACduC,SAAS,EAAE,QAAQ;IACnBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE;EACV,CAAC;EACDb,GAAG,EAAE;IACHc,YAAY,EAAE,GAAG;IACjBH,SAAS,EAAE,QAAQ;IACnBI,MAAM,EAAE;EACV,CAAC;EACDb,SAAS,EAAE;IACTc,KAAK,EAAE;EACT,CAAC;EACDf,OAAO,EAAE;IACPe,KAAK,EAAE;EACT,CAAC;EACDb,OAAO,EAAE;IACPc,eAAe,EAAE;EACnB,CAAC;EACDb,SAAS,EAAE;IACTa,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useRef","StyleSheet","View","Animated","cancelAnimation","useAnimatedStyle","useSharedValue","withRepeat","withSequence","withTiming","jsx","_jsx","BAR_COUNT","BAR_MAX_HEIGHTS","BAR_PHASE_OFFSETS","AnimatedBar","waveProgress","isActive","maxHeight","phaseOffset","isEdge","barStyle","value","height","phase","Math","max","abs","sin","PI","style","styles","bar","barEdge","barCenter","WaveformVisualizer","roomRef","lastActiveState","intervalRef","checkAudioActivity","room","current","speaking","state","remoteParticipants","forEach","participant","audioLevel","isSpeaking","duration","setInterval","clearInterval","container","children","map","maxH","idx","create","flexDirection","alignItems","alignSelf","justifyContent","zIndex","borderRadius","margin","width","backgroundColor"],"sourceRoot":"../../../../src","sources":["components/Embed/EmbedAudioWave.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAAyBA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,OAAOC,QAAQ,IACbC,eAAe,EACfC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,YAAY,EACZC,UAAU,QACL,yBAAyB;AAAC,SAAAC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