@adminide-stack/yantra-mobile 12.0.196-alpha.0 → 12.0.196-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/CustomDrawer.js +17 -1
- package/lib/components/CustomDrawer.js.map +1 -1
- package/lib/compute.js +57 -1
- package/lib/compute.js.map +1 -1
- package/lib/config/env-config.js +11 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/features/agent-chat/NativeAgentChat.js +7 -0
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/canvas/extendVideo.js +5 -1
- package/lib/features/canvas/extendVideo.js.map +1 -1
- package/lib/features/canvas/workflow/StepSheet.js +18 -1
- package/lib/features/canvas/workflow/StepSheet.js.map +1 -1
- package/lib/features/canvas/workflow/workflowSteps.js +102 -31
- package/lib/features/canvas/workflow/workflowSteps.js.map +1 -1
- package/lib/features/chat/ComposerMicSend.js +35 -0
- package/lib/features/chat/ComposerMicSend.js.map +1 -0
- package/lib/features/chat/ComposerModeSwitch.js +64 -1
- package/lib/features/chat/ComposerModeSwitch.js.map +1 -1
- package/lib/features/chat/askUser.js +6 -1
- package/lib/features/chat/askUser.js.map +1 -1
- package/lib/features/connectors/ConnectorSheet.js +443 -0
- package/lib/features/connectors/ConnectorSheet.js.map +1 -0
- package/lib/features/connectors/ConnectorsPage.js +320 -0
- package/lib/features/connectors/ConnectorsPage.js.map +1 -0
- package/lib/features/connectors/connectConnector.js +278 -0
- package/lib/features/connectors/connectConnector.js.map +1 -0
- package/lib/features/connectors/connectorCatalog.js +222 -0
- package/lib/features/connectors/connectorCatalog.js.map +1 -0
- package/lib/features/connectors/useConnectorCatalog.js +153 -0
- package/lib/features/connectors/useConnectorCatalog.js.map +1 -0
- package/lib/features/home/needsYou/HomeNeedsYou.js +618 -0
- package/lib/features/home/needsYou/HomeNeedsYou.js.map +1 -0
- package/lib/features/home/needsYou/chatFollowUps.js +333 -0
- package/lib/features/home/needsYou/chatFollowUps.js.map +1 -0
- package/lib/features/home/needsYou/format.js +47 -0
- package/lib/features/home/needsYou/format.js.map +1 -0
- package/lib/features/home/needsYou/historyText.js +40 -0
- package/lib/features/home/needsYou/historyText.js.map +1 -0
- package/lib/features/home/needsYou/inboxHighlights.js +152 -0
- package/lib/features/home/needsYou/inboxHighlights.js.map +1 -0
- package/lib/features/home/needsYou/panelsSettings.js +71 -0
- package/lib/features/home/needsYou/panelsSettings.js.map +1 -0
- package/lib/features/home/needsYou/ported/commandConfirmProtocol.js +13 -0
- package/lib/features/home/needsYou/ported/commandConfirmProtocol.js.map +1 -0
- package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js +91 -0
- package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js.map +1 -0
- package/lib/features/home/needsYou/ported/resultCardModels.js +659 -0
- package/lib/features/home/needsYou/ported/resultCardModels.js.map +1 -0
- package/lib/features/home/needsYou/types.js +1 -0
- package/lib/features/home/needsYou/types.js.map +1 -0
- package/lib/features/home/needsYou/useChatFollowUps.js +149 -0
- package/lib/features/home/needsYou/useChatFollowUps.js.map +1 -0
- package/lib/features/home/needsYou/useHomeBriefing.js +68 -0
- package/lib/features/home/needsYou/useHomeBriefing.js.map +1 -0
- package/lib/features/home/needsYou/useInboxHighlights.js +173 -0
- package/lib/features/home/needsYou/useInboxHighlights.js.map +1 -0
- package/lib/features/home/needsYou/usePanelsSettings.js +105 -0
- package/lib/features/home/needsYou/usePanelsSettings.js.map +1 -0
- package/lib/features/shopping/DealCard.js +8 -1
- package/lib/features/shopping/DealCard.js.map +1 -1
- package/lib/features/shopping/DealRails.js +24 -7
- package/lib/features/shopping/DealRails.js.map +1 -1
- package/lib/features/shopping/DealsPanel.js +1 -1
- package/lib/features/shopping/DealsPanel.js.map +1 -1
- package/lib/features/shopping/HolidayDealsPanel.js +529 -0
- package/lib/features/shopping/HolidayDealsPanel.js.map +1 -0
- package/lib/features/shopping/HolidayDealsParts.js +954 -0
- package/lib/features/shopping/HolidayDealsParts.js.map +1 -0
- package/lib/features/shopping/HolidayOffers.js +351 -0
- package/lib/features/shopping/HolidayOffers.js.map +1 -0
- package/lib/features/shopping/ProductCard.js +80 -14
- package/lib/features/shopping/ProductCard.js.map +1 -1
- package/lib/features/shopping/ProductDetailSheet.js +22 -3
- package/lib/features/shopping/ProductDetailSheet.js.map +1 -1
- package/lib/features/shopping/SavedPanel.js +341 -5
- package/lib/features/shopping/SavedPanel.js.map +1 -1
- package/lib/features/shopping/SearchResults.js +8 -2
- package/lib/features/shopping/SearchResults.js.map +1 -1
- package/lib/features/shopping/ShoppingAgentChatPane.js +12 -0
- package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
- package/lib/features/shopping/ShoppingExperience.js +56 -19
- package/lib/features/shopping/ShoppingExperience.js.map +1 -1
- package/lib/features/shopping/TrendingSections.js +13 -4
- package/lib/features/shopping/TrendingSections.js.map +1 -1
- package/lib/features/shopping/WatchlistPanel.js +61 -5
- package/lib/features/shopping/WatchlistPanel.js.map +1 -1
- package/lib/features/shopping/catalog.js +41 -2
- package/lib/features/shopping/catalog.js.map +1 -1
- package/lib/features/shopping/chat/brainRouter.js +14 -0
- package/lib/features/shopping/chat/brainRouter.js.map +1 -1
- package/lib/features/shopping/chat/shoppingTurn.js +88 -16
- package/lib/features/shopping/chat/shoppingTurn.js.map +1 -1
- package/lib/features/shopping/hooks/useHolidayDeals.js +388 -0
- package/lib/features/shopping/hooks/useHolidayDeals.js.map +1 -0
- package/lib/features/shopping/hooks/useProductMedia.js +33 -6
- package/lib/features/shopping/hooks/useProductMedia.js.map +1 -1
- package/lib/features/shopping/hooks/useShoppingHistorySync.js +8 -4
- package/lib/features/shopping/hooks/useShoppingHistorySync.js.map +1 -1
- package/lib/features/shopping/hooks/useTrendingProducts.js +11 -3
- package/lib/features/shopping/hooks/useTrendingProducts.js.map +1 -1
- package/lib/features/shopping/savedProducts.js +76 -6
- package/lib/features/shopping/savedProducts.js.map +1 -1
- package/lib/features/shopping/services/aiRelevance.js +212 -0
- package/lib/features/shopping/services/aiRelevance.js.map +1 -0
- package/lib/features/shopping/services/blackFriday.js +301 -0
- package/lib/features/shopping/services/blackFriday.js.map +1 -0
- package/lib/features/shopping/services/blackFridayBrowserSites.js +137 -0
- package/lib/features/shopping/services/blackFridayBrowserSites.js.map +1 -0
- package/lib/features/shopping/services/catalogProductSearch.js +21 -3
- package/lib/features/shopping/services/catalogProductSearch.js.map +1 -1
- package/lib/features/shopping/services/holidayDeals.js +143 -0
- package/lib/features/shopping/services/holidayDeals.js.map +1 -0
- package/lib/features/shopping/services/mediaShape.js +7 -0
- package/lib/features/shopping/services/mediaShape.js.map +1 -0
- package/lib/features/shopping/services/modelStep.js +95 -0
- package/lib/features/shopping/services/modelStep.js.map +1 -0
- package/lib/features/shopping/services/modelWords.js +14 -0
- package/lib/features/shopping/services/modelWords.js.map +1 -0
- package/lib/features/shopping/services/productAvailability.js +5 -1
- package/lib/features/shopping/services/productAvailability.js.map +1 -1
- package/lib/features/shopping/services/productFilters.js +2 -2
- package/lib/features/shopping/services/productFilters.js.map +1 -1
- package/lib/features/shopping/services/productMedia.js +103 -18
- package/lib/features/shopping/services/productMedia.js.map +1 -1
- package/lib/features/shopping/services/retailerUrl.js +11 -8
- package/lib/features/shopping/services/retailerUrl.js.map +1 -1
- package/lib/features/shopping/services/salesDealsStore.js +3 -2
- package/lib/features/shopping/services/salesDealsStore.js.map +1 -1
- package/lib/features/shopping/services/savedReads.js +82 -0
- package/lib/features/shopping/services/savedReads.js.map +1 -0
- package/lib/features/shopping/services/searchCardFields.js +2 -0
- package/lib/features/shopping/services/searchCardFields.js.map +1 -1
- package/lib/features/shopping/services/searchRelevance.js +154 -24
- package/lib/features/shopping/services/searchRelevance.js.map +1 -1
- package/lib/features/shopping/services/secondHand.js +12 -0
- package/lib/features/shopping/services/secondHand.js.map +1 -0
- package/lib/features/shopping/services/shoppingProductSearch.js +82 -10
- package/lib/features/shopping/services/shoppingProductSearch.js.map +1 -1
- package/lib/features/shopping/services/shoppingSearchConnectorClient.js +14 -1
- package/lib/features/shopping/services/shoppingSearchConnectorClient.js.map +1 -1
- package/lib/features/shopping/services/shoppingSubgraph.js +2 -1
- package/lib/features/shopping/services/shoppingSubgraph.js.map +1 -1
- package/lib/features/shopping/services/storedGalleries.js +130 -0
- package/lib/features/shopping/services/storedGalleries.js.map +1 -0
- package/lib/features/shopping/services/usedSites.js +263 -0
- package/lib/features/shopping/services/usedSites.js.map +1 -0
- package/lib/features/shopping/services/verifyProducts.js +3 -3
- package/lib/features/shopping/services/verifyProducts.js.map +1 -1
- package/lib/features/shopping/services/watchDeal.js +61 -0
- package/lib/features/shopping/services/watchDeal.js.map +1 -0
- package/lib/features/shopping/shoppingRuntime.js +7 -2
- package/lib/features/shopping/shoppingRuntime.js.map +1 -1
- package/lib/features/shopping/state/accountCaches.js +20 -0
- package/lib/features/shopping/state/accountCaches.js.map +1 -0
- package/lib/features/shopping/state/holidayDealsRequest.js +22 -0
- package/lib/features/shopping/state/holidayDealsRequest.js.map +1 -0
- package/lib/features/shopping/tutorials/ShoppingTutorialDock.js +1 -1
- package/lib/features/shopping/tutorials/ShoppingTutorialDock.js.map +1 -1
- package/lib/features/shopping/tutorials/shoppingTutorials.js +2 -0
- package/lib/features/shopping/tutorials/shoppingTutorials.js.map +1 -1
- package/lib/features/shopping/useShoppingSearch.js +74 -18
- package/lib/features/shopping/useShoppingSearch.js.map +1 -1
- package/lib/features/team-chat/TeamChatExperience.js +474 -0
- package/lib/features/team-chat/TeamChatExperience.js.map +1 -0
- package/lib/features/team-chat/api/client.js +198 -0
- package/lib/features/team-chat/api/client.js.map +1 -0
- package/lib/features/team-chat/api/live.js +160 -0
- package/lib/features/team-chat/api/live.js.map +1 -0
- package/lib/features/team-chat/api/ops.js +241 -0
- package/lib/features/team-chat/api/ops.js.map +1 -0
- package/lib/features/team-chat/app.js +12 -0
- package/lib/features/team-chat/app.js.map +1 -0
- package/lib/features/team-chat/components/Avatar.js +107 -0
- package/lib/features/team-chat/components/Avatar.js.map +1 -0
- package/lib/features/team-chat/components/Composer.js +641 -0
- package/lib/features/team-chat/components/Composer.js.map +1 -0
- package/lib/features/team-chat/components/Dialogs.js +598 -0
- package/lib/features/team-chat/components/Dialogs.js.map +1 -0
- package/lib/features/team-chat/components/EmojiPicker.js +165 -0
- package/lib/features/team-chat/components/EmojiPicker.js.map +1 -0
- package/lib/features/team-chat/components/MessageItem.js +658 -0
- package/lib/features/team-chat/components/MessageItem.js.map +1 -0
- package/lib/features/team-chat/components/MessageList.js +248 -0
- package/lib/features/team-chat/components/MessageList.js.map +1 -0
- package/lib/features/team-chat/components/Mrkdwn.js +228 -0
- package/lib/features/team-chat/components/Mrkdwn.js.map +1 -0
- package/lib/features/team-chat/components/QuickSwitcher.js +215 -0
- package/lib/features/team-chat/components/QuickSwitcher.js.map +1 -0
- package/lib/features/team-chat/components/ui.js +662 -0
- package/lib/features/team-chat/components/ui.js.map +1 -0
- package/lib/features/team-chat/nativeTeamChatRegistry.js +15 -0
- package/lib/features/team-chat/nativeTeamChatRegistry.js.map +1 -0
- package/lib/features/team-chat/state/fetched.js +39 -0
- package/lib/features/team-chat/state/fetched.js.map +1 -0
- package/lib/features/team-chat/state/lists.js +230 -0
- package/lib/features/team-chat/state/lists.js.map +1 -0
- package/lib/features/team-chat/state/store.js +1108 -0
- package/lib/features/team-chat/state/store.js.map +1 -0
- package/lib/features/team-chat/state/useChannelDirectory.js +21 -0
- package/lib/features/team-chat/state/useChannelDirectory.js.map +1 -0
- package/lib/features/team-chat/theme.js +77 -0
- package/lib/features/team-chat/theme.js.map +1 -0
- package/lib/features/team-chat/utils/composeText.js +72 -0
- package/lib/features/team-chat/utils/composeText.js.map +1 -0
- package/lib/features/team-chat/utils/emoji.js +369 -0
- package/lib/features/team-chat/utils/emoji.js.map +1 -0
- package/lib/features/team-chat/utils/format.js +109 -0
- package/lib/features/team-chat/utils/format.js.map +1 -0
- package/lib/features/team-chat/utils/messageRows.js +24 -0
- package/lib/features/team-chat/utils/messageRows.js.map +1 -0
- package/lib/features/team-chat/utils/mrkdwn.js +222 -0
- package/lib/features/team-chat/utils/mrkdwn.js.map +1 -0
- package/lib/features/team-chat/utils/notify.js +47 -0
- package/lib/features/team-chat/utils/notify.js.map +1 -0
- package/lib/features/team-chat/utils/pickFiles.js +81 -0
- package/lib/features/team-chat/utils/pickFiles.js.map +1 -0
- package/lib/features/team-chat/views/ActivityView.js +235 -0
- package/lib/features/team-chat/views/ActivityView.js.map +1 -0
- package/lib/features/team-chat/views/BrowseView.js +179 -0
- package/lib/features/team-chat/views/BrowseView.js.map +1 -0
- package/lib/features/team-chat/views/ChannelView.js +475 -0
- package/lib/features/team-chat/views/ChannelView.js.map +1 -0
- package/lib/features/team-chat/views/DetailsPane.js +816 -0
- package/lib/features/team-chat/views/DetailsPane.js.map +1 -0
- package/lib/features/team-chat/views/DraftsView.js +212 -0
- package/lib/features/team-chat/views/DraftsView.js.map +1 -0
- package/lib/features/team-chat/views/FilesView.js +152 -0
- package/lib/features/team-chat/views/FilesView.js.map +1 -0
- package/lib/features/team-chat/views/NewMessageView.js +286 -0
- package/lib/features/team-chat/views/NewMessageView.js.map +1 -0
- package/lib/features/team-chat/views/PeopleView.js +118 -0
- package/lib/features/team-chat/views/PeopleView.js.map +1 -0
- package/lib/features/team-chat/views/ProfilePane.js +220 -0
- package/lib/features/team-chat/views/ProfilePane.js.map +1 -0
- package/lib/features/team-chat/views/SavedView.js +113 -0
- package/lib/features/team-chat/views/SavedView.js.map +1 -0
- package/lib/features/team-chat/views/SearchView.js +307 -0
- package/lib/features/team-chat/views/SearchView.js.map +1 -0
- package/lib/features/team-chat/views/Sidebar.js +368 -0
- package/lib/features/team-chat/views/Sidebar.js.map +1 -0
- package/lib/features/team-chat/views/ThreadPane.js +139 -0
- package/lib/features/team-chat/views/ThreadPane.js.map +1 -0
- package/lib/features/team-chat/views/ThreadsView.js +157 -0
- package/lib/features/team-chat/views/ThreadsView.js.map +1 -0
- package/lib/features/webbuilder/WebBuilderExperience.js +276 -42
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +10 -4
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/components/AssetChips.js +61 -0
- package/lib/features/webbuilder/components/AssetChips.js.map +1 -0
- package/lib/features/webbuilder/components/AssetSiteChooser.js +100 -0
- package/lib/features/webbuilder/components/AssetSiteChooser.js.map +1 -0
- package/lib/features/webbuilder/components/CommentsLayer.js +485 -0
- package/lib/features/webbuilder/components/CommentsLayer.js.map +1 -0
- package/lib/features/webbuilder/components/Composer.js +16 -2
- package/lib/features/webbuilder/components/Composer.js.map +1 -1
- package/lib/features/webbuilder/components/ComposerModeSwitch.js +71 -0
- package/lib/features/webbuilder/components/ComposerModeSwitch.js.map +1 -0
- package/lib/features/webbuilder/components/MyAssetsPicker.js +500 -0
- package/lib/features/webbuilder/components/MyAssetsPicker.js.map +1 -0
- package/lib/features/webbuilder/components/PlanDocument.js +165 -0
- package/lib/features/webbuilder/components/PlanDocument.js.map +1 -0
- package/lib/features/webbuilder/components/PlanDraftCard.js +205 -0
- package/lib/features/webbuilder/components/PlanDraftCard.js.map +1 -0
- package/lib/features/webbuilder/components/PlanView.js +788 -0
- package/lib/features/webbuilder/components/PlanView.js.map +1 -0
- package/lib/features/webbuilder/components/PreviewConsoleSheet.js +334 -0
- package/lib/features/webbuilder/components/PreviewConsoleSheet.js.map +1 -0
- package/lib/features/webbuilder/components/PreviewFrame.js +45 -3
- package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewScreen.js +94 -10
- package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +84 -14
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/components/StudioHome.js +69 -6
- package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
- package/lib/features/webbuilder/components/StyleDirectionsSheet.js +291 -0
- package/lib/features/webbuilder/components/StyleDirectionsSheet.js.map +1 -0
- package/lib/features/webbuilder/components/VersionChangesView.js +574 -0
- package/lib/features/webbuilder/components/VersionChangesView.js.map +1 -0
- package/lib/features/webbuilder/components/VersionPreviewView.js +186 -0
- package/lib/features/webbuilder/components/VersionPreviewView.js.map +1 -0
- package/lib/features/webbuilder/components/VersionsSheet.js +673 -16
- package/lib/features/webbuilder/components/VersionsSheet.js.map +1 -1
- package/lib/features/webbuilder/connectorTemplates.js +6 -1
- package/lib/features/webbuilder/connectorTemplates.js.map +1 -1
- package/lib/features/webbuilder/myAssets.js +101 -0
- package/lib/features/webbuilder/myAssets.js.map +1 -0
- package/lib/features/webbuilder/planChat.js +146 -0
- package/lib/features/webbuilder/planChat.js.map +1 -0
- package/lib/features/webbuilder/planDocument.js +89 -0
- package/lib/features/webbuilder/planDocument.js.map +1 -0
- package/lib/features/webbuilder/planStore.js +55 -0
- package/lib/features/webbuilder/planStore.js.map +1 -0
- package/lib/features/webbuilder/previewCommentsScript.js +218 -0
- package/lib/features/webbuilder/previewCommentsScript.js.map +1 -0
- package/lib/features/webbuilder/previewConsoleScript.js +39 -0
- package/lib/features/webbuilder/previewConsoleScript.js.map +1 -0
- package/lib/features/webbuilder/styleDirections.js +85 -0
- package/lib/features/webbuilder/styleDirections.js.map +1 -0
- package/lib/features/webbuilder/useCanvasComments.js +335 -0
- package/lib/features/webbuilder/useCanvasComments.js.map +1 -0
- package/lib/features/webbuilder/useCatalogTemplates.js +37 -0
- package/lib/features/webbuilder/useCatalogTemplates.js.map +1 -0
- package/lib/features/webbuilder/usePlanMode.js +145 -0
- package/lib/features/webbuilder/usePlanMode.js.map +1 -0
- package/lib/features/webbuilder/useStyleDirections.js +112 -0
- package/lib/features/webbuilder/useStyleDirections.js.map +1 -0
- package/lib/features/webbuilder/web/assets/assetsApi.js +174 -0
- package/lib/features/webbuilder/web/assets/assetsApi.js.map +1 -0
- package/lib/features/webbuilder/web/assets/assetsApi.ts +173 -0
- package/lib/features/webbuilder/web/assets/myAssets.js +341 -0
- package/lib/features/webbuilder/web/assets/myAssets.js.map +1 -0
- package/lib/features/webbuilder/web/assets/myAssets.ts +396 -0
- package/lib/features/webbuilder/web/canvas/elementName.js +46 -0
- package/lib/features/webbuilder/web/canvas/elementName.js.map +1 -0
- package/lib/features/webbuilder/web/canvas/visualEditorBridge.js +95 -0
- package/lib/features/webbuilder/web/canvas/visualEditorBridge.js.map +1 -0
- package/lib/features/webbuilder/web/chat/agentTurn.js +24 -0
- package/lib/features/webbuilder/web/chat/agentTurn.js.map +1 -0
- package/lib/features/webbuilder/web/chat/planMode.js +164 -0
- package/lib/features/webbuilder/web/chat/planMode.js.map +1 -0
- package/lib/features/webbuilder/web/chat/realPlans.js +66 -0
- package/lib/features/webbuilder/web/chat/realPlans.js.map +1 -0
- package/lib/features/webbuilder/web/comments/comments.js +336 -0
- package/lib/features/webbuilder/web/comments/comments.js.map +1 -0
- package/lib/features/webbuilder/web/comments/commentsApi.js +59 -0
- package/lib/features/webbuilder/web/comments/commentsApi.js.map +1 -0
- package/lib/features/webbuilder/web/components/planView.js +21 -0
- package/lib/features/webbuilder/web/components/planView.js.map +1 -0
- package/lib/features/webbuilder/web/console/consolePanel.js +43 -0
- package/lib/features/webbuilder/web/console/consolePanel.js.map +1 -0
- package/lib/features/webbuilder/web/console/previewConsole.js +256 -0
- package/lib/features/webbuilder/web/console/previewConsole.js.map +1 -0
- package/lib/features/webbuilder/web/console/usePreviewConsole.js +147 -0
- package/lib/features/webbuilder/web/console/usePreviewConsole.js.map +1 -0
- package/lib/features/webbuilder/web/design/directions.js +419 -1
- package/lib/features/webbuilder/web/design/directions.js.map +1 -1
- package/lib/features/webbuilder/web/history/diffActions.js +222 -0
- package/lib/features/webbuilder/web/history/diffActions.js.map +1 -0
- package/lib/features/webbuilder/web/history/diffHighlight.js +18 -0
- package/lib/features/webbuilder/web/history/diffHighlight.js.map +1 -0
- package/lib/features/webbuilder/web/history/versionActions.js +272 -0
- package/lib/features/webbuilder/web/history/versionActions.js.map +1 -0
- package/lib/features/webbuilder/web/history/versionDiff.js +338 -0
- package/lib/features/webbuilder/web/history/versionDiff.js.map +1 -0
- package/lib/features/webbuilder/web/history/versionPreview.js +83 -0
- package/lib/features/webbuilder/web/history/versionPreview.js.map +1 -0
- package/lib/features/webbuilder/web/history/versionPreviewMachine.js +150 -0
- package/lib/features/webbuilder/web/history/versionPreviewMachine.js.map +1 -0
- package/lib/features/webbuilder/web/history/versions.js +326 -1
- package/lib/features/webbuilder/web/history/versions.js.map +1 -1
- package/lib/features/webbuilder/web/hosted/hostedTurn.js +36 -0
- package/lib/features/webbuilder/web/hosted/hostedTurn.js.map +1 -0
- package/lib/features/webbuilder/web/studio/brandKit.js +25 -0
- package/lib/features/webbuilder/web/studio/brandKit.js.map +1 -0
- package/lib/features/webbuilder/web/utils/promptSafe.js +15 -0
- package/lib/features/webbuilder/web/utils/promptSafe.js.map +1 -0
- package/lib/features/webbuilder/web/webServices.js +3 -1
- package/lib/features/webbuilder/web/webServices.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/routes.json +55 -0
- package/lib/screens/Account/index.js +13 -5
- package/lib/screens/Account/index.js.map +1 -1
- package/lib/screens/Chat/index.js +16 -0
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Home/HomeScreen.js +202 -39
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/HomeHero.js +52 -38
- package/lib/screens/Home/components/HomeHero.js.map +1 -1
- package/lib/screens/Home/components/homeCatalog.js +8 -1
- package/lib/screens/Home/components/homeCatalog.js.map +1 -1
- package/lib/screens/TeamChat/index.js +41 -0
- package/lib/screens/TeamChat/index.js.map +1 -0
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +9 -2
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
- package/lib/screens/WebBuilderNative/index.js +13 -3
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/useConnectorTemplates.js +2 -2
- package/lib/screens/WebBuilderNative/useConnectorTemplates.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useState,useCallback,useRef,useEffect}from'react';import {StyleSheet,Alert,Linking,Keyboard,BackHandler,View,Text,Share,Clipboard}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {GestureHandlerRootView}from'react-native-gesture-handler';import {useSafeInsets}from'../canvas/withRemoteSafeArea.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {Tap,DIM}from'../inbox/components/Tap.js';import {isBareSeed,studioTurnText,siteScoreTurn}from'./studioCatalog.js';import {brandKitNote,findDesires,importBrandKit}from'../design/surface/brandKit.js';import {useBrandKitInUse}from'../design/surface/useBrandKitInUse.js';import {BrandSheet}from'../design/surface/BrandSheet.js';import {moveLegacyBrandKit}from'./brandKitMove.js';import {titleFromPrompt,displayHost}from'./buildFragments.js';import {parseToolActivity}from'../chat/toolActivity.js';import {friendlySteps,firstContentLanded}from'./stepLabels.js';import {restoreTurnNote}from'./webbuilderPrompts.js';import {webbuilderTheme}from'./webbuilderTheme.js';import {CodeView}from'./components/CodeView.js';import {ProjectChat}from'./components/ProjectChat.js';import {ViewportToggle,PreviewScreen,ViewPicker}from'./components/PreviewScreen.js';import {PublishSheet}from'./components/PublishSheet.js';import {BOTTOM_TABS_SPACE,BottomTabs}from'./components/BottomTabs.js';import {SiteScoreSheet}from'./components/SiteScoreSheet.js';import {ProjectsScreen}from'./components/ProjectsScreen.js';import {TemplatesSheet}from'./components/TemplatesSheet.js';import {StudioHome}from'./components/StudioHome.js';import {VersionsSheet}from'./components/VersionsSheet.js';import {IconButton,Sheet,Toast}from'./components/ui.js';import {exportMessage,exportTurn}from'./exportCode.js';import {ownCloudflareTurn,projectNameOfLiveUrl,plainActionError}from'./publishTools.js';import {SecretsSheet}from'./components/SecretsSheet.js';import {CloudSheet}from'./components/CloudSheet.js';import {MAX_IMAGE_EDIT_BYTES,imageMimeFor}from'./web/code/imageEdit.js';import {useSiteCopyProgress,SiteCopyCard}from'./components/SiteCopyProgress.js';import {heldCopyLine,copyLine}from'./web/chat/siteCopy.js';import {publishDeployCheck}from'./web/publish/siteInsights.js';import {DraftBanner,DraftsSheet}from'./components/DraftsSheet.js';import {draftBuild,createDrafts}from'./drafts.js';import {draftTurnNote}from'./web/project/drafts.js';import {notReadyHint,projectReadiness}from'./readiness.js';import {SiteStatusSheet}from'./components/SiteStatusSheet.js';import {useRetention,RetentionBanner}from'./components/RetentionBanner.js';import {useGithubAutoSync}from'./useGithubAutoSync.js';import {githubSyncStatus,repoNameOf,githubSettingsPatch}from'./web/github/githubSync.js';import {syncChip,canRunSync}from'./web/github/autoSync.js';import {normalizeGithubRepoUrl}from'./web/project/serverSettings.js';import {ShareSheet}from'./components/ShareSheet.js';import {approvalsSettingsUrl}from'./approvalsLink.js';import {NotesSheet}from'./components/NotesSheet.js';import {projectShareLink}from'./web/sharing/shareLink.js';import {ignoresPatch}from'./web/publish/review/ignores.js';import {publishRequestComment}from'./web/publish/publishRequest.js';import {roleCan}from'./web/sharing/roles.js';import {remixSnapshotParams,snapshotIdFromResult,remixSecretsCheck,buildRemixUrl}from'./web/sharing/share.js';import {OutOfCreditsCard,CreditsSheet}from'./components/Credits.js';import {billingPageUrl}from'./creditsLinks.js';import {useWebBuilderCredits}from'./useWebBuilderCredits.js';import {OUT_OF_CREDITS_TITLE,outOfCreditsText,chipLabel}from'./web/credits/credits.js';import {IntegrationsPanel}from'./components/IntegrationsPanel.js';import {createWebServices}from'./web/webServices.js';import {longTurn,turnDoneText}from'./web/notify/turnDone.js';import {liveSiteDeleteTools}from'./liveSiteDelete.js';import {CdecliConnectionContext}from'../../contexts/cdecliConnection.js';import {websiteImportBrief}from'./web/import/websiteImport.js';import {siteForLink}from'./web/upload/sitePhotos.js';import {AppPhoneSheet}from'./components/AppPhoneSheet.js';import {SiteUploadSheet}from'./components/SiteUploadSheet.js';import {GithubConnectSheet}from'./components/GithubConnectSheet.js';import {needsGithubConnection}from'./web/github/githubConnect.js';import {useUploadCard}from'./uploadCard.js';import {setupPhase}from'./web/preview/setupPhase.js';import {ProjectMenuSheet,ProjectSettingsSheet,GithubPushSheet,IntegrationsSheet,ImportProjectSheet}from'./components/ProjectSheets.js';import {isUserOwnedRepo,CODEZEN_NEEDS_GITHUB,codezenRepoHandoff,codezenRepoFragment,demoVideoSource,webbuilderDemoHandoff,encodeCodezenHandoff}from'./codezenHandoff.js';import {PreviewAccessProvider,openPreviewInBrowser}from'./usePreviewAccess.js';import {probePreviewPrivacy}from'./previewProbe.js';import {siteShareTarget,PRIVATE_SHARE_TITLE,privateShareMessage}from'./shareLink.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useState,useCallback,useRef,useEffect}from'react';import {StyleSheet,Alert,Linking,Keyboard,BackHandler,View,Text,Share,Clipboard}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {GestureHandlerRootView}from'react-native-gesture-handler';import {useSafeInsets}from'../canvas/withRemoteSafeArea.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {Tap,DIM}from'../inbox/components/Tap.js';import {isBareSeed,studioTurnText,siteScoreTurn}from'./studioCatalog.js';import {brandKitNote,findDesires,importBrandKit}from'../design/surface/brandKit.js';import {useBrandKitInUse}from'../design/surface/useBrandKitInUse.js';import {BrandSheet}from'../design/surface/BrandSheet.js';import {moveLegacyBrandKit}from'./brandKitMove.js';import {titleFromPrompt,displayHost}from'./buildFragments.js';import {parseToolActivity}from'../chat/toolActivity.js';import {friendlySteps,firstContentLanded}from'./stepLabels.js';import {restoreTurnNote}from'./webbuilderPrompts.js';import {webbuilderTheme}from'./webbuilderTheme.js';import {CodeView}from'./components/CodeView.js';import {ProjectChat}from'./components/ProjectChat.js';import {ViewportToggle,PreviewScreen,ViewPicker}from'./components/PreviewScreen.js';import {PublishSheet}from'./components/PublishSheet.js';import {BOTTOM_TABS_SPACE,BottomTabs}from'./components/BottomTabs.js';import {SiteScoreSheet}from'./components/SiteScoreSheet.js';import {ProjectsScreen}from'./components/ProjectsScreen.js';import {TemplatesSheet}from'./components/TemplatesSheet.js';import {StudioHome}from'./components/StudioHome.js';import {VersionsSheet}from'./components/VersionsSheet.js';import {IconButton,Sheet,Toast}from'./components/ui.js';import {exportMessage,exportTurn}from'./exportCode.js';import {ownCloudflareTurn,projectNameOfLiveUrl,plainActionError}from'./publishTools.js';import {SecretsSheet}from'./components/SecretsSheet.js';import {CloudSheet}from'./components/CloudSheet.js';import {MAX_IMAGE_EDIT_BYTES,imageMimeFor}from'./web/code/imageEdit.js';import {useSiteCopyProgress,SiteCopyCard}from'./components/SiteCopyProgress.js';import {heldCopyLine,copyLine}from'./web/chat/siteCopy.js';import {publishDeployCheck}from'./web/publish/siteInsights.js';import {DraftBanner,DraftsSheet}from'./components/DraftsSheet.js';import {draftBuild,createDrafts}from'./drafts.js';import {draftTurnNote}from'./web/project/drafts.js';import {sandboxRunner}from'./web/history/diffActions.js';import {restoreManualEdit}from'./web/history/versions.js';import {parseProjectSettings}from'./projectTools.js';import {notReadyHint,projectReadiness}from'./readiness.js';import {SiteStatusSheet}from'./components/SiteStatusSheet.js';import {useRetention,RetentionBanner}from'./components/RetentionBanner.js';import {useGithubAutoSync}from'./useGithubAutoSync.js';import {githubSyncStatus,repoNameOf,githubSettingsPatch}from'./web/github/githubSync.js';import {syncChip,canRunSync}from'./web/github/autoSync.js';import {normalizeGithubRepoUrl}from'./web/project/serverSettings.js';import {ShareSheet}from'./components/ShareSheet.js';import {approvalsSettingsUrl}from'./approvalsLink.js';import {NotesSheet}from'./components/NotesSheet.js';import {projectShareLink}from'./web/sharing/shareLink.js';import {ignoresPatch}from'./web/publish/review/ignores.js';import {publishRequestComment}from'./web/publish/publishRequest.js';import {roleCan}from'./web/sharing/roles.js';import {remixSnapshotParams,snapshotIdFromResult,remixSecretsCheck,buildRemixUrl}from'./web/sharing/share.js';import {OutOfCreditsCard,CreditsSheet}from'./components/Credits.js';import {billingPageUrl}from'./creditsLinks.js';import {useWebBuilderCredits}from'./useWebBuilderCredits.js';import {OUT_OF_CREDITS_TITLE,outOfCreditsText,chipLabel}from'./web/credits/credits.js';import {IntegrationsPanel}from'./components/IntegrationsPanel.js';import {createWebServices}from'./web/webServices.js';import {longTurn,turnDoneText}from'./web/notify/turnDone.js';import {liveSiteDeleteTools}from'./liveSiteDelete.js';import {useCatalogTemplates}from'./useCatalogTemplates.js';import {CdecliConnectionContext}from'../../contexts/cdecliConnection.js';import {websiteImportBrief}from'./web/import/websiteImport.js';import {siteForLink}from'./web/upload/sitePhotos.js';import {AppPhoneSheet}from'./components/AppPhoneSheet.js';import {SiteUploadSheet}from'./components/SiteUploadSheet.js';import {GithubConnectSheet}from'./components/GithubConnectSheet.js';import {needsGithubConnection}from'./web/github/githubConnect.js';import {useUploadCard}from'./uploadCard.js';import {setupPhase}from'./web/preview/setupPhase.js';import {ProjectMenuSheet,ProjectSettingsSheet,GithubPushSheet,IntegrationsSheet,ImportProjectSheet}from'./components/ProjectSheets.js';import {isUserOwnedRepo,CODEZEN_NEEDS_GITHUB,codezenRepoHandoff,codezenRepoFragment,demoVideoSource,webbuilderDemoHandoff,encodeCodezenHandoff}from'./codezenHandoff.js';import {PreviewAccessProvider,openPreviewInBrowser}from'./usePreviewAccess.js';import {probePreviewPrivacy}from'./previewProbe.js';import {siteShareTarget,PRIVATE_SHARE_TITLE,privateShareMessage}from'./shareLink.js';import {usePlanMode}from'./usePlanMode.js';import {PlanView}from'./components/PlanView.js';import {withAgentNotes}from'./web/chat/agentTurn.js';import {createAssetsService,assetsRunnerOf}from'./web/assets/assetsApi.js';import {withPermanentLogo}from'./web/studio/brandKit.js';import {assetAttachments,withAssetNotes}from'./myAssets.js';import {AssetSiteChooser}from'./components/AssetSiteChooser.js';import {useStyleDirections}from'./useStyleDirections.js';import {startStyle,styleGateBrief,withStyleDirection,styleGateDisabledReason}from'./styleDirections.js';import {StyleDirectionsSheet}from'./components/StyleDirectionsSheet.js';import {PreviewConsoleSheet}from'./components/PreviewConsoleSheet.js';import {usePreviewConsole}from'./web/console/usePreviewConsole.js';import {fixErrorFromEntry}from'./web/console/previewConsole.js';import {fixTurnText}from'./web/publish/siteHealth.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -36,7 +36,7 @@ function WebBuilderExperience({
|
|
|
36
36
|
onRefreshProjects,
|
|
37
37
|
projectsHasMore = false,
|
|
38
38
|
onLoadMoreProjects,
|
|
39
|
-
templates,
|
|
39
|
+
templates: hostTemplates,
|
|
40
40
|
templatesLoading = false,
|
|
41
41
|
templatesError = null,
|
|
42
42
|
onReloadTemplates,
|
|
@@ -63,12 +63,15 @@ function WebBuilderExperience({
|
|
|
63
63
|
projectTools,
|
|
64
64
|
code,
|
|
65
65
|
initialAgentSeed = null,
|
|
66
|
+
incomingAsset = null,
|
|
67
|
+
onIncomingAssetDone,
|
|
66
68
|
uploadLink = null,
|
|
67
69
|
onUploadLinkDone,
|
|
68
70
|
previewAccess,
|
|
69
71
|
agentConnection = null
|
|
70
72
|
}) {
|
|
71
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T;
|
|
73
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z;
|
|
74
|
+
const templates = useCatalogTemplates(hostTemplates, brandTools == null ? void 0 : brandTools.run);
|
|
72
75
|
const appTheme = useAppTheme();
|
|
73
76
|
const isDark = hostIsDark != null ? hostIsDark : appTheme.isDark;
|
|
74
77
|
const theme = useMemo(() => webbuilderTheme(isDark), [isDark]);
|
|
@@ -91,6 +94,17 @@ function WebBuilderExperience({
|
|
|
91
94
|
credits.showCard();
|
|
92
95
|
return true;
|
|
93
96
|
}, [credits]);
|
|
97
|
+
const assetsRun = brandTools == null ? void 0 : brandTools.run;
|
|
98
|
+
const assetsService = useMemo(() => assetsRun ? createAssetsService(assetsRunnerOf(assetsRun)) : void 0, [assetsRun]);
|
|
99
|
+
const brandSave = brandKits.save;
|
|
100
|
+
const keepLogoInBrandKit = useCallback((item) => {
|
|
101
|
+
const next = item.permanent ? withPermanentLogo(brand, item.url) : null;
|
|
102
|
+
if (next) brandSave(next).catch(() => void 0);
|
|
103
|
+
}, [brand, brandSave]);
|
|
104
|
+
const [assetPrefill, setAssetPrefill] = useState(null);
|
|
105
|
+
const assetNonce = useRef(0);
|
|
106
|
+
const assetPrefillDone = useCallback(() => setAssetPrefill(null), []);
|
|
107
|
+
const recentSites = useMemo(() => [...projects].sort((a, b) => b.updatedAt - a.updatedAt), [projects]);
|
|
94
108
|
const brandMoved = useRef(false);
|
|
95
109
|
useEffect(() => {
|
|
96
110
|
if (brandMoved.current || !brandTools || brandKits.loading || brandKits.error) return;
|
|
@@ -125,31 +139,63 @@ function WebBuilderExperience({
|
|
|
125
139
|
}]);
|
|
126
140
|
return true;
|
|
127
141
|
}, [credits, projectTools == null ? void 0 : projectTools.appUrl]);
|
|
128
|
-
const
|
|
142
|
+
const styleDirections = useStyleDirections({
|
|
143
|
+
connection: agentConnection,
|
|
144
|
+
channelId: activeChannelId
|
|
145
|
+
});
|
|
146
|
+
const {
|
|
147
|
+
suggestStyles,
|
|
148
|
+
open: openStyles,
|
|
149
|
+
close: closeStyles
|
|
150
|
+
} = styleDirections;
|
|
151
|
+
const startSite = useCallback((start, files, style, onSent) => {
|
|
152
|
+
var _a2, _b2;
|
|
129
153
|
const brief = start.brief.trim() || (start.template ? start.template.chatPrompt || start.template.title : "");
|
|
130
154
|
const copyingSite = Boolean(start.referenceUrl) && start.referenceMode === "copy";
|
|
131
|
-
if (!brief && !(files == null ? void 0 : files.length) && !copyingSite) return;
|
|
132
|
-
if (outOfCredits()) return;
|
|
155
|
+
if (!brief && !(files == null ? void 0 : files.length) && !copyingSite) return false;
|
|
156
|
+
if (outOfCredits()) return false;
|
|
133
157
|
const copying = copyingSite;
|
|
158
|
+
const styled = startStyle({
|
|
159
|
+
copying,
|
|
160
|
+
style,
|
|
161
|
+
suggestStyles
|
|
162
|
+
});
|
|
163
|
+
if (styled.kind === "gate") {
|
|
164
|
+
openStyles(styleGateBrief(start.brief, (_a2 = start.template) == null ? void 0 : _a2.chatPrompt) || brief, {
|
|
165
|
+
start,
|
|
166
|
+
files,
|
|
167
|
+
onSent
|
|
168
|
+
});
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
const text = studioTurnText({
|
|
172
|
+
brief,
|
|
173
|
+
brandBlock: brandOff || copying ? null : brandKitNote(brand) || null,
|
|
174
|
+
referenceUrl: start.referenceUrl,
|
|
175
|
+
referenceMode: start.referenceMode,
|
|
176
|
+
referenceGraphics: start.referenceGraphics
|
|
177
|
+
});
|
|
178
|
+
const sentFiles = [...files != null ? files : [], ...assetAttachments((_b2 = start.assets) != null ? _b2 : [])];
|
|
134
179
|
onStartProject(__spreadValues(__spreadValues(__spreadValues({
|
|
135
|
-
text:
|
|
136
|
-
brief,
|
|
137
|
-
brandBlock: brandOff || copying ? null : brandKitNote(brand) || null,
|
|
138
|
-
referenceUrl: start.referenceUrl,
|
|
139
|
-
referenceMode: start.referenceMode,
|
|
140
|
-
referenceGraphics: start.referenceGraphics
|
|
141
|
-
}),
|
|
180
|
+
text: withAssetNotes(withStyleDirection(text, styled.direction), start.assets),
|
|
142
181
|
template: copying ? null : start.template
|
|
143
182
|
}, copying ? {
|
|
144
183
|
agent: true
|
|
145
184
|
} : {}), start.referenceUrl && !copying ? {
|
|
146
185
|
referenceUrl: start.referenceUrl
|
|
147
|
-
} : {}),
|
|
148
|
-
attachments:
|
|
186
|
+
} : {}), sentFiles.length ? {
|
|
187
|
+
attachments: sentFiles
|
|
149
188
|
} : {}));
|
|
189
|
+
closeStyles();
|
|
190
|
+
onSent == null ? void 0 : onSent();
|
|
150
191
|
setDraft("");
|
|
151
192
|
setTemplate(null);
|
|
152
|
-
|
|
193
|
+
return true;
|
|
194
|
+
}, [onStartProject, brand, brandOff, outOfCredits, suggestStyles, openStyles, closeStyles]);
|
|
195
|
+
const styleGateReason = styleGateDisabledReason({
|
|
196
|
+
blocked: startBlocked,
|
|
197
|
+
busy: Boolean(activeChannelId) && Boolean(hostChat == null ? void 0 : hostChat.busy)
|
|
198
|
+
});
|
|
153
199
|
const startWebsiteCopy = useCallback((url, graphics) => {
|
|
154
200
|
if (outOfCredits()) return false;
|
|
155
201
|
onStartProject({
|
|
@@ -166,7 +212,9 @@ function WebBuilderExperience({
|
|
|
166
212
|
startSite({
|
|
167
213
|
brief: initialAgentSeed.text,
|
|
168
214
|
template: null
|
|
169
|
-
}, initialAgentSeed.files
|
|
215
|
+
}, initialAgentSeed.files, {
|
|
216
|
+
skip: true
|
|
217
|
+
});
|
|
170
218
|
}, [initialAgentSeed, startBlocked, startSite]);
|
|
171
219
|
const [selectedKey, setSelectedKey] = useState(null);
|
|
172
220
|
useEffect(() => setSelectedKey(null), [activeChannelId]);
|
|
@@ -178,9 +226,21 @@ function WebBuilderExperience({
|
|
|
178
226
|
const [openDraft, setOpenDraft] = useState(null);
|
|
179
227
|
useEffect(() => setOpenDraft(null), [activeChannelId]);
|
|
180
228
|
const build = useMemo(() => openDraft && projectBuild ? draftBuild(projectBuild, openDraft) : projectBuild, [openDraft, projectBuild]);
|
|
181
|
-
const
|
|
229
|
+
const restoreNotes = useRef(/* @__PURE__ */ new Map());
|
|
230
|
+
const inDraft = useCallback((text) => {
|
|
231
|
+
var _a2;
|
|
232
|
+
const notes = [];
|
|
233
|
+
if (openDraft) notes.push(draftTurnNote(openDraft, openDraft.sandboxId));
|
|
234
|
+
const sid = (_a2 = build == null ? void 0 : build.sandboxId) != null ? _a2 : "";
|
|
235
|
+
const restored = sid ? restoreNotes.current.get(sid) : void 0;
|
|
236
|
+
if (restored) {
|
|
237
|
+
restoreNotes.current.delete(sid);
|
|
238
|
+
notes.push(restored);
|
|
239
|
+
}
|
|
240
|
+
return notes.length ? `${text}
|
|
182
241
|
|
|
183
|
-
${
|
|
242
|
+
${notes.join("\n")}` : text;
|
|
243
|
+
}, [openDraft, build == null ? void 0 : build.sandboxId]);
|
|
184
244
|
const firstAsk = (_b = hostChat == null ? void 0 : hostChat.messages.find((m) => m.role === "user")) == null ? void 0 : _b.content;
|
|
185
245
|
const askTitle = useMemo(() => titleFromPrompt(firstAsk), [firstAsk]);
|
|
186
246
|
const siteTitle = (project == null ? void 0 : project.title) || (build == null ? void 0 : build.title) || askTitle || null;
|
|
@@ -251,20 +311,53 @@ ${draftTurnNote(openDraft, openDraft.sandboxId)}` : text, [openDraft]);
|
|
|
251
311
|
[publishTools, build == null ? void 0 : build.key, build == null ? void 0 : build.sandboxId]
|
|
252
312
|
);
|
|
253
313
|
useEffect(() => setAppPhoneOpen(false), [activeChannelId]);
|
|
314
|
+
const historyRun = useMemo(
|
|
315
|
+
() => (publishTools == null ? void 0 : publishTools.run) && (build == null ? void 0 : build.sandboxId) ? sandboxRunner((action, params, timeoutMs) => publishTools.run(build, action, __spreadValues({
|
|
316
|
+
sandbox_id: build.sandboxId
|
|
317
|
+
}, params), timeoutMs)) : void 0,
|
|
318
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
319
|
+
[publishTools, build == null ? void 0 : build.key, build == null ? void 0 : build.sandboxId]
|
|
320
|
+
);
|
|
254
321
|
const [mode, setMode] = useState("chat");
|
|
255
322
|
const [viewport, setViewport] = useState("phone");
|
|
256
323
|
useEffect(() => setMode("chat"), [activeChannelId]);
|
|
324
|
+
const chooseAssetSite = useCallback((target) => {
|
|
325
|
+
const asset = incomingAsset;
|
|
326
|
+
onIncomingAssetDone == null ? void 0 : onIncomingAssetDone();
|
|
327
|
+
if (!asset) return;
|
|
328
|
+
if (target === "new") {
|
|
329
|
+
onCloseProject();
|
|
330
|
+
setHomeTab("create");
|
|
331
|
+
} else {
|
|
332
|
+
if (target.channelId !== activeChannelId) onOpenProject(target.channelId);
|
|
333
|
+
setMode("chat");
|
|
334
|
+
}
|
|
335
|
+
assetNonce.current += 1;
|
|
336
|
+
setAssetPrefill({
|
|
337
|
+
nonce: assetNonce.current,
|
|
338
|
+
asset: {
|
|
339
|
+
role: asset.role,
|
|
340
|
+
name: asset.name || "",
|
|
341
|
+
url: asset.url
|
|
342
|
+
},
|
|
343
|
+
target: target === "new" ? "home" : "chat"
|
|
344
|
+
});
|
|
345
|
+
}, [incomingAsset, onIncomingAssetDone, onCloseProject, onOpenProject, activeChannelId]);
|
|
257
346
|
const githubSyncRef = useRef(null);
|
|
258
347
|
const syncTurnRef = useRef(null);
|
|
259
|
-
const sendToAgent = useCallback((text, files) => {
|
|
348
|
+
const sendToAgent = useCallback((text, files, opts) => {
|
|
260
349
|
var _a2;
|
|
261
350
|
const words = text.trim();
|
|
262
351
|
if (!words && !(files == null ? void 0 : files.length) || !hostChat) return;
|
|
263
|
-
const
|
|
264
|
-
|
|
352
|
+
const brief = build || (opts == null ? void 0 : opts.discuss) || /^build\b/i.test(words) ? words : `Build me: ${words}`;
|
|
353
|
+
const turn = withAgentNotes(brief, {
|
|
354
|
+
mode: (opts == null ? void 0 : opts.discuss) ? "chat" : "build",
|
|
355
|
+
plan: opts == null ? void 0 : opts.plan
|
|
356
|
+
});
|
|
357
|
+
if (!(opts == null ? void 0 : opts.stay)) setMode("chat");
|
|
265
358
|
const engine = (_a2 = githubSyncRef.current) == null ? void 0 : _a2.engine;
|
|
266
359
|
const channel = activeChannelId;
|
|
267
|
-
if (!engine || !channel || !(build == null ? void 0 : build.sandboxId)) {
|
|
360
|
+
if (!engine || !channel || !(build == null ? void 0 : build.sandboxId) || (opts == null ? void 0 : opts.discuss)) {
|
|
268
361
|
hostChat.send(inDraft(turn), files, build);
|
|
269
362
|
return;
|
|
270
363
|
}
|
|
@@ -278,12 +371,33 @@ ${draftTurnNote(openDraft, openDraft.sandboxId)}` : text, [openDraft]);
|
|
|
278
371
|
}
|
|
279
372
|
syncTurnRef.current = {
|
|
280
373
|
channelId: channel,
|
|
281
|
-
request:
|
|
374
|
+
request: brief,
|
|
282
375
|
preHead: gate.preHead
|
|
283
376
|
};
|
|
284
377
|
hostChat.send(inDraft(turn), files, build);
|
|
285
378
|
});
|
|
286
379
|
}, [hostChat, build, activeChannelId, showToast, inDraft]);
|
|
380
|
+
const planModeRef = useRef(null);
|
|
381
|
+
const sendPlanBuild = useCallback((text, plan) => {
|
|
382
|
+
var _a2, _b2;
|
|
383
|
+
if (!hostChat) return false;
|
|
384
|
+
if (mode === "chat" ? holdTurn() : outOfCredits()) return false;
|
|
385
|
+
if (activeChannelId) (_b2 = (_a2 = planModeRef.current) == null ? void 0 : _a2.plans) == null ? void 0 : _b2.savePlan(activeChannelId, plan, text).catch(() => void 0);
|
|
386
|
+
sendToAgent(text, void 0, {
|
|
387
|
+
plan,
|
|
388
|
+
stay: true
|
|
389
|
+
});
|
|
390
|
+
return true;
|
|
391
|
+
}, [hostChat, mode, holdTurn, outOfCredits, activeChannelId, sendToAgent]);
|
|
392
|
+
const planMode = usePlanMode({
|
|
393
|
+
connection: agentConnection,
|
|
394
|
+
channelId: activeChannelId,
|
|
395
|
+
build,
|
|
396
|
+
siteTitle,
|
|
397
|
+
sendPlanBuild
|
|
398
|
+
});
|
|
399
|
+
planModeRef.current = planMode;
|
|
400
|
+
const showPlanTab = Boolean(planMode.plans && planMode.canPlan);
|
|
287
401
|
const [uploadPicked, setUploadPicked] = useState(null);
|
|
288
402
|
const uploadPages = useRef(1);
|
|
289
403
|
const uploadCard = useUploadCard(projectTools == null ? void 0 : projectTools.graphql, (_c = uploadLink == null ? void 0 : uploadLink.card) != null ? _c : null);
|
|
@@ -414,6 +528,24 @@ ${restoreTurnNote({
|
|
|
414
528
|
}, [build, previewTrouble == null ? void 0 : previewTrouble.kind, onRestorePreview, askAiToRestore, showToast, openDraft]);
|
|
415
529
|
const [publishOpen, setPublishOpen] = useState(false);
|
|
416
530
|
const [versionsOpen, setVersionsOpen] = useState(false);
|
|
531
|
+
const [historyImported, setHistoryImported] = useState(false);
|
|
532
|
+
useEffect(() => setHistoryImported(false), [activeChannelId]);
|
|
533
|
+
useEffect(() => {
|
|
534
|
+
if (!versionsOpen || !activeChannelId || !(projectTools == null ? void 0 : projectTools.loadSettings)) return void 0;
|
|
535
|
+
let live2 = true;
|
|
536
|
+
projectTools.loadSettings(activeChannelId).then((raw) => {
|
|
537
|
+
var _a2;
|
|
538
|
+
return live2 && setHistoryImported(Boolean((_a2 = parseProjectSettings(raw)) == null ? void 0 : _a2.imported));
|
|
539
|
+
}).catch(() => void 0);
|
|
540
|
+
return () => {
|
|
541
|
+
live2 = false;
|
|
542
|
+
};
|
|
543
|
+
}, [versionsOpen, activeChannelId, projectTools]);
|
|
544
|
+
const afterHistoryRestore = useCallback((version) => {
|
|
545
|
+
const sid = build == null ? void 0 : build.sandboxId;
|
|
546
|
+
if (sid) restoreNotes.current.set(sid, `[Restored version] ${restoreManualEdit(version).summary}`);
|
|
547
|
+
setPreviewNonce((n) => n + 1);
|
|
548
|
+
}, [build == null ? void 0 : build.sandboxId]);
|
|
417
549
|
const [publishStarted, setPublishStarted] = useState(null);
|
|
418
550
|
useEffect(() => setPublishStarted(null), [activeChannelId]);
|
|
419
551
|
const siteLive = (_n = (_m = builds.find((b) => b.liveUrl)) == null ? void 0 : _m.liveUrl) != null ? _n : null;
|
|
@@ -747,6 +879,51 @@ ${restoreTurnNote({
|
|
|
747
879
|
live2 = false;
|
|
748
880
|
};
|
|
749
881
|
}, [webServices, activeChannelId, roleEpoch]);
|
|
882
|
+
const [consoleOpen, setConsoleOpen] = useState(false);
|
|
883
|
+
const [previewLive, setPreviewLive] = useState(false);
|
|
884
|
+
useEffect(() => {
|
|
885
|
+
if (mode !== "preview") setConsoleOpen(false);
|
|
886
|
+
}, [mode]);
|
|
887
|
+
useEffect(() => setConsoleOpen(false), [activeChannelId]);
|
|
888
|
+
const canReadServerLog = Boolean(historyRun && activeChannelId && (build == null ? void 0 : build.sandboxId) && roleCan(projectRole, "build"));
|
|
889
|
+
const previewConsole = usePreviewConsole({
|
|
890
|
+
buildKey: activeChannelId || (build == null ? void 0 : build.sandboxId) || (build == null ? void 0 : build.previewUrl) || (build == null ? void 0 : build.key) || "",
|
|
891
|
+
run: canReadServerLog ? historyRun : void 0,
|
|
892
|
+
sandboxId: build == null ? void 0 : build.sandboxId,
|
|
893
|
+
// Every command renews the sandbox's lease: only while the page is up and on screen.
|
|
894
|
+
live: mode === "preview" && previewLive,
|
|
895
|
+
open: consoleOpen
|
|
896
|
+
});
|
|
897
|
+
const canFixFromConsole = Boolean(hostChat) && roleCan(projectRole, "build");
|
|
898
|
+
const askAiFromCommentRef = useRef(() => false);
|
|
899
|
+
askAiFromCommentRef.current = (text) => {
|
|
900
|
+
if (!build || !hostChat || hostChat.busy || building) {
|
|
901
|
+
showToast("Wait for the AI to finish, then try again.");
|
|
902
|
+
return false;
|
|
903
|
+
}
|
|
904
|
+
if (holdTurn()) {
|
|
905
|
+
setMode("chat");
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
sendToAgent(text);
|
|
909
|
+
return true;
|
|
910
|
+
};
|
|
911
|
+
const canAskAiFromComment = Boolean(hostChat && build) && roleCan(projectRole, "build");
|
|
912
|
+
const previewComments = useMemo(() => webServices && activeChannelId ? {
|
|
913
|
+
service: webServices.comments,
|
|
914
|
+
channelId: activeChannelId,
|
|
915
|
+
role: projectRole,
|
|
916
|
+
currentUserId: webServices.sharing.currentUserId,
|
|
917
|
+
onAskAi: canAskAiFromComment ? (text) => askAiFromCommentRef.current(text) : void 0
|
|
918
|
+
} : null, [webServices, activeChannelId, projectRole, canAskAiFromComment]);
|
|
919
|
+
const fixFromConsole = (entry) => {
|
|
920
|
+
if (!build || !hostChat || hostChat.busy) {
|
|
921
|
+
showToast("Wait for the AI to finish, then try again.");
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
setConsoleOpen(false);
|
|
925
|
+
askAgent(fixTurnText(fixErrorFromEntry(entry)));
|
|
926
|
+
};
|
|
750
927
|
const shareAsTemplate = async () => {
|
|
751
928
|
if (!(build == null ? void 0 : build.sandboxId) || !(publishTools == null ? void 0 : publishTools.run) || !(projectTools == null ? void 0 : projectTools.webBuilderUrl)) return;
|
|
752
929
|
showToast("Making the template link\u2026");
|
|
@@ -1006,11 +1183,19 @@ ${secrets.note}` : ""}`, [{
|
|
|
1006
1183
|
run: () => setMode("preview")
|
|
1007
1184
|
});
|
|
1008
1185
|
}
|
|
1009
|
-
if (
|
|
1186
|
+
if (showPlanTab && mode !== "plan") {
|
|
1187
|
+
view.push({
|
|
1188
|
+
key: "plan",
|
|
1189
|
+
icon: "format-list-checks",
|
|
1190
|
+
label: "Plan",
|
|
1191
|
+
run: () => setMode("plan")
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
if (historyRun || builds.length > 1) {
|
|
1010
1195
|
view.push({
|
|
1011
1196
|
key: "versions",
|
|
1012
1197
|
icon: "history",
|
|
1013
|
-
label: "
|
|
1198
|
+
label: "History",
|
|
1014
1199
|
run: () => setVersionsOpen(true)
|
|
1015
1200
|
});
|
|
1016
1201
|
}
|
|
@@ -1319,9 +1504,13 @@ ${secrets.note}` : ""}`, [{
|
|
|
1319
1504
|
/* @__PURE__ */ jsx(Tap, { onPress: openMore, accessibilityRole: "button", accessibilityLabel: "More", style: styles.pillBtn, pressedStyle: DIM, testID: "webbuilder-more", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "dots-horizontal", size: 24, color: theme.ink }) })
|
|
1320
1505
|
] })
|
|
1321
1506
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1322
|
-
/* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ jsxs(Text, { style: [styles.centerTitle, {
|
|
1323
1508
|
color: theme.ink
|
|
1324
|
-
}], numberOfLines: 1, children:
|
|
1509
|
+
}], numberOfLines: 1, children: [
|
|
1510
|
+
mode === "code" ? "Code" : null,
|
|
1511
|
+
mode === "plan" ? "Plan" : null,
|
|
1512
|
+
mode === "preview" ? siteTitle || "Preview" : null
|
|
1513
|
+
] }),
|
|
1325
1514
|
/* @__PURE__ */ jsxs(View, { style: [styles.actionPill, floating], children: [
|
|
1326
1515
|
mode === "preview" ? /* @__PURE__ */ jsx(ViewportToggle, { viewport, onViewport: setViewport, disabled: !(build == null ? void 0 : build.previewUrl), theme, style: styles.pillBtn }) : null,
|
|
1327
1516
|
/* @__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 }) }),
|
|
@@ -1329,10 +1518,10 @@ ${secrets.note}` : ""}`, [{
|
|
|
1329
1518
|
] })
|
|
1330
1519
|
] })
|
|
1331
1520
|
] }),
|
|
1332
|
-
mode === "chat" ? /* @__PURE__ */ jsx(ProjectChat, { messages: (_D = hostChat == null ? void 0 : hostChat.messages) != null ? _D : [], streaming: (_E = hostChat == null ? void 0 : hostChat.streaming) != null ? _E : null, busy: Boolean(hostChat == null ? void 0 : hostChat.busy), error: (_F = hostChat == null ? void 0 : hostChat.error) != null ? _F : null, connected: Boolean(hostChat == null ? void 0 : hostChat.connected), building, build, siteTitle: siteTitle || "Your site", onSend: (text, files) => sendToAgent(text, files), codeActions: Boolean(hostChat && (build == null ? void 0 : build.sandboxId)), holdTurn, liveCard: siteCopy ? /* @__PURE__ */ jsx(SiteCopyCard, { view: siteCopy, theme }) : null, code: code != null ? code : void 0, permissionsUrl: approvalsSettingsUrl(projectTools == null ? void 0 : projectTools.appUrl), templates, onStartFromTemplate: (t, brief) => startSite({
|
|
1521
|
+
mode === "chat" ? /* @__PURE__ */ jsx(ProjectChat, { messages: (_D = hostChat == null ? void 0 : hostChat.messages) != null ? _D : [], streaming: (_E = hostChat == null ? void 0 : hostChat.streaming) != null ? _E : null, busy: Boolean(hostChat == null ? void 0 : hostChat.busy), error: (_F = hostChat == null ? void 0 : hostChat.error) != null ? _F : null, connected: Boolean(hostChat == null ? void 0 : hostChat.connected), building, build, siteTitle: siteTitle || "Your site", onSend: (text, files) => sendToAgent(text, files), assets: assetsService, onUseAsLogo: keepLogoInBrandKit, assetPrefill: (assetPrefill == null ? void 0 : assetPrefill.target) === "chat" ? assetPrefill : null, onAssetPrefillDone: assetPrefillDone, codeActions: Boolean(hostChat && (build == null ? void 0 : build.sandboxId)), holdTurn, liveCard: siteCopy ? /* @__PURE__ */ jsx(SiteCopyCard, { view: siteCopy, theme }) : null, code: code != null ? code : void 0, permissionsUrl: approvalsSettingsUrl(projectTools == null ? void 0 : projectTools.appUrl), templates, onStartFromTemplate: (t, brief, sent) => startSite({
|
|
1333
1522
|
brief,
|
|
1334
1523
|
template: t
|
|
1335
|
-
}), banner: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1524
|
+
}, void 0, void 0, sent), banner: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1336
1525
|
openDraft ? /* @__PURE__ */ jsx(DraftBanner, { name: openDraft.name, onAccept: () => setDraftsOpen(true), onBack: () => {
|
|
1337
1526
|
setOpenDraft(null);
|
|
1338
1527
|
showToast("Back to the project.");
|
|
@@ -1340,11 +1529,37 @@ ${secrets.note}` : ""}`, [{
|
|
|
1340
1529
|
/* @__PURE__ */ jsx(RetentionBanner, { view: retention, appUrl: projectTools == null ? void 0 : projectTools.appUrl, canExtend: projectRole !== "viewer", onDownload: (build == null ? void 0 : build.sandboxId) && !building ? downloadCode : void 0, theme })
|
|
1341
1530
|
] }), costLine: ((_G = credits == null ? void 0 : credits.costLine) == null ? void 0 : _G.channelId) === activeChannelId ? credits.costLine.text : null, creditsCard: (credits == null ? void 0 : credits.cardOpen) ? /* @__PURE__ */ jsx(OutOfCreditsCard, { appUrl: projectTools == null ? void 0 : projectTools.appUrl, onCheckAgain: () => credits.refresh({
|
|
1342
1531
|
fresh: true
|
|
1343
|
-
}), onDismiss: credits.dismissCard, theme }) : null, onOpenPreview: () => setMode("preview"), onPublish: openPublish, onPreviewAsleep: () => wakePreview(), previewDown: Boolean(previewTrouble && previewTrouble.kind !== "restoring"), ask: (_H = hostChat == null ? void 0 : hostChat.ask) != null ? _H : 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, onCopyLink: copySiteLink,
|
|
1532
|
+
}), onDismiss: credits.dismissCard, theme }) : null, onOpenPreview: () => setMode("preview"), onPublish: openPublish, onPreviewAsleep: () => wakePreview(), previewDown: Boolean(previewTrouble && previewTrouble.kind !== "restoring"), ask: (_H = hostChat == null ? void 0 : hostChat.ask) != null ? _H : 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, onCopyLink: copySiteLink, planMode, onDiscuss: (text, files) => sendToAgent(text, files, {
|
|
1533
|
+
discuss: true
|
|
1534
|
+
}), theme, bottomInset: insets.bottom }) : null,
|
|
1344
1535
|
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: openPublish, publishLabel, error: (_I = hostChat == null ? void 0 : hostChat.error) != null ? _I : null, theme, bottomInset: insets.bottom, viewport, unpublished: Boolean(build == null ? void 0 : build.sandboxId) && !(build == null ? void 0 : build.liveUrl), readSourceFile: code && build ? (path) => code.readFile(build, path, false).then((r) => {
|
|
1345
1536
|
var _a2;
|
|
1346
1537
|
return r.ok ? (_a2 = r.content) != null ? _a2 : null : null;
|
|
1347
|
-
}) : void 0, onShowCode: canShowCode ? () => setMode("code") : void 0, buildingCover, setupNotice, onOpenApp: () => setAppPhoneOpen(true) }) : null,
|
|
1538
|
+
}) : void 0, onShowCode: canShowCode ? () => setMode("code") : void 0, onShowPlan: showPlanTab ? () => setMode("plan") : void 0, buildingCover, setupNotice, onOpenApp: () => setAppPhoneOpen(true), onConsoleMessage: previewConsole.addBridgeMessage, onPreviewLive: setPreviewLive, onOpenConsole: () => setConsoleOpen(true), consoleErrors: previewConsole.errorCount, comments: previewComments }) : null,
|
|
1539
|
+
mode === "plan" && planMode.plans ? /* @__PURE__ */ jsxs(View, { style: [styles.fill, {
|
|
1540
|
+
backgroundColor: theme.screen
|
|
1541
|
+
}], children: [
|
|
1542
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.codeBar, {
|
|
1543
|
+
borderBottomColor: theme.border
|
|
1544
|
+
}], children: [
|
|
1545
|
+
/* @__PURE__ */ jsx(ViewPicker, { value: "plan", onPick: (picked) => {
|
|
1546
|
+
if (picked === "preview") setMode("preview");
|
|
1547
|
+
if (picked === "code") setMode("code");
|
|
1548
|
+
}, canShowCode, canShowPlan: true, theme }),
|
|
1549
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.codeBarTitle, {
|
|
1550
|
+
color: theme.ink
|
|
1551
|
+
}], numberOfLines: 1, children: "Plan" })
|
|
1552
|
+
] }),
|
|
1553
|
+
/* @__PURE__ */ jsx(PlanView, { channelId: activeChannelId, creation: build ? {
|
|
1554
|
+
title: siteTitle || build.title || "Your site"
|
|
1555
|
+
} : null, plans: planMode.plans, onSendEdits: hostChat && roleCan(projectRole, "build") ? (text) => {
|
|
1556
|
+
if (holdTurn()) return false;
|
|
1557
|
+
sendToAgent(text, void 0, {
|
|
1558
|
+
stay: true
|
|
1559
|
+
});
|
|
1560
|
+
return true;
|
|
1561
|
+
} : void 0, theme, bottomInset: insets.bottom })
|
|
1562
|
+
] }) : null,
|
|
1348
1563
|
mode === "code" ? /* @__PURE__ */ jsxs(View, { style: [styles.fill, {
|
|
1349
1564
|
backgroundColor: theme.card,
|
|
1350
1565
|
paddingBottom: insets.bottom
|
|
@@ -1354,7 +1569,8 @@ ${secrets.note}` : ""}`, [{
|
|
|
1354
1569
|
}], children: [
|
|
1355
1570
|
/* @__PURE__ */ jsx(ViewPicker, { value: "code", onPick: (picked) => {
|
|
1356
1571
|
if (picked === "preview") setMode("preview");
|
|
1357
|
-
|
|
1572
|
+
if (picked === "plan") setMode("plan");
|
|
1573
|
+
}, canShowCode: true, canShowPlan: showPlanTab, theme }),
|
|
1358
1574
|
/* @__PURE__ */ jsx(Text, { style: [styles.codeBarTitle, {
|
|
1359
1575
|
color: theme.ink
|
|
1360
1576
|
}], numberOfLines: 1, children: "Code" })
|
|
@@ -1379,10 +1595,27 @@ ${req.note}`), req.attachments, build);
|
|
|
1379
1595
|
/* @__PURE__ */ jsx(View, { style: styles.fill, children: homeTab === "create" ? /* @__PURE__ */ jsx(StudioHome, { draft, onDraft: setDraft, template, onClearTemplate: () => setTemplate(null), onBrowseTemplates: () => setTemplatesOpen(true), templates, onUseTemplate: (t, brief) => {
|
|
1380
1596
|
pickTemplate(t);
|
|
1381
1597
|
if (brief) setDraft(brief);
|
|
1382
|
-
}, brand, brandOff, onBrandOffChange: setBrandOff, onBrand: () => setBrandOpen(true), onSiteScore: () => setScoreOpen(true), onStart:
|
|
1598
|
+
}, brand, brandOff, onBrandOffChange: setBrandOff, onBrand: () => setBrandOpen(true), onSiteScore: () => setScoreOpen(true), onStart: (start) => startSite(start), suggestStyles: {
|
|
1599
|
+
on: styleDirections.suggestStyles,
|
|
1600
|
+
onToggle: () => styleDirections.setSuggestStyles(!styleDirections.suggestStyles)
|
|
1601
|
+
}, connecting: startBlocked, startNotice, assets: assetsService, onUseAsLogo: keepLogoInBrandKit, assetPrefill: (assetPrefill == null ? void 0 : assetPrefill.target) === "home" ? assetPrefill : null, onAssetPrefillDone: assetPrefillDone, theme, bottomInset: BOTTOM_TABS_SPACE + insets.bottom }) : /* @__PURE__ */ jsx(ProjectsScreen, { projects: boardProjects, loading: projectsLoading, loadingMore: projectsLoadingMore, error: projectsError, hasMore: projectsHasMore, onRefresh: onRefreshProjects, onLoadMore: onLoadMoreProjects, onOpen: (p) => onOpenProject(p.channelId), onNewProject: () => setHomeTab("create"), topInset: insets.top + 12, bottomInset: BOTTOM_TABS_SPACE + insets.bottom, sharedWithMe, theme }) }),
|
|
1383
1602
|
/* @__PURE__ */ jsx(BottomTabs, { tab: homeTab, onTab: setHomeTab, theme, bottomInset: insets.bottom })
|
|
1384
1603
|
] }),
|
|
1385
1604
|
/* @__PURE__ */ jsx(TemplatesSheet, { visible: templatesOpen, onClose: () => setTemplatesOpen(false), templates, loading: templatesLoading, error: templatesError, onReload: onReloadTemplates, selectedId: (_L = template == null ? void 0 : template.id) != null ? _L : null, onPick: pickTemplate, theme }),
|
|
1605
|
+
/* @__PURE__ */ jsx(AssetSiteChooser, { asset: incomingAsset, current: project, recent: recentSites, onChoose: chooseAssetSite, onClose: () => onIncomingAssetDone == null ? void 0 : onIncomingAssetDone(), theme }),
|
|
1606
|
+
/* @__PURE__ */ jsx(StyleDirectionsSheet, { visible: Boolean(styleDirections.gate), directions: (_N = (_M = styleDirections.gate) == null ? void 0 : _M.directions) != null ? _N : [], loading: (_O = styleDirections.gate) == null ? void 0 : _O.loading, source: (_P = styleDirections.gate) == null ? void 0 : _P.source, disabled: Boolean(styleGateReason), disabledReason: styleGateReason, onPick: (direction) => {
|
|
1607
|
+
var _a2;
|
|
1608
|
+
const held = (_a2 = styleDirections.gate) == null ? void 0 : _a2.pending;
|
|
1609
|
+
if (held) startSite(held.start, held.files, {
|
|
1610
|
+
direction
|
|
1611
|
+
}, held.onSent);
|
|
1612
|
+
}, onShuffle: styleDirections.shuffle, tailoredReady: Boolean((_R = (_Q = styleDirections.gate) == null ? void 0 : _Q.tailored) == null ? void 0 : _R.length), onUseTailored: styleDirections.showTailored, onInteract: styleDirections.touch, onSkip: () => {
|
|
1613
|
+
var _a2;
|
|
1614
|
+
const held = (_a2 = styleDirections.gate) == null ? void 0 : _a2.pending;
|
|
1615
|
+
if (held) startSite(held.start, held.files, {
|
|
1616
|
+
skip: true
|
|
1617
|
+
}, held.onSent);
|
|
1618
|
+
}, onClose: closeStyles, theme }),
|
|
1386
1619
|
/* @__PURE__ */ jsx(SiteScoreSheet, { visible: scoreOpen, onClose: () => setScoreOpen(false), blocked: startBlocked, onCheck: (url) => {
|
|
1387
1620
|
setScoreOpen(false);
|
|
1388
1621
|
onStartProject({
|
|
@@ -1433,13 +1666,13 @@ ${req.note}`), req.attachments, build);
|
|
|
1433
1666
|
}, theme }) : null,
|
|
1434
1667
|
webServices ? /* @__PURE__ */ jsx(IntegrationsPanel, { visible: integrationsOpen, channelId: activeChannelId, services: webServices, aiBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), onRequest: (text) => askAgent(text), onClose: () => setIntegrationsOpen(false), theme }) : /* @__PURE__ */ jsx(IntegrationsSheet, { visible: integrationsOpen, channelId: activeChannelId, tools: projectTools, aiBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), onRequest: (text) => askAgent(text), onClose: () => setIntegrationsOpen(false), theme })
|
|
1435
1668
|
] }) : null,
|
|
1436
|
-
webServices ? /* @__PURE__ */ jsx(CreditsSheet, { visible: creditsOpen, balance: (
|
|
1669
|
+
webServices ? /* @__PURE__ */ jsx(CreditsSheet, { visible: creditsOpen, balance: (_S = credits == null ? void 0 : credits.balance) != null ? _S : null, appUrl: projectTools == null ? void 0 : projectTools.appUrl, onRefresh: () => {
|
|
1437
1670
|
var _a2;
|
|
1438
1671
|
return (_a2 = credits == null ? void 0 : credits.refresh({
|
|
1439
1672
|
fresh: true
|
|
1440
1673
|
})) != null ? _a2 : Promise.resolve(null);
|
|
1441
1674
|
}, onClose: () => setCreditsOpen(false), theme }) : null,
|
|
1442
|
-
/* @__PURE__ */ jsx(DraftsSheet, { visible: draftsOpen, project: projectBuild, drafts, openDraftId: (
|
|
1675
|
+
/* @__PURE__ */ jsx(DraftsSheet, { visible: draftsOpen, project: projectBuild, drafts, openDraftId: (_T = openDraft == null ? void 0 : openDraft.id) != null ? _T : null, canEdit: roleCan(projectRole, "build"), onOpen: (d) => {
|
|
1443
1676
|
setOpenDraft(d);
|
|
1444
1677
|
setMode("chat");
|
|
1445
1678
|
showToast(d ? `In the draft "${d.name}".` : "Back to the project.");
|
|
@@ -1459,11 +1692,11 @@ ${req.note}`), req.attachments, build);
|
|
|
1459
1692
|
return true;
|
|
1460
1693
|
}, onClose: () => setCloudOpen(false), theme }) : null,
|
|
1461
1694
|
webServices ? /* @__PURE__ */ jsx(SecretsSheet, { visible: secretsOpen, channelId: activeChannelId, build, secrets: webServices.secrets, runAction: publishTools == null ? void 0 : publishTools.run, aiBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), onClose: () => setSecretsOpen(false), theme }) : null,
|
|
1462
|
-
/* @__PURE__ */ jsx(AppPhoneSheet, { visible: appPhoneOpen, previewUrl: (
|
|
1695
|
+
/* @__PURE__ */ jsx(AppPhoneSheet, { visible: appPhoneOpen, previewUrl: (_U = build == null ? void 0 : build.previewUrl) != null ? _U : null, run: runOnSandbox, onClose: () => setAppPhoneOpen(false), theme }),
|
|
1463
1696
|
/* @__PURE__ */ jsx(SiteUploadSheet, { visible: Boolean(uploadLink), onClose: () => {
|
|
1464
1697
|
setUploadPicked(null);
|
|
1465
1698
|
onUploadLinkDone == null ? void 0 : onUploadLinkDone();
|
|
1466
|
-
}, linkState: uploadSite.state, site: uploadSite.site, choices: uploadSite.choices, onPickSite: (p) => setUploadPicked(p), ready: Boolean(uploadSite.site && activeChannelId === uploadSite.site.channelId && hostChat && build), busy: Boolean(hostChat == null ? void 0 : hostChat.busy) || Boolean(building), lastReply: uploadLastReply, messageCount: (
|
|
1699
|
+
}, linkState: uploadSite.state, site: uploadSite.site, choices: uploadSite.choices, onPickSite: (p) => setUploadPicked(p), ready: Boolean(uploadSite.site && activeChannelId === uploadSite.site.channelId && hostChat && build), busy: Boolean(hostChat == null ? void 0 : hostChat.busy) || Boolean(building), lastReply: uploadLastReply, messageCount: (_W = (_V = hostChat == null ? void 0 : hostChat.messages) == null ? void 0 : _V.length) != null ? _W : 0, messages: uploadLink ? hostChat == null ? void 0 : hostChat.messages : void 0, renderConnectorCard: hostChat == null ? void 0 : hostChat.renderConnectorCard, failed: Boolean(hostChat == null ? void 0 : hostChat.error), card: (uploadLink == null ? void 0 : uploadLink.card) ? uploadCard : null, previewUrl: uploadSite.site && build && activeChannelId === uploadSite.site.channelId ? build.previewUrl : null, onPublishNow: onPublish && build && roleCan(projectRole, "publish") ? async (target) => {
|
|
1467
1700
|
if ((hostChat == null ? void 0 : hostChat.busy) || building) {
|
|
1468
1701
|
return {
|
|
1469
1702
|
ok: false,
|
|
@@ -1517,7 +1750,7 @@ ${req.note}`), req.attachments, build);
|
|
|
1517
1750
|
/* @__PURE__ */ jsx(PublishSheet, { visible: publishOpen, build, publishing, onPublish: onPublish ? publish : void 0, onClose: () => setPublishOpen(false), theme, liveUrl: live, aiBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), tools: publishTools, onDownloadCode: (build == null ? void 0 : build.sandboxId) && !building ? downloadCode : void 0, onExport: hostChat && !building ? exportTo : void 0, onOwnCloudflare: hostChat && !building ? () => askAgent(ownCloudflareTurn(siteTitle || (build == null ? void 0 : build.title) || "")) : void 0, onFixWithAi: hostChat ? (text) => askAgent(text) : void 0, onUnpublished: () => showToast("The site is offline now."), onSiteStatus: (publishTools == null ? void 0 : publishTools.run) && live ? () => {
|
|
1518
1751
|
setPublishOpen(false);
|
|
1519
1752
|
setTimeout(() => setSiteStatusOpen(true), 300);
|
|
1520
|
-
} : void 0, progressText: publishing ? (
|
|
1753
|
+
} : void 0, progressText: publishing ? (_X = building == null ? void 0 : building.statusText) != null ? _X : null : null, reviewIgnores, appUrl: projectTools == null ? void 0 : projectTools.appUrl, askToPublish: projectRole === "viewer" && (projectTools == null ? void 0 : projectTools.graphql) && activeChannelId ? async (note) => {
|
|
1521
1754
|
var _a2, _b2, _c2;
|
|
1522
1755
|
const r = await projectTools.graphql.mutate(ADD_COMMENT_MUTATION, {
|
|
1523
1756
|
channelId: activeChannelId,
|
|
@@ -1549,13 +1782,14 @@ ${req.note}`), req.attachments, build);
|
|
|
1549
1782
|
askAgent(text);
|
|
1550
1783
|
return true;
|
|
1551
1784
|
}, onClose: () => setSiteStatusOpen(false), theme }) : null,
|
|
1785
|
+
/* @__PURE__ */ jsx(PreviewConsoleSheet, { visible: consoleOpen && mode === "preview", entries: previewConsole.entries, server: previewConsole.server, canReadServer: canReadServerLog, onClear: previewConsole.clear, onClose: () => setConsoleOpen(false), onFix: canFixFromConsole ? fixFromConsole : void 0, fixBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), theme }),
|
|
1552
1786
|
/* @__PURE__ */ jsx(VersionsSheet, { visible: versionsOpen, builds, selectedKey, onSelect: (picked) => {
|
|
1553
1787
|
setSelectedKey(picked.key === (latest == null ? void 0 : latest.key) ? null : picked.key);
|
|
1554
1788
|
setVersionsOpen(false);
|
|
1555
|
-
}, onClose: () => setVersionsOpen(false), theme }),
|
|
1556
|
-
/* @__PURE__ */ jsx(Sheet, { visible: menu !== null, title: (
|
|
1789
|
+
}, onClose: () => setVersionsOpen(false), theme, build, run: historyRun, busy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), readOnly: !roleCan(projectRole, "restoreVersion"), imported: historyImported, onRestored: afterHistoryRestore }),
|
|
1790
|
+
/* @__PURE__ */ jsx(Sheet, { visible: menu !== null, title: (_Y = menu == null ? void 0 : menu.title) != null ? _Y : "", onClose: () => setMenu(null), theme, children: /* @__PURE__ */ jsx(View, { style: [styles.menuList, {
|
|
1557
1791
|
paddingBottom: insets.bottom + 8
|
|
1558
|
-
}], children: ((
|
|
1792
|
+
}], children: ((_Z = menu == null ? void 0 : menu.actions) != null ? _Z : []).map((action) => /* @__PURE__ */ jsx(Tap, { onPress: () => chooseMenu(action), accessibilityRole: "button", style: [styles.menuRow, {
|
|
1559
1793
|
borderBottomColor: theme.border
|
|
1560
1794
|
}], pressedStyle: DIM, children: /* @__PURE__ */ jsx(Text, { style: [styles.menuLabel, {
|
|
1561
1795
|
color: action.destructive ? theme.crit : theme.ink
|