livevoice-sdk-react-native 2.0.1 → 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.
- package/README.md +105 -66
- package/android/build.gradle +5 -4
- package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +122 -188
- package/android/src/main/java/io/livevoice/react/__SDK.kt +2 -2
- package/ios/LiveVoiceRNBridge.swift +362 -0
- package/ios/LiveVoiceSdkReactNative.mm +187 -158
- package/ios/__SDK.h +1 -1
- package/ios/livevoice_spm_backport.rb +202 -0
- package/lib/module/components/BrandingView.js +58 -39
- package/lib/module/components/BrandingView.js.map +1 -1
- package/lib/module/components/ChannelView.js +355 -44
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/ErrorView.js +5 -6
- package/lib/module/components/ErrorView.js.map +1 -1
- package/lib/module/components/LiveVoiceSpinner.js +81 -0
- package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
- package/lib/module/components/LiveVoiceView.js +311 -133
- package/lib/module/components/LiveVoiceView.js.map +1 -1
- package/lib/module/components/PasswordPrompt.js +165 -0
- package/lib/module/components/PasswordPrompt.js.map +1 -0
- package/lib/module/components/PlayButtonView.js +180 -244
- package/lib/module/components/PlayButtonView.js.map +1 -1
- package/lib/module/components/ReconnectingView.js +31 -53
- package/lib/module/components/ReconnectingView.js.map +1 -1
- package/lib/module/icons/branding-ios.png +0 -0
- package/lib/module/icons/camera-off-android.png +0 -0
- package/lib/module/icons/camera-off-android@2x.png +0 -0
- package/lib/module/icons/camera-off-android@3x.png +0 -0
- package/lib/module/icons/cpu-android.png +0 -0
- package/lib/module/icons/cpu-android@2x.png +0 -0
- package/lib/module/icons/cpu-android@3x.png +0 -0
- package/lib/module/icons/cpu-ios.png +0 -0
- package/lib/module/icons/cpu-ios@2x.png +0 -0
- package/lib/module/icons/cpu-ios@3x.png +0 -0
- package/lib/module/icons/lock-android.png +0 -0
- package/lib/module/icons/lock-android@2x.png +0 -0
- package/lib/module/icons/lock-android@3x.png +0 -0
- package/lib/module/icons/lock-ios.png +0 -0
- package/lib/module/icons/lock-ios@2x.png +0 -0
- package/lib/module/icons/lock-ios@3x.png +0 -0
- package/lib/module/icons/mic-off-android.png +0 -0
- package/lib/module/icons/mic-off-android@2x.png +0 -0
- package/lib/module/icons/mic-off-android@3x.png +0 -0
- package/lib/module/icons/mic-slash-ios.png +0 -0
- package/lib/module/icons/mic-slash-ios@2x.png +0 -0
- package/lib/module/icons/mic-slash-ios@3x.png +0 -0
- package/lib/module/icons/video-slash-ios.png +0 -0
- package/lib/module/icons/video-slash-ios@2x.png +0 -0
- package/lib/module/icons/video-slash-ios@3x.png +0 -0
- package/lib/module/index.js +11 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/Bridge.js +236 -0
- package/lib/module/sdk/Bridge.js.map +1 -0
- package/lib/module/sdk/Event.js +160 -0
- package/lib/module/sdk/Event.js.map +1 -0
- package/lib/module/sdk/Lifecycle.js +331 -0
- package/lib/module/sdk/Lifecycle.js.map +1 -0
- package/lib/module/sdk/LiveVoiceSdk.js +262 -268
- package/lib/module/sdk/LiveVoiceSdk.js.map +1 -1
- package/lib/module/sdk/LiveVoiceState.js +208 -40
- package/lib/module/sdk/LiveVoiceState.js.map +1 -1
- package/lib/module/sdk/LogEntries.js +99 -0
- package/lib/module/sdk/LogEntries.js.map +1 -0
- package/lib/module/sdk/Models.js +2 -0
- package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
- package/lib/module/{util/PlayingState.js → sdk/NativeSdkVersions.js} +9 -8
- package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
- package/lib/module/sdk/Observables.js +391 -0
- package/lib/module/sdk/Observables.js.map +1 -0
- package/lib/module/sdk/Passwords.js +298 -0
- package/lib/module/sdk/Passwords.js.map +1 -0
- package/lib/module/sdk/Playback.js +35 -0
- package/lib/module/sdk/Playback.js.map +1 -0
- package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
- package/lib/module/util/Colors.js +2 -1
- package/lib/module/util/Colors.js.map +1 -1
- package/lib/module/util/Translations.js +34 -11
- package/lib/module/util/Translations.js.map +1 -1
- package/lib/module/util/freeze.js +26 -0
- package/lib/module/util/freeze.js.map +1 -0
- package/lib/module/util/logger.js +79 -41
- package/lib/module/util/logger.js.map +1 -1
- package/lib/typescript/src/components/BrandingView.d.ts +4 -0
- package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
- package/lib/typescript/src/components/ChannelView.d.ts +29 -3
- package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
- package/lib/typescript/src/components/ErrorView.d.ts +5 -3
- package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
- package/lib/typescript/src/components/LiveVoiceView.d.ts +81 -21
- package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
- package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
- package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
- package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
- package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
- package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
- package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +15 -6
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
- package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Event.d.ts +97 -0
- package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +195 -190
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts +77 -9
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -1
- package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
- package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Models.d.ts +114 -0
- package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Observables.d.ts +123 -0
- package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
- package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Playback.d.ts +9 -0
- package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +34 -31
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/util/Colors.d.ts.map +1 -1
- package/lib/typescript/src/util/Translations.d.ts +30 -8
- package/lib/typescript/src/util/Translations.d.ts.map +1 -1
- package/lib/typescript/src/util/freeze.d.ts +6 -0
- package/lib/typescript/src/util/freeze.d.ts.map +1 -0
- package/lib/typescript/src/util/logger.d.ts +17 -7
- package/lib/typescript/src/util/logger.d.ts.map +1 -1
- package/livevoice-sdk-react-native.podspec +29 -4
- package/package.json +12 -9
- package/src/components/BrandingView.tsx +42 -55
- package/src/components/ChannelView.tsx +329 -38
- package/src/components/ErrorView.tsx +9 -12
- package/src/components/LiveVoiceSpinner.tsx +87 -0
- package/src/components/LiveVoiceView.tsx +319 -201
- package/src/components/PasswordPrompt.tsx +144 -0
- package/src/components/PlayButtonView.tsx +165 -269
- package/src/components/ReconnectingView.tsx +28 -81
- package/src/icons/branding-ios.png +0 -0
- package/src/icons/camera-off-android.png +0 -0
- package/src/icons/camera-off-android@2x.png +0 -0
- package/src/icons/camera-off-android@3x.png +0 -0
- package/src/icons/cpu-android.png +0 -0
- package/src/icons/cpu-android@2x.png +0 -0
- package/src/icons/cpu-android@3x.png +0 -0
- package/src/icons/cpu-ios.png +0 -0
- package/src/icons/cpu-ios@2x.png +0 -0
- package/src/icons/cpu-ios@3x.png +0 -0
- package/src/icons/lock-android.png +0 -0
- package/src/icons/lock-android@2x.png +0 -0
- package/src/icons/lock-android@3x.png +0 -0
- package/src/icons/lock-ios.png +0 -0
- package/src/icons/lock-ios@2x.png +0 -0
- package/src/icons/lock-ios@3x.png +0 -0
- package/src/icons/mic-off-android.png +0 -0
- package/src/icons/mic-off-android@2x.png +0 -0
- package/src/icons/mic-off-android@3x.png +0 -0
- package/src/icons/mic-slash-ios.png +0 -0
- package/src/icons/mic-slash-ios@2x.png +0 -0
- package/src/icons/mic-slash-ios@3x.png +0 -0
- package/src/icons/video-slash-ios.png +0 -0
- package/src/icons/video-slash-ios@2x.png +0 -0
- package/src/icons/video-slash-ios@3x.png +0 -0
- package/src/index.tsx +92 -6
- package/src/sdk/Bridge.ts +259 -0
- package/src/sdk/Event.ts +187 -0
- package/src/sdk/Lifecycle.ts +366 -0
- package/src/sdk/LiveVoiceSdk.ts +285 -309
- package/src/sdk/LiveVoiceState.ts +230 -60
- package/src/sdk/LogEntries.ts +88 -0
- package/src/sdk/Models.ts +129 -0
- package/src/{util/PlayingState.ts → sdk/NativeSdkVersions.ts} +7 -6
- package/src/sdk/Observables.ts +414 -0
- package/src/sdk/Passwords.ts +286 -0
- package/src/sdk/Playback.ts +30 -0
- package/src/specs/NativeLiveVoiceSdk.ts +42 -38
- package/src/util/Colors.ts +2 -1
- package/src/util/Translations.ts +34 -12
- package/src/util/freeze.ts +23 -0
- package/src/util/logger.ts +79 -52
- package/lib/module/components/AudioOutputSwitchView.js +0 -138
- package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
- package/lib/module/components/index.js +0 -24
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/icons/mic.png +0 -0
- package/lib/module/util/ForegroundServiceConfig.js +0 -38
- package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
- package/lib/module/util/PlayingState.js.map +0 -1
- package/lib/module/util/UIState.js +0 -4
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
- package/lib/typescript/src/components/index.d.ts +0 -9
- package/lib/typescript/src/components/index.d.ts.map +0 -1
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -19
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
- package/lib/typescript/src/util/PlayingState.d.ts +0 -7
- package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
- package/lib/typescript/src/util/UIState.d.ts +0 -86
- package/lib/typescript/src/util/UIState.d.ts.map +0 -1
- package/src/components/AudioOutputSwitchView.tsx +0 -146
- package/src/components/index.tsx +0 -21
- package/src/icons/mic.png +0 -0
- package/src/util/ForegroundServiceConfig.tsx +0 -42
- package/src/util/UIState.ts +0 -106
|
@@ -14,61 +14,80 @@
|
|
|
14
14
|
//===----------------------------------------------------------------------===//
|
|
15
15
|
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import {
|
|
18
|
-
import { COLORS } from "../util/Colors.js";
|
|
17
|
+
import { Image, Platform, Pressable, StyleSheet, Text, useColorScheme } from 'react-native';
|
|
19
18
|
import { openLiveVoiceWebsite } from "../sdk/LiveVoiceSdk.js";
|
|
19
|
+
import { Translations } from "../util/Translations.js";
|
|
20
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
/**
|
|
22
|
+
* The "Live Audio Streaming by LiveVoice" footer, drawn exactly as the native SDK of the platform
|
|
23
|
+
* draws it: iOS `LogoView`, Android `LiveVoiceSdkBranding`. Change them together.
|
|
24
|
+
*/
|
|
21
25
|
export const BrandingView = props => {
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/
|
|
27
|
-
onPress:
|
|
28
|
-
|
|
29
|
-
width: '100%',
|
|
30
|
-
alignItems: 'center'
|
|
26
|
+
const scheme = useColorScheme();
|
|
27
|
+
const isDarkMode = props.isDarkMode ?? scheme === 'dark';
|
|
28
|
+
// Both native footers draw the text and the logo in plain black or white.
|
|
29
|
+
const color = isDarkMode ? '#FFFFFF' : '#000000';
|
|
30
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
31
|
+
onPress: () => {
|
|
32
|
+
openLiveVoiceWebsite();
|
|
31
33
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
})
|
|
34
|
+
style: styles.container,
|
|
35
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
36
|
+
style: [styles.text, {
|
|
37
|
+
color
|
|
38
|
+
}],
|
|
39
|
+
allowFontScaling: Platform.OS !== 'ios',
|
|
40
|
+
children: Translations.streamingByTitle()
|
|
41
|
+
}), /*#__PURE__*/_jsx(Image, {
|
|
42
|
+
source: Platform.OS === 'ios' ? require('../icons/branding-ios.png') : require('../icons/branding.png'),
|
|
43
|
+
style: [styles.logo, {
|
|
44
|
+
tintColor: color
|
|
45
|
+
}],
|
|
46
|
+
resizeMode: "contain"
|
|
47
|
+
})]
|
|
46
48
|
});
|
|
47
49
|
};
|
|
48
|
-
const styles = StyleSheet.create({
|
|
50
|
+
const styles = StyleSheet.create(Platform.OS === 'ios' ? {
|
|
51
|
+
// iOS: `.padding()` (16 pt) around a 4 pt stack of a fixed 12 pt medium text and the logo
|
|
52
|
+
// set 100 pt wide. The logo artwork keeps the margins of the SDK's SVG (196 × 48).
|
|
49
53
|
container: {
|
|
50
|
-
|
|
54
|
+
alignSelf: 'center',
|
|
51
55
|
alignItems: 'center',
|
|
52
|
-
|
|
53
|
-
borderRadius: 8,
|
|
54
|
-
width: 250
|
|
56
|
+
padding: 16
|
|
55
57
|
},
|
|
56
58
|
text: {
|
|
57
59
|
textAlign: 'center',
|
|
58
|
-
fontSize:
|
|
60
|
+
fontSize: 12,
|
|
59
61
|
fontWeight: '500',
|
|
60
62
|
marginBottom: 4
|
|
61
63
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
logo: {
|
|
65
|
+
width: 100,
|
|
66
|
+
height: 100 * 48 / 196
|
|
67
|
+
}
|
|
68
|
+
} : {
|
|
69
|
+
// Android: 8 dp above (from the view), below and at the sides; bodyMedium text and a
|
|
70
|
+
// 92 × 28 dp logo, each inset 8 dp more at the sides.
|
|
71
|
+
container: {
|
|
72
|
+
alignSelf: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
paddingTop: 8,
|
|
75
|
+
paddingBottom: 8,
|
|
76
|
+
paddingHorizontal: 8
|
|
64
77
|
},
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
text: {
|
|
79
|
+
textAlign: 'center',
|
|
80
|
+
fontSize: 14,
|
|
81
|
+
lineHeight: 20,
|
|
82
|
+
letterSpacing: 0.25,
|
|
83
|
+
fontWeight: '400',
|
|
84
|
+
includeFontPadding: false,
|
|
85
|
+
marginHorizontal: 8
|
|
67
86
|
},
|
|
68
|
-
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
71
|
-
|
|
87
|
+
logo: {
|
|
88
|
+
width: 92,
|
|
89
|
+
height: 28,
|
|
90
|
+
marginHorizontal: 8
|
|
72
91
|
}
|
|
73
92
|
});
|
|
74
93
|
//# sourceMappingURL=BrandingView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","Image","Platform","Pressable","StyleSheet","Text","useColorScheme","openLiveVoiceWebsite","Translations","jsx","_jsx","jsxs","_jsxs","BrandingView","props","scheme","isDarkMode","color","onPress","style","styles","container","children","text","allowFontScaling","OS","streamingByTitle","source","require","logo","tintColor","resizeMode","create","alignSelf","alignItems","padding","textAlign","fontSize","fontWeight","marginBottom","width","height","paddingTop","paddingBottom","paddingHorizontal","lineHeight","letterSpacing","includeFontPadding","marginHorizontal"],"sourceRoot":"../../../src","sources":["components/BrandingView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,cAAc,QAAQ,cAAc;AAE3F,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,YAAY,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMpD;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAqC,GAAIC,KAAK,IAAK;EAC9D,MAAMC,MAAM,GAAGT,cAAc,CAAC,CAAC;EAC/B,MAAMU,UAAU,GAAGF,KAAK,CAACE,UAAU,IAAID,MAAM,KAAK,MAAM;EACxD;EACA,MAAME,KAAK,GAAGD,UAAU,GAAG,SAAS,GAAG,SAAS;EAEhD,oBACEJ,KAAA,CAACT,SAAS;IAACe,OAAO,EAAEA,CAAA,KAAM;MAAEX,oBAAoB,CAAC,CAAC;IAAE,CAAE;IAACY,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAC7EZ,IAAA,CAACL,IAAI;MAACc,KAAK,EAAE,CAACC,MAAM,CAACG,IAAI,EAAE;QAAEN;MAAM,CAAC,CAAE;MAACO,gBAAgB,EAAEtB,QAAQ,CAACuB,EAAE,KAAK,KAAM;MAAAH,QAAA,EAC5Ed,YAAY,CAACkB,gBAAgB,CAAC;IAAC,CAC5B,CAAC,eACPhB,IAAA,CAACT,KAAK;MACJ0B,MAAM,EAAEzB,QAAQ,CAACuB,EA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//===----------------------------------------------------------------------===//
|
|
15
15
|
|
|
16
16
|
import React, { useState } from 'react';
|
|
17
|
-
import { View, Text, StyleSheet, TouchableOpacity, useColorScheme, Image } from 'react-native';
|
|
18
|
-
import { COLORS } from "../util/Colors.js";
|
|
17
|
+
import { View, Text, StyleSheet, TouchableOpacity, useColorScheme, useWindowDimensions, Image, Platform } from 'react-native';
|
|
19
18
|
import PlayButtonView from "./PlayButtonView.js";
|
|
20
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
/**
|
|
21
|
+
* The default channel cell, drawn as the native SDK of the platform draws its row (iOS
|
|
22
|
+
* `ChannelCellView` in the `.sdk` mode, Android `DefaultChannel`; change them together). Where
|
|
23
|
+
* the two natives differed in behaviour, both follow iOS: the status rule, the expanded name, the
|
|
24
|
+
* dimming during the reconnect grace.
|
|
25
|
+
*/
|
|
21
26
|
export const ChannelView = ({
|
|
22
27
|
channelName,
|
|
23
28
|
playingState,
|
|
24
|
-
muted,
|
|
25
29
|
isOnline,
|
|
26
30
|
hasAudio,
|
|
27
31
|
hasSubtitles,
|
|
32
|
+
status = null,
|
|
33
|
+
muteMark = null,
|
|
34
|
+
isPasswordProtected = false,
|
|
28
35
|
isDarkMode = useColorScheme() === 'dark',
|
|
36
|
+
isDimmed = false,
|
|
37
|
+
brandColor = null,
|
|
38
|
+
subtitlesOpen = false,
|
|
39
|
+
accessibility = null,
|
|
29
40
|
onAudioPress,
|
|
30
41
|
onSubtitlesPress
|
|
31
42
|
}) => {
|
|
32
|
-
const [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const [isExpanded, setExpanded] = useState(false);
|
|
44
|
+
/** How many lines the whole name takes at the column's width. */
|
|
45
|
+
const [nameLines, setNameLines] = useState(1);
|
|
46
|
+
// As iOS: a tap opens a name that does not fit one line to at most 4, and the row then aligns
|
|
47
|
+
// to the top; one that fits stays as it is.
|
|
48
|
+
const isOpen = isExpanded && nameLines > 1;
|
|
49
|
+
const look = cellLook(isDarkMode, useWindowDimensions().fontScale);
|
|
50
|
+
const onSubtitles = isDimmed ? () => {} : onSubtitlesPress;
|
|
51
|
+
// An accessibility action does what a tap on the matching half does.
|
|
52
|
+
const run = kind => {
|
|
53
|
+
if (kind === 'toggleAudio') onAudioPress?.();else if (kind === 'toggleSubtitles') onSubtitles?.();
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/_jsx(View, {
|
|
56
|
+
...(accessibility === null ? null : rowAccessibility(accessibility, run)),
|
|
57
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
58
|
+
style: [styles.container, {
|
|
59
|
+
alignItems: isOpen ? 'flex-start' : 'center'
|
|
60
|
+
}],
|
|
61
|
+
...(accessibility === null ? null : hiddenFromAccessibility),
|
|
62
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
63
|
+
style: [styles.button, {
|
|
64
|
+
opacity: isDimmed ? 0.5 : 1
|
|
65
|
+
}],
|
|
66
|
+
children: /*#__PURE__*/_jsx(PlayButtonView, {
|
|
67
|
+
playingState: playingState,
|
|
68
|
+
onAudioPress: onAudioPress,
|
|
69
|
+
onSubtitlesPress: onSubtitles,
|
|
70
|
+
isDarkMode: isDarkMode,
|
|
71
|
+
isChannelOnline: isOnline,
|
|
72
|
+
hasAudio: hasAudio,
|
|
73
|
+
hasSubtitles: hasSubtitles,
|
|
74
|
+
brandColor: brandColor,
|
|
75
|
+
subtitlesOpen: subtitlesOpen
|
|
76
|
+
})
|
|
77
|
+
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
78
|
+
style: look.title,
|
|
79
|
+
onPress: () => setExpanded(!isExpanded),
|
|
51
80
|
activeOpacity: 1,
|
|
52
|
-
children: /*#__PURE__*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
82
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
83
|
+
numberOfLines: isOpen ? 4 : 1,
|
|
84
|
+
ellipsizeMode: "tail",
|
|
85
|
+
style: look.name,
|
|
86
|
+
children: channelName
|
|
87
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
88
|
+
style: [look.name, styles.measure],
|
|
89
|
+
importantForAccessibility: "no-hide-descendants",
|
|
90
|
+
accessibilityElementsHidden: true,
|
|
91
|
+
onTextLayout: event => setNameLines(event.nativeEvent.lines.length),
|
|
92
|
+
children: channelName
|
|
93
|
+
})]
|
|
94
|
+
}), status !== null && /*#__PURE__*/_jsxs(View, {
|
|
95
|
+
style: look.statusRow,
|
|
96
|
+
children: [status.showsAiIcon && /*#__PURE__*/_jsx(Image, {
|
|
97
|
+
source: look.cpu.source,
|
|
98
|
+
style: [look.cpu.style, {
|
|
99
|
+
tintColor: look.status.color
|
|
100
|
+
}]
|
|
101
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
102
|
+
numberOfLines: 1,
|
|
103
|
+
style: [look.status, status.showsAiIcon ? look.cpu.text : null],
|
|
104
|
+
children: [status.showsAiIcon ? look.cpu.before : '', status.text]
|
|
105
|
+
})]
|
|
106
|
+
})]
|
|
107
|
+
}), look.spacer && /*#__PURE__*/_jsx(View, {
|
|
108
|
+
style: styles.spacer
|
|
109
|
+
}), muteMark !== null && /*#__PURE__*/_jsx(View, {
|
|
110
|
+
style: look.mute.frame,
|
|
111
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
112
|
+
source: look.mute[muteMark].source,
|
|
113
|
+
style: look.mute[muteMark].style
|
|
59
114
|
})
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
|
|
115
|
+
}), isPasswordProtected && /*#__PURE__*/_jsx(View, {
|
|
116
|
+
style: look.lock.frame,
|
|
117
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
118
|
+
source: look.lock.source,
|
|
119
|
+
style: look.lock.style
|
|
120
|
+
})
|
|
121
|
+
})]
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/** The system grey of the mute mark and the lock: iOS `.gray`, Android `RawColors.systemGray`. */
|
|
127
|
+
const systemGray = '#8E8E93';
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The row's type, colours and marks on this platform.
|
|
131
|
+
*
|
|
132
|
+
* - iOS (`ChannelCellView.swift`): the name `.headline` (17 pt semibold) in `.primary`; the status
|
|
133
|
+
* `.caption` (12 pt) in `.secondary`, `Text(Image("cpu")) + " " + Text(status)` for an AI
|
|
134
|
+
* speaker; the mute mark `mic.slash.fill` or `video.slash.fill` and the lock `lock.fill`, each at
|
|
135
|
+
* its natural size centred in a 30 pt frame, 12 apart and 12 after the flexible space (at least
|
|
136
|
+
* 8) that follows the name. The glyphs are UIKit's renders at `.body` and `.caption`, sized by
|
|
137
|
+
* their point sizes.
|
|
138
|
+
* - Android (`DefaultChannel.kt`, `ChannelNameAndStatus.kt`, `ChannelMuteIcon.kt`): the name
|
|
139
|
+
* `titleMedium` (16 sp, 500, line height 24, letter spacing 0.15) in `onBackground`; the status
|
|
140
|
+
* `bodySmall` (12 sp, line height 16, letter spacing 0.4) in `onBackgroundInactive`,
|
|
141
|
+
* `livevoice_ic_cpu` 16 dp and 4 dp before an AI speaker's; the mute mark
|
|
142
|
+
* `livevoice_ic_microphone_off` or `livevoice_ic_camera_off` 24 dp right after the name; the
|
|
143
|
+
* lock `livevoice_ic_lock` in a 30 dp frame with 5 dp padding, 12 dp after.
|
|
144
|
+
*
|
|
145
|
+
* `fontScale` is the system text size React Native applies to text; only the iOS `cpu` uses it, to
|
|
146
|
+
* keep its baseline on the text's.
|
|
147
|
+
*/
|
|
148
|
+
function cellLook(isDarkMode, fontScale) {
|
|
149
|
+
if (Platform.OS === 'ios') {
|
|
150
|
+
// The `cpu` symbol in the caption line, as `Text(Image)`: its baseline, 2.33 above its bottom,
|
|
151
|
+
// on the text's, which lies the caption font's ascender (11.43 at 12 pt) below the line's top.
|
|
152
|
+
// Whichever of the two would start higher starts the row; the other moves down.
|
|
153
|
+
const cpuTop = 11.43 * fontScale - (40 / 3 - 7 / 3);
|
|
154
|
+
return {
|
|
155
|
+
name: {
|
|
156
|
+
fontSize: 17,
|
|
157
|
+
fontWeight: '600',
|
|
158
|
+
color: isDarkMode ? '#FFFFFF' : '#000000'
|
|
159
|
+
},
|
|
160
|
+
status: {
|
|
161
|
+
fontSize: 12,
|
|
162
|
+
fontWeight: '400',
|
|
163
|
+
color: isDarkMode ? 'rgba(235, 235, 245, 0.6)' : 'rgba(60, 60, 67, 0.6)'
|
|
164
|
+
},
|
|
165
|
+
statusRow: styles.statusIos,
|
|
166
|
+
cpu: {
|
|
167
|
+
source: require('../icons/cpu-ios.png'),
|
|
168
|
+
style: {
|
|
169
|
+
width: 44 / 3,
|
|
170
|
+
height: 40 / 3,
|
|
171
|
+
marginTop: Math.max(0, cpuTop)
|
|
172
|
+
},
|
|
173
|
+
text: {
|
|
174
|
+
marginTop: Math.max(0, -cpuTop)
|
|
175
|
+
},
|
|
176
|
+
// The space of `+ " " +`, in the caption font.
|
|
177
|
+
before: ' '
|
|
178
|
+
},
|
|
179
|
+
// As wide as the name needs; the flexible space after it takes the rest.
|
|
180
|
+
title: styles.titleShrinks,
|
|
181
|
+
spacer: true,
|
|
182
|
+
mute: {
|
|
183
|
+
frame: styles.iosMark,
|
|
184
|
+
microphone: {
|
|
185
|
+
source: require('../icons/mic-slash-ios.png'),
|
|
186
|
+
style: {
|
|
187
|
+
width: 17,
|
|
188
|
+
height: 20,
|
|
189
|
+
tintColor: systemGray
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
camera: {
|
|
193
|
+
source: require('../icons/video-slash-ios.png'),
|
|
194
|
+
style: {
|
|
195
|
+
width: 25,
|
|
196
|
+
height: 67 / 3,
|
|
197
|
+
tintColor: systemGray
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
lock: {
|
|
202
|
+
frame: styles.iosMark,
|
|
203
|
+
source: require('../icons/lock-ios.png'),
|
|
204
|
+
style: {
|
|
205
|
+
width: 16,
|
|
206
|
+
height: 55 / 3,
|
|
207
|
+
tintColor: systemGray
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
name: {
|
|
214
|
+
fontSize: 16,
|
|
215
|
+
fontWeight: '500',
|
|
216
|
+
lineHeight: 24,
|
|
217
|
+
letterSpacing: 0.15,
|
|
218
|
+
includeFontPadding: false,
|
|
219
|
+
color: isDarkMode ? '#FFFFFF' : '#191919'
|
|
220
|
+
},
|
|
221
|
+
status: {
|
|
222
|
+
fontSize: 12,
|
|
223
|
+
fontWeight: '400',
|
|
224
|
+
lineHeight: 16,
|
|
225
|
+
letterSpacing: 0.4,
|
|
226
|
+
includeFontPadding: false,
|
|
227
|
+
color: isDarkMode ? '#8B9299' : '#6D757D'
|
|
228
|
+
},
|
|
229
|
+
statusRow: styles.statusAndroid,
|
|
230
|
+
cpu: {
|
|
231
|
+
source: require('../icons/cpu-android.png'),
|
|
232
|
+
style: {
|
|
233
|
+
width: 16,
|
|
234
|
+
height: 16,
|
|
235
|
+
marginRight: 4
|
|
236
|
+
},
|
|
237
|
+
text: null,
|
|
238
|
+
before: ''
|
|
239
|
+
},
|
|
240
|
+
// The rest of the row (`weight(1f)`), so the mute mark sits at its end.
|
|
241
|
+
title: styles.titleFills,
|
|
242
|
+
spacer: false,
|
|
243
|
+
mute: {
|
|
244
|
+
frame: styles.androidMute,
|
|
245
|
+
microphone: {
|
|
246
|
+
source: require('../icons/mic-off-android.png'),
|
|
247
|
+
style: {
|
|
248
|
+
width: 24,
|
|
249
|
+
height: 24,
|
|
250
|
+
tintColor: systemGray
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
camera: {
|
|
254
|
+
source: require('../icons/camera-off-android.png'),
|
|
255
|
+
style: {
|
|
256
|
+
width: 24,
|
|
257
|
+
height: 24,
|
|
258
|
+
tintColor: systemGray
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
lock: {
|
|
263
|
+
frame: styles.androidLock,
|
|
264
|
+
source: require('../icons/lock-android.png'),
|
|
63
265
|
style: {
|
|
64
|
-
tintColor: iconColor,
|
|
65
266
|
width: 20,
|
|
66
267
|
height: 20,
|
|
67
|
-
|
|
268
|
+
tintColor: systemGray
|
|
68
269
|
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/** The row's parts, which the row's own element speaks for. */
|
|
275
|
+
const hiddenFromAccessibility = {
|
|
276
|
+
importantForAccessibility: 'no-hide-descendants',
|
|
277
|
+
accessibilityElementsHidden: true
|
|
71
278
|
};
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* React Native clears an Android view's whole content description, label included, when its
|
|
282
|
+
* `accessibilityValue` goes away, and keeps a stale value when one without `text` replaces it. An
|
|
283
|
+
* empty value is therefore a value whose `text` is `null`: no value on either platform.
|
|
284
|
+
*/
|
|
285
|
+
const noValue = {
|
|
286
|
+
text: null
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The row as one accessibility element, exactly as native computed it: its label, value, button
|
|
291
|
+
* role and selected state, what a double tap does, and the named actions in the native order.
|
|
292
|
+
*
|
|
293
|
+
* - iOS: VoiceOver's double tap is `onAccessibilityTap`, a no-op without an activation (the
|
|
294
|
+
* default would tap the row's middle). Every named action is a custom action, as the native row
|
|
295
|
+
* lists play or stop beside the double tap.
|
|
296
|
+
* - Android: TalkBack's double tap is the click, named after the activation's own action, as the
|
|
297
|
+
* native row's click label; TalkBack lists it with the actions, so the activation's entry
|
|
298
|
+
* becomes that click instead of a second action of the same name.
|
|
299
|
+
*/
|
|
300
|
+
function rowAccessibility(accessibility, run) {
|
|
301
|
+
const {
|
|
302
|
+
activation
|
|
303
|
+
} = accessibility;
|
|
304
|
+
const click = Platform.OS === 'android' && activation !== null ? accessibility.actions.findIndex(action => action.kind === activation) : -1;
|
|
305
|
+
const actions = accessibility.actions.map((action, index) => ({
|
|
306
|
+
name: index === click ? 'activate' : action.kind,
|
|
307
|
+
label: action.name
|
|
308
|
+
}));
|
|
309
|
+
if (Platform.OS === 'android' && activation !== null && click < 0) actions.unshift({
|
|
310
|
+
name: 'activate'
|
|
311
|
+
});
|
|
312
|
+
return {
|
|
313
|
+
accessible: true,
|
|
314
|
+
accessibilityLabel: accessibility.label,
|
|
315
|
+
accessibilityValue: accessibility.value === '' ? noValue : {
|
|
316
|
+
text: accessibility.value
|
|
317
|
+
},
|
|
318
|
+
accessibilityRole: accessibility.isButton ? 'button' : undefined,
|
|
319
|
+
accessibilityState: {
|
|
320
|
+
selected: accessibility.isSelected
|
|
321
|
+
},
|
|
322
|
+
accessibilityActions: actions,
|
|
323
|
+
onAccessibilityTap: () => run(activation),
|
|
324
|
+
onAccessibilityAction: ({
|
|
325
|
+
nativeEvent: {
|
|
326
|
+
actionName
|
|
327
|
+
}
|
|
328
|
+
}) => {
|
|
329
|
+
if (actionName === 'activate') run(activation);else if (actionName === 'toggleAudio' || actionName === 'toggleSubtitles') run(actionName);
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
72
333
|
const styles = StyleSheet.create({
|
|
334
|
+
// 12 at the sides (iOS `defaultCellInsets`, Android `padding(horizontal = 12.dp)`), 8 above and below.
|
|
73
335
|
container: {
|
|
74
336
|
flexDirection: 'row',
|
|
75
|
-
alignItems: 'center',
|
|
76
337
|
paddingHorizontal: 12,
|
|
77
338
|
paddingVertical: 8
|
|
78
339
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
340
|
+
// 2 above and below the button, so a row is 64 tall, and 12 to the name.
|
|
341
|
+
button: {
|
|
342
|
+
paddingVertical: 2,
|
|
343
|
+
marginRight: 12
|
|
344
|
+
},
|
|
345
|
+
// The name and the status line.
|
|
346
|
+
titleShrinks: {
|
|
347
|
+
flexShrink: 1
|
|
348
|
+
},
|
|
349
|
+
// Android: the rest of the row, 20 clear of the marks as iOS's spacing of 12 and Spacer of 8.
|
|
350
|
+
titleFills: {
|
|
351
|
+
flex: 1,
|
|
352
|
+
marginRight: 20
|
|
353
|
+
},
|
|
354
|
+
measure: {
|
|
355
|
+
position: 'absolute',
|
|
356
|
+
left: 0,
|
|
357
|
+
right: 0,
|
|
358
|
+
top: 0,
|
|
359
|
+
opacity: 0
|
|
360
|
+
},
|
|
361
|
+
// iOS: the `cpu` placed on the text's baseline from the top; Android: centred, as its `Row`.
|
|
362
|
+
statusIos: {
|
|
363
|
+
flexDirection: 'row',
|
|
364
|
+
alignItems: 'flex-start',
|
|
365
|
+
marginTop: 2
|
|
366
|
+
},
|
|
367
|
+
statusAndroid: {
|
|
368
|
+
flexDirection: 'row',
|
|
369
|
+
alignItems: 'center',
|
|
370
|
+
marginTop: 2
|
|
371
|
+
},
|
|
372
|
+
// iOS's `Spacer()`: at least the default spacing of 8, 12 from the name beside it.
|
|
373
|
+
spacer: {
|
|
374
|
+
flexGrow: 1,
|
|
375
|
+
minWidth: 8,
|
|
376
|
+
marginLeft: 12
|
|
377
|
+
},
|
|
378
|
+
iosMark: {
|
|
379
|
+
width: 30,
|
|
380
|
+
height: 30,
|
|
381
|
+
marginLeft: 12,
|
|
382
|
+
alignItems: 'center',
|
|
383
|
+
justifyContent: 'center'
|
|
384
|
+
},
|
|
385
|
+
// `ChannelMuteIcon`: the 24 dp glyph centred in a 30 dp frame, 12 after the name's gap.
|
|
386
|
+
androidMute: {
|
|
387
|
+
width: 30,
|
|
388
|
+
height: 30,
|
|
389
|
+
marginLeft: 12,
|
|
390
|
+
alignItems: 'center',
|
|
391
|
+
justifyContent: 'center'
|
|
82
392
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
393
|
+
androidLock: {
|
|
394
|
+
width: 30,
|
|
395
|
+
height: 30,
|
|
396
|
+
padding: 5,
|
|
397
|
+
marginLeft: 12
|
|
87
398
|
}
|
|
88
399
|
});
|
|
89
400
|
//# sourceMappingURL=ChannelView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","Text","StyleSheet","TouchableOpacity","useColorScheme","Image","COLORS","PlayButtonView","jsx","_jsx","jsxs","_jsxs","ChannelView","channelName","playingState","muted","isOnline","hasAudio","hasSubtitles","isDarkMode","onAudioPress","onSubtitlesPress","collapsed","setCollapsed","iconColor","white","black","style","styles","container","children","isChannelOnline","flex","marginLeft","onPress","activeOpacity","numberOfLines","undefined","ellipsizeMode","text","color","source","require","tintColor","width","height","resizeMode","create","flexDirection","alignItems","paddingHorizontal","paddingVertical","fontSize","fontWeight","aiText"],"sourceRoot":"../../../src","sources":["components/ChannelView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,KAAK,QAAQ,cAAc;AAC9F,SAASC,MAAM,QAAQ,mBAAgB;AAEvC,OAAOC,cAAc,MAAM,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAe9C,OAAO,MAAMC,WAAmC,GAAGA,CAAC;EAClDC,WAAW;EACXC,YAAY;EACZC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EACZC,UAAU,GAAGf,cAAc,CAAC,CAAC,KAAK,MAAM;EACxCgB,YAAY;EACZC;AACF,CAAC,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QAAEC,UAAU,EAAE;MAAU;IAAE,CAAE,CAAC;EAAA,CAEjF,CAAC;AAEX,CAAC;AAED,MAAMlB,MAAM,GAAG1B,UAAU,CAAC6C,MAAM,CAAC;EAC/BlB,SAAS,EAAE;IACTmB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDZ,IAAI,EAAE;IACJa,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDC,MAAM,EAAE;IACNF,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBpB,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useState","View","Text","StyleSheet","TouchableOpacity","useColorScheme","useWindowDimensions","Image","Platform","PlayButtonView","jsx","_jsx","jsxs","_jsxs","ChannelView","channelName","playingState","isOnline","hasAudio","hasSubtitles","status","muteMark","isPasswordProtected","isDarkMode","isDimmed","brandColor","subtitlesOpen","accessibility","onAudioPress","onSubtitlesPress","isExpanded","setExpanded","nameLines","setNameLines","isOpen","look","cellLook","fontScale","onSubtitles","run","kind","rowAccessibility","children","style","styles","container","alignItems","hiddenFromAccessibility","button","opacity","isChannelOnline","title","onPress","activeOpacity","numberOfLines","ellipsizeMode","name","measure","importantForAccessibility","accessibilityElementsHidden","onTextLayout","event","nativeEvent","lines","length","statusRow","showsAiIcon","source","cpu","tintColor","color","text","before","spacer","mute","frame","lock","systemGray","OS","cpuTop","fontSize","fontWeight","statusIos","require","width","height","marginTop","Math","max","titleShrinks","iosMark","microphone","camera","lineHeight","letterSpacing","includeFontPadding","statusAndroid","marginRight","titleFills","androidMute","androidLock","noValue","activation","click","actions","findIndex","action","map","index","label","unshift","accessible","accessibilityLabel","accessibilityValue","value","accessibilityRole","isButton","undefined","accessibilityState","selected","isSelected","accessibilityActions","onAccessibilityTap","onAccessibilityAction","actionName","create","flexDirection","paddingHorizontal","paddingVertical","flexShrink","flex","position","left","right","top","flexGrow","minWidth","marginLeft","justifyContent","padding"],"sourceRoot":"../../../src","sources":["components/ChannelView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,EACdC,mBAAmB,EACnBC,KAAK,EACLC,QAAQ,QAKH,cAAc;AAQrB,OAAOC,cAAc,MAAM,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAkC9C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAmC,GAAGA,CAAC;EAClDC,WAAW;EACXC,YAAY;EACZC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EACZC,MAAM,GAAG,IAAI;EACbC,QAAQ,GAAG,IAAI;EACfC,mBAAmB,GAAG,KAAK;EAC3BC,UAAU,GAAGlB,cAAc,CAAC,CAAC,KAAK,MAAM;EACxCmB,QAAQ,GAAG,KAAK;EAChBC,UAAU,GAAG,IAAI;EACjBC,aAAa,GAAG,KAAK;EACrBC,aAAa,GAAG,IAAI;EACpBC,YAAY;EACZC;AACF,CAAC,KAAK;EAEJ,MAAM,CAACC,UAAU,EAAEC,WAAW,CAAC,GAAG/B,QAAQ,CAAC,KAAK,CAAC;EACjD;EACA,MAAM,CAACgC,SAAS,EAAEC,YAAY,CAAC,GAAGjC,QAAQ,CAAC,CAAC,CAAC;EAC7C;EACA;EACA,MAAMkC,MAAM,GAAGJ,UAAU,IAAIE,SAAS,GAAG,CAAC;EAE1C,MAAMG,IAAI,GAAGC,QAAQ,CAACb,UAAU,EAAEjB,mBAAmB,CAAC,CAAC,CAAC+B,SAAS,CAAC;EAElE,MAAMC,WAAW,GAAGd,QAAQ,GAAG,MAAM,CAAC,C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,EAAE,YAAY;IACxBwC,SAAS,EAAE;EACb,CAAC;EACDU,aAAa,EAAE;IACb8B,aAAa,EAAE,KAAK;IACpBhF,UAAU,EAAE,QAAQ;IACpBwC,SAAS,EAAE;EACb,CAAC;EACD;EACAb,MAAM,EAAE;IACN8D,QAAQ,EAAE,CAAC;IACXC,QAAQ,EAAE,CAAC;IACXC,UAAU,EAAE;EACd,CAAC;EACD/C,OAAO,EAAE;IACPN,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVoD,UAAU,EAAE,EAAE;IACd3F,UAAU,EAAE,QAAQ;IACpB4F,cAAc,EAAE;EAClB,CAAC;EACD;EACAvC,WAAW,EAAE;IACXf,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVoD,UAAU,EAAE,EAAE;IACd3F,UAAU,EAAE,QAAQ;IACpB4F,cAAc,EAAE;EAClB,CAAC;EACDtC,WAAW,EAAE;IACXhB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVsD,OAAO,EAAE,CAAC;IACVF,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -18,10 +18,9 @@ import { View, Text, useColorScheme, StyleSheet, TouchableOpacity } from 'react-
|
|
|
18
18
|
import { COLORS } from "../util/Colors.js";
|
|
19
19
|
import { Translations } from "../util/Translations.js";
|
|
20
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
/** The default error part. */
|
|
21
22
|
export const ErrorView = props => {
|
|
22
23
|
const isDarkMode = props.isDarkMode ?? useColorScheme() === 'dark';
|
|
23
|
-
const state = props.state;
|
|
24
|
-
const canBeRetried = state.type === 'error' && state.canBeRetried;
|
|
25
24
|
return /*#__PURE__*/_jsxs(View, {
|
|
26
25
|
style: [styles.container, isDarkMode ? {
|
|
27
26
|
backgroundColor: COLORS.cardBgDark
|
|
@@ -29,10 +28,10 @@ export const ErrorView = props => {
|
|
|
29
28
|
backgroundColor: COLORS.cardBg
|
|
30
29
|
}],
|
|
31
30
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
32
|
-
style: [styles.text,
|
|
33
|
-
children:
|
|
34
|
-
}),
|
|
35
|
-
onPress: props.
|
|
31
|
+
style: [styles.text, styles.dangerText],
|
|
32
|
+
children: props.message
|
|
33
|
+
}), props.onRetry != null && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
34
|
+
onPress: props.onRetry,
|
|
36
35
|
activeOpacity: 0.9,
|
|
37
36
|
style: [styles.button, isDarkMode ? {
|
|
38
37
|
backgroundColor: '#fff'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","useColorScheme","StyleSheet","TouchableOpacity","COLORS","Translations","jsx","_jsx","jsxs","_jsxs","ErrorView","props","isDarkMode","
|
|
1
|
+
{"version":3,"names":["React","View","Text","useColorScheme","StyleSheet","TouchableOpacity","COLORS","Translations","jsx","_jsx","jsxs","_jsxs","ErrorView","props","isDarkMode","style","styles","container","backgroundColor","cardBgDark","cardBg","children","text","dangerText","message","onRetry","onPress","activeOpacity","button","buttonText","lightText","darkText","errorRetryNowButton","create","paddingVertical","alignItems","justifyContent","borderRadius","width","marginBottom","fontSize","fontWeight","textAlign","color","paddingHorizontal","marginTop"],"sourceRoot":"../../../src","sources":["components/ErrorView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,cAAc,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AACvF,SAASC,MAAM,QAAQ,mBAAgB;AACvC,SAASC,YAAY,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAUpD;AACA,OAAO,MAAMC,SAA+B,GAAIC,KAAK,IAAK;EACxD,MAAMC,UAAU,GAAGD,KAAK,CAACC,UAA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