@adminide-stack/yantra-mobile 12.0.145 → 12.0.146
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/features/agent-chat/NativeAgentChat.js +28 -10
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/chat/ChatTranscript.js +9 -6
- package/lib/features/chat/ChatTranscript.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +8 -8
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +145 -215
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/projectTools.js +1 -0
- package/lib/features/webbuilder/projectTools.js.map +1 -1
- package/lib/screens/WebBuilderNative/index.js +1 -1
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/keepAlive.js +1 -0
- package/lib/screens/WebBuilderNative/keepAlive.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +82 -11
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/screens/WebBuilderNative/versionUndo.js +108 -12
- package/lib/screens/WebBuilderNative/versionUndo.js.map +1 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +7 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useRef,useCallback,
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useEffect,useRef,useCallback,useMemo}from'react';import {Platform,Keyboard,InteractionManager,View,StyleSheet,Text,Pressable,ScrollView,TextInput,ActivityIndicator}from'react-native';import {MaterialCommunityIcons,Feather}from'@expo/vector-icons';import {AppKeyboardAvoidingView}from'../../components/AppKeyboardAvoidingView.js';import {dismissKeyboard}from'../../utils/keyboardController.js';import {useSafeInsets}from'../canvas/withRemoteSafeArea.js';import {useImageAttachments}from'../attachments/useImageAttachments.js';import {ComposerAttachmentBar}from'../attachments/ComposerAttachmentBar.js';import {NativeDictationBar}from'../audio-input/NativeDictationBar.js';import {AudioRecorderPanel}from'../audio-input/AudioRecorderPanel.js';import {MicErrorBoundary}from'../audio-input/MicErrorBoundary.js';import {isNativeDictationAvailable}from'../audio-input/nativeDictation.js';import {requestMicPermission}from'../audio-input/useAudioPermission.js';import {ChatTranscript}from'../chat/ChatTranscript.js';import {QueuedFollowUps}from'../chat/QueuedFollowUps.js';import {createEdgeSwipe}from'./edgeSwipe.js';import ThinkingIndicator from'../../components/ThinkingIndicator.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -54,10 +54,26 @@ function NativeAgentChat({
|
|
|
54
54
|
muted = "#64748b",
|
|
55
55
|
screen = "#f8fafc",
|
|
56
56
|
border = "#e8ecf1",
|
|
57
|
-
card
|
|
57
|
+
card,
|
|
58
|
+
hideHeader = false,
|
|
59
|
+
mapToolSteps,
|
|
60
|
+
busyIndicator,
|
|
61
|
+
sendDisabled = false,
|
|
62
|
+
keyboardOffset = 0
|
|
58
63
|
}) {
|
|
59
64
|
var _a;
|
|
60
65
|
const insets = useSafeInsets();
|
|
66
|
+
const [keyboardShown, setKeyboardShown] = useState(false);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const showEvent = Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow";
|
|
69
|
+
const hideEvent = Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide";
|
|
70
|
+
const shown = Keyboard.addListener(showEvent, () => setKeyboardShown(true));
|
|
71
|
+
const hidden = Keyboard.addListener(hideEvent, () => setKeyboardShown(false));
|
|
72
|
+
return () => {
|
|
73
|
+
shown.remove();
|
|
74
|
+
hidden.remove();
|
|
75
|
+
};
|
|
76
|
+
}, []);
|
|
61
77
|
const draftControlled = onDraftChange !== void 0;
|
|
62
78
|
const [internalDraft, setInternalDraft] = useState("");
|
|
63
79
|
const draft = draftControlled ? draftProp != null ? draftProp : "" : internalDraft;
|
|
@@ -81,11 +97,12 @@ ${prev}` : composerSeed);
|
|
|
81
97
|
const [showNativeDictation, setShowNativeDictation] = useState(false);
|
|
82
98
|
const [showAudioRecorder, setShowAudioRecorder] = useState(false);
|
|
83
99
|
const [voiceError, setVoiceError] = useState(null);
|
|
84
|
-
const canSend = draft.trim().length > 0 || attachments.pending.length > 0;
|
|
100
|
+
const canSend = !sendDisabled && (draft.trim().length > 0 || attachments.pending.length > 0);
|
|
85
101
|
const listening = showNativeDictation || showAudioRecorder;
|
|
86
102
|
const canStop = Boolean((steering == null ? void 0 : steering.steerable) && steering.stop) && !canSend && !listening;
|
|
87
103
|
const queuedTurns = (_a = steering == null ? void 0 : steering.queued) != null ? _a : [];
|
|
88
104
|
const submit = (text, files) => {
|
|
105
|
+
if (sendDisabled) return;
|
|
89
106
|
const trimmed = (text != null ? text : draft).trim();
|
|
90
107
|
const pending = attachments.forSend();
|
|
91
108
|
if (!trimmed && !(pending == null ? void 0 : pending.length)) return;
|
|
@@ -178,9 +195,9 @@ ${prev}` : composerSeed);
|
|
|
178
195
|
}], pointerEvents: "auto" }, swipeAway == null ? void 0 : swipeAway.panHandlers), { children: [
|
|
179
196
|
/* @__PURE__ */ jsxs(AppKeyboardAvoidingView, { style: [styles.fill, {
|
|
180
197
|
backgroundColor: screen,
|
|
181
|
-
paddingTop: embedded ? 8 : Math.max(insets.top, 8)
|
|
182
|
-
}], behavior: Platform.OS === "ios" ? "padding" : void 0, children: [
|
|
183
|
-
/* @__PURE__ */ jsxs(View, { style: [styles.head, {
|
|
198
|
+
paddingTop: embedded || hideHeader ? 8 : Math.max(insets.top, 8)
|
|
199
|
+
}], behavior: Platform.OS === "ios" ? "padding" : void 0, keyboardVerticalOffset: keyboardOffset, children: [
|
|
200
|
+
hideHeader ? null : /* @__PURE__ */ jsxs(View, { style: [styles.head, {
|
|
184
201
|
borderColor: border
|
|
185
202
|
}], children: [
|
|
186
203
|
/* @__PURE__ */ jsxs(View, { style: styles.headTitle, children: [
|
|
@@ -214,12 +231,12 @@ ${prev}` : composerSeed);
|
|
|
214
231
|
color: ink
|
|
215
232
|
}], children: chip.label }) }, chip.id)) }) : null
|
|
216
233
|
] }) }) : /* @__PURE__ */ jsxs(View, { style: styles.fill, children: [
|
|
217
|
-
/* @__PURE__ */ jsx(ChatTranscript, { messages, streamingContent: streamingContent != null ? streamingContent : void 0, isDark, listFooter: beforeComposer, renderMessageActions: renderMessageExtras }),
|
|
218
|
-
busy && !(streamingContent == null ? void 0 : streamingContent.trim()) ? /* @__PURE__ */ jsx(View, { style: styles.thinking, children: /* @__PURE__ */ jsx(ThinkingIndicator, { variant: "awaiting", color: muted, isDark }) }) : null
|
|
234
|
+
/* @__PURE__ */ jsx(ChatTranscript, { messages, streamingContent: streamingContent != null ? streamingContent : void 0, isDark, listFooter: beforeComposer, renderMessageActions: renderMessageExtras, mapToolSteps }),
|
|
235
|
+
busy && !(streamingContent == null ? void 0 : streamingContent.trim()) ? /* @__PURE__ */ jsx(View, { style: styles.thinking, children: busyIndicator != null ? busyIndicator : /* @__PURE__ */ jsx(ThinkingIndicator, { variant: "awaiting", color: muted, isDark }) }) : null
|
|
219
236
|
] }),
|
|
220
237
|
/* @__PURE__ */ jsxs(View, { style: [styles.composerWrap, {
|
|
221
238
|
borderColor: border,
|
|
222
|
-
paddingBottom: Math.max(insets.bottom, 10)
|
|
239
|
+
paddingBottom: keyboardShown ? 10 : Math.max(insets.bottom, 10)
|
|
223
240
|
}], children: [
|
|
224
241
|
composerLead,
|
|
225
242
|
renderConnectorCard == null ? void 0 : renderConnectorCard(isDark),
|
|
@@ -248,7 +265,8 @@ ${prev}` : composerSeed);
|
|
|
248
265
|
enableVoice ? /* @__PURE__ */ jsx(Pressable, { onPress: handleMicPress, style: [styles.mic, listening && styles.micLive], accessibilityRole: "button", accessibilityLabel: listening ? "Stop listening" : "Start voice input", children: /* @__PURE__ */ jsx(Feather, { name: listening ? "square" : "mic", size: 16, color: listening ? "#b91c1c" : muted }) }) : null,
|
|
249
266
|
canSend ? /* @__PURE__ */ jsx(Pressable, { onPress: () => submit(), style: [styles.send, busy && {
|
|
250
267
|
opacity: 0.85
|
|
251
|
-
}], accessibilityRole: "button", accessibilityLabel: "Send", children: /* @__PURE__ */ jsx(Feather, { name: "send", size: 14, color: "#fff", style: styles.sendIcon }) }) :
|
|
268
|
+
}], accessibilityRole: "button", accessibilityLabel: "Send", children: /* @__PURE__ */ jsx(Feather, { name: "send", size: 14, color: "#fff", style: styles.sendIcon }) }) : null,
|
|
269
|
+
!canSend && canStop ? /* @__PURE__ */ jsx(Pressable, { onPress: () => {
|
|
252
270
|
var _a2;
|
|
253
271
|
return (_a2 = steering == null ? void 0 : steering.stop) == null ? void 0 : _a2.call(steering);
|
|
254
272
|
}, style: [styles.send, styles.stop], accessibilityRole: "button", accessibilityLabel: "Stop the reply", children: /* @__PURE__ */ jsx(Feather, { name: "square", size: 12, color: "#fff" }) }) : null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAgentChat.js","sources":["../../../src/features/agent-chat/NativeAgentChat.tsx"],"sourcesContent":["/**\n * Reusable native Agent panel (header + transcript + composer).\n * Composer matches web Shopping Agent: text + mic/send on the first row,\n * image + paperclip under the field. Surface cards (`beforeComposer`) scroll\n * with the thread as the list footer.\n */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n ActivityIndicator,\n InteractionManager,\n Keyboard,\n Platform,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n TextInput,\n View,\n} from 'react-native';\nimport { AppKeyboardAvoidingView } from '../../components/AppKeyboardAvoidingView';\nimport { Feather, MaterialCommunityIcons } from '@expo/vector-icons';\nimport { dismissKeyboard } from '../../utils/keyboardController';\nimport { useSafeInsets } from '../canvas/withRemoteSafeArea';\nimport type { NativeAgentChatProps } from './types';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { useImageAttachments } from '../attachments/useImageAttachments';\nimport { ComposerAttachmentBar } from '../attachments/ComposerAttachmentBar';\nimport { NativeDictationBar } from '../audio-input/NativeDictationBar';\nimport { AudioRecorderPanel } from '../audio-input/AudioRecorderPanel';\nimport { MicErrorBoundary } from '../audio-input/MicErrorBoundary';\nimport { isNativeDictationAvailable } from '../audio-input/nativeDictation';\nimport { requestMicPermission } from '../audio-input/useAudioPermission';\nimport { ChatTranscript } from '../chat/ChatTranscript';\nimport { QueuedFollowUps } from '../chat/QueuedFollowUps';\nimport { createEdgeSwipe } from './edgeSwipe';\nimport ThinkingIndicator from '../../components/ThinkingIndicator';\n\nexport function NativeAgentChat({\n title,\n visible,\n onClose,\n messages,\n onSend,\n renderConnectorCard,\n renderMessageExtras,\n onClear,\n busy = false,\n steering,\n streamingContent = null,\n error = null,\n placeholder = 'Ask anything…',\n emptyTitle,\n emptyBody,\n suggestions = [],\n beforeComposer,\n composerAccessory,\n paneOverlay,\n headerTrailing,\n belowHeader,\n composerLead,\n draft: draftProp,\n onDraftChange,\n composerSeed,\n composerSeedKey,\n onComposerSeedConsumed,\n embedded = false,\n onSwipeLeft,\n enableVoice = true,\n enableAttachments = true,\n isDark = false,\n ink = '#0f172a',\n muted = '#64748b',\n screen = '#f8fafc',\n border = '#e8ecf1',\n card,\n}: NativeAgentChatProps) {\n const insets = useSafeInsets();\n const draftControlled = onDraftChange !== undefined;\n const [internalDraft, setInternalDraft] = useState('');\n const draft = draftControlled ? (draftProp ?? '') : internalDraft;\n const draftRef = useRef(draft);\n draftRef.current = draft;\n // Read through a ref so setDraft stays one function for the pane's life; the\n // voice callbacks that call it are memoised once.\n const onDraftChangeRef = useRef(onDraftChange);\n onDraftChangeRef.current = onDraftChange;\n const setDraft = useCallback((next: string | ((prev: string) => string)) => {\n const value = typeof next === 'function' ? next(draftRef.current) : next;\n if (onDraftChangeRef.current) onDraftChangeRef.current(value);\n else setInternalDraft(value);\n }, []);\n useEffect(() => {\n if (composerSeed == null) return;\n setDraft((prev) => (prev.trim() ? `${composerSeed}\\n\\n${prev}` : composerSeed));\n onComposerSeedConsumed?.();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [composerSeed, composerSeedKey]);\n const attachments = useImageAttachments();\n const [showNativeDictation, setShowNativeDictation] = useState(false);\n const [showAudioRecorder, setShowAudioRecorder] = useState(false);\n const [voiceError, setVoiceError] = useState<string | null>(null);\n\n const canSend = draft.trim().length > 0 || attachments.pending.length > 0;\n const listening = showNativeDictation || showAudioRecorder;\n // Mid-reply, Send queues behind the running turn and Stop sits beside it (as in the main Chat).\n const canStop = Boolean(steering?.steerable && steering.stop) && !canSend && !listening;\n const queuedTurns = steering?.queued ?? [];\n\n const submit = (text?: string, files?: MessageAttachment[]) => {\n const trimmed = (text ?? draft).trim();\n const pending = files ?? attachments.forSend();\n if (!trimmed && !pending?.length) return;\n setDraft('');\n attachments.clear();\n onSend(trimmed, pending);\n };\n\n const openWhisperRecorder = useCallback(() => {\n setVoiceError(null);\n void (async () => {\n const { granted, error } = await requestMicPermission();\n if (!granted) {\n setVoiceError(error || 'Microphone is not available.');\n return;\n }\n setShowAudioRecorder(true);\n })();\n }, []);\n\n const handleMicPress = useCallback(() => {\n if (listening) {\n setShowNativeDictation(false);\n setShowAudioRecorder(false);\n return;\n }\n setVoiceError(null);\n Keyboard.dismiss();\n if (isNativeDictationAvailable()) {\n setShowNativeDictation(true);\n return;\n }\n openWhisperRecorder();\n }, [listening, openWhisperRecorder]);\n\n const pasteTranscript = useCallback(\n (text: string) => {\n const cleaned = (text ?? '').trim();\n if (!cleaned) return;\n setDraft((prev) => (prev.trim() ? `${prev.trim()} ${cleaned}` : cleaned));\n },\n [setDraft],\n );\n\n const openPicker = useCallback((fn: () => Promise<void>) => {\n Keyboard.dismiss();\n InteractionManager.runAfterInteractions(() => {\n setTimeout(() => {\n void fn();\n }, 350);\n });\n }, []);\n\n const banner = voiceError || attachments.error || error;\n\n // Swipe right from the left edge to close the pane. Claimed on the pane's root view: the\n // strip that used to sit over the left 40pt ate taps on the composer's attach buttons.\n const swipeAway = useMemo(() => {\n if (!onSwipeLeft) return null;\n return createEdgeSwipe({\n zone: { edge: 'left', width: 40 },\n claim: (g) => g.dx > 10 && Math.abs(g.dx) > Math.abs(g.dy),\n release: (g) => {\n if (g.dx >= 48 && Math.abs(g.dx) > Math.abs(g.dy) * 1.15) onSwipeLeft();\n },\n });\n }, [onSwipeLeft]);\n\n if (!visible) return null;\n\n // Dictation or the recorder takes the composer's place while it listens.\n let voicePanel: React.ReactNode = null;\n if (showNativeDictation) {\n voicePanel = (\n <MicErrorBoundary\n onCancel={() => setShowNativeDictation(false)}\n onError={() => {\n setShowNativeDictation(false);\n openWhisperRecorder();\n }}\n >\n <NativeDictationBar\n isDark={isDark}\n onInterim={() => undefined}\n onTranscriptionComplete={(text) => {\n setShowNativeDictation(false);\n pasteTranscript(text);\n }}\n onCancel={() => setShowNativeDictation(false)}\n onFallback={() => {\n setShowNativeDictation(false);\n openWhisperRecorder();\n }}\n />\n </MicErrorBoundary>\n );\n } else if (showAudioRecorder) {\n voicePanel = (\n <MicErrorBoundary\n onCancel={() => setShowAudioRecorder(false)}\n onError={(err) => {\n setShowAudioRecorder(false);\n setVoiceError(err);\n }}\n >\n <AudioRecorderPanel\n isDark={isDark}\n onTranscriptionComplete={(text) => {\n setShowAudioRecorder(false);\n pasteTranscript(text);\n }}\n onCancel={() => setShowAudioRecorder(false)}\n onError={(err) => {\n setShowAudioRecorder(false);\n setVoiceError(err);\n }}\n />\n </MicErrorBoundary>\n );\n }\n\n return (\n <View\n style={[StyleSheet.absoluteFill, styles.overlay, { backgroundColor: screen }]}\n pointerEvents=\"auto\"\n {...swipeAway?.panHandlers}\n >\n <AppKeyboardAvoidingView\n style={[styles.fill, { backgroundColor: screen, paddingTop: embedded ? 8 : Math.max(insets.top, 8) }]}\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n >\n <View style={[styles.head, { borderColor: border }]}>\n <View style={styles.headTitle}>\n <MaterialCommunityIcons name=\"creation\" size={16} color={ink} />\n <Text style={[styles.title, { color: ink }]}>{title}</Text>\n </View>\n <View style={styles.headActions}>\n {onClear && (messages.length > 0 || Boolean(streamingContent?.trim())) ? (\n <Pressable\n onPress={onClear}\n hitSlop={10}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Clear chat\"\n >\n <Feather name=\"trash-2\" size={18} color={muted} />\n </Pressable>\n ) : null}\n {headerTrailing}\n <Pressable\n onPress={onClose}\n hitSlop={10}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${title}`}\n >\n <MaterialCommunityIcons name=\"close\" size={22} color={muted} />\n </Pressable>\n </View>\n </View>\n {belowHeader}\n\n {messages.length === 0 && !streamingContent ? (\n <ScrollView\n style={styles.fill}\n contentContainerStyle={styles.emptyScroll}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode={Platform.OS === 'ios' ? 'interactive' : 'on-drag'}\n showsVerticalScrollIndicator={false}\n >\n <Pressable style={styles.empty} onPress={dismissKeyboard} accessible={false}>\n {emptyTitle ? <Text style={[styles.emptyTitle, { color: ink }]}>{emptyTitle}</Text> : null}\n {emptyBody ? <Text style={[styles.emptyBody, { color: muted }]}>{emptyBody}</Text> : null}\n {suggestions.length > 0 ? (\n <View style={styles.chips}>\n {suggestions.map((chip) => (\n <Pressable\n key={chip.id}\n onPress={() => {\n dismissKeyboard();\n submit(chip.prompt ?? chip.label);\n }}\n style={[\n styles.chip,\n {\n borderColor: border,\n backgroundColor: card ?? (isDark ? '#1e293b' : '#fff'),\n },\n ]}\n >\n <Text style={[styles.chipText, { color: ink }]}>{chip.label}</Text>\n </Pressable>\n ))}\n </View>\n ) : null}\n </Pressable>\n </ScrollView>\n ) : (\n <View style={styles.fill}>\n {/* Links open through the host's ChatLinkOpenerProvider (mounted at the\n app root): it needs Apollo, the root navigator and the in-app\n browser, which must stay out of the native surface remotes. */}\n <ChatTranscript\n messages={messages}\n streamingContent={streamingContent ?? undefined}\n isDark={isDark}\n listFooter={beforeComposer}\n renderMessageActions={renderMessageExtras}\n />\n {busy && !streamingContent?.trim() ? (\n <View style={styles.thinking}>\n <ThinkingIndicator variant=\"awaiting\" color={muted} isDark={isDark} />\n </View>\n ) : null}\n </View>\n )}\n\n <View\n style={[styles.composerWrap, { borderColor: border, paddingBottom: Math.max(insets.bottom, 10) }]}\n >\n {composerLead}\n {renderConnectorCard?.(isDark)}\n {banner ? (\n <View style={[styles.errorBanner, { backgroundColor: isDark ? '#2b1a1d' : '#fef2f2' }]}>\n <Text style={styles.errorText}>{banner}</Text>\n </View>\n ) : null}\n\n {queuedTurns.length > 0 ? (\n <QueuedFollowUps\n items={queuedTurns}\n onCancel={(id) => steering?.cancelQueued?.(id)}\n onSendNow={() => steering?.sendQueuedNow?.()}\n isDark={isDark}\n />\n ) : null}\n\n {voicePanel ?? (\n <View\n style={[\n styles.composerCard,\n { borderColor: border, backgroundColor: card ?? (isDark ? '#111827' : '#fff') },\n ]}\n >\n {enableAttachments ? (\n <ComposerAttachmentBar\n attachments={attachments.pending}\n onRemove={attachments.remove}\n isDark={isDark}\n />\n ) : null}\n <View style={styles.inputRow}>\n <TextInput\n value={draft}\n onChangeText={(next) => {\n setDraft(next);\n if (voiceError) setVoiceError(null);\n }}\n placeholder={listening ? 'Listening… speak your request' : placeholder}\n placeholderTextColor={muted}\n multiline\n textAlignVertical=\"top\"\n onSubmitEditing={() => submit()}\n style={[styles.input, { color: ink }]}\n accessibilityLabel={placeholder}\n />\n {enableVoice ? (\n <Pressable\n onPress={handleMicPress}\n style={[styles.mic, listening && styles.micLive]}\n accessibilityRole=\"button\"\n accessibilityLabel={listening ? 'Stop listening' : 'Start voice input'}\n >\n <Feather\n name={listening ? 'square' : 'mic'}\n size={16}\n color={listening ? '#b91c1c' : muted}\n />\n </Pressable>\n ) : null}\n {canSend ? (\n <Pressable\n onPress={() => submit()}\n style={[styles.send, busy && { opacity: 0.85 }]}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Send\"\n >\n <Feather name=\"send\" size={14} color=\"#fff\" style={styles.sendIcon} />\n </Pressable>\n ) : canStop ? (\n <Pressable\n onPress={() => steering?.stop?.()}\n style={[styles.send, styles.stop]}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Stop the reply\"\n >\n <Feather name=\"square\" size={12} color=\"#fff\" />\n </Pressable>\n ) : null}\n </View>\n {enableAttachments || composerAccessory ? (\n <View style={styles.tools}>\n {enableAttachments ? (\n <>\n <Pressable\n onPress={() => openPicker(attachments.pickFromLibrary)}\n onLongPress={() => openPicker(attachments.captureFromCamera)}\n disabled={attachments.busy}\n style={styles.toolBtn}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Add image or screenshot\"\n >\n {attachments.busyKind === 'library' ||\n attachments.busyKind === 'camera' ? (\n <ActivityIndicator size=\"small\" />\n ) : (\n <Feather name=\"image\" size={18} color={muted} />\n )}\n </Pressable>\n <Pressable\n onPress={() => openPicker(attachments.pickDocuments)}\n disabled={attachments.busy}\n style={styles.toolBtn}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Attach files\"\n >\n {attachments.busyKind === 'documents' ? (\n <ActivityIndicator size=\"small\" />\n ) : (\n <Feather name=\"paperclip\" size={18} color={muted} />\n )}\n </Pressable>\n </>\n ) : null}\n {composerAccessory ? (\n <View style={styles.toolsAccessory}>{composerAccessory}</View>\n ) : null}\n </View>\n ) : null}\n </View>\n )}\n </View>\n </AppKeyboardAvoidingView>\n {paneOverlay}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: { zIndex: 200, elevation: 200 },\n fill: { flex: 1, overflow: 'hidden' },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingBottom: 10,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n headTitle: { flexDirection: 'row', alignItems: 'center', gap: 8 },\n headActions: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n title: { fontSize: 16, fontWeight: '700' },\n emptyScroll: { flexGrow: 1 },\n empty: { flexGrow: 1, gap: 10, paddingTop: 20, paddingHorizontal: 16 },\n thinking: { paddingHorizontal: 16, paddingBottom: 8 },\n emptyTitle: { fontSize: 18, fontWeight: '700', letterSpacing: -0.3 },\n emptyBody: { fontSize: 14, lineHeight: 20 },\n chips: { flexDirection: 'row', flexWrap: 'wrap', gap: 8, marginTop: 4 },\n chip: { borderWidth: 1, borderRadius: 999, paddingHorizontal: 12, paddingVertical: 8 },\n chipText: { fontSize: 13, fontWeight: '600' },\n composerWrap: { paddingHorizontal: 12, paddingTop: 8, gap: 8 },\n errorBanner: { borderRadius: 10, padding: 8 },\n errorText: { color: '#991b1b', fontSize: 12 },\n composerCard: {\n borderWidth: StyleSheet.hairlineWidth,\n borderRadius: 18,\n paddingHorizontal: 12,\n paddingTop: 10,\n paddingBottom: 8,\n gap: 4,\n overflow: 'visible',\n },\n inputRow: {\n flexDirection: 'row',\n alignItems: 'flex-end',\n gap: 4,\n minHeight: 44,\n },\n input: { flex: 1, fontSize: 15, maxHeight: 120, minHeight: 40, paddingVertical: 8, paddingHorizontal: 2 },\n tools: { flexDirection: 'row', alignItems: 'center', gap: 2, paddingTop: 2, overflow: 'visible' },\n toolsAccessory: { marginLeft: 'auto', flexShrink: 1 },\n mic: {\n width: 32,\n height: 32,\n borderRadius: 8,\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: 2,\n },\n micLive: { backgroundColor: 'rgba(185,28,28,0.12)' },\n send: {\n width: 32,\n height: 32,\n borderRadius: 16,\n backgroundColor: '#ea580c',\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: 2,\n },\n sendIcon: { transform: [{ rotate: '45deg' }] },\n stop: { backgroundColor: '#0f172a' },\n toolBtn: {\n width: 36,\n height: 36,\n borderRadius: 8,\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,eAAiB,EAAA;AAAA,GACnB;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,EAAA;AAAA,IACd,eAAiB,EAAA,SAAA;AAAA,IACjB,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA,QAAA;AAAA,IAChB,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,WAAW,CAAC;AAAA,MACV,MAAQ,EAAA;AAAA,KACT;AAAA,GACH;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA;AAAA,GACnB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,CAAA;AAAA,IACd,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA;AAEpB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"NativeAgentChat.js","sources":["../../../src/features/agent-chat/NativeAgentChat.tsx"],"sourcesContent":["/**\n * Reusable native Agent panel (header + transcript + composer).\n * Composer matches web Shopping Agent: text + mic/send on the first row,\n * image + paperclip under the field. Surface cards (`beforeComposer`) scroll\n * with the thread as the list footer.\n */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n ActivityIndicator,\n InteractionManager,\n Keyboard,\n Platform,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n TextInput,\n View,\n} from 'react-native';\nimport { Feather, MaterialCommunityIcons } from '@expo/vector-icons';\nimport { AppKeyboardAvoidingView } from '../../components/AppKeyboardAvoidingView';\nimport { dismissKeyboard } from '../../utils/keyboardController';\nimport { useSafeInsets } from '../canvas/withRemoteSafeArea';\nimport type { NativeAgentChatProps } from './types';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { useImageAttachments } from '../attachments/useImageAttachments';\nimport { ComposerAttachmentBar } from '../attachments/ComposerAttachmentBar';\nimport { NativeDictationBar } from '../audio-input/NativeDictationBar';\nimport { AudioRecorderPanel } from '../audio-input/AudioRecorderPanel';\nimport { MicErrorBoundary } from '../audio-input/MicErrorBoundary';\nimport { isNativeDictationAvailable } from '../audio-input/nativeDictation';\nimport { requestMicPermission } from '../audio-input/useAudioPermission';\nimport { ChatTranscript } from '../chat/ChatTranscript';\nimport { QueuedFollowUps } from '../chat/QueuedFollowUps';\nimport { createEdgeSwipe } from './edgeSwipe';\nimport ThinkingIndicator from '../../components/ThinkingIndicator';\n\nexport function NativeAgentChat({\n title,\n visible,\n onClose,\n messages,\n onSend,\n renderConnectorCard,\n renderMessageExtras,\n onClear,\n busy = false,\n steering,\n streamingContent = null,\n error = null,\n placeholder = 'Ask anything…',\n emptyTitle,\n emptyBody,\n suggestions = [],\n beforeComposer,\n composerAccessory,\n paneOverlay,\n headerTrailing,\n belowHeader,\n composerLead,\n draft: draftProp,\n onDraftChange,\n composerSeed,\n composerSeedKey,\n onComposerSeedConsumed,\n embedded = false,\n onSwipeLeft,\n enableVoice = true,\n enableAttachments = true,\n isDark = false,\n ink = '#0f172a',\n muted = '#64748b',\n screen = '#f8fafc',\n border = '#e8ecf1',\n card,\n hideHeader = false,\n mapToolSteps,\n busyIndicator,\n sendDisabled = false,\n keyboardOffset = 0,\n}: NativeAgentChatProps) {\n const insets = useSafeInsets();\n // The home indicator is under the keyboard while it is up: no gap above the keyboard then.\n const [keyboardShown, setKeyboardShown] = useState(false);\n useEffect(() => {\n const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';\n const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';\n const shown = Keyboard.addListener(showEvent, () => setKeyboardShown(true));\n const hidden = Keyboard.addListener(hideEvent, () => setKeyboardShown(false));\n return () => {\n shown.remove();\n hidden.remove();\n };\n }, []);\n const draftControlled = onDraftChange !== undefined;\n const [internalDraft, setInternalDraft] = useState('');\n const draft = draftControlled ? (draftProp ?? '') : internalDraft;\n const draftRef = useRef(draft);\n draftRef.current = draft;\n // Read through a ref so setDraft stays one function for the pane's life; the\n // voice callbacks that call it are memoised once.\n const onDraftChangeRef = useRef(onDraftChange);\n onDraftChangeRef.current = onDraftChange;\n const setDraft = useCallback((next: string | ((prev: string) => string)) => {\n const value = typeof next === 'function' ? next(draftRef.current) : next;\n if (onDraftChangeRef.current) onDraftChangeRef.current(value);\n else setInternalDraft(value);\n }, []);\n useEffect(() => {\n if (composerSeed == null) return;\n setDraft((prev) => (prev.trim() ? `${composerSeed}\\n\\n${prev}` : composerSeed));\n onComposerSeedConsumed?.();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [composerSeed, composerSeedKey]);\n const attachments = useImageAttachments();\n const [showNativeDictation, setShowNativeDictation] = useState(false);\n const [showAudioRecorder, setShowAudioRecorder] = useState(false);\n const [voiceError, setVoiceError] = useState<string | null>(null);\n\n const canSend = !sendDisabled && (draft.trim().length > 0 || attachments.pending.length > 0);\n const listening = showNativeDictation || showAudioRecorder;\n // Mid-reply, Send queues behind the running turn and Stop sits beside it (as in the main Chat).\n const canStop = Boolean(steering?.steerable && steering.stop) && !canSend && !listening;\n const queuedTurns = steering?.queued ?? [];\n\n const submit = (text?: string, files?: MessageAttachment[]) => {\n if (sendDisabled) return;\n const trimmed = (text ?? draft).trim();\n const pending = files ?? attachments.forSend();\n if (!trimmed && !pending?.length) return;\n setDraft('');\n attachments.clear();\n onSend(trimmed, pending);\n };\n\n const openWhisperRecorder = useCallback(() => {\n setVoiceError(null);\n void (async () => {\n const { granted, error } = await requestMicPermission();\n if (!granted) {\n setVoiceError(error || 'Microphone is not available.');\n return;\n }\n setShowAudioRecorder(true);\n })();\n }, []);\n\n const handleMicPress = useCallback(() => {\n if (listening) {\n setShowNativeDictation(false);\n setShowAudioRecorder(false);\n return;\n }\n setVoiceError(null);\n Keyboard.dismiss();\n if (isNativeDictationAvailable()) {\n setShowNativeDictation(true);\n return;\n }\n openWhisperRecorder();\n }, [listening, openWhisperRecorder]);\n\n const pasteTranscript = useCallback(\n (text: string) => {\n const cleaned = (text ?? '').trim();\n if (!cleaned) return;\n setDraft((prev) => (prev.trim() ? `${prev.trim()} ${cleaned}` : cleaned));\n },\n [setDraft],\n );\n\n const openPicker = useCallback((fn: () => Promise<void>) => {\n Keyboard.dismiss();\n InteractionManager.runAfterInteractions(() => {\n setTimeout(() => {\n void fn();\n }, 350);\n });\n }, []);\n\n const banner = voiceError || attachments.error || error;\n\n // Swipe right from the left edge to close the pane. Claimed on the pane's root view: the\n // strip that used to sit over the left 40pt ate taps on the composer's attach buttons.\n const swipeAway = useMemo(() => {\n if (!onSwipeLeft) return null;\n return createEdgeSwipe({\n zone: { edge: 'left', width: 40 },\n claim: (g) => g.dx > 10 && Math.abs(g.dx) > Math.abs(g.dy),\n release: (g) => {\n if (g.dx >= 48 && Math.abs(g.dx) > Math.abs(g.dy) * 1.15) onSwipeLeft();\n },\n });\n }, [onSwipeLeft]);\n\n if (!visible) return null;\n\n // Dictation or the recorder takes the composer's place while it listens.\n let voicePanel: React.ReactNode = null;\n if (showNativeDictation) {\n voicePanel = (\n <MicErrorBoundary\n onCancel={() => setShowNativeDictation(false)}\n onError={() => {\n setShowNativeDictation(false);\n openWhisperRecorder();\n }}\n >\n <NativeDictationBar\n isDark={isDark}\n onInterim={() => undefined}\n onTranscriptionComplete={(text) => {\n setShowNativeDictation(false);\n pasteTranscript(text);\n }}\n onCancel={() => setShowNativeDictation(false)}\n onFallback={() => {\n setShowNativeDictation(false);\n openWhisperRecorder();\n }}\n />\n </MicErrorBoundary>\n );\n } else if (showAudioRecorder) {\n voicePanel = (\n <MicErrorBoundary\n onCancel={() => setShowAudioRecorder(false)}\n onError={(err) => {\n setShowAudioRecorder(false);\n setVoiceError(err);\n }}\n >\n <AudioRecorderPanel\n isDark={isDark}\n onTranscriptionComplete={(text) => {\n setShowAudioRecorder(false);\n pasteTranscript(text);\n }}\n onCancel={() => setShowAudioRecorder(false)}\n onError={(err) => {\n setShowAudioRecorder(false);\n setVoiceError(err);\n }}\n />\n </MicErrorBoundary>\n );\n }\n\n return (\n <View\n style={[StyleSheet.absoluteFill, styles.overlay, { backgroundColor: screen }]}\n pointerEvents=\"auto\"\n {...swipeAway?.panHandlers}\n >\n <AppKeyboardAvoidingView\n style={[\n styles.fill,\n { backgroundColor: screen, paddingTop: embedded || hideHeader ? 8 : Math.max(insets.top, 8) },\n ]}\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={keyboardOffset}\n >\n {hideHeader ? null : (\n <View style={[styles.head, { borderColor: border }]}>\n <View style={styles.headTitle}>\n <MaterialCommunityIcons name=\"creation\" size={16} color={ink} />\n <Text style={[styles.title, { color: ink }]}>{title}</Text>\n </View>\n <View style={styles.headActions}>\n {onClear && (messages.length > 0 || Boolean(streamingContent?.trim())) ? (\n <Pressable\n onPress={onClear}\n hitSlop={10}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Clear chat\"\n >\n <Feather name=\"trash-2\" size={18} color={muted} />\n </Pressable>\n ) : null}\n {headerTrailing}\n <Pressable\n onPress={onClose}\n hitSlop={10}\n accessibilityRole=\"button\"\n accessibilityLabel={`Close ${title}`}\n >\n <MaterialCommunityIcons name=\"close\" size={22} color={muted} />\n </Pressable>\n </View>\n </View>\n )}\n {belowHeader}\n\n {messages.length === 0 && !streamingContent ? (\n <ScrollView\n style={styles.fill}\n contentContainerStyle={styles.emptyScroll}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode={Platform.OS === 'ios' ? 'interactive' : 'on-drag'}\n showsVerticalScrollIndicator={false}\n >\n <Pressable style={styles.empty} onPress={dismissKeyboard} accessible={false}>\n {emptyTitle ? <Text style={[styles.emptyTitle, { color: ink }]}>{emptyTitle}</Text> : null}\n {emptyBody ? <Text style={[styles.emptyBody, { color: muted }]}>{emptyBody}</Text> : null}\n {suggestions.length > 0 ? (\n <View style={styles.chips}>\n {suggestions.map((chip) => (\n <Pressable\n key={chip.id}\n onPress={() => {\n dismissKeyboard();\n submit(chip.prompt ?? chip.label);\n }}\n style={[\n styles.chip,\n {\n borderColor: border,\n backgroundColor: card ?? (isDark ? '#1e293b' : '#fff'),\n },\n ]}\n >\n <Text style={[styles.chipText, { color: ink }]}>{chip.label}</Text>\n </Pressable>\n ))}\n </View>\n ) : null}\n </Pressable>\n </ScrollView>\n ) : (\n <View style={styles.fill}>\n {/* Links open through the host's ChatLinkOpenerProvider (mounted at the\n app root): it needs Apollo, the root navigator and the in-app\n browser, which must stay out of the native surface remotes. */}\n <ChatTranscript\n messages={messages}\n streamingContent={streamingContent ?? undefined}\n isDark={isDark}\n listFooter={beforeComposer}\n renderMessageActions={renderMessageExtras}\n mapToolSteps={mapToolSteps}\n />\n {busy && !streamingContent?.trim() ? (\n <View style={styles.thinking}>\n {busyIndicator ?? (\n <ThinkingIndicator variant=\"awaiting\" color={muted} isDark={isDark} />\n )}\n </View>\n ) : null}\n </View>\n )}\n\n <View\n style={[\n styles.composerWrap,\n { borderColor: border, paddingBottom: keyboardShown ? 10 : Math.max(insets.bottom, 10) },\n ]}\n >\n {composerLead}\n {renderConnectorCard?.(isDark)}\n {banner ? (\n <View style={[styles.errorBanner, { backgroundColor: isDark ? '#2b1a1d' : '#fef2f2' }]}>\n <Text style={styles.errorText}>{banner}</Text>\n </View>\n ) : null}\n\n {queuedTurns.length > 0 ? (\n <QueuedFollowUps\n items={queuedTurns}\n onCancel={(id) => steering?.cancelQueued?.(id)}\n onSendNow={() => steering?.sendQueuedNow?.()}\n isDark={isDark}\n />\n ) : null}\n\n {voicePanel ?? (\n <View\n style={[\n styles.composerCard,\n { borderColor: border, backgroundColor: card ?? (isDark ? '#111827' : '#fff') },\n ]}\n >\n {enableAttachments ? (\n <ComposerAttachmentBar\n attachments={attachments.pending}\n onRemove={attachments.remove}\n isDark={isDark}\n />\n ) : null}\n <View style={styles.inputRow}>\n <TextInput\n value={draft}\n onChangeText={(next) => {\n setDraft(next);\n if (voiceError) setVoiceError(null);\n }}\n placeholder={listening ? 'Listening… speak your request' : placeholder}\n placeholderTextColor={muted}\n multiline\n textAlignVertical=\"top\"\n onSubmitEditing={() => submit()}\n style={[styles.input, { color: ink }]}\n accessibilityLabel={placeholder}\n />\n {enableVoice ? (\n <Pressable\n onPress={handleMicPress}\n style={[styles.mic, listening && styles.micLive]}\n accessibilityRole=\"button\"\n accessibilityLabel={listening ? 'Stop listening' : 'Start voice input'}\n >\n <Feather\n name={listening ? 'square' : 'mic'}\n size={16}\n color={listening ? '#b91c1c' : muted}\n />\n </Pressable>\n ) : null}\n {canSend ? (\n <Pressable\n onPress={() => submit()}\n style={[styles.send, busy && { opacity: 0.85 }]}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Send\"\n >\n <Feather name=\"send\" size={14} color=\"#fff\" style={styles.sendIcon} />\n </Pressable>\n ) : null}\n {!canSend && canStop ? (\n <Pressable\n onPress={() => steering?.stop?.()}\n style={[styles.send, styles.stop]}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Stop the reply\"\n >\n <Feather name=\"square\" size={12} color=\"#fff\" />\n </Pressable>\n ) : null}\n </View>\n {enableAttachments || composerAccessory ? (\n <View style={styles.tools}>\n {enableAttachments ? (\n <>\n <Pressable\n onPress={() => openPicker(attachments.pickFromLibrary)}\n onLongPress={() => openPicker(attachments.captureFromCamera)}\n disabled={attachments.busy}\n style={styles.toolBtn}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Add image or screenshot\"\n >\n {attachments.busyKind === 'library' ||\n attachments.busyKind === 'camera' ? (\n <ActivityIndicator size=\"small\" />\n ) : (\n <Feather name=\"image\" size={18} color={muted} />\n )}\n </Pressable>\n <Pressable\n onPress={() => openPicker(attachments.pickDocuments)}\n disabled={attachments.busy}\n style={styles.toolBtn}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Attach files\"\n >\n {attachments.busyKind === 'documents' ? (\n <ActivityIndicator size=\"small\" />\n ) : (\n <Feather name=\"paperclip\" size={18} color={muted} />\n )}\n </Pressable>\n </>\n ) : null}\n {composerAccessory ? (\n <View style={styles.toolsAccessory}>{composerAccessory}</View>\n ) : null}\n </View>\n ) : null}\n </View>\n )}\n </View>\n </AppKeyboardAvoidingView>\n {paneOverlay}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: { zIndex: 200, elevation: 200 },\n fill: { flex: 1, overflow: 'hidden' },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingBottom: 10,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n headTitle: { flexDirection: 'row', alignItems: 'center', gap: 8 },\n headActions: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n title: { fontSize: 16, fontWeight: '700' },\n emptyScroll: { flexGrow: 1 },\n empty: { flexGrow: 1, gap: 10, paddingTop: 20, paddingHorizontal: 16 },\n thinking: { paddingHorizontal: 16, paddingBottom: 8 },\n emptyTitle: { fontSize: 18, fontWeight: '700', letterSpacing: -0.3 },\n emptyBody: { fontSize: 14, lineHeight: 20 },\n chips: { flexDirection: 'row', flexWrap: 'wrap', gap: 8, marginTop: 4 },\n chip: { borderWidth: 1, borderRadius: 999, paddingHorizontal: 12, paddingVertical: 8 },\n chipText: { fontSize: 13, fontWeight: '600' },\n composerWrap: { paddingHorizontal: 12, paddingTop: 8, gap: 8 },\n errorBanner: { borderRadius: 10, padding: 8 },\n errorText: { color: '#991b1b', fontSize: 12 },\n composerCard: {\n borderWidth: StyleSheet.hairlineWidth,\n borderRadius: 18,\n paddingHorizontal: 12,\n paddingTop: 10,\n paddingBottom: 8,\n gap: 4,\n overflow: 'visible',\n },\n inputRow: {\n flexDirection: 'row',\n alignItems: 'flex-end',\n gap: 4,\n minHeight: 44,\n },\n input: { flex: 1, fontSize: 15, maxHeight: 120, minHeight: 40, paddingVertical: 8, paddingHorizontal: 2 },\n tools: { flexDirection: 'row', alignItems: 'center', gap: 2, paddingTop: 2, overflow: 'visible' },\n toolsAccessory: { marginLeft: 'auto', flexShrink: 1 },\n mic: {\n width: 32,\n height: 32,\n borderRadius: 8,\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: 2,\n },\n micLive: { backgroundColor: 'rgba(185,28,28,0.12)' },\n send: {\n width: 32,\n height: 32,\n borderRadius: 16,\n backgroundColor: '#ea580c',\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: 2,\n },\n sendIcon: { transform: [{ rotate: '45deg' }] },\n stop: { backgroundColor: '#0f172a' },\n toolBtn: {\n width: 36,\n height: 36,\n borderRadius: 8,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"],"names":["error","_a"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBO,SAAS,eAAgB,CAAA;AAAA,EAC9B,KAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,mBAAA;AAAA,EACA,mBAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAO,GAAA,KAAA;AAAA,EACP,QAAA;AAAA,EACA,gBAAmB,GAAA,IAAA;AAAA,EACnB,KAAQ,GAAA,IAAA;AAAA,EACR,WAAc,GAAA,oBAAA;AAAA,EACd,UAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAc,EAAC;AAAA,EACf,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,KAAO,EAAA,SAAA;AAAA,EACP,aAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,sBAAA;AAAA,EACA,QAAW,GAAA,KAAA;AAAA,EACX,WAAA;AAAA,EACA,WAAc,GAAA,IAAA;AAAA,EACd,iBAAoB,GAAA,IAAA;AAAA,EACpB,MAAS,GAAA,KAAA;AAAA,EACT,GAAM,GAAA,SAAA;AAAA,EACN,KAAQ,GAAA,SAAA;AAAA,EACR,MAAS,GAAA,SAAA;AA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,EAAA;AAAA,GAChB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,eAAiB,EAAA;AAAA,GACnB;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,EAAA;AAAA,IACd,eAAiB,EAAA,SAAA;AAAA,IACjB,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA,QAAA;AAAA,IAChB,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,WAAW,CAAC;AAAA,MACV,MAAQ,EAAA;AAAA,KACT;AAAA,GACH;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA;AAAA,GACnB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,CAAA;AAAA,IACd,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA;AAEpB,CAAC,CAAA"}
|
|
@@ -25,7 +25,8 @@ function ChatTranscript({
|
|
|
25
25
|
renderMessageActions,
|
|
26
26
|
listContentStyle,
|
|
27
27
|
listFooter,
|
|
28
|
-
isDark = false
|
|
28
|
+
isDark = false,
|
|
29
|
+
mapToolSteps
|
|
29
30
|
}) {
|
|
30
31
|
const listRef = useRef(null);
|
|
31
32
|
const stickToBottomRef = useRef(true);
|
|
@@ -155,7 +156,7 @@ function ChatTranscript({
|
|
|
155
156
|
}, [scrollToLatest]);
|
|
156
157
|
const renderItem = useCallback(({
|
|
157
158
|
item
|
|
158
|
-
}) => /* @__PURE__ */ jsx(TranscriptGroupView, { group: item, isDark, renderMessageActions }), [isDark, renderMessageActions]);
|
|
159
|
+
}) => /* @__PURE__ */ jsx(TranscriptGroupView, { group: item, isDark, renderMessageActions, mapToolSteps }), [isDark, renderMessageActions, mapToolSteps]);
|
|
159
160
|
return /* @__PURE__ */ jsx(View, { style: styles.list, children: /* @__PURE__ */ jsx(FlatList, { ref: listRef, data: groups, keyExtractor: (item) => item.id, renderItem, extraData: `${streamingContent != null ? streamingContent : ""}:${quickReply != null ? quickReply : ""}:${Boolean(listFooter)}`, ListFooterComponent: listFooter ? /* @__PURE__ */ jsx(Fragment, { children: listFooter }) : null, initialNumToRender: 12, maxToRenderPerBatch: 8, updateCellsBatchingPeriod: 50, windowSize: 21, scrollEnabled: true, nestedScrollEnabled: false, directionalLockEnabled: true, onScroll: handleScroll, onContentSizeChange: handleContentSizeChange, onLayout: () => {
|
|
160
161
|
if (stickToBottomRef.current) scrollToLatest(false);
|
|
161
162
|
}, scrollEventThrottle: 16, keyboardShouldPersistTaps: "handled", keyboardDismissMode: Platform.OS === "ios" ? "interactive" : "on-drag", automaticallyAdjustKeyboardInsets: false, automaticallyAdjustContentInsets: false, contentInsetAdjustmentBehavior: "never", contentContainerStyle: [styles.listContent, listContentStyle, !listFooter && styles.listContentFill], style: styles.list }) });
|
|
@@ -163,7 +164,8 @@ function ChatTranscript({
|
|
|
163
164
|
const TranscriptGroupView = memo(function TranscriptGroupView2({
|
|
164
165
|
group,
|
|
165
166
|
isDark,
|
|
166
|
-
renderMessageActions
|
|
167
|
+
renderMessageActions,
|
|
168
|
+
mapToolSteps
|
|
167
169
|
}) {
|
|
168
170
|
const openLink = useChatLinkOpener();
|
|
169
171
|
const onLinkPress = useCallback((url) => {
|
|
@@ -186,13 +188,14 @@ const TranscriptGroupView = memo(function TranscriptGroupView2({
|
|
|
186
188
|
}) });
|
|
187
189
|
}
|
|
188
190
|
const last = group.items[group.items.length - 1];
|
|
189
|
-
return /* @__PURE__ */ jsx(View, { style: styles.assistantGroup, children: group.items.map((item, index) => /* @__PURE__ */ jsx(AssistantTurnView, { item, isDark, tightTop: index > 0, renderMessageActions: item.streaming || item !== last ? void 0 : renderMessageActions }, item.id)) });
|
|
191
|
+
return /* @__PURE__ */ jsx(View, { style: styles.assistantGroup, children: group.items.map((item, index) => /* @__PURE__ */ jsx(AssistantTurnView, { item, isDark, tightTop: index > 0, renderMessageActions: item.streaming || item !== last ? void 0 : renderMessageActions, mapToolSteps }, item.id)) });
|
|
190
192
|
});
|
|
191
193
|
const AssistantTurnView = memo(function AssistantTurnView2({
|
|
192
194
|
item,
|
|
193
195
|
isDark,
|
|
194
196
|
tightTop,
|
|
195
|
-
renderMessageActions
|
|
197
|
+
renderMessageActions,
|
|
198
|
+
mapToolSteps
|
|
196
199
|
}) {
|
|
197
200
|
var _a;
|
|
198
201
|
const attachments = (_a = item.attachments) != null ? _a : [];
|
|
@@ -206,7 +209,7 @@ const AssistantTurnView = memo(function AssistantTurnView2({
|
|
|
206
209
|
return /* @__PURE__ */ jsxs(View, { style: [styles.assistantCol, tightTop && styles.assistantColTight], children: [
|
|
207
210
|
attachments.length > 0 ? /* @__PURE__ */ jsx(MessageAttachmentPreviews, { attachments, align: "start", isDark }) : null,
|
|
208
211
|
item.preResponse ? /* @__PURE__ */ jsx(PreResponseStrip, { text: item.preResponse, expanded: preResponseOpen, live: !!item.streaming, isDark }) : null,
|
|
209
|
-
toolActivity.steps.length > 0 ? /* @__PURE__ */ jsx(ToolTimeline, { steps: toolActivity.steps, active: !!item.streaming, isDark }) : null,
|
|
212
|
+
toolActivity.steps.length > 0 ? /* @__PURE__ */ jsx(ToolTimeline, { steps: mapToolSteps ? mapToolSteps(toolActivity.steps) : toolActivity.steps, active: !!item.streaming, isDark }) : null,
|
|
210
213
|
text ? /* @__PURE__ */ jsx(AssistantMarkdown, { text, streaming: !!item.streaming, isDark }) : null,
|
|
211
214
|
widgets.map((widget, i) => /* @__PURE__ */ jsx(ChatWidgetCard, { widget, isDark }, `${widget.component}-${i}`)),
|
|
212
215
|
renderMessageActions ? renderMessageActions({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatTranscript.js","sources":["../../../src/features/chat/ChatTranscript.tsx"],"sourcesContent":["/**\n * Chat thread list that can show attachment previews.\n *\n * `@messenger-box/platform-mobile` PlanModeView maps each row to GiftedChat\n * `{ text }` only, so an image send becomes the gateway caption\n * \"Attached: IMG_0005.jpg\" with no thumbnail. This list keeps streaming\n * markdown for the assistant and draws Manus-style previews on the user side.\n *\n * Rows stay oldest → newest (same as web). A previous `inverted` FlatList\n * reversed that order on device. The composer dock already lifts with the\n * keyboard; this list just fills the leftover space and pins to the latest\n * turn.\n */\nimport React, { memo, useCallback, useEffect, useMemo, useRef, type ReactNode } from 'react';\nimport { FlatList, Platform, Pressable, StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\nimport Markdown from 'react-native-markdown-display';\nimport { dismissKeyboard } from '../../utils/keyboardController';\nimport { useKeyboardLiftHeight } from '../../components/KeyboardComposerDock';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { displayUserMessageText, shouldRenderUserTranscriptTurn } from '../attachments/displayUserMessageText';\nimport { MessageAttachmentPreviews } from '../attachments/MessageAttachmentPreviews';\nimport { ToolTimeline } from './ToolTimeline';\nimport { ChatWidgetCard } from './ChatWidgetCard';\nimport { splitChatWidgets } from './chatWidgets';\nimport { parseToolActivity } from './toolActivity';\nimport { parseAskUser, stripAskUser, displayAskUserAssistantText } from './askUser';\nimport { stripSurfaceNotes } from './surfaceNotes';\nimport { collapseDuplicateUserRows, groupConsecutiveRoleRows, type RoleGroup } from './transcriptGroups';\nimport { AssistantMarkdown } from './AssistantMarkdown';\nimport { useChatLinkOpener } from '../links/chatLinkOpener';\nimport { autolinkBareUrls } from '../messaging/chatLinks';\nimport { PreResponseStrip } from './PreResponseStrip';\nimport { splitPreResponse } from './preResponse';\n\nexport type TranscriptMessage = {\n id: string;\n role: string;\n content: string;\n displayContent?: string;\n attachments?: MessageAttachment[];\n /** Typed while the gateway was down: shown in place, waiting on the outbox. */\n queued?: boolean;\n /** What the caption under a queued turn says, when it is not waiting on the gateway to connect. */\n queuedNote?: string;\n};\n\ntype TranscriptRow = TranscriptMessage & {\n streaming?: boolean;\n askAnswered?: boolean;\n /** The fast lane's quick answer for this turn, drawn as a strip - never as text. */\n preResponse?: string | null;\n};\ntype TranscriptGroup = RoleGroup<TranscriptRow>;\n\nexport const USER_BUBBLE_BG = '#2563eb';\n\nexport function ChatTranscript({\n messages,\n streamingContent,\n quickReply,\n renderMessageActions,\n listContentStyle,\n listFooter,\n isDark = false,\n}: {\n messages: TranscriptMessage[];\n streamingContent?: string;\n /** The running turn's quick answer (fast lane or brain), already split off the stream. */\n quickReply?: string;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n listContentStyle?: StyleProp<ViewStyle>;\n listFooter?: ReactNode;\n isDark?: boolean;\n}) {\n const listRef = useRef<FlatList<TranscriptGroup>>(null);\n const stickToBottomRef = useRef(true);\n const isProgrammaticScrollRef = useRef(false);\n const ignoreScrollUntilRef = useRef(0);\n const keyboardHeight = useKeyboardLiftHeight();\n\n const historyRows = useMemo<TranscriptRow[]>(() => {\n const rows: TranscriptRow[] = [];\n messages.forEach((msg, index) => {\n if (msg.role === 'user') {\n if (shouldRenderUserTranscriptTurn(msg.content, msg.attachments)) {\n rows.push({ ...msg, streaming: false });\n }\n return;\n }\n if (msg.role !== 'assistant') {\n rows.push({ ...msg, streaming: false });\n return;\n }\n // A persisted reply carries its quick answer prepended in the gateway's\n // markers; the row keeps the two apart from here on.\n const { preResponse, text: content } = splitPreResponse(msg.content);\n const hasAttachments = (msg.attachments?.length ?? 0) > 0;\n const askAnswered =\n Boolean(parseAskUser(content)) && messages.slice(index + 1).some((m) => m.role === 'user');\n const visible = displayAskUserAssistantText(content, askAnswered).trim();\n const tools = parseToolActivity(stripAskUser(content), false);\n const hasAsk = Boolean(parseAskUser(content));\n if (hasAsk && !visible && tools.steps.length === 0 && !hasAttachments && !preResponse) {\n return;\n }\n if (!hasAsk) {\n const leftover = stripAskUser(content).trim();\n if (!leftover && !hasAttachments && !preResponse) return;\n }\n rows.push({ ...msg, content, preResponse, streaming: false, askAnswered });\n });\n return rows;\n }, [messages]);\n\n const rows = useMemo<TranscriptRow[]>(() => {\n const history = collapseDuplicateUserRows(historyRows);\n // The chat hook hands the quick answer over split off the stream; a raw\n // stream (another host) may still carry the markers, open mid-stream.\n const { preResponse: streamPre, text: rawStream } = splitPreResponse(streamingContent ?? '');\n const livePre = quickReply?.trim() || streamPre;\n const last = history[history.length - 1];\n const streamAskAnswered = last?.role === 'user' && Boolean(parseAskUser(rawStream));\n const streamProse = displayAskUserAssistantText(rawStream, streamAskAnswered).trim();\n const streamTools = parseToolActivity(stripAskUser(rawStream), true);\n if (!streamProse && streamTools.steps.length === 0 && !livePre) return history;\n if (last?.role === 'assistant' && (!livePre || last.preResponse === livePre)) {\n const lastText = last.content.trim();\n const streamText = rawStream.trim();\n if (lastText === streamText || lastText.startsWith(streamText) || streamText.startsWith(lastText)) {\n return history;\n }\n }\n return [\n ...history,\n {\n id: '__streaming__',\n role: 'assistant',\n content: rawStream,\n preResponse: livePre,\n streaming: true,\n askAnswered: streamAskAnswered,\n },\n ];\n }, [historyRows, streamingContent, quickReply]);\n\n const groups = useMemo(() => groupConsecutiveRoleRows(rows), [rows]);\n\n const scrollToLatest = useCallback(\n (animated: boolean) => {\n if (groups.length === 0) return;\n isProgrammaticScrollRef.current = true;\n stickToBottomRef.current = true;\n const list = listRef.current;\n if (!list) return;\n list.scrollToEnd({ animated });\n },\n [groups.length],\n );\n\n useEffect(() => {\n if (groups.length === 0 || !stickToBottomRef.current) return undefined;\n const t = setTimeout(() => scrollToLatest(false), 0);\n return () => clearTimeout(t);\n }, [groups.length, streamingContent?.length, quickReply?.length, scrollToLatest]);\n\n // Spacer and list height update on the same keyboard frame. Scroll only\n // after that shrink, or we stay on the top of a long turn (image 1).\n useEffect(() => {\n if (keyboardHeight <= 0) return undefined;\n stickToBottomRef.current = true;\n ignoreScrollUntilRef.current = Date.now() + 400;\n const frame = requestAnimationFrame(() => scrollToLatest(false));\n const afterLayout = setTimeout(() => scrollToLatest(false), 64);\n const afterKeyboard = setTimeout(() => scrollToLatest(false), 280);\n return () => {\n cancelAnimationFrame(frame);\n clearTimeout(afterLayout);\n clearTimeout(afterKeyboard);\n };\n }, [keyboardHeight, scrollToLatest]);\n\n const handleScroll = useCallback(\n (e: {\n nativeEvent: {\n contentOffset: { y: number };\n contentSize: { height: number };\n layoutMeasurement: { height: number };\n };\n }) => {\n if (Date.now() < ignoreScrollUntilRef.current) {\n stickToBottomRef.current = true;\n return;\n }\n const { contentOffset, contentSize, layoutMeasurement } = e.nativeEvent;\n const nearLatest = contentOffset.y + layoutMeasurement.height >= contentSize.height - 80;\n if (!isProgrammaticScrollRef.current) {\n stickToBottomRef.current = nearLatest;\n } else if (nearLatest) {\n isProgrammaticScrollRef.current = false;\n }\n },\n [],\n );\n\n const handleContentSizeChange = useCallback(() => {\n if (!stickToBottomRef.current) return;\n scrollToLatest(false);\n }, [scrollToLatest]);\n\n const renderItem = useCallback(\n ({ item }: { item: TranscriptGroup }) => (\n <TranscriptGroupView group={item} isDark={isDark} renderMessageActions={renderMessageActions} />\n ),\n [isDark, renderMessageActions],\n );\n\n return (\n <View style={styles.list}>\n <FlatList\n ref={listRef}\n data={groups}\n keyExtractor={(item) => item.id}\n renderItem={renderItem}\n extraData={`${streamingContent ?? ''}:${quickReply ?? ''}:${Boolean(listFooter)}`}\n ListFooterComponent={listFooter ? <>{listFooter}</> : null}\n initialNumToRender={12}\n maxToRenderPerBatch={8}\n updateCellsBatchingPeriod={50}\n windowSize={21}\n scrollEnabled\n nestedScrollEnabled={false}\n directionalLockEnabled\n onScroll={handleScroll}\n onContentSizeChange={handleContentSizeChange}\n onLayout={() => {\n if (stickToBottomRef.current) scrollToLatest(false);\n }}\n scrollEventThrottle={16}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode={Platform.OS === 'ios' ? 'interactive' : 'on-drag'}\n automaticallyAdjustKeyboardInsets={false}\n automaticallyAdjustContentInsets={false}\n contentInsetAdjustmentBehavior=\"never\"\n contentContainerStyle={[styles.listContent, listContentStyle, !listFooter && styles.listContentFill]}\n style={styles.list}\n />\n </View>\n );\n}\n\nconst TranscriptGroupView = memo(function TranscriptGroupView({\n group,\n isDark,\n renderMessageActions,\n}: {\n group: TranscriptGroup;\n isDark: boolean;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n}) {\n // A link the person pasted opens like one the assistant sent: in the app or a browser sheet.\n const openLink = useChatLinkOpener();\n const onLinkPress = useCallback(\n (url: string) => {\n openLink(url);\n return false;\n },\n [openLink],\n );\n if (group.role === 'user') {\n return (\n <Pressable style={styles.userCol} onPress={dismissKeyboard} accessible={false}>\n {group.items.map((item, index) => {\n const attachments = item.attachments ?? [];\n const text = displayUserMessageText(item.displayContent ?? item.content, attachments);\n if (!text && attachments.length === 0) return null;\n return (\n <View key={item.id} style={[styles.userTurn, index > 0 && styles.userFollow]}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"end\" isDark={isDark} />\n ) : null}\n {text ? (\n <View style={[styles.userBubble, item.queued && styles.userBubbleQueued]}>\n <Markdown style={USER_MARKDOWN} onLinkPress={onLinkPress}>\n {/* Bare URLs the person typed become links, as in the assistant's replies. */}\n {autolinkBareUrls(text)}\n </Markdown>\n </View>\n ) : null}\n {item.queued ? (\n <Text style={[styles.queuedCaption, { color: isDark ? '#94a3b8' : '#64748b' }]}>\n {item.queuedNote ?? 'Queued · sends when the gateway connects'}\n </Text>\n ) : null}\n </View>\n );\n })}\n </Pressable>\n );\n }\n\n const last = group.items[group.items.length - 1];\n\n return (\n <View style={styles.assistantGroup}>\n {group.items.map((item, index) => (\n <AssistantTurnView\n key={item.id}\n item={item}\n isDark={isDark}\n tightTop={index > 0}\n renderMessageActions={item.streaming || item !== last ? undefined : renderMessageActions}\n />\n ))}\n </View>\n );\n});\n\nconst AssistantTurnView = memo(function AssistantTurnView({\n item,\n isDark,\n tightTop,\n renderMessageActions,\n}: {\n item: TranscriptRow;\n isDark: boolean;\n tightTop: boolean;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n}) {\n const attachments = item.attachments ?? [];\n const stripped = stripAskUser(item.content);\n const toolActivity = parseToolActivity(stripped, !!item.streaming);\n // Widget envelopes become native cards below the text, never raw JSON.\n const { text, widgets } = splitChatWidgets(\n parseToolActivity(\n stripSurfaceNotes(displayAskUserAssistantText(item.content, !!item.askAnswered)),\n !!item.streaming,\n ).text,\n !!item.streaming,\n );\n\n // The quick answer stays open while it is all there is to read: until the\n // agent's own words start on a live turn, or for good on a reply that never\n // got anything past it. Tool steps alone do not fold it - they are not an answer.\n const preResponseOpen = item.streaming\n ? !text.trim()\n : !text.trim() && toolActivity.steps.length === 0 && widgets.length === 0 && attachments.length === 0;\n\n return (\n <View style={[styles.assistantCol, tightTop && styles.assistantColTight]}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"start\" isDark={isDark} />\n ) : null}\n {item.preResponse ? (\n <PreResponseStrip\n text={item.preResponse}\n expanded={preResponseOpen}\n live={!!item.streaming}\n isDark={isDark}\n />\n ) : null}\n {toolActivity.steps.length > 0 ? (\n <ToolTimeline steps={toolActivity.steps} active={!!item.streaming} isDark={isDark} />\n ) : null}\n {text ? <AssistantMarkdown text={text} streaming={!!item.streaming} isDark={isDark} /> : null}\n {widgets.map((widget, i) => (\n <ChatWidgetCard key={`${widget.component}-${i}`} widget={widget} isDark={isDark} />\n ))}\n {renderMessageActions\n ? renderMessageActions({\n id: item.id,\n role: 'assistant',\n // Copy and share take what the user reads, not the wire markup.\n content: text.trim() || item.preResponse || item.content,\n })\n : null}\n </View>\n );\n});\n\nconst USER_MARKDOWN = {\n body: { color: '#ffffff', fontSize: 15, lineHeight: 22 },\n // White and underlined: the bubble is blue, so the usual blue link would vanish.\n link: { color: '#ffffff', textDecorationLine: 'underline' as const },\n paragraph: { marginTop: 4, marginBottom: 4, color: '#ffffff' },\n strong: { fontWeight: '700' as const, color: '#ffffff' },\n em: { color: '#ffffff' },\n text: { color: '#ffffff' },\n bullet_list: { marginVertical: 4 },\n ordered_list: { marginVertical: 4 },\n list_item: { marginVertical: 2, color: '#ffffff' },\n};\n\nconst styles = StyleSheet.create({\n list: {\n flex: 1,\n minHeight: 0,\n },\n listContent: {\n paddingTop: 8,\n paddingBottom: 8,\n paddingHorizontal: 8,\n },\n listContentFill: {\n flexGrow: 1,\n },\n userCol: {\n width: '100%',\n alignItems: 'flex-end',\n marginBottom: 12,\n paddingHorizontal: 4,\n },\n userTurn: {\n maxWidth: '92%',\n alignItems: 'flex-end',\n },\n userFollow: {\n marginTop: 4,\n },\n userBubble: {\n backgroundColor: USER_BUBBLE_BG,\n borderRadius: 16,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n // Same bubble, held back: a queued turn reads as pending, not as delivered.\n userBubbleQueued: {\n opacity: 0.55,\n },\n queuedCaption: {\n fontSize: 11,\n fontWeight: '500',\n marginTop: 4,\n marginRight: 2,\n },\n assistantGroup: {\n width: '100%',\n marginBottom: 4,\n },\n assistantCol: {\n width: '100%',\n flexGrow: 0,\n alignItems: 'stretch',\n marginBottom: 8,\n paddingHorizontal: 4,\n },\n assistantColTight: {\n marginTop: -4,\n },\n});\n"],"names":["rows","TranscriptGroupView","AssistantTurnView"],"mappings":";;;;;;;;;;;;;;;;;;;AAmDO,MAAM,cAAiB,GAAA;AACvB,SAAS,cAAe,CAAA;AAAA,EAC7B,QAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,oBAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAS,GAAA;AACX,CAaG,EAAA;AACD,EAAM,MAAA,OAAA,GAAU,OAAkC,IAAI,CAAA;AACtD,EAAM,MAAA,gBAAA,GAAmB,OAAO,IAAI,CAAA;AACpC,EAAM,MAAA,uBAAA,GAA0B,OAAO,KAAK,CAAA;AAC5C,EAAM,MAAA,oBAAA,GAAuB,OAAO,CAAC,CAAA;AACrC,EAAA,MAAM,iBAAiB,qBAAsB,EAAA;AAC7C,E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A,SAAA;AAAA,IACZ,YAAc,EAAA,CAAA;AAAA,IACd,iBAAmB,EAAA;AAAA,GACrB;AAAA,EACA,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"ChatTranscript.js","sources":["../../../src/features/chat/ChatTranscript.tsx"],"sourcesContent":["/**\n * Chat thread list that can show attachment previews.\n *\n * `@messenger-box/platform-mobile` PlanModeView maps each row to GiftedChat\n * `{ text }` only, so an image send becomes the gateway caption\n * \"Attached: IMG_0005.jpg\" with no thumbnail. This list keeps streaming\n * markdown for the assistant and draws Manus-style previews on the user side.\n *\n * Rows stay oldest → newest (same as web). A previous `inverted` FlatList\n * reversed that order on device. The composer dock already lifts with the\n * keyboard; this list just fills the leftover space and pins to the latest\n * turn.\n */\nimport React, { memo, useCallback, useEffect, useMemo, useRef, type ReactNode } from 'react';\nimport { FlatList, Platform, Pressable, StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\nimport Markdown from 'react-native-markdown-display';\nimport { dismissKeyboard } from '../../utils/keyboardController';\nimport { useKeyboardLiftHeight } from '../../components/KeyboardComposerDock';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { displayUserMessageText, shouldRenderUserTranscriptTurn } from '../attachments/displayUserMessageText';\nimport { MessageAttachmentPreviews } from '../attachments/MessageAttachmentPreviews';\nimport { ToolTimeline } from './ToolTimeline';\nimport { ChatWidgetCard } from './ChatWidgetCard';\nimport { splitChatWidgets } from './chatWidgets';\nimport { parseToolActivity, type ToolStep } from './toolActivity';\nimport { parseAskUser, stripAskUser, displayAskUserAssistantText } from './askUser';\nimport { stripSurfaceNotes } from './surfaceNotes';\nimport { collapseDuplicateUserRows, groupConsecutiveRoleRows, type RoleGroup } from './transcriptGroups';\nimport { AssistantMarkdown } from './AssistantMarkdown';\nimport { useChatLinkOpener } from '../links/chatLinkOpener';\nimport { autolinkBareUrls } from '../messaging/chatLinks';\nimport { PreResponseStrip } from './PreResponseStrip';\nimport { splitPreResponse } from './preResponse';\n\nexport type TranscriptMessage = {\n id: string;\n role: string;\n content: string;\n displayContent?: string;\n attachments?: MessageAttachment[];\n /** Typed while the gateway was down: shown in place, waiting on the outbox. */\n queued?: boolean;\n /** What the caption under a queued turn says, when it is not waiting on the gateway to connect. */\n queuedNote?: string;\n};\n\ntype TranscriptRow = TranscriptMessage & {\n streaming?: boolean;\n askAnswered?: boolean;\n /** The fast lane's quick answer for this turn, drawn as a strip - never as text. */\n preResponse?: string | null;\n};\ntype TranscriptGroup = RoleGroup<TranscriptRow>;\n\nexport const USER_BUBBLE_BG = '#2563eb';\n\nexport function ChatTranscript({\n messages,\n streamingContent,\n quickReply,\n renderMessageActions,\n listContentStyle,\n listFooter,\n isDark = false,\n mapToolSteps,\n}: {\n messages: TranscriptMessage[];\n streamingContent?: string;\n /** The running turn's quick answer (fast lane or brain), already split off the stream. */\n quickReply?: string;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n listContentStyle?: StyleProp<ViewStyle>;\n listFooter?: ReactNode;\n isDark?: boolean;\n /** Plain labels for the tool steps (a surface's own wording); the steps as parsed otherwise. */\n mapToolSteps?: (steps: ToolStep[]) => ToolStep[];\n}) {\n const listRef = useRef<FlatList<TranscriptGroup>>(null);\n const stickToBottomRef = useRef(true);\n const isProgrammaticScrollRef = useRef(false);\n const ignoreScrollUntilRef = useRef(0);\n const keyboardHeight = useKeyboardLiftHeight();\n\n const historyRows = useMemo<TranscriptRow[]>(() => {\n const rows: TranscriptRow[] = [];\n messages.forEach((msg, index) => {\n if (msg.role === 'user') {\n if (shouldRenderUserTranscriptTurn(msg.content, msg.attachments)) {\n rows.push({ ...msg, streaming: false });\n }\n return;\n }\n if (msg.role !== 'assistant') {\n rows.push({ ...msg, streaming: false });\n return;\n }\n // A persisted reply carries its quick answer prepended in the gateway's\n // markers; the row keeps the two apart from here on.\n const { preResponse, text: content } = splitPreResponse(msg.content);\n const hasAttachments = (msg.attachments?.length ?? 0) > 0;\n const askAnswered =\n Boolean(parseAskUser(content)) && messages.slice(index + 1).some((m) => m.role === 'user');\n const visible = displayAskUserAssistantText(content, askAnswered).trim();\n const tools = parseToolActivity(stripAskUser(content), false);\n const hasAsk = Boolean(parseAskUser(content));\n if (hasAsk && !visible && tools.steps.length === 0 && !hasAttachments && !preResponse) {\n return;\n }\n if (!hasAsk) {\n const leftover = stripAskUser(content).trim();\n if (!leftover && !hasAttachments && !preResponse) return;\n }\n rows.push({ ...msg, content, preResponse, streaming: false, askAnswered });\n });\n return rows;\n }, [messages]);\n\n const rows = useMemo<TranscriptRow[]>(() => {\n const history = collapseDuplicateUserRows(historyRows);\n // The chat hook hands the quick answer over split off the stream; a raw\n // stream (another host) may still carry the markers, open mid-stream.\n const { preResponse: streamPre, text: rawStream } = splitPreResponse(streamingContent ?? '');\n const livePre = quickReply?.trim() || streamPre;\n const last = history[history.length - 1];\n const streamAskAnswered = last?.role === 'user' && Boolean(parseAskUser(rawStream));\n const streamProse = displayAskUserAssistantText(rawStream, streamAskAnswered).trim();\n const streamTools = parseToolActivity(stripAskUser(rawStream), true);\n if (!streamProse && streamTools.steps.length === 0 && !livePre) return history;\n if (last?.role === 'assistant' && (!livePre || last.preResponse === livePre)) {\n const lastText = last.content.trim();\n const streamText = rawStream.trim();\n if (lastText === streamText || lastText.startsWith(streamText) || streamText.startsWith(lastText)) {\n return history;\n }\n }\n return [\n ...history,\n {\n id: '__streaming__',\n role: 'assistant',\n content: rawStream,\n preResponse: livePre,\n streaming: true,\n askAnswered: streamAskAnswered,\n },\n ];\n }, [historyRows, streamingContent, quickReply]);\n\n const groups = useMemo(() => groupConsecutiveRoleRows(rows), [rows]);\n\n const scrollToLatest = useCallback(\n (animated: boolean) => {\n if (groups.length === 0) return;\n isProgrammaticScrollRef.current = true;\n stickToBottomRef.current = true;\n const list = listRef.current;\n if (!list) return;\n list.scrollToEnd({ animated });\n },\n [groups.length],\n );\n\n useEffect(() => {\n if (groups.length === 0 || !stickToBottomRef.current) return undefined;\n const t = setTimeout(() => scrollToLatest(false), 0);\n return () => clearTimeout(t);\n }, [groups.length, streamingContent?.length, quickReply?.length, scrollToLatest]);\n\n // Spacer and list height update on the same keyboard frame. Scroll only\n // after that shrink, or we stay on the top of a long turn (image 1).\n useEffect(() => {\n if (keyboardHeight <= 0) return undefined;\n stickToBottomRef.current = true;\n ignoreScrollUntilRef.current = Date.now() + 400;\n const frame = requestAnimationFrame(() => scrollToLatest(false));\n const afterLayout = setTimeout(() => scrollToLatest(false), 64);\n const afterKeyboard = setTimeout(() => scrollToLatest(false), 280);\n return () => {\n cancelAnimationFrame(frame);\n clearTimeout(afterLayout);\n clearTimeout(afterKeyboard);\n };\n }, [keyboardHeight, scrollToLatest]);\n\n const handleScroll = useCallback(\n (e: {\n nativeEvent: {\n contentOffset: { y: number };\n contentSize: { height: number };\n layoutMeasurement: { height: number };\n };\n }) => {\n if (Date.now() < ignoreScrollUntilRef.current) {\n stickToBottomRef.current = true;\n return;\n }\n const { contentOffset, contentSize, layoutMeasurement } = e.nativeEvent;\n const nearLatest = contentOffset.y + layoutMeasurement.height >= contentSize.height - 80;\n if (!isProgrammaticScrollRef.current) {\n stickToBottomRef.current = nearLatest;\n } else if (nearLatest) {\n isProgrammaticScrollRef.current = false;\n }\n },\n [],\n );\n\n const handleContentSizeChange = useCallback(() => {\n if (!stickToBottomRef.current) return;\n scrollToLatest(false);\n }, [scrollToLatest]);\n\n const renderItem = useCallback(\n ({ item }: { item: TranscriptGroup }) => (\n <TranscriptGroupView\n group={item}\n isDark={isDark}\n renderMessageActions={renderMessageActions}\n mapToolSteps={mapToolSteps}\n />\n ),\n [isDark, renderMessageActions, mapToolSteps],\n );\n\n return (\n <View style={styles.list}>\n <FlatList\n ref={listRef}\n data={groups}\n keyExtractor={(item) => item.id}\n renderItem={renderItem}\n extraData={`${streamingContent ?? ''}:${quickReply ?? ''}:${Boolean(listFooter)}`}\n ListFooterComponent={listFooter ? <>{listFooter}</> : null}\n initialNumToRender={12}\n maxToRenderPerBatch={8}\n updateCellsBatchingPeriod={50}\n windowSize={21}\n scrollEnabled\n nestedScrollEnabled={false}\n directionalLockEnabled\n onScroll={handleScroll}\n onContentSizeChange={handleContentSizeChange}\n onLayout={() => {\n if (stickToBottomRef.current) scrollToLatest(false);\n }}\n scrollEventThrottle={16}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode={Platform.OS === 'ios' ? 'interactive' : 'on-drag'}\n automaticallyAdjustKeyboardInsets={false}\n automaticallyAdjustContentInsets={false}\n contentInsetAdjustmentBehavior=\"never\"\n contentContainerStyle={[styles.listContent, listContentStyle, !listFooter && styles.listContentFill]}\n style={styles.list}\n />\n </View>\n );\n}\n\nconst TranscriptGroupView = memo(function TranscriptGroupView({\n group,\n isDark,\n renderMessageActions,\n mapToolSteps,\n}: {\n group: TranscriptGroup;\n isDark: boolean;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n mapToolSteps?: (steps: ToolStep[]) => ToolStep[];\n}) {\n // A link the person pasted opens like one the assistant sent: in the app or a browser sheet.\n const openLink = useChatLinkOpener();\n const onLinkPress = useCallback(\n (url: string) => {\n openLink(url);\n return false;\n },\n [openLink],\n );\n if (group.role === 'user') {\n return (\n <Pressable style={styles.userCol} onPress={dismissKeyboard} accessible={false}>\n {group.items.map((item, index) => {\n const attachments = item.attachments ?? [];\n const text = displayUserMessageText(item.displayContent ?? item.content, attachments);\n if (!text && attachments.length === 0) return null;\n return (\n <View key={item.id} style={[styles.userTurn, index > 0 && styles.userFollow]}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"end\" isDark={isDark} />\n ) : null}\n {text ? (\n <View style={[styles.userBubble, item.queued && styles.userBubbleQueued]}>\n <Markdown style={USER_MARKDOWN} onLinkPress={onLinkPress}>\n {/* Bare URLs the person typed become links, as in the assistant's replies. */}\n {autolinkBareUrls(text)}\n </Markdown>\n </View>\n ) : null}\n {item.queued ? (\n <Text style={[styles.queuedCaption, { color: isDark ? '#94a3b8' : '#64748b' }]}>\n {item.queuedNote ?? 'Queued · sends when the gateway connects'}\n </Text>\n ) : null}\n </View>\n );\n })}\n </Pressable>\n );\n }\n\n const last = group.items[group.items.length - 1];\n\n return (\n <View style={styles.assistantGroup}>\n {group.items.map((item, index) => (\n <AssistantTurnView\n key={item.id}\n item={item}\n isDark={isDark}\n tightTop={index > 0}\n renderMessageActions={item.streaming || item !== last ? undefined : renderMessageActions}\n mapToolSteps={mapToolSteps}\n />\n ))}\n </View>\n );\n});\n\nconst AssistantTurnView = memo(function AssistantTurnView({\n item,\n isDark,\n tightTop,\n renderMessageActions,\n mapToolSteps,\n}: {\n item: TranscriptRow;\n isDark: boolean;\n tightTop: boolean;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n mapToolSteps?: (steps: ToolStep[]) => ToolStep[];\n}) {\n const attachments = item.attachments ?? [];\n const stripped = stripAskUser(item.content);\n const toolActivity = parseToolActivity(stripped, !!item.streaming);\n // Widget envelopes become native cards below the text, never raw JSON.\n const { text, widgets } = splitChatWidgets(\n parseToolActivity(\n stripSurfaceNotes(displayAskUserAssistantText(item.content, !!item.askAnswered)),\n !!item.streaming,\n ).text,\n !!item.streaming,\n );\n\n // The quick answer stays open while it is all there is to read: until the\n // agent's own words start on a live turn, or for good on a reply that never\n // got anything past it. Tool steps alone do not fold it - they are not an answer.\n const preResponseOpen = item.streaming\n ? !text.trim()\n : !text.trim() && toolActivity.steps.length === 0 && widgets.length === 0 && attachments.length === 0;\n\n return (\n <View style={[styles.assistantCol, tightTop && styles.assistantColTight]}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"start\" isDark={isDark} />\n ) : null}\n {item.preResponse ? (\n <PreResponseStrip\n text={item.preResponse}\n expanded={preResponseOpen}\n live={!!item.streaming}\n isDark={isDark}\n />\n ) : null}\n {toolActivity.steps.length > 0 ? (\n <ToolTimeline\n steps={mapToolSteps ? mapToolSteps(toolActivity.steps) : toolActivity.steps}\n active={!!item.streaming}\n isDark={isDark}\n />\n ) : null}\n {text ? <AssistantMarkdown text={text} streaming={!!item.streaming} isDark={isDark} /> : null}\n {widgets.map((widget, i) => (\n <ChatWidgetCard key={`${widget.component}-${i}`} widget={widget} isDark={isDark} />\n ))}\n {renderMessageActions\n ? renderMessageActions({\n id: item.id,\n role: 'assistant',\n // Copy and share take what the user reads, not the wire markup.\n content: text.trim() || item.preResponse || item.content,\n })\n : null}\n </View>\n );\n});\n\nconst USER_MARKDOWN = {\n body: { color: '#ffffff', fontSize: 15, lineHeight: 22 },\n // White and underlined: the bubble is blue, so the usual blue link would vanish.\n link: { color: '#ffffff', textDecorationLine: 'underline' as const },\n paragraph: { marginTop: 4, marginBottom: 4, color: '#ffffff' },\n strong: { fontWeight: '700' as const, color: '#ffffff' },\n em: { color: '#ffffff' },\n text: { color: '#ffffff' },\n bullet_list: { marginVertical: 4 },\n ordered_list: { marginVertical: 4 },\n list_item: { marginVertical: 2, color: '#ffffff' },\n};\n\nconst styles = StyleSheet.create({\n list: {\n flex: 1,\n minHeight: 0,\n },\n listContent: {\n paddingTop: 8,\n paddingBottom: 8,\n paddingHorizontal: 8,\n },\n listContentFill: {\n flexGrow: 1,\n },\n userCol: {\n width: '100%',\n alignItems: 'flex-end',\n marginBottom: 12,\n paddingHorizontal: 4,\n },\n userTurn: {\n maxWidth: '92%',\n alignItems: 'flex-end',\n },\n userFollow: {\n marginTop: 4,\n },\n userBubble: {\n backgroundColor: USER_BUBBLE_BG,\n borderRadius: 16,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n // Same bubble, held back: a queued turn reads as pending, not as delivered.\n userBubbleQueued: {\n opacity: 0.55,\n },\n queuedCaption: {\n fontSize: 11,\n fontWeight: '500',\n marginTop: 4,\n marginRight: 2,\n },\n assistantGroup: {\n width: '100%',\n marginBottom: 4,\n },\n assistantCol: {\n width: '100%',\n flexGrow: 0,\n alignItems: 'stretch',\n marginBottom: 8,\n paddingHorizontal: 4,\n },\n assistantColTight: {\n marginTop: -4,\n },\n});\n"],"names":["rows","TranscriptGroupView","AssistantTurnView"],"mappings":";;;;;;;;;;;;;;;;;;;AAmDO,MAAM,cAAiB,GAAA;AACvB,SAAS,cAAe,CAAA;AAAA,EAC7B,QAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,oBAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAS,GAAA,KAAA;AAAA,EACT;AACF,CAeG,EAAA;AACD,EAAM,MAAA,OAAA,GAAU,OAAkC,IAAI,CAAA;AACtD,EAAM,MAAA,gBAAA,GAAmB,OAAO,IAAI,CAAA;AACpC,EAAM,MAAA,uBAAA,GAA0B,OAAO,KAAK,CAAA;AAC5C,EAAM,MAAA,oBAAA,GAAuB,OAAO,CAAC,CAAA;AACrC,EAAA,MAAM,iBAAiB,qBAAsB,EAAA;AAC7C,EAAM,MAAA,WAAA,GAAc,QAAyB,MAAM;AACjD,IAAA,MAAMA,QAAwB,EAAC;AAC/B,IAAS,QAAA,CAAA,OAAA,CAAQ,CAAC,GAAA,EAAK,KAAU,KAAA;AApFrC,MAAA,IAAA,EAAA,EAAA,EAAA;AAqFM,MAAI,IAAA,GAAA,CAAI,SAAS,MAAQ,EAAA;AACvB,QAAA,IAAI,8BAA+B,CAAA,GAAA,CAAI,OAAS,EAAA,GAAA,CAAI,WAAW,CAAG,EAAA;AAChE,UAAAA,KAAAA,CAAK,IAAK,CAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACL,GADK,CAAA,EAAA;AAAA,YAER,SAAW,EAAA;AAAA,WACZ,CAAA,CAAA;AAAA;AAEH,QAAA;AAAA;AAEF,MAAI,IAAA,GAAA,CAAI,SAAS,WAAa,EAAA;AAC5B,QAAAA,KAAAA,CAAK,IAAK,CAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACL,GADK,CAAA,EAAA;AAAA,UAER,SAAW,EAAA;AAA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AAA;AAAA,GACrB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,KAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAW,EAAA;AAAA,GACb;AAAA,EACA,UAAY,EAAA;AAAA,IACV,eAAiB,EAAA,cAAA;AAAA,IACjB,YAAc,EAAA,EAAA;AAAA,IACd,iBAAmB,EAAA,EAAA;AAAA,IACnB,eAAiB,EAAA;AAAA,GACnB;AAAA;AAAA,EAEA,gBAAkB,EAAA;AAAA,IAChB,OAAS,EAAA;AAAA,GACX;AAAA,EACA,aAAe,EAAA;AAAA,IACb,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,KAAA;AAAA,IACZ,SAAW,EAAA,CAAA;AAAA,IACX,WAAa,EAAA;AAAA,GACf;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,KAAO,EAAA,MAAA;AAAA,IACP,QAAU,EAAA,CAAA;AAAA,IACV,UAAY,EAAA,SAAA;AAAA,IACZ,YAAc,EAAA,CAAA;AAAA,IACd,iBAAmB,EAAA;AAAA,GACrB;AAAA,EACA,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA"}
|
|
@@ -38,6 +38,7 @@ function WebBuilderExperience({
|
|
|
38
38
|
onStartProject,
|
|
39
39
|
builds,
|
|
40
40
|
buildsLoading = false,
|
|
41
|
+
historyLoading = false,
|
|
41
42
|
building = null,
|
|
42
43
|
publishing: publishingOnChat = false,
|
|
43
44
|
hostChat,
|
|
@@ -150,7 +151,7 @@ function WebBuilderExperience({
|
|
|
150
151
|
useEffect(() => setMode("chat"), [activeChannelId]);
|
|
151
152
|
const sendToAgent = useCallback((text, files) => {
|
|
152
153
|
const words = text.trim();
|
|
153
|
-
if (!words || !hostChat) return;
|
|
154
|
+
if (!words && !(files == null ? void 0 : files.length) || !hostChat) return;
|
|
154
155
|
const turn = build || /^build\b/i.test(words) ? words : `Build me: ${words}`;
|
|
155
156
|
hostChat.send(turn, files, build);
|
|
156
157
|
setMode("chat");
|
|
@@ -534,7 +535,6 @@ ${restoreTurnNote({
|
|
|
534
535
|
color: statusTone
|
|
535
536
|
}], numberOfLines: 1, children: statusText })
|
|
536
537
|
] }),
|
|
537
|
-
/* @__PURE__ */ jsx(View, { style: styles.headSpacer }),
|
|
538
538
|
/* @__PURE__ */ jsxs(View, { style: [styles.actionPill, floating], children: [
|
|
539
539
|
canUndo ? /* @__PURE__ */ jsx(Tap, { onPress: undoLast, disabled: undoing, accessibilityRole: "button", accessibilityLabel: "Undo the last change", style: [styles.pillBtn, undoing && styles.disabled], pressedStyle: DIM, testID: "webbuilder-undo", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "undo-variant", size: 24, color: theme.ink }) }) : null,
|
|
540
540
|
/* @__PURE__ */ jsx(Tap, { onPress: shareSite, disabled: !shareUrl, accessibilityRole: "button", accessibilityLabel: "Share", style: [styles.pillBtn, !shareUrl && styles.disabled], pressedStyle: DIM, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "share-outline", size: 24, color: theme.ink }) }),
|
|
@@ -552,7 +552,7 @@ ${restoreTurnNote({
|
|
|
552
552
|
] })
|
|
553
553
|
] })
|
|
554
554
|
] }),
|
|
555
|
-
mode === "chat" ? /* @__PURE__ */ jsx(ProjectChat, { messages: (_g = hostChat == null ? void 0 : hostChat.messages) != null ? _g : [], streaming: (_h = hostChat == null ? void 0 : hostChat.streaming) != null ? _h : null, busy: Boolean(hostChat == null ? void 0 : hostChat.busy), error: (_i = hostChat == null ? void 0 : hostChat.error) != null ? _i : null, connected: Boolean(hostChat == null ? void 0 : hostChat.connected), building, build, siteTitle: siteTitle || "Your site", onSend: (text) => sendToAgent(text), onOpenPreview: () => setMode("preview"), onPublish: () => setPublishOpen(true), onPreviewAsleep: () => wakePreview(), previewDown: Boolean(previewTrouble && previewTrouble.kind !== "restoring"), ask: (_j = hostChat == null ? void 0 : hostChat.ask) != null ? _j : null, onAnswerAsk: (formatted) => hostChat == null ? void 0 : hostChat.send(formatted), theme, bottomInset: insets.bottom }) : null,
|
|
555
|
+
mode === "chat" ? /* @__PURE__ */ jsx(ProjectChat, { messages: (_g = hostChat == null ? void 0 : hostChat.messages) != null ? _g : [], streaming: (_h = hostChat == null ? void 0 : hostChat.streaming) != null ? _h : null, busy: Boolean(hostChat == null ? void 0 : hostChat.busy), error: (_i = hostChat == null ? void 0 : hostChat.error) != null ? _i : null, connected: Boolean(hostChat == null ? void 0 : hostChat.connected), building, build, siteTitle: siteTitle || "Your site", onSend: (text, files) => sendToAgent(text, files), onOpenPreview: () => setMode("preview"), onPublish: () => setPublishOpen(true), onPreviewAsleep: () => wakePreview(), previewDown: Boolean(previewTrouble && previewTrouble.kind !== "restoring"), ask: (_j = hostChat == null ? void 0 : hostChat.ask) != null ? _j : null, onAnswerAsk: (formatted) => hostChat == null ? void 0 : hostChat.send(formatted), loading: historyLoading, steering: hostChat == null ? void 0 : hostChat.steering, renderConnectorCard: hostChat == null ? void 0 : hostChat.renderConnectorCard, theme, bottomInset: insets.bottom }) : null,
|
|
556
556
|
mode === "preview" ? /* @__PURE__ */ jsx(PreviewScreen, { build, building, loading: buildsLoading, previewNonce, onReload: () => setPreviewNonce((n) => n + 1), onWake: () => wakePreview(), waking, trouble: previewTrouble, onRetry: () => wakePreview(true), onRestore: restoreFromSavedCopy, onAskAiRestore: hostChat ? askAiToRestore : void 0, agentBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), steps: liveSteps, onPublish: () => setPublishOpen(true), publishLabel, error: (_k = hostChat == null ? void 0 : hostChat.error) != null ? _k : null, theme, bottomInset: insets.bottom, viewport, unpublished: Boolean(build == null ? void 0 : build.sandboxId) && !(build == null ? void 0 : build.liveUrl), onShowCode: canShowCode ? () => setMode("code") : void 0, buildingCover }) : null,
|
|
557
557
|
mode === "code" ? /* @__PURE__ */ jsxs(View, { style: [styles.fill, {
|
|
558
558
|
backgroundColor: theme.card,
|
|
@@ -674,6 +674,7 @@ const styles = StyleSheet.create({
|
|
|
674
674
|
paddingBottom: 10
|
|
675
675
|
},
|
|
676
676
|
roundBtn: {
|
|
677
|
+
flexShrink: 0,
|
|
677
678
|
width: 52,
|
|
678
679
|
height: 52,
|
|
679
680
|
borderRadius: 26,
|
|
@@ -688,9 +689,10 @@ const styles = StyleSheet.create({
|
|
|
688
689
|
},
|
|
689
690
|
elevation: 3
|
|
690
691
|
},
|
|
692
|
+
// The title takes the room the buttons leave, truncated; the buttons never shrink off-screen.
|
|
691
693
|
titlePill: {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
+
flex: 1,
|
|
695
|
+
minWidth: 0,
|
|
694
696
|
height: 52,
|
|
695
697
|
paddingHorizontal: 18,
|
|
696
698
|
borderRadius: 26,
|
|
@@ -714,10 +716,8 @@ const styles = StyleSheet.create({
|
|
|
714
716
|
fontWeight: "600",
|
|
715
717
|
marginTop: 1
|
|
716
718
|
},
|
|
717
|
-
headSpacer: {
|
|
718
|
-
flex: 1
|
|
719
|
-
},
|
|
720
719
|
actionPill: {
|
|
720
|
+
flexShrink: 0,
|
|
721
721
|
flexDirection: "row",
|
|
722
722
|
alignItems: "center",
|
|
723
723
|
height: 52,
|