@microcosmmoney/portal-react 3.12.8 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -0
- package/dist/index.js +48 -1
- package/dist/main-portal/components/auctions/AuctionsPage.d.ts +1 -0
- package/dist/main-portal/components/auctions/AuctionsPage.js +218 -0
- package/dist/main-portal/components/data/asset-stats.d.ts +1 -0
- package/dist/main-portal/components/data/asset-stats.js +33 -0
- package/dist/main-portal/components/data/charts/MCCSupplyChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/MCCSupplyChart.js +27 -0
- package/dist/main-portal/components/data/charts/MiningTrendChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/MiningTrendChart.js +39 -0
- package/dist/main-portal/components/data/charts/PriceChart.d.ts +5 -0
- package/dist/main-portal/components/data/charts/PriceChart.js +99 -0
- package/dist/main-portal/components/data/charts/TeamWalletChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/TeamWalletChart.js +33 -0
- package/dist/main-portal/components/data/charts/TerritoryProgressChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/TerritoryProgressChart.js +35 -0
- package/dist/main-portal/components/data/charts/UserLevelPieChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/UserLevelPieChart.js +34 -0
- package/dist/main-portal/components/data/charts/index.d.ts +5 -0
- package/dist/main-portal/components/data/charts/index.js +14 -0
- package/dist/main-portal/components/data/data-hero.d.ts +1 -0
- package/dist/main-portal/components/data/data-hero.js +81 -0
- package/dist/main-portal/components/data/mining-history-stats.d.ts +1 -0
- package/dist/main-portal/components/data/mining-history-stats.js +44 -0
- package/dist/main-portal/components/data/team-wallet-stats.d.ts +1 -0
- package/dist/main-portal/components/data/team-wallet-stats.js +34 -0
- package/dist/main-portal/components/data/territory-stats.d.ts +1 -0
- package/dist/main-portal/components/data/territory-stats.js +48 -0
- package/dist/main-portal/components/data/user-level-stats.d.ts +1 -0
- package/dist/main-portal/components/data/user-level-stats.js +36 -0
- package/dist/main-portal/components/fragment/FragmentPage.d.ts +1 -0
- package/dist/main-portal/components/fragment/FragmentPage.js +13 -0
- package/dist/main-portal/components/income/ManagerIncomePage.d.ts +1 -0
- package/dist/main-portal/components/income/ManagerIncomePage.js +147 -0
- package/dist/main-portal/components/layout/AppSidebar.d.ts +3 -0
- package/dist/main-portal/components/layout/AppSidebar.js +88 -0
- package/dist/main-portal/components/layout/DashboardHeader.d.ts +1 -0
- package/dist/main-portal/components/layout/DashboardHeader.js +121 -0
- package/dist/main-portal/components/layout/LocaleSwitcher.d.ts +1 -0
- package/dist/main-portal/components/layout/LocaleSwitcher.js +30 -0
- package/dist/main-portal/components/layout/MainFooter.d.ts +2 -0
- package/dist/main-portal/components/layout/MainFooter.js +50 -0
- package/dist/main-portal/components/layout/ShadcnNavbar.d.ts +1 -0
- package/dist/main-portal/components/layout/ShadcnNavbar.js +155 -0
- package/dist/main-portal/components/layout/TerminalSidebar.d.ts +1 -0
- package/dist/main-portal/components/layout/TerminalSidebar.js +110 -0
- package/dist/main-portal/components/lending/LendingPage.d.ts +1 -0
- package/dist/main-portal/components/lending/LendingPage.js +20 -0
- package/dist/main-portal/components/mcd/MCDPage.d.ts +1 -0
- package/dist/main-portal/components/mcd/MCDPage.js +125 -0
- package/dist/main-portal/components/messages/MessagesPage.d.ts +1 -0
- package/dist/main-portal/components/messages/MessagesPage.js +13 -0
- package/dist/main-portal/components/mining/MiningDistributionHistory.d.ts +11 -0
- package/dist/main-portal/components/mining/MiningDistributionHistory.js +84 -0
- package/dist/main-portal/components/mining/MiningModal.d.ts +12 -0
- package/dist/main-portal/components/mining/MiningModal.js +302 -0
- package/dist/main-portal/components/mining/MiningPage.d.ts +1 -0
- package/dist/main-portal/components/mining/MiningPage.js +237 -0
- package/dist/main-portal/components/mining/index.d.ts +1 -0
- package/dist/main-portal/components/mining/index.js +6 -0
- package/dist/main-portal/components/notifications/NotificationsPage.d.ts +1 -0
- package/dist/main-portal/components/notifications/NotificationsPage.js +13 -0
- package/dist/main-portal/components/organization/OrganizationPage.d.ts +1 -0
- package/dist/main-portal/components/organization/OrganizationPage.js +235 -0
- package/dist/main-portal/components/organization/connection-line.d.ts +12 -0
- package/dist/main-portal/components/organization/connection-line.js +38 -0
- package/dist/main-portal/components/organization/diagram-node.d.ts +17 -0
- package/dist/main-portal/components/organization/diagram-node.js +105 -0
- package/dist/main-portal/components/organization/system-panel.d.ts +11 -0
- package/dist/main-portal/components/organization/system-panel.js +72 -0
- package/dist/main-portal/components/profile/EmailChangeCard.d.ts +1 -0
- package/dist/main-portal/components/profile/EmailChangeCard.js +58 -0
- package/dist/main-portal/components/profile/ProfilePage.d.ts +1 -0
- package/dist/main-portal/components/profile/ProfilePage.js +263 -0
- package/dist/main-portal/components/profile/TwoFactorSettings.d.ts +1 -0
- package/dist/main-portal/components/profile/TwoFactorSettings.js +99 -0
- package/dist/main-portal/components/providers/ClientProviders.d.ts +6 -0
- package/dist/main-portal/components/providers/ClientProviders.js +17 -0
- package/dist/main-portal/components/providers/SolanaWalletProvider.d.ts +7 -0
- package/dist/main-portal/components/providers/SolanaWalletProvider.js +17 -0
- package/dist/main-portal/components/providers/theme-provider.d.ts +5 -0
- package/dist/main-portal/components/providers/theme-provider.js +10 -0
- package/dist/main-portal/components/queue/QueueStatusPage.d.ts +1 -0
- package/dist/main-portal/components/queue/QueueStatusPage.js +245 -0
- package/dist/main-portal/components/reincarnation/ReincarnationPage.d.ts +1 -0
- package/dist/main-portal/components/reincarnation/ReincarnationPage.js +87 -0
- package/dist/main-portal/components/resources/mcc-stats-section.d.ts +1 -0
- package/dist/main-portal/components/resources/mcc-stats-section.js +199 -0
- package/dist/main-portal/components/resources/mcd-stats-section.d.ts +1 -0
- package/dist/main-portal/components/resources/mcd-stats-section.js +76 -0
- package/dist/main-portal/components/resources/minting-entry-section.d.ts +1 -0
- package/dist/main-portal/components/resources/minting-entry-section.js +70 -0
- package/dist/main-portal/components/resources/public-mining-modal.d.ts +7 -0
- package/dist/main-portal/components/resources/public-mining-modal.js +239 -0
- package/dist/main-portal/components/resources/recycle-pool-section.d.ts +1 -0
- package/dist/main-portal/components/resources/recycle-pool-section.js +82 -0
- package/dist/main-portal/components/resources/registration-prompt.d.ts +8 -0
- package/dist/main-portal/components/resources/registration-prompt.js +13 -0
- package/dist/main-portal/components/rewards/RewardsPage.d.ts +1 -0
- package/dist/main-portal/components/rewards/RewardsPage.js +149 -0
- package/dist/main-portal/components/security/domain-verification-bar.d.ts +1 -0
- package/dist/main-portal/components/security/domain-verification-bar.js +32 -0
- package/dist/main-portal/components/stations/StationDetailPage.d.ts +5 -0
- package/dist/main-portal/components/stations/StationDetailPage.js +232 -0
- package/dist/main-portal/components/stations/StationIncomeChart.d.ts +11 -0
- package/dist/main-portal/components/stations/StationIncomeChart.js +57 -0
- package/dist/main-portal/components/stations/StationKPIHistory.d.ts +1 -0
- package/dist/main-portal/components/stations/StationKPIHistory.js +7 -0
- package/dist/main-portal/components/stations/StationListPage.d.ts +1 -0
- package/dist/main-portal/components/stations/StationListPage.js +341 -0
- package/dist/main-portal/components/stations/StationMemberRanking.d.ts +13 -0
- package/dist/main-portal/components/stations/StationMemberRanking.js +64 -0
- package/dist/main-portal/components/stations/StationSummaryCards.d.ts +13 -0
- package/dist/main-portal/components/stations/StationSummaryCards.js +30 -0
- package/dist/main-portal/components/stations/StationsPage.d.ts +1 -0
- package/dist/main-portal/components/stations/StationsPage.js +239 -0
- package/dist/main-portal/components/territory/TerritoryNFTBrowser.d.ts +1 -0
- package/dist/main-portal/components/territory/TerritoryNFTBrowser.js +147 -0
- package/dist/main-portal/components/ui/accordion.d.ts +7 -0
- package/dist/main-portal/components/ui/accordion.js +57 -0
- package/dist/main-portal/components/ui/alert-dialog.d.ts +14 -0
- package/dist/main-portal/components/ui/alert-dialog.js +85 -0
- package/dist/main-portal/components/ui/alert.d.ts +9 -0
- package/dist/main-portal/components/ui/alert.js +28 -0
- package/dist/main-portal/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/main-portal/components/ui/aspect-ratio.js +43 -0
- package/dist/main-portal/components/ui/avatar.d.ts +6 -0
- package/dist/main-portal/components/ui/avatar.js +52 -0
- package/dist/main-portal/components/ui/badge.d.ts +9 -0
- package/dist/main-portal/components/ui/badge.js +26 -0
- package/dist/main-portal/components/ui/breadcrumb.d.ts +11 -0
- package/dist/main-portal/components/ui/breadcrumb.js +35 -0
- package/dist/main-portal/components/ui/button-group.d.ts +11 -0
- package/dist/main-portal/components/ui/button-group.js +34 -0
- package/dist/main-portal/components/ui/button.d.ts +10 -0
- package/dist/main-portal/components/ui/button.js +35 -0
- package/dist/main-portal/components/ui/calendar.d.ts +8 -0
- package/dist/main-portal/components/ui/calendar.js +111 -0
- package/dist/main-portal/components/ui/card.d.ts +17 -0
- package/dist/main-portal/components/ui/card.js +41 -0
- package/dist/main-portal/components/ui/carousel.d.ts +19 -0
- package/dist/main-portal/components/ui/carousel.js +134 -0
- package/dist/main-portal/components/ui/chart.d.ts +40 -0
- package/dist/main-portal/components/ui/chart.js +168 -0
- package/dist/main-portal/components/ui/checkbox.d.ts +4 -0
- package/dist/main-portal/components/ui/checkbox.js +45 -0
- package/dist/main-portal/components/ui/collapsible.d.ts +5 -0
- package/dist/main-portal/components/ui/collapsible.js +51 -0
- package/dist/main-portal/components/ui/command.d.ts +18 -0
- package/dist/main-portal/components/ui/command.js +45 -0
- package/dist/main-portal/components/ui/context-menu.d.ts +25 -0
- package/dist/main-portal/components/ui/context-menu.js +101 -0
- package/dist/main-portal/components/ui/dialog.d.ts +15 -0
- package/dist/main-portal/components/ui/dialog.js +81 -0
- package/dist/main-portal/components/ui/drawer.d.ts +13 -0
- package/dist/main-portal/components/ui/drawer.js +47 -0
- package/dist/main-portal/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/main-portal/components/ui/dropdown-menu.js +101 -0
- package/dist/main-portal/components/ui/empty.d.ts +11 -0
- package/dist/main-portal/components/ui/empty.js +41 -0
- package/dist/main-portal/components/ui/field.d.ts +24 -0
- package/dist/main-portal/components/ui/field.js +85 -0
- package/dist/main-portal/components/ui/form.d.ts +24 -0
- package/dist/main-portal/components/ui/form.js +103 -0
- package/dist/main-portal/components/ui/hover-avatar.d.ts +10 -0
- package/dist/main-portal/components/ui/hover-avatar.js +70 -0
- package/dist/main-portal/components/ui/hover-card.d.ts +6 -0
- package/dist/main-portal/components/ui/hover-card.js +52 -0
- package/dist/main-portal/components/ui/input-group.d.ts +15 -0
- package/dist/main-portal/components/ui/input-group.js +65 -0
- package/dist/main-portal/components/ui/input-otp.d.ts +11 -0
- package/dist/main-portal/components/ui/input-otp.js +60 -0
- package/dist/main-portal/components/ui/input.d.ts +3 -0
- package/dist/main-portal/components/ui/input.js +8 -0
- package/dist/main-portal/components/ui/item.d.ts +23 -0
- package/dist/main-portal/components/ui/item.js +77 -0
- package/dist/main-portal/components/ui/kbd.d.ts +3 -0
- package/dist/main-portal/components/ui/kbd.js +13 -0
- package/dist/main-portal/components/ui/label.d.ts +4 -0
- package/dist/main-portal/components/ui/label.js +44 -0
- package/dist/main-portal/components/ui/menubar.d.ts +26 -0
- package/dist/main-portal/components/ui/menubar.js +105 -0
- package/dist/main-portal/components/ui/navigation-menu.d.ts +14 -0
- package/dist/main-portal/components/ui/navigation-menu.js +75 -0
- package/dist/main-portal/components/ui/pagination.d.ts +13 -0
- package/dist/main-portal/components/ui/pagination.js +37 -0
- package/dist/main-portal/components/ui/popover.d.ts +7 -0
- package/dist/main-portal/components/ui/popover.js +56 -0
- package/dist/main-portal/components/ui/progress.d.ts +4 -0
- package/dist/main-portal/components/ui/progress.js +44 -0
- package/dist/main-portal/components/ui/radio-group.d.ts +5 -0
- package/dist/main-portal/components/ui/radio-group.js +49 -0
- package/dist/main-portal/components/ui/resizable.d.ts +8 -0
- package/dist/main-portal/components/ui/resizable.js +53 -0
- package/dist/main-portal/components/ui/scroll-area.d.ts +5 -0
- package/dist/main-portal/components/ui/scroll-area.js +50 -0
- package/dist/main-portal/components/ui/select.d.ts +15 -0
- package/dist/main-portal/components/ui/select.js +83 -0
- package/dist/main-portal/components/ui/separator.d.ts +4 -0
- package/dist/main-portal/components/ui/separator.js +44 -0
- package/dist/main-portal/components/ui/sheet.d.ts +13 -0
- package/dist/main-portal/components/ui/sheet.js +83 -0
- package/dist/main-portal/components/ui/sidebar.d.ts +69 -0
- package/dist/main-portal/components/ui/sidebar.js +258 -0
- package/dist/main-portal/components/ui/skeleton.d.ts +2 -0
- package/dist/main-portal/components/ui/skeleton.js +9 -0
- package/dist/main-portal/components/ui/slider.d.ts +4 -0
- package/dist/main-portal/components/ui/slider.js +50 -0
- package/dist/main-portal/components/ui/sonner.d.ts +3 -0
- package/dist/main-portal/components/ui/sonner.js +17 -0
- package/dist/main-portal/components/ui/spinner.d.ts +2 -0
- package/dist/main-portal/components/ui/spinner.js +10 -0
- package/dist/main-portal/components/ui/switch.d.ts +4 -0
- package/dist/main-portal/components/ui/switch.js +44 -0
- package/dist/main-portal/components/ui/table.d.ts +10 -0
- package/dist/main-portal/components/ui/table.js +38 -0
- package/dist/main-portal/components/ui/tabs.d.ts +7 -0
- package/dist/main-portal/components/ui/tabs.js +53 -0
- package/dist/main-portal/components/ui/terminal.d.ts +49 -0
- package/dist/main-portal/components/ui/terminal.js +56 -0
- package/dist/main-portal/components/ui/textarea.d.ts +3 -0
- package/dist/main-portal/components/ui/textarea.js +8 -0
- package/dist/main-portal/components/ui/time-remaining.d.ts +54 -0
- package/dist/main-portal/components/ui/time-remaining.js +223 -0
- package/dist/main-portal/components/ui/toast.d.ts +15 -0
- package/dist/main-portal/components/ui/toast.js +77 -0
- package/dist/main-portal/components/ui/toaster.d.ts +1 -0
- package/dist/main-portal/components/ui/toaster.js +14 -0
- package/dist/main-portal/components/ui/toggle-group.d.ts +7 -0
- package/dist/main-portal/components/ui/toggle-group.js +58 -0
- package/dist/main-portal/components/ui/toggle.d.ts +9 -0
- package/dist/main-portal/components/ui/toggle.js +64 -0
- package/dist/main-portal/components/ui/tooltip.d.ts +7 -0
- package/dist/main-portal/components/ui/tooltip.js +56 -0
- package/dist/main-portal/components/ui/use-mobile.d.ts +1 -0
- package/dist/main-portal/components/ui/use-mobile.js +53 -0
- package/dist/main-portal/components/voting/VotingPage.d.ts +1 -0
- package/dist/main-portal/components/voting/VotingPage.js +14 -0
- package/dist/main-portal/components/wallet/MCCHistory.d.ts +9 -0
- package/dist/main-portal/components/wallet/MCCHistory.js +100 -0
- package/dist/main-portal/components/wallet/WalletManagement.d.ts +5 -0
- package/dist/main-portal/components/wallet/WalletManagement.js +144 -0
- package/dist/main-portal/components/wallet/WalletPage.d.ts +1 -0
- package/dist/main-portal/components/wallet/WalletPage.js +130 -0
- package/dist/main-portal/config/menu-config.d.ts +22 -0
- package/dist/main-portal/config/menu-config.js +167 -0
- package/dist/main-portal/contexts/MCCPriceContext.d.ts +38 -0
- package/dist/main-portal/contexts/MCCPriceContext.js +70 -0
- package/dist/main-portal/contexts/WalletContext.d.ts +48 -0
- package/dist/main-portal/contexts/WalletContext.js +94 -0
- package/dist/main-portal/hooks/index.d.ts +4 -0
- package/dist/main-portal/hooks/index.js +11 -0
- package/dist/main-portal/hooks/use-breakpoint.d.ts +45 -0
- package/dist/main-portal/hooks/use-breakpoint.js +91 -0
- package/dist/main-portal/hooks/use-mobile.d.ts +1 -0
- package/dist/main-portal/hooks/use-mobile.js +55 -0
- package/dist/main-portal/hooks/use-toast.d.ts +44 -0
- package/dist/main-portal/hooks/use-toast.js +164 -0
- package/dist/main-portal/hooks/useAuth.d.ts +30 -0
- package/dist/main-portal/hooks/useAuth.js +135 -0
- package/dist/main-portal/hooks/useMCC.d.ts +26 -0
- package/dist/main-portal/hooks/useMCC.js +148 -0
- package/dist/main-portal/hooks/useMCD.d.ts +17 -0
- package/dist/main-portal/hooks/useMCD.js +114 -0
- package/dist/main-portal/hooks/useMarketData.d.ts +9 -0
- package/dist/main-portal/hooks/useMarketData.js +32 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.d.ts +31 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.js +65 -0
- package/dist/main-portal/hooks/usePriceHistory.d.ts +9 -0
- package/dist/main-portal/hooks/usePriceHistory.js +36 -0
- package/dist/main-portal/hooks/useSolanaBalance.d.ts +21 -0
- package/dist/main-portal/hooks/useSolanaBalance.js +58 -0
- package/dist/main-portal/hooks/useSpeechRecognition.d.ts +6 -0
- package/dist/main-portal/hooks/useSpeechRecognition.js +82 -0
- package/dist/main-portal/hooks/useStats.d.ts +131 -0
- package/dist/main-portal/hooks/useStats.js +161 -0
- package/dist/main-portal/hooks/useStrategies.d.ts +134 -0
- package/dist/main-portal/hooks/useStrategies.js +28 -0
- package/dist/main-portal/hooks/useUserRank.d.ts +16 -0
- package/dist/main-portal/hooks/useUserRank.js +61 -0
- package/dist/main-portal/hooks/useWalletTokenBalances.d.ts +29 -0
- package/dist/main-portal/hooks/useWalletTokenBalances.js +106 -0
- package/dist/main-portal/i18n/navigation.d.ts +341 -0
- package/dist/main-portal/i18n/navigation.js +7 -0
- package/dist/main-portal/i18n/request.d.ts +2 -0
- package/dist/main-portal/i18n/request.js +47 -0
- package/dist/main-portal/i18n/routing.d.ts +18 -0
- package/dist/main-portal/i18n/routing.js +10 -0
- package/dist/main-portal/lib/ai-chat-config.d.ts +8 -0
- package/dist/main-portal/lib/ai-chat-config.js +144 -0
- package/dist/main-portal/lib/analytics/hooks.d.ts +139 -0
- package/dist/main-portal/lib/analytics/hooks.js +277 -0
- package/dist/main-portal/lib/analytics/index.d.ts +2 -0
- package/dist/main-portal/lib/analytics/index.js +19 -0
- package/dist/main-portal/lib/analytics/types.d.ts +611 -0
- package/dist/main-portal/lib/analytics/types.js +2 -0
- package/dist/main-portal/lib/api/account.d.ts +39 -0
- package/dist/main-portal/lib/api/account.js +86 -0
- package/dist/main-portal/lib/api/admin.d.ts +78 -0
- package/dist/main-portal/lib/api/admin.js +195 -0
- package/dist/main-portal/lib/api/analytics.d.ts +217 -0
- package/dist/main-portal/lib/api/analytics.js +55 -0
- package/dist/main-portal/lib/api/blockchain.d.ts +178 -0
- package/dist/main-portal/lib/api/blockchain.js +302 -0
- package/dist/main-portal/lib/api/core.d.ts +3 -0
- package/dist/main-portal/lib/api/core.js +47 -0
- package/dist/main-portal/lib/api/dexscreener.d.ts +126 -0
- package/dist/main-portal/lib/api/dexscreener.js +139 -0
- package/dist/main-portal/lib/api/geckoterminal.d.ts +10 -0
- package/dist/main-portal/lib/api/geckoterminal.js +43 -0
- package/dist/main-portal/lib/api/index.d.ts +16 -0
- package/dist/main-portal/lib/api/index.js +230 -0
- package/dist/main-portal/lib/api/mcc-holders.d.ts +130 -0
- package/dist/main-portal/lib/api/mcc-holders.js +47 -0
- package/dist/main-portal/lib/api/org-service-proxy.d.ts +7 -0
- package/dist/main-portal/lib/api/org-service-proxy.js +55 -0
- package/dist/main-portal/lib/api/services/ai.d.ts +139 -0
- package/dist/main-portal/lib/api/services/ai.js +214 -0
- package/dist/main-portal/lib/api/services/finance.d.ts +37 -0
- package/dist/main-portal/lib/api/services/finance.js +144 -0
- package/dist/main-portal/lib/api/services/index.d.ts +5 -0
- package/dist/main-portal/lib/api/services/index.js +21 -0
- package/dist/main-portal/lib/api/services/mining.d.ts +68 -0
- package/dist/main-portal/lib/api/services/mining.js +76 -0
- package/dist/main-portal/lib/api/services/organization.d.ts +161 -0
- package/dist/main-portal/lib/api/services/organization.js +139 -0
- package/dist/main-portal/lib/api/services/user.d.ts +90 -0
- package/dist/main-portal/lib/api/services/user.js +78 -0
- package/dist/main-portal/lib/api/services.d.ts +1 -0
- package/dist/main-portal/lib/api/services.js +17 -0
- package/dist/main-portal/lib/api/strategies.d.ts +101 -0
- package/dist/main-portal/lib/api/strategies.js +87 -0
- package/dist/main-portal/lib/api-service.d.ts +1 -0
- package/dist/main-portal/lib/api-service.js +18 -0
- package/dist/main-portal/lib/auth-service.d.ts +65 -0
- package/dist/main-portal/lib/auth-service.js +382 -0
- package/dist/main-portal/lib/config/mainstream-tokens.d.ts +13 -0
- package/dist/main-portal/lib/config/mainstream-tokens.js +88 -0
- package/dist/main-portal/lib/docs-data.d.ts +36 -0
- package/dist/main-portal/lib/docs-data.js +108 -0
- package/dist/main-portal/lib/exchanges/config.d.ts +34 -0
- package/dist/main-portal/lib/exchanges/config.js +185 -0
- package/dist/main-portal/lib/exchanges/hooks/index.d.ts +5 -0
- package/dist/main-portal/lib/exchanges/hooks/index.js +10 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.d.ts +15 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.js +216 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.d.ts +32 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.js +395 -0
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.d.ts +15 -0
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.js +51 -0
- package/dist/main-portal/lib/exchanges/index.d.ts +4 -0
- package/dist/main-portal/lib/exchanges/index.js +21 -0
- package/dist/main-portal/lib/exchanges/types.d.ts +102 -0
- package/dist/main-portal/lib/exchanges/types.js +2 -0
- package/dist/main-portal/lib/exchanges/utils.d.ts +1 -0
- package/dist/main-portal/lib/exchanges/utils.js +10 -0
- package/dist/main-portal/lib/gcp-secrets.d.ts +7 -0
- package/dist/main-portal/lib/gcp-secrets.js +45 -0
- package/dist/main-portal/lib/mockWallet.d.ts +130 -0
- package/dist/main-portal/lib/mockWallet.js +284 -0
- package/dist/main-portal/lib/oauth-config.d.ts +12 -0
- package/dist/main-portal/lib/oauth-config.js +48 -0
- package/dist/main-portal/lib/order-id-generator.d.ts +19 -0
- package/dist/main-portal/lib/order-id-generator.js +97 -0
- package/dist/main-portal/lib/solana/reincarnation-client.d.ts +28 -0
- package/dist/main-portal/lib/solana/reincarnation-client.js +39 -0
- package/dist/main-portal/lib/solana/solana-pay.d.ts +31 -0
- package/dist/main-portal/lib/solana/solana-pay.js +85 -0
- package/dist/main-portal/lib/strategy/defaults.d.ts +2 -0
- package/dist/main-portal/lib/strategy/defaults.js +58 -0
- package/dist/main-portal/lib/strategy/index.d.ts +3 -0
- package/dist/main-portal/lib/strategy/index.js +20 -0
- package/dist/main-portal/lib/strategy/tooltips.d.ts +1 -0
- package/dist/main-portal/lib/strategy/tooltips.js +50 -0
- package/dist/main-portal/lib/strategy/types.d.ts +74 -0
- package/dist/main-portal/lib/strategy/types.js +2 -0
- package/dist/main-portal/lib/types/ai.types.d.ts +111 -0
- package/dist/main-portal/lib/types/ai.types.js +2 -0
- package/dist/main-portal/lib/types/api.d.ts +5 -0
- package/dist/main-portal/lib/types/api.js +21 -0
- package/dist/main-portal/lib/types/common.types.d.ts +168 -0
- package/dist/main-portal/lib/types/common.types.js +24 -0
- package/dist/main-portal/lib/types/finance.types.d.ts +267 -0
- package/dist/main-portal/lib/types/finance.types.js +2 -0
- package/dist/main-portal/lib/types/protocol.types.d.ts +216 -0
- package/dist/main-portal/lib/types/protocol.types.js +2 -0
- package/dist/main-portal/lib/types/user.types.d.ts +243 -0
- package/dist/main-portal/lib/types/user.types.js +12 -0
- package/dist/main-portal/lib/utils/territoryId.d.ts +75 -0
- package/dist/main-portal/lib/utils/territoryId.js +241 -0
- package/dist/main-portal/lib/utils.d.ts +4 -0
- package/dist/main-portal/lib/utils.js +24 -0
- package/dist/main-portal/lib/wallet-auth/api.d.ts +13 -0
- package/dist/main-portal/lib/wallet-auth/api.js +132 -0
- package/dist/main-portal/lib/wallet-auth/types.d.ts +87 -0
- package/dist/main-portal/lib/wallet-auth/types.js +58 -0
- package/package.json +55 -5
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface MCCTickerData {
|
|
3
|
+
price: number | null;
|
|
4
|
+
basePrice: number | null;
|
|
5
|
+
marketPrice: number | null;
|
|
6
|
+
cpmmReserves: {
|
|
7
|
+
mcc: number;
|
|
8
|
+
usdc: number;
|
|
9
|
+
} | null;
|
|
10
|
+
miningVaultMcc: number | null;
|
|
11
|
+
volume24h: {
|
|
12
|
+
total: number;
|
|
13
|
+
buy: number;
|
|
14
|
+
sell: number;
|
|
15
|
+
} | null;
|
|
16
|
+
trades24h: {
|
|
17
|
+
buys: number;
|
|
18
|
+
sells: number;
|
|
19
|
+
} | null;
|
|
20
|
+
lastTrade: {
|
|
21
|
+
price: number;
|
|
22
|
+
amount: number;
|
|
23
|
+
direction: string;
|
|
24
|
+
time: number;
|
|
25
|
+
} | null;
|
|
26
|
+
updatedAt: string | null;
|
|
27
|
+
fdv: number | null;
|
|
28
|
+
miningPrice: number | null;
|
|
29
|
+
}
|
|
30
|
+
interface MCCPriceContextValue extends MCCTickerData {
|
|
31
|
+
loading: boolean;
|
|
32
|
+
refresh: () => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export declare function MCCPriceProvider({ children }: {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function useMCCPrice(): MCCPriceContextValue;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.MCCPriceProvider = MCCPriceProvider;
|
|
6
|
+
exports.useMCCPrice = useMCCPrice;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const POLL_INTERVAL = 15000; // 15 seconds
|
|
10
|
+
const MCCPriceContext = (0, react_1.createContext)(null);
|
|
11
|
+
function MCCPriceProvider({ children }) {
|
|
12
|
+
const [data, setData] = (0, react_1.useState)({
|
|
13
|
+
price: null, basePrice: null, marketPrice: null,
|
|
14
|
+
cpmmReserves: null, miningVaultMcc: null,
|
|
15
|
+
volume24h: null, trades24h: null, lastTrade: null,
|
|
16
|
+
updatedAt: null, fdv: null, miningPrice: null,
|
|
17
|
+
});
|
|
18
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
19
|
+
const fetchTicker = (0, react_1.useCallback)(async () => {
|
|
20
|
+
try {
|
|
21
|
+
const res = await fetch('/api/stats/ticker');
|
|
22
|
+
if (!res.ok)
|
|
23
|
+
return;
|
|
24
|
+
const json = await res.json();
|
|
25
|
+
if (!json.success || !json.data)
|
|
26
|
+
return;
|
|
27
|
+
const d = json.data;
|
|
28
|
+
const price = d.price ?? null;
|
|
29
|
+
setData({
|
|
30
|
+
price,
|
|
31
|
+
basePrice: d.base_price ?? null,
|
|
32
|
+
marketPrice: d.market_price ?? null,
|
|
33
|
+
cpmmReserves: d.cpmm_reserves ?? null,
|
|
34
|
+
miningVaultMcc: d.mining_vault_mcc ?? null,
|
|
35
|
+
volume24h: d.volume_24h ?? null,
|
|
36
|
+
trades24h: d.trades_24h ?? null,
|
|
37
|
+
lastTrade: d.last_trade ?? null,
|
|
38
|
+
updatedAt: d.updated_at ?? null,
|
|
39
|
+
fdv: price ? price * 1000000000 : null,
|
|
40
|
+
miningPrice: (d.base_price ? d.base_price * 4 : null),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Silent — stale data is acceptable
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
setLoading(false);
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
(0, react_1.useEffect)(() => {
|
|
51
|
+
fetchTicker();
|
|
52
|
+
const interval = setInterval(fetchTicker, POLL_INTERVAL);
|
|
53
|
+
return () => clearInterval(interval);
|
|
54
|
+
}, [fetchTicker]);
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(MCCPriceContext.Provider, { value: { ...data, loading, refresh: fetchTicker }, children: children }));
|
|
56
|
+
}
|
|
57
|
+
function useMCCPrice() {
|
|
58
|
+
const ctx = (0, react_1.useContext)(MCCPriceContext);
|
|
59
|
+
if (!ctx) {
|
|
60
|
+
// Return safe defaults when used outside provider (e.g. in static pages)
|
|
61
|
+
return {
|
|
62
|
+
price: null, basePrice: null, marketPrice: null,
|
|
63
|
+
cpmmReserves: null, miningVaultMcc: null,
|
|
64
|
+
volume24h: null, trades24h: null, lastTrade: null,
|
|
65
|
+
updatedAt: null, fdv: null, miningPrice: null,
|
|
66
|
+
loading: true, refresh: async () => { },
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return ctx;
|
|
70
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MCCBalance, MCCLockPeriod, MCCMinting, MCCMintingStats, MiningWeight, UserRank, PDABalance, MCDBalance, MCDTransaction, MCDUserDailyReward, TerritoryHoldings, NextLevelRequirement } from '../lib/types/api';
|
|
3
|
+
interface PDAInfo {
|
|
4
|
+
pda_address: string;
|
|
5
|
+
token_account: string;
|
|
6
|
+
bump: number;
|
|
7
|
+
}
|
|
8
|
+
interface WalletContextType {
|
|
9
|
+
connected: boolean;
|
|
10
|
+
address: string | null;
|
|
11
|
+
balance: MCCBalance | null;
|
|
12
|
+
totalBalance: number;
|
|
13
|
+
availableBalance: number;
|
|
14
|
+
lockedBalance: number;
|
|
15
|
+
pdaBalance: PDABalance | null;
|
|
16
|
+
pdaInfo: PDAInfo | null;
|
|
17
|
+
onChainBalance: number;
|
|
18
|
+
lockPeriods: MCCLockPeriod[];
|
|
19
|
+
mintingHistory: MCCMinting[];
|
|
20
|
+
mintingStats: MCCMintingStats | null;
|
|
21
|
+
mcdBalance: MCDBalance | null;
|
|
22
|
+
mcdAmount: number;
|
|
23
|
+
mcdTotalReceived: number;
|
|
24
|
+
mcdTotalSpent: number;
|
|
25
|
+
mcdTransactions: MCDTransaction[];
|
|
26
|
+
mcdDailyRewards: MCDUserDailyReward[];
|
|
27
|
+
userRank: UserRank | null;
|
|
28
|
+
currentLevel: number | null;
|
|
29
|
+
nextRank: UserRank | null;
|
|
30
|
+
nextLevel: number | null;
|
|
31
|
+
progressPercent: number;
|
|
32
|
+
holdings: TerritoryHoldings;
|
|
33
|
+
nextLevelRequirement: NextLevelRequirement | null;
|
|
34
|
+
miningWeight: MiningWeight | null;
|
|
35
|
+
loading: boolean;
|
|
36
|
+
isRefreshing: boolean;
|
|
37
|
+
error: string | null;
|
|
38
|
+
refreshBalance: () => Promise<void>;
|
|
39
|
+
refreshMinting: () => Promise<void>;
|
|
40
|
+
refreshRank: () => Promise<void>;
|
|
41
|
+
refreshPDABalance: () => Promise<void>;
|
|
42
|
+
refreshMCD: () => Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
export declare const useWallet: () => WalletContextType;
|
|
45
|
+
export declare function WalletProvider({ children }: {
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useWallet = void 0;
|
|
5
|
+
exports.WalletProvider = WalletProvider;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const useAuth_1 = require("../hooks/useAuth");
|
|
9
|
+
const useMCC_1 = require("../hooks/useMCC");
|
|
10
|
+
const useMCD_1 = require("../hooks/useMCD");
|
|
11
|
+
const useUserRank_1 = require("../hooks/useUserRank");
|
|
12
|
+
const EMPTY_HOLDINGS = { station: 0, matrix: 0, sector: 0, system: 0 };
|
|
13
|
+
const WalletContext = (0, react_1.createContext)({
|
|
14
|
+
connected: false,
|
|
15
|
+
address: null,
|
|
16
|
+
balance: null,
|
|
17
|
+
totalBalance: 0,
|
|
18
|
+
availableBalance: 0,
|
|
19
|
+
lockedBalance: 0,
|
|
20
|
+
pdaBalance: null,
|
|
21
|
+
pdaInfo: null,
|
|
22
|
+
onChainBalance: 0,
|
|
23
|
+
lockPeriods: [],
|
|
24
|
+
mintingHistory: [],
|
|
25
|
+
mintingStats: null,
|
|
26
|
+
mcdBalance: null,
|
|
27
|
+
mcdAmount: 0,
|
|
28
|
+
mcdTotalReceived: 0,
|
|
29
|
+
mcdTotalSpent: 0,
|
|
30
|
+
mcdTransactions: [],
|
|
31
|
+
mcdDailyRewards: [],
|
|
32
|
+
userRank: null,
|
|
33
|
+
currentLevel: null,
|
|
34
|
+
nextRank: null,
|
|
35
|
+
nextLevel: null,
|
|
36
|
+
progressPercent: 0,
|
|
37
|
+
holdings: EMPTY_HOLDINGS,
|
|
38
|
+
nextLevelRequirement: null,
|
|
39
|
+
miningWeight: null,
|
|
40
|
+
loading: true,
|
|
41
|
+
isRefreshing: false,
|
|
42
|
+
error: null,
|
|
43
|
+
refreshBalance: async () => { },
|
|
44
|
+
refreshMinting: async () => { },
|
|
45
|
+
refreshRank: async () => { },
|
|
46
|
+
refreshPDABalance: async () => { },
|
|
47
|
+
refreshMCD: async () => { },
|
|
48
|
+
});
|
|
49
|
+
const useWallet = () => (0, react_1.useContext)(WalletContext);
|
|
50
|
+
exports.useWallet = useWallet;
|
|
51
|
+
function WalletProvider({ children }) {
|
|
52
|
+
const { user } = (0, useAuth_1.useAuth)();
|
|
53
|
+
const mccData = (0, useMCC_1.useMCC)(user?.uid);
|
|
54
|
+
const mcdData = (0, useMCD_1.useMCD)(user?.uid);
|
|
55
|
+
const rankData = (0, useUserRank_1.useUserRank)(user?.uid);
|
|
56
|
+
const loading = mccData.loading || mcdData.loading || rankData.loading;
|
|
57
|
+
const error = mccData.error || mcdData.error || rankData.error;
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(WalletContext.Provider, { value: {
|
|
59
|
+
connected: !!user,
|
|
60
|
+
address: user?.uid || null,
|
|
61
|
+
balance: mccData.balance,
|
|
62
|
+
totalBalance: mccData.totalBalance,
|
|
63
|
+
availableBalance: mccData.availableBalance,
|
|
64
|
+
lockedBalance: mccData.lockedBalance,
|
|
65
|
+
pdaBalance: mccData.pdaBalance,
|
|
66
|
+
pdaInfo: mccData.pdaInfo,
|
|
67
|
+
onChainBalance: mccData.onChainBalance,
|
|
68
|
+
lockPeriods: mccData.lockPeriods,
|
|
69
|
+
mintingHistory: mccData.mintingHistory,
|
|
70
|
+
mintingStats: mccData.mintingStats,
|
|
71
|
+
mcdBalance: mcdData.balance,
|
|
72
|
+
mcdAmount: mcdData.mcdBalance,
|
|
73
|
+
mcdTotalReceived: mcdData.totalReceived,
|
|
74
|
+
mcdTotalSpent: mcdData.totalSpent,
|
|
75
|
+
mcdTransactions: mcdData.transactions,
|
|
76
|
+
mcdDailyRewards: mcdData.dailyRewards,
|
|
77
|
+
userRank: rankData.rank,
|
|
78
|
+
currentLevel: rankData.currentLevel,
|
|
79
|
+
nextRank: rankData.nextRank,
|
|
80
|
+
nextLevel: rankData.nextLevel,
|
|
81
|
+
progressPercent: rankData.progressPercent,
|
|
82
|
+
holdings: rankData.holdings,
|
|
83
|
+
nextLevelRequirement: rankData.nextLevelRequirement,
|
|
84
|
+
miningWeight: rankData.miningWeight,
|
|
85
|
+
loading,
|
|
86
|
+
isRefreshing: mccData.isRefreshing,
|
|
87
|
+
error,
|
|
88
|
+
refreshBalance: mccData.refresh,
|
|
89
|
+
refreshMinting: mccData.refreshMinting,
|
|
90
|
+
refreshRank: rankData.refresh,
|
|
91
|
+
refreshPDABalance: mccData.refreshPDABalance,
|
|
92
|
+
refreshMCD: mcdData.refresh,
|
|
93
|
+
}, children: children }));
|
|
94
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUserRank = exports.useMCC = exports.useIsMobile = exports.useAuth = void 0;
|
|
4
|
+
var useAuth_1 = require("./useAuth");
|
|
5
|
+
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return useAuth_1.useAuth; } });
|
|
6
|
+
var use_mobile_1 = require("./use-mobile");
|
|
7
|
+
Object.defineProperty(exports, "useIsMobile", { enumerable: true, get: function () { return use_mobile_1.useIsMobile; } });
|
|
8
|
+
var useMCC_1 = require("./useMCC");
|
|
9
|
+
Object.defineProperty(exports, "useMCC", { enumerable: true, get: function () { return useMCC_1.useMCC; } });
|
|
10
|
+
var useUserRank_1 = require("./useUserRank");
|
|
11
|
+
Object.defineProperty(exports, "useUserRank", { enumerable: true, get: function () { return useUserRank_1.useUserRank; } });
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 9-Tier Responsive Breakpoint System
|
|
3
|
+
* Matches globals.css @theme breakpoint definitions exactly
|
|
4
|
+
*/
|
|
5
|
+
export declare const BREAKPOINTS: {
|
|
6
|
+
readonly "3xs": 320;
|
|
7
|
+
readonly "2xs": 360;
|
|
8
|
+
readonly xs: 475;
|
|
9
|
+
readonly sm: 640;
|
|
10
|
+
readonly md: 768;
|
|
11
|
+
readonly lg: 1024;
|
|
12
|
+
readonly xl: 1280;
|
|
13
|
+
readonly "2xl": 1536;
|
|
14
|
+
readonly "3xl": 1920;
|
|
15
|
+
};
|
|
16
|
+
export type BreakpointKey = keyof typeof BREAKPOINTS;
|
|
17
|
+
/**
|
|
18
|
+
* Comprehensive breakpoint hook for responsive JS logic.
|
|
19
|
+
*
|
|
20
|
+
* Usage:
|
|
21
|
+
* const { current, isAbove, isBelow, isBetween, width } = useBreakpoint()
|
|
22
|
+
* if (isAbove("md")) { ... } // >= 768px
|
|
23
|
+
* if (isBelow("sm")) { ... } // < 640px
|
|
24
|
+
* if (isBetween("xs", "lg")) { ... } // >= 475px && < 1024px
|
|
25
|
+
*/
|
|
26
|
+
export declare function useBreakpoint(): {
|
|
27
|
+
/** Current active breakpoint name */
|
|
28
|
+
current: "sm" | "md" | "lg" | "base" | "3xs" | "2xs" | "xs" | "xl" | "2xl" | "3xl";
|
|
29
|
+
/** True if width >= given breakpoint */
|
|
30
|
+
isAbove: (bp: BreakpointKey) => boolean;
|
|
31
|
+
/** True if width < given breakpoint */
|
|
32
|
+
isBelow: (bp: BreakpointKey) => boolean;
|
|
33
|
+
/** True if width >= min and < max */
|
|
34
|
+
isBetween: (min: BreakpointKey, max: BreakpointKey) => boolean;
|
|
35
|
+
/** Raw viewport width in px */
|
|
36
|
+
width: number;
|
|
37
|
+
/** False during SSR / before hydration */
|
|
38
|
+
hasMounted: boolean;
|
|
39
|
+
/** Legacy compat: true when < md (768px) */
|
|
40
|
+
isMobile: boolean;
|
|
41
|
+
/** true when < xs (475px) — small phones */
|
|
42
|
+
isSmallPhone: boolean;
|
|
43
|
+
/** true when >= md && < lg — tablets */
|
|
44
|
+
isTablet: boolean;
|
|
45
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.BREAKPOINTS = void 0;
|
|
6
|
+
exports.useBreakpoint = useBreakpoint;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* 9-Tier Responsive Breakpoint System
|
|
10
|
+
* Matches globals.css @theme breakpoint definitions exactly
|
|
11
|
+
*/
|
|
12
|
+
exports.BREAKPOINTS = {
|
|
13
|
+
"3xs": 320,
|
|
14
|
+
"2xs": 360,
|
|
15
|
+
xs: 475,
|
|
16
|
+
sm: 640,
|
|
17
|
+
md: 768,
|
|
18
|
+
lg: 1024,
|
|
19
|
+
xl: 1280,
|
|
20
|
+
"2xl": 1536,
|
|
21
|
+
"3xl": 1920,
|
|
22
|
+
};
|
|
23
|
+
const BREAKPOINT_ORDER = [
|
|
24
|
+
"3xs", "2xs", "xs", "sm", "md", "lg", "xl", "2xl", "3xl",
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Returns the current active breakpoint name based on window width.
|
|
28
|
+
* Uses min-width (mobile-first): returns the largest breakpoint that fits.
|
|
29
|
+
* Below 320px returns "base".
|
|
30
|
+
*/
|
|
31
|
+
function getActiveBreakpoint(width) {
|
|
32
|
+
for (let i = BREAKPOINT_ORDER.length - 1; i >= 0; i--) {
|
|
33
|
+
if (width >= exports.BREAKPOINTS[BREAKPOINT_ORDER[i]]) {
|
|
34
|
+
return BREAKPOINT_ORDER[i];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return "base";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Comprehensive breakpoint hook for responsive JS logic.
|
|
41
|
+
*
|
|
42
|
+
* Usage:
|
|
43
|
+
* const { current, isAbove, isBelow, isBetween, width } = useBreakpoint()
|
|
44
|
+
* if (isAbove("md")) { ... } // >= 768px
|
|
45
|
+
* if (isBelow("sm")) { ... } // < 640px
|
|
46
|
+
* if (isBetween("xs", "lg")) { ... } // >= 475px && < 1024px
|
|
47
|
+
*/
|
|
48
|
+
function useBreakpoint() {
|
|
49
|
+
const [width, setWidth] = (0, react_1.useState)(0);
|
|
50
|
+
const [hasMounted, setHasMounted] = (0, react_1.useState)(false);
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
|
+
setHasMounted(true);
|
|
53
|
+
setWidth(window.innerWidth);
|
|
54
|
+
let rafId;
|
|
55
|
+
const handleResize = () => {
|
|
56
|
+
cancelAnimationFrame(rafId);
|
|
57
|
+
rafId = requestAnimationFrame(() => {
|
|
58
|
+
setWidth(window.innerWidth);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
window.addEventListener("resize", handleResize);
|
|
62
|
+
return () => {
|
|
63
|
+
window.removeEventListener("resize", handleResize);
|
|
64
|
+
cancelAnimationFrame(rafId);
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
const isAbove = (0, react_1.useCallback)((bp) => width >= exports.BREAKPOINTS[bp], [width]);
|
|
68
|
+
const isBelow = (0, react_1.useCallback)((bp) => width < exports.BREAKPOINTS[bp], [width]);
|
|
69
|
+
const isBetween = (0, react_1.useCallback)((min, max) => width >= exports.BREAKPOINTS[min] && width < exports.BREAKPOINTS[max], [width]);
|
|
70
|
+
const current = hasMounted ? getActiveBreakpoint(width) : "md";
|
|
71
|
+
return {
|
|
72
|
+
/** Current active breakpoint name */
|
|
73
|
+
current,
|
|
74
|
+
/** True if width >= given breakpoint */
|
|
75
|
+
isAbove,
|
|
76
|
+
/** True if width < given breakpoint */
|
|
77
|
+
isBelow,
|
|
78
|
+
/** True if width >= min and < max */
|
|
79
|
+
isBetween,
|
|
80
|
+
/** Raw viewport width in px */
|
|
81
|
+
width: hasMounted ? width : 0,
|
|
82
|
+
/** False during SSR / before hydration */
|
|
83
|
+
hasMounted,
|
|
84
|
+
/** Legacy compat: true when < md (768px) */
|
|
85
|
+
isMobile: hasMounted ? width < exports.BREAKPOINTS.md : false,
|
|
86
|
+
/** true when < xs (475px) — small phones */
|
|
87
|
+
isSmallPhone: hasMounted ? width < exports.BREAKPOINTS.xs : false,
|
|
88
|
+
/** true when >= md && < lg — tablets */
|
|
89
|
+
isTablet: hasMounted ? width >= exports.BREAKPOINTS.md && width < exports.BREAKPOINTS.lg : false,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.useIsMobile = useIsMobile;
|
|
37
|
+
// AI-generated · AI-managed · AI-maintained
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const use_breakpoint_1 = require("./use-breakpoint");
|
|
40
|
+
const MOBILE_BREAKPOINT = use_breakpoint_1.BREAKPOINTS.md; // 768px
|
|
41
|
+
function useIsMobile() {
|
|
42
|
+
const [isMobile, setIsMobile] = React.useState(false);
|
|
43
|
+
const [hasMounted, setHasMounted] = React.useState(false);
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
setHasMounted(true);
|
|
46
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
47
|
+
const onChange = () => {
|
|
48
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
49
|
+
};
|
|
50
|
+
mql.addEventListener("change", onChange);
|
|
51
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
52
|
+
return () => mql.removeEventListener("change", onChange);
|
|
53
|
+
}, []);
|
|
54
|
+
return hasMounted ? isMobile : false;
|
|
55
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ToastActionElement, ToastProps } from '../components/ui/toast';
|
|
3
|
+
type ToasterToast = ToastProps & {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
action?: ToastActionElement;
|
|
8
|
+
};
|
|
9
|
+
declare const actionTypes: {
|
|
10
|
+
readonly ADD_TOAST: "ADD_TOAST";
|
|
11
|
+
readonly UPDATE_TOAST: "UPDATE_TOAST";
|
|
12
|
+
readonly DISMISS_TOAST: "DISMISS_TOAST";
|
|
13
|
+
readonly REMOVE_TOAST: "REMOVE_TOAST";
|
|
14
|
+
};
|
|
15
|
+
type ActionType = typeof actionTypes;
|
|
16
|
+
type Action = {
|
|
17
|
+
type: ActionType['ADD_TOAST'];
|
|
18
|
+
toast: ToasterToast;
|
|
19
|
+
} | {
|
|
20
|
+
type: ActionType['UPDATE_TOAST'];
|
|
21
|
+
toast: Partial<ToasterToast>;
|
|
22
|
+
} | {
|
|
23
|
+
type: ActionType['DISMISS_TOAST'];
|
|
24
|
+
toastId?: ToasterToast['id'];
|
|
25
|
+
} | {
|
|
26
|
+
type: ActionType['REMOVE_TOAST'];
|
|
27
|
+
toastId?: ToasterToast['id'];
|
|
28
|
+
};
|
|
29
|
+
interface State {
|
|
30
|
+
toasts: ToasterToast[];
|
|
31
|
+
}
|
|
32
|
+
export declare const reducer: (state: State, action: Action) => State;
|
|
33
|
+
type Toast = Omit<ToasterToast, 'id'>;
|
|
34
|
+
declare function toast({ ...props }: Toast): {
|
|
35
|
+
id: string;
|
|
36
|
+
dismiss: () => void;
|
|
37
|
+
update: (props: ToasterToast) => void;
|
|
38
|
+
};
|
|
39
|
+
declare function useToast(): {
|
|
40
|
+
toast: typeof toast;
|
|
41
|
+
dismiss: (toastId?: string) => void;
|
|
42
|
+
toasts: ToasterToast[];
|
|
43
|
+
};
|
|
44
|
+
export { useToast, toast };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.reducer = void 0;
|
|
39
|
+
exports.useToast = useToast;
|
|
40
|
+
exports.toast = toast;
|
|
41
|
+
const React = __importStar(require("react"));
|
|
42
|
+
const TOAST_LIMIT = 1;
|
|
43
|
+
const TOAST_REMOVE_DELAY = 1000000;
|
|
44
|
+
const actionTypes = {
|
|
45
|
+
ADD_TOAST: 'ADD_TOAST',
|
|
46
|
+
UPDATE_TOAST: 'UPDATE_TOAST',
|
|
47
|
+
DISMISS_TOAST: 'DISMISS_TOAST',
|
|
48
|
+
REMOVE_TOAST: 'REMOVE_TOAST',
|
|
49
|
+
};
|
|
50
|
+
let count = 0;
|
|
51
|
+
function genId() {
|
|
52
|
+
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
53
|
+
return count.toString();
|
|
54
|
+
}
|
|
55
|
+
const toastTimeouts = new Map();
|
|
56
|
+
const addToRemoveQueue = (toastId) => {
|
|
57
|
+
if (toastTimeouts.has(toastId)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const timeout = setTimeout(() => {
|
|
61
|
+
toastTimeouts.delete(toastId);
|
|
62
|
+
dispatch({
|
|
63
|
+
type: 'REMOVE_TOAST',
|
|
64
|
+
toastId: toastId,
|
|
65
|
+
});
|
|
66
|
+
}, TOAST_REMOVE_DELAY);
|
|
67
|
+
toastTimeouts.set(toastId, timeout);
|
|
68
|
+
};
|
|
69
|
+
const reducer = (state, action) => {
|
|
70
|
+
switch (action.type) {
|
|
71
|
+
case 'ADD_TOAST':
|
|
72
|
+
return {
|
|
73
|
+
...state,
|
|
74
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
|
75
|
+
};
|
|
76
|
+
case 'UPDATE_TOAST':
|
|
77
|
+
return {
|
|
78
|
+
...state,
|
|
79
|
+
toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t),
|
|
80
|
+
};
|
|
81
|
+
case 'DISMISS_TOAST': {
|
|
82
|
+
const { toastId } = action;
|
|
83
|
+
if (toastId) {
|
|
84
|
+
addToRemoveQueue(toastId);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
state.toasts.forEach((toast) => {
|
|
88
|
+
addToRemoveQueue(toast.id);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
...state,
|
|
93
|
+
toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
|
|
94
|
+
? {
|
|
95
|
+
...t,
|
|
96
|
+
open: false,
|
|
97
|
+
}
|
|
98
|
+
: t),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
case 'REMOVE_TOAST':
|
|
102
|
+
if (action.toastId === undefined) {
|
|
103
|
+
return {
|
|
104
|
+
...state,
|
|
105
|
+
toasts: [],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
...state,
|
|
110
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.reducer = reducer;
|
|
115
|
+
const listeners = [];
|
|
116
|
+
let memoryState = { toasts: [] };
|
|
117
|
+
function dispatch(action) {
|
|
118
|
+
memoryState = (0, exports.reducer)(memoryState, action);
|
|
119
|
+
listeners.forEach((listener) => {
|
|
120
|
+
listener(memoryState);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function toast({ ...props }) {
|
|
124
|
+
const id = genId();
|
|
125
|
+
const update = (props) => dispatch({
|
|
126
|
+
type: 'UPDATE_TOAST',
|
|
127
|
+
toast: { ...props, id },
|
|
128
|
+
});
|
|
129
|
+
const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });
|
|
130
|
+
dispatch({
|
|
131
|
+
type: 'ADD_TOAST',
|
|
132
|
+
toast: {
|
|
133
|
+
...props,
|
|
134
|
+
id,
|
|
135
|
+
open: true,
|
|
136
|
+
onOpenChange: (open) => {
|
|
137
|
+
if (!open)
|
|
138
|
+
dismiss();
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
return {
|
|
143
|
+
id: id,
|
|
144
|
+
dismiss,
|
|
145
|
+
update,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function useToast() {
|
|
149
|
+
const [state, setState] = React.useState(memoryState);
|
|
150
|
+
React.useEffect(() => {
|
|
151
|
+
listeners.push(setState);
|
|
152
|
+
return () => {
|
|
153
|
+
const index = listeners.indexOf(setState);
|
|
154
|
+
if (index > -1) {
|
|
155
|
+
listeners.splice(index, 1);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}, [state]);
|
|
159
|
+
return {
|
|
160
|
+
...state,
|
|
161
|
+
toast,
|
|
162
|
+
dismiss: (toastId) => dispatch({ type: 'DISMISS_TOAST', toastId }),
|
|
163
|
+
};
|
|
164
|
+
}
|