feat: eas update
This commit is contained in:
parent
1f35ce1c4a
commit
6b35cefbdc
6
app.json
6
app.json
@ -46,7 +46,7 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
"expo-router",
|
"expo-router",
|
||||||
"expo-secure-store",
|
"expo-secure-store",
|
||||||
[
|
[
|
||||||
"expo-background-task",
|
"expo-background-task",
|
||||||
{
|
{
|
||||||
"minimumInterval": 15
|
"minimumInterval": 15
|
||||||
@ -90,6 +90,10 @@
|
|||||||
"eas": {
|
"eas": {
|
||||||
"projectId": "04721dd4-6b15-495a-b9ec-98187c613172"
|
"projectId": "04721dd4-6b15-495a-b9ec-98187c613172"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"runtimeVersion": "1.0.0.2",
|
||||||
|
"updates": {
|
||||||
|
"url": "https://u.expo.dev/04721dd4-6b15-495a-b9ec-98187c613172"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,11 +6,10 @@ import { ThemedText } from "@/components/ThemedText";
|
|||||||
import { fetchApi } from "@/lib/server-api-util";
|
import { fetchApi } from "@/lib/server-api-util";
|
||||||
import { getWebSocketErrorMessage, webSocketManager, WsMessage } from "@/lib/websocket-util";
|
import { getWebSocketErrorMessage, webSocketManager, WsMessage } from "@/lib/websocket-util";
|
||||||
import { Assistant, Message } from "@/types/ask";
|
import { Assistant, Message } from "@/types/ask";
|
||||||
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { useFocusEffect, useLocalSearchParams, useRouter } from "expo-router";
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {
|
import {
|
||||||
Animated,
|
|
||||||
FlatList,
|
FlatList,
|
||||||
Keyboard,
|
Keyboard,
|
||||||
KeyboardAvoidingView,
|
KeyboardAvoidingView,
|
||||||
@ -21,10 +20,11 @@ import {
|
|||||||
View
|
View
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
||||||
import { runOnJS } from 'react-native-reanimated';
|
import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
|
||||||
export default function AskScreen() {
|
export default function AskScreen() {
|
||||||
|
const router = useRouter();
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
|
|
||||||
const chatListRef = useRef<FlatList>(null);
|
const chatListRef = useRef<FlatList>(null);
|
||||||
@ -32,8 +32,8 @@ export default function AskScreen() {
|
|||||||
const [conversationId, setConversationId] = useState<string | null>(null);
|
const [conversationId, setConversationId] = useState<string | null>(null);
|
||||||
const [userMessages, setUserMessages] = useState<Message[]>([]);
|
const [userMessages, setUserMessages] = useState<Message[]>([]);
|
||||||
const [selectedImages, setSelectedImages] = useState<string[]>([]);
|
const [selectedImages, setSelectedImages] = useState<string[]>([]);
|
||||||
const fadeAnim = useRef(new Animated.Value(1)).current;
|
const fadeAnim = useSharedValue(1);
|
||||||
const fadeAnimChat = useRef(new Animated.Value(0)).current;
|
const fadeAnimChat = useSharedValue(0);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { sessionId, newSession } = useLocalSearchParams<{
|
const { sessionId, newSession } = useLocalSearchParams<{
|
||||||
@ -184,6 +184,27 @@ export default function AskScreen() {
|
|||||||
}, [])
|
}, [])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 创建动画样式
|
||||||
|
const welcomeStyle = useAnimatedStyle(() => {
|
||||||
|
return {
|
||||||
|
opacity: fadeAnim.value,
|
||||||
|
pointerEvents: isHello ? 'auto' : 'none',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const chatStyle = useAnimatedStyle(() => {
|
||||||
|
return {
|
||||||
|
opacity: fadeAnimChat.value,
|
||||||
|
pointerEvents: isHello ? 'none' : 'auto',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// 触发动画
|
||||||
|
useEffect(() => {
|
||||||
|
fadeAnim.value = withTiming(isHello ? 1 : 0, { duration: 300 });
|
||||||
|
fadeAnimChat.value = withTiming(isHello ? 0 : 1, { duration: 300 });
|
||||||
|
}, [isHello]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (sessionId) {
|
if (sessionId) {
|
||||||
setConversationId(sessionId);
|
setConversationId(sessionId);
|
||||||
@ -198,41 +219,41 @@ export default function AskScreen() {
|
|||||||
}
|
}
|
||||||
}, [sessionId, newSession]);
|
}, [sessionId, newSession]);
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
if (isHello) {
|
// if (isHello) {
|
||||||
Animated.parallel([
|
// Animated.parallel([
|
||||||
Animated.timing(fadeAnim, {
|
// Animated.timing(fadeAnim, {
|
||||||
toValue: 1,
|
// toValue: 1,
|
||||||
duration: 300,
|
// duration: 300,
|
||||||
useNativeDriver: true,
|
// useNativeDriver: true,
|
||||||
}),
|
// }),
|
||||||
Animated.timing(fadeAnimChat, {
|
// Animated.timing(fadeAnimChat, {
|
||||||
toValue: 0,
|
// toValue: 0,
|
||||||
duration: 300,
|
// duration: 300,
|
||||||
useNativeDriver: true,
|
// useNativeDriver: true,
|
||||||
})
|
// })
|
||||||
]).start();
|
// ]).start();
|
||||||
} else {
|
// } else {
|
||||||
Animated.parallel([
|
// Animated.parallel([
|
||||||
Animated.timing(fadeAnim, {
|
// Animated.timing(fadeAnim, {
|
||||||
toValue: 0,
|
// toValue: 0,
|
||||||
duration: 300,
|
// duration: 300,
|
||||||
useNativeDriver: true,
|
// useNativeDriver: true,
|
||||||
}),
|
// }),
|
||||||
Animated.timing(fadeAnimChat, {
|
// Animated.timing(fadeAnimChat, {
|
||||||
toValue: 1,
|
// toValue: 1,
|
||||||
duration: 300,
|
// duration: 300,
|
||||||
useNativeDriver: true,
|
// useNativeDriver: true,
|
||||||
})
|
// })
|
||||||
]).start(() => {
|
// ]).start(() => {
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
if (!isHello) {
|
// if (!isHello) {
|
||||||
scrollToEnd(false);
|
// scrollToEnd(false);
|
||||||
}
|
// }
|
||||||
}, 50);
|
// }, 50);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}, [isHello, fadeAnim, fadeAnimChat]);
|
// }, [isHello, fadeAnim, fadeAnimChat]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isHello) {
|
if (!isHello) {
|
||||||
@ -280,28 +301,14 @@ export default function AskScreen() {
|
|||||||
<View style={styles.contentContainer}>
|
<View style={styles.contentContainer}>
|
||||||
{/* 欢迎页面 */}
|
{/* 欢迎页面 */}
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[
|
style={[styles.absoluteView, welcomeStyle, { zIndex: 1 }]}
|
||||||
styles.absoluteView,
|
|
||||||
{
|
|
||||||
opacity: fadeAnim,
|
|
||||||
pointerEvents: isHello ? 'auto' : 'none',
|
|
||||||
zIndex: 1
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
<AskHello setUserMessages={setUserMessages} setConversationId={setConversationId} setIsHello={setIsHello} />
|
<AskHello setUserMessages={setUserMessages} setConversationId={setConversationId} setIsHello={setIsHello} />
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
|
|
||||||
{/* 聊天页面 */}
|
{/* 聊天页面 */}
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[
|
style={[styles.absoluteView, chatStyle, { zIndex: 0 }]}
|
||||||
styles.absoluteView,
|
|
||||||
{
|
|
||||||
opacity: fadeAnimChat,
|
|
||||||
pointerEvents: isHello ? 'none' : 'auto',
|
|
||||||
zIndex: 0
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
<Chat
|
<Chat
|
||||||
ref={chatListRef}
|
ref={chatListRef}
|
||||||
|
|||||||
@ -225,7 +225,7 @@ export default function HomeScreen() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
checkAuthStatus(router, () => {
|
checkAuthStatus(router, () => {
|
||||||
router.replace('/ask')
|
router.replace('/memo-list') // TODO FIXME
|
||||||
}, false).then(() => {
|
}, false).then(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
|||||||
9
eas.json
9
eas.json
@ -6,13 +6,16 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"development": {
|
"development": {
|
||||||
"developmentClient": true,
|
"developmentClient": true,
|
||||||
"distribution": "internal"
|
"distribution": "internal",
|
||||||
|
"channel": "development"
|
||||||
},
|
},
|
||||||
"preview": {
|
"preview": {
|
||||||
"distribution": "internal"
|
"distribution": "internal",
|
||||||
|
"channel": "preview"
|
||||||
},
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"autoIncrement": true
|
"autoIncrement": true,
|
||||||
|
"channel": "release"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"submit": {
|
"submit": {
|
||||||
|
|||||||
60
package-lock.json
generated
60
package-lock.json
generated
@ -34,6 +34,7 @@
|
|||||||
"expo-iap": "^2.7.5",
|
"expo-iap": "^2.7.5",
|
||||||
"expo-image-manipulator": "~13.1.7",
|
"expo-image-manipulator": "~13.1.7",
|
||||||
"expo-image-picker": "~16.1.4",
|
"expo-image-picker": "~16.1.4",
|
||||||
|
"expo-insights": "~0.9.3",
|
||||||
"expo-linear-gradient": "~14.1.5",
|
"expo-linear-gradient": "~14.1.5",
|
||||||
"expo-linking": "~7.1.7",
|
"expo-linking": "~7.1.7",
|
||||||
"expo-localization": "^16.1.5",
|
"expo-localization": "^16.1.5",
|
||||||
@ -48,6 +49,7 @@
|
|||||||
"expo-symbols": "~0.4.5",
|
"expo-symbols": "~0.4.5",
|
||||||
"expo-system-ui": "~5.0.9",
|
"expo-system-ui": "~5.0.9",
|
||||||
"expo-task-manager": "^13.1.6",
|
"expo-task-manager": "^13.1.6",
|
||||||
|
"expo-updates": "~0.28.17",
|
||||||
"expo-video": "~2.2.2",
|
"expo-video": "~2.2.2",
|
||||||
"expo-video-thumbnails": "~9.1.3",
|
"expo-video-thumbnails": "~9.1.3",
|
||||||
"expo-web-browser": "~14.2.0",
|
"expo-web-browser": "~14.2.0",
|
||||||
@ -9062,6 +9064,12 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/expo-eas-client": {
|
||||||
|
"version": "0.14.4",
|
||||||
|
"resolved": "https://registry.npmmirror.com/expo-eas-client/-/expo-eas-client-0.14.4.tgz",
|
||||||
|
"integrity": "sha512-TSL1BbBFIuXchJmPgbPnB7cGpOOuSGJcQ/L7gij/+zPjExwvKm5ckA5dlSulwoFhH8zQt4vb7bfISPSAWQVWBw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/expo-file-system": {
|
"node_modules/expo-file-system": {
|
||||||
"version": "18.1.11",
|
"version": "18.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-18.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-18.1.11.tgz",
|
||||||
@ -9138,6 +9146,18 @@
|
|||||||
"expo": "*"
|
"expo": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/expo-insights": {
|
||||||
|
"version": "0.9.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/expo-insights/-/expo-insights-0.9.3.tgz",
|
||||||
|
"integrity": "sha512-ictylDUdERHPXUM4suEYLJGGvlSOB7btDSA0FtlZeVWWOcyTWQlSF5t1Wj3lCCljzjMm/pIj8k9hp8CXCl0gsg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"expo-eas-client": "~0.14.3"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"expo": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/expo-json-utils": {
|
"node_modules/expo-json-utils": {
|
||||||
"version": "0.15.0",
|
"version": "0.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.15.0.tgz",
|
||||||
@ -9374,6 +9394,12 @@
|
|||||||
"react-native": "*"
|
"react-native": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/expo-structured-headers": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/expo-structured-headers/-/expo-structured-headers-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-2X+aUNzC/qaw7/WyUhrVHNDB0uQ5rE12XA2H/rJXaAiYQSuOeU90ladaN0IJYV9I2XlhYrjXLktLXWbO7zgbag==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/expo-symbols": {
|
"node_modules/expo-symbols": {
|
||||||
"version": "0.4.5",
|
"version": "0.4.5",
|
||||||
"resolved": "https://registry.npmjs.org/expo-symbols/-/expo-symbols-0.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/expo-symbols/-/expo-symbols-0.4.5.tgz",
|
||||||
@ -9420,6 +9446,34 @@
|
|||||||
"react-native": "*"
|
"react-native": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/expo-updates": {
|
||||||
|
"version": "0.28.17",
|
||||||
|
"resolved": "https://registry.npmmirror.com/expo-updates/-/expo-updates-0.28.17.tgz",
|
||||||
|
"integrity": "sha512-OiKDrKk6EoBRP9AoK7/4tyj9lVtHw2IfaETIFeUCHMgx5xjgKGX/jjSwqhk8N9BJgLDIy0oD0Sb0MaEbSBb3lg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@expo/code-signing-certificates": "0.0.5",
|
||||||
|
"@expo/config": "~11.0.13",
|
||||||
|
"@expo/config-plugins": "~10.1.2",
|
||||||
|
"@expo/spawn-async": "^1.7.2",
|
||||||
|
"arg": "4.1.0",
|
||||||
|
"chalk": "^4.1.2",
|
||||||
|
"expo-eas-client": "~0.14.4",
|
||||||
|
"expo-manifests": "~0.16.6",
|
||||||
|
"expo-structured-headers": "~4.1.0",
|
||||||
|
"expo-updates-interface": "~1.1.0",
|
||||||
|
"glob": "^10.4.2",
|
||||||
|
"ignore": "^5.3.1",
|
||||||
|
"resolve-from": "^5.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"expo-updates": "bin/cli.js"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"expo": "*",
|
||||||
|
"react": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/expo-updates-interface": {
|
"node_modules/expo-updates-interface": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-1.1.0.tgz",
|
||||||
@ -9429,6 +9483,12 @@
|
|||||||
"expo": "*"
|
"expo": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/expo-updates/node_modules/arg": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/arg/-/arg-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/expo-video": {
|
"node_modules/expo-video": {
|
||||||
"version": "2.2.2",
|
"version": "2.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/expo-video/-/expo-video-2.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/expo-video/-/expo-video-2.2.2.tgz",
|
||||||
|
|||||||
@ -87,7 +87,9 @@
|
|||||||
"react-native-web": "~0.20.0",
|
"react-native-web": "~0.20.0",
|
||||||
"react-native-webview": "13.13.5",
|
"react-native-webview": "13.13.5",
|
||||||
"react-redux": "^9.2.0",
|
"react-redux": "^9.2.0",
|
||||||
"worklet": "^1.0.3"
|
"worklet": "^1.0.3",
|
||||||
|
"expo-insights": "~0.9.3",
|
||||||
|
"expo-updates": "~0.28.17"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.25.2",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user