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,165 @@
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 { useEffect, useState } from 'react';
17
+ import { Modal, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
18
+ import { COLORS } from "../util/Colors.js";
19
+ import { PasswordPromptTexts } from "../util/Translations.js";
20
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
+ /**
22
+ * The built-in password prompt, for channels and events alike. Its texts come from the native SDK;
23
+ * the title is the channel's or event's name, or "Password required" for a join.
24
+ */
25
+ export const PasswordPrompt = ({
26
+ request,
27
+ isDarkMode,
28
+ onAnswer
29
+ }) => {
30
+ const [password, setPassword] = useState('');
31
+ // A new request starts empty.
32
+ useEffect(() => setPassword(''), [request.requestId]);
33
+ const isChannel = request.subject.kind === 'channel';
34
+ const text = isDarkMode ? COLORS.white : COLORS.black;
35
+ const confirm = () => {
36
+ if (password.length > 0) onAnswer(password);
37
+ };
38
+ return /*#__PURE__*/_jsx(Modal, {
39
+ transparent: true,
40
+ animationType: "fade",
41
+ visible: true,
42
+ onRequestClose: () => onAnswer(null),
43
+ children: /*#__PURE__*/_jsx(View, {
44
+ style: styles.backdrop,
45
+ children: /*#__PURE__*/_jsxs(View, {
46
+ style: [styles.card, {
47
+ backgroundColor: isDarkMode ? COLORS.cardBgDark : COLORS.cardBg
48
+ }],
49
+ children: [/*#__PURE__*/_jsx(Text, {
50
+ accessibilityRole: "header",
51
+ style: [styles.title, {
52
+ color: text
53
+ }],
54
+ children: request.name ?? PasswordPromptTexts.title()
55
+ }), /*#__PURE__*/_jsx(Text, {
56
+ style: [styles.message, {
57
+ color: text
58
+ }],
59
+ children: isChannel ? PasswordPromptTexts.channelMessage() : PasswordPromptTexts.eventMessage()
60
+ }), request.isRetry && /*#__PURE__*/_jsx(Text, {
61
+ accessibilityLiveRegion: "polite",
62
+ style: [styles.message, styles.wrong],
63
+ children: PasswordPromptTexts.wrongPassword()
64
+ }), /*#__PURE__*/_jsx(TextInput, {
65
+ value: password,
66
+ onChangeText: setPassword,
67
+ onSubmitEditing: confirm,
68
+ placeholder: PasswordPromptTexts.field(),
69
+ accessibilityLabel: PasswordPromptTexts.field(),
70
+ placeholderTextColor: isDarkMode ? '#8e8e93' : '#a0a0a5',
71
+ secureTextEntry: true,
72
+ autoFocus: true,
73
+ autoCapitalize: "none",
74
+ autoCorrect: false,
75
+ returnKeyType: "go",
76
+ style: [styles.field, {
77
+ color: text,
78
+ borderColor: isDarkMode ? COLORS.dividerDark : COLORS.divider
79
+ }]
80
+ }), /*#__PURE__*/_jsxs(View, {
81
+ style: styles.buttons,
82
+ children: [/*#__PURE__*/_jsx(TouchableOpacity, {
83
+ accessibilityRole: "button",
84
+ onPress: () => onAnswer(null),
85
+ style: styles.button,
86
+ children: /*#__PURE__*/_jsx(Text, {
87
+ style: [styles.buttonText, {
88
+ color: text
89
+ }],
90
+ children: PasswordPromptTexts.cancelButton()
91
+ })
92
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
93
+ accessibilityRole: "button",
94
+ accessibilityState: {
95
+ disabled: password.length === 0
96
+ },
97
+ disabled: password.length === 0,
98
+ onPress: confirm,
99
+ style: styles.button,
100
+ children: /*#__PURE__*/_jsx(Text, {
101
+ style: [styles.buttonText, styles.confirm, {
102
+ opacity: password.length === 0 ? 0.4 : 1
103
+ }],
104
+ children: isChannel ? PasswordPromptTexts.channelConfirmButton() : PasswordPromptTexts.eventConfirmButton()
105
+ })
106
+ })]
107
+ })]
108
+ })
109
+ })
110
+ });
111
+ };
112
+ const styles = StyleSheet.create({
113
+ backdrop: {
114
+ flex: 1,
115
+ justifyContent: 'center',
116
+ alignItems: 'center',
117
+ padding: 24,
118
+ backgroundColor: 'rgba(0, 0, 0, 0.4)'
119
+ },
120
+ card: {
121
+ width: '100%',
122
+ maxWidth: 360,
123
+ borderRadius: 14,
124
+ padding: 20
125
+ },
126
+ title: {
127
+ fontSize: 17,
128
+ fontWeight: '600',
129
+ textAlign: 'center'
130
+ },
131
+ message: {
132
+ fontSize: 14,
133
+ textAlign: 'center',
134
+ marginTop: 8
135
+ },
136
+ wrong: {
137
+ color: '#F1521B'
138
+ },
139
+ field: {
140
+ borderWidth: 1,
141
+ borderRadius: 8,
142
+ paddingHorizontal: 12,
143
+ paddingVertical: 10,
144
+ marginTop: 16,
145
+ fontSize: 16
146
+ },
147
+ buttons: {
148
+ flexDirection: 'row',
149
+ justifyContent: 'flex-end',
150
+ marginTop: 16
151
+ },
152
+ button: {
153
+ paddingHorizontal: 12,
154
+ paddingVertical: 8,
155
+ marginLeft: 8
156
+ },
157
+ buttonText: {
158
+ fontSize: 16,
159
+ fontWeight: '500'
160
+ },
161
+ confirm: {
162
+ color: COLORS.primary
163
+ }
164
+ });
165
+ //# sourceMappingURL=PasswordPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","Modal","StyleSheet","Text","TextInput","TouchableOpacity","View","COLORS","PasswordPromptTexts","jsx","_jsx","jsxs","_jsxs","PasswordPrompt","request","isDarkMode","onAnswer","password","setPassword","requestId","isChannel","subject","kind","text","white","black","confirm","length","transparent","animationType","visible","onRequestClose","children","style","styles","backdrop","card","backgroundColor","cardBgDark","cardBg","accessibilityRole","title","color","name","message","channelMessage","eventMessage","isRetry","accessibilityLiveRegion","wrong","wrongPassword","value","onChangeText","onSubmitEditing","placeholder","field","accessibilityLabel","placeholderTextColor","secureTextEntry","autoFocus","autoCapitalize","autoCorrect","returnKeyType","borderColor","dividerDark","divider","buttons","onPress","button","buttonText","cancelButton","accessibilityState","disabled","opacity","channelConfirmButton","eventConfirmButton","create","flex","justifyContent","alignItems","padding","width","maxWidth","borderRadius","fontSize","fontWeight","textAlign","marginTop","borderWidth","paddingHorizontal","paddingVertical","flexDirection","marginLeft","primary"],"sourceRoot":"../../../src","sources":["components/PasswordPrompt.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,KAAK,EAAEC,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAGzF,SAASC,MAAM,QAAQ,mBAAgB;AACvC,SAASC,mBAAmB,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS3D;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAA6C,GAAGA,CAAC;EAAEC,OAAO;EAAEC,UAAU;EAAEC;AAAS,CAAC,KAAK;EAClG,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGlB,QAAQ,CAAC,EAAE,CAAC;EAC5C;EACAD,SAAS,CAAC,MAAMmB,WAAW,CAAC,EAAE,CA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AE;EACb,CAAC;EACDtC,KAAK,EAAE;IACLP,KAAK,EAAE;EACT,CAAC;EACDa,KAAK,EAAE;IACLiC,WAAW,EAAE,CAAC;IACdL,YAAY,EAAE,CAAC;IACfM,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBH,SAAS,EAAE,EAAE;IACbH,QAAQ,EAAE;EACZ,CAAC;EACDlB,OAAO,EAAE;IACPyB,aAAa,EAAE,KAAK;IACpBb,cAAc,EAAE,UAAU;IAC1BS,SAAS,EAAE;EACb,CAAC;EACDnB,MAAM,EAAE;IACNqB,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,CAAC;IAClBE,UAAU,EAAE;EACd,CAAC;EACDvB,UAAU,EAAE;IACVe,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACD3D,OAAO,EAAE;IACPgB,KAAK,EAAEnC,MAAM,CAACsF;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,20 +1,27 @@
1
1
  "use strict";
2
2
 
3
- /*
4
- * This source file is part of the LiveVoice SDK project
5
- *
6
- * Copyright (c) LiveVoice GmbH
7
- * Licensed under the MIT license
8
- *
9
- * See LICENSE for license information
10
- *
11
- * SPDX-License-Identifier: MIT
12
- */
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
+ //===----------------------------------------------------------------------===//
13
15
 
14
- import { COLORS } from "../util/Colors.js";
15
- import { ActivityIndicator, Image, TouchableOpacity, useColorScheme, View } from "react-native";
16
- import { PlayingState } from "../util/PlayingState.js";
16
+ import { Image, Platform, TouchableOpacity, useColorScheme, View } from "react-native";
17
+ import { LiveVoiceSpinner } from "./LiveVoiceSpinner.js";
17
18
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ /**
20
+ * The default cell's play button, drawn as the native SDK of the platform draws it: iOS
21
+ * `ChannelPlayButton` in its `.sdk` style, Android `PlayButton` in the SDK cell's Listener style.
22
+ * Change them together. Geometry is the same on both; the colours are each platform's own
23
+ * (`buttonColors`).
24
+ */
18
25
  const PlayButtonView = ({
19
26
  playingState,
20
27
  isChannelOnline,
@@ -23,293 +30,224 @@ const PlayButtonView = ({
23
30
  isDarkMode = useColorScheme() === "dark",
24
31
  onAudioPress,
25
32
  onSubtitlesPress,
26
- onPress
33
+ onPress,
34
+ brandColor = null,
35
+ subtitlesOpen = false
27
36
  }) => {
28
- const isPlaying = playingState === PlayingState.PLAYING;
29
- const isTransitioning = playingState === PlayingState.TRANSITIONING;
30
- const getAudioIconColor = () => {
31
- if (!isChannelOnline) {
32
- return isDarkMode ? "#5a5a60" : "#d1d1d6";
33
- }
34
- return COLORS.white;
35
- };
36
- const getSubtitlesIconColor = () => {
37
- if (!isChannelOnline) {
38
- return isDarkMode ? "#ffffff" : "#000000";
39
- }
40
- return COLORS.white;
41
- };
42
- const audioIconColor = getAudioIconColor();
43
- const subtitlesIconColor = getSubtitlesIconColor();
44
- const getAudioIcon = () => {
45
- if (isTransitioning) {
46
- return /*#__PURE__*/_jsx(ActivityIndicator, {
47
- size: 20,
48
- color: audioIconColor,
49
- style: {}
50
- });
51
- }
52
- return isPlaying ? /*#__PURE__*/_jsx(Image, {
53
- source: require("../icons/pause.png"),
54
- style: [{
55
- tintColor: audioIconColor,
56
- width: 30,
57
- height: 26
58
- }]
59
- }) : /*#__PURE__*/_jsx(Image, {
60
- source: require("../icons/play.png"),
61
- style: [{
62
- tintColor: audioIconColor,
63
- width: 30,
64
- height: 26
65
- }]
66
- });
67
- };
68
- const getSubtitlesIcon = () => {
69
- return /*#__PURE__*/_jsx(Image, {
70
- source: require("../icons/captions.png"),
71
- style: [{
72
- tintColor: subtitlesIconColor,
73
- width: 30,
74
- height: 26
75
- }]
76
- });
77
- };
78
- const getStyleType = () => {
79
- if (!isChannelOnline) return "offline";
80
- if (isPlaying) return "playing";
81
- return "paused";
82
- };
37
+ const isPlaying = playingState === "playing";
38
+ const isTransitioning = playingState === "transitioning";
39
+ const colors = buttonColors(isDarkMode);
83
40
 
84
- // If no audio and no subtitles, render disabled button with dashed border
41
+ // Play, pause and the spinner share one colour by state, as both native glyphs do.
42
+ const glyphColor = isChannelOnline ? colors.onlineGlyph : colors.offlineGlyph;
43
+ const captionsColor = isChannelOnline ? colors.onlineGlyph : colors.offlineCaptions;
44
+ // The event's brand colour replaces the orange of an online button.
45
+ const fill = isChannelOnline ? brandColor ?? colors.onlineFill : colors.offlineFill;
46
+ const audioIcon = isTransitioning ? /*#__PURE__*/_jsx(LiveVoiceSpinner, {
47
+ size: 22,
48
+ color: glyphColor
49
+ }) : /*#__PURE__*/_jsx(Image, {
50
+ source: isPlaying ? require("../icons/pause.png") : require("../icons/play.png"),
51
+ style: [{
52
+ tintColor: glyphColor,
53
+ width: 30,
54
+ height: 26
55
+ }]
56
+ });
57
+ const subtitlesIcon = /*#__PURE__*/_jsx(Image, {
58
+ source: require("../icons/captions.png"),
59
+ style: [{
60
+ tintColor: captionsColor,
61
+ width: 30,
62
+ height: 26
63
+ }]
64
+ });
65
+
66
+ // Open subtitles mark the subtitle half with a capsule, as both native SDKs do.
67
+ const marker = inset => subtitlesOpen && /*#__PURE__*/_jsx(SubtitlesMarker, {
68
+ inset: inset,
69
+ color: isChannelOnline ? colors.onlineMarker : colors.offlineMarker
70
+ });
71
+ // The offline outline, over the button without taking any of its room.
72
+ const border = !isChannelOnline && /*#__PURE__*/_jsx(ButtonBorder, {
73
+ color: colors.outline
74
+ });
75
+
76
+ // Neither audio nor subtitles: a dashed outline and nothing to press.
85
77
  if (!hasAudio && !hasSubtitles) {
86
- const noContentStyle = {
87
- ...baseButtonStyleNoContent,
88
- backgroundColor: isDarkMode ? "#1c1c1e00" : "#ffffff",
89
- borderColor: isDarkMode ? COLORS_SCHEME.borderGrayDark : COLORS_SCHEME.borderGrayLight,
90
- borderStyle: "dashed"
91
- };
92
78
  return /*#__PURE__*/_jsx(TouchableOpacity, {
93
- style: noContentStyle,
79
+ style: {
80
+ ...buttonFrame,
81
+ borderWidth: colors.noInputBorderWidth,
82
+ borderColor: colors.outline,
83
+ borderStyle: "dashed",
84
+ backgroundColor: isChannelOnline && colors.noInputFillsWhenOnline ? fill : colors.noInputFill
85
+ },
94
86
  disabled: true,
95
87
  activeOpacity: 0.8,
96
88
  children: /*#__PURE__*/_jsx(View, {})
97
89
  });
98
90
  }
99
-
100
- // If only audio, render simple button
101
- if (hasAudio && !hasSubtitles) {
102
- return /*#__PURE__*/_jsx(TouchableOpacity, {
103
- style: getButtonStyle(getStyleType(), isDarkMode, false),
91
+ if (!hasSubtitles) {
92
+ return /*#__PURE__*/_jsxs(TouchableOpacity, {
93
+ style: [buttonFrame, {
94
+ backgroundColor: fill
95
+ }],
104
96
  onPress: onAudioPress || onPress,
105
97
  activeOpacity: 0.8,
106
- children: getAudioIcon()
98
+ children: [audioIcon, border]
107
99
  });
108
100
  }
109
-
110
- // If only subtitles, render subtitles button
111
- if (!hasAudio && hasSubtitles) {
112
- return /*#__PURE__*/_jsx(TouchableOpacity, {
113
- style: getButtonStyle(getStyleType(), isDarkMode, false),
101
+ if (!hasAudio) {
102
+ return /*#__PURE__*/_jsxs(TouchableOpacity, {
103
+ style: [buttonFrame, {
104
+ backgroundColor: fill
105
+ }],
114
106
  onPress: onSubtitlesPress || onPress,
115
107
  activeOpacity: 0.8,
116
- children: getSubtitlesIcon()
108
+ children: [marker(3), subtitlesIcon, border]
117
109
  });
118
110
  }
119
111
 
120
- // If both audio and subtitles, render split button
112
+ // The divider keeps its slot but is clear while the channel plays or its subtitles are open.
113
+ const dividerColor = isPlaying || subtitlesOpen ? "transparent" : isChannelOnline ? colors.onlineDivider : colors.offlineDivider;
121
114
  return /*#__PURE__*/_jsxs(View, {
122
- style: getSplitButtonContainerStyle(getStyleType(), isDarkMode),
115
+ style: [splitFrame, {
116
+ backgroundColor: fill
117
+ }],
123
118
  children: [/*#__PURE__*/_jsx(TouchableOpacity, {
124
- style: getSplitButtonAudioStyle(getStyleType(), isDarkMode),
119
+ style: halfFrame,
125
120
  onPress: onAudioPress || onPress,
126
121
  activeOpacity: 0.8,
127
- children: getAudioIcon()
122
+ children: audioIcon
128
123
  }), /*#__PURE__*/_jsx(View, {
129
- style: getDividerStyle(getStyleType(), isDarkMode)
130
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
131
- style: getSplitButtonSubtitlesStyle(getStyleType(), isDarkMode),
124
+ style: [dividerFrame, {
125
+ backgroundColor: dividerColor
126
+ }]
127
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
128
+ style: halfFrame,
132
129
  onPress: onSubtitlesPress || onPress,
133
130
  activeOpacity: 0.8,
134
- children: getSubtitlesIcon()
135
- })]
131
+ children: [marker(4), subtitlesIcon]
132
+ }), border]
136
133
  });
137
134
  };
138
- export const getButtonStyle = (type, isDarkMode, isSplit = false) => {
139
- if (isSplit) {
140
- return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].container;
141
- }
142
- return ButtonStyles[type][isDarkMode ? "dark" : "light"];
143
- };
144
- export const getSplitButtonContainerStyle = (type, isDarkMode) => {
145
- return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].container;
146
- };
147
- export const getSplitButtonAudioStyle = (type, isDarkMode) => {
148
- return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].audio;
149
- };
150
- export const getSplitButtonSubtitlesStyle = (type, isDarkMode) => {
151
- return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].subtitles;
152
- };
153
- export const getDividerStyle = (type, isDarkMode) => {
154
- // When button is online (orange background), divider is light orange
155
- if (type === "paused" || type === "playing") {
135
+
136
+ /**
137
+ * Every colour of the button, light or dark, as the native SDK of this platform has it.
138
+ *
139
+ * Both: LiveVoice orange online (iOS `.lvOrange`, Android `orange`); white glyphs online; the
140
+ * outline and the offline divider `#A0A0A0` / `#E0E0E0` at 50 % (iOS `.lightGrey.opacity(0.5)`,
141
+ * Android `playButtonOutline`); the online divider white at 30 %; the marker white at 25 % online,
142
+ * `#EAEAEF` / `#4E4E4E` offline (iOS `.outlineButtonBorder`, Android
143
+ * `selectedCaptionsBackgroundOffline`).
144
+ *
145
+ * - iOS (`ChannelPlayButton`, `.sdk`): offline fill `.clear`; offline play glyph, pause and spinner
146
+ * `.lightGrey.opacity(0.5)`; offline captions `.primary`.
147
+ * - Android (`PlayButton`, Listener, in `LvAppTheme`): offline fill `background` (`white`,
148
+ * `veryDarkGray`); offline play glyph, pause and spinner `buttonIconInactive` (`veryLightGray`,
149
+ * `darkGray`); offline captions `onBackground` (`lightBlack`, `white`).
150
+ * - The button without input follows iOS on both: filled as an online button when its channel is
151
+ * online, clear otherwise, with a 1 pt dashed outline (Android is changing to match).
152
+ */
153
+ function buttonColors(isDarkMode) {
154
+ const outline = isDarkMode ? "rgba(224, 224, 224, 0.5)" : "rgba(160, 160, 160, 0.5)";
155
+ const shared = {
156
+ onlineFill: "#F56230",
157
+ onlineGlyph: "#FFFFFF",
158
+ outline,
159
+ onlineDivider: "rgba(255, 255, 255, 0.3)",
160
+ offlineDivider: outline,
161
+ onlineMarker: "rgba(255, 255, 255, 0.25)",
162
+ offlineMarker: isDarkMode ? "#4E4E4E" : "#EAEAEF",
163
+ // Without audio or subtitles, both as iOS: filled as an online button when the channel is
164
+ // online, clear otherwise, and always the 1 pt dashed outline.
165
+ noInputFill: "transparent",
166
+ noInputFillsWhenOnline: true,
167
+ noInputBorderWidth: 1
168
+ };
169
+ if (Platform.OS === "ios") {
156
170
  return {
157
- width: 1,
158
- height: 24,
159
- backgroundColor: COLORS_SCHEME.dividerOnOrange
171
+ ...shared,
172
+ offlineFill: "transparent",
173
+ offlineGlyph: outline,
174
+ offlineCaptions: isDarkMode ? "#FFFFFF" : "#000000"
160
175
  };
161
176
  }
162
-
163
- // When button is offline, divider is gray (same as border)
177
+ const background = isDarkMode ? "#212529" : "#FFFFFF";
164
178
  return {
165
- width: 1,
166
- height: 24,
167
- backgroundColor: isDarkMode ? COLORS_SCHEME.borderGrayDark : COLORS_SCHEME.borderGrayLight
179
+ ...shared,
180
+ offlineFill: background,
181
+ offlineGlyph: isDarkMode ? "#343A40" : "#E7E7E7",
182
+ offlineCaptions: isDarkMode ? "#FFFFFF" : "#191919"
168
183
  };
169
- };
170
- const baseButtonStyle = {
171
- width: 96,
172
- height: 44,
173
- borderRadius: 22,
174
- borderWidth: 1,
175
- alignItems: "center",
176
- justifyContent: "center"
177
- };
178
- const baseButtonStyleNoContent = {
184
+ }
185
+
186
+ /**
187
+ * The open-subtitles marker, drawn as the native SDKs draw it: a capsule inset `inset` from the
188
+ * subtitle half's own bounds, 4 beside the play half and 3 on a subtitles-only button.
189
+ */
190
+ const SubtitlesMarker = ({
191
+ inset,
192
+ color
193
+ }) => /*#__PURE__*/_jsx(View, {
194
+ style: {
195
+ position: "absolute",
196
+ top: inset,
197
+ bottom: inset,
198
+ left: inset,
199
+ right: inset,
200
+ borderRadius: (buttonFrame.height - 2 * inset) / 2,
201
+ backgroundColor: color
202
+ }
203
+ });
204
+
205
+ /**
206
+ * The offline button's 1 pt outline, drawn over the button as both native SDKs stroke it (iOS
207
+ * `strokeBorder` in the button's background, Android `Modifier.border`), so it insets nothing: the
208
+ * halves fill the whole 96 × 44 button and the glyphs sit where native puts them. Online, iOS draws
209
+ * none and Android strokes it in the fill's own colour, so none is drawn here.
210
+ */
211
+ const ButtonBorder = ({
212
+ color
213
+ }) => /*#__PURE__*/_jsx(View, {
214
+ pointerEvents: "none",
215
+ style: {
216
+ position: "absolute",
217
+ top: 0,
218
+ bottom: 0,
219
+ left: 0,
220
+ right: 0,
221
+ borderRadius: buttonFrame.borderRadius,
222
+ borderWidth: 1,
223
+ borderColor: color
224
+ }
225
+ });
226
+
227
+ // No border of their own: an offline outline is `ButtonBorder`, which takes no room.
228
+ const buttonFrame = {
179
229
  width: 96,
180
230
  height: 44,
181
231
  borderRadius: 22,
182
- borderWidth: 1,
183
232
  alignItems: "center",
184
233
  justifyContent: "center"
185
234
  };
186
- const baseSplitButtonStyle = {
187
- width: 96,
188
- height: 44,
189
- borderRadius: 22,
190
- borderWidth: 1,
235
+ const splitFrame = {
236
+ ...buttonFrame,
191
237
  flexDirection: "row",
192
- alignItems: "center",
193
- justifyContent: "center",
194
238
  overflow: "hidden"
195
239
  };
196
- const baseSplitAudioStyle = {
240
+ const halfFrame = {
197
241
  flex: 1,
198
242
  height: 44,
199
243
  alignItems: "center",
200
244
  justifyContent: "center"
201
245
  };
202
- const baseSplitSubtitlesStyle = {
203
- flex: 1,
204
- height: 44,
205
- alignItems: "center",
206
- justifyContent: "center"
207
- };
208
- const COLORS_SCHEME = {
209
- orange: "#f56230",
210
- dividerOnOrange: "#ffffff80",
211
- borderGrayLight: "#d1d1d6",
212
- borderGrayDark: "#5a5a60"
213
- };
214
- export const ButtonStyles = {
215
- paused: {
216
- light: {
217
- ...baseButtonStyle,
218
- backgroundColor: COLORS_SCHEME.orange,
219
- borderColor: "transparent"
220
- },
221
- dark: {
222
- ...baseButtonStyle,
223
- backgroundColor: COLORS_SCHEME.orange,
224
- borderColor: "transparent"
225
- }
226
- },
227
- playing: {
228
- light: {
229
- ...baseButtonStyle,
230
- backgroundColor: COLORS_SCHEME.orange,
231
- borderColor: "transparent"
232
- },
233
- dark: {
234
- ...baseButtonStyle,
235
- backgroundColor: COLORS_SCHEME.orange,
236
- borderColor: "transparent"
237
- }
238
- },
239
- offline: {
240
- light: {
241
- ...baseButtonStyle,
242
- backgroundColor: "#ffffff",
243
- borderColor: COLORS_SCHEME.borderGrayLight
244
- },
245
- dark: {
246
- ...baseButtonStyle,
247
- backgroundColor: "#212429",
248
- borderColor: COLORS_SCHEME.borderGrayDark
249
- }
250
- }
251
- };
252
- export const SplitButtonStyles = {
253
- paused: {
254
- light: {
255
- container: {
256
- ...baseSplitButtonStyle,
257
- backgroundColor: COLORS_SCHEME.orange,
258
- borderColor: "transparent"
259
- },
260
- audio: baseSplitAudioStyle,
261
- subtitles: baseSplitSubtitlesStyle
262
- },
263
- dark: {
264
- container: {
265
- ...baseSplitButtonStyle,
266
- backgroundColor: COLORS_SCHEME.orange,
267
- borderColor: "transparent"
268
- },
269
- audio: baseSplitAudioStyle,
270
- subtitles: baseSplitSubtitlesStyle
271
- }
272
- },
273
- playing: {
274
- light: {
275
- container: {
276
- ...baseSplitButtonStyle,
277
- backgroundColor: COLORS_SCHEME.orange,
278
- borderColor: "transparent"
279
- },
280
- audio: baseSplitAudioStyle,
281
- subtitles: baseSplitSubtitlesStyle
282
- },
283
- dark: {
284
- container: {
285
- ...baseSplitButtonStyle,
286
- backgroundColor: COLORS_SCHEME.orange,
287
- borderColor: "transparent"
288
- },
289
- audio: baseSplitAudioStyle,
290
- subtitles: baseSplitSubtitlesStyle
291
- }
292
- },
293
- offline: {
294
- light: {
295
- container: {
296
- ...baseSplitButtonStyle,
297
- backgroundColor: "#ffffff",
298
- borderColor: COLORS_SCHEME.borderGrayLight
299
- },
300
- audio: baseSplitAudioStyle,
301
- subtitles: baseSplitSubtitlesStyle
302
- },
303
- dark: {
304
- container: {
305
- ...baseSplitButtonStyle,
306
- backgroundColor: "#212429",
307
- borderColor: COLORS_SCHEME.borderGrayDark
308
- },
309
- audio: baseSplitAudioStyle,
310
- subtitles: baseSplitSubtitlesStyle
311
- }
312
- }
246
+
247
+ // 26 tall, 9 from the top and bottom of the 44 button, as in both native SDKs.
248
+ const dividerFrame = {
249
+ width: 1,
250
+ height: 26
313
251
  };
314
252
  export default PlayButtonView;
315
253
  //# sourceMappingURL=PlayButtonView.js.map