@adminide-stack/yantra-mobile 12.0.95 → 12.0.96-alpha.1
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/lib/compute.js +113 -1
- package/lib/compute.js.map +1 -1
- package/lib/features/agent-chat/NativeAgentChat.js +38 -29
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +20 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +19 -0
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/nativeAppHandoff.js +45 -0
- package/lib/features/apps/nativeAppHandoff.js.map +1 -0
- package/lib/features/apps/nativeAppNavigation.js +66 -0
- package/lib/features/apps/nativeAppNavigation.js.map +1 -0
- package/lib/features/canvas/CanvasExperience.js +3 -3
- package/lib/features/canvas/CanvasExperience.js.map +1 -1
- package/lib/features/canvas/nativeViewerRegistry.js.map +1 -1
- package/lib/features/canvas/useCanvasSession.js +10 -6
- package/lib/features/canvas/useCanvasSession.js.map +1 -1
- package/lib/features/job-search/JobSearchExperience.js +46 -17
- package/lib/features/job-search/JobSearchExperience.js.map +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js +146 -0
- package/lib/features/local-services/LocalServicesAgentChatPane.js.map +1 -0
- package/lib/features/local-services/LocalServicesExperience.js +740 -0
- package/lib/features/local-services/LocalServicesExperience.js.map +1 -0
- package/lib/features/local-services/categories.js +290 -0
- package/lib/features/local-services/categories.js.map +1 -0
- package/lib/features/local-services/chat/widgetOpening.js +139 -0
- package/lib/features/local-services/chat/widgetOpening.js.map +1 -0
- package/lib/features/local-services/components/BusinessCard.js +269 -0
- package/lib/features/local-services/components/BusinessCard.js.map +1 -0
- package/lib/features/local-services/components/BusinessDetail.js +441 -0
- package/lib/features/local-services/components/BusinessDetail.js.map +1 -0
- package/lib/features/local-services/components/CategoryGrid.js +101 -0
- package/lib/features/local-services/components/CategoryGrid.js.map +1 -0
- package/lib/features/local-services/components/FiltersSheet.js +162 -0
- package/lib/features/local-services/components/FiltersSheet.js.map +1 -0
- package/lib/features/local-services/components/ProAvatar.js +38 -0
- package/lib/features/local-services/components/ProAvatar.js.map +1 -0
- package/lib/features/local-services/components/ResultsMap.js +139 -0
- package/lib/features/local-services/components/ResultsMap.js.map +1 -0
- package/lib/features/local-services/components/SearchForm.js +230 -0
- package/lib/features/local-services/components/SearchForm.js.map +1 -0
- package/lib/features/local-services/components/Sheet.js +65 -0
- package/lib/features/local-services/components/Sheet.js.map +1 -0
- package/lib/features/local-services/components/States.js +147 -0
- package/lib/features/local-services/components/States.js.map +1 -0
- package/lib/features/local-services/deviceLocation.js +50 -0
- package/lib/features/local-services/deviceLocation.js.map +1 -0
- package/lib/features/local-services/filters.js +75 -0
- package/lib/features/local-services/filters.js.map +1 -0
- package/lib/features/local-services/format.js +125 -0
- package/lib/features/local-services/format.js.map +1 -0
- package/lib/features/local-services/localServicesClient.js +178 -0
- package/lib/features/local-services/localServicesClient.js.map +1 -0
- package/lib/features/local-services/localServicesContext.js +48 -0
- package/lib/features/local-services/localServicesContext.js.map +1 -0
- package/lib/features/local-services/localServicesMemory.js +202 -0
- package/lib/features/local-services/localServicesMemory.js.map +1 -0
- package/lib/features/local-services/localServicesNormalize.js +204 -0
- package/lib/features/local-services/localServicesNormalize.js.map +1 -0
- package/lib/features/local-services/localServicesTheme.js +50 -0
- package/lib/features/local-services/localServicesTheme.js.map +1 -0
- package/lib/features/local-services/nativeLocalServicesRegistry.js +15 -0
- package/lib/features/local-services/nativeLocalServicesRegistry.js.map +1 -0
- package/lib/features/local-services/openingHours.js +153 -0
- package/lib/features/local-services/openingHours.js.map +1 -0
- package/lib/features/local-services/searchDraft.js +80 -0
- package/lib/features/local-services/searchDraft.js.map +1 -0
- package/lib/features/local-services/useLocalServicesSearch.js +181 -0
- package/lib/features/local-services/useLocalServicesSearch.js.map +1 -0
- package/lib/features/movies/MoviesAgentChatPane.js +49 -0
- package/lib/features/movies/MoviesAgentChatPane.js.map +1 -0
- package/lib/features/movies/MoviesExperience.js +316 -0
- package/lib/features/movies/MoviesExperience.js.map +1 -0
- package/lib/features/movies/components/DiscoverHero.js +256 -0
- package/lib/features/movies/components/DiscoverHero.js.map +1 -0
- package/lib/features/movies/components/LocationSheet.js +259 -0
- package/lib/features/movies/components/LocationSheet.js.map +1 -0
- package/lib/features/movies/components/MovieDetail.js +527 -0
- package/lib/features/movies/components/MovieDetail.js.map +1 -0
- package/lib/features/movies/components/MovieRail.js +188 -0
- package/lib/features/movies/components/MovieRail.js.map +1 -0
- package/lib/features/movies/components/MovieRow.js +119 -0
- package/lib/features/movies/components/MovieRow.js.map +1 -0
- package/lib/features/movies/components/MoviesStates.js +191 -0
- package/lib/features/movies/components/MoviesStates.js.map +1 -0
- package/lib/features/movies/components/MoviesTabBar.js +82 -0
- package/lib/features/movies/components/MoviesTabBar.js.map +1 -0
- package/lib/features/movies/components/PosterImage.js +40 -0
- package/lib/features/movies/components/PosterImage.js.map +1 -0
- package/lib/features/movies/components/Scrim.js +14 -0
- package/lib/features/movies/components/Scrim.js.map +1 -0
- package/lib/features/movies/components/SearchPanel.js +208 -0
- package/lib/features/movies/components/SearchPanel.js.map +1 -0
- package/lib/features/movies/components/ShowtimesPanel.js +279 -0
- package/lib/features/movies/components/ShowtimesPanel.js.map +1 -0
- package/lib/features/movies/components/TrailerPlayer.js +89 -0
- package/lib/features/movies/components/TrailerPlayer.js.map +1 -0
- package/lib/features/movies/components/TrailerStill.js +12 -0
- package/lib/features/movies/components/TrailerStill.js.map +1 -0
- package/lib/features/movies/components/WatchPanel.js +206 -0
- package/lib/features/movies/components/WatchPanel.js.map +1 -0
- package/lib/features/movies/components/WatchlistPanel.js +45 -0
- package/lib/features/movies/components/WatchlistPanel.js.map +1 -0
- package/lib/features/movies/deviceLocation.js +35 -0
- package/lib/features/movies/deviceLocation.js.map +1 -0
- package/lib/features/movies/movieFormats.js +52 -0
- package/lib/features/movies/movieFormats.js.map +1 -0
- package/lib/features/movies/movieMeta.js +38 -0
- package/lib/features/movies/movieMeta.js.map +1 -0
- package/lib/features/movies/moviesClient.js +245 -0
- package/lib/features/movies/moviesClient.js.map +1 -0
- package/lib/features/movies/moviesContext.js +30 -0
- package/lib/features/movies/moviesContext.js.map +1 -0
- package/lib/features/movies/moviesNormalize.js +427 -0
- package/lib/features/movies/moviesNormalize.js.map +1 -0
- package/lib/features/movies/moviesPrompts.js +38 -0
- package/lib/features/movies/moviesPrompts.js.map +1 -0
- package/lib/features/movies/moviesStorage.js +101 -0
- package/lib/features/movies/moviesStorage.js.map +1 -0
- package/lib/features/movies/moviesTheme.js +54 -0
- package/lib/features/movies/moviesTheme.js.map +1 -0
- package/lib/features/movies/nativeMoviesRegistry.js +15 -0
- package/lib/features/movies/nativeMoviesRegistry.js.map +1 -0
- package/lib/features/movies/showtimeDates.js +114 -0
- package/lib/features/movies/showtimeDates.js.map +1 -0
- package/lib/features/movies/useDiscoverRails.js +77 -0
- package/lib/features/movies/useDiscoverRails.js.map +1 -0
- package/lib/features/movies/useMoviesPrefs.js +40 -0
- package/lib/features/movies/useMoviesPrefs.js.map +1 -0
- package/lib/features/resume/ResumeExperience.js +54 -17
- package/lib/features/resume/ResumeExperience.js.map +1 -1
- package/lib/features/shopping/chat/homeShoppingIntent.js +8 -6
- package/lib/features/shopping/chat/homeShoppingIntent.js.map +1 -1
- package/lib/hooks/mintScope.js +28 -0
- package/lib/hooks/mintScope.js.map +1 -0
- package/lib/hooks/mintSurfaceSystemToken.js +29 -149
- package/lib/hooks/mintSurfaceSystemToken.js.map +1 -1
- package/lib/hooks/surfaceHandoffScript.js +79 -0
- package/lib/hooks/surfaceHandoffScript.js.map +1 -0
- package/lib/hooks/useCdecliAutoConnect.js +6 -1
- package/lib/hooks/useCdecliAutoConnect.js.map +1 -1
- package/lib/hooks/useObtainSystemToken.js +14 -16
- package/lib/hooks/useObtainSystemToken.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/routes.json +108 -0
- package/lib/screens/CanvasBoard/index.js +4 -2
- package/lib/screens/CanvasBoard/index.js.map +1 -1
- package/lib/screens/Chat/index.js +113 -46
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Home/HomeScreen.js +15 -2
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/CanvasPrewarm.js +5 -4
- package/lib/screens/Home/components/CanvasPrewarm.js.map +1 -1
- package/lib/screens/JobSearchNative/index.js +7 -4
- package/lib/screens/JobSearchNative/index.js.map +1 -1
- package/lib/screens/LocalServicesNative/index.js +99 -0
- package/lib/screens/LocalServicesNative/index.js.map +1 -0
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js +65 -0
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js.map +1 -0
- package/lib/screens/MoviesNative/index.js +82 -0
- package/lib/screens/MoviesNative/index.js.map +1 -0
- package/lib/screens/MoviesNative/useMoviesHostChat.js +63 -0
- package/lib/screens/MoviesNative/useMoviesHostChat.js.map +1 -0
- package/lib/screens/ResumeNative/index.js +7 -4
- package/lib/screens/ResumeNative/index.js.map +1 -1
- package/lib/screens/WebBuilder/index.js +31 -31
- package/lib/screens/WebBuilder/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useLayoutEffect,useCallback,useState,useRef,useEffect}from'react';import {useWindowDimensions,Keyboard,View,
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useLayoutEffect,useCallback,useState,useRef,useEffect}from'react';import {useWindowDimensions,Keyboard,StyleSheet,View,Pressable}from'react-native';import {getDefaultLeftItems,Box,Text,InputToolBar}from'@admin-layout/gluestack-ui-mobile';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {useNavigation,useRoute,CommonActions}from'@react-navigation/native';import {MessageActionBar}from'../../features/chat/MessageActionBar.js';import {ChatTranscript}from'../../features/chat/ChatTranscript.js';import {AskUserCard}from'../../features/chat/AskUserCard.js';import {pendingAskUser}from'../../features/chat/askUser.js';import {PendingConnectorConnectCard}from'../../features/chat/ConnectorConnectPrompt.js';import {QueuedFollowUps}from'../../features/chat/QueuedFollowUps.js';import {displayConnectorConnectMessages,displayConnectorConnectText}from'common';import {splitPreResponse}from'../../features/chat/preResponse.js';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {useChatLiveStream}from'../../contexts/ChatLiveStreamContext.js';import {KeyboardAwareScreen,KeyboardComposerDock}from'../../components/KeyboardComposerDock.js';import {YantraBrandLoader,YANTRA_LOADER_SIZE_COMPACT}from'../../components/YantraBrandLoader.js';import ThinkingIndicator from'../../components/ThinkingIndicator.js';import {mobileTokens}from'../../theme/mobileTokens.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import DeepSearchModal from'../Home/components/DeepSearchModal.js';import {normalizeSummaryText,extractDeepSearchSources}from'../Home/deepSearchUtils.js';import {AudioRecorderPanel}from'../../features/audio-input/AudioRecorderPanel.js';import {NativeDictationBar}from'../../features/audio-input/NativeDictationBar.js';import {isNativeDictationAvailable}from'../../features/audio-input/nativeDictation.js';import {useImageAttachments}from'../../features/attachments/useImageAttachments.js';import {ComposerAttachmentBar}from'../../features/attachments/ComposerAttachmentBar.js';import {useComposerAttachMenu}from'../../features/attachments/ComposerAttachMenu.js';import {hasComposerAttachments,takeComposerAttachments}from'../../features/attachments/composerAttachmentHandoff.js';import {MicErrorBoundary}from'../../features/audio-input/MicErrorBoundary.js';import {requestMicPermission}from'../../features/audio-input/useAudioPermission.js';import {shouldRedirectToShop}from'../../features/shopping/chat/homeShoppingIntent.js';import {replaceWithShopNative,shopHandoffParams,pushShopNative}from'../../features/shopping/chat/openShopNative.js';import {resolveNativeHandoff}from'../../features/apps/nativeAppHandoff.js';import {replaceWithNativeApp,nativeHandoffParams,pushNativeApp}from'../../features/apps/nativeAppNavigation.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -17,6 +17,20 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
function routingModeOf(value) {
|
|
21
|
+
if (value === "deep-search" || value === "build") return value;
|
|
22
|
+
return "chat";
|
|
23
|
+
}
|
|
24
|
+
function modeOf(isDeepSearchMode, isBuildMode) {
|
|
25
|
+
if (isDeepSearchMode) return "deep-search";
|
|
26
|
+
if (isBuildMode) return "build";
|
|
27
|
+
return "chat";
|
|
28
|
+
}
|
|
29
|
+
const PLACEHOLDER = {
|
|
30
|
+
"deep-search": "Research anything...",
|
|
31
|
+
build: "Describe an app to build...",
|
|
32
|
+
chat: "Ask anything..."
|
|
33
|
+
};
|
|
20
34
|
function ChatScreen() {
|
|
21
35
|
var _a;
|
|
22
36
|
const navigation = useNavigation();
|
|
@@ -30,7 +44,9 @@ function ChatScreen() {
|
|
|
30
44
|
const raw = typeof params.initialQuery === "string" ? params.initialQuery.trim() : "";
|
|
31
45
|
return raw.length > 0 ? raw : null;
|
|
32
46
|
}, [params.initialQuery]);
|
|
33
|
-
const
|
|
47
|
+
const {
|
|
48
|
+
initialAttachments
|
|
49
|
+
} = params;
|
|
34
50
|
const shopRouteChecked = params.shopRouteChecked === true;
|
|
35
51
|
const {
|
|
36
52
|
isDark
|
|
@@ -43,10 +59,13 @@ function ChatScreen() {
|
|
|
43
59
|
const secondaryTextColor = isDark ? "#94a3b8" : mobileTokens.color.textMuted;
|
|
44
60
|
const insets = useSafeAreaInsets();
|
|
45
61
|
const cdecli = useCdecliConnection();
|
|
62
|
+
const {
|
|
63
|
+
setActiveChannelId
|
|
64
|
+
} = cdecli;
|
|
46
65
|
useLayoutEffect(() => {
|
|
47
66
|
if (!channelId) return;
|
|
48
|
-
|
|
49
|
-
}, [channelId,
|
|
67
|
+
setActiveChannelId(channelId);
|
|
68
|
+
}, [channelId, setActiveChannelId]);
|
|
50
69
|
const chat = useChatLiveStream();
|
|
51
70
|
const transcriptRows = useMemo(() => {
|
|
52
71
|
var _a2;
|
|
@@ -124,7 +143,7 @@ function ChatScreen() {
|
|
|
124
143
|
const hasQuery = trimmed.length > 0;
|
|
125
144
|
const hasAttachments = imageAttachments.pending.length > 0;
|
|
126
145
|
const canSubmit = (hasQuery || hasAttachments) && Boolean(channelId);
|
|
127
|
-
const [activeMode, setActiveMode] = useState(() => params.initialMode
|
|
146
|
+
const [activeMode, setActiveMode] = useState(() => routingModeOf(params.initialMode));
|
|
128
147
|
const handleModeSwitch = useCallback((mode) => {
|
|
129
148
|
setActiveMode(mode);
|
|
130
149
|
}, []);
|
|
@@ -162,7 +181,7 @@ function ChatScreen() {
|
|
|
162
181
|
}
|
|
163
182
|
void (async () => {
|
|
164
183
|
var _a2;
|
|
165
|
-
const mode = isDeepSearchMode
|
|
184
|
+
const mode = modeOf(isDeepSearchMode, isBuildMode);
|
|
166
185
|
let openShop = false;
|
|
167
186
|
try {
|
|
168
187
|
openShop = !shopRouteChecked && await shouldRedirectToShop(initialQuery != null ? initialQuery : "", (_a2 = attachments == null ? void 0 : attachments.length) != null ? _a2 : 0, mode);
|
|
@@ -179,6 +198,18 @@ function ChatScreen() {
|
|
|
179
198
|
}));
|
|
180
199
|
return;
|
|
181
200
|
}
|
|
201
|
+
const nativeRoute = shopRouteChecked ? null : await resolveNativeHandoff(initialQuery != null ? initialQuery : "", {
|
|
202
|
+
mode
|
|
203
|
+
});
|
|
204
|
+
if (nativeRoute) {
|
|
205
|
+
replaceWithNativeApp(navigation, nativeRoute, nativeHandoffParams({
|
|
206
|
+
orgName: params.orgName,
|
|
207
|
+
query: initialQuery != null ? initialQuery : "",
|
|
208
|
+
files: attachments,
|
|
209
|
+
channelId
|
|
210
|
+
}));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
182
213
|
void sendMessage(initialQuery != null ? initialQuery : "", attachments, channelId);
|
|
183
214
|
})();
|
|
184
215
|
try {
|
|
@@ -206,6 +237,7 @@ function ChatScreen() {
|
|
|
206
237
|
}, [sendMessage, channelId]);
|
|
207
238
|
const transcriptDisplayRows = useMemo(() => displayConnectorConnectMessages(transcriptRows), [transcriptRows]);
|
|
208
239
|
const transcriptStreaming = useMemo(() => response ? displayConnectorConnectText(response, true) : response, [response]);
|
|
240
|
+
const hasAssistantReply = useMemo(() => messages.some((m) => m.role === "assistant"), [messages]);
|
|
209
241
|
const handleSend = useCallback((text) => {
|
|
210
242
|
var _a2;
|
|
211
243
|
const pending = imageAttachments.forSend();
|
|
@@ -253,10 +285,31 @@ function ChatScreen() {
|
|
|
253
285
|
}
|
|
254
286
|
return;
|
|
255
287
|
}
|
|
288
|
+
const nativeRoute = await resolveNativeHandoff(t, {
|
|
289
|
+
mode: isDeepSearchMode ? "deep-search" : "chat",
|
|
290
|
+
followUp: hasAssistantReply
|
|
291
|
+
});
|
|
292
|
+
if (nativeRoute) {
|
|
293
|
+
if (messages.length === 0) {
|
|
294
|
+
replaceWithNativeApp(navigation, nativeRoute, nativeHandoffParams({
|
|
295
|
+
orgName: params.orgName,
|
|
296
|
+
query: t,
|
|
297
|
+
files: pending,
|
|
298
|
+
channelId
|
|
299
|
+
}));
|
|
300
|
+
} else {
|
|
301
|
+
pushNativeApp(navigation, nativeRoute, nativeHandoffParams({
|
|
302
|
+
orgName: params.orgName,
|
|
303
|
+
query: t,
|
|
304
|
+
files: pending
|
|
305
|
+
}));
|
|
306
|
+
}
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
256
309
|
void sendMessage(t, pending, channelId);
|
|
257
310
|
})();
|
|
258
311
|
imageAttachments.clear();
|
|
259
|
-
}, [channelId, sendMessage, isDeepSearchMode, isBuildMode, navigation, params.orgName, imageAttachments, messages.length]);
|
|
312
|
+
}, [channelId, sendMessage, isDeepSearchMode, isBuildMode, navigation, params.orgName, imageAttachments, messages.length, hasAssistantReply]);
|
|
260
313
|
const handleValueChange = useCallback((e) => {
|
|
261
314
|
var _a2, _b;
|
|
262
315
|
setValue((_b = (_a2 = e == null ? void 0 : e.nativeEvent) == null ? void 0 : _a2.text) != null ? _b : "");
|
|
@@ -378,7 +431,7 @@ function ChatScreen() {
|
|
|
378
431
|
onClick: () => handleModeSwitch("build")
|
|
379
432
|
}
|
|
380
433
|
}), [activeMode, handleModeSwitch]);
|
|
381
|
-
const inputPlaceholder = isDeepSearchMode
|
|
434
|
+
const inputPlaceholder = PLACEHOLDER[modeOf(isDeepSearchMode, isBuildMode)];
|
|
382
435
|
const inputConfig = useMemo(() => ({
|
|
383
436
|
value,
|
|
384
437
|
onChange: handleValueChange,
|
|
@@ -408,6 +461,56 @@ function ChatScreen() {
|
|
|
408
461
|
const isWaitingForGateway = !autoFiredRef.current && !!channelId && (!!initialQuery || hasComposerAttachments(channelId)) && cdecli.status !== "connected" && cdecli.status !== "error";
|
|
409
462
|
const showSendingLoader = waitingForAssistant;
|
|
410
463
|
const pinSendingLoaderNearComposer = messages.length > 0 || Boolean((response != null ? response : "").trim());
|
|
464
|
+
let transcriptArea;
|
|
465
|
+
if (!channelId) {
|
|
466
|
+
transcriptArea = /* @__PURE__ */ jsxs(Box, { flex: 1, alignItems: "center", justifyContent: "center", children: [
|
|
467
|
+
/* @__PURE__ */ jsx(YantraBrandLoader, { size: YANTRA_LOADER_SIZE_COMPACT }),
|
|
468
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.statusText, {
|
|
469
|
+
color: secondaryTextColor
|
|
470
|
+
}], children: "No channel selected" })
|
|
471
|
+
] });
|
|
472
|
+
} else if (isHydrating) {
|
|
473
|
+
transcriptArea = /* @__PURE__ */ jsx(Box, { flex: 1, px: "$4", pt: "$8", children: /* @__PURE__ */ jsx(ThinkingIndicator, { variant: "awaiting", color: secondaryTextColor, isDark, label: "Opening conversation\u2026" }) });
|
|
474
|
+
} else if (isWaitingForGateway) {
|
|
475
|
+
transcriptArea = /* @__PURE__ */ jsxs(Box, { flex: 1, alignItems: "center", justifyContent: "center", children: [
|
|
476
|
+
/* @__PURE__ */ jsx(YantraBrandLoader, { size: YANTRA_LOADER_SIZE_COMPACT }),
|
|
477
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.statusText, {
|
|
478
|
+
color: secondaryTextColor
|
|
479
|
+
}], children: "Connecting gateway\u2026" })
|
|
480
|
+
] });
|
|
481
|
+
} else {
|
|
482
|
+
transcriptArea = /* @__PURE__ */ jsx(View, { style: styles.transcriptPane, children: /* @__PURE__ */ jsx(ChatTranscript, { messages: transcriptDisplayRows, streamingContent: transcriptStreaming, quickReply, listFooter: showSendingLoader && pinSendingLoaderNearComposer ? /* @__PURE__ */ jsx(View, { style: styles.thinkingInThread, children: /* @__PURE__ */ jsx(ThinkingIndicator, { variant: "awaiting", color: secondaryTextColor, isDark }) }) : null, renderMessageActions, isDark, listContentStyle: {
|
|
483
|
+
paddingTop: 12,
|
|
484
|
+
paddingBottom: 8,
|
|
485
|
+
margin: 0,
|
|
486
|
+
width: contentMaxWidth,
|
|
487
|
+
alignSelf: "center"
|
|
488
|
+
} }) });
|
|
489
|
+
}
|
|
490
|
+
let composerBody;
|
|
491
|
+
if (showNativeDictation) {
|
|
492
|
+
composerBody = // A throw inside the native recognizer degrades to
|
|
493
|
+
// the Whisper recorder rather than killing the JS
|
|
494
|
+
// thread (same guard rationale as the recorder).
|
|
495
|
+
/* @__PURE__ */ jsx(MicErrorBoundary, { onCancel: handleDictationFallback, onError: handleDictationFallback, children: /* @__PURE__ */ jsx(NativeDictationBar, { isDark, onInterim: () => void 0, onTranscriptionComplete: handleDictationComplete, onCancel: handleDictationCancel, onFallback: handleDictationFallback }) });
|
|
496
|
+
} else if (showAudioRecorder) {
|
|
497
|
+
composerBody = /*
|
|
498
|
+
* Render-time JS errors thrown by `useAudioRecorder`
|
|
499
|
+
* (e.g. expo-audio native module missing, recorder
|
|
500
|
+
* constructor throws in a release build) are caught
|
|
501
|
+
* by the boundary and converted into a soft cancel
|
|
502
|
+
* via the same handlers the panel itself uses on
|
|
503
|
+
* runtime errors. Without this, a throw during the
|
|
504
|
+
* panel's render phase kills the JS thread in
|
|
505
|
+
* release / TestFlight.
|
|
506
|
+
*/
|
|
507
|
+
/* @__PURE__ */ jsx(MicErrorBoundary, { onCancel: handleRecorderCancel, onError: handleRecorderError, children: /* @__PURE__ */ jsx(AudioRecorderPanel, { isDark, onTranscriptionComplete: handleTranscriptionComplete, onCancel: handleRecorderCancel, onError: handleRecorderError }) });
|
|
508
|
+
} else {
|
|
509
|
+
composerBody = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
510
|
+
/* @__PURE__ */ jsx(ComposerAttachmentBar, { attachments: imageAttachments.pending, onRemove: imageAttachments.remove, isDark }),
|
|
511
|
+
/* @__PURE__ */ jsx(InputToolBar, { inputConfig, leftItems, rightItems, templateButton: null, templateModalConfig: null, micSendButton })
|
|
512
|
+
] });
|
|
513
|
+
}
|
|
411
514
|
return /* @__PURE__ */ jsxs(SafeAreaView, { edges: ["left", "right"], style: {
|
|
412
515
|
flex: 1,
|
|
413
516
|
backgroundColor: surfaceColor
|
|
@@ -442,23 +545,7 @@ function ChatScreen() {
|
|
|
442
545
|
}, children: /* @__PURE__ */ jsx(Text, { fontSize: "$sm", style: {
|
|
443
546
|
color: isDark ? "#fecaca" : "#991b1b"
|
|
444
547
|
}, children: chatError || cdecli.error }) }),
|
|
445
|
-
|
|
446
|
-
/* @__PURE__ */ jsx(YantraBrandLoader, { size: YANTRA_LOADER_SIZE_COMPACT }),
|
|
447
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.statusText, {
|
|
448
|
-
color: secondaryTextColor
|
|
449
|
-
}], children: "No channel selected" })
|
|
450
|
-
] }) : isHydrating ? /* @__PURE__ */ jsx(Box, { flex: 1, px: "$4", pt: "$8", children: /* @__PURE__ */ jsx(ThinkingIndicator, { variant: "awaiting", color: secondaryTextColor, isDark, label: "Opening conversation\u2026" }) }) : isWaitingForGateway ? /* @__PURE__ */ jsxs(Box, { flex: 1, alignItems: "center", justifyContent: "center", children: [
|
|
451
|
-
/* @__PURE__ */ jsx(YantraBrandLoader, { size: YANTRA_LOADER_SIZE_COMPACT }),
|
|
452
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.statusText, {
|
|
453
|
-
color: secondaryTextColor
|
|
454
|
-
}], children: "Connecting gateway\u2026" })
|
|
455
|
-
] }) : /* @__PURE__ */ jsx(View, { style: styles.transcriptPane, children: /* @__PURE__ */ jsx(ChatTranscript, { messages: transcriptDisplayRows, streamingContent: transcriptStreaming, quickReply, listFooter: showSendingLoader && pinSendingLoaderNearComposer ? /* @__PURE__ */ jsx(View, { style: styles.thinkingInThread, children: /* @__PURE__ */ jsx(ThinkingIndicator, { variant: "awaiting", color: secondaryTextColor, isDark }) }) : null, renderMessageActions, isDark, listContentStyle: {
|
|
456
|
-
paddingTop: 12,
|
|
457
|
-
paddingBottom: 8,
|
|
458
|
-
margin: 0,
|
|
459
|
-
width: contentMaxWidth,
|
|
460
|
-
alignSelf: "center"
|
|
461
|
-
} }) }),
|
|
548
|
+
transcriptArea,
|
|
462
549
|
showSendingLoader && !pinSendingLoaderNearComposer ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles.sendingLoaderEmptyState, children: /* @__PURE__ */ jsx(ThinkingIndicator, { variant: "awaiting", color: secondaryTextColor, isDark }) }) : null,
|
|
463
550
|
/* @__PURE__ */ jsxs(KeyboardComposerDock, { closedInset: insets.bottom, onSwipeUp: () => {
|
|
464
551
|
var _a2;
|
|
@@ -491,27 +578,7 @@ function ChatScreen() {
|
|
|
491
578
|
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.voiceErrorText, {
|
|
492
579
|
color: isDark ? "#fecaca" : "#991b1b"
|
|
493
580
|
}], children: voiceError || imageAttachments.error }) }) : null,
|
|
494
|
-
|
|
495
|
-
// A throw inside the native recognizer degrades to
|
|
496
|
-
// the Whisper recorder rather than killing the JS
|
|
497
|
-
// thread (same guard rationale as the recorder).
|
|
498
|
-
/* @__PURE__ */ jsx(MicErrorBoundary, { onCancel: handleDictationFallback, onError: handleDictationFallback, children: /* @__PURE__ */ jsx(NativeDictationBar, { isDark, onInterim: () => void 0, onTranscriptionComplete: handleDictationComplete, onCancel: handleDictationCancel, onFallback: handleDictationFallback }) })
|
|
499
|
-
) : showAudioRecorder ? (
|
|
500
|
-
/*
|
|
501
|
-
* Render-time JS errors thrown by `useAudioRecorder`
|
|
502
|
-
* (e.g. expo-audio native module missing, recorder
|
|
503
|
-
* constructor throws in a release build) are caught
|
|
504
|
-
* by the boundary and converted into a soft cancel
|
|
505
|
-
* via the same handlers the panel itself uses on
|
|
506
|
-
* runtime errors. Without this, a throw during the
|
|
507
|
-
* panel's render phase kills the JS thread in
|
|
508
|
-
* release / TestFlight.
|
|
509
|
-
*/
|
|
510
|
-
/* @__PURE__ */ jsx(MicErrorBoundary, { onCancel: handleRecorderCancel, onError: handleRecorderError, children: /* @__PURE__ */ jsx(AudioRecorderPanel, { isDark, onTranscriptionComplete: handleTranscriptionComplete, onCancel: handleRecorderCancel, onError: handleRecorderError }) })
|
|
511
|
-
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
512
|
-
/* @__PURE__ */ jsx(ComposerAttachmentBar, { attachments: imageAttachments.pending, onRemove: imageAttachments.remove, isDark }),
|
|
513
|
-
/* @__PURE__ */ jsx(InputToolBar, { inputConfig, leftItems, rightItems, templateButton: null, templateModalConfig: null, micSendButton })
|
|
514
|
-
] })
|
|
581
|
+
composerBody
|
|
515
582
|
] })
|
|
516
583
|
] })
|
|
517
584
|
] }) }),
|