livevoice-sdk-react-native 2.0.0 → 3.0.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.
Files changed (221) hide show
  1. package/README.md +158 -7
  2. package/android/build.gradle +18 -6
  3. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +121 -221
  4. package/android/src/main/java/io/livevoice/react/__SDK.kt +17 -3
  5. package/ios/LiveVoiceRNBridge.swift +362 -0
  6. package/ios/LiveVoiceSdkReactNative.mm +247 -145
  7. package/ios/__SDK.h +16 -2
  8. package/ios/livevoice_spm_backport.rb +202 -0
  9. package/lib/module/components/BrandingView.js +71 -50
  10. package/lib/module/components/BrandingView.js.map +1 -1
  11. package/lib/module/components/ChannelView.js +368 -54
  12. package/lib/module/components/ChannelView.js.map +1 -1
  13. package/lib/module/components/ErrorView.js +17 -16
  14. package/lib/module/components/ErrorView.js.map +1 -1
  15. package/lib/module/components/LiveVoiceSpinner.js +81 -0
  16. package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
  17. package/lib/module/components/LiveVoiceView.js +351 -104
  18. package/lib/module/components/LiveVoiceView.js.map +1 -1
  19. package/lib/module/components/PasswordPrompt.js +165 -0
  20. package/lib/module/components/PasswordPrompt.js.map +1 -0
  21. package/lib/module/components/PlayButtonView.js +192 -254
  22. package/lib/module/components/PlayButtonView.js.map +1 -1
  23. package/lib/module/components/ReconnectingView.js +43 -62
  24. package/lib/module/components/ReconnectingView.js.map +1 -1
  25. package/lib/module/components/WarningView.js +12 -10
  26. package/lib/module/components/WarningView.js.map +1 -1
  27. package/lib/module/icons/branding-ios.png +0 -0
  28. package/lib/module/icons/camera-off-android.png +0 -0
  29. package/lib/module/icons/camera-off-android@2x.png +0 -0
  30. package/lib/module/icons/camera-off-android@3x.png +0 -0
  31. package/lib/module/icons/cpu-android.png +0 -0
  32. package/lib/module/icons/cpu-android@2x.png +0 -0
  33. package/lib/module/icons/cpu-android@3x.png +0 -0
  34. package/lib/module/icons/cpu-ios.png +0 -0
  35. package/lib/module/icons/cpu-ios@2x.png +0 -0
  36. package/lib/module/icons/cpu-ios@3x.png +0 -0
  37. package/lib/module/icons/lock-android.png +0 -0
  38. package/lib/module/icons/lock-android@2x.png +0 -0
  39. package/lib/module/icons/lock-android@3x.png +0 -0
  40. package/lib/module/icons/lock-ios.png +0 -0
  41. package/lib/module/icons/lock-ios@2x.png +0 -0
  42. package/lib/module/icons/lock-ios@3x.png +0 -0
  43. package/lib/module/icons/mic-off-android.png +0 -0
  44. package/lib/module/icons/mic-off-android@2x.png +0 -0
  45. package/lib/module/icons/mic-off-android@3x.png +0 -0
  46. package/lib/module/icons/mic-slash-ios.png +0 -0
  47. package/lib/module/icons/mic-slash-ios@2x.png +0 -0
  48. package/lib/module/icons/mic-slash-ios@3x.png +0 -0
  49. package/lib/module/icons/video-slash-ios.png +0 -0
  50. package/lib/module/icons/video-slash-ios@2x.png +0 -0
  51. package/lib/module/icons/video-slash-ios@3x.png +0 -0
  52. package/lib/module/index.js +24 -225
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/sdk/Bridge.js +236 -0
  55. package/lib/module/sdk/Bridge.js.map +1 -0
  56. package/lib/module/sdk/Event.js +160 -0
  57. package/lib/module/sdk/Event.js.map +1 -0
  58. package/lib/module/sdk/Lifecycle.js +331 -0
  59. package/lib/module/sdk/Lifecycle.js.map +1 -0
  60. package/lib/module/sdk/LiveVoiceSdk.js +365 -0
  61. package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
  62. package/lib/module/sdk/LiveVoiceState.js +234 -0
  63. package/lib/module/sdk/LiveVoiceState.js.map +1 -0
  64. package/lib/module/sdk/LogEntries.js +99 -0
  65. package/lib/module/sdk/LogEntries.js.map +1 -0
  66. package/lib/module/sdk/Models.js +2 -0
  67. package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
  68. package/lib/module/sdk/NativeSdkVersions.js +24 -0
  69. package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
  70. package/lib/module/sdk/Observables.js +391 -0
  71. package/lib/module/sdk/Observables.js.map +1 -0
  72. package/lib/module/sdk/Passwords.js +298 -0
  73. package/lib/module/sdk/Passwords.js.map +1 -0
  74. package/lib/module/sdk/Playback.js +35 -0
  75. package/lib/module/sdk/Playback.js.map +1 -0
  76. package/lib/module/specs/NativeLiveVoiceSdk.js +12 -10
  77. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  78. package/lib/module/util/Colors.js +14 -11
  79. package/lib/module/util/Colors.js.map +1 -1
  80. package/lib/module/util/Translations.js +46 -21
  81. package/lib/module/util/Translations.js.map +1 -1
  82. package/lib/module/util/freeze.js +26 -0
  83. package/lib/module/util/freeze.js.map +1 -0
  84. package/lib/module/util/logger.js +114 -0
  85. package/lib/module/util/logger.js.map +1 -0
  86. package/lib/typescript/src/components/BrandingView.d.ts +4 -0
  87. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
  88. package/lib/typescript/src/components/ChannelView.d.ts +29 -3
  89. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
  90. package/lib/typescript/src/components/ErrorView.d.ts +5 -3
  91. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
  92. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
  93. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
  94. package/lib/typescript/src/components/LiveVoiceView.d.ts +85 -3
  95. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
  96. package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
  97. package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
  98. package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
  99. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
  100. package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
  101. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
  102. package/lib/typescript/src/components/WarningView.d.ts.map +1 -1
  103. package/lib/typescript/src/index.d.ts +15 -144
  104. package/lib/typescript/src/index.d.ts.map +1 -1
  105. package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
  106. package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
  107. package/lib/typescript/src/sdk/Event.d.ts +97 -0
  108. package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
  109. package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
  110. package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
  111. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +215 -0
  112. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
  113. package/lib/typescript/src/sdk/LiveVoiceState.d.ts +80 -0
  114. package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
  115. package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
  116. package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
  117. package/lib/typescript/src/sdk/Models.d.ts +114 -0
  118. package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
  119. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
  120. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
  121. package/lib/typescript/src/sdk/Observables.d.ts +123 -0
  122. package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
  123. package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
  124. package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
  125. package/lib/typescript/src/sdk/Playback.d.ts +9 -0
  126. package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
  127. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +35 -29
  128. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  129. package/lib/typescript/src/util/Colors.d.ts.map +1 -1
  130. package/lib/typescript/src/util/Translations.d.ts +30 -8
  131. package/lib/typescript/src/util/Translations.d.ts.map +1 -1
  132. package/lib/typescript/src/util/freeze.d.ts +6 -0
  133. package/lib/typescript/src/util/freeze.d.ts.map +1 -0
  134. package/lib/typescript/src/util/logger.d.ts +33 -0
  135. package/lib/typescript/src/util/logger.d.ts.map +1 -0
  136. package/livevoice-sdk-react-native.podspec +41 -16
  137. package/package.json +26 -14
  138. package/src/components/BrandingView.tsx +55 -66
  139. package/src/components/ChannelView.tsx +342 -48
  140. package/src/components/ErrorView.tsx +21 -22
  141. package/src/components/LiveVoiceSpinner.tsx +87 -0
  142. package/src/components/LiveVoiceView.tsx +360 -151
  143. package/src/components/PasswordPrompt.tsx +144 -0
  144. package/src/components/PlayButtonView.tsx +177 -279
  145. package/src/components/ReconnectingView.tsx +40 -86
  146. package/src/components/WarningView.tsx +12 -10
  147. package/src/icons/branding-ios.png +0 -0
  148. package/src/icons/camera-off-android.png +0 -0
  149. package/src/icons/camera-off-android@2x.png +0 -0
  150. package/src/icons/camera-off-android@3x.png +0 -0
  151. package/src/icons/cpu-android.png +0 -0
  152. package/src/icons/cpu-android@2x.png +0 -0
  153. package/src/icons/cpu-android@3x.png +0 -0
  154. package/src/icons/cpu-ios.png +0 -0
  155. package/src/icons/cpu-ios@2x.png +0 -0
  156. package/src/icons/cpu-ios@3x.png +0 -0
  157. package/src/icons/lock-android.png +0 -0
  158. package/src/icons/lock-android@2x.png +0 -0
  159. package/src/icons/lock-android@3x.png +0 -0
  160. package/src/icons/lock-ios.png +0 -0
  161. package/src/icons/lock-ios@2x.png +0 -0
  162. package/src/icons/lock-ios@3x.png +0 -0
  163. package/src/icons/mic-off-android.png +0 -0
  164. package/src/icons/mic-off-android@2x.png +0 -0
  165. package/src/icons/mic-off-android@3x.png +0 -0
  166. package/src/icons/mic-slash-ios.png +0 -0
  167. package/src/icons/mic-slash-ios@2x.png +0 -0
  168. package/src/icons/mic-slash-ios@3x.png +0 -0
  169. package/src/icons/video-slash-ios.png +0 -0
  170. package/src/icons/video-slash-ios@2x.png +0 -0
  171. package/src/icons/video-slash-ios@3x.png +0 -0
  172. package/src/index.tsx +105 -252
  173. package/src/sdk/Bridge.ts +259 -0
  174. package/src/sdk/Event.ts +187 -0
  175. package/src/sdk/Lifecycle.ts +366 -0
  176. package/src/sdk/LiveVoiceSdk.ts +384 -0
  177. package/src/sdk/LiveVoiceState.ts +259 -0
  178. package/src/sdk/LogEntries.ts +88 -0
  179. package/src/sdk/Models.ts +129 -0
  180. package/src/sdk/NativeSdkVersions.ts +21 -0
  181. package/src/sdk/Observables.ts +414 -0
  182. package/src/sdk/Passwords.ts +286 -0
  183. package/src/sdk/Playback.ts +30 -0
  184. package/src/specs/NativeLiveVoiceSdk.ts +56 -46
  185. package/src/util/Colors.ts +14 -11
  186. package/src/util/Translations.ts +46 -22
  187. package/src/util/freeze.ts +23 -0
  188. package/src/util/logger.ts +119 -0
  189. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeLiveVoiceSdkSpec.java +0 -186
  190. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  191. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec-generated.cpp +0 -235
  192. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec.h +0 -31
  193. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -341
  194. package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -85
  195. package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -79
  196. package/lib/module/components/AudioOutputSwitchView.js +0 -138
  197. package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
  198. package/lib/module/components/index.js +0 -22
  199. package/lib/module/components/index.js.map +0 -1
  200. package/lib/module/icons/mic.png +0 -0
  201. package/lib/module/util/ForegroundServiceConfig.js +0 -28
  202. package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
  203. package/lib/module/util/PlayingState.js +0 -21
  204. package/lib/module/util/PlayingState.js.map +0 -1
  205. package/lib/module/util/UIState.js +0 -4
  206. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
  207. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  208. package/lib/typescript/src/components/index.d.ts +0 -9
  209. package/lib/typescript/src/components/index.d.ts.map +0 -1
  210. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -12
  211. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  212. package/lib/typescript/src/util/PlayingState.d.ts +0 -7
  213. package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
  214. package/lib/typescript/src/util/UIState.d.ts +0 -66
  215. package/lib/typescript/src/util/UIState.d.ts.map +0 -1
  216. package/src/components/AudioOutputSwitchView.tsx +0 -146
  217. package/src/components/index.tsx +0 -19
  218. package/src/icons/mic.png +0 -0
  219. package/src/util/ForegroundServiceConfig.tsx +0 -32
  220. package/src/util/PlayingState.ts +0 -18
  221. package/src/util/UIState.ts +0 -89
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the LiveVoice SDK project
6
+ //
7
+ // Copyright (c) LiveVoice GmbH
8
+ // Licensed under the MIT license
9
+ //
10
+ // See LICENSE for license information
11
+ //
12
+ // SPDX-License-Identifier: MIT
13
+ //
14
+ //===----------------------------------------------------------------------===//
15
+
16
+ import Native from "../specs/NativeLiveVoiceSdk.js";
17
+ import { logListenerError } from "../util/logger.js";
18
+
19
+ /** `error` for a failed result and a failed connection, `info` for everything else. */
20
+
21
+ /** One diagnostic event of the LiveVoice SDK. */
22
+
23
+ /** Receives one log entry; see {@link addLogListener}. */
24
+
25
+ /** The entry of a native event, or `undefined` for anything that is not one. */
26
+ function decode(data) {
27
+ if (typeof data !== 'string') return undefined;
28
+ let wire;
29
+ try {
30
+ wire = JSON.parse(data);
31
+ } catch {
32
+ return undefined;
33
+ }
34
+ if (!record(wire)) return undefined;
35
+ const {
36
+ event,
37
+ level,
38
+ fields,
39
+ timestamp
40
+ } = wire;
41
+ if (typeof event !== 'string' || event.length === 0) return undefined;
42
+ if (level !== 'info' && level !== 'error') return undefined;
43
+ if (typeof timestamp !== 'number' || !Number.isFinite(timestamp)) return undefined;
44
+ if (!record(fields)) return undefined;
45
+ const entries = Object.entries(fields);
46
+ if (!entries.every(([, value]) => typeof value === 'string')) return undefined;
47
+ return {
48
+ event,
49
+ level,
50
+ fields: Object.fromEntries(entries),
51
+ timestamp: new Date(timestamp)
52
+ };
53
+ }
54
+ function record(value) {
55
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
56
+ }
57
+
58
+ /**
59
+ * Receives the SDK's diagnostic events, the ones it also writes to the system log. Entries are
60
+ * not replayed: a listener gets what is logged after it was added, in order. It can be added
61
+ * before `initialize()` and stays until it is removed.
62
+ *
63
+ * Entries never hold the API key or a password. Return quickly and do not call the SDK from the
64
+ * listener; an error it throws is caught.
65
+ *
66
+ * @param listener - Called with each entry.
67
+ * @returns A subscription; its `remove()` stops the entries.
68
+ */
69
+ export function addLogListener(listener) {
70
+ let active = true;
71
+ let subscription;
72
+ const receive = data => {
73
+ if (!active) return; // A delivery already on its way when the listener was removed.
74
+ const entry = decode(data);
75
+ if (entry === undefined) return;
76
+ try {
77
+ listener(entry);
78
+ }
79
+ // Not logged into the stream, which would reach this listener again.
80
+ catch (error) {
81
+ logListenerError('LV_LOG_LISTENER_ERROR', error);
82
+ }
83
+ };
84
+ try {
85
+ subscription = Native.onLogEntry(receive);
86
+ } catch (error) {
87
+ logListenerError('LV_LOG_LISTENER_UNAVAILABLE', error);
88
+ }
89
+ return {
90
+ remove: () => {
91
+ if (!active) return;
92
+ active = false;
93
+ try {
94
+ subscription?.remove();
95
+ } catch {/* The native emitter is already gone. */}
96
+ }
97
+ };
98
+ }
99
+ //# sourceMappingURL=LogEntries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Native","logListenerError","decode","data","undefined","wire","JSON","parse","record","event","level","fields","timestamp","length","Number","isFinite","entries","Object","every","value","fromEntries","Date","Array","isArray","addLogListener","listener","active","subscription","receive","entry","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IAAEJ,SAAS,EAAE,IAAIS,IAAI,CAACT,SAAS;EAAE,CAAC;AACxH;AAEA,SAASJ,MAAMA,CAACW,KAAc,EAAoC;EAChE,OAAOA,KAAK,KAAK,IAAI,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,CAACG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,cAAcA,CAACC,QAA8B,EAAyB;EACpF,IAAIC,MAAM,GAAG,IAAI;EACjB,IAAIC,YAA4C;EAChD,MAAMC,OAAO,GAAIzB,IAAY,IAAK;IAChC,IAAI,CAACuB,MAAM,EAAE,OAAO,CAAC;IACrB,MAAMG,KAAK,GAAG3B,MAAM,CAACC,IAAI,CAAC;IAC1B,IAAI0B,KAAK,KAAKzB,SAAS,EAAE;IACzB,IAAI;MAAEqB,QAAQ,CAACI,KAAK,CAAC;IAAE;IACvB;IACA,OAAOC,KAAK,EAAE;MAAE7B,gBAAgB,CAAC,uBAAuB,EAAE6B,KAAK,CAAC;IAAE;EACpE,CAAC;EACD,IAAI;IAAEH,YAAY,GAAG3B,MAAM,CAAC+B,UAAU,CAACH,OAAO,CAAC;EAAE,CAAC,CAClD,OAAOE,KAAK,EAAE;IAAE7B,gBAAgB,CAAC,6BAA6B,EAAE6B,KAAK,CAAC;EAAE;EACxE,OAAO;IACLE,MAAM,EAAEA,CAAA,KAAM;MACZ,IAAI,CAACN,MAAM,EAAE;MACbA,MAAM,GAAG,KAAK;MACd,IAAI;QAAEC,YAAY,EAAEK,MAAM,CAAC,CAAC;MAAE,CAAC,CAC/B,MAAM,CAAE;IACV;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=Models.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["util/UIState.ts"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["sdk/Models.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the LiveVoice SDK project
6
+ //
7
+ // Copyright (c) LiveVoice GmbH
8
+ // Licensed under the MIT license
9
+ //
10
+ // See LICENSE for license information
11
+ //
12
+ // SPDX-License-Identifier: MIT
13
+ //
14
+ //===----------------------------------------------------------------------===//
15
+
16
+ // GENERATED CODE - DO NOT MODIFY BY HAND.
17
+ // Generated by tool/generate-native-versions.mjs from the native SDK pins.
18
+
19
+ /** The native SDK versions this wrapper pins exactly, per platform. */
20
+ export const nativeSdkVersions = {
21
+ ios: '3.0.0',
22
+ android: '3.0.0'
23
+ };
24
+ //# sourceMappingURL=NativeSdkVersions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["nativeSdkVersions","ios","android"],"sourceRoot":"../../../src","sources":["sdk/NativeSdkVersions.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,OAAO,MAAMA,iBAAiB,GAAG;EAC/BC,GAAG,EAAE,OAAO;EACZC,OAAO,EAAE;AACX,CAAU","ignoreList":[]}
@@ -0,0 +1,391 @@
1
+ "use strict";
2
+
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the LiveVoice SDK project
6
+ //
7
+ // Copyright (c) LiveVoice GmbH
8
+ // Licensed under the MIT license
9
+ //
10
+ // See LICENSE for license information
11
+ //
12
+ // SPDX-License-Identifier: MIT
13
+ //
14
+ //===----------------------------------------------------------------------===//
15
+
16
+ // Every public state of the SDK as `getCurrent…()`, `add…Listener()` and `useLiveVoice…()`. Each
17
+ // has one store: hydrated from the snapshot the bridge's `initialize` returns, kept current by the
18
+ // one `onState` callback with its revisions (Bridge.ts), and changed only when the value changes.
19
+ // Values are frozen, nested objects and arrays too, and keep their identity until they change, as
20
+ // `useSyncExternalStore` requires. Before `initialize()` each store has its initial value.
21
+
22
+ import { useMemo, useSyncExternalStore } from 'react';
23
+ import { currentEncoded, decodeState, record } from "./Bridge.js";
24
+ import { decodeEvent, decodeLanguages, decodeLinkedEvents } from "./Event.js";
25
+ import { decodeConnection, publicConnection } from "./Lifecycle.js";
26
+ import { deepFreeze } from "../util/freeze.js";
27
+ import { logDecodeError, logListenerError } from "../util/logger.js";
28
+ /**
29
+ * A store of the state `name`, which is that state's decoder in the bridge. `decode` reads the
30
+ * wire's value and throws for one it cannot read, which is dropped: the last good value stays, the
31
+ * SDK log gets `LV_BRIDGE_DECODE_ERROR`, and the value satisfies no command's revisions.
32
+ * `publish` turns the cached value into the one hosts get; it creates the `Date`s, so every
33
+ * getter call and listener delivery gets its own, and a hook one per update.
34
+ */
35
+ function store(name, decode, initial, publish = value => value) {
36
+ let value = deepFreeze(initial);
37
+ /** The wire's JSON of the last value native delivered and this store applied. */
38
+ let applied;
39
+ const subscribers = new Set();
40
+ const change = next => {
41
+ value = deepFreeze(next);
42
+ for (const subscriber of [...subscribers]) {
43
+ try {
44
+ subscriber();
45
+ } catch (error) {
46
+ logListenerError('LV_LISTENER_ERROR', error);
47
+ }
48
+ }
49
+ };
50
+ /** Whether the store holds the wire's value, decoded, afterwards. */
51
+ const receive = wire => {
52
+ // The bridge reports only changed values; after a dropped one, the last good one can return.
53
+ const encoded = currentEncoded(name) ?? JSON.stringify(wire ?? null);
54
+ if (encoded === applied) return true;
55
+ let next;
56
+ try {
57
+ next = decode(wire);
58
+ } catch {
59
+ logDecodeError('state', name);
60
+ return false;
61
+ }
62
+ // The first value from native may equal the initial one: nothing changed, nobody hears.
63
+ const unchanged = applied === undefined && JSON.stringify(next) === JSON.stringify(value);
64
+ applied = encoded;
65
+ if (!unchanged) change(next);
66
+ return true;
67
+ };
68
+ // Also decodes the value the bridge already holds.
69
+ decodeState(name, receive);
70
+ const subscribe = onChange => {
71
+ subscribers.add(onChange);
72
+ return () => {
73
+ subscribers.delete(onChange);
74
+ };
75
+ };
76
+ const snapshot = () => value;
77
+ return {
78
+ get: () => publish(value),
79
+ add(listener) {
80
+ let active = true;
81
+ const deliver = () => {
82
+ if (!active) return;
83
+ // A listener that throws reaches neither the other listeners nor the SDK.
84
+ try {
85
+ listener(publish(value));
86
+ } catch (error) {
87
+ logListenerError('LV_LISTENER_ERROR', error);
88
+ }
89
+ };
90
+ subscribers.add(deliver);
91
+ deliver();
92
+ return {
93
+ remove: () => {
94
+ if (!active) return;
95
+ active = false;
96
+ subscribers.delete(deliver);
97
+ }
98
+ };
99
+ },
100
+ use() {
101
+ const current = useSyncExternalStore(subscribe, snapshot, snapshot);
102
+ return useMemo(() => publish(current), [current]);
103
+ },
104
+ preset(next) {
105
+ if (applied !== undefined || JSON.stringify(next) === JSON.stringify(value)) return;
106
+ change(next);
107
+ }
108
+ };
109
+ }
110
+
111
+ // MARK: Decoders of bridge.md 2.5 to 2.8
112
+
113
+ function decodeFeatures(wire) {
114
+ if (!record(wire) || typeof wire.customUiAllowed !== 'boolean' || typeof wire.hideBranding !== 'boolean') {
115
+ throw new TypeError('features');
116
+ }
117
+ return {
118
+ customUiAllowed: wire.customUiAllowed,
119
+ hideBranding: wire.hideBranding
120
+ };
121
+ }
122
+ function decodeAudioOutput(wire) {
123
+ if (wire !== 'system' && wire !== 'speaker') throw new TypeError('audioOutput');
124
+ return wire;
125
+ }
126
+ function fragments(wire) {
127
+ if (!Array.isArray(wire.fragments)) throw new TypeError('subtitles');
128
+ return wire.fragments.filter(fragment => typeof fragment === 'string');
129
+ }
130
+ function decodeSubtitles(wire) {
131
+ if (!record(wire)) throw new TypeError('subtitles');
132
+ switch (wire.kind) {
133
+ case 'disabled':
134
+ return {
135
+ kind: 'disabled'
136
+ };
137
+ case 'automatic':
138
+ return {
139
+ kind: 'automatic',
140
+ fragments: fragments(wire)
141
+ };
142
+ case 'specific':
143
+ if (typeof wire.channelId !== 'number') throw new TypeError('subtitles');
144
+ return {
145
+ kind: 'specific',
146
+ channelId: wire.channelId,
147
+ fragments: fragments(wire)
148
+ };
149
+ default:
150
+ throw new TypeError('subtitles');
151
+ }
152
+ }
153
+
154
+ /** `null` until the joined event's list arrived, `[]` when it has none (bridge.md 2.8). */
155
+ function decodeAvailableSubtitles(wire) {
156
+ if (wire === null) return null;
157
+ if (!Array.isArray(wire)) throw new TypeError('availableSubtitles');
158
+ return wire.filter(record).flatMap(subtitle => typeof subtitle.channelId === 'number' && typeof subtitle.name === 'string' ? [{
159
+ channelId: subtitle.channelId,
160
+ name: subtitle.name,
161
+ language: typeof subtitle.language === 'string' ? subtitle.language : null,
162
+ parentChannelId: typeof subtitle.parentChannelId === 'number' ? subtitle.parentChannelId : null
163
+ }] : []);
164
+ }
165
+
166
+ // MARK: The stores
167
+
168
+ const connection = store('connection', decodeConnection, {
169
+ status: 'idle'
170
+ }, publicConnection);
171
+ const subtitles = store('subtitles', decodeSubtitles, {
172
+ kind: 'disabled'
173
+ });
174
+ const availableSubtitles = store('availableSubtitles', decodeAvailableSubtitles, null);
175
+ const audioOutput = store('audioOutput', decodeAudioOutput, 'system');
176
+ const features = store('features', decodeFeatures, {
177
+ customUiAllowed: false,
178
+ hideBranding: false
179
+ });
180
+ const currentEvent = store('currentEvent', decodeEvent, null);
181
+ const requestableLanguages = store('requestableLanguages', decodeLanguages, null);
182
+ const linkedEvents = store('linkedEvents', decodeLinkedEvents, null);
183
+
184
+ // MARK: Connection
185
+
186
+ /**
187
+ * The connection to the event: `idle` before `initialize()` and while nothing is joined or
188
+ * joining.
189
+ */
190
+ export function getCurrentConnection() {
191
+ return connection.get();
192
+ }
193
+
194
+ /**
195
+ * Calls `listener` with the current connection at once, then on every change. A state change is a
196
+ * display update; await `joinEvent()` to confirm a particular join.
197
+ *
198
+ * @param listener - Called with the current value at once, then with every change.
199
+ * @returns A subscription; its `remove()` ends the observation.
200
+ */
201
+ export function addConnectionListener(listener) {
202
+ return connection.add(listener);
203
+ }
204
+
205
+ /** The connection in a component. */
206
+ export function useLiveVoiceConnection() {
207
+ return connection.use();
208
+ }
209
+
210
+ // MARK: Subtitles
211
+
212
+ /**
213
+ * Which subtitles the SDK receives, with the fragments so far. It is `disabled` after a join, a
214
+ * leave and `stopSubtitles`. The value follows a call shortly, also an awaited `joinEvent`: right
215
+ * after the promise resolves it can still show the previous value, so observe it with
216
+ * {@link addSubtitlesListener} or {@link useLiveVoiceSubtitles}.
217
+ */
218
+ export function getCurrentSubtitles() {
219
+ return subtitles.get();
220
+ }
221
+
222
+ /**
223
+ * Calls `listener` with the current subtitles at once, then on every change.
224
+ *
225
+ * @param listener - Called with the current value at once, then with every change.
226
+ * @returns A subscription; its `remove()` ends the observation.
227
+ */
228
+ export function addSubtitlesListener(listener) {
229
+ return subtitles.add(listener);
230
+ }
231
+
232
+ /** The subtitles in a component. */
233
+ export function useLiveVoiceSubtitles() {
234
+ return subtitles.use();
235
+ }
236
+
237
+ /**
238
+ * The subtitles that can be started: `null` while no event is joined, a list once `joinEvent` has
239
+ * resolved, `[]` when the event has none. The list stays during a reconnect.
240
+ */
241
+ export function getCurrentAvailableSubtitles() {
242
+ return availableSubtitles.get();
243
+ }
244
+
245
+ /**
246
+ * Calls `listener` with the current available subtitles at once, then on every change.
247
+ *
248
+ * @param listener - Called with the current value at once, then with every change.
249
+ * @returns A subscription; its `remove()` ends the observation.
250
+ */
251
+ export function addAvailableSubtitlesListener(listener) {
252
+ return availableSubtitles.add(listener);
253
+ }
254
+
255
+ /** The available subtitles in a component. */
256
+ export function useLiveVoiceAvailableSubtitles() {
257
+ return availableSubtitles.use();
258
+ }
259
+
260
+ // MARK: Audio output
261
+
262
+ /**
263
+ * The audio output preference. Before `initialize()` it is `'system'` until `setAudioOutput()`
264
+ * sets a preference, then that preference.
265
+ */
266
+ export function getCurrentAudioOutput() {
267
+ return audioOutput.get();
268
+ }
269
+
270
+ /**
271
+ * Calls `listener` with the current audio output at once, then on every change.
272
+ *
273
+ * @param listener - Called with the current value at once, then with every change.
274
+ * @returns A subscription; its `remove()` ends the observation.
275
+ */
276
+ export function addAudioOutputListener(listener) {
277
+ return audioOutput.add(listener);
278
+ }
279
+
280
+ /** The audio output in a component. */
281
+ export function useLiveVoiceAudioOutput() {
282
+ return audioOutput.use();
283
+ }
284
+
285
+ /** Internal: `setAudioOutput()` before native reported a value, which then replaces it. */
286
+ export function presetAudioOutput(output) {
287
+ audioOutput.preset(output);
288
+ }
289
+
290
+ // MARK: Features
291
+
292
+ /**
293
+ * What the API key of the joined event permits; `false` for both before the first join, after a
294
+ * leave and after a failure. Right after an awaited `joinEvent` it can still show the previous
295
+ * value; observe it with {@link addFeaturesListener} or {@link useLiveVoiceFeatures}.
296
+ */
297
+ export function getCurrentFeatures() {
298
+ return features.get();
299
+ }
300
+
301
+ /**
302
+ * Calls `listener` with the current features at once, then whenever they change.
303
+ *
304
+ * @param listener - Called with the current value at once, then with every change.
305
+ * @returns A subscription; its `remove()` ends the observation.
306
+ */
307
+ export function addFeaturesListener(listener) {
308
+ return features.add(listener);
309
+ }
310
+
311
+ /** The features in a component. */
312
+ export function useLiveVoiceFeatures() {
313
+ return features.use();
314
+ }
315
+
316
+ // MARK: Current event
317
+
318
+ /**
319
+ * The joined event: `null` whenever no event is ready, set once the join is ready, kept during a
320
+ * reconnect, and following a linked switch. Its brand colours come with every API key.
321
+ */
322
+ export function getCurrentEvent() {
323
+ return currentEvent.get();
324
+ }
325
+
326
+ /**
327
+ * Calls `listener` with the current event at once, then on every change.
328
+ *
329
+ * @param listener - Called with the current value at once, then with every change.
330
+ * @returns A subscription; its `remove()` ends the observation.
331
+ */
332
+ export function addCurrentEventListener(listener) {
333
+ return currentEvent.add(listener);
334
+ }
335
+
336
+ /** The current event in a component. */
337
+ export function useLiveVoiceCurrentEvent() {
338
+ return currentEvent.use();
339
+ }
340
+
341
+ // MARK: Requestable languages
342
+
343
+ /**
344
+ * The languages listeners can request: `null` until the join has authenticated, for a key without
345
+ * the custom-UI permission, when the event disables requests, and whenever no event is ready; kept
346
+ * during a reconnect.
347
+ */
348
+ export function getCurrentRequestableLanguages() {
349
+ return requestableLanguages.get();
350
+ }
351
+
352
+ /**
353
+ * Calls `listener` with the current languages at once, then on every change.
354
+ *
355
+ * @param listener - Called with the current value at once, then with every change.
356
+ * @returns A subscription; its `remove()` ends the observation.
357
+ */
358
+ export function addRequestableLanguagesListener(listener) {
359
+ return requestableLanguages.add(listener);
360
+ }
361
+
362
+ /** The requestable languages in a component. */
363
+ export function useLiveVoiceRequestableLanguages() {
364
+ return requestableLanguages.use();
365
+ }
366
+
367
+ // MARK: Linked events
368
+
369
+ /**
370
+ * The events linked to the joined one: `null` until the join has authenticated, for a key without
371
+ * the custom-UI permission, and whenever no event is ready; kept during a reconnect.
372
+ */
373
+ export function getCurrentLinkedEvents() {
374
+ return linkedEvents.get();
375
+ }
376
+
377
+ /**
378
+ * Calls `listener` with the current linked events at once, then on every change.
379
+ *
380
+ * @param listener - Called with the current value at once, then with every change.
381
+ * @returns A subscription; its `remove()` ends the observation.
382
+ */
383
+ export function addLinkedEventsListener(listener) {
384
+ return linkedEvents.add(listener);
385
+ }
386
+
387
+ /** The linked events in a component. */
388
+ export function useLiveVoiceLinkedEvents() {
389
+ return linkedEvents.use();
390
+ }
391
+ //# sourceMappingURL=Observables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMemo","useSyncExternalStore","currentEncoded","decodeState","record","decodeEvent","decodeLanguages","decodeLinkedEvents","decodeConnection","publicConnection","deepFreeze","logDecodeError","logListenerError","store","name","decode","initial","publish","value","applied","subscribers","Set","change","next","subscriber","error","receive","wire","encoded","JSON","stringify","unchanged","undefined","subscribe","onChange","add","delete","snapshot","get","listener","active","deliver","remove","use","current","preset","decodeFeatures","customUiAllowed","hideBranding","TypeError","decodeAudioOutput","fragments","Array","isArray","filter","fragment","decodeSubtitles","kind","channelId","decodeAvailableSubtitles","flatMap","subtitle","language","parentChannelId","connection","status","subtitles","availableSubtitles","audioOutput","features","currentEvent","requestableLanguages","linkedEvents","getCurrentConnection","addConnectionListener","useLiveVoiceConnection","getCurrentSubtitles","addSubtitlesListener","useLiveVoiceSubtitles","getCurrentAvailableSubtitles","addAvailableSubtitlesListener","useLiveVoiceAvailableSubtitles","getCurrentAudioOutput","addAudioOutputListener","useLiveVoiceAudioOutput","presetAudioOutput","output","getCurrentFeatures","addFeaturesListener","useLiveVoiceFeatures","getCurrentEvent","addCurrentEventListener","useLiveVoiceCurrentEvent","getCurrentRequestableLanguages","addRequestableLanguagesListener","useLiveVoiceRequestableLanguages","getCurrentLinkedEvents","addLinkedEventsListener","useLiveVoiceLinkedEvents"],"sourceRoot":"../../../src","sources":["sdk/Observables.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,EAAEC,oBAAoB,QAAQ,OAAO;AAErD,SAASC,cAAc,EAAEC,WAAW,EAAEC,MAAM,QAAwB,aAAU;AAC9E,SACEC,WAAW,EACXC,eAAe,EACfC,kBAAkB,QAIb,YAAS;AAChB,SACEC,gBAAgB,EAChBC,gBAAgB,QAGX,gBAAa;AAQpB,SAASC,UAAU,QAAQ,mBAAgB;AAC3C,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,mBAAgB;AAajE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,KAAKA,CACZC,IAAe,EACfC,MAAgC,EAChCC,OAAc,EACdC,OAAiC,GAAGC,KAAK,IAAIA,KAA0B,EACjD;EACtB,IAAIA,KAAK,GAAGR,UAAU,CAACM,OAAO,CAAC;EAC/B;EACA,IAAIG,OAA2B;EAC/B,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAa,CAAC;EAEzC,MAAMC,MAAM,GAAIC,IAAW,IAAK;IAC9BL,KAAK,GAAGR,UAAU,CAACa,IAAI,CAAC;IACxB,KAAK,MAAMC,UAAU,IAAI,CAAC,GAAGJ,WAAW,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