@adminide-stack/yantra-mobile 12.0.167-alpha.0 → 12.0.168-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.
- package/lib/assets/kinds/character.webp +0 -0
- package/lib/assets/kinds/image.webp +0 -0
- package/lib/assets/kinds/video.webp +0 -0
- package/lib/assets/kinds/website.webp +0 -0
- package/lib/bridge/handlers/NavigationBridgeHandler.js +3 -2
- package/lib/bridge/handlers/NavigationBridgeHandler.js.map +1 -1
- package/lib/components/CustomDrawer.js +6 -2
- package/lib/components/CustomDrawer.js.map +1 -1
- package/lib/features/agent-chat/NativeAgentChat.js +17 -3
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/chat/ApprovalCard.js +8 -2
- package/lib/features/chat/ApprovalCard.js.map +1 -1
- package/lib/features/chat/AskUserCard.js +5 -3
- package/lib/features/chat/AskUserCard.js.map +1 -1
- package/lib/features/chat/ComposerModeSwitch.js +147 -0
- package/lib/features/chat/ComposerModeSwitch.js.map +1 -0
- package/lib/features/templates/__tests__/buildKinds.test.ts +54 -0
- package/lib/features/templates/__tests__/buildTemplateCards.test.ts +58 -6
- package/lib/features/templates/__tests__/templateSuggestion.test.ts +30 -0
- package/lib/features/templates/buildKinds.js +114 -0
- package/lib/features/templates/buildKinds.js.map +1 -0
- package/lib/features/templates/buildKinds.ts +189 -0
- package/lib/features/templates/buildTemplateCards.js +63 -18
- package/lib/features/templates/buildTemplateCards.js.map +1 -1
- package/lib/features/templates/buildTemplateCards.ts +88 -18
- package/lib/features/templates/index.ts +2 -0
- package/lib/features/templates/templateSuggestion.js +34 -0
- package/lib/features/templates/templateSuggestion.js.map +1 -0
- package/lib/features/templates/templateSuggestion.ts +57 -0
- package/lib/features/webbuilder/WebBuilderExperience.js +188 -28
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/approvalsLink.js +6 -0
- package/lib/features/webbuilder/approvalsLink.js.map +1 -0
- package/lib/features/webbuilder/buildFragments.js +19 -4
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/components/CloudSheet.js +18 -5
- package/lib/features/webbuilder/components/CloudSheet.js.map +1 -1
- package/lib/features/webbuilder/components/CodeView.js +7 -3
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/DomainFinder.js +263 -0
- package/lib/features/webbuilder/components/DomainFinder.js.map +1 -0
- package/lib/features/webbuilder/components/DraftsSheet.js +298 -0
- package/lib/features/webbuilder/components/DraftsSheet.js.map +1 -0
- package/lib/features/webbuilder/components/ImageEditPanel.js +266 -0
- package/lib/features/webbuilder/components/ImageEditPanel.js.map +1 -0
- package/lib/features/webbuilder/components/MentionMenu.js +155 -0
- package/lib/features/webbuilder/components/MentionMenu.js.map +1 -0
- package/lib/features/webbuilder/components/NotesSheet.js +138 -0
- package/lib/features/webbuilder/components/NotesSheet.js.map +1 -0
- package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +17 -3
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js +200 -15
- package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
- package/lib/features/webbuilder/components/ShareSheet.js +48 -6
- package/lib/features/webbuilder/components/ShareSheet.js.map +1 -1
- package/lib/features/webbuilder/components/SiteCopyProgress.js +169 -0
- package/lib/features/webbuilder/components/SiteCopyProgress.js.map +1 -0
- package/lib/features/webbuilder/components/SiteStatusSheet.js +145 -2
- package/lib/features/webbuilder/components/SiteStatusSheet.js.map +1 -1
- package/lib/features/webbuilder/drafts.js +167 -0
- package/lib/features/webbuilder/drafts.js.map +1 -0
- package/lib/features/webbuilder/maskPng.js +113 -0
- package/lib/features/webbuilder/maskPng.js.map +1 -0
- package/lib/features/webbuilder/previewProbe.js.map +1 -1
- package/lib/features/webbuilder/stepLabels.js +21 -1
- package/lib/features/webbuilder/stepLabels.js.map +1 -1
- package/lib/features/webbuilder/web/chat/mentions.js +106 -0
- package/lib/features/webbuilder/web/chat/mentions.js.map +1 -0
- package/lib/features/webbuilder/web/chat/siteCopy.js +121 -0
- package/lib/features/webbuilder/web/chat/siteCopy.js.map +1 -0
- package/lib/features/webbuilder/web/code/imageEdit.js +30 -0
- package/lib/features/webbuilder/web/code/imageEdit.js.map +1 -0
- package/lib/features/webbuilder/web/design/linkedDesign.js +26 -0
- package/lib/features/webbuilder/web/design/linkedDesign.js.map +1 -0
- package/lib/features/webbuilder/web/project/buildLink.js +3 -0
- package/lib/features/webbuilder/web/project/buildLink.js.map +1 -0
- package/lib/features/webbuilder/web/project/drafts.js +57 -0
- package/lib/features/webbuilder/web/project/drafts.js.map +1 -0
- package/lib/features/webbuilder/web/project/navHistory.js +7 -0
- package/lib/features/webbuilder/web/project/navHistory.js.map +1 -0
- package/lib/features/webbuilder/web/project/serverSettings.js +15 -4
- package/lib/features/webbuilder/web/project/serverSettings.js.map +1 -1
- package/lib/features/webbuilder/web/publish/domainShop.js +79 -0
- package/lib/features/webbuilder/web/publish/domainShop.js.map +1 -0
- package/lib/features/webbuilder/web/publish/publishRequest.js +11 -0
- package/lib/features/webbuilder/web/publish/publishRequest.js.map +1 -0
- package/lib/features/webbuilder/web/publish/review/freshness.js +13 -0
- package/lib/features/webbuilder/web/publish/review/freshness.js.map +1 -0
- package/lib/features/webbuilder/web/publish/review/ignores.js +94 -0
- package/lib/features/webbuilder/web/publish/review/ignores.js.map +1 -0
- package/lib/features/webbuilder/web/publish/review/seo.js +230 -0
- package/lib/features/webbuilder/web/publish/review/seo.js.map +1 -0
- package/lib/features/webbuilder/web/publish/siteHealth.js +27 -3
- package/lib/features/webbuilder/web/publish/siteHealth.js.map +1 -1
- package/lib/features/webbuilder/web/publish/siteInsights.js +120 -3
- package/lib/features/webbuilder/web/publish/siteInsights.js.map +1 -1
- package/lib/features/webbuilder/web/sharing/shareLink.js +9 -0
- package/lib/features/webbuilder/web/sharing/shareLink.js.map +1 -0
- package/lib/features/webbuilder/web/webServices.js +1 -1
- package/lib/features/webbuilder/web/webServices.js.map +1 -1
- package/lib/hooks/useMarketplaceTemplateCards.js +3 -4
- package/lib/hooks/useMarketplaceTemplateCards.js.map +1 -1
- package/lib/hooks/useMarketplaceTemplateGroups.js +12 -5
- package/lib/hooks/useMarketplaceTemplateGroups.js.map +1 -1
- package/lib/hooks/useTemplatesResourceUri.js +12 -0
- package/lib/hooks/useTemplatesResourceUri.js.map +1 -0
- package/lib/screens/Chat/index.js +4 -22
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Home/HomeScreen.js +165 -179
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/BuildKindPicker.js +248 -0
- package/lib/screens/Home/components/BuildKindPicker.js.map +1 -0
- package/lib/screens/Home/components/BuildTemplatesSection.js +556 -117
- package/lib/screens/Home/components/BuildTemplatesSection.js.map +1 -1
- package/lib/screens/Home/components/KindThumb.js +444 -0
- package/lib/screens/Home/components/KindThumb.js.map +1 -0
- package/lib/screens/Home/components/TemplateSuggestionBanner.js +73 -0
- package/lib/screens/Home/components/TemplateSuggestionBanner.js.map +1 -0
- package/lib/screens/Home/components/buildTheme.js +68 -0
- package/lib/screens/Home/components/buildTheme.js.map +1 -0
- package/lib/screens/WebBuilder/index.js +11 -1
- package/lib/screens/WebBuilder/index.js.map +1 -1
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +55 -0
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -0
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js +4 -0
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js.map +1 -1
- package/lib/screens/WebBuilderNative/index.js +31 -4
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +1 -0
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +5 -5
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import React__default,{useRef,useState,useCallback,useMemo,useEffect}from'react';import {View,StyleSheet,useWindowDimensions,InteractionManager,Animated,Keyboard,Pressable,Platform}from'react-native';import {Text,
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import React__default,{useRef,useState,useCallback,useMemo,useEffect}from'react';import {View,StyleSheet,useWindowDimensions,InteractionManager,Animated,Keyboard,Pressable,Platform}from'react-native';import {Text,InputToolBar}from'@admin-layout/gluestack-ui-mobile';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {useNavigation,useRoute,useFocusEffect,CommonActions,useIsFocused}from'@react-navigation/native';import {useDispatch,useSelector}from'react-redux';import {userSelector}from'@adminide-stack/user-auth0-client';import {v4}from'uuid';import {pickGivenName}from'../../utils/authUserDisplay.js';import {KeyboardAwareScreen,KeyboardComposerDock}from'../../components/KeyboardComposerDock.js';import {useKeyboardBottomOffset}from'../../hooks/useKeyboardBottomOffset.js';import {dismissKeyboard}from'../../utils/keyboardController.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {syncMobileOrgRouteContext}from'../../utils/syncMobileOrgRouteContext.js';import {useChatMutations,usePrefetchChatHistory}from'../../hooks/useChatApi.js';import {hydrateChatHistorySnapshot,persistChatHistorySnapshot}from'../../features/chat/chatHistorySnapshot.js';import {AudioRecorderPanel}from'../../features/audio-input/AudioRecorderPanel.js';import {MicErrorBoundary}from'../../features/audio-input/MicErrorBoundary.js';import {requestMicPermission}from'../../features/audio-input/useAudioPermission.js';import {mobileTokens}from'../../theme/mobileTokens.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {groupByKind,BUILD_KINDS,kindForGroup,buildKind,CODE_ASSISTANT_GROUP}from'../../features/templates/buildKinds.js';import {ComposerModeSwitch,composerMode}from'../../features/chat/ComposerModeSwitch.js';import {useMarketplaceTemplateGroups}from'../../hooks/useMarketplaceTemplateGroups.js';import {useImageAttachments}from'../../features/attachments/useImageAttachments.js';import {ComposerAttachmentBar}from'../../features/attachments/ComposerAttachmentBar.js';import {useComposerAttachMenu}from'../../features/attachments/ComposerAttachMenu.js';import {stashComposerAttachments}from'../../features/attachments/composerAttachmentHandoff.js';import {nativeHandoffParams}from'../../features/apps/nativeAppNavigation.js';import {ConnectAppsSheet}from'../../features/channels/ConnectAppsSheet.js';import {HomeImessage}from'../../features/channels/HomeImessage.js';import {IMESSAGE_CHANNEL}from'../../features/channels/channelLinks.js';import {useChannelBindings}from'../../features/channels/useChannelsApi.js';import {ChatModelSheet}from'../../features/chat/ChatModelSheet.js';import {HomeSky}from'../../features/home/sky/HomeSky.js';import {setHomeSkyBar}from'../../features/home/sky/homeSkyBar.js';import {useSkyScene}from'../../features/home/sky/useSkyScene.js';import {useHomeWeather}from'../../features/home/useHomeWeather.js';import {BuildKindPicker,BuildGroupTabs}from'./components/BuildKindPicker.js';import {buildPalette}from'./components/buildTheme.js';import {BuildTemplatesSection}from'./components/BuildTemplatesSection.js';import {ChooseTemplateModal}from'./components/ChooseTemplateModal.js';import {TemplateSuggestionBanner}from'./components/TemplateSuggestionBanner.js';import {SUGGEST_MIN_QUERY,suggestTemplateGroup,SUGGEST_DEBOUNCE_MS}from'../../features/templates/templateSuggestion.js';import {HomeHero}from'./components/HomeHero.js';import {FreeCreditsCard}from'../../features/credits/FreeCreditsCard.js';import {shouldOfferFreeCredits}from'../../features/credits/freeCredits.js';import {useFreeCredits}from'../../features/credits/useFreeCredits.js';import {HomeSuggestions}from'./components/HomeSuggestions.js';import {HomeWash}from'./components/HomeWash.js';import {WebBuilderPrewarm}from'./components/WebBuilderPrewarm.js';import {CanvasPrewarm}from'./components/CanvasPrewarm.js';import {WebBuilderCodePrewarm}from'./components/WebBuilderCodePrewarm.js';import {resetDrawerClosed,dispatchDrawerAction,afterNativeModalClose}from'../../utils/drawerNavigation.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -22,35 +22,35 @@ function buildChannelTitle(mode, channelId) {
|
|
|
22
22
|
if (mode === "build") return `build-channel-${channelId}`;
|
|
23
23
|
return `chat-channel-${channelId}`;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
chat: "Ask anything"
|
|
29
|
-
};
|
|
30
|
-
function emptyStateSubtitle(mode, hasTemplate, hasTemplateGroup) {
|
|
31
|
-
if (mode === "deep-search") return "Source-backed answers from the web.";
|
|
32
|
-
if (mode !== "build") return "Chat, Deep Search, or Build from the composer.";
|
|
33
|
-
if (hasTemplate) return "Describe the project, then send.";
|
|
34
|
-
return hasTemplateGroup ? "Tap a starter below, then send." : "Tap Template to pick a group, then send.";
|
|
35
|
-
}
|
|
36
|
-
function composerPlaceholder(mode, hasTemplate) {
|
|
37
|
-
if (mode === "deep-search") return "Research anything...";
|
|
38
|
-
if (mode !== "build") return "Ask anything...";
|
|
39
|
-
return hasTemplate ? "Build me: describe your project\u2026" : "Describe an app to build...";
|
|
25
|
+
function composerPlaceholder(mode, buildKindId) {
|
|
26
|
+
if (mode === "build" && buildKindId) return buildKind(buildKindId).placeholder;
|
|
27
|
+
return composerMode(mode).placeholder;
|
|
40
28
|
}
|
|
41
29
|
function seedTemplateFor(stack) {
|
|
42
30
|
if (stack.includes("next")) return "nextjs";
|
|
43
31
|
return stack.includes("vue") ? "vue" : "vite-react";
|
|
44
32
|
}
|
|
33
|
+
function webBuilderTemplateFor(card) {
|
|
34
|
+
var _a;
|
|
35
|
+
return {
|
|
36
|
+
id: card.formTemplateId || card.id,
|
|
37
|
+
title: card.title,
|
|
38
|
+
description: card.description,
|
|
39
|
+
cover: card.coverImageUrl,
|
|
40
|
+
category: card.category,
|
|
41
|
+
templateName: seedTemplateFor((card.templateName || "").toLowerCase()),
|
|
42
|
+
formTemplateId: card.formTemplateId,
|
|
43
|
+
chatPrompt: card.chatPrompt,
|
|
44
|
+
snapshotId: (_a = card.snapshotId) == null ? void 0 : _a.trim(),
|
|
45
|
+
skill: card.skill
|
|
46
|
+
};
|
|
47
|
+
}
|
|
45
48
|
const TESTING_PROJECT_ID = "9a8ac704-1040-4836-9b72-48b771ca91b1";
|
|
46
49
|
const SEND_WAIT_MS = 2e4;
|
|
47
50
|
const EmptyStateSection = React__default.memo(function EmptyStateSection2({
|
|
48
51
|
isDark,
|
|
49
52
|
secondaryTextColor,
|
|
50
53
|
primaryTextColor,
|
|
51
|
-
activeMode,
|
|
52
|
-
selectedTemplateGroup,
|
|
53
|
-
selectedBuildTemplateId,
|
|
54
54
|
compact,
|
|
55
55
|
onInjectPrompt,
|
|
56
56
|
onOpenRoute,
|
|
@@ -63,22 +63,10 @@ const EmptyStateSection = React__default.memo(function EmptyStateSection2({
|
|
|
63
63
|
anchorRef,
|
|
64
64
|
onAnchorLayout
|
|
65
65
|
}) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
compact ? null : /* @__PURE__ */ jsx(HomeSuggestions, { isDark, primaryTextColor, secondaryTextColor, headingColor: skyPrimaryColor, headingMutedColor: skySecondaryColor, onInjectPrompt, onOpenRoute })
|
|
71
|
-
] });
|
|
72
|
-
}
|
|
73
|
-
const title = EMPTY_STATE_TITLES[activeMode];
|
|
74
|
-
const subtitle = emptyStateSubtitle(activeMode, Boolean(selectedBuildTemplateId), Boolean(selectedTemplateGroup));
|
|
75
|
-
return /* @__PURE__ */ jsxs(View, { ref: anchorRef, collapsable: false, onLayout: onAnchorLayout, style: styles.emptyInner, children: [
|
|
76
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.emptyCenterTitle, compact && styles.emptyCenterTitleCompact, {
|
|
77
|
-
color: skyPrimaryColor
|
|
78
|
-
}], children: title }),
|
|
79
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.emptySubtitle, compact && styles.emptySubtitleCompact, {
|
|
80
|
-
color: skySecondaryColor
|
|
81
|
-
}], children: subtitle })
|
|
66
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.homeInner, children: [
|
|
67
|
+
/* @__PURE__ */ jsx(View, { ref: anchorRef, collapsable: false, onLayout: onAnchorLayout, style: styles.anchor, children: /* @__PURE__ */ jsx(HomeHero, { firstName, weather, primaryTextColor: skyPrimaryColor, secondaryTextColor: skySecondaryColor, compact, channelChip }) }),
|
|
68
|
+
compact ? null : freeCreditsOffer,
|
|
69
|
+
compact ? null : /* @__PURE__ */ jsx(HomeSuggestions, { isDark, primaryTextColor, secondaryTextColor, headingColor: skyPrimaryColor, headingMutedColor: skySecondaryColor, onInjectPrompt, onOpenRoute })
|
|
82
70
|
] });
|
|
83
71
|
});
|
|
84
72
|
function HomeScreenContent({
|
|
@@ -87,7 +75,7 @@ function HomeScreenContent({
|
|
|
87
75
|
isLoading: isLoadingProp = false,
|
|
88
76
|
disabled = false
|
|
89
77
|
}) {
|
|
90
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
78
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
91
79
|
const {
|
|
92
80
|
width: screenWidth
|
|
93
81
|
} = useWindowDimensions();
|
|
@@ -135,8 +123,8 @@ function HomeScreenContent({
|
|
|
135
123
|
const [activeMode, setActiveMode] = useState(initialMode);
|
|
136
124
|
const [showAudioRecorder, setShowAudioRecorder] = useState(false);
|
|
137
125
|
const [selectedTemplateGroup, setSelectedTemplateGroup] = useState(null);
|
|
126
|
+
const [pickedKind, setPickedKind] = useState(null);
|
|
138
127
|
const [selectedBuildTemplate, setSelectedBuildTemplate] = useState(null);
|
|
139
|
-
const [showTemplateModal, setShowTemplateModal] = useState(false);
|
|
140
128
|
const [voiceError, setVoiceError] = useState(null);
|
|
141
129
|
const [showModelSheet, setShowModelSheet] = useState(false);
|
|
142
130
|
const [connectSheet, setConnectSheet] = useState(null);
|
|
@@ -167,8 +155,8 @@ function HomeScreenContent({
|
|
|
167
155
|
setActiveMode("chat");
|
|
168
156
|
setShowAudioRecorder(false);
|
|
169
157
|
setSelectedTemplateGroup(null);
|
|
158
|
+
setPickedKind(null);
|
|
170
159
|
setSelectedBuildTemplate(null);
|
|
171
|
-
setShowTemplateModal(false);
|
|
172
160
|
setVoiceError(null);
|
|
173
161
|
setShowModelSheet(false);
|
|
174
162
|
setConnectSheet(null);
|
|
@@ -202,12 +190,27 @@ function HomeScreenContent({
|
|
|
202
190
|
persistChatHistorySnapshot(accountUserId, effectiveOrgName, prefetchedHistory);
|
|
203
191
|
}, [accountUserId, effectiveOrgName, historyPrefetched, prefetchedHistory]);
|
|
204
192
|
const {
|
|
205
|
-
groups: marketplaceTemplateGroups
|
|
206
|
-
loading: templateGroupsLoading
|
|
193
|
+
groups: marketplaceTemplateGroups
|
|
207
194
|
} = useMarketplaceTemplateGroups({
|
|
208
195
|
orgName: effectiveOrgName,
|
|
209
196
|
enabled: true
|
|
210
197
|
});
|
|
198
|
+
const kindGroups = useMemo(() => {
|
|
199
|
+
const withGroups = groupByKind(marketplaceTemplateGroups);
|
|
200
|
+
return BUILD_KINDS.flatMap((kind) => {
|
|
201
|
+
var _a2;
|
|
202
|
+
return (_a2 = withGroups.find((entry) => entry.kind.id === kind.id)) != null ? _a2 : kind.id === "more" ? [] : [{
|
|
203
|
+
kind,
|
|
204
|
+
groups: []
|
|
205
|
+
}];
|
|
206
|
+
});
|
|
207
|
+
}, [marketplaceTemplateGroups]);
|
|
208
|
+
const galleryKindId = (_g = (_f = pickedKind != null ? pickedKind : kindForGroup(selectedTemplateGroup)) != null ? _f : (_e = kindGroups[0]) == null ? void 0 : _e.kind.id) != null ? _g : null;
|
|
209
|
+
const galleryKindGroups = useMemo(() => {
|
|
210
|
+
var _a2, _b2;
|
|
211
|
+
return (_b2 = (_a2 = kindGroups.find((entry) => entry.kind.id === galleryKindId)) == null ? void 0 : _a2.groups) != null ? _b2 : [];
|
|
212
|
+
}, [galleryKindId, kindGroups]);
|
|
213
|
+
const galleryGroup = (_i = selectedTemplateGroup != null ? selectedTemplateGroup : (_h = galleryKindGroups[0]) == null ? void 0 : _h.id) != null ? _i : null;
|
|
211
214
|
const reservedChannelIdRef = useRef(null);
|
|
212
215
|
const ensureChatSessionId = useCallback(() => {
|
|
213
216
|
if (reservedChannelIdRef.current) return reservedChannelIdRef.current;
|
|
@@ -239,7 +242,34 @@ function HomeScreenContent({
|
|
|
239
242
|
const [sendWhenReady, setSendWhenReady] = useState(false);
|
|
240
243
|
const isLoading = isLoadingProp;
|
|
241
244
|
const isBuildMode = activeMode === "build";
|
|
242
|
-
const inputPlaceholder = composerPlaceholder(activeMode,
|
|
245
|
+
const inputPlaceholder = composerPlaceholder(activeMode, galleryKindId);
|
|
246
|
+
const [suggestedGroupId, setSuggestedGroupId] = useState(null);
|
|
247
|
+
const [analyzingQuery, setAnalyzingQuery] = useState(false);
|
|
248
|
+
const [groupPickerOpen, setGroupPickerOpen] = useState(false);
|
|
249
|
+
const draftReadable = isBuildMode && trimmedQuery.length >= SUGGEST_MIN_QUERY;
|
|
250
|
+
useEffect(() => {
|
|
251
|
+
if (!draftReadable || marketplaceTemplateGroups.length === 0) {
|
|
252
|
+
setSuggestedGroupId(null);
|
|
253
|
+
setAnalyzingQuery(false);
|
|
254
|
+
return void 0;
|
|
255
|
+
}
|
|
256
|
+
if (selectedTemplateGroup) {
|
|
257
|
+
setAnalyzingQuery(false);
|
|
258
|
+
return void 0;
|
|
259
|
+
}
|
|
260
|
+
setAnalyzingQuery(true);
|
|
261
|
+
const timer = setTimeout(() => {
|
|
262
|
+
var _a2, _b2;
|
|
263
|
+
setSuggestedGroupId((_b2 = (_a2 = suggestTemplateGroup(trimmedQuery, marketplaceTemplateGroups)) == null ? void 0 : _a2.id) != null ? _b2 : null);
|
|
264
|
+
setAnalyzingQuery(false);
|
|
265
|
+
}, SUGGEST_DEBOUNCE_MS);
|
|
266
|
+
return () => clearTimeout(timer);
|
|
267
|
+
}, [draftReadable, trimmedQuery, marketplaceTemplateGroups, selectedTemplateGroup]);
|
|
268
|
+
const bannerGroup = useMemo(() => {
|
|
269
|
+
var _a2;
|
|
270
|
+
const id = selectedTemplateGroup != null ? selectedTemplateGroup : suggestedGroupId;
|
|
271
|
+
return id ? (_a2 = marketplaceTemplateGroups.find((group) => group.id === id)) != null ? _a2 : null : null;
|
|
272
|
+
}, [marketplaceTemplateGroups, selectedTemplateGroup, suggestedGroupId]);
|
|
243
273
|
const insets = useSafeAreaInsets();
|
|
244
274
|
const {
|
|
245
275
|
keyboardVisible
|
|
@@ -256,8 +286,8 @@ function HomeScreenContent({
|
|
|
256
286
|
const handleModeSwitch = useCallback((mode) => {
|
|
257
287
|
setActiveMode(mode);
|
|
258
288
|
if (mode !== "build") {
|
|
259
|
-
setShowTemplateModal(false);
|
|
260
289
|
setSelectedTemplateGroup(null);
|
|
290
|
+
setPickedKind(null);
|
|
261
291
|
setSelectedBuildTemplate(null);
|
|
262
292
|
}
|
|
263
293
|
}, []);
|
|
@@ -293,57 +323,47 @@ function HomeScreenContent({
|
|
|
293
323
|
}));
|
|
294
324
|
});
|
|
295
325
|
}, [navigation, effectiveOrgName, routeOrgName]);
|
|
296
|
-
const navigateToWebBuilder = useCallback((channelId, handoff) => {
|
|
297
|
-
var _a2, _b2;
|
|
298
|
-
const isRemix = Boolean((_a2 = handoff.snapshotId) == null ? void 0 : _a2.trim());
|
|
299
|
-
navigation.dispatch(CommonActions.navigate({
|
|
300
|
-
name: "MainStack.WebBuilder",
|
|
301
|
-
params: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadValues({
|
|
302
|
-
orgName: (_b2 = effectiveOrgName != null ? effectiveOrgName : routeOrgName) != null ? _b2 : void 0
|
|
303
|
-
}, !isRemix ? {
|
|
304
|
-
channelId
|
|
305
|
-
} : {}), !isRemix && effectiveProjectId ? {
|
|
306
|
-
projectId: effectiveProjectId
|
|
307
|
-
} : {}), {
|
|
308
|
-
message: handoff.message
|
|
309
|
-
}), handoff.snapshotId ? {
|
|
310
|
-
snapshotId: handoff.snapshotId
|
|
311
|
-
} : {}), handoff.templateId ? {
|
|
312
|
-
templateId: handoff.templateId
|
|
313
|
-
} : {}), handoff.templateTitle ? {
|
|
314
|
-
templateTitle: handoff.templateTitle
|
|
315
|
-
} : {}), handoff.seedTemplate ? {
|
|
316
|
-
seedTemplate: handoff.seedTemplate
|
|
317
|
-
} : {})
|
|
318
|
-
}));
|
|
319
|
-
}, [navigation, effectiveOrgName, routeOrgName, effectiveProjectId]);
|
|
320
326
|
const handleUseBuildTemplate = useCallback((card) => {
|
|
321
|
-
var _a2;
|
|
327
|
+
var _a2, _b2;
|
|
328
|
+
if (galleryGroup) setSelectedTemplateGroup(galleryGroup);
|
|
329
|
+
setSelectedBuildTemplate(card);
|
|
322
330
|
const snapshotId = (_a2 = card.snapshotId) == null ? void 0 : _a2.trim();
|
|
323
|
-
|
|
324
|
-
|
|
331
|
+
const prompt = (_b2 = card.chatPrompt) == null ? void 0 : _b2.trim();
|
|
332
|
+
if (!snapshotId && prompt) {
|
|
333
|
+
setValue(prompt);
|
|
334
|
+
return;
|
|
325
335
|
}
|
|
326
|
-
setSelectedBuildTemplate(card);
|
|
327
336
|
setValue((prev) => {
|
|
328
337
|
const trimmed = prev.trim();
|
|
329
338
|
if (trimmed && !/^build\s*me\s*:?\s*$/i.test(trimmed)) return prev;
|
|
330
339
|
return "Build me: ";
|
|
331
340
|
});
|
|
332
|
-
}, []);
|
|
341
|
+
}, [galleryGroup]);
|
|
333
342
|
const handleSelectTemplateGroup = useCallback((groupId) => {
|
|
334
343
|
setSelectedTemplateGroup(groupId);
|
|
344
|
+
setPickedKind(kindForGroup(groupId));
|
|
335
345
|
setSelectedBuildTemplate(null);
|
|
336
|
-
setShowTemplateModal(false);
|
|
337
346
|
}, []);
|
|
338
|
-
const
|
|
339
|
-
if (selectedBuildTemplate) {
|
|
340
|
-
setSelectedBuildTemplate(null);
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
setSelectedTemplateGroup(null);
|
|
344
|
-
}, [selectedBuildTemplate]);
|
|
345
|
-
const handleSubmit = useCallback(async () => {
|
|
347
|
+
const handlePickKind = useCallback((id) => {
|
|
346
348
|
var _a2, _b2;
|
|
349
|
+
if (id === galleryKindId && (pickedKind || selectedTemplateGroup)) return;
|
|
350
|
+
const first = (_a2 = kindGroups.find((entry) => entry.kind.id === id)) == null ? void 0 : _a2.groups[0];
|
|
351
|
+
setPickedKind(id);
|
|
352
|
+
setSelectedTemplateGroup((_b2 = first == null ? void 0 : first.id) != null ? _b2 : null);
|
|
353
|
+
setSelectedBuildTemplate(null);
|
|
354
|
+
}, [galleryKindId, kindGroups, pickedKind, selectedTemplateGroup]);
|
|
355
|
+
const handleTryBuildPrompt = useCallback((prompt) => {
|
|
356
|
+
var _a2;
|
|
357
|
+
setSelectedBuildTemplate(null);
|
|
358
|
+
setValue(prompt);
|
|
359
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
360
|
+
}, []);
|
|
361
|
+
const focusComposer = useCallback(() => {
|
|
362
|
+
var _a2;
|
|
363
|
+
return (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
364
|
+
}, []);
|
|
365
|
+
const handleSubmit = useCallback(async () => {
|
|
366
|
+
var _a2;
|
|
347
367
|
if (!canSubmit || isLoading || disabled) return;
|
|
348
368
|
if (!workspaceReady) {
|
|
349
369
|
setSendWhenReady(true);
|
|
@@ -367,25 +387,33 @@ function HomeScreenContent({
|
|
|
367
387
|
console.warn("[HomeScreen] projectId not ready \u2014 using testing project fallback for submit.");
|
|
368
388
|
}
|
|
369
389
|
const queryToForward = trimmedQuery;
|
|
370
|
-
|
|
390
|
+
const isRemix = activeMode === "build" && Boolean((_a2 = selectedBuildTemplate == null ? void 0 : selectedBuildTemplate.snapshotId) == null ? void 0 : _a2.trim());
|
|
391
|
+
const kindBuildsSite = !pickedKind || pickedKind === "website" || pickedKind === "app";
|
|
392
|
+
const routedGroup = selectedTemplateGroup != null ? selectedTemplateGroup : suggestedGroupId;
|
|
393
|
+
const buildAsChat = activeMode === "build" && !isRemix && (routedGroup ? routedGroup !== CODE_ASSISTANT_GROUP : !kindBuildsSite);
|
|
394
|
+
const sendMode = buildAsChat ? "chat" : activeMode;
|
|
395
|
+
if (sendMode === "build") {
|
|
396
|
+
const tpl = isRemix ? selectedBuildTemplate : null;
|
|
371
397
|
clearComposerOnFocusRef.current = true;
|
|
372
398
|
resetComposer();
|
|
373
399
|
composerAttachments.clear();
|
|
374
400
|
setSelectedBuildTemplate(null);
|
|
375
401
|
navigation.dispatch(CommonActions.navigate({
|
|
376
402
|
name: "MainStack.WebBuilderNative",
|
|
377
|
-
params: nativeHandoffParams({
|
|
403
|
+
params: __spreadValues(__spreadValues({}, nativeHandoffParams({
|
|
378
404
|
orgName: effectiveOrgName,
|
|
379
405
|
query: queryToForward,
|
|
380
406
|
files: attachmentsToForward
|
|
381
|
-
})
|
|
407
|
+
})), tpl ? {
|
|
408
|
+
initialTemplate: webBuilderTemplateFor(tpl)
|
|
409
|
+
} : {})
|
|
382
410
|
}));
|
|
383
411
|
return;
|
|
384
412
|
}
|
|
385
|
-
const reservedChannelId =
|
|
413
|
+
const reservedChannelId = sendMode === "chat" ? reservedChannelIdRef.current : null;
|
|
386
414
|
reservedChannelIdRef.current = null;
|
|
387
415
|
const requestedChannelId = reservedChannelId != null ? reservedChannelId : v4();
|
|
388
|
-
const title = buildChannelTitle(
|
|
416
|
+
const title = buildChannelTitle(sendMode, requestedChannelId);
|
|
389
417
|
clearComposerOnFocusRef.current = true;
|
|
390
418
|
resetComposer();
|
|
391
419
|
composerAttachments.clear();
|
|
@@ -406,23 +434,9 @@ function HomeScreenContent({
|
|
|
406
434
|
console.error("[HomeScreen] createChannel failed:", err);
|
|
407
435
|
});
|
|
408
436
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
const rawStack = ((tpl == null ? void 0 : tpl.templateName) || "").toLowerCase();
|
|
413
|
-
const seedTemplate = snapshotId ? seedTemplateFor(rawStack) : void 0;
|
|
414
|
-
navigateToWebBuilder(requestedChannelId, {
|
|
415
|
-
message: queryToForward,
|
|
416
|
-
snapshotId,
|
|
417
|
-
templateId: tpl ? tpl.formTemplateId || tpl.id : void 0,
|
|
418
|
-
templateTitle: tpl == null ? void 0 : tpl.title,
|
|
419
|
-
seedTemplate
|
|
420
|
-
});
|
|
421
|
-
setSelectedBuildTemplate(null);
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
navigateToChat(requestedChannelId, queryToForward, activeMode);
|
|
425
|
-
}, [canSubmit, workspaceReady, isLoading, disabled, activeMode, trimmedQuery, onSubmitProp, effectiveOrgName, effectiveProjectId, createChannel, navigateToChat, navigateToWebBuilder, selectedBuildTemplate, composerAttachments, resetComposer, navigation]);
|
|
437
|
+
setSelectedBuildTemplate(null);
|
|
438
|
+
navigateToChat(requestedChannelId, queryToForward, sendMode);
|
|
439
|
+
}, [canSubmit, workspaceReady, isLoading, disabled, activeMode, trimmedQuery, onSubmitProp, effectiveOrgName, effectiveProjectId, createChannel, navigateToChat, selectedBuildTemplate, selectedTemplateGroup, suggestedGroupId, pickedKind, composerAttachments, resetComposer, navigation]);
|
|
426
440
|
const surfaceColor = isDark ? "#0f172a" : mobileTokens.color.surface;
|
|
427
441
|
const authUser = useSelector(userSelector);
|
|
428
442
|
const firstName = useMemo(() => pickGivenName(authUser), [authUser]);
|
|
@@ -430,7 +444,9 @@ function HomeScreenContent({
|
|
|
430
444
|
const secondaryTextColor = isDark ? "#94a3b8" : mobileTokens.color.textMuted;
|
|
431
445
|
const contentMaxWidth = Math.min(720, Math.max(360, screenWidth - 24));
|
|
432
446
|
const homeWeather = useHomeWeather();
|
|
433
|
-
const
|
|
447
|
+
const skyScene = useSkyScene(homeWeather.report, isDark);
|
|
448
|
+
const sky = isBuildMode ? null : skyScene;
|
|
449
|
+
const buildColors = useMemo(() => buildPalette(isDark), [isDark]);
|
|
434
450
|
const homeFocused = useIsFocused();
|
|
435
451
|
const skyInkLight = (sky == null ? void 0 : sky.ink) === "light";
|
|
436
452
|
const skyInk = skyInkLight ? {
|
|
@@ -526,7 +542,7 @@ function HomeScreenContent({
|
|
|
526
542
|
}),
|
|
527
543
|
merge: true
|
|
528
544
|
}));
|
|
529
|
-
}, [dispatch, navigation, route == null ? void 0 : route.name, route == null ? void 0 : route.params, (
|
|
545
|
+
}, [dispatch, navigation, route == null ? void 0 : route.name, route == null ? void 0 : route.params, (_j = route == null ? void 0 : route.params) == null ? void 0 : _j.orgName, resolvedOrgName, accountUserId, mobileRoutePath, orgLoading]);
|
|
530
546
|
const handleValueChange = useCallback((e) => {
|
|
531
547
|
setValue(e.nativeEvent.text);
|
|
532
548
|
}, []);
|
|
@@ -562,55 +578,28 @@ function HomeScreenContent({
|
|
|
562
578
|
const handleRecorderError = useCallback((error) => {
|
|
563
579
|
setVoiceError(error);
|
|
564
580
|
}, []);
|
|
565
|
-
const
|
|
566
|
-
search: {
|
|
567
|
-
active: activeMode === "chat",
|
|
568
|
-
onClick: () => handleModeSwitch("chat")
|
|
569
|
-
},
|
|
570
|
-
zap: {
|
|
571
|
-
active: activeMode === "deep-search",
|
|
572
|
-
onClick: () => handleModeSwitch("deep-search")
|
|
573
|
-
},
|
|
574
|
-
lightbulb: {
|
|
575
|
-
active: activeMode === "build",
|
|
576
|
-
onClick: () => handleModeSwitch("build")
|
|
577
|
-
}
|
|
578
|
-
}), [activeMode, handleModeSwitch]);
|
|
579
|
-
const templateModalItems = useMemo(() => marketplaceTemplateGroups.map((group) => ({
|
|
580
|
-
id: group.id,
|
|
581
|
-
label: group.label,
|
|
582
|
-
description: group.description,
|
|
583
|
-
category: group.category
|
|
584
|
-
})), [marketplaceTemplateGroups]);
|
|
585
|
-
const selectedTemplateLabel = useMemo(() => {
|
|
586
|
-
var _a2, _b2;
|
|
587
|
-
if ((_a2 = selectedBuildTemplate == null ? void 0 : selectedBuildTemplate.title) == null ? void 0 : _a2.trim()) return selectedBuildTemplate.title.trim();
|
|
588
|
-
if (!selectedTemplateGroup) return void 0;
|
|
589
|
-
return ((_b2 = marketplaceTemplateGroups.find((g) => g.id === selectedTemplateGroup)) == null ? void 0 : _b2.label) || selectedTemplateGroup;
|
|
590
|
-
}, [marketplaceTemplateGroups, selectedTemplateGroup, selectedBuildTemplate]);
|
|
581
|
+
const modeSwitch = useMemo(() => /* @__PURE__ */ jsx(ComposerModeSwitch, { activeMode, onSelect: handleModeSwitch, isDark }), [activeMode, handleModeSwitch, isDark]);
|
|
591
582
|
const templateButton = useMemo(() => {
|
|
592
|
-
|
|
583
|
+
var _a2;
|
|
584
|
+
if (!isBuildMode || !selectedBuildTemplate) return null;
|
|
593
585
|
return {
|
|
594
586
|
label: "Template",
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
onSelect: handleSelectTemplateGroup,
|
|
610
|
-
title: "Choose Template"
|
|
587
|
+
selectedLabel: ((_a2 = selectedBuildTemplate.title) == null ? void 0 : _a2.trim()) || "Template",
|
|
588
|
+
onClick: () => {
|
|
589
|
+
var _a3;
|
|
590
|
+
dismissKeyboard();
|
|
591
|
+
(_a3 = emptyScrollRef.current) == null ? void 0 : _a3.scrollTo({
|
|
592
|
+
y: 0,
|
|
593
|
+
animated: true
|
|
594
|
+
});
|
|
595
|
+
},
|
|
596
|
+
onClearTemplate: () => {
|
|
597
|
+
setSelectedBuildTemplate(null);
|
|
598
|
+
setValue((prev) => /^build\s*me\s*:?\s*$/i.test(prev.trim()) ? "" : prev);
|
|
599
|
+
},
|
|
600
|
+
disabled: isLoading || disabled
|
|
611
601
|
};
|
|
612
|
-
}, [isBuildMode,
|
|
613
|
-
const renderTemplateModal = useCallback((config) => /* @__PURE__ */ jsx(ChooseTemplateModal, { isOpen: config.isOpen, onClose: config.onClose, templates: config.templates, selectedId: config.selectedId, onSelect: config.onSelect, suggestedId: config.suggestedId, title: config.title, isDark, loading: templateGroupsLoading }), [isDark, templateGroupsLoading]);
|
|
602
|
+
}, [isBuildMode, selectedBuildTemplate, isLoading, disabled]);
|
|
614
603
|
useEffect(() => {
|
|
615
604
|
if (!sendWhenReady) return void 0;
|
|
616
605
|
if (!canSubmit) {
|
|
@@ -657,7 +646,9 @@ function HomeScreenContent({
|
|
|
657
646
|
/* @__PURE__ */ jsx(WebBuilderPrewarm, { enabled: isBuildMode, orgName: effectiveOrgName, projectId: effectiveProjectId, tagId }),
|
|
658
647
|
/* @__PURE__ */ jsx(CanvasPrewarm, { orgName: effectiveOrgName, projectId: effectiveProjectId, tagId }),
|
|
659
648
|
/* @__PURE__ */ jsx(WebBuilderCodePrewarm, {}),
|
|
660
|
-
sky && skyAnchor ? /* @__PURE__ */ jsx(HomeSky, { scene: sky, anchor: skyAnchor, pageColor: surfaceColor, scrollY, active: homeFocused }) : /* @__PURE__ */ jsx(
|
|
649
|
+
sky && skyAnchor ? /* @__PURE__ */ jsx(HomeSky, { scene: sky, anchor: skyAnchor, pageColor: surfaceColor, scrollY, active: homeFocused }) : isBuildMode ? /* @__PURE__ */ jsx(View, { style: [StyleSheet.absoluteFill, {
|
|
650
|
+
backgroundColor: buildColors.page
|
|
651
|
+
}] }) : /* @__PURE__ */ jsx(HomeWash, { isDark }),
|
|
661
652
|
/* @__PURE__ */ jsx(KeyboardAwareScreen, { children: /* @__PURE__ */ jsxs(View, { style: styles.flex, children: [
|
|
662
653
|
/* @__PURE__ */ jsx(View, { style: styles.flex, children: /* @__PURE__ */ jsx(Animated.ScrollView, { ref: emptyScrollRef, style: styles.flex, onScroll: Animated.event([{
|
|
663
654
|
nativeEvent: {
|
|
@@ -667,7 +658,10 @@ function HomeScreenContent({
|
|
|
667
658
|
}
|
|
668
659
|
}], {
|
|
669
660
|
useNativeDriver: true
|
|
670
|
-
}), scrollEventThrottle: 16, contentContainerStyle: [styles.emptyScroll, keyboardVisible ? styles.emptyScrollKeyboardOpen : null], keyboardShouldPersistTaps: "handled", keyboardDismissMode: Platform.OS === "ios" ? "interactive" : "on-drag", automaticallyAdjustKeyboardInsets: false, contentInsetAdjustmentBehavior: "never", showsVerticalScrollIndicator: false, children: /* @__PURE__ */ jsx(Pressable, { style: styles.dismissArea, onPress: dismissKeyboard, accessible: false, children: /* @__PURE__ */
|
|
661
|
+
}), scrollEventThrottle: 16, contentContainerStyle: [styles.emptyScroll, isBuildMode ? styles.buildScroll : null, keyboardVisible ? styles.emptyScrollKeyboardOpen : null], keyboardShouldPersistTaps: "handled", keyboardDismissMode: Platform.OS === "ios" ? "interactive" : "on-drag", automaticallyAdjustKeyboardInsets: false, contentInsetAdjustmentBehavior: "never", showsVerticalScrollIndicator: false, children: /* @__PURE__ */ jsx(Pressable, { style: styles.dismissArea, onPress: dismissKeyboard, accessible: false, children: isBuildMode ? /* @__PURE__ */ jsxs(View, { style: styles.buildInner, children: [
|
|
662
|
+
/* @__PURE__ */ jsx(View, { ref: anchorRef, collapsable: false, onLayout: measureSkyAnchor, style: styles.anchor, children: /* @__PURE__ */ jsx(BuildKindPicker, { kindGroups, activeKind: galleryKindId, onPickKind: handlePickKind, onTryPrompt: handleTryBuildPrompt, palette: buildColors, compact: keyboardVisible }) }),
|
|
663
|
+
keyboardVisible ? null : /* @__PURE__ */ jsx(BuildTemplatesSection, { enabled: true, group: galleryGroup, orgName: effectiveOrgName, isDark, palette: buildColors, selectedTemplateId: (_k = selectedBuildTemplate == null ? void 0 : selectedBuildTemplate.id) != null ? _k : null, onUseTemplate: handleUseBuildTemplate, kind: galleryKindId, title: galleryKindId ? buildKind(galleryKindId).title : void 0, tabs: /* @__PURE__ */ jsx(BuildGroupTabs, { kindLabel: galleryKindId ? buildKind(galleryKindId).label : "Template", groups: galleryKindGroups, activeGroup: galleryGroup, onPickGroup: handleSelectTemplateGroup, palette: buildColors }), onDescribeOwn: focusComposer })
|
|
664
|
+
] }) : /* @__PURE__ */ jsx(EmptyStateSection, { isDark, secondaryTextColor, primaryTextColor, compact: keyboardVisible, onInjectPrompt: handleInjectPrompt, onOpenRoute: handleOpenRoute, firstName, weather: homeWeather, skyPrimaryColor, skySecondaryColor, channelChip, freeCreditsOffer, anchorRef, onAnchorLayout: measureSkyAnchor }) }) }) }),
|
|
671
665
|
/* @__PURE__ */ jsx(KeyboardComposerDock, { closedInset: insets.bottom, onSwipeUp: () => {
|
|
672
666
|
var _a2;
|
|
673
667
|
return (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
@@ -682,12 +676,18 @@ function HomeScreenContent({
|
|
|
682
676
|
}], children: voiceError || composerAttachments.error }) }) : null,
|
|
683
677
|
showAudioRecorder ? /* @__PURE__ */ jsx(MicErrorBoundary, { onCancel: handleRecorderCancel, onError: handleRecorderError, children: /* @__PURE__ */ jsx(AudioRecorderPanel, { isDark, onTranscriptionComplete: handleTranscriptionComplete, onCancel: handleRecorderCancel, onError: handleRecorderError }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
684
678
|
/* @__PURE__ */ jsx(ComposerAttachmentBar, { attachments: composerAttachments.pending, onRemove: composerAttachments.remove, isDark }),
|
|
685
|
-
/* @__PURE__ */ jsx(InputToolBar, { inputConfig,
|
|
686
|
-
|
|
687
|
-
|
|
679
|
+
/* @__PURE__ */ jsx(InputToolBar, { inputConfig, leftCustomRender: modeSwitch, rightItems, templateButton, topContent: draftReadable ? /* @__PURE__ */ jsx(TemplateSuggestionBanner, { selectedLabel: selectedTemplateGroup ? (_l = bannerGroup == null ? void 0 : bannerGroup.label) != null ? _l : null : null, suggestedLabel: selectedTemplateGroup ? null : (_m = bannerGroup == null ? void 0 : bannerGroup.label) != null ? _m : null, description: bannerGroup == null ? void 0 : bannerGroup.description, isAnalyzing: analyzingQuery, onChange: () => {
|
|
680
|
+
dismissKeyboard();
|
|
681
|
+
setGroupPickerOpen(true);
|
|
682
|
+
}, palette: buildColors }) : null, micSendButton }, composerEpoch)
|
|
683
|
+
] })
|
|
688
684
|
] }) })
|
|
689
685
|
] }) }),
|
|
690
686
|
attachMenu,
|
|
687
|
+
/* @__PURE__ */ jsx(ChooseTemplateModal, { isOpen: groupPickerOpen, onClose: () => setGroupPickerOpen(false), templates: marketplaceTemplateGroups, selectedId: selectedTemplateGroup, suggestedId: suggestedGroupId, onSelect: (id) => {
|
|
688
|
+
handleSelectTemplateGroup(id);
|
|
689
|
+
setGroupPickerOpen(false);
|
|
690
|
+
}, title: "Choose Template", isDark }),
|
|
691
691
|
/* @__PURE__ */ jsx(ChatModelSheet, { visible: showModelSheet, isDark, orgName: effectiveOrgName, projectId: effectiveProjectId, onClose: () => setShowModelSheet(false) }),
|
|
692
692
|
/* @__PURE__ */ jsx(ConnectAppsSheet, { visible: connectSheet !== null, isDark, initialChannel: connectSheet == null ? void 0 : connectSheet.channel, ensureChatSessionId, onClose: closeConnectSheet })
|
|
693
693
|
] });
|
|
@@ -703,48 +703,34 @@ const styles = StyleSheet.create({
|
|
|
703
703
|
justifyContent: "center",
|
|
704
704
|
paddingVertical: 24
|
|
705
705
|
},
|
|
706
|
+
// The gallery reads top-down from under the header, in the web's 20px gutters.
|
|
707
|
+
buildScroll: {
|
|
708
|
+
paddingHorizontal: 20,
|
|
709
|
+
justifyContent: "flex-start",
|
|
710
|
+
paddingTop: 20
|
|
711
|
+
},
|
|
706
712
|
emptyScrollKeyboardOpen: {
|
|
707
713
|
justifyContent: "flex-start",
|
|
708
714
|
paddingTop: 12,
|
|
709
715
|
paddingBottom: 8
|
|
710
716
|
},
|
|
711
|
-
emptyInner: {
|
|
712
|
-
alignItems: "center",
|
|
713
|
-
width: "100%"
|
|
714
|
-
},
|
|
715
717
|
homeInner: {
|
|
716
718
|
alignItems: "flex-start",
|
|
717
719
|
width: "100%",
|
|
718
720
|
maxWidth: 560,
|
|
719
721
|
alignSelf: "center"
|
|
720
722
|
},
|
|
723
|
+
buildInner: {
|
|
724
|
+
width: "100%",
|
|
725
|
+
maxWidth: 720,
|
|
726
|
+
alignSelf: "center"
|
|
727
|
+
},
|
|
721
728
|
dismissArea: {
|
|
722
729
|
width: "100%"
|
|
723
730
|
},
|
|
724
731
|
anchor: {
|
|
725
732
|
width: "100%"
|
|
726
733
|
},
|
|
727
|
-
emptyCenterTitle: {
|
|
728
|
-
fontSize: 28,
|
|
729
|
-
fontWeight: "700",
|
|
730
|
-
textAlign: "center",
|
|
731
|
-
letterSpacing: -0.5
|
|
732
|
-
},
|
|
733
|
-
emptyCenterTitleCompact: {
|
|
734
|
-
fontSize: 22
|
|
735
|
-
},
|
|
736
|
-
emptySubtitle: {
|
|
737
|
-
marginTop: 8,
|
|
738
|
-
fontSize: 15,
|
|
739
|
-
lineHeight: 22,
|
|
740
|
-
textAlign: "center",
|
|
741
|
-
maxWidth: 320
|
|
742
|
-
},
|
|
743
|
-
emptySubtitleCompact: {
|
|
744
|
-
marginTop: 4,
|
|
745
|
-
fontSize: 13,
|
|
746
|
-
lineHeight: 18
|
|
747
|
-
},
|
|
748
734
|
composerInner: {
|
|
749
735
|
paddingHorizontal: 14,
|
|
750
736
|
paddingTop: 4
|