@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 @@
|
|
|
1
|
+
{"version":3,"file":"ops.js","sources":["../../../../src/features/team-chat/api/ops.ts"],"sourcesContent":["/**\n * The Team Chat API, typed: one fragment per shape so every screen reads the\n * same fields, and one function per operation.\n */\n\nimport { gql } from './client';\nimport { invalidateLists, qk } from '../state/lists';\n\nexport type ChannelKind = 'public' | 'private' | 'dm' | 'group';\nexport type Presence = 'active' | 'away';\nexport type NotifyLevel = 'default' | 'all' | 'mentions' | 'nothing';\n\nexport interface User {\n id: string;\n displayName: string;\n realName: string;\n /** The platform username ('' when none): `from:@handle` in search. */\n handle: string;\n email: string;\n avatarUrl: string | null;\n isAdmin: boolean;\n active: boolean;\n presence: Presence;\n away: boolean;\n statusEmoji: string | null;\n statusText: string | null;\n statusExpiresAt: string | null;\n dndUntil: string | null;\n isSelf: boolean;\n}\n\nexport interface Membership {\n role: 'member' | 'admin';\n joinedAt: string;\n lastReadSeq: number;\n unreadCount: number;\n mentionCount: number;\n muted: boolean;\n starred: boolean;\n hidden: boolean;\n notify: NotifyLevel;\n}\n\nexport interface Channel {\n id: string;\n kind: ChannelKind;\n name: string | null;\n topic: string;\n purpose: string;\n isGeneral: boolean;\n createdBy: { id: string } | null;\n createdAt: string;\n archivedAt: string | null;\n lastMessageAt: string | null;\n lastSeq: number;\n memberCount: number;\n participants: { id: string }[];\n membership: Membership | null;\n draft: string | null;\n canManage: boolean;\n pinCount: number;\n}\n\nexport interface Reaction {\n emoji: string;\n count: number;\n userIds: string[];\n reacted: boolean;\n}\n\nexport interface FileItem {\n id: string;\n name: string;\n contentType: string;\n size: number;\n url: string | null;\n}\n\nexport interface SystemEvent {\n type: string;\n text: string | null;\n userIds: string[];\n oldName: string | null;\n newName: string | null;\n messageId: string | null;\n}\n\nexport interface Message {\n id: string;\n channelId: string;\n seq: number;\n kind: 'message' | 'system';\n body: string;\n system: SystemEvent | null;\n author: { id: string } | null;\n createdAt: string;\n editedAt: string | null;\n deleted: boolean;\n threadRootId: string | null;\n alsoInChannel: boolean;\n replyCount: number;\n replyUsers: { id: string }[];\n lastReplyAt: string | null;\n mentions: string[];\n mentionAll: boolean;\n reactions: Reaction[];\n files: FileItem[];\n pinned: boolean;\n pinnedBy: { id: string } | null;\n saved: boolean;\n clientMsgId: string | null;\n /** Client-only: an optimistic send not yet confirmed, or one that failed. */\n pending?: 'sending' | 'failed';\n}\n\nexport interface Me {\n user: User;\n workspace: { orgName: string; generalChannelId: string | null };\n isAdmin: boolean;\n capabilities: { files: boolean; maxFileBytes: number };\n activityUnread: number;\n threadsUnread: number;\n activityReadAt: string;\n}\n\nexport interface Thread {\n root: Message;\n replies: Message[];\n following: boolean;\n lastReadSeq: number;\n unreadCount: number;\n channel: Channel | null;\n}\n\nexport interface ActivityItem {\n id: string;\n type: 'mention' | 'reaction' | 'reply';\n at: string;\n actor: { id: string } | null;\n emoji: string | null;\n message: (Message & { channel: Channel | null }) | null;\n unread: boolean;\n}\n\nexport interface SavedItem {\n message: Message & { channel: Channel | null };\n savedAt: string;\n completedAt: string | null;\n}\n\nexport interface Draft {\n channelId: string;\n threadRootId: string | null;\n body: string;\n updatedAt: string;\n channel: Channel | null;\n}\n\nexport interface LiveEvent {\n type: string;\n channelId: string | null;\n messageId: string | null;\n userId: string | null;\n rootId: string | null;\n seq: number | null;\n presence: Presence | null;\n message: Message | null;\n channel: Channel | null;\n user: User | null;\n}\n\nexport const USER = `id displayName realName handle email avatarUrl isAdmin active presence away statusEmoji statusText statusExpiresAt dndUntil isSelf`;\nexport const CHANNEL = `id kind name topic purpose isGeneral createdBy { id } createdAt archivedAt lastMessageAt lastSeq memberCount\n participants { id } draft canManage pinCount\n membership { role joinedAt lastReadSeq unreadCount mentionCount muted starred hidden notify }`;\nexport const MESSAGE = `id channelId seq kind body createdAt editedAt deleted threadRootId alsoInChannel replyCount lastReplyAt\n mentions mentionAll pinned saved clientMsgId\n system { type text userIds oldName newName messageId }\n author { id } replyUsers { id } pinnedBy { id }\n reactions { emoji count userIds reacted }\n files { id name contentType size url }`;\nconst ME = `user { ${USER} } workspace { orgName generalChannelId } isAdmin capabilities { files maxFileBytes }\n activityUnread threadsUnread activityReadAt`;\nexport const EVENT = `type channelId messageId userId rootId seq presence\n message { ${MESSAGE} } channel { ${CHANNEL} } user { ${USER} }`;\n\n// ── reads ────────────────────────────────────────────────────────────────────\n\nexport async function fetchBootstrap(): Promise<{ me: Me; sidebar: Channel[]; people: User[] }> {\n return gql(`query TeamChatBootstrap { me { ${ME} } sidebar { ${CHANNEL} } people { ${USER} } }`, {});\n}\n\nexport async function fetchMe(): Promise<Me> {\n return (await gql<{ me: Me }>(`query { me { ${ME} } }`)).me;\n}\n\nexport async function fetchSidebar(): Promise<Channel[]> {\n return (await gql<{ sidebar: Channel[] }>(`query { sidebar { ${CHANNEL} } }`)).sidebar;\n}\n\nexport async function fetchPeople(): Promise<User[]> {\n return (await gql<{ people: User[] }>(`query { people { ${USER} } }`)).people;\n}\n\nexport async function fetchUser(id: string): Promise<User | null> {\n return (await gql<{ user: User | null }>(`query($id: ID!) { user(id: $id) { ${USER} } }`, { id })).user;\n}\n\nexport async function fetchChannel(id: string): Promise<Channel | null> {\n return (await gql<{ channel: Channel | null }>(`query($id: ID!) { channel(id: $id) { ${CHANNEL} } }`, { id }))\n .channel;\n}\n\nexport interface MessagePage {\n messages: Message[];\n hasMoreBefore: boolean;\n hasMoreAfter: boolean;\n}\n\nexport async function fetchMessages(\n channelId: string,\n opts: { before?: number; after?: number; around?: number; limit?: number } = {},\n): Promise<MessagePage> {\n return (\n await gql<{ messages: MessagePage }>(\n `query($c: ID!, $b: Float, $a: Float, $r: Float, $l: Int) { messages(channelId: $c, before: $b, after: $a, around: $r, limit: $l) { hasMoreBefore hasMoreAfter messages { ${MESSAGE} } } }`,\n { c: channelId, b: opts.before, a: opts.after, r: opts.around, l: opts.limit ?? 50 },\n )\n ).messages;\n}\n\nexport async function fetchMessage(id: string): Promise<Message | null> {\n return (await gql<{ message: Message | null }>(`query($id: ID!) { message(id: $id) { ${MESSAGE} } }`, { id }))\n .message;\n}\n\nexport async function fetchThread(rootId: string): Promise<Thread> {\n return (\n await gql<{ thread: Thread }>(\n `query($r: ID!) { thread(rootId: $r) { following lastReadSeq unreadCount root { ${MESSAGE} } replies { ${MESSAGE} } channel { ${CHANNEL} } } }`,\n { r: rootId },\n )\n ).thread;\n}\n\nexport async function fetchThreads(before?: string): Promise<Thread[]> {\n return (\n await gql<{ threads: Thread[] }>(\n `query($b: String) { threads(first: 20, before: $b) { following lastReadSeq unreadCount root { ${MESSAGE} } replies { ${MESSAGE} } channel { ${CHANNEL} } } }`,\n { b: before },\n )\n ).threads;\n}\n\nexport async function fetchActivity(filter: string, before?: string): Promise<ActivityItem[]> {\n return (\n await gql<{ activity: ActivityItem[] }>(\n `query($f: String, $b: String) { activity(filter: $f, first: 40, before: $b) { id type at unread emoji actor { id } message { ${MESSAGE} channel { ${CHANNEL} } } } }`,\n { f: filter, b: before },\n )\n ).activity;\n}\n\nexport async function fetchSaved(completed: boolean): Promise<SavedItem[]> {\n return (\n await gql<{ saved: SavedItem[] }>(\n `query($c: Boolean) { saved(completed: $c, first: 100) { savedAt completedAt message { ${MESSAGE} channel { ${CHANNEL} } } } }`,\n { c: completed },\n )\n ).saved;\n}\n\nexport async function fetchDrafts(): Promise<Draft[]> {\n return (\n await gql<{ drafts: Draft[] }>(\n `query { drafts { channelId threadRootId body updatedAt channel { ${CHANNEL} } } }`,\n )\n ).drafts;\n}\n\nexport async function fetchPins(channelId: string): Promise<Message[]> {\n return (await gql<{ pins: Message[] }>(`query($c: ID!) { pins(channelId: $c) { ${MESSAGE} } }`, { c: channelId }))\n .pins;\n}\n\nexport async function fetchMembers(channelId: string): Promise<{ user: User; role: string; joinedAt: string }[]> {\n return (\n await gql<{ channelMembers: { user: User; role: string; joinedAt: string }[] }>(\n `query($c: ID!) { channelMembers(channelId: $c) { role joinedAt user { ${USER} } } }`,\n { c: channelId },\n )\n ).channelMembers;\n}\n\nexport async function browseChannels(\n query: string,\n includeArchived: boolean,\n): Promise<{ total: number; channels: Channel[] }> {\n return (\n await gql<{ browseChannels: { total: number; channels: Channel[] } }>(\n `query($q: String, $a: Boolean) { browseChannels(query: $q, includeArchived: $a, first: 200) { total channels { ${CHANNEL} } } }`,\n { q: query, a: includeArchived },\n )\n ).browseChannels;\n}\n\nexport async function searchMessages(\n query: string,\n offset = 0,\n): Promise<{ total: number; messages: (Message & { channel: Channel | null })[] }> {\n return (\n await gql<{ search: { total: number; messages: (Message & { channel: Channel | null })[] } }>(\n `query($q: String!, $o: Int) { search(query: $q, first: 30, offset: $o) { total messages { ${MESSAGE} channel { ${CHANNEL} } } } }`,\n { q: query, o: offset },\n )\n ).search;\n}\n\nexport async function fetchFiles(\n channelId?: string,\n): Promise<\n (FileItem & { channelId: string; messageId: string; createdAt: string; uploader: { id: string } | null })[]\n> {\n return (\n await gql<{\n files: (FileItem & {\n channelId: string;\n messageId: string;\n createdAt: string;\n uploader: { id: string } | null;\n })[];\n }>(\n `query($c: ID) { files(channelId: $c, first: 100) { id name contentType size url channelId messageId createdAt uploader { id } } }`,\n { c: channelId },\n )\n ).files;\n}\n\n// ── writes ───────────────────────────────────────────────────────────────────\n\nconst ch = async (q: string, v: Record<string, unknown>, key: string): Promise<Channel> =>\n ((await gql<Record<string, Channel>>(q, v)) as Record<string, Channel>)[key];\n\n// ── writes: each refreshes the fetched lists it changes ────────────────────────\n\nconst refresh = (...keys: unknown[][]) => {\n for (const key of keys) invalidateLists(key);\n};\n/** A channel was made, joined, left, renamed or archived: the directory and its members change. */\nconst channelChanged = <T>(channelId: string | undefined, result: T): T => {\n refresh(qk.browse(), ...(channelId ? [qk.members(channelId)] : []));\n return result;\n};\n\nexport const api = {\n createChannel: async (name: string, isPrivate: boolean, purpose: string, memberIds: string[]) => {\n const c = await ch(\n `mutation($n: String!, $p: Boolean, $d: String, $m: [ID!]) { createChannel(name: $n, private: $p, purpose: $d, memberIds: $m) { ${CHANNEL} } }`,\n { n: name, p: isPrivate, d: purpose, m: memberIds },\n 'createChannel',\n );\n return channelChanged(c?.id, c);\n },\n openConversation: (userIds: string[]) =>\n ch(`mutation($u: [ID!]!) { openConversation(userIds: $u) { ${CHANNEL} } }`, { u: userIds }, 'openConversation'),\n joinChannel: async (channelId: string) =>\n channelChanged(\n channelId,\n await ch(\n `mutation($c: ID!) { joinChannel(channelId: $c) { ${CHANNEL} } }`,\n { c: channelId },\n 'joinChannel',\n ),\n ),\n leaveChannel: async (channelId: string) =>\n channelChanged(\n channelId,\n (\n await gql<{ leaveChannel: boolean }>(`mutation($c: ID!) { leaveChannel(channelId: $c) }`, {\n c: channelId,\n })\n ).leaveChannel,\n ),\n addMembers: async (channelId: string, userIds: string[]) =>\n channelChanged(\n channelId,\n await ch(\n `mutation($c: ID!, $u: [ID!]!) { addChannelMembers(channelId: $c, userIds: $u) { ${CHANNEL} } }`,\n { c: channelId, u: userIds },\n 'addChannelMembers',\n ),\n ),\n removeMember: async (channelId: string, userId: string) =>\n channelChanged(\n channelId,\n await ch(\n `mutation($c: ID!, $u: ID!) { removeChannelMember(channelId: $c, userId: $u) { ${CHANNEL} } }`,\n { c: channelId, u: userId },\n 'removeChannelMember',\n ),\n ),\n updateChannel: async (channelId: string, input: { name?: string; topic?: string; purpose?: string }) =>\n channelChanged(\n channelId,\n await ch(\n `mutation($c: ID!, $n: String, $t: String, $p: String) { updateChannel(channelId: $c, name: $n, topic: $t, purpose: $p) { ${CHANNEL} } }`,\n { c: channelId, n: input.name, t: input.topic, p: input.purpose },\n 'updateChannel',\n ),\n ),\n archive: async (channelId: string, archived: boolean) =>\n channelChanged(\n channelId,\n archived\n ? await ch(\n `mutation($c: ID!) { archiveChannel(channelId: $c) { ${CHANNEL} } }`,\n { c: channelId },\n 'archiveChannel',\n )\n : await ch(\n `mutation($c: ID!) { unarchiveChannel(channelId: $c) { ${CHANNEL} } }`,\n { c: channelId },\n 'unarchiveChannel',\n ),\n ),\n setPrefs: (\n channelId: string,\n prefs: { muted?: boolean; starred?: boolean; hidden?: boolean; notify?: NotifyLevel },\n ) =>\n ch(\n `mutation($c: ID!, $m: Boolean, $s: Boolean, $h: Boolean, $n: String) { setChannelPrefs(channelId: $c, muted: $m, starred: $s, hidden: $h, notify: $n) { ${CHANNEL} } }`,\n { c: channelId, m: prefs.muted, s: prefs.starred, h: prefs.hidden, n: prefs.notify },\n 'setChannelPrefs',\n ),\n send: async (input: {\n channelId: string;\n body: string;\n threadRootId?: string;\n alsoSendToChannel?: boolean;\n clientMsgId: string;\n fileIds?: string[];\n }) => {\n const sent = (\n await gql<{ sendMessage: Message }>(\n `mutation($c: ID!, $b: String!, $r: ID, $a: Boolean, $k: String, $f: [ID!]) { sendMessage(channelId: $c, body: $b, threadRootId: $r, alsoSendToChannel: $a, clientMsgId: $k, fileIds: $f) { ${MESSAGE} } }`,\n {\n c: input.channelId,\n b: input.body,\n r: input.threadRootId,\n a: input.alsoSendToChannel,\n k: input.clientMsgId,\n f: input.fileIds,\n },\n )\n ).sendMessage;\n // A message with files adds them to Files; anything sent can show in a search.\n refresh(qk.search(), ...(input.fileIds?.length ? [qk.files()] : []));\n return sent;\n },\n edit: async (messageId: string, body: string) =>\n (\n await gql<{ editMessage: Message }>(\n `mutation($m: ID!, $b: String!) { editMessage(messageId: $m, body: $b) { ${MESSAGE} } }`,\n { m: messageId, b: body },\n )\n ).editMessage,\n remove: async (messageId: string) =>\n (await gql<{ deleteMessage: boolean }>(`mutation($m: ID!) { deleteMessage(messageId: $m) }`, { m: messageId }))\n .deleteMessage,\n react: async (messageId: string, emoji: string) =>\n (\n await gql<{ toggleReaction: Message }>(\n `mutation($m: ID!, $e: String!) { toggleReaction(messageId: $m, emoji: $e) { ${MESSAGE} } }`,\n { m: messageId, e: emoji },\n )\n ).toggleReaction,\n pin: async (messageId: string, pinned: boolean) => {\n const m = (\n await gql<{ setPinned: Message }>(\n `mutation($m: ID!, $p: Boolean!) { setPinned(messageId: $m, pinned: $p) { ${MESSAGE} } }`,\n { m: messageId, p: pinned },\n )\n ).setPinned;\n refresh(qk.pins(m.channelId));\n return m;\n },\n save: async (messageId: string, saved: boolean) =>\n (\n await gql<{ setSaved: boolean }>(`mutation($m: ID!, $s: Boolean!) { setSaved(messageId: $m, saved: $s) }`, {\n m: messageId,\n s: saved,\n })\n ).setSaved,\n completeSaved: async (messageId: string, completed: boolean) => {\n const ok = (\n await gql<{ setSavedCompleted: boolean }>(\n `mutation($m: ID!, $c: Boolean!) { setSavedCompleted(messageId: $m, completed: $c) }`,\n { m: messageId, c: completed },\n )\n ).setSavedCompleted;\n refresh(qk.saved());\n return ok;\n },\n markRead: (channelId: string, seq: number) =>\n ch(\n `mutation($c: ID!, $s: Float!) { markRead(channelId: $c, seq: $s) { ${CHANNEL} } }`,\n { c: channelId, s: seq },\n 'markRead',\n ),\n markUnread: (channelId: string, seq: number) =>\n ch(\n `mutation($c: ID!, $s: Float!) { markUnread(channelId: $c, seq: $s) { ${CHANNEL} } }`,\n { c: channelId, s: seq },\n 'markUnread',\n ),\n markThreadRead: async (rootId: string, seq: number) =>\n (\n await gql<{ markThreadRead: boolean }>(\n `mutation($r: ID!, $s: Float!) { markThreadRead(rootId: $r, seq: $s) }`,\n { r: rootId, s: seq },\n )\n ).markThreadRead,\n follow: async (rootId: string, following: boolean) =>\n (\n await gql<{ followThread: boolean }>(\n `mutation($r: ID!, $f: Boolean!) { followThread(rootId: $r, following: $f) }`,\n { r: rootId, f: following },\n )\n ).followThread,\n markActivityRead: async () =>\n (await gql<{ markActivityRead: boolean }>(`mutation { markActivityRead }`)).markActivityRead,\n setDraft: async (channelId: string, threadRootId: string | null, body: string) => {\n const ok = (\n await gql<{ setDraft: boolean }>(\n `mutation($c: ID!, $r: ID, $b: String!) { setDraft(channelId: $c, threadRootId: $r, body: $b) }`,\n { c: channelId, r: threadRootId, b: body },\n )\n ).setDraft;\n refresh(qk.drafts());\n return ok;\n },\n setStatus: async (emoji: string | null, text: string | null, expiresAt: string | null) =>\n (\n await gql<{ setStatus: User }>(\n `mutation($e: String, $t: String, $x: String) { setStatus(emoji: $e, text: $t, expiresAt: $x) { ${USER} } }`,\n { e: emoji, t: text, x: expiresAt },\n )\n ).setStatus,\n setAway: async (away: boolean) =>\n (await gql<{ setAway: User }>(`mutation($a: Boolean!) { setAway(away: $a) { ${USER} } }`, { a: away })).setAway,\n setDnd: async (until: string | null) =>\n (await gql<{ setDnd: User }>(`mutation($u: String) { setDnd(until: $u) { ${USER} } }`, { u: until })).setDnd,\n typing: async (channelId: string, threadRootId?: string) =>\n (\n await gql<{ typing: boolean }>(`mutation($c: ID!, $r: ID) { typing(channelId: $c, threadRootId: $r) }`, {\n c: channelId,\n r: threadRootId,\n })\n ).typing,\n};\n"],"names":[],"mappings":"iFAkLO,MAAM,IAAO,GAAA,CAAA,kIAAA;AACb,MAAM,OAAU,GAAA,CAAA;AAAA;AAAA,iGAAA;AAGhB,MAAM,OAAU,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0CAAA;AAMvB,MAAM,EAAA,GAAK,UAAU,IAAI,CAAA;AAAA,+CAAA,CAAA;AAElB,MAAM,KAAQ,GAAA,CAAA;AAAA,cAAA,EACL,OAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,UAAA,EAAa,IAAI,CAAA,EAAA;AAI/D,eAAsB,cAInB,GAAA;AACD,EAAO,OAAA,GAAA,CAAI,kCAAkC,EAAE,CAAA,aAAA,EAAgB,OAAO,CAAe,YAAA,EAAA,IAAI,CAAQ,IAAA,CAAA,EAAA,EAAE,CAAA;AACrG;AACA,eAAsB,OAAuB,GAAA;AAC3C,EAAA,OAAA,CAAQ,MAAM,GAAA,CAEX,CAAgB,aAAA,EAAA,EAAE,MAAM,CAAG,EAAA,EAAA;AAChC;AACA,eAAsB,YAAmC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A,EAAA;AAAA,IAC3D,CAAG,EAAA;AAAA,GACJ,CAAG,EAAA,MAAA;AAAA,EACJ,QAAQ,OAAO,SAAA,EAAmB,YAA2B,KAAA,CAAA,MAAM,IAEhE,CAAyE,qEAAA,CAAA,EAAA;AAAA,IAC1E,CAAG,EAAA,SAAA;AAAA,IACH,CAAG,EAAA;AAAA,GACJ,CAAG,EAAA;AACN"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {createContext,useContext}from'react';import {useChatStore}from'./state/store.js';const ChatAppContext = createContext(null);
|
|
2
|
+
function useApp() {
|
|
3
|
+
const app = useContext(ChatAppContext);
|
|
4
|
+
if (!app) throw new Error("useApp outside TeamChatExperience");
|
|
5
|
+
return app;
|
|
6
|
+
}
|
|
7
|
+
function useChat(selector) {
|
|
8
|
+
return useChatStore(useApp().store, selector);
|
|
9
|
+
}
|
|
10
|
+
function usePalette() {
|
|
11
|
+
return useApp().palette;
|
|
12
|
+
}export{ChatAppContext,useApp,useChat,usePalette};//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../../../src/features/team-chat/app.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { Message } from './api/ops';\nimport type { ChatStore, State } from './state/store';\nimport { useChatStore } from './state/store';\nimport type { TeamChatPalette } from './theme';\n\n/** The main column (web `Route`). On the phone it is the screen over the sidebar. */\nexport type Route =\n | { view: 'channel'; channelId: string; around?: number }\n | { view: 'threads' }\n | { view: 'activity' }\n | { view: 'drafts' }\n | { view: 'saved' }\n | { view: 'search'; query: string }\n | { view: 'browse' }\n | { view: 'new-message' }\n | { view: 'files' }\n | { view: 'people' }\n | { view: 'home' };\n\nexport type DetailsTab = 'about' | 'members' | 'pins' | 'files' | 'settings';\n\n/** The side pane (web `Pane`): a full screen over the column on the phone. */\nexport type Pane =\n | { kind: 'thread'; rootId: string; channelId: string; focusSeq?: number }\n | { kind: 'details'; channelId: string; tab?: DetailsTab }\n | { kind: 'profile'; userId: string }\n | null;\n\nexport interface ConfirmAsk {\n title: string;\n body: string;\n /** The button that goes ahead: \"Delete\", \"Remove\", \"Archive\". */\n action: string;\n danger?: boolean;\n}\n\n/** A long-press on a message: what the row can offer (web: the hover toolbar and its menu). */\nexport interface MessageActionsRequest {\n message: Message;\n canPost: boolean;\n mode: 'channel' | 'thread' | 'context';\n isThreadRoot?: boolean;\n /** Start editing this row in place. */\n onEdit?: () => void;\n}\n\nexport interface ChatApp {\n store: ChatStore;\n route: Route;\n pane: Pane;\n palette: TeamChatPalette;\n navigate(route: Route): void;\n openPane(pane: Pane): void;\n /** Open a channel (or DM) at its live end, or at one message. */\n openChannel(channelId: string, around?: number): void;\n openThread(rootId: string, channelId: string, focusSeq?: number): void;\n openProfile(userId: string): void;\n /** Find or start the conversation with these people, then open it. */\n message(userIds: string[]): Promise<void>;\n openCreateChannel(): void;\n openStatus(): void;\n openSwitcher(): void;\n /** Live events of a public channel you are looking at without having joined; returns the unsubscribe. */\n preview(channelId: string): () => void;\n toast(text: string, tone?: 'ok' | 'error'): void;\n /** Ask before something that can't be undone: true to go ahead. */\n confirm(ask: ConfirmAsk): Promise<boolean>;\n /** The actions sheet for one message. */\n showMessageActions(req: MessageActionsRequest): void;\n /** The emoji picker, reacting to one message. */\n showReactionPicker(message: Message): void;\n /** Back one level: the pane, then the column, then out of Team Chat. */\n back(): void;\n /** The app's drawer (the home screen's menu button). */\n openMenu?(): void;\n /** Open a link or a file outside the app. */\n openUrl(url: string): void;\n}\n\nexport const ChatAppContext = createContext<ChatApp | null>(null);\n\nexport function useApp(): ChatApp {\n const app = useContext(ChatAppContext);\n if (!app) throw new Error('useApp outside TeamChatExperience');\n return app;\n}\n\n/** Select from the chat store. The selector must return existing objects, never new ones. */\nexport function useChat<T>(selector: (s: State) => T): T {\n return useChatStore(useApp().store, selector);\n}\n\nexport function usePalette(): TeamChatPalette {\n return useApp().palette;\n}\n"],"names":[],"mappings":"yFAkGa,MAAA,cAAA,GAAiB,cAA8B,IAAI;AACzD,SAAS,MAAkB,GAAA;AAChC,EAAM,MAAA,GAAA,GAAM,WAAW,cAAc,CAAA;AACrC,EAAA,IAAI,CAAC,GAAA,EAAW,MAAA,IAAI,MAAM,mCAAmC,CAAA;AAC7D,EAAO,OAAA,GAAA;AACT;AAGO,SAAS,QAAW,QAA8B,EAAA;AACvD,EAAA,OAAO,YAAa,CAAA,MAAA,EAAS,CAAA,KAAA,EAAO,QAAQ,CAAA;AAC9C;AACO,SAAS,UAA8B,GAAA;AAC5C,EAAA,OAAO,QAAS,CAAA,OAAA;AAClB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {View,StyleSheet,Text}from'react-native';import {Image}from'expo-image';import {usePalette}from'../app.js';import {initialsOf}from'../utils/format.js';const FILLS = ["#5b5bd6", "#0f8b8d", "#c2410c", "#7c3aed", "#0e7490", "#b45309", "#be185d", "#15803d", "#4338ca", "#9333ea"];
|
|
2
|
+
function fillFor(id) {
|
|
3
|
+
let h = 0;
|
|
4
|
+
for (let i = 0; i < id.length; i++) h = h * 31 + id.charCodeAt(i) >>> 0;
|
|
5
|
+
return FILLS[h % FILLS.length];
|
|
6
|
+
}
|
|
7
|
+
const SIZES = {
|
|
8
|
+
xs: {
|
|
9
|
+
box: 20,
|
|
10
|
+
font: 9,
|
|
11
|
+
radius: 5
|
|
12
|
+
},
|
|
13
|
+
sm: {
|
|
14
|
+
box: 24,
|
|
15
|
+
font: 10,
|
|
16
|
+
radius: 6
|
|
17
|
+
},
|
|
18
|
+
md: {
|
|
19
|
+
box: 36,
|
|
20
|
+
font: 14,
|
|
21
|
+
radius: 9
|
|
22
|
+
},
|
|
23
|
+
lg: {
|
|
24
|
+
box: 64,
|
|
25
|
+
font: 22,
|
|
26
|
+
radius: 14
|
|
27
|
+
},
|
|
28
|
+
xl: {
|
|
29
|
+
box: 96,
|
|
30
|
+
font: 32,
|
|
31
|
+
radius: 20
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function Avatar({
|
|
35
|
+
user,
|
|
36
|
+
size = "md",
|
|
37
|
+
presence,
|
|
38
|
+
ring,
|
|
39
|
+
style
|
|
40
|
+
}) {
|
|
41
|
+
var _a;
|
|
42
|
+
const p = usePalette();
|
|
43
|
+
const s = SIZES[size];
|
|
44
|
+
const id = (_a = user == null ? void 0 : user.id) != null ? _a : "?";
|
|
45
|
+
const inactive = Boolean(user && !user.active);
|
|
46
|
+
const initials = size === "xs" ? initialsOf(user).slice(0, 1) : initialsOf(user);
|
|
47
|
+
return /* @__PURE__ */ jsxs(View, { style: [{
|
|
48
|
+
width: s.box,
|
|
49
|
+
height: s.box
|
|
50
|
+
}, style], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: [
|
|
51
|
+
(user == null ? void 0 : user.avatarUrl) ? /* @__PURE__ */ jsx(Image, { source: {
|
|
52
|
+
uri: user.avatarUrl
|
|
53
|
+
}, style: {
|
|
54
|
+
width: s.box,
|
|
55
|
+
height: s.box,
|
|
56
|
+
borderRadius: s.radius,
|
|
57
|
+
opacity: inactive ? 0.6 : 1
|
|
58
|
+
}, contentFit: "cover", cachePolicy: "memory-disk" }) : /* @__PURE__ */ jsx(View, { style: [styles.initials, {
|
|
59
|
+
width: s.box,
|
|
60
|
+
height: s.box,
|
|
61
|
+
borderRadius: s.radius,
|
|
62
|
+
backgroundColor: fillFor(id),
|
|
63
|
+
opacity: inactive ? 0.6 : 1
|
|
64
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.initialsText, {
|
|
65
|
+
fontSize: s.font
|
|
66
|
+
}], children: initials }) }),
|
|
67
|
+
presence && user ? /* @__PURE__ */ jsx(PresenceDot, { user, big: size === "lg" || size === "xl", ring: ring != null ? ring : p.background }) : null
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
function PresenceDot({
|
|
71
|
+
user,
|
|
72
|
+
big,
|
|
73
|
+
ring,
|
|
74
|
+
inline
|
|
75
|
+
}) {
|
|
76
|
+
const p = usePalette();
|
|
77
|
+
const active = (user.active ? user.presence : "away") === "active";
|
|
78
|
+
const d = big ? 16 : 10;
|
|
79
|
+
return /* @__PURE__ */ jsx(View, { accessibilityLabel: active ? "Active" : "Away", style: [inline ? null : big ? styles.dotBig : styles.dot, {
|
|
80
|
+
width: d,
|
|
81
|
+
height: d,
|
|
82
|
+
borderRadius: d / 2,
|
|
83
|
+
backgroundColor: active ? p.presence : ring,
|
|
84
|
+
borderWidth: active ? 2 : 2,
|
|
85
|
+
borderColor: active ? ring : p.mutedForeground
|
|
86
|
+
}] });
|
|
87
|
+
}
|
|
88
|
+
const styles = StyleSheet.create({
|
|
89
|
+
initials: {
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
justifyContent: "center"
|
|
92
|
+
},
|
|
93
|
+
initialsText: {
|
|
94
|
+
color: "#ffffff",
|
|
95
|
+
fontWeight: "700"
|
|
96
|
+
},
|
|
97
|
+
dot: {
|
|
98
|
+
position: "absolute",
|
|
99
|
+
right: -3,
|
|
100
|
+
bottom: -3
|
|
101
|
+
},
|
|
102
|
+
dotBig: {
|
|
103
|
+
position: "absolute",
|
|
104
|
+
right: -4,
|
|
105
|
+
bottom: -4
|
|
106
|
+
}
|
|
107
|
+
});export{Avatar,PresenceDot};//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../../src/features/team-chat/components/Avatar.tsx"],"sourcesContent":["/** A person's picture (or initials on a colour picked by id) with an optional presence dot. */\nimport React from 'react';\nimport { StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\nimport { Image } from 'expo-image';\nimport type { User } from '../api/ops';\nimport { usePalette } from '../app';\nimport { initialsOf } from '../utils/format';\n\nconst FILLS = [\n '#5b5bd6',\n '#0f8b8d',\n '#c2410c',\n '#7c3aed',\n '#0e7490',\n '#b45309',\n '#be185d',\n '#15803d',\n '#4338ca',\n '#9333ea',\n];\n\nfunction fillFor(id: string): string {\n let h = 0;\n for (let i = 0; i < id.length; i++) h = (h * 31 + id.charCodeAt(i)) >>> 0;\n return FILLS[h % FILLS.length];\n}\n\nconst SIZES = {\n xs: { box: 20, font: 9, radius: 5 },\n sm: { box: 24, font: 10, radius: 6 },\n md: { box: 36, font: 14, radius: 9 },\n lg: { box: 64, font: 22, radius: 14 },\n xl: { box: 96, font: 32, radius: 20 },\n} as const;\n\nexport type AvatarSize = keyof typeof SIZES;\n\nexport function Avatar({\n user,\n size = 'md',\n presence,\n ring,\n style,\n}: {\n user: User | undefined | null;\n size?: AvatarSize;\n presence?: boolean;\n /** The colour behind the avatar (the presence dot's ring). */\n ring?: string;\n style?: StyleProp<ViewStyle>;\n}) {\n const p = usePalette();\n const s = SIZES[size];\n const id = user?.id ?? '?';\n const inactive = Boolean(user && !user.active);\n const initials = size === 'xs' ? initialsOf(user).slice(0, 1) : initialsOf(user);\n return (\n <View\n style={[{ width: s.box, height: s.box }, style]}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n >\n {user?.avatarUrl ? (\n <Image\n source={{ uri: user.avatarUrl }}\n style={{ width: s.box, height: s.box, borderRadius: s.radius, opacity: inactive ? 0.6 : 1 }}\n contentFit=\"cover\"\n cachePolicy=\"memory-disk\"\n />\n ) : (\n <View\n style={[\n styles.initials,\n {\n width: s.box,\n height: s.box,\n borderRadius: s.radius,\n backgroundColor: fillFor(id),\n opacity: inactive ? 0.6 : 1,\n },\n ]}\n >\n <Text style={[styles.initialsText, { fontSize: s.font }]}>{initials}</Text>\n </View>\n )}\n {presence && user ? (\n <PresenceDot user={user} big={size === 'lg' || size === 'xl'} ring={ring ?? p.background} />\n ) : null}\n </View>\n );\n}\n\nexport function PresenceDot({\n user,\n big,\n ring,\n inline,\n}: {\n user: User;\n big?: boolean;\n ring: string;\n inline?: boolean;\n}) {\n const p = usePalette();\n const active = (user.active ? user.presence : 'away') === 'active';\n const d = big ? 16 : 10;\n return (\n <View\n accessibilityLabel={active ? 'Active' : 'Away'}\n style={[\n inline ? null : big ? styles.dotBig : styles.dot,\n {\n width: d,\n height: d,\n borderRadius: d / 2,\n backgroundColor: active ? p.presence : ring,\n borderWidth: active ? 2 : 2,\n borderColor: active ? ring : p.mutedForeground,\n },\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n initials: { alignItems: 'center', justifyContent: 'center' },\n initialsText: { color: '#ffffff', fontWeight: '700' },\n dot: { position: 'absolute', right: -3, bottom: -3 },\n dotBig: { position: 'absolute', right: -4, bottom: -4 },\n});\n"],"names":[],"mappings":"uMAOA,MAAM,KAAA,GAAQ,CAAC,SAAA,EAAW,SAAW,EAAA,SAAA,EAAW,SAAW,EAAA,SAAA,EAAW,SAAW,EAAA,SAAA,EAAW,SAAW,EAAA,SAAA,EAAW,SAAS,CAAA;AAC3H,SAAS,QAAQ,EAAoB,EAAA;AACnC,EAAA,IAAI,CAAI,GAAA,CAAA;AACR,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,EAAA,CAAG,MAAQ,EAAA,CAAA,EAAA,EAAS,CAAA,GAAA,CAAA,GAAI,EAAK,GAAA,EAAA,CAAG,UAAW,CAAA,CAAC,CAAM,KAAA,CAAA;AACtE,EAAO,OAAA,KAAA,CAAM,CAAI,GAAA,KAAA,CAAM,MAAM,CAAA;AAC/B;AACA,MAAM,KAAQ,GAAA;AAAA,EACZ,EAAI,EAAA;AAAA,IACF,GAAK,EAAA,EAAA;AAAA,IACL,IAAM,EAAA,CAAA;AAAA,IACN,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,EAAI,EAAA;AAAA,IACF,GAAK,EAAA,EAAA;AAAA,IACL,IAAM,EAAA,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,EAAI,EAAA;AAAA,IACF,GAAK,EAAA,EAAA;AAAA,IACL,IAAM,EAAA,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,GACV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