@adminide-stack/yantra-mobile 12.0.196-alpha.0 → 12.0.196
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 +4 -4
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {addPriceWatch}from'./catalogProductSearch.js';import {scheduleLivePriceCheck}from'./livePriceCheckClient.js';const STORE_HOST = /(^|\.)(amazon|walmart|target|bestbuy|costco|samsclub|bjs|ebay|kohls|macys|nordstrom|homedepot|lowes|newegg|bhphotovideo|adorama|dell|lenovo|samsung|hp|gamestop|ulta|sephora|rei|lego|nike|adidas|staples|officedepot|wayfair|ikea|gap|oldnavy)\.com$/i;
|
|
2
|
+
const hostOf = (url) => {
|
|
3
|
+
try {
|
|
4
|
+
return new URL(url).hostname.toLowerCase();
|
|
5
|
+
} catch (e) {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function watchPathOf(deal) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const host = hostOf(deal.url);
|
|
12
|
+
if (/^amazon/i.test(deal.store) && deal.productId && /^[A-Z0-9]{10}$/.test(deal.productId)) {
|
|
13
|
+
return {
|
|
14
|
+
kind: "catalog",
|
|
15
|
+
retailer: "amazon",
|
|
16
|
+
productId: deal.productId
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const asin = /(^|\.)amazon\.com$/.test(host) ? (_a = deal.url.match(/\/(?:dp|gp\/product)\/([A-Z0-9]{10})/)) == null ? void 0 : _a[1] : void 0;
|
|
20
|
+
if (asin) return {
|
|
21
|
+
kind: "catalog",
|
|
22
|
+
retailer: "amazon",
|
|
23
|
+
productId: asin
|
|
24
|
+
};
|
|
25
|
+
const walmartItem = /(^|\.)walmart\.com$/.test(host) ? (_b = deal.url.match(/\/ip\/(?:[^/?#]+\/)?(\d{6,})/)) == null ? void 0 : _b[1] : void 0;
|
|
26
|
+
if (walmartItem) return {
|
|
27
|
+
kind: "catalog",
|
|
28
|
+
retailer: "walmart",
|
|
29
|
+
productId: walmartItem
|
|
30
|
+
};
|
|
31
|
+
return STORE_HOST.test(host) ? {
|
|
32
|
+
kind: "live",
|
|
33
|
+
url: deal.url
|
|
34
|
+
} : null;
|
|
35
|
+
}
|
|
36
|
+
async function watchDeal(deal) {
|
|
37
|
+
var _a;
|
|
38
|
+
const path = watchPathOf(deal);
|
|
39
|
+
if (!path) throw new Error("This deal has no store page to watch.");
|
|
40
|
+
const price = `$${deal.price.toFixed(deal.price % 1 ? 2 : 0)}`;
|
|
41
|
+
if (path.kind === "catalog") {
|
|
42
|
+
const {
|
|
43
|
+
alerts
|
|
44
|
+
} = await addPriceWatch({
|
|
45
|
+
retailer: path.retailer,
|
|
46
|
+
productId: path.productId,
|
|
47
|
+
targetPrice: deal.price,
|
|
48
|
+
name: deal.title,
|
|
49
|
+
url: deal.url,
|
|
50
|
+
price: deal.price
|
|
51
|
+
});
|
|
52
|
+
if (alerts && !alerts.armed) return `In your Watchlist. Alerts could not be turned on: ${(_a = alerts.error) != null ? _a : "try again later"}.`;
|
|
53
|
+
return `Watching: we'll tell you here and on your phone if it drops below ${price}.`;
|
|
54
|
+
}
|
|
55
|
+
await scheduleLivePriceCheck([{
|
|
56
|
+
url: path.url,
|
|
57
|
+
name: deal.title,
|
|
58
|
+
targetPrice: deal.price
|
|
59
|
+
}]);
|
|
60
|
+
return `Watching on your Computer every hour: we'll tell you if it drops below ${price}.`;
|
|
61
|
+
}export{watchDeal,watchPathOf};//# sourceMappingURL=watchDeal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchDeal.js","sources":["../../../../src/features/shopping/services/watchDeal.ts"],"sourcesContent":["/**\n * Native twin of the web surface's `services/watchDeal.ts` (0.49.0), verbatim.\n *\n * Watch a holiday deal: \"should I wait?\" answered by a price alert instead of a\n * guess. A deal is watched the way the Shop already watches products:\n *\n * - an Amazon or Walmart product the catalog knows (an ASIN, a Walmart item\n * id): pinned to the Watchlist, with the person's hourly price alerts;\n * - any other store's own product page: the live price check on their\n * Computer, hourly.\n *\n * A deal that only points at a deal site's thread cannot be watched (there is\n * no store page to read), and the card offers no Watch button for it.\n */\nimport type { BlackFridayDeal } from './blackFriday';\nimport { addPriceWatch } from './catalogProductSearch';\nimport { scheduleLivePriceCheck } from './livePriceCheckClient';\n\n/** Stores whose product pages the live check reads. */\nconst STORE_HOST =\n /(^|\\.)(amazon|walmart|target|bestbuy|costco|samsclub|bjs|ebay|kohls|macys|nordstrom|homedepot|lowes|newegg|bhphotovideo|adorama|dell|lenovo|samsung|hp|gamestop|ulta|sephora|rei|lego|nike|adidas|staples|officedepot|wayfair|ikea|gap|oldnavy)\\.com$/i;\n\nexport type WatchPath =\n | { kind: 'catalog'; retailer: 'amazon' | 'walmart'; productId: string }\n | { kind: 'live'; url: string }\n | null;\n\nconst hostOf = (url: string): string => {\n try {\n return new URL(url).hostname.toLowerCase();\n } catch {\n return '';\n }\n};\n\n/** How a deal can be watched, or null when it cannot. */\nexport function watchPathOf(deal: Pick<BlackFridayDeal, 'store' | 'url' | 'productId'>): WatchPath {\n const host = hostOf(deal.url);\n if (/^amazon/i.test(deal.store) && deal.productId && /^[A-Z0-9]{10}$/.test(deal.productId)) {\n return { kind: 'catalog', retailer: 'amazon', productId: deal.productId };\n }\n const asin = /(^|\\.)amazon\\.com$/.test(host)\n ? deal.url.match(/\\/(?:dp|gp\\/product)\\/([A-Z0-9]{10})/)?.[1]\n : undefined;\n if (asin) return { kind: 'catalog', retailer: 'amazon', productId: asin };\n const walmartItem = /(^|\\.)walmart\\.com$/.test(host)\n ? deal.url.match(/\\/ip\\/(?:[^/?#]+\\/)?(\\d{6,})/)?.[1]\n : undefined;\n if (walmartItem) return { kind: 'catalog', retailer: 'walmart', productId: walmartItem };\n return STORE_HOST.test(host) ? { kind: 'live', url: deal.url } : null;\n}\n\n/** Watch the deal; what to tell the shopper. Throws when the watch could not be set. */\nexport async function watchDeal(deal: BlackFridayDeal): Promise<string> {\n const path = watchPathOf(deal);\n if (!path) throw new Error('This deal has no store page to watch.');\n const price = `$${deal.price.toFixed(deal.price % 1 ? 2 : 0)}`;\n if (path.kind === 'catalog') {\n const { alerts } = await addPriceWatch({\n retailer: path.retailer,\n productId: path.productId,\n targetPrice: deal.price,\n name: deal.title,\n url: deal.url,\n price: deal.price,\n });\n if (alerts && !alerts.armed)\n return `In your Watchlist. Alerts could not be turned on: ${alerts.error ?? 'try again later'}.`;\n return `Watching: we'll tell you here and on your phone if it drops below ${price}.`;\n }\n await scheduleLivePriceCheck([{ url: path.url, name: deal.title, targetPrice: deal.price }]);\n return `Watching on your Computer every hour: we'll tell you if it drops below ${price}.`;\n}\n"],"names":[],"mappings":"qHAmBA,MAAM,UAAa,GAAA,wPAAA;AASnB,MAAM,MAAA,GAAS,CAAC,GAAwB,KAAA;AACtC,EAAI,IAAA;AACF,IAAA,OAAO,IAAI,GAAA,CAAI,GAAG,CAAA,CAAE,SAAS,WAAY,EAAA;AAAA,GACnC,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,EAAA;AAAA;AAEX,CAAA;AAGO,SAAS,YAAY,IAAuE,EAAA;AArCnG,EAAA,IAAA,EAAA,EAAA,EAAA;AAsCE,EAAM,MAAA,IAAA,GAAO,MAAO,CAAA,IAAA,CAAK,GAAG,CAAA;AAC5B,EAAI,IAAA,UAAA,CAAW,IAAK,CAAA,IAAA,CAAK,KAAK,CAAA,IAAK,IAAK,CAAA,SAAA,IAAa,gBAAiB,CAAA,IAAA,CAAK,IAAK,CAAA,SAAS,CAAG,EAAA;AAC1F,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,SAAA;AAAA,MACN,QAAU,EAAA,QAAA;AAAA,MACV,WAAW,IAAK,CAAA;AAAA,KAClB;AAAA;AAEF,EAAM,MAAA,IAAA,GAAO,oBAAqB,CAAA,IAAA,CAAK,IAAI,CAAA,GAAA,CAAI,EAAK,GAAA,IAAA,CAAA,GAAA,CAAI,KAAM,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K,CAAA,KAAA;AAAA,MAClB,MAAM,IAAK,CAAA,KAAA;AAAA,MACX,KAAK,IAAK,CAAA,GAAA;AAAA,MACV,OAAO,IAAK,CAAA;AAAA,KACb,CAAA;AACD,IAAI,IAAA,MAAA,IAAU,CAAC,MAAO,CAAA,KAAA,SAAc,CAAqD,kDAAA,EAAA,CAAA,EAAA,GAAA,MAAA,CAAO,KAAP,KAAA,IAAA,GAAA,EAAA,GAAgB,iBAAiB,CAAA,CAAA,CAAA;AAC1H,IAAA,OAAO,qEAAqE,KAAK,CAAA,CAAA,CAAA;AAAA;AAEnF,EAAA,MAAM,uBAAuB,CAAC;AAAA,IAC5B,KAAK,IAAK,CAAA,GAAA;AAAA,IACV,MAAM,IAAK,CAAA,KAAA;AAAA,IACX,aAAa,IAAK,CAAA;AAAA,GACnB,CAAC,CAAA;AACF,EAAA,OAAO,0EAA0E,KAAK,CAAA,CAAA,CAAA;AACxF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
1
|
+
import {followAccount}from'./state/accountCaches.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -34,6 +34,10 @@ function shoppingBrainTask() {
|
|
|
34
34
|
ok: false
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
37
|
+
function shoppingAskModel() {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_a = current.askModel) != null ? _a : (async () => Promise.reject(new Error("the model is unavailable (not wired)")));
|
|
40
|
+
}
|
|
37
41
|
let current = EMPTY;
|
|
38
42
|
function setShoppingRuntime(next) {
|
|
39
43
|
var _a;
|
|
@@ -42,6 +46,7 @@ function setShoppingRuntime(next) {
|
|
|
42
46
|
shoppingSearch: __spreadValues(__spreadValues({}, EMPTY.config.shoppingSearch), (_a = next.config) == null ? void 0 : _a.shoppingSearch)
|
|
43
47
|
})
|
|
44
48
|
});
|
|
49
|
+
followAccount(current.token);
|
|
45
50
|
}
|
|
46
51
|
function getShoppingRuntime() {
|
|
47
52
|
return current;
|
|
@@ -69,4 +74,4 @@ function unwrapConnectorEnvelope(raw) {
|
|
|
69
74
|
}
|
|
70
75
|
function isShoppingOpeningMiss(value) {
|
|
71
76
|
return typeof value === "object" && value !== null && (value.miss === "not-opened" || value.miss === "no-products");
|
|
72
|
-
}export{getShoppingRuntime,isShoppingOpeningMiss,setShoppingRuntime,shoppingBrainTask,unwrapConnectorEnvelope};//# sourceMappingURL=shoppingRuntime.js.map
|
|
77
|
+
}export{getShoppingRuntime,isShoppingOpeningMiss,setShoppingRuntime,shoppingAskModel,shoppingBrainTask,unwrapConnectorEnvelope};//# sourceMappingURL=shoppingRuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shoppingRuntime.js","sources":["../../../src/features/shopping/shoppingRuntime.ts"],"sourcesContent":["/**\n * Host-services contract for native shopping — twin of the web surface's\n * `ShoppingSurfaceServices`. The experience installs this before a search\n * runs so connector modules stay host-agnostic.\n */\n\nexport interface ConnectorExecutionResult<T = unknown> {\n success: boolean;\n data?: T;\n error?: string;\n}\n\nexport type ConnectorExec = <T = unknown>(\n connector: string,\n action: string,\n params: Record<string, unknown>,\n) => Promise<ConnectorExecutionResult<T>>;\n\nexport interface ShoppingSurfaceConfig {\n shoppingSearch?: {\n catalogEnabled?: boolean;\n parallelApiKey?: string;\n rapidApiKey?: string;\n lemmebuyitApiKey?: string;\n /** Coupon feeds (connector first-aid 009). */\n linkmydealsApiKey?: string;\n couponApiKey?: string;\n /**\n * Run the coupon lane though the app holds no feed key: the connector\n * resolves the feed credentials backend-side (web `services.ts`\n * `couponsEnabled`, set by web standalone).\n */\n couponsEnabled?: boolean;\n /**\n * Show the Google Shopping offers lane (better-price, deals) though the\n * app holds no RapidAPI key: the connector resolves it backend-side\n * (web `services.ts` `offersEnabled`).\n */\n offersEnabled?: boolean;\n llmApiKey?: string;\n llmEndpoint?: string;\n llmModel?: string;\n };\n}\n\n// ─── Brain classify seam (web `services.ts` `BrainTask`) ────────────────────\nexport type BrainTaskResult<T> = { ok: true; intent: T | null } | { ok: false };\nexport interface BrainTaskOptions {\n timeoutMs?: number;\n signal?: AbortSignal;\n}\nexport type BrainTask = <T>(\n task: 'travel' | 'shopping',\n text: string,\n opts?: BrainTaskOptions,\n) => Promise<BrainTaskResult<T>>;\n\n// ─── Optional host override for the live product-page check ────────────────\n/** Mirror of the web `page-check/pageChecker` result: is the link alive, what does the page say. */\nexport interface ProductPageCheck {\n status: 'ok' | 'dead' | 'unverified';\n httpStatus?: number;\n finalUrl?: string;\n facts?: {\n isProduct: boolean;\n title?: string;\n price?: number;\n currency?: string;\n originalPrice?: number;\n availability: 'in_stock' | 'out_of_stock' | 'unknown';\n };\n reason?: string;\n}\n/** Check one product link through a host lane. Must never throw - return `{status: 'unverified'}` instead. */\nexport type CheckProductPage = (pageUrl: string) => Promise<ProductPageCheck | null>;\n\nexport interface ShoppingRuntime {\n exec: ConnectorExec;\n config: ShoppingSurfaceConfig;\n /**\n * yantra-brain's classify call (`task: 'shopping'`). The experience wires\n * `brainTaskViaBrain` (services/brainQuickReply); absent, the brain\n * \"declines\" (`ok:false`) and the structural parser takes over, as web's\n * EMPTY_SERVICES does.\n */\n brainTask?: BrainTask;\n /** Optional host lane for product-page checks; the shopping subgraph is asked when absent or null. */\n checkProductPage?: CheckProductPage;\n /**\n * The surface session token the host handed the experience: the bearer for\n * the shopping subgraph (services/shoppingSubgraph) when the session renewer\n * holds none.\n */\n token?: string | null;\n}\n\nconst EMPTY: ShoppingRuntime = {\n config: { shoppingSearch: { catalogEnabled: true } },\n exec: async () => ({ success: false, error: 'Shopping: no connector executor wired.' }),\n};\n\n/** The brain seam, or the declining default when the host wired none. */\nexport function shoppingBrainTask(): BrainTask {\n return current.brainTask ?? (async () => ({ ok: false }));\n}\n\nlet current: ShoppingRuntime = EMPTY;\n\nexport function setShoppingRuntime(next: Partial<ShoppingRuntime>): void {\n current = {\n ...EMPTY,\n ...next,\n config: {\n ...EMPTY.config,\n ...next.config,\n shoppingSearch: {\n ...EMPTY.config.shoppingSearch,\n ...next.config?.shoppingSearch,\n },\n },\n };\n}\n\nexport function getShoppingRuntime(): ShoppingRuntime {\n return current;\n}\n\nexport function unwrapConnectorEnvelope<T>(raw: unknown): ConnectorExecutionResult<T> {\n if (raw && typeof raw === 'object') {\n const row = raw as { successful?: boolean; success?: boolean; data?: unknown; error?: unknown };\n if ('data' in row && ('successful' in row || 'success' in row)) {\n const ok = row.successful ?? row.success;\n if (ok === false) return { success: false, error: String(row.error ?? 'Connector action failed') };\n return { success: true, data: row.data as T };\n }\n }\n return { success: true, data: raw as T };\n}\n\n/**\n * Why a card opened the page without its products (web `services.ts`) - said on\n * the page, because a landing page alone reads as \"it found nothing\".\n *\n * - `not-opened`: the card's result could not be read here.\n * - `no-products`: it was read, but the reply sent no product list with it.\n */\nexport interface ShoppingOpeningMiss {\n miss: 'not-opened' | 'no-products';\n}\n\nexport function isShoppingOpeningMiss(value: unknown): value is ShoppingOpeningMiss {\n return (\n typeof value === 'object' &&\n value !== null &&\n ((value as ShoppingOpeningMiss).miss === 'not-opened' || (value as ShoppingOpeningMiss).miss === 'no-products')\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"shoppingRuntime.js","sources":["../../../src/features/shopping/shoppingRuntime.ts"],"sourcesContent":["/**\n * Host-services contract for native shopping — twin of the web surface's\n * `ShoppingSurfaceServices`. The experience installs this before a search\n * runs so connector modules stay host-agnostic.\n */\n\nimport type { AskModel } from './services/modelStep';\nimport { followAccount } from './state/accountCaches';\n\nexport interface ConnectorExecutionResult<T = unknown> {\n success: boolean;\n data?: T;\n error?: string;\n}\n\nexport type ConnectorExec = <T = unknown>(\n connector: string,\n action: string,\n params: Record<string, unknown>,\n) => Promise<ConnectorExecutionResult<T>>;\n\nexport interface ShoppingSurfaceConfig {\n shoppingSearch?: {\n catalogEnabled?: boolean;\n parallelApiKey?: string;\n rapidApiKey?: string;\n lemmebuyitApiKey?: string;\n /** Coupon feeds (connector first-aid 009). */\n linkmydealsApiKey?: string;\n couponApiKey?: string;\n /**\n * Run the coupon lane though the app holds no feed key: the connector\n * resolves the feed credentials backend-side (web `services.ts`\n * `couponsEnabled`, set by web standalone).\n */\n couponsEnabled?: boolean;\n /**\n * Show the Google Shopping offers lane (better-price, deals) though the\n * app holds no RapidAPI key: the connector resolves it backend-side\n * (web `services.ts` `offersEnabled`).\n */\n offersEnabled?: boolean;\n llmApiKey?: string;\n llmEndpoint?: string;\n llmModel?: string;\n };\n}\n\n// ─── Brain classify seam (web `services.ts` `BrainTask`) ────────────────────\nexport type BrainTaskResult<T> = { ok: true; intent: T | null } | { ok: false };\nexport interface BrainTaskOptions {\n timeoutMs?: number;\n signal?: AbortSignal;\n}\nexport type BrainTask = <T>(\n task: 'travel' | 'shopping',\n text: string,\n opts?: BrainTaskOptions,\n) => Promise<BrainTaskResult<T>>;\n\n// ─── Optional host override for the live product-page check ────────────────\n/** Mirror of the web `page-check/pageChecker` result: is the link alive, what does the page say. */\nexport interface ProductPageCheck {\n status: 'ok' | 'dead' | 'unverified';\n httpStatus?: number;\n finalUrl?: string;\n facts?: {\n isProduct: boolean;\n title?: string;\n price?: number;\n currency?: string;\n originalPrice?: number;\n availability: 'in_stock' | 'out_of_stock' | 'unknown';\n };\n reason?: string;\n}\n/** Check one product link through a host lane. Must never throw - return `{status: 'unverified'}` instead. */\nexport type CheckProductPage = (pageUrl: string) => Promise<ProductPageCheck | null>;\n\nexport interface ShoppingRuntime {\n exec: ConnectorExec;\n config: ShoppingSurfaceConfig;\n /**\n * yantra-brain's classify call (`task: 'shopping'`). The experience wires\n * `brainTaskViaBrain` (services/brainQuickReply); absent, the brain\n * \"declines\" (`ok:false`) and the structural parser takes over, as web's\n * EMPTY_SERVICES does.\n */\n brainTask?: BrainTask;\n /**\n * One model step with a tool on the agent's `/v1/chat/completions` (web\n * `services/modelStep` `askModelOneStep`): the AI reading of the search's rows\n * (services/aiRelevance). The experience wires `createModelStep(token,\n * indexUrl)`; absent, every ask fails and the rows paint as the word rules\n * left them.\n */\n askModel?: AskModel;\n /** Optional host lane for product-page checks; the shopping subgraph is asked when absent or null. */\n checkProductPage?: CheckProductPage;\n /**\n * The surface session token the host handed the experience: the bearer for\n * the shopping subgraph (services/shoppingSubgraph) when the session renewer\n * holds none.\n */\n token?: string | null;\n}\n\nconst EMPTY: ShoppingRuntime = {\n config: { shoppingSearch: { catalogEnabled: true } },\n exec: async () => ({ success: false, error: 'Shopping: no connector executor wired.' }),\n};\n\n/** The brain seam, or the declining default when the host wired none. */\nexport function shoppingBrainTask(): BrainTask {\n return current.brainTask ?? (async () => ({ ok: false }));\n}\n\n/** The model-step seam, or one that always fails (no verdict) when the host wired none. */\nexport function shoppingAskModel(): AskModel {\n return current.askModel ?? (async () => Promise.reject(new Error('the model is unavailable (not wired)')));\n}\n\nlet current: ShoppingRuntime = EMPTY;\n\nexport function setShoppingRuntime(next: Partial<ShoppingRuntime>): void {\n current = {\n ...EMPTY,\n ...next,\n config: {\n ...EMPTY.config,\n ...next.config,\n shoppingSearch: {\n ...EMPTY.config.shoppingSearch,\n ...next.config?.shoppingSearch,\n },\n },\n };\n // The experience installed another account's token: the Shop's cached reads go (web `followAccount`).\n followAccount(current.token);\n}\n\nexport function getShoppingRuntime(): ShoppingRuntime {\n return current;\n}\n\nexport function unwrapConnectorEnvelope<T>(raw: unknown): ConnectorExecutionResult<T> {\n if (raw && typeof raw === 'object') {\n const row = raw as { successful?: boolean; success?: boolean; data?: unknown; error?: unknown };\n if ('data' in row && ('successful' in row || 'success' in row)) {\n const ok = row.successful ?? row.success;\n if (ok === false) return { success: false, error: String(row.error ?? 'Connector action failed') };\n return { success: true, data: row.data as T };\n }\n }\n return { success: true, data: raw as T };\n}\n\n/**\n * Why a card opened the page without its products (web `services.ts`) - said on\n * the page, because a landing page alone reads as \"it found nothing\".\n *\n * - `not-opened`: the card's result could not be read here.\n * - `no-products`: it was read, but the reply sent no product list with it.\n */\nexport interface ShoppingOpeningMiss {\n miss: 'not-opened' | 'no-products';\n}\n\nexport function isShoppingOpeningMiss(value: unknown): value is ShoppingOpeningMiss {\n return (\n typeof value === 'object' &&\n value !== null &&\n ((value as ShoppingOpeningMiss).miss === 'not-opened' || (value as ShoppingOpeningMiss).miss === 'no-products')\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmGA,MAAM,KAAyB,GAAA;AAAA,EAC7B,MAAQ,EAAA;AAAA,IACN,cAAgB,EAAA;AAAA,MACd,cAAgB,EAAA;AAAA;AAClB,GACF;AAAA,EACA,MAAM,aAAa;AAAA,IACjB,OAAS,EAAA,KAAA;AAAA,IACT,KAAO,EAAA;AAAA,GACT;AACF,CAAA;AAGO,SAAS,iBAA+B,GAAA;AAhH/C,EAAA,IAAA,EAAA;AAiHE,EAAO,OAAA,CAAA,EAAA,GAAA,OAAA,CAAQ,SAAR,KAAA,IAAA,GAAA,EAAA,IAAsB,aAAa;AAAA,IACxC,EAAI,EAAA;AAAA,GACN,CAAA,CAAA;AACF;AAGO,SAAS,gBAA6B,GAAA;AAvH7C,EAAA,IAAA,EAAA;AAwHE,EAAO,OAAA,CAAA,EAAA,GAAA,OAAA,CAAQ,aAAR,IAAqB,GAAA,EAAA,IAAA,YAAY,QAAQ,MAAO,CAAA,IAAI,KAAM,CAAA,sCAAsC,CAAC,CAAA,CAAA;AAC1G;AACA,IAAI,OAA2B,GAAA,KAAA;AACxB,SAAS,mBAAmB,IAAsC,EAAA;AA3HzE,EAAA,IAAA,EAAA;AA4HE,EAAU,OAAA,GAAA,aAAA,CAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EACL,QACA,IAFK,CAAA,EAAA;AAAA,IAGR,MAAQ,EAAA,aAAA,CAAA,cAAA,CAAA,cAAA,CAAA,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B,IAAA,KAAA,CAA8B,IAAS,KAAA,aAAA,CAAA;AACzJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {tokenSubject}from'../../computer/computerChat.js';const forgetters = /* @__PURE__ */ new Set();
|
|
2
|
+
let account = "";
|
|
3
|
+
function onAccountChange(forget) {
|
|
4
|
+
forgetters.add(forget);
|
|
5
|
+
return () => forgetters.delete(forget);
|
|
6
|
+
}
|
|
7
|
+
function followAccount(token) {
|
|
8
|
+
const who = tokenSubject(token == null ? void 0 : token.replace(/^Bearer\s+/i, ""));
|
|
9
|
+
if (!who) return;
|
|
10
|
+
if (account && who !== account) {
|
|
11
|
+
for (const forget of [...forgetters]) {
|
|
12
|
+
try {
|
|
13
|
+
forget();
|
|
14
|
+
} catch (err) {
|
|
15
|
+
console.warn("[shopping] dropping a cached read failed:", err);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
account = who;
|
|
20
|
+
}export{followAccount,onAccountChange};//# sourceMappingURL=accountCaches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountCaches.js","sources":["../../../../src/features/shopping/state/accountCaches.ts"],"sourcesContent":["/**\n * Another account, fresh reads - the native half of web `utils/queryClient.ts`\n * `followAccount` (0.49.0). Web keeps the Shop's reads (trending rails, deal\n * rails, the holiday section's answers and deal alerts) on one react-query\n * client and clears it when a bearer for another account is seen. Native keeps\n * the same reads in module caches, so each registers how it forgets\n * ({@link onAccountChange}) and the readers of the bearer call\n * {@link followAccount}: the subgraph on every request (as web) and the runtime\n * when the experience installs its token.\n */\nimport { tokenSubject } from '../../computer/computerChat';\n\nconst forgetters = new Set<() => void>();\nlet account = '';\n\n/** Run `forget` whenever another account signs in; returns the unregister. */\nexport function onAccountChange(forget: () => void): () => void {\n forgetters.add(forget);\n return () => forgetters.delete(forget);\n}\n\n/** Call with the bearer whenever it is read; another account drops every cached read. */\nexport function followAccount(token: string | null | undefined): void {\n const who = tokenSubject(token?.replace(/^Bearer\\s+/i, ''));\n if (!who) return;\n if (account && who !== account) {\n for (const forget of [...forgetters]) {\n try {\n forget();\n } catch (err) {\n console.warn('[shopping] dropping a cached read failed:', err);\n }\n }\n }\n account = who;\n}\n\n/** Tests: forget whose reads are cached. */\nexport function resetAccountForTests(): void {\n account = '';\n}\n"],"names":[],"mappings":"0DAWA,MAAM,UAAA,uBAAiB,GAAgB,EAAA;AACvC,IAAI,OAAU,GAAA,EAAA;AAGP,SAAS,gBAAgB,MAAgC,EAAA;AAC9D,EAAA,UAAA,CAAW,IAAI,MAAM,CAAA;AACrB,EAAO,OAAA,MAAM,UAAW,CAAA,MAAA,CAAO,MAAM,CAAA;AACvC;AAGO,SAAS,cAAc,KAAwC,EAAA;AACpE,EAAA,MAAM,GAAM,GAAA,YAAA,CAAa,KAAO,IAAA,IAAA,GAAA,MAAA,GAAA,KAAA,CAAA,OAAA,CAAQ,eAAe,EAAG,CAAA,CAAA;AAC1D,EAAA,IAAI,CAAC,GAAK,EAAA;AACV,EAAI,IAAA,OAAA,IAAW,QAAQ,OAAS,EAAA;AAC9B,IAAA,KAAA,MAAW,MAAU,IAAA,CAAC,GAAG,UAAU,CAAG,EAAA;AACpC,MAAI,IAAA;AACF,QAAO,MAAA,EAAA;AAAA,eACA,GAAK,EAAA;AACZ,QAAQ,OAAA,CAAA,IAAA,CAAK,6CAA6C,GAAG,CAAA;AAAA;AAC/D;AACF;AAEF,EAAU,OAAA,GAAA,GAAA;AACZ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {useSyncExternalStore}from'react';let current = null;
|
|
2
|
+
let counter = 0;
|
|
3
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
4
|
+
function requestHolidayDeals(query) {
|
|
5
|
+
counter += 1;
|
|
6
|
+
current = {
|
|
7
|
+
query: query.trim(),
|
|
8
|
+
nonce: counter
|
|
9
|
+
};
|
|
10
|
+
for (const listener of listeners) listener();
|
|
11
|
+
return current;
|
|
12
|
+
}
|
|
13
|
+
function getHolidayDealsRequest() {
|
|
14
|
+
return current;
|
|
15
|
+
}
|
|
16
|
+
const subscribe = (listener) => {
|
|
17
|
+
listeners.add(listener);
|
|
18
|
+
return () => listeners.delete(listener);
|
|
19
|
+
};
|
|
20
|
+
function useHolidayDealsRequest() {
|
|
21
|
+
return useSyncExternalStore(subscribe, getHolidayDealsRequest, () => null);
|
|
22
|
+
}export{getHolidayDealsRequest,requestHolidayDeals,useHolidayDealsRequest};//# sourceMappingURL=holidayDealsRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holidayDealsRequest.js","sources":["../../../../src/features/shopping/state/holidayDealsRequest.ts"],"sourcesContent":["/**\n * Native twin of the web surface's `state/holidayDealsRequest.ts` (0.49.0),\n * verbatim. On native the chat is `chat/shoppingTurn.ts` (via the agent pane)\n * and the page is `ShoppingExperience` / the holiday deals panel.\n *\n * \"Black Friday deals on a 65 inch TV\" asked in the Shop's chat opens the\n * holiday deals section on that search. The chat (ShoppingSearchContext) and\n * the page (ShoppingLandingPage, BlackFridayPanel) do not share a parent that\n * could pass it down, so the ask travels through this small external store:\n * the chat puts a request, the page switches to the section, the panel runs\n * the search. Each request has its own nonce, so asking the same words twice\n * runs twice.\n */\nimport { useSyncExternalStore } from 'react';\n\nexport interface HolidayDealsRequest {\n query: string;\n nonce: number;\n}\n\nlet current: HolidayDealsRequest | null = null;\nlet counter = 0;\nconst listeners = new Set<() => void>();\n\n/** Open the holiday deals section on `query` (empty: the season's best). */\nexport function requestHolidayDeals(query: string): HolidayDealsRequest {\n counter += 1;\n current = { query: query.trim(), nonce: counter };\n for (const listener of listeners) listener();\n return current;\n}\n\nexport function getHolidayDealsRequest(): HolidayDealsRequest | null {\n return current;\n}\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n};\n\n/** The latest request, or null when none was made in this page's life. */\nexport function useHolidayDealsRequest(): HolidayDealsRequest | null {\n return useSyncExternalStore(subscribe, getHolidayDealsRequest, () => null);\n}\n\n/** Tests only. */\nexport function resetHolidayDealsRequestForTests(): void {\n current = null;\n}\n"],"names":[],"mappings":"yCAkBA,IAAI,OAAsC,GAAA,IAAA;AAC1C,IAAI,OAAU,GAAA,CAAA;AACd,MAAM,SAAA,uBAAgB,GAAgB,EAAA;AAG/B,SAAS,oBAAoB,KAAoC,EAAA;AACtE,EAAW,OAAA,IAAA,CAAA;AACX,EAAU,OAAA,GAAA;AAAA,IACR,KAAA,EAAO,MAAM,IAAK,EAAA;AAAA,IAClB,KAAO,EAAA;AAAA,GACT;AACA,EAAW,KAAA,MAAA,QAAA,IAAY,WAAoB,QAAA,EAAA;AAC3C,EAAO,OAAA,OAAA;AACT;AACO,SAAS,sBAAqD,GAAA;AACnE,EAAO,OAAA,OAAA;AACT;AACA,MAAM,SAAA,GAAY,CAAC,QAAyB,KAAA;AAC1C,EAAA,SAAA,CAAU,IAAI,QAAQ,CAAA;AACtB,EAAO,OAAA,MAAM,SAAU,CAAA,MAAA,CAAO,QAAQ,CAAA;AACxC,CAAA;AAGO,SAAS,sBAAqD,GAAA;AACnE,EAAA,OAAO,oBAAqB,CAAA,SAAA,EAAW,sBAAwB,EAAA,MAAM,IAAI,CAAA;AAC3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {jsxs,Fragment,jsx}from'react/jsx-runtime';import {useMemo,useState,useEffect}from'react';import {StyleSheet,Pressable,View,Modal,Text,ScrollView,Linking}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {TrailerPlayer}from'../../movies/components/TrailerPlayer.js';import {ownTutorial,tutorialsFor}from'./shoppingTutorials.js';import {useTutorialSeen,useTutorialWatched,hydrateTutorialSeen,markSeen,markWatched,watchUrl}from'./tutorials.js';const TUTORIAL_SURFACE = "shopping";
|
|
2
|
-
const SCREENS = ["shop", "deals", "watchlist", "saved", "history", "orders"];
|
|
2
|
+
const SCREENS = ["shop", "blackfriday", "deals", "watchlist", "saved", "history", "orders"];
|
|
3
3
|
function tutorialButtonLabel(own, count) {
|
|
4
4
|
if (own) return `Watch the tutorial: ${own.title}`;
|
|
5
5
|
return `No video for this page yet. See all ${count} tutorials`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShoppingTutorialDock.js","sources":["../../../../src/features/shopping/tutorials/ShoppingTutorialDock.tsx"],"sourcesContent":["/**\n * The storefront's tutorials - native twin of web\n * `tutorials/ShoppingTutorialDock.tsx` (0.37.0): a round gold play button at\n * the bottom right, and once pressed, this screen's film first and the rest\n * listed under it.\n *\n * As on web, the film plays in the panel: the player sits on top (the Movies\n * trailer player - YouTube's privacy-enhanced embed, no browser handoff), the\n * screen's own film first, and tapping another film in the list plays that one\n * in place. \"Open on YouTube\" is the only way out. Native differences: the\n * panel is a bottom sheet, and there is no first-visit autoplay - the film\n * starts when the shopper opens the panel.\n * Until the shopper has opened this screen's list once, the button wears a dot\n * - the \"seen\" record (AsyncStorage) the web uses to stop its autoplay. Films\n * already opened carry a tick. The button floats above the agent button, so the\n * compare tray (level with the agent button) never meets it.\n */\nimport React, { useEffect, useMemo, useState } from 'react';\nimport {\n Linking,\n Modal,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n View,\n type StyleProp,\n type ViewStyle,\n} from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { TrailerPlayer } from '../../movies/components/TrailerPlayer';\nimport { ownTutorial, tutorialsFor, type ShoppingView } from './shoppingTutorials';\nimport {\n hydrateTutorialSeen,\n markSeen,\n markWatched,\n useTutorialSeen,\n useTutorialWatched,\n watchUrl,\n type Tutorial,\n} from './tutorials';\n\nexport const TUTORIAL_SURFACE = 'shopping';\nconst SCREENS: readonly ShoppingView[] = ['shop', 'deals', 'watchlist', 'saved', 'history', 'orders'];\n\nexport function tutorialButtonLabel(own: Tutorial | null, count: number): string {\n if (own) return `Watch the tutorial: ${own.title}`;\n return `No video for this page yet. See all ${count} tutorials`;\n}\n\nexport interface ShoppingTutorialDockProps {\n view: ShoppingView;\n catalogEnabled: boolean;\n style?: StyleProp<ViewStyle>;\n isDark?: boolean;\n /** The session's surface host: the player page's https origin (the embed refuses a page with none). */\n indexUrl: string;\n}\n\nexport function ShoppingTutorialDock({\n view,\n catalogEnabled,\n style,\n isDark = false,\n indexUrl,\n}: ShoppingTutorialDockProps) {\n const own = ownTutorial(view, catalogEnabled);\n const tutorials = useMemo(() => tutorialsFor(view, catalogEnabled), [view, catalogEnabled]);\n const [open, setOpen] = useState(false);\n const [playingId, setPlayingId] = useState<string | null>(null);\n const seen = useTutorialSeen(TUTORIAL_SURFACE, view);\n const watched = useTutorialWatched(TUTORIAL_SURFACE);\n\n useEffect(() => {\n void hydrateTutorialSeen(TUTORIAL_SURFACE, SCREENS);\n }, []);\n // A tutorial belongs to its screen: a new tab closes the list.\n useEffect(() => setOpen(false), [view]);\n\n if (tutorials.length === 0) return null;\n\n const sheet = isDark ? '#0f172a' : '#0b1220';\n // The film in the player: the one picked from the list, else this screen's own, else the first.\n const playing = tutorials.find((t) => t.id === playingId) ?? own ?? tutorials[0];\n const play = (tutorial: Tutorial) => {\n markWatched(TUTORIAL_SURFACE, tutorial.id);\n setPlayingId(tutorial.id);\n };\n const close = () => {\n setOpen(false);\n setPlayingId(null);\n };\n\n return (\n <>\n <Pressable\n onPress={() => {\n markSeen(TUTORIAL_SURFACE, view);\n if (playing) markWatched(TUTORIAL_SURFACE, playing.id);\n setOpen(true);\n }}\n accessibilityRole=\"button\"\n accessibilityLabel={tutorialButtonLabel(own, tutorials.length)}\n testID=\"shopping-tutorial-toggle\"\n style={[styles.button, style]}\n >\n <MaterialCommunityIcons name=\"play-circle-outline\" size={22} color=\"#1a1408\" />\n {own && !seen ? <View style={styles.dot} testID=\"shopping-tutorial-new\" /> : null}\n </Pressable>\n <Modal visible={open} transparent animationType=\"slide\" onRequestClose={close}>\n <Pressable\n style={styles.backdrop}\n onPress={close}\n accessibilityLabel=\"Close tutorials\"\n testID=\"shopping-tutorial-backdrop\"\n />\n <View style={[styles.sheet, { backgroundColor: sheet }]} testID=\"shopping-tutorial-panel\">\n {playing ? (\n <View style={styles.player} testID=\"shopping-tutorial-player\">\n <TrailerPlayer key={playing.id} videoId={playing.id} indexUrl={indexUrl} onClose={close} />\n </View>\n ) : null}\n <View style={styles.head}>\n <View style={styles.headText}>\n <Text style={styles.kicker}>{own ? 'TUTORIAL' : 'NO VIDEO FOR THIS PAGE YET'}</Text>\n {playing ? <Text style={styles.heading}>{playing.title}</Text> : null}\n {playing ? <Text style={styles.filmAbout}>{playing.about}</Text> : null}\n </View>\n <Pressable\n onPress={close}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Hide tutorial\"\n hitSlop={8}\n >\n <MaterialCommunityIcons name=\"close\" size={20} color=\"rgba(255,255,255,0.7)\" />\n </Pressable>\n </View>\n <ScrollView contentContainerStyle={styles.list}>\n {tutorials.map((tutorial) => {\n const isOwn = tutorial === own;\n const isPlaying = tutorial === playing;\n const done = watched.has(tutorial.id);\n return (\n <Pressable\n key={tutorial.id}\n onPress={() => play(tutorial)}\n accessibilityRole=\"button\"\n accessibilityLabel={`Play ${tutorial.title}`}\n accessibilityState={{ selected: isPlaying }}\n testID=\"shopping-tutorial-film\"\n style={[styles.film, isOwn && styles.filmOwn, isPlaying && styles.filmPlaying]}\n >\n <View style={styles.filmIcon}>\n <MaterialCommunityIcons\n name={isPlaying ? 'volume-high' : done ? 'check' : 'play'}\n size={18}\n color=\"#1a1408\"\n />\n </View>\n <View style={styles.filmText}>\n {isOwn ? <Text style={styles.ownTag}>THIS SCREEN</Text> : null}\n <Text style={styles.filmTitle}>{tutorial.title}</Text>\n <Text style={styles.filmAbout}>{tutorial.about}</Text>\n </View>\n </Pressable>\n );\n })}\n {playing ? (\n <Pressable\n onPress={() => void Linking.openURL(watchUrl(playing.id)).catch(() => undefined)}\n accessibilityRole=\"link\"\n accessibilityLabel={`Open ${playing.title} on YouTube`}\n testID=\"shopping-tutorial-youtube\"\n style={styles.youtube}\n >\n <Text style={styles.youtubeText}>Open on YouTube</Text>\n <MaterialCommunityIcons name=\"open-in-new\" size={14} color=\"rgba(255,255,255,0.65)\" />\n </Pressable>\n ) : null}\n </ScrollView>\n </View>\n </Modal>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n button: {\n position: 'absolute',\n width: 44,\n height: 44,\n borderRadius: 22,\n backgroundColor: '#e8b84a',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 20,\n shadowColor: '#0f172a',\n shadowOpacity: 0.25,\n shadowRadius: 10,\n shadowOffset: { width: 0, height: 4 },\n elevation: 6,\n },\n dot: {\n position: 'absolute',\n top: 2,\n right: 2,\n width: 10,\n height: 10,\n borderRadius: 5,\n backgroundColor: '#b91c1c',\n borderWidth: 2,\n borderColor: '#e8b84a',\n },\n backdrop: { flex: 1, backgroundColor: 'rgba(11,18,32,0.45)' },\n sheet: {\n maxHeight: '88%',\n overflow: 'hidden',\n borderTopLeftRadius: 22,\n borderTopRightRadius: 22,\n paddingBottom: 28,\n },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 18,\n paddingTop: 16,\n paddingBottom: 8,\n },\n heading: { color: '#fff', fontSize: 17, fontWeight: '800' },\n headText: { flex: 1, minWidth: 0, gap: 4, paddingRight: 12 },\n kicker: { color: '#e8b84a', fontSize: 11, fontWeight: '800', letterSpacing: 1.5 },\n player: { width: '100%', aspectRatio: 16 / 9, backgroundColor: '#000' },\n filmPlaying: { backgroundColor: 'rgba(232,184,74,0.16)' },\n youtube: { flexDirection: 'row', alignItems: 'center', gap: 6, paddingHorizontal: 6, paddingTop: 6 },\n youtubeText: { color: 'rgba(255,255,255,0.75)', fontSize: 13, fontWeight: '600' },\n list: { paddingHorizontal: 12, gap: 8, paddingBottom: 8 },\n film: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n borderRadius: 14,\n padding: 12,\n backgroundColor: 'rgba(255,255,255,0.06)',\n },\n filmOwn: { borderWidth: 1, borderColor: 'rgba(232,184,74,0.5)' },\n filmIcon: {\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: '#e8b84a',\n alignItems: 'center',\n justifyContent: 'center',\n },\n filmText: { flex: 1, minWidth: 0, gap: 2 },\n ownTag: { color: '#e8b84a', fontSize: 10, fontWeight: '800', letterSpacing: 1 },\n filmTitle: { color: '#fff', fontSize: 14, fontWeight: '700' },\n filmAbout: { color: 'rgba(255,255,255,0.65)', fontSize: 12, lineHeight: 16 },\n});\n"],"names":[],"mappings":"ieAuBO,MAAM,gBAAmB,GAAA;AAChC,MAAM,UAAmC,CAAC,MAAA,EAAQ,SAAS,WAAa,EAAA,OAAA,EAAS,WAAW,QAAQ,CAAA;AACpF,SAAA,mBAAA,CAAoB,KAAsB,KAAuB,EAAA;AAC/E,EAAA,IAAI,GAAK,EAAA,OAAO,CAAuB,oBAAA,EAAA,GAAA,CAAI,KAAK,CAAA,CAAA;AAChD,EAAA,OAAO,uCAAuC,KAAK,CAAA,UAAA,CAAA;AACrD;AASO,SAAS,oBAAqB,CAAA;AAAA,EACnC,IAAA;AAAA,EACA,cAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAS,GAAA,KAAA;AAAA,EACT;AACF,CAA8B,EAAA;AA3C9B,EAAA,IAAA,EAAA,EAAA,EAAA;AA4CE,EAAM,MAAA,GAAA,GAAM,WAAY,CAAA,IAAA,EAAM,cAAc,CAAA;AAC5C,EAAM,MAAA,SAAA,GAAY,OAAQ,CAAA,MAAM,YAAa,CAAA,IAAA,EAAM,cAAc,CAAG,EAAA,CAAC,IAAM,EAAA,cAAc,CAAC,CAAA;AAC1F,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAwB,IAAI,CAAA;AAC9D,EAAM,MAAA,IAAA,GAAO,eAAgB,CAAA,gBAAA,EAAkB,IAAI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,UAAY,EAAA;AAAA,GACd;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,iBAAmB,EAAA,EAAA;AAAA,IACnB,GAAK,EAAA,CAAA;AAAA,IACL,aAAe,EAAA;AAAA,GACjB;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,aAAe,EAAA,KAAA;AAAA,IACf,UAAY,EAAA,QAAA;AAAA,IACZ,GAAK,EAAA,EAAA;AAAA,IACL,YAAc,EAAA,EAAA;AAAA,IACd,OAAS,EAAA,EAAA;AAAA,IACT,eAAiB,EAAA;AAAA,GACnB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,CAAA;AAAA,IACb,WAAa,EAAA;AAAA,GACf;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,EAAA;AAAA,IACd,eAAiB,EAAA,SAAA;AAAA,IACjB,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,CAAA;AAAA,IACN,QAAU,EAAA,CAAA;AAAA,IACV,GAAK,EAAA;AAAA,GACP;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,KAAA;AAAA,IACZ,aAAe,EAAA;AAAA,GACjB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,MAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,wBAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"ShoppingTutorialDock.js","sources":["../../../../src/features/shopping/tutorials/ShoppingTutorialDock.tsx"],"sourcesContent":["/**\n * The storefront's tutorials - native twin of web\n * `tutorials/ShoppingTutorialDock.tsx` (0.37.0): a round gold play button at\n * the bottom right, and once pressed, this screen's film first and the rest\n * listed under it.\n *\n * As on web, the film plays in the panel: the player sits on top (the Movies\n * trailer player - YouTube's privacy-enhanced embed, no browser handoff), the\n * screen's own film first, and tapping another film in the list plays that one\n * in place. \"Open on YouTube\" is the only way out. Native differences: the\n * panel is a bottom sheet, and there is no first-visit autoplay - the film\n * starts when the shopper opens the panel.\n * Until the shopper has opened this screen's list once, the button wears a dot\n * - the \"seen\" record (AsyncStorage) the web uses to stop its autoplay. Films\n * already opened carry a tick. The button floats above the agent button, so the\n * compare tray (level with the agent button) never meets it.\n */\nimport React, { useEffect, useMemo, useState } from 'react';\nimport {\n Linking,\n Modal,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n View,\n type StyleProp,\n type ViewStyle,\n} from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { TrailerPlayer } from '../../movies/components/TrailerPlayer';\nimport { ownTutorial, tutorialsFor, type ShoppingView } from './shoppingTutorials';\nimport {\n hydrateTutorialSeen,\n markSeen,\n markWatched,\n useTutorialSeen,\n useTutorialWatched,\n watchUrl,\n type Tutorial,\n} from './tutorials';\n\nexport const TUTORIAL_SURFACE = 'shopping';\nconst SCREENS: readonly ShoppingView[] = ['shop', 'blackfriday', 'deals', 'watchlist', 'saved', 'history', 'orders'];\n\nexport function tutorialButtonLabel(own: Tutorial | null, count: number): string {\n if (own) return `Watch the tutorial: ${own.title}`;\n return `No video for this page yet. See all ${count} tutorials`;\n}\n\nexport interface ShoppingTutorialDockProps {\n view: ShoppingView;\n catalogEnabled: boolean;\n style?: StyleProp<ViewStyle>;\n isDark?: boolean;\n /** The session's surface host: the player page's https origin (the embed refuses a page with none). */\n indexUrl: string;\n}\n\nexport function ShoppingTutorialDock({\n view,\n catalogEnabled,\n style,\n isDark = false,\n indexUrl,\n}: ShoppingTutorialDockProps) {\n const own = ownTutorial(view, catalogEnabled);\n const tutorials = useMemo(() => tutorialsFor(view, catalogEnabled), [view, catalogEnabled]);\n const [open, setOpen] = useState(false);\n const [playingId, setPlayingId] = useState<string | null>(null);\n const seen = useTutorialSeen(TUTORIAL_SURFACE, view);\n const watched = useTutorialWatched(TUTORIAL_SURFACE);\n\n useEffect(() => {\n void hydrateTutorialSeen(TUTORIAL_SURFACE, SCREENS);\n }, []);\n // A tutorial belongs to its screen: a new tab closes the list.\n useEffect(() => setOpen(false), [view]);\n\n if (tutorials.length === 0) return null;\n\n const sheet = isDark ? '#0f172a' : '#0b1220';\n // The film in the player: the one picked from the list, else this screen's own, else the first.\n const playing = tutorials.find((t) => t.id === playingId) ?? own ?? tutorials[0];\n const play = (tutorial: Tutorial) => {\n markWatched(TUTORIAL_SURFACE, tutorial.id);\n setPlayingId(tutorial.id);\n };\n const close = () => {\n setOpen(false);\n setPlayingId(null);\n };\n\n return (\n <>\n <Pressable\n onPress={() => {\n markSeen(TUTORIAL_SURFACE, view);\n if (playing) markWatched(TUTORIAL_SURFACE, playing.id);\n setOpen(true);\n }}\n accessibilityRole=\"button\"\n accessibilityLabel={tutorialButtonLabel(own, tutorials.length)}\n testID=\"shopping-tutorial-toggle\"\n style={[styles.button, style]}\n >\n <MaterialCommunityIcons name=\"play-circle-outline\" size={22} color=\"#1a1408\" />\n {own && !seen ? <View style={styles.dot} testID=\"shopping-tutorial-new\" /> : null}\n </Pressable>\n <Modal visible={open} transparent animationType=\"slide\" onRequestClose={close}>\n <Pressable\n style={styles.backdrop}\n onPress={close}\n accessibilityLabel=\"Close tutorials\"\n testID=\"shopping-tutorial-backdrop\"\n />\n <View style={[styles.sheet, { backgroundColor: sheet }]} testID=\"shopping-tutorial-panel\">\n {playing ? (\n <View style={styles.player} testID=\"shopping-tutorial-player\">\n <TrailerPlayer key={playing.id} videoId={playing.id} indexUrl={indexUrl} onClose={close} />\n </View>\n ) : null}\n <View style={styles.head}>\n <View style={styles.headText}>\n <Text style={styles.kicker}>{own ? 'TUTORIAL' : 'NO VIDEO FOR THIS PAGE YET'}</Text>\n {playing ? <Text style={styles.heading}>{playing.title}</Text> : null}\n {playing ? <Text style={styles.filmAbout}>{playing.about}</Text> : null}\n </View>\n <Pressable\n onPress={close}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Hide tutorial\"\n hitSlop={8}\n >\n <MaterialCommunityIcons name=\"close\" size={20} color=\"rgba(255,255,255,0.7)\" />\n </Pressable>\n </View>\n <ScrollView contentContainerStyle={styles.list}>\n {tutorials.map((tutorial) => {\n const isOwn = tutorial === own;\n const isPlaying = tutorial === playing;\n const done = watched.has(tutorial.id);\n return (\n <Pressable\n key={tutorial.id}\n onPress={() => play(tutorial)}\n accessibilityRole=\"button\"\n accessibilityLabel={`Play ${tutorial.title}`}\n accessibilityState={{ selected: isPlaying }}\n testID=\"shopping-tutorial-film\"\n style={[styles.film, isOwn && styles.filmOwn, isPlaying && styles.filmPlaying]}\n >\n <View style={styles.filmIcon}>\n <MaterialCommunityIcons\n name={isPlaying ? 'volume-high' : done ? 'check' : 'play'}\n size={18}\n color=\"#1a1408\"\n />\n </View>\n <View style={styles.filmText}>\n {isOwn ? <Text style={styles.ownTag}>THIS SCREEN</Text> : null}\n <Text style={styles.filmTitle}>{tutorial.title}</Text>\n <Text style={styles.filmAbout}>{tutorial.about}</Text>\n </View>\n </Pressable>\n );\n })}\n {playing ? (\n <Pressable\n onPress={() => void Linking.openURL(watchUrl(playing.id)).catch(() => undefined)}\n accessibilityRole=\"link\"\n accessibilityLabel={`Open ${playing.title} on YouTube`}\n testID=\"shopping-tutorial-youtube\"\n style={styles.youtube}\n >\n <Text style={styles.youtubeText}>Open on YouTube</Text>\n <MaterialCommunityIcons name=\"open-in-new\" size={14} color=\"rgba(255,255,255,0.65)\" />\n </Pressable>\n ) : null}\n </ScrollView>\n </View>\n </Modal>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n button: {\n position: 'absolute',\n width: 44,\n height: 44,\n borderRadius: 22,\n backgroundColor: '#e8b84a',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 20,\n shadowColor: '#0f172a',\n shadowOpacity: 0.25,\n shadowRadius: 10,\n shadowOffset: { width: 0, height: 4 },\n elevation: 6,\n },\n dot: {\n position: 'absolute',\n top: 2,\n right: 2,\n width: 10,\n height: 10,\n borderRadius: 5,\n backgroundColor: '#b91c1c',\n borderWidth: 2,\n borderColor: '#e8b84a',\n },\n backdrop: { flex: 1, backgroundColor: 'rgba(11,18,32,0.45)' },\n sheet: {\n maxHeight: '88%',\n overflow: 'hidden',\n borderTopLeftRadius: 22,\n borderTopRightRadius: 22,\n paddingBottom: 28,\n },\n head: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 18,\n paddingTop: 16,\n paddingBottom: 8,\n },\n heading: { color: '#fff', fontSize: 17, fontWeight: '800' },\n headText: { flex: 1, minWidth: 0, gap: 4, paddingRight: 12 },\n kicker: { color: '#e8b84a', fontSize: 11, fontWeight: '800', letterSpacing: 1.5 },\n player: { width: '100%', aspectRatio: 16 / 9, backgroundColor: '#000' },\n filmPlaying: { backgroundColor: 'rgba(232,184,74,0.16)' },\n youtube: { flexDirection: 'row', alignItems: 'center', gap: 6, paddingHorizontal: 6, paddingTop: 6 },\n youtubeText: { color: 'rgba(255,255,255,0.75)', fontSize: 13, fontWeight: '600' },\n list: { paddingHorizontal: 12, gap: 8, paddingBottom: 8 },\n film: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n borderRadius: 14,\n padding: 12,\n backgroundColor: 'rgba(255,255,255,0.06)',\n },\n filmOwn: { borderWidth: 1, borderColor: 'rgba(232,184,74,0.5)' },\n filmIcon: {\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: '#e8b84a',\n alignItems: 'center',\n justifyContent: 'center',\n },\n filmText: { flex: 1, minWidth: 0, gap: 2 },\n ownTag: { color: '#e8b84a', fontSize: 10, fontWeight: '800', let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;AAAA,IACf,UAAY,EAAA,QAAA;AAAA,IACZ,GAAK,EAAA,EAAA;AAAA,IACL,YAAc,EAAA,EAAA;AAAA,IACd,OAAS,EAAA,EAAA;AAAA,IACT,eAAiB,EAAA;AAAA,GACnB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,WAAa,EAAA,CAAA;AAAA,IACb,WAAa,EAAA;AAAA,GACf;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,EAAA;AAAA,IACd,eAAiB,EAAA,SAAA;AAAA,IACjB,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,CAAA;AAAA,IACN,QAAU,EAAA,CAAA;AAAA,IACV,GAAK,EAAA;AAAA,GACP;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,KAAA;AAAA,IACZ,aAAe,EAAA;AAAA,GACjB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,MAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,wBAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
|
|
@@ -34,6 +34,8 @@ const T = SHOPPING_TUTORIALS;
|
|
|
34
34
|
const NEEDS_CATALOG = /* @__PURE__ */ new Set([T.deals, T.watchPrice]);
|
|
35
35
|
const OWN = {
|
|
36
36
|
shop: T.search,
|
|
37
|
+
// The holiday deals section (web 0.49.0) has no film yet.
|
|
38
|
+
blackfriday: null,
|
|
37
39
|
deals: T.deals,
|
|
38
40
|
watchlist: T.watchPrice,
|
|
39
41
|
// Film 05's screens, once it is published.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shoppingTutorials.js","sources":["../../../../src/features/shopping/tutorials/shoppingTutorials.ts"],"sourcesContent":["/**\n * Which Shopping screen plays which feature demo - web\n * `tutorials/shoppingTutorials.ts` (0.37.0), verbatim. The films are on the\n * Yantra YouTube channel (\"Yantra Shopping - feature demos\").\n *\n * A screen with no film of its own still offers all of them: \"No video for this\n * page yet\" lists every tutorial rather than none.\n *\n * The surface-kit pieces it leans on (`Tutorial`, `watchUrl`, the \"seen\" record)\n * are in ./tutorials. Native difference: no first-visit autoplay - the phone\n * only opens a film when the play button is pressed, in YouTube.\n */\nimport type { Tutorial } from './tutorials';\n\n/** The storefront's screens (ShoppingExperience's tabs; web `ShoppingView`). */\nexport type ShoppingView = 'shop' | 'deals' | 'watchlist' | 'saved' | 'history' | 'orders';\n\n/** In film order. Film 05 (save, cart and checkout) is not on YouTube yet. */\nexport const SHOPPING_TUTORIALS = {\n search: {\n id: '9EPopmMLido',\n title: 'One search, every store',\n about: \"Every store's answer on one page, then narrowed by price, rating and sort.\",\n },\n findCheaper: {\n id: '52pYDTxkQDs',\n title: 'Find it cheaper',\n about: \"The same product at the other stores, cheapest first, with what you'd save.\",\n },\n deals: {\n id: '4-2bQTC9IqI',\n title: 'The Deals board',\n about: 'The biggest markdowns by department, or for the one thing you want.',\n },\n watchPrice: {\n id: 'VsE7SK5_s6o',\n title: 'Watch a price',\n about: 'Compare a product across stores, then get an alert when it drops.',\n },\n agent: {\n id: 'gAVXhQ4GZpQ',\n title: 'Ask the shopping agent',\n about: 'Say what you need in plain words, budget too, and get its picks.',\n },\n cart: {\n id: 'RC7fatagtt4',\n title: 'Save Items, Build a Cart and Check Out at the Store',\n about: \"Here's how saving, the cart and checkout fit together in Yantra Shopping.\",\n },\n} satisfies Record<string, Tutorial>;\n\nconst T = SHOPPING_TUTORIALS;\n\n/** Deals and Watchlist read the indexed catalog: without it the page has neither, so neither film. */\nconst NEEDS_CATALOG: ReadonlySet<Tutorial> = new Set([T.deals, T.watchPrice]);\n\n/** Find it cheaper and Compare & track both open from a Shop card, so they are the Shop screen's too. */\nconst OWN: Record<ShoppingView, Tutorial | null> = {\n shop: T.search,\n deals: T.deals,\n watchlist: T.watchPrice,\n // Film 05's screens, once it is published.\n saved: T.cart,\n orders: T.cart,\n history: T.cart,\n};\n\n/** The film made for this screen, or null when it has none. */\nexport function ownTutorial(view: ShoppingView, catalogEnabled: boolean): Tutorial | null {\n const own = OWN[view];\n return own && (catalogEnabled || !NEEDS_CATALOG.has(own)) ? own : null;\n}\n\n/** The screen's own film first, then the rest in film order. */\nexport function tutorialsFor(view: ShoppingView, catalogEnabled: boolean): Tutorial[] {\n const offered = Object.values(T).filter((t) => catalogEnabled || !NEEDS_CATALOG.has(t));\n const own = ownTutorial(view, catalogEnabled);\n return own ? [own, ...offered.filter((t) => t !== own)] : offered;\n}\n"],"names":[],"mappings":"AAkBO,MAAM,kBAAqB,GAAA;AAAA,EAChC,MAAQ,EAAA;AAAA,IACN,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,yBAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA,WAAa,EAAA;AAAA,IACX,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,iBAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA,KAAO,EAAA;AAAA,IACL,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,iBAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA,UAAY,EAAA;AAAA,IACV,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,eAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA,KAAO,EAAA;AAAA,IACL,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,wBAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,qDAAA;AAAA,IACP,KAAO,EAAA;AAAA;AAEX;AACA,MAAM,CAAI,GAAA,kBAAA;AAGV,MAAM,aAAA,uBAA2C,GAAI,CAAA,CAAC,EAAE,KAAO,EAAA,CAAA,CAAE,UAAU,CAAC,CAAA;AAG5E,MAAM,GAA6C,GAAA;AAAA,EACjD,MAAM,CAAE,CAAA,MAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"shoppingTutorials.js","sources":["../../../../src/features/shopping/tutorials/shoppingTutorials.ts"],"sourcesContent":["/**\n * Which Shopping screen plays which feature demo - web\n * `tutorials/shoppingTutorials.ts` (0.37.0), verbatim. The films are on the\n * Yantra YouTube channel (\"Yantra Shopping - feature demos\").\n *\n * A screen with no film of its own still offers all of them: \"No video for this\n * page yet\" lists every tutorial rather than none.\n *\n * The surface-kit pieces it leans on (`Tutorial`, `watchUrl`, the \"seen\" record)\n * are in ./tutorials. Native difference: no first-visit autoplay - the phone\n * only opens a film when the play button is pressed, in YouTube.\n */\nimport type { Tutorial } from './tutorials';\n\n/** The storefront's screens (ShoppingExperience's tabs; web `ShoppingView`). */\nexport type ShoppingView = 'shop' | 'blackfriday' | 'deals' | 'watchlist' | 'saved' | 'history' | 'orders';\n\n/** In film order. Film 05 (save, cart and checkout) is not on YouTube yet. */\nexport const SHOPPING_TUTORIALS = {\n search: {\n id: '9EPopmMLido',\n title: 'One search, every store',\n about: \"Every store's answer on one page, then narrowed by price, rating and sort.\",\n },\n findCheaper: {\n id: '52pYDTxkQDs',\n title: 'Find it cheaper',\n about: \"The same product at the other stores, cheapest first, with what you'd save.\",\n },\n deals: {\n id: '4-2bQTC9IqI',\n title: 'The Deals board',\n about: 'The biggest markdowns by department, or for the one thing you want.',\n },\n watchPrice: {\n id: 'VsE7SK5_s6o',\n title: 'Watch a price',\n about: 'Compare a product across stores, then get an alert when it drops.',\n },\n agent: {\n id: 'gAVXhQ4GZpQ',\n title: 'Ask the shopping agent',\n about: 'Say what you need in plain words, budget too, and get its picks.',\n },\n cart: {\n id: 'RC7fatagtt4',\n title: 'Save Items, Build a Cart and Check Out at the Store',\n about: \"Here's how saving, the cart and checkout fit together in Yantra Shopping.\",\n },\n} satisfies Record<string, Tutorial>;\n\nconst T = SHOPPING_TUTORIALS;\n\n/** Deals and Watchlist read the indexed catalog: without it the page has neither, so neither film. */\nconst NEEDS_CATALOG: ReadonlySet<Tutorial> = new Set([T.deals, T.watchPrice]);\n\n/** Find it cheaper and Compare & track both open from a Shop card, so they are the Shop screen's too. */\nconst OWN: Record<ShoppingView, Tutorial | null> = {\n shop: T.search,\n // The holiday deals section (web 0.49.0) has no film yet.\n blackfriday: null,\n deals: T.deals,\n watchlist: T.watchPrice,\n // Film 05's screens, once it is published.\n saved: T.cart,\n orders: T.cart,\n history: T.cart,\n};\n\n/** The film made for this screen, or null when it has none. */\nexport function ownTutorial(view: ShoppingView, catalogEnabled: boolean): Tutorial | null {\n const own = OWN[view];\n return own && (catalogEnabled || !NEEDS_CATALOG.has(own)) ? own : null;\n}\n\n/** The screen's own film first, then the rest in film order. */\nexport function tutorialsFor(view: ShoppingView, catalogEnabled: boolean): Tutorial[] {\n const offered = Object.values(T).filter((t) => catalogEnabled || !NEEDS_CATALOG.has(t));\n const own = ownTutorial(view, catalogEnabled);\n return own ? [own, ...offered.filter((t) => t !== own)] : offered;\n}\n"],"names":[],"mappings":"AAkBO,MAAM,kBAAqB,GAAA;AAAA,EAChC,MAAQ,EAAA;AAAA,IACN,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,yBAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA,WAAa,EAAA;AAAA,IACX,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,iBAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA,KAAO,EAAA;AAAA,IACL,EAAI,EAAA,aAAA;AAAA,IACJ,KAAO,EAAA,iBAA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,CAAA,IAAA,EAAM,cAAc,CAAA;AAC5C,EAAO,OAAA,GAAA,GAAM,CAAC,GAAA,EAAK,GAAG,OAAA,CAAQ,OAAO,CAAK,CAAA,KAAA,CAAA,KAAM,GAAG,CAAC,CAAI,GAAA,OAAA;AAC1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useState,useRef,useMemo,useCallback}from'react';import {DEPARTMENT_SEARCH_PRESETS,searchShoppingProductsRest,searchShoppingProductsFast,sanitizeShoppingProviderError,mergeShoppingProductSources}from'./services/shoppingProductSearch.js';import {resolveShoppingRelevance}from'./services/resolveShoppingRelevance.js';import {mapShoppingAttachmentToProducts,buildShoppingAttachment}from'./services/buildShoppingAttachment.js';import {buildShoppingWidgetMessage,summarizeShoppingAttachment}from'./services/buildShoppingWidgetMessage.js';import {verifyProducts}from'./services/verifyProducts.js';import {NO_REQUIREMENTS,requirementChips,removeRequirement,requirementsFromIntent,applyRequirements,heldBackNote}from'./services/searchRequirements.js';import {groupProductVariants}from'./services/variantCards.js';import {readProductPages,productPageEvidence}from'./services/productPageEvidence.js';import {findProductForChatSelection}from'./productHighlight.js';import {addToCart}from'./shoppingCart.js';import {saveProduct}from'./savedProducts.js';import {ROUTING_BRAIN_DID_NOT_ANSWER}from'./chat/brainRouterKit.js';import {pickReply}from'./chat/pickReplies.js';import {addPriceWatch}from'./services/catalogProductSearch.js';import {scheduleLivePriceCheck,runLivePriceCheck,announcePriceCheckUpdate,pauseLivePriceChecks}from'./services/livePriceCheckClient.js';import {livePriceCheckMessage,nextCheckLabel}from'./services/livePriceCheckReport.js';import {resolveComputerWorkspace,captureComputerScreenshot,computerExec}from'./services/shoppingComputer.js';import {recordSearch}from'./shoppingHistoryStore.js';import {isShoppingOpeningMiss}from'./shoppingRuntime.js';import {useDeliveryLocation}from'./state/deliveryLocation.js';import {isShoppingConversation,withHeldBackNote,UI_TURN_COPY}from'./chat/widgetContent.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {useState,useRef,useMemo,useCallback}from'react';import {DEPARTMENT_SEARCH_PRESETS,searchShoppingProductsRest,searchShoppingProductsFast,sanitizeShoppingProviderError,mergeShoppingProductSources,combineSameListing,mergeIntoGrid}from'./services/shoppingProductSearch.js';import {resolveShoppingRelevance}from'./services/resolveShoppingRelevance.js';import {mapShoppingAttachmentToProducts,buildShoppingAttachment}from'./services/buildShoppingAttachment.js';import {buildShoppingWidgetMessage,summarizeShoppingAttachment}from'./services/buildShoppingWidgetMessage.js';import {verifyProducts}from'./services/verifyProducts.js';import {judgeRowsWithAi,applyAiVerdicts,rankByMatch}from'./services/aiRelevance.js';import {NO_REQUIREMENTS,requirementChips,removeRequirement,requirementsFromIntent,applyRequirements,heldBackNote}from'./services/searchRequirements.js';import {groupProductVariants}from'./services/variantCards.js';import {readProductPages,productPageEvidence}from'./services/productPageEvidence.js';import {findProductForChatSelection}from'./productHighlight.js';import {addToCart}from'./shoppingCart.js';import {saveProduct}from'./savedProducts.js';import {ROUTING_BRAIN_DID_NOT_ANSWER}from'./chat/brainRouterKit.js';import {pickReply}from'./chat/pickReplies.js';import {addPriceWatch}from'./services/catalogProductSearch.js';import {scheduleLivePriceCheck,runLivePriceCheck,announcePriceCheckUpdate,pauseLivePriceChecks}from'./services/livePriceCheckClient.js';import {livePriceCheckMessage,nextCheckLabel}from'./services/livePriceCheckReport.js';import {resolveComputerWorkspace,captureComputerScreenshot,computerExec}from'./services/shoppingComputer.js';import {recordSearch}from'./shoppingHistoryStore.js';import {isShoppingOpeningMiss}from'./shoppingRuntime.js';import {useDeliveryLocation}from'./state/deliveryLocation.js';import {isShoppingConversation,withHeldBackNote,UI_TURN_COPY}from'./chat/widgetContent.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -29,6 +29,19 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
const AI_PAINT_WAIT_MS = 6e3;
|
|
33
|
+
function settledWithin(promise, ms) {
|
|
34
|
+
return new Promise((resolve) => {
|
|
35
|
+
const timer = setTimeout(() => resolve(void 0), ms);
|
|
36
|
+
promise.then((value) => {
|
|
37
|
+
clearTimeout(timer);
|
|
38
|
+
resolve(value);
|
|
39
|
+
}, () => {
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
resolve(void 0);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
32
45
|
function shownRows(rows, requirements, {
|
|
33
46
|
group = true
|
|
34
47
|
} = {}) {
|
|
@@ -218,32 +231,82 @@ function useShoppingSearch({
|
|
|
218
231
|
const verifications = [];
|
|
219
232
|
const verifyQueued = /* @__PURE__ */ new Set();
|
|
220
233
|
const latePictures = /* @__PURE__ */ new Map();
|
|
234
|
+
const lateCopies = /* @__PURE__ */ new Map();
|
|
221
235
|
const commit = (rows, authoritative) => {
|
|
222
236
|
if (rows.length === 0) return;
|
|
223
|
-
const pictured = rows.map((p) =>
|
|
224
|
-
|
|
225
|
-
|
|
237
|
+
const pictured = rows.map((p) => {
|
|
238
|
+
const late = lateCopies.get(p.id);
|
|
239
|
+
if (late) lateCopies.delete(p.id);
|
|
240
|
+
const row = late ? late.reduce(combineSameListing, p) : p;
|
|
241
|
+
return !row.imageUrl && latePictures.has(row.id) ? __spreadProps(__spreadValues({}, row), {
|
|
242
|
+
imageUrl: latePictures.get(row.id)
|
|
243
|
+
}) : row;
|
|
244
|
+
});
|
|
226
245
|
const first = !painted;
|
|
227
246
|
painted = true;
|
|
228
247
|
if (first) setHasSearched(true);
|
|
229
|
-
currentRows = first ? pictured : mergeShoppingProductSources([pictured, currentRows] );
|
|
248
|
+
currentRows = rankByMatch(first ? pictured : mergeShoppingProductSources([pictured, currentRows] ));
|
|
230
249
|
setProducts(currentRows);
|
|
231
250
|
setIsLoading(false);
|
|
232
251
|
};
|
|
252
|
+
const readRows = (rows) => searchQuery ? judgeRowsWithAi(searchQuery, rows).catch(() => null) : Promise.resolve(null);
|
|
253
|
+
const prune = (verdicts) => {
|
|
254
|
+
if (requestId !== requestIdRef.current || !currentRows.some((p) => verdicts.has(p.id))) return;
|
|
255
|
+
currentRows = rankByMatch(applyAiVerdicts(currentRows, verdicts));
|
|
256
|
+
setProducts(currentRows);
|
|
257
|
+
};
|
|
258
|
+
const mergeLateCopies = (copies) => {
|
|
259
|
+
var _a2;
|
|
260
|
+
if (copies.length === 0 || requestId !== requestIdRef.current) return;
|
|
261
|
+
const {
|
|
262
|
+
rows: merged,
|
|
263
|
+
pending
|
|
264
|
+
} = mergeIntoGrid(currentRows, copies);
|
|
265
|
+
for (const copy of pending) lateCopies.set(copy.id, [...(_a2 = lateCopies.get(copy.id)) != null ? _a2 : [], copy]);
|
|
266
|
+
if (pending.length === copies.length) return;
|
|
267
|
+
currentRows = rankByMatch(merged);
|
|
268
|
+
setProducts(currentRows);
|
|
269
|
+
};
|
|
233
270
|
const paint = (rows, authoritative) => {
|
|
271
|
+
mergeLateCopies(rows.filter((p) => verifyQueued.has(p.id)));
|
|
234
272
|
const batch = rows.filter((p) => !verifyQueued.has(p.id));
|
|
235
273
|
if (batch.length === 0) return Promise.resolve();
|
|
236
274
|
for (const p of batch) verifyQueued.add(p.id);
|
|
237
|
-
const
|
|
238
|
-
|
|
275
|
+
const reading = readRows(batch);
|
|
276
|
+
const done = verifyProducts(batch).then(async (verified) => {
|
|
277
|
+
const verdicts = await settledWithin(reading, AI_PAINT_WAIT_MS);
|
|
278
|
+
if (requestId !== requestIdRef.current) return;
|
|
279
|
+
commit(applyAiVerdicts(verified, verdicts != null ? verdicts : null));
|
|
280
|
+
if (verdicts === void 0) {
|
|
281
|
+
const late = await reading;
|
|
282
|
+
if (late) prune(late);
|
|
283
|
+
}
|
|
239
284
|
}).catch((err) => console.warn("[shopping] product verification failed:", err));
|
|
240
285
|
verifications.push(done);
|
|
241
286
|
return done;
|
|
242
287
|
};
|
|
288
|
+
const adoptPictures = (rows) => {
|
|
289
|
+
const pictures = new Map(rows.filter((p) => verifyQueued.has(p.id) && p.imageUrl).map((p) => [p.id, p.imageUrl]));
|
|
290
|
+
for (const [id, url] of pictures) latePictures.set(id, url);
|
|
291
|
+
if (pictures.size > 0 && currentRows.some((p) => !p.imageUrl && pictures.has(p.id))) {
|
|
292
|
+
currentRows = currentRows.map((p) => !p.imageUrl && pictures.has(p.id) ? __spreadProps(__spreadValues({}, p), {
|
|
293
|
+
imageUrl: pictures.get(p.id)
|
|
294
|
+
}) : p);
|
|
295
|
+
setProducts(currentRows);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
243
298
|
try {
|
|
244
299
|
let restCall = null;
|
|
245
|
-
const restOnce = () => restCall != null ? restCall : restCall = searchShoppingProductsRest(searchParams
|
|
246
|
-
|
|
300
|
+
const restOnce = () => restCall != null ? restCall : restCall = searchShoppingProductsRest(searchParams, {
|
|
301
|
+
// Each store's list paints the moment it lands, not when the
|
|
302
|
+
// web research behind it does.
|
|
303
|
+
onLane: (rows) => {
|
|
304
|
+
if (requestId === requestIdRef.current) void paint(rows, true);
|
|
305
|
+
}
|
|
306
|
+
}).then(async (rest2) => {
|
|
307
|
+
if (requestId !== requestIdRef.current) return rest2;
|
|
308
|
+
adoptPictures(rest2.products);
|
|
309
|
+
await paint(rest2.products, true);
|
|
247
310
|
return rest2;
|
|
248
311
|
});
|
|
249
312
|
const earlyIds = /* @__PURE__ */ new Set();
|
|
@@ -275,14 +338,7 @@ function useShoppingSearch({
|
|
|
275
338
|
budget,
|
|
276
339
|
resultCount: fast.products.length
|
|
277
340
|
});
|
|
278
|
-
|
|
279
|
-
for (const [id, url] of pictures) latePictures.set(id, url);
|
|
280
|
-
if (pictures.size > 0 && currentRows.some((p) => !p.imageUrl && pictures.has(p.id))) {
|
|
281
|
-
currentRows = currentRows.map((p) => !p.imageUrl && pictures.has(p.id) ? __spreadProps(__spreadValues({}, p), {
|
|
282
|
-
imageUrl: pictures.get(p.id)
|
|
283
|
-
}) : p);
|
|
284
|
-
setProducts(currentRows);
|
|
285
|
-
}
|
|
341
|
+
adoptPictures(fast.products.filter((p) => earlyIds.has(p.id)));
|
|
286
342
|
void paint(fast.products.filter((p) => !earlyIds.has(p.id)), true);
|
|
287
343
|
setError((_f = fast.error) != null ? _f : null);
|
|
288
344
|
setIsEnriching(true);
|
|
@@ -896,4 +952,4 @@ function useShoppingSearch({
|
|
|
896
952
|
schedulePriceCheckFromChat,
|
|
897
953
|
stopPriceChecksFromChat
|
|
898
954
|
};
|
|
899
|
-
}export{shownRows,useShoppingSearch};//# sourceMappingURL=useShoppingSearch.js.map
|
|
955
|
+
}export{AI_PAINT_WAIT_MS,shownRows,useShoppingSearch};//# sourceMappingURL=useShoppingSearch.js.map
|