@adminide-stack/yantra-mobile 12.0.145 → 12.0.147-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/lib/features/agent-chat/NativeAgentChat.js +28 -10
  2. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  3. package/lib/features/chat/ChatTranscript.js +9 -6
  4. package/lib/features/chat/ChatTranscript.js.map +1 -1
  5. package/lib/features/devices/readings.js.map +1 -1
  6. package/lib/features/devices/session.js +2 -22
  7. package/lib/features/devices/session.js.map +1 -1
  8. package/lib/features/webbuilder/WebBuilderExperience.js +8 -8
  9. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  10. package/lib/features/webbuilder/components/ProjectChat.js +145 -215
  11. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  12. package/lib/features/webbuilder/projectTools.js +1 -0
  13. package/lib/features/webbuilder/projectTools.js.map +1 -1
  14. package/lib/screens/Devices/index.js +3 -205
  15. package/lib/screens/Devices/index.js.map +1 -1
  16. package/lib/screens/WebBuilderNative/index.js +1 -1
  17. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  18. package/lib/screens/WebBuilderNative/keepAlive.js +1 -0
  19. package/lib/screens/WebBuilderNative/keepAlive.js.map +1 -1
  20. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +82 -11
  21. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  22. package/lib/screens/WebBuilderNative/versionUndo.js +108 -12
  23. package/lib/screens/WebBuilderNative/versionUndo.js.map +1 -1
  24. package/lib/screens/WebBuilderNative/webbuilderTransport.js +7 -1
  25. package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
  26. package/package.json +4 -4
  27. package/lib/features/devices/bodyComposition.js +0 -116
  28. package/lib/features/devices/bodyComposition.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useRef,useMemo,useEffect}from'react';import {StyleSheet,KeyboardAvoidingView,FlatList,View,Text,TextInput,Platform,ActivityIndicator,Image}from'react-native';import {WebView}from'react-native-webview';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {AssistantMarkdown}from'../../chat/AssistantMarkdown.js';import {ToolTimeline}from'../../chat/ToolTimeline.js';import {parseToolActivity}from'../../chat/toolActivity.js';import {friendlySteps}from'../stepLabels.js';import {webbuilderAgentSuggestions,withoutRestorePointLine,publishEventText}from'../webbuilderPrompts.js';import {sleepNoticeDue,minutesUntilSleep}from'../sleepNotice.js';import {followUpSuggestions}from'../followUps.js';import {AskUserCard}from'../../chat/AskUserCard.js';import {displayHost}from'../buildFragments.js';import {DESKTOP_VIEWPORT_SCRIPT}from'./PreviewFrame.js';import {PreviewPlaceholder}from'./PreviewPlaceholder.js';import {probePreview,mayFrame}from'../previewProbe.js';var __defProp = Object.defineProperty;
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useRef,useMemo,useEffect}from'react';import {StyleSheet,View,Text,ActivityIndicator,Image}from'react-native';import {WebView}from'react-native-webview';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {parseToolActivity}from'../../chat/toolActivity.js';import {friendlySteps}from'../stepLabels.js';import {publishEventText,withoutRestorePointLine,webbuilderAgentSuggestions}from'../webbuilderPrompts.js';import {sleepNoticeDue,minutesUntilSleep}from'../sleepNotice.js';import {followUpSuggestions}from'../followUps.js';import {AskUserCard}from'../../chat/AskUserCard.js';import {NativeAgentChat}from'../../agent-chat/NativeAgentChat.js';import {displayHost}from'../buildFragments.js';import {DESKTOP_VIEWPORT_SCRIPT}from'./PreviewFrame.js';import {PreviewPlaceholder}from'./PreviewPlaceholder.js';import {probePreview,mayFrame}from'../previewProbe.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -30,95 +30,23 @@ function useElapsed(startedAt) {
30
30
  }, [startedAt]);
31
31
  return startedAt ? Math.max(0, Math.floor((now - startedAt) / 1e3)) : 0;
32
32
  }
33
- function UserBubble({
34
- text,
35
- theme
36
- }) {
37
- return /* @__PURE__ */ jsx(View, { style: styles.userRow, children: /* @__PURE__ */ jsx(View, { style: [styles.userBubble, {
38
- backgroundColor: theme.chip
39
- }], children: /* @__PURE__ */ jsx(Text, { style: [styles.userText, {
40
- color: theme.ink
41
- }], selectable: true, children: text }) }) });
42
- }
43
- function AgentAvatar({
44
- theme
45
- }) {
46
- return /* @__PURE__ */ jsxs(View, { style: styles.agentHead, children: [
47
- /* @__PURE__ */ jsx(View, { style: [styles.agentMark, {
48
- backgroundColor: theme.accent
49
- }], children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "creation", size: 14, color: theme.accentInk }) }),
50
- /* @__PURE__ */ jsx(Text, { style: [styles.agentName, {
51
- color: theme.ink
52
- }], children: "Web Builder" })
53
- ] });
54
- }
55
- function AgentTurn({
56
- content,
57
- active,
58
- theme
59
- }) {
60
- const parsed = useMemo(() => parseToolActivity(content, active), [content, active]);
61
- const {
62
- text,
63
- saved
64
- } = useMemo(() => withoutRestorePointLine(parsed.text), [parsed.text]);
65
- return /* @__PURE__ */ jsxs(View, { style: styles.agentTurn, children: [
66
- /* @__PURE__ */ jsx(AgentAvatar, { theme }),
67
- parsed.steps.length ? /* @__PURE__ */ jsx(ToolTimeline, { steps: friendlySteps(parsed.steps), active, isDark: theme.isDark }) : null,
68
- text ? /* @__PURE__ */ jsx(AssistantMarkdown, { text, streaming: active, isDark: theme.isDark }) : null,
69
- saved && !active ? /* @__PURE__ */ jsxs(View, { style: [styles.versionChip, {
70
- borderColor: theme.border,
71
- backgroundColor: theme.chip
72
- }], accessibilityLabel: "Version saved. You can go back to it from Versions.", children: [
73
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "history", size: 12, color: theme.muted }),
74
- /* @__PURE__ */ jsx(Text, { style: [styles.versionChipText, {
75
- color: theme.muted
76
- }], children: "Version saved" })
77
- ] }) : null
78
- ] });
79
- }
80
- function EventLine({
81
- text,
82
- theme
83
- }) {
84
- return /* @__PURE__ */ jsxs(View, { style: styles.eventLine, accessibilityRole: "text", children: [
85
- /* @__PURE__ */ jsx(View, { style: [styles.eventRule, {
86
- backgroundColor: theme.border
87
- }] }),
88
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "rocket-launch-outline", size: 13, color: theme.muted }),
89
- /* @__PURE__ */ jsx(Text, { style: [styles.eventText, {
90
- color: theme.muted
91
- }], numberOfLines: 1, children: text }),
92
- /* @__PURE__ */ jsx(View, { style: [styles.eventRule, {
93
- backgroundColor: theme.border
94
- }] })
95
- ] });
96
- }
97
- function LiveTurn({
98
- streaming,
33
+ function BuildingStatus({
99
34
  building,
100
35
  theme
101
36
  }) {
102
37
  var _a;
103
38
  const elapsed = useElapsed((_a = building == null ? void 0 : building.startedAt) != null ? _a : null);
104
- const parsed = useMemo(() => parseToolActivity(streaming != null ? streaming : "", true), [streaming]);
105
- const showStatus = !parsed.text && parsed.steps.length === 0;
106
- return /* @__PURE__ */ jsxs(View, { style: styles.agentTurn, children: [
107
- /* @__PURE__ */ jsx(AgentAvatar, { theme }),
108
- parsed.steps.length ? /* @__PURE__ */ jsx(ToolTimeline, { steps: friendlySteps(parsed.steps), active: true, isDark: theme.isDark }) : null,
109
- parsed.text ? /* @__PURE__ */ jsx(AssistantMarkdown, { text: parsed.text, streaming: true, isDark: theme.isDark }) : null,
110
- showStatus ? /* @__PURE__ */ jsxs(View, { style: [styles.working, {
111
- backgroundColor: theme.card,
112
- borderColor: theme.border
113
- }], children: [
114
- /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: theme.accent }),
115
- /* @__PURE__ */ jsx(Text, { style: [styles.workingText, {
116
- color: theme.ink
117
- }], numberOfLines: 2, children: (building == null ? void 0 : building.statusText) || "Thinking\u2026" }),
118
- building ? /* @__PURE__ */ jsx(Text, { style: [styles.workingTime, {
119
- color: theme.muted
120
- }], children: elapsedLabel(elapsed) }) : null
121
- ] }) : null
39
+ return /* @__PURE__ */ jsxs(View, { style: [styles.working, {
40
+ backgroundColor: theme.card,
41
+ borderColor: theme.border
42
+ }], children: [
43
+ /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: theme.accent }),
44
+ /* @__PURE__ */ jsx(Text, { style: [styles.workingText, {
45
+ color: theme.ink
46
+ }], numberOfLines: 2, children: (building == null ? void 0 : building.statusText) || "Thinking\u2026" }),
47
+ building ? /* @__PURE__ */ jsx(Text, { style: [styles.workingTime, {
48
+ color: theme.muted
49
+ }], children: elapsedLabel(elapsed) }) : null
122
50
  ] });
123
51
  }
124
52
  function timeOf(ms) {
@@ -261,6 +189,14 @@ function SiteCard({
261
189
  ] })
262
190
  ] });
263
191
  }
192
+ function emptyTitleFor(loading, hasBuild, siteTitle) {
193
+ if (loading) return void 0;
194
+ return hasBuild ? `What should change on ${siteTitle}?` : "Describe your idea";
195
+ }
196
+ function emptyBodyFor(loading, hasBuild) {
197
+ if (loading) return void 0;
198
+ return hasBuild ? "Ask for new sections, another look, copy changes or fixes." : "Tell me what the site is for and I'll build it step by step.";
199
+ }
264
200
  function ProjectChat({
265
201
  messages,
266
202
  streaming,
@@ -277,147 +213,125 @@ function ProjectChat({
277
213
  previewDown = false,
278
214
  ask = null,
279
215
  onAnswerAsk,
280
- theme,
281
- bottomInset
216
+ steering,
217
+ renderConnectorCard,
218
+ loading = false,
219
+ theme
282
220
  }) {
283
221
  const [draft, setDraft] = useState("");
284
222
  const [dismissedAsks, setDismissedAsks] = useState([]);
285
- const listRef = useRef(null);
286
- const [atBottom, setAtBottom] = useState(true);
223
+ const rootRef = useRef(null);
224
+ const [top, setTop] = useState(0);
287
225
  const live = busy || Boolean(building);
288
- const rows = useMemo(() => {
289
- const out = messages.map((m) => ({
290
- kind: "message",
291
- id: m.id,
292
- message: m
293
- }));
294
- if (build) out.push({
295
- kind: "site",
296
- id: `site-${build.key}`
297
- });
298
- if (live) out.push({
299
- kind: "live",
300
- id: "live"
301
- });
302
- return out;
303
- }, [messages, build, live]);
304
- useEffect(() => {
305
- if (!atBottom) return void 0;
306
- const timer = setTimeout(() => {
307
- var _a;
308
- return (_a = listRef.current) == null ? void 0 : _a.scrollToEnd({
309
- animated: true
310
- });
311
- }, 80);
312
- return () => clearTimeout(timer);
313
- }, [rows.length, streaming]);
314
- const send = (text) => {
315
- const words = text.trim();
316
- if (!words) return;
317
- onSend(words);
318
- setDraft("");
319
- };
320
- const suggestions = messages.length === 0 && !live ? webbuilderAgentSuggestions(Boolean(build), siteTitle) : [];
321
- const lastReply = messages[messages.length - 1];
322
- const followUps = useMemo(() => (lastReply == null ? void 0 : lastReply.role) === "assistant" ? followUpSuggestions(withoutRestorePointLine(parseToolActivity(lastReply.content, false).text).text) : [], [lastReply]);
323
- return /* @__PURE__ */ jsxs(KeyboardAvoidingView, { style: styles.fill, behavior: Platform.OS === "ios" ? "padding" : void 0, keyboardVerticalOffset: Platform.OS === "ios" ? 96 : 0, children: [
324
- /* @__PURE__ */ jsx(FlatList, { ref: listRef, data: rows, keyExtractor: (row) => row.id, contentContainerStyle: styles.list, keyboardShouldPersistTaps: "handled", scrollEventThrottle: 100, onScroll: (event) => {
325
- const {
326
- layoutMeasurement,
327
- contentOffset,
328
- contentSize
329
- } = event.nativeEvent;
330
- setAtBottom(layoutMeasurement.height + contentOffset.y >= contentSize.height - 48);
331
- }, ListEmptyComponent: /* @__PURE__ */ jsxs(View, { style: styles.empty, children: [
332
- /* @__PURE__ */ jsx(View, { style: [styles.emptyMark, {
333
- backgroundColor: theme.accentSoft
334
- }], children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "creation", size: 26, color: theme.accent }) }),
335
- /* @__PURE__ */ jsx(Text, { style: [styles.emptyTitle, {
336
- color: theme.ink
337
- }], children: build ? `What should change on ${siteTitle}?` : "Describe your idea" }),
338
- /* @__PURE__ */ jsx(Text, { style: [styles.emptyBody, {
339
- color: theme.muted
340
- }], children: build ? "Ask for new sections, another look, copy changes or fixes." : "Tell me what the site is for and I'll build it step by step." })
341
- ] }), ListFooterComponent: ask && onAnswerAsk && !dismissedAsks.includes(ask.requestId) ? /* @__PURE__ */ jsx(View, { style: styles.askCard, children: /* @__PURE__ */ jsx(AskUserCard, { payload: ask, isDark: theme.isDark, onAnswer: (formatted) => {
342
- setDismissedAsks((prev) => [...prev, ask.requestId]);
343
- onAnswerAsk(formatted);
344
- }, onDismiss: () => setDismissedAsks((prev) => [...prev, ask.requestId]) }, ask.requestId) }) : null, renderItem: ({
345
- item
346
- }) => {
347
- var _a;
348
- if (item.kind === "live") return /* @__PURE__ */ jsx(LiveTurn, { streaming, building, theme });
349
- if (item.kind === "site" && build) {
350
- return /* @__PURE__ */ jsx(SiteCard, { build, title: siteTitle, busy: live, onOpen: onOpenPreview, onPublish, onAsleep: onPreviewAsleep, previewDown, theme });
351
- }
352
- if (item.kind !== "message") return null;
353
- const m = item.message;
226
+ const loadingHistory = loading && messages.length === 0 && !live && !streaming;
227
+ const {
228
+ shown,
229
+ savedIds
230
+ } = useMemo(() => {
231
+ const saved = /* @__PURE__ */ new Set();
232
+ const out = messages.map((m) => {
354
233
  if (m.role === "user") {
355
234
  const event = publishEventText(m.content);
356
- if (event) return /* @__PURE__ */ jsx(EventLine, { text: event, theme });
357
- return /* @__PURE__ */ jsx(UserBubble, { text: (_a = m.displayContent) != null ? _a : m.content, theme });
235
+ return event ? __spreadProps(__spreadValues({}, m), {
236
+ role: "system",
237
+ content: `_${event}_`
238
+ }) : m;
358
239
  }
359
- return /* @__PURE__ */ jsxs(Fragment, { children: [
360
- /* @__PURE__ */ jsx(AgentTurn, { content: m.content, active: false, theme }),
361
- m === lastReply && followUps.length && !live ? /* @__PURE__ */ jsx(View, { style: styles.followUps, testID: "webbuilder-follow-ups", children: followUps.map((f) => /* @__PURE__ */ jsxs(Tap, { onPress: () => setDraft(f.prompt), accessibilityRole: "button", accessibilityLabel: `Suggest: ${f.prompt}`, style: [styles.followUp, {
362
- borderColor: theme.border,
363
- backgroundColor: theme.card
364
- }], pressedStyle: DIM, children: [
365
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "lightbulb-outline", size: 14, color: theme.accent }),
366
- /* @__PURE__ */ jsx(Text, { style: [styles.followUpText, {
367
- color: theme.ink
368
- }], numberOfLines: 1, children: f.label })
369
- ] }, f.label)) }) : null
370
- ] });
371
- } }),
372
- !atBottom ? /* @__PURE__ */ jsx(Tap, { onPress: () => {
373
- var _a;
374
- setAtBottom(true);
375
- (_a = listRef.current) == null ? void 0 : _a.scrollToEnd({
376
- animated: true
240
+ const {
241
+ text,
242
+ saved: hadPoint
243
+ } = withoutRestorePointLine(m.content);
244
+ if (!hadPoint) return m;
245
+ saved.add(m.id);
246
+ return __spreadProps(__spreadValues({}, m), {
247
+ content: text
377
248
  });
378
- }, accessibilityRole: "button", accessibilityLabel: "Jump to the latest", style: [styles.jump, {
379
- backgroundColor: theme.card,
249
+ });
250
+ return {
251
+ shown: out,
252
+ savedIds: saved
253
+ };
254
+ }, [messages]);
255
+ const lastReply = messages[messages.length - 1];
256
+ const followUps = useMemo(() => (lastReply == null ? void 0 : lastReply.role) === "assistant" ? followUpSuggestions(withoutRestorePointLine(parseToolActivity(lastReply.content, false).text).text) : [], [lastReply]);
257
+ const renderExtras = (message) => {
258
+ const chip = savedIds.has(message.id) ? /* @__PURE__ */ jsxs(View, { style: [styles.versionChip, {
380
259
  borderColor: theme.border,
381
- shadowColor: theme.isDark ? "#000" : "#1c1917"
382
- }], pressedStyle: DIM, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "arrow-down", size: 20, color: theme.ink }) }) : null,
383
- suggestions.length ? /* @__PURE__ */ jsx(View, { style: styles.suggestions, children: suggestions.slice(0, 3).map((s) => /* @__PURE__ */ jsx(Tap, { onPress: () => {
384
- var _a;
385
- return send((_a = s.prompt) != null ? _a : s.label);
386
- }, accessibilityRole: "button", style: [styles.suggestion, {
387
- backgroundColor: theme.card,
388
- borderColor: theme.border
389
- }], pressedStyle: DIM, children: /* @__PURE__ */ jsx(Text, { style: [styles.suggestionText, {
390
- color: theme.ink
391
- }], numberOfLines: 1, children: s.label }) }, s.id)) }) : null,
392
- error ? /* @__PURE__ */ jsxs(View, { style: [styles.error, {
393
- backgroundColor: theme.critSoft
394
- }], children: [
395
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "alert-circle-outline", size: 16, color: theme.crit }),
396
- /* @__PURE__ */ jsx(Text, { style: [styles.errorText, {
397
- color: theme.crit
398
- }], children: error })
399
- ] }) : null,
400
- /* @__PURE__ */ jsxs(View, { style: [styles.composerDock, {
401
- backgroundColor: theme.screen,
402
- paddingBottom: Math.max(bottomInset, 10)
403
- }], children: [
404
- /* @__PURE__ */ jsxs(View, { style: [styles.composer, {
405
- backgroundColor: theme.card,
406
- borderColor: theme.border,
407
- shadowColor: theme.isDark ? "#000" : "#1c1917"
408
- }], children: [
409
- /* @__PURE__ */ jsx(TextInput, { value: draft, onChangeText: setDraft, placeholder: "Message Web Builder", placeholderTextColor: theme.faint, multiline: true, style: [styles.input, {
410
- color: theme.ink
411
- }], accessibilityLabel: "Message the agent", testID: "webbuilder-chat-input" }),
412
- /* @__PURE__ */ jsx(Tap, { onPress: () => send(draft), disabled: !draft.trim() || !connected, accessibilityRole: "button", accessibilityLabel: "Send", style: [styles.send, {
413
- backgroundColor: draft.trim() && connected ? theme.accent : theme.chip
414
- }], pressedStyle: DIM, testID: "webbuilder-chat-send", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "arrow-up", size: 20, color: draft.trim() && connected ? theme.accentInk : theme.faint }) })
415
- ] }),
416
- !connected ? /* @__PURE__ */ jsx(Text, { style: [styles.connecting, {
260
+ backgroundColor: theme.chip
261
+ }], accessibilityLabel: "Version saved. You can go back to it from Versions.", children: [
262
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "history", size: 12, color: theme.muted }),
263
+ /* @__PURE__ */ jsx(Text, { style: [styles.versionChipText, {
417
264
  color: theme.muted
418
- }], children: "Connecting to Web Builder\u2026" }) : null
419
- ] })
265
+ }], children: "Version saved" })
266
+ ] }) : null;
267
+ const chips = message.id === (lastReply == null ? void 0 : lastReply.id) && followUps.length && !live ? /* @__PURE__ */ jsx(View, { style: styles.followUps, testID: "webbuilder-follow-ups", children: followUps.map((f) => /* @__PURE__ */ jsxs(Tap, { onPress: () => setDraft(f.prompt), accessibilityRole: "button", accessibilityLabel: `Suggest: ${f.prompt}`, style: [styles.followUp, {
268
+ borderColor: theme.border,
269
+ backgroundColor: theme.card
270
+ }], pressedStyle: DIM, children: [
271
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "lightbulb-outline", size: 14, color: theme.accent }),
272
+ /* @__PURE__ */ jsx(Text, { style: [styles.followUpText, {
273
+ color: theme.ink
274
+ }], numberOfLines: 1, children: f.label })
275
+ ] }, f.label)) }) : null;
276
+ return chip || chips ? /* @__PURE__ */ jsxs(Fragment, { children: [
277
+ chip,
278
+ chips
279
+ ] }) : null;
280
+ };
281
+ const footer = /* @__PURE__ */ jsxs(View, { style: styles.footer, children: [
282
+ build ? /* @__PURE__ */ jsx(SiteCard, { build, title: siteTitle, busy: live, onOpen: onOpenPreview, onPublish, onAsleep: onPreviewAsleep, previewDown, theme }) : null,
283
+ live && !(streaming == null ? void 0 : streaming.trim()) ? /* @__PURE__ */ jsx(BuildingStatus, { building, theme }) : null,
284
+ ask && onAnswerAsk && !dismissedAsks.includes(ask.requestId) ? /* @__PURE__ */ jsx(AskUserCard, { payload: ask, isDark: theme.isDark, onAnswer: (formatted) => {
285
+ setDismissedAsks((prev) => [...prev, ask.requestId]);
286
+ onAnswerAsk(formatted);
287
+ }, onDismiss: () => setDismissedAsks((prev) => [...prev, ask.requestId]) }, ask.requestId) : null
420
288
  ] });
289
+ return /* @__PURE__ */ jsx(View, { ref: rootRef, style: styles.fill, collapsable: false, onLayout: () => {
290
+ var _a;
291
+ return (_a = rootRef.current) == null ? void 0 : _a.measureInWindow((_x, y) => setTop(Math.max(0, Math.round(y))));
292
+ }, children: /* @__PURE__ */ jsx(
293
+ NativeAgentChat,
294
+ {
295
+ title: "Web Builder",
296
+ visible: true,
297
+ onClose: () => void 0,
298
+ hideHeader: true,
299
+ messages: shown,
300
+ onSend,
301
+ busy: false,
302
+ steering,
303
+ streamingContent: streaming,
304
+ error,
305
+ placeholder: "Message Web Builder",
306
+ emptyTitle: emptyTitleFor(loadingHistory, Boolean(build), siteTitle),
307
+ emptyBody: emptyBodyFor(loadingHistory, Boolean(build)),
308
+ belowHeader: loadingHistory ? /* @__PURE__ */ jsxs(View, { style: styles.historyLoading, testID: "webbuilder-chat-loading", children: [
309
+ /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.accent }),
310
+ /* @__PURE__ */ jsx(Text, { style: [styles.historyLoadingText, {
311
+ color: theme.muted
312
+ }], children: "Loading the conversation\u2026" })
313
+ ] }) : null,
314
+ suggestions: messages.length === 0 && !live && !loadingHistory ? webbuilderAgentSuggestions(Boolean(build), siteTitle) : [],
315
+ beforeComposer: footer,
316
+ renderMessageExtras: renderExtras,
317
+ renderConnectorCard,
318
+ mapToolSteps: friendlySteps,
319
+ sendDisabled: !connected,
320
+ composerLead: !connected ? /* @__PURE__ */ jsx(Text, { style: [styles.connecting, {
321
+ color: theme.muted
322
+ }], children: "Connecting to Web Builder\u2026" }) : null,
323
+ draft,
324
+ onDraftChange: setDraft,
325
+ keyboardOffset: top,
326
+ embedded: true,
327
+ isDark: theme.isDark,
328
+ ink: theme.ink,
329
+ muted: theme.muted,
330
+ screen: theme.screen,
331
+ border: theme.border,
332
+ card: theme.card
333
+ }
334
+ ) });
421
335
  }
422
336
  const styles = StyleSheet.create({
423
337
  versionChip: {
@@ -765,5 +679,21 @@ const styles = StyleSheet.create({
765
679
  fontSize: 12,
766
680
  textAlign: "center",
767
681
  marginTop: 6
682
+ },
683
+ footer: {
684
+ gap: 16,
685
+ paddingHorizontal: 16,
686
+ paddingTop: 8,
687
+ paddingBottom: 12
688
+ },
689
+ historyLoading: {
690
+ flexDirection: "row",
691
+ alignItems: "center",
692
+ justifyContent: "center",
693
+ gap: 10,
694
+ paddingTop: 40
695
+ },
696
+ historyLoadingText: {
697
+ fontSize: 14
768
698
  }
769
699
  });export{ProjectChat};//# sourceMappingURL=ProjectChat.js.map