@medialane/ui 0.107.1 → 0.108.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/components/remixes-tab.cjs +91 -0
- package/dist/components/remixes-tab.cjs.map +1 -0
- package/dist/components/remixes-tab.d.cts +11 -0
- package/dist/components/remixes-tab.d.ts +11 -0
- package/dist/components/remixes-tab.js +57 -0
- package/dist/components/remixes-tab.js.map +1 -0
- package/dist/data/notification.cjs +17 -0
- package/dist/data/notification.cjs.map +1 -0
- package/dist/data/notification.d.cts +34 -0
- package/dist/data/notification.d.ts +34 -0
- package/dist/data/notification.js +1 -0
- package/dist/data/notification.js.map +1 -0
- package/dist/index.cjs +31 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/api-fetch.cjs +65 -0
- package/dist/utils/api-fetch.cjs.map +1 -0
- package/dist/utils/api-fetch.d.cts +38 -0
- package/dist/utils/api-fetch.d.ts +38 -0
- package/dist/utils/api-fetch.js +40 -0
- package/dist/utils/api-fetch.js.map +1 -0
- package/dist/utils/use-notifications.cjs +169 -0
- package/dist/utils/use-notifications.cjs.map +1 -0
- package/dist/utils/use-notifications.d.cts +12 -0
- package/dist/utils/use-notifications.d.ts +12 -0
- package/dist/utils/use-notifications.js +140 -0
- package/dist/utils/use-notifications.js.map +1 -0
- package/dist/utils/use-orders.cjs +153 -0
- package/dist/utils/use-orders.cjs.map +1 -0
- package/dist/utils/use-orders.d.cts +55 -0
- package/dist/utils/use-orders.d.ts +55 -0
- package/dist/utils/use-orders.js +113 -0
- package/dist/utils/use-orders.js.map +1 -0
- package/dist/utils/use-remix-offers.cjs +49 -0
- package/dist/utils/use-remix-offers.cjs.map +1 -0
- package/dist/utils/use-remix-offers.d.cts +19 -0
- package/dist/utils/use-remix-offers.d.ts +19 -0
- package/dist/utils/use-remix-offers.js +15 -0
- package/dist/utils/use-remix-offers.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -229,6 +229,19 @@ import {
|
|
|
229
229
|
useRewardsConfig,
|
|
230
230
|
useRewardsBatch
|
|
231
231
|
} from "./utils/use-rewards.js";
|
|
232
|
+
import { apiFetch, ApiError } from "./utils/api-fetch.js";
|
|
233
|
+
import {
|
|
234
|
+
useOrders,
|
|
235
|
+
useOrder,
|
|
236
|
+
useTokenListings,
|
|
237
|
+
useUserOrders,
|
|
238
|
+
useCounterOffers,
|
|
239
|
+
useReceivedOffers,
|
|
240
|
+
useCollectionFloorListings
|
|
241
|
+
} from "./utils/use-orders.js";
|
|
242
|
+
import { useNotifications } from "./utils/use-notifications.js";
|
|
243
|
+
import { useTokenRemixes } from "./utils/use-remix-offers.js";
|
|
244
|
+
import { RemixesTab } from "./components/remixes-tab.js";
|
|
232
245
|
import { OwnerSetupPanel } from "./components/owner-setup-panel.js";
|
|
233
246
|
import { DropCountdown } from "./components/drop-countdown.js";
|
|
234
247
|
import { CreatorAnalytics } from "./components/creator-analytics.js";
|
|
@@ -260,6 +273,7 @@ export {
|
|
|
260
273
|
AlertDescription,
|
|
261
274
|
AlertTitle,
|
|
262
275
|
AnimatedTokenMedia,
|
|
276
|
+
ApiError,
|
|
263
277
|
AssetCard,
|
|
264
278
|
AssetCardSkeleton,
|
|
265
279
|
AssetCollectionBar,
|
|
@@ -424,6 +438,7 @@ export {
|
|
|
424
438
|
PortfolioOverview,
|
|
425
439
|
PriceHistoryChart,
|
|
426
440
|
QUERY_PREFIX,
|
|
441
|
+
RemixesTab,
|
|
427
442
|
SERVICE_HUES,
|
|
428
443
|
SOCIAL_PLATFORM_META,
|
|
429
444
|
SORT_OPTIONS,
|
|
@@ -476,6 +491,7 @@ export {
|
|
|
476
491
|
TokenGlyph,
|
|
477
492
|
XpProgress,
|
|
478
493
|
XpToastContent,
|
|
494
|
+
apiFetch,
|
|
479
495
|
badgeVariants,
|
|
480
496
|
buildEditionStats,
|
|
481
497
|
buttonVariants,
|
|
@@ -509,10 +525,12 @@ export {
|
|
|
509
525
|
useActivitiesByAddress,
|
|
510
526
|
useCollection,
|
|
511
527
|
useCollectionFilters,
|
|
528
|
+
useCollectionFloorListings,
|
|
512
529
|
useCollectionProfile,
|
|
513
530
|
useCollectionTokens,
|
|
514
531
|
useCollections,
|
|
515
532
|
useCollectionsByOwner,
|
|
533
|
+
useCounterOffers,
|
|
516
534
|
useCreatorProfile,
|
|
517
535
|
useCreators,
|
|
518
536
|
useFormField,
|
|
@@ -523,10 +541,17 @@ export {
|
|
|
523
541
|
useNavAccountSheet,
|
|
524
542
|
useNavCommandMenu,
|
|
525
543
|
useNearbyCollectionTokens,
|
|
544
|
+
useNotifications,
|
|
545
|
+
useOrder,
|
|
546
|
+
useOrders,
|
|
547
|
+
useReceivedOffers,
|
|
526
548
|
useRewards,
|
|
527
549
|
useRewardsBatch,
|
|
528
550
|
useRewardsCelebrations,
|
|
529
551
|
useRewardsConfig,
|
|
530
|
-
useRewardsEvents
|
|
552
|
+
useRewardsEvents,
|
|
553
|
+
useTokenListings,
|
|
554
|
+
useTokenRemixes,
|
|
555
|
+
useUserOrders
|
|
531
556
|
};
|
|
532
557
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ── Utils ─────────────────────────────────────────────────────────────────────\nexport { cn } from \"./utils/cn.js\";\nexport { formatDisplayPrice, parsePriceDisplay } from \"./utils/format.js\";\nexport { shortenAddress } from \"./utils/address.js\";\nexport { ipfsToHttp } from \"./utils/ipfs.js\";\nexport { useIntersectionActive } from \"./utils/use-intersection-active.js\";\nexport { getReadIds, markRead } from \"./utils/notification-storage.js\";\nexport { licenseSummary } from \"./utils/license-summary.js\";\n\n// ── Data (server-safe — no React, safe in Server Components) ──────────────────\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"./data/ip-types.js\";\nexport type { IpTypeData } from \"./data/ip-types.js\";\nexport {\n IP_TYPES, LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES,\n DERIVATIVES_OPTIONS, LICENSE_TRAIT_TYPES,\n} from \"./data/ip.js\";\nexport type { IPType, LicenseType } from \"./data/ip.js\";\nexport {\n IP_TEMPLATES, EMBED_PLATFORM_META, SOCIAL_PLATFORM_META, TEMPLATE_TRAIT_TYPES, DOC_UPLOAD,\n} from \"./data/ip-templates.js\";\nexport type { EmbedPlatform, SocialPlatform, TraitSuggestion, IPTemplate, DocUploadConfig } from \"./data/ip-templates.js\";\nexport { IPTypeDisplay } from \"./components/ip-type-display.js\";\nexport { AssetOverviewContent } from \"./components/asset-overview-content.js\";\nexport { AssetLicenseSummary } from \"./components/asset-license-summary.js\";\nexport { AssetMarketsTab } from \"./components/asset-markets-tab.js\";\nexport { ParentAttributionBanner } from \"./components/parent-attribution-banner.js\";\nexport type { ParentBannerProps } from \"./components/parent-attribution-banner.js\";\nexport { AssetMediaColumn, AssetHeaderBlock, AssetOwnerRow, buildEditionStats } from \"./components/asset-top-sections.js\";\nexport type { AssetOwnerRowProps } from \"./components/asset-top-sections.js\";\nexport { AssetCollectionBar } from \"./components/asset-collection-bar.js\";\nexport type { AssetCollectionBarProps, AssetCollectionBarSibling } from \"./components/asset-collection-bar.js\";\nexport { AssetUtilityIcons } from \"./components/asset-utility-icons.js\";\nexport type { AssetUtilityIconsProps } from \"./components/asset-utility-icons.js\";\nexport { AssetMarketplacePanel } from \"./components/asset-marketplace-panel.js\";\nexport type { AssetMarketplacePanelProps, ApiOrderLike } from \"./components/asset-marketplace-panel.js\";\nexport { BRAND } from \"./data/brand.js\";\nexport { LIVING_RENDER_COLLECTIONS, isLivingRenderCollection } from \"./data/living-render-collections.js\";\n\n// ── Components (client-only — all have \"use client\") ─────────────────────────\nexport { CurrencyIcon, CurrencyAmount } from \"./components/currency-icon.js\";\nexport type { CurrencyIconProps, CurrencyAmountProps } from \"./components/currency-icon.js\";\n\nexport { IpTypeBadge, IP_TYPE_CONFIG, IP_TYPE_MAP } from \"./components/ip-type-badge.js\";\nexport type { IpTypeBadgeProps, IpTypeConfig } from \"./components/ip-type-badge.js\";\n\nexport { AddressDisplay } from \"./components/address-display.js\";\nexport type { AddressDisplayProps } from \"./components/address-display.js\";\n\nexport { MedialaneLogoFull } from \"./components/brand-logo.js\";\nexport type { MedialaneLogoFullProps } from \"./components/brand-logo.js\";\n\n// ── v0.2 additions ────────────────────────────────────────────────────────────\nexport { MotionCard, FadeIn, Stagger, StaggerItem, KineticWords, SPRING, EASE_OUT } from \"./components/motion-primitives.js\";\nexport { PageContainer } from \"./components/page-container.js\";\nexport type { PageContainerProps } from \"./components/page-container.js\";\nexport { ScrollSection } from \"./components/scroll-section.js\";\nexport type { ScrollSectionProps } from \"./components/scroll-section.js\";\nexport { ShareButton } from \"./components/share-button.js\";\nexport type { ShareButtonProps } from \"./components/share-button.js\";\nexport { CollectionCard, CollectionCardSkeleton } from \"./components/collection-card.js\";\nexport type { CollectionCardProps } from \"./components/collection-card.js\";\nexport { TokenCard, TokenCardSkeleton } from \"./components/token-card.js\";\nexport type { TokenCardProps } from \"./components/token-card.js\";\nexport { AnimatedTokenMedia } from \"./components/animated-token-media.js\";\nexport type { AnimatedTokenMediaProps } from \"./components/animated-token-media.js\";\nexport { ThemeAmbientBackground } from \"./components/theme-ambient-background.js\";\nexport {\n useCollectionFilters, SORT_OPTIONS, CollectionFiltersTrigger, CollectionFiltersBody,\n} from \"./components/collection-filters.js\";\nexport type { TraitSection, CollectionFiltersTriggerProps, CollectionFiltersBodyProps } from \"./components/collection-filters.js\";\nexport {\n DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem,\n DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel,\n DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup,\n DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent,\n DropdownMenuSubTrigger, DropdownMenuRadioGroup,\n} from \"./components/dropdown-menu.js\";\nexport { AssetCard, AssetCardSkeleton } from \"./components/asset-card.js\";\nexport type { AssetCardProps, AssetCardPrice } from \"./components/asset-card.js\";\nexport { AssetPicker } from \"./components/asset-picker.js\";\nexport type { AssetPickerProps, OwnedAsset } from \"./components/asset-picker.js\";\nexport { AssetSearchPicker } from \"./components/asset-search-picker.js\";\nexport type { AssetSearchPickerProps } from \"./components/asset-search-picker.js\";\nexport { LicenseTermsBuilder, EMPTY_SPONSORSHIP_TERMS, MEDIA_TYPES, DURATION_UNITS, toLicenseMetadata, toDurationDays } from \"./components/license-terms-builder.js\";\nexport type { LicenseTermsBuilderProps, SponsorshipTerms, DurationUnit } from \"./components/license-terms-builder.js\";\n// ── Coin discovery (chain-agnostic; price/data/href injected by the app) ─────\nexport {\n coinKind, formatCoinPrice, formatFdv,\n type CoinKind, type CoinCollectionLike, type CoinPriceLike,\n} from \"./data/coins.js\";\nexport { CoinCard, CoinRow, CoinCardSkeleton, type UseCoinPrice, type CoinTileProps } from \"./components/coin-card.js\";\nexport {\n CoinsExplorer,\n type CoinsExplorerProps, type CoinFilter, type CoinSort, type UseCoins,\n} from \"./components/coins-explorer.js\";\n\n// ── v0.3 additions ────────────────────────────────────────────────────────────\nexport { timeAgo, timeUntil } from \"./utils/time.js\";\nexport { ACTIVITY_TYPE_CONFIG, TYPE_FILTERS } from \"./data/activity.js\";\nexport type { ActivityTypeConfig } from \"./data/activity.js\";\nexport { HeroSlider, HeroSliderSkeleton } from \"./components/hero-slider.js\";\nexport type { HeroSliderProps } from \"./components/hero-slider.js\";\nexport { ActivityTicker } from \"./components/activity-ticker.js\";\nexport type { ActivityTickerProps } from \"./components/activity-ticker.js\";\nexport { ListingCard, ListingCardSkeleton } from \"./components/listing-card.js\";\nexport type { ListingCardProps } from \"./components/listing-card.js\";\nexport { ActivityRow } from \"./components/activity-row.js\";\nexport type { ActivityRowProps } from \"./components/activity-row.js\";\nexport { ActivityFeedShell } from \"./components/activity-feed-shell.js\";\nexport type { ActivityFeedShellProps } from \"./components/activity-feed-shell.js\";\nexport { CtaCardGrid } from \"./components/cta-card-grid.js\";\nexport type { CtaCardGridProps, CtaCardItem } from \"./components/cta-card-grid.js\";\n\n// ── v0.3.2 additions ─────────────────────────────────────────────────────────\nexport { DiscoverHero } from \"./components/discover-hero.js\";\nexport type { DiscoverHeroProps } from \"./components/discover-hero.js\";\nexport { FeaturedCarousel, FeaturedCarouselSkeleton } from \"./components/featured-carousel.js\";\nexport type { FeaturedCarouselProps } from \"./components/featured-carousel.js\";\nexport { DiscoverCollectionsStrip } from \"./components/discover-collections-strip.js\";\nexport type { DiscoverCollectionsStripProps } from \"./components/discover-collections-strip.js\";\nexport { DiscoverCreatorsStrip } from \"./components/discover-creators-strip.js\";\nexport type { DiscoverCreatorsStripProps } from \"./components/discover-creators-strip.js\";\nexport { DiscoverFeedSection, DiscoverActivityStrip } from \"./components/discover-feed-section.js\";\nexport type { DiscoverFeedSectionProps, DiscoverActivityStripProps } from \"./components/discover-feed-section.js\";\nexport { ActivityCard, ActivityCardSkeleton, ACTIVITY_MESSAGES } from \"./components/activity-card.js\";\nexport type { ActivityCardProps } from \"./components/activity-card.js\";\n\n// ── Launchpad (grouped sections — single page-UI source since 0.8.0) ─────────\nexport { LaunchpadGroupedSections, LaunchpadServiceCard, SERVICE_HUES, useLaunchpadFilter } from \"./components/launchpad-services.js\";\nexport { LaunchpadFilterBar } from \"./components/launchpad-filter-bar.js\";\nexport type { LaunchpadFilterBarProps } from \"./components/launchpad-filter-bar.js\";\nexport { LaunchpadStrip } from \"./components/launchpad-strip.js\";\nexport type { LaunchpadStripProps } from \"./components/launchpad-strip.js\";\nexport type { LaunchpadGroupedSectionsProps, LaunchpadServiceCardProps, ServiceOverride, ServiceOverrides } from \"./components/launchpad-services.js\";\nexport { LAUNCHPAD_SERVICE_DEFINITIONS, LAUNCHPAD_SERVICE_GROUPS } from \"./data/launchpad-services.js\";\nexport type { ServiceDefinition, ServiceStatus, ServiceGroup, ServiceGroupDefinition } from \"./data/launchpad-services.js\";\n\n// ── v0.5.0 additions ─────────────────────────────────────────────────────────\nexport { NavCommandMenu, useNavCommandMenu } from \"./components/nav-command-menu.js\";\nexport type { NavCommand, NavCommandGroup, NavCommandMenuProps } from \"./components/nav-command-menu.js\";\n\n// ── v0.62.0 — nav shell (brand trigger + header buttons + account sheet) ─────\nexport {\n NavBrandButton,\n NavIconButton,\n NavWalletTrigger,\n NavAccountSheet,\n useNavAccountSheet,\n} from \"./components/nav-shell.js\";\nexport type {\n NavBrandButtonProps,\n NavIconButtonProps,\n NavWalletTriggerProps,\n NavAccountSheetProps,\n} from \"./components/nav-shell.js\";\n\n// ── v0.59.0 — portfolio shell (two-level nav + header + overview) ────────────\nexport { PortfolioHeader } from \"./components/portfolio-header.js\";\nexport type {\n PortfolioHeaderProps,\n PortfolioHeaderScore,\n} from \"./components/portfolio-header.js\";\nexport { PortfolioOverview } from \"./components/portfolio-overview.js\";\nexport type {\n PortfolioOverviewProps,\n PortfolioBentoTileConfig,\n} from \"./components/portfolio-overview.js\";\nexport { derivePortfolioCounts } from \"./utils/portfolio-counts.js\";\nexport type { PortfolioCounts, CountableOrder } from \"./utils/portfolio-counts.js\";\nexport { PortfolioBentoTile } from \"./components/portfolio-bento-tile.js\";\nexport type { PortfolioBentoTileProps } from \"./components/portfolio-bento-tile.js\";\nexport { PortfolioChipFilter } from \"./components/portfolio-chip-filter.js\";\nexport type {\n PortfolioChipFilterProps,\n PortfolioChipFilterOption,\n} from \"./components/portfolio-chip-filter.js\";\n\n// ── v0.22.0 additions — launchpad/claim form template primitives ─────────────\n// Pure-presentation header + rail shared by every launchpad/claim form. The\n// app supplies its own gate, back button, and form logic. Requires the\n// `.btn-border-animated` class (in @medialane/ui/styles) for the form shell.\nexport { ServiceHeader } from \"./components/service-header.js\";\nexport type { ServiceHeaderProps } from \"./components/service-header.js\";\nexport { ClaimRail } from \"./components/claim-rail.js\";\nexport type { ClaimRailProps } from \"./components/claim-rail.js\";\n\n// ── v0.23.0 additions — slot-based form shell ────────────────────────────────\n// Pure layout (back slot + header + animated-border compartment + 8/4 bento).\n// No auth/router — the app injects its own gate (around children) + back button.\nexport { ServiceFormShell } from \"./components/service-form-shell.js\";\nexport type { ServiceFormShellProps } from \"./components/service-form-shell.js\";\nexport { StepNav } from \"./components/step-nav.js\";\nexport type { StepNavProps, StepNavStep } from \"./components/step-nav.js\";\n\n// Rewards score kit (v0.36.0)\nexport { LevelBadge } from \"./components/rewards/level-badge.js\";\nexport type { LevelBadgeProps } from \"./components/rewards/level-badge.js\";\nexport { XpProgress } from \"./components/rewards/xp-progress.js\";\nexport type { XpProgressProps } from \"./components/rewards/xp-progress.js\";\nexport { BadgeShelf } from \"./components/rewards/badge-shelf.js\";\nexport type { BadgeShelfProps, BadgeShelfBadge } from \"./components/rewards/badge-shelf.js\";\nexport { ScoreSummaryCard } from \"./components/rewards/score-summary-card.js\";\nexport type { ScoreSummaryCardProps } from \"./components/rewards/score-summary-card.js\";\nexport { LeaderboardTable, LeaderboardWidget } from \"./components/rewards/leaderboard-table.js\";\nexport type { LeaderboardTableProps, LeaderboardWidgetProps, LeaderboardEntryLike } from \"./components/rewards/leaderboard-table.js\";\nexport { LevelJourneyList } from \"./components/rewards/level-journey-list.js\";\nexport type { LevelJourneyListProps, LevelJourneyListLevel } from \"./components/rewards/level-journey-list.js\";\nexport { BadgeCatalog } from \"./components/rewards/badge-catalog.js\";\nexport type { BadgeCatalogProps, BadgeCatalogBadge } from \"./components/rewards/badge-catalog.js\";\nexport { XpToastContent } from \"./components/rewards/xp-toast-content.js\";\nexport type { XpToastContentProps } from \"./components/rewards/xp-toast-content.js\";\nexport { createRewardToast } from \"./components/rewards/reward-toast.js\";\nexport type { RewardToastSnapshot } from \"./components/rewards/reward-toast.js\";\n\n// ── v0.37.0 additions — infinite-scroll trigger ──────────────────────────────\nexport { LoadMoreSentinel } from \"./components/load-more-sentinel.js\";\nexport type { LoadMoreSentinelProps } from \"./components/load-more-sentinel.js\";\n\n// ── v0.47.0 additions — community rewards section ────────────────────────────\nexport { CommunityRewardsSection } from \"./components/community-rewards-section.js\";\nexport type { CommunityRewardsSectionProps, CommunityRewardsEntry } from \"./components/community-rewards-section.js\";\nexport { CreatorAirdropBanner } from \"./components/creator-airdrop-banner.js\";\nexport type { CreatorAirdropBannerProps } from \"./components/creator-airdrop-banner.js\";\n\n// ── Design system primitives — action-focus pattern, tokens, data display ────\nexport { ActionButton } from \"./components/action-button.js\";\nexport type { ActionButtonProps, ActionKey, ToneKey } from \"./components/action-button.js\";\nexport { GradientButton } from \"./components/gradient-button.js\";\nexport type { GradientButtonProps } from \"./components/gradient-button.js\";\n\nexport { CoinLaunchPreview } from \"./components/coin-launch-preview.js\";\nexport type { CoinPreviewData } from \"./components/coin-launch-preview.js\";\nexport { MedialaneCollectionCard } from \"./components/medialane-collection-card.js\";\nexport type { MedialaneCollectionCardProps } from \"./components/medialane-collection-card.js\";\nexport { TokenGlyph, TokenAmount } from \"./components/token-glyph.js\";\nexport type { TokenGlyphProps, TokenAmountProps, TokenSymbol } from \"./components/token-glyph.js\";\n\nexport { StatTile, StatPill } from \"./components/stat-tile.js\";\nexport type { StatTileProps, StatPillProps } from \"./components/stat-tile.js\";\n\nexport { ActionDialog } from \"./components/action-dialog.js\";\nexport type { ActionDialogProps } from \"./components/action-dialog.js\";\n\nexport { HiddenContentBanner } from \"./components/hidden-content-banner.js\";\nexport { CollectionHeroBanner } from \"./components/collection-hero-banner.js\";\nexport type { CollectionHeroBannerProps, CollectionHeroStat } from \"./components/collection-hero-banner.js\";\n\n// ── v0.99.0 additions — rewards UX overhaul ───────────────────────────────────\nexport { useRewardsCelebrations } from \"./components/rewards/use-rewards-celebrations.js\";\nexport { LevelUpCelebration } from \"./components/rewards/level-up-celebration.js\";\nexport type { LevelUpCelebrationProps } from \"./components/rewards/level-up-celebration.js\";\nexport { BadgeUnlockToastContent } from \"./components/rewards/badge-unlock-toast-content.js\";\nexport type { BadgeUnlockToastContentProps } from \"./components/rewards/badge-unlock-toast-content.js\";\nexport { JourneyPath } from \"./components/rewards/journey-path.js\";\nexport type { JourneyPathProps, JourneyStep } from \"./components/rewards/journey-path.js\";\n\n// ── Primitives (shadcn-derived, deduplicated from io + starknet) ─────────────\nexport { Skeleton } from \"./components/skeleton.js\";\nexport { Badge, badgeVariants } from \"./components/badge.js\";\nexport type { BadgeProps } from \"./components/badge.js\";\nexport { Label } from \"./components/label.js\";\nexport { Input } from \"./components/input.js\";\nexport { Switch } from \"./components/switch.js\";\nexport { Checkbox } from \"./components/checkbox.js\";\nexport { Alert, AlertTitle, AlertDescription } from \"./components/alert.js\";\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./components/tabs.js\";\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from \"./components/card.js\";\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from \"./components/collapsible.js\";\nexport { Button, buttonVariants } from \"./components/button.js\";\nexport type { ButtonProps } from \"./components/button.js\";\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from \"./components/popover.js\";\nexport { HelpIcon } from \"./components/help-icon.js\";\nexport { EmptyOrError } from \"./components/empty-or-error.js\";\nexport {\n Select, SelectGroup, SelectValue, SelectTrigger, SelectContent,\n SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton,\n} from \"./components/select.js\";\nexport {\n useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField,\n} from \"./components/form.js\";\nexport { Textarea } from \"./components/textarea.js\";\nexport type { TextareaProps } from \"./components/textarea.js\";\nexport {\n Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent,\n SheetHeader, SheetFooter, SheetTitle, SheetDescription,\n} from \"./components/sheet.js\";\n\n// ── v0.106.0 additions — dedupe pass 2 (io + starknet audit) ─────────────────\nexport { ToggleGroup, Section } from \"./components/create-form-primitives.js\";\nexport { OrderSortControl, sortOrders } from \"./components/order-sort-control.js\";\nexport type { OrderSort } from \"./components/order-sort-control.js\";\nexport { AssetLightbox } from \"./components/asset-lightbox.js\";\nexport type { AssetLightboxProps } from \"./components/asset-lightbox.js\";\nexport { PriceHistoryChart } from \"./components/price-history-chart.js\";\nexport type { PriceHistoryChartProps } from \"./components/price-history-chart.js\";\nexport { NavThemeToggle } from \"./components/nav-theme-toggle.js\";\nexport { JsonLd } from \"./components/json-ld.js\";\nexport type { JsonLdProps } from \"./components/json-ld.js\";\nexport { CreationRecord } from \"./components/creation-record.js\";\nexport type { CreationRecordProps } from \"./components/creation-record.js\";\nexport { ClubOwnerActions } from \"./components/club-owner-actions.js\";\nexport type { ClubOwnerActionsProps } from \"./components/club-owner-actions.js\";\nexport { IPTypeFields } from \"./components/ip-type-fields.js\";\nexport type { IPTypeFieldsProps, MetadataField } from \"./components/ip-type-fields.js\";\nexport { readBodyWithCap } from \"./utils/proxy-body.js\";\nexport type { CappedBody } from \"./utils/proxy-body.js\";\nexport {\n formatActivity, formatOrderNotification, formatOfferAcceptedNotification, formatAssetReceivedNotification,\n} from \"./utils/format-activity.js\";\nexport type { FormattedEvent } from \"./utils/format-activity.js\";\n\n// ── v0.107.0 additions — dedupe pass 3: data-fetching hooks + their views ────\n// Same getClient-injection pattern as useRewards/useCreators — the app\n// supplies its own SDK client factory, none of this touches wallet state.\nexport { queryKeys, queryKeyPrefix, QUERY_PREFIX } from \"./utils/query-keys.js\";\nexport { useCollectionProfile, useCreatorProfile } from \"./utils/use-profiles.js\";\nexport { useActivities, useActivitiesByAddress } from \"./utils/use-activities.js\";\nexport {\n useCollections, useCollection, useCollectionsByOwner, useCollectionTokens, useNearbyCollectionTokens,\n} from \"./utils/use-collections.js\";\nexport type { CollectionSort } from \"./utils/use-collections.js\";\nexport { CreatorChip } from \"./components/creator-chip.js\";\nexport type { CreatorChipProps } from \"./components/creator-chip.js\";\nexport { CollectionActivityTab } from \"./components/collection-activity-tab.js\";\nexport type { CollectionActivityTabProps } from \"./components/collection-activity-tab.js\";\nexport { CollectionTraitsTab } from \"./components/collection-traits-tab.js\";\nexport type { CollectionTraitsTabProps } from \"./components/collection-traits-tab.js\";\nexport { PortfolioActivity } from \"./components/portfolio-activity.js\";\nexport type { PortfolioActivityProps } from \"./components/portfolio-activity.js\";\nexport { CreatorScoreInline } from \"./components/creator-score-inline.js\";\nexport type { CreatorScoreInlineProps } from \"./components/creator-score-inline.js\";\n\nexport { useMedialaneClient } from \"./utils/use-medialane-client.js\";\nexport { useCreators } from \"./utils/use-creators.js\";\nexport {\n useRewards, useLeaderboard, useRewardsEvents, useRewardsConfig, useRewardsBatch,\n} from \"./utils/use-rewards.js\";\nexport type { UserRewards, LeaderboardEntry, BadgeSummary, LevelSummary } from \"./utils/use-rewards.js\";\nexport { OwnerSetupPanel } from \"./components/owner-setup-panel.js\";\nexport { DropCountdown } from \"./components/drop-countdown.js\";\nexport { CreatorAnalytics } from \"./components/creator-analytics.js\";\nexport {\n Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger,\n DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription,\n} from \"./components/dialog.js\";\n"],"mappings":"AACA,SAAS,UAAU;AACnB,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC,SAAS,YAAY,gBAAgB;AACrC,SAAS,sBAAsB;AAG/B,SAAS,cAAc,wBAAwB;AAE/C;AAAA,EACE;AAAA,EAAU;AAAA,EAAe;AAAA,EAAmB;AAAA,EAC5C;AAAA,EAAqB;AAAA,OAChB;AAEP;AAAA,EACE;AAAA,EAAc;AAAA,EAAqB;AAAA,EAAsB;AAAA,EAAsB;AAAA,OAC1E;AAEP,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AAExC,SAAS,kBAAkB,kBAAkB,eAAe,yBA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C,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EAAY;AAAA,EAAgB;AAAA,EAAkB;AAAA,EAAkB;AAAA,OAC3D;AAEP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EAAQ;AAAA,EAAc;AAAA,EAAe;AAAA,EAAa;AAAA,EAClD;AAAA,EAAe;AAAA,EAAc;AAAA,EAAc;AAAA,EAAa;AAAA,OACnD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ── Utils ─────────────────────────────────────────────────────────────────────\nexport { cn } from \"./utils/cn.js\";\nexport { formatDisplayPrice, parsePriceDisplay } from \"./utils/format.js\";\nexport { shortenAddress } from \"./utils/address.js\";\nexport { ipfsToHttp } from \"./utils/ipfs.js\";\nexport { useIntersectionActive } from \"./utils/use-intersection-active.js\";\nexport { getReadIds, markRead } from \"./utils/notification-storage.js\";\nexport { licenseSummary } from \"./utils/license-summary.js\";\n\n// ── Data (server-safe — no React, safe in Server Components) ──────────────────\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"./data/ip-types.js\";\nexport type { IpTypeData } from \"./data/ip-types.js\";\nexport {\n IP_TYPES, LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES,\n DERIVATIVES_OPTIONS, LICENSE_TRAIT_TYPES,\n} from \"./data/ip.js\";\nexport type { IPType, LicenseType } from \"./data/ip.js\";\nexport {\n IP_TEMPLATES, EMBED_PLATFORM_META, SOCIAL_PLATFORM_META, TEMPLATE_TRAIT_TYPES, DOC_UPLOAD,\n} from \"./data/ip-templates.js\";\nexport type { EmbedPlatform, SocialPlatform, TraitSuggestion, IPTemplate, DocUploadConfig } from \"./data/ip-templates.js\";\nexport { IPTypeDisplay } from \"./components/ip-type-display.js\";\nexport { AssetOverviewContent } from \"./components/asset-overview-content.js\";\nexport { AssetLicenseSummary } from \"./components/asset-license-summary.js\";\nexport { AssetMarketsTab } from \"./components/asset-markets-tab.js\";\nexport { ParentAttributionBanner } from \"./components/parent-attribution-banner.js\";\nexport type { ParentBannerProps } from \"./components/parent-attribution-banner.js\";\nexport { AssetMediaColumn, AssetHeaderBlock, AssetOwnerRow, buildEditionStats } from \"./components/asset-top-sections.js\";\nexport type { AssetOwnerRowProps } from \"./components/asset-top-sections.js\";\nexport { AssetCollectionBar } from \"./components/asset-collection-bar.js\";\nexport type { AssetCollectionBarProps, AssetCollectionBarSibling } from \"./components/asset-collection-bar.js\";\nexport { AssetUtilityIcons } from \"./components/asset-utility-icons.js\";\nexport type { AssetUtilityIconsProps } from \"./components/asset-utility-icons.js\";\nexport { AssetMarketplacePanel } from \"./components/asset-marketplace-panel.js\";\nexport type { AssetMarketplacePanelProps, ApiOrderLike } from \"./components/asset-marketplace-panel.js\";\nexport { BRAND } from \"./data/brand.js\";\nexport { LIVING_RENDER_COLLECTIONS, isLivingRenderCollection } from \"./data/living-render-collections.js\";\n\n// ── Components (client-only — all have \"use client\") ─────────────────────────\nexport { CurrencyIcon, CurrencyAmount } from \"./components/currency-icon.js\";\nexport type { CurrencyIconProps, CurrencyAmountProps } from \"./components/currency-icon.js\";\n\nexport { IpTypeBadge, IP_TYPE_CONFIG, IP_TYPE_MAP } from \"./components/ip-type-badge.js\";\nexport type { IpTypeBadgeProps, IpTypeConfig } from \"./components/ip-type-badge.js\";\n\nexport { AddressDisplay } from \"./components/address-display.js\";\nexport type { AddressDisplayProps } from \"./components/address-display.js\";\n\nexport { MedialaneLogoFull } from \"./components/brand-logo.js\";\nexport type { MedialaneLogoFullProps } from \"./components/brand-logo.js\";\n\n// ── v0.2 additions ────────────────────────────────────────────────────────────\nexport { MotionCard, FadeIn, Stagger, StaggerItem, KineticWords, SPRING, EASE_OUT } from \"./components/motion-primitives.js\";\nexport { PageContainer } from \"./components/page-container.js\";\nexport type { PageContainerProps } from \"./components/page-container.js\";\nexport { ScrollSection } from \"./components/scroll-section.js\";\nexport type { ScrollSectionProps } from \"./components/scroll-section.js\";\nexport { ShareButton } from \"./components/share-button.js\";\nexport type { ShareButtonProps } from \"./components/share-button.js\";\nexport { CollectionCard, CollectionCardSkeleton } from \"./components/collection-card.js\";\nexport type { CollectionCardProps } from \"./components/collection-card.js\";\nexport { TokenCard, TokenCardSkeleton } from \"./components/token-card.js\";\nexport type { TokenCardProps } from \"./components/token-card.js\";\nexport { AnimatedTokenMedia } from \"./components/animated-token-media.js\";\nexport type { AnimatedTokenMediaProps } from \"./components/animated-token-media.js\";\nexport { ThemeAmbientBackground } from \"./components/theme-ambient-background.js\";\nexport {\n useCollectionFilters, SORT_OPTIONS, CollectionFiltersTrigger, CollectionFiltersBody,\n} from \"./components/collection-filters.js\";\nexport type { TraitSection, CollectionFiltersTriggerProps, CollectionFiltersBodyProps } from \"./components/collection-filters.js\";\nexport {\n DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem,\n DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel,\n DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup,\n DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent,\n DropdownMenuSubTrigger, DropdownMenuRadioGroup,\n} from \"./components/dropdown-menu.js\";\nexport { AssetCard, AssetCardSkeleton } from \"./components/asset-card.js\";\nexport type { AssetCardProps, AssetCardPrice } from \"./components/asset-card.js\";\nexport { AssetPicker } from \"./components/asset-picker.js\";\nexport type { AssetPickerProps, OwnedAsset } from \"./components/asset-picker.js\";\nexport { AssetSearchPicker } from \"./components/asset-search-picker.js\";\nexport type { AssetSearchPickerProps } from \"./components/asset-search-picker.js\";\nexport { LicenseTermsBuilder, EMPTY_SPONSORSHIP_TERMS, MEDIA_TYPES, DURATION_UNITS, toLicenseMetadata, toDurationDays } from \"./components/license-terms-builder.js\";\nexport type { LicenseTermsBuilderProps, SponsorshipTerms, DurationUnit } from \"./components/license-terms-builder.js\";\n// ── Coin discovery (chain-agnostic; price/data/href injected by the app) ─────\nexport {\n coinKind, formatCoinPrice, formatFdv,\n type CoinKind, type CoinCollectionLike, type CoinPriceLike,\n} from \"./data/coins.js\";\nexport { CoinCard, CoinRow, CoinCardSkeleton, type UseCoinPrice, type CoinTileProps } from \"./components/coin-card.js\";\nexport {\n CoinsExplorer,\n type CoinsExplorerProps, type CoinFilter, type CoinSort, type UseCoins,\n} from \"./components/coins-explorer.js\";\n\n// ── v0.3 additions ────────────────────────────────────────────────────────────\nexport { timeAgo, timeUntil } from \"./utils/time.js\";\nexport { ACTIVITY_TYPE_CONFIG, TYPE_FILTERS } from \"./data/activity.js\";\nexport type { ActivityTypeConfig } from \"./data/activity.js\";\nexport { HeroSlider, HeroSliderSkeleton } from \"./components/hero-slider.js\";\nexport type { HeroSliderProps } from \"./components/hero-slider.js\";\nexport { ActivityTicker } from \"./components/activity-ticker.js\";\nexport type { ActivityTickerProps } from \"./components/activity-ticker.js\";\nexport { ListingCard, ListingCardSkeleton } from \"./components/listing-card.js\";\nexport type { ListingCardProps } from \"./components/listing-card.js\";\nexport { ActivityRow } from \"./components/activity-row.js\";\nexport type { ActivityRowProps } from \"./components/activity-row.js\";\nexport { ActivityFeedShell } from \"./components/activity-feed-shell.js\";\nexport type { ActivityFeedShellProps } from \"./components/activity-feed-shell.js\";\nexport { CtaCardGrid } from \"./components/cta-card-grid.js\";\nexport type { CtaCardGridProps, CtaCardItem } from \"./components/cta-card-grid.js\";\n\n// ── v0.3.2 additions ─────────────────────────────────────────────────────────\nexport { DiscoverHero } from \"./components/discover-hero.js\";\nexport type { DiscoverHeroProps } from \"./components/discover-hero.js\";\nexport { FeaturedCarousel, FeaturedCarouselSkeleton } from \"./components/featured-carousel.js\";\nexport type { FeaturedCarouselProps } from \"./components/featured-carousel.js\";\nexport { DiscoverCollectionsStrip } from \"./components/discover-collections-strip.js\";\nexport type { DiscoverCollectionsStripProps } from \"./components/discover-collections-strip.js\";\nexport { DiscoverCreatorsStrip } from \"./components/discover-creators-strip.js\";\nexport type { DiscoverCreatorsStripProps } from \"./components/discover-creators-strip.js\";\nexport { DiscoverFeedSection, DiscoverActivityStrip } from \"./components/discover-feed-section.js\";\nexport type { DiscoverFeedSectionProps, DiscoverActivityStripProps } from \"./components/discover-feed-section.js\";\nexport { ActivityCard, ActivityCardSkeleton, ACTIVITY_MESSAGES } from \"./components/activity-card.js\";\nexport type { ActivityCardProps } from \"./components/activity-card.js\";\n\n// ── Launchpad (grouped sections — single page-UI source since 0.8.0) ─────────\nexport { LaunchpadGroupedSections, LaunchpadServiceCard, SERVICE_HUES, useLaunchpadFilter } from \"./components/launchpad-services.js\";\nexport { LaunchpadFilterBar } from \"./components/launchpad-filter-bar.js\";\nexport type { LaunchpadFilterBarProps } from \"./components/launchpad-filter-bar.js\";\nexport { LaunchpadStrip } from \"./components/launchpad-strip.js\";\nexport type { LaunchpadStripProps } from \"./components/launchpad-strip.js\";\nexport type { LaunchpadGroupedSectionsProps, LaunchpadServiceCardProps, ServiceOverride, ServiceOverrides } from \"./components/launchpad-services.js\";\nexport { LAUNCHPAD_SERVICE_DEFINITIONS, LAUNCHPAD_SERVICE_GROUPS } from \"./data/launchpad-services.js\";\nexport type { ServiceDefinition, ServiceStatus, ServiceGroup, ServiceGroupDefinition } from \"./data/launchpad-services.js\";\n\n// ── v0.5.0 additions ─────────────────────────────────────────────────────────\nexport { NavCommandMenu, useNavCommandMenu } from \"./components/nav-command-menu.js\";\nexport type { NavCommand, NavCommandGroup, NavCommandMenuProps } from \"./components/nav-command-menu.js\";\n\n// ── v0.62.0 — nav shell (brand trigger + header buttons + account sheet) ─────\nexport {\n NavBrandButton,\n NavIconButton,\n NavWalletTrigger,\n NavAccountSheet,\n useNavAccountSheet,\n} from \"./components/nav-shell.js\";\nexport type {\n NavBrandButtonProps,\n NavIconButtonProps,\n NavWalletTriggerProps,\n NavAccountSheetProps,\n} from \"./components/nav-shell.js\";\n\n// ── v0.59.0 — portfolio shell (two-level nav + header + overview) ────────────\nexport { PortfolioHeader } from \"./components/portfolio-header.js\";\nexport type {\n PortfolioHeaderProps,\n PortfolioHeaderScore,\n} from \"./components/portfolio-header.js\";\nexport { PortfolioOverview } from \"./components/portfolio-overview.js\";\nexport type {\n PortfolioOverviewProps,\n PortfolioBentoTileConfig,\n} from \"./components/portfolio-overview.js\";\nexport { derivePortfolioCounts } from \"./utils/portfolio-counts.js\";\nexport type { PortfolioCounts, CountableOrder } from \"./utils/portfolio-counts.js\";\nexport { PortfolioBentoTile } from \"./components/portfolio-bento-tile.js\";\nexport type { PortfolioBentoTileProps } from \"./components/portfolio-bento-tile.js\";\nexport { PortfolioChipFilter } from \"./components/portfolio-chip-filter.js\";\nexport type {\n PortfolioChipFilterProps,\n PortfolioChipFilterOption,\n} from \"./components/portfolio-chip-filter.js\";\n\n// ── v0.22.0 additions — launchpad/claim form template primitives ─────────────\n// Pure-presentation header + rail shared by every launchpad/claim form. The\n// app supplies its own gate, back button, and form logic. Requires the\n// `.btn-border-animated` class (in @medialane/ui/styles) for the form shell.\nexport { ServiceHeader } from \"./components/service-header.js\";\nexport type { ServiceHeaderProps } from \"./components/service-header.js\";\nexport { ClaimRail } from \"./components/claim-rail.js\";\nexport type { ClaimRailProps } from \"./components/claim-rail.js\";\n\n// ── v0.23.0 additions — slot-based form shell ────────────────────────────────\n// Pure layout (back slot + header + animated-border compartment + 8/4 bento).\n// No auth/router — the app injects its own gate (around children) + back button.\nexport { ServiceFormShell } from \"./components/service-form-shell.js\";\nexport type { ServiceFormShellProps } from \"./components/service-form-shell.js\";\nexport { StepNav } from \"./components/step-nav.js\";\nexport type { StepNavProps, StepNavStep } from \"./components/step-nav.js\";\n\n// Rewards score kit (v0.36.0)\nexport { LevelBadge } from \"./components/rewards/level-badge.js\";\nexport type { LevelBadgeProps } from \"./components/rewards/level-badge.js\";\nexport { XpProgress } from \"./components/rewards/xp-progress.js\";\nexport type { XpProgressProps } from \"./components/rewards/xp-progress.js\";\nexport { BadgeShelf } from \"./components/rewards/badge-shelf.js\";\nexport type { BadgeShelfProps, BadgeShelfBadge } from \"./components/rewards/badge-shelf.js\";\nexport { ScoreSummaryCard } from \"./components/rewards/score-summary-card.js\";\nexport type { ScoreSummaryCardProps } from \"./components/rewards/score-summary-card.js\";\nexport { LeaderboardTable, LeaderboardWidget } from \"./components/rewards/leaderboard-table.js\";\nexport type { LeaderboardTableProps, LeaderboardWidgetProps, LeaderboardEntryLike } from \"./components/rewards/leaderboard-table.js\";\nexport { LevelJourneyList } from \"./components/rewards/level-journey-list.js\";\nexport type { LevelJourneyListProps, LevelJourneyListLevel } from \"./components/rewards/level-journey-list.js\";\nexport { BadgeCatalog } from \"./components/rewards/badge-catalog.js\";\nexport type { BadgeCatalogProps, BadgeCatalogBadge } from \"./components/rewards/badge-catalog.js\";\nexport { XpToastContent } from \"./components/rewards/xp-toast-content.js\";\nexport type { XpToastContentProps } from \"./components/rewards/xp-toast-content.js\";\nexport { createRewardToast } from \"./components/rewards/reward-toast.js\";\nexport type { RewardToastSnapshot } from \"./components/rewards/reward-toast.js\";\n\n// ── v0.37.0 additions — infinite-scroll trigger ──────────────────────────────\nexport { LoadMoreSentinel } from \"./components/load-more-sentinel.js\";\nexport type { LoadMoreSentinelProps } from \"./components/load-more-sentinel.js\";\n\n// ── v0.47.0 additions — community rewards section ────────────────────────────\nexport { CommunityRewardsSection } from \"./components/community-rewards-section.js\";\nexport type { CommunityRewardsSectionProps, CommunityRewardsEntry } from \"./components/community-rewards-section.js\";\nexport { CreatorAirdropBanner } from \"./components/creator-airdrop-banner.js\";\nexport type { CreatorAirdropBannerProps } from \"./components/creator-airdrop-banner.js\";\n\n// ── Design system primitives — action-focus pattern, tokens, data display ────\nexport { ActionButton } from \"./components/action-button.js\";\nexport type { ActionButtonProps, ActionKey, ToneKey } from \"./components/action-button.js\";\nexport { GradientButton } from \"./components/gradient-button.js\";\nexport type { GradientButtonProps } from \"./components/gradient-button.js\";\n\nexport { CoinLaunchPreview } from \"./components/coin-launch-preview.js\";\nexport type { CoinPreviewData } from \"./components/coin-launch-preview.js\";\nexport { MedialaneCollectionCard } from \"./components/medialane-collection-card.js\";\nexport type { MedialaneCollectionCardProps } from \"./components/medialane-collection-card.js\";\nexport { TokenGlyph, TokenAmount } from \"./components/token-glyph.js\";\nexport type { TokenGlyphProps, TokenAmountProps, TokenSymbol } from \"./components/token-glyph.js\";\n\nexport { StatTile, StatPill } from \"./components/stat-tile.js\";\nexport type { StatTileProps, StatPillProps } from \"./components/stat-tile.js\";\n\nexport { ActionDialog } from \"./components/action-dialog.js\";\nexport type { ActionDialogProps } from \"./components/action-dialog.js\";\n\nexport { HiddenContentBanner } from \"./components/hidden-content-banner.js\";\nexport { CollectionHeroBanner } from \"./components/collection-hero-banner.js\";\nexport type { CollectionHeroBannerProps, CollectionHeroStat } from \"./components/collection-hero-banner.js\";\n\n// ── v0.99.0 additions — rewards UX overhaul ───────────────────────────────────\nexport { useRewardsCelebrations } from \"./components/rewards/use-rewards-celebrations.js\";\nexport { LevelUpCelebration } from \"./components/rewards/level-up-celebration.js\";\nexport type { LevelUpCelebrationProps } from \"./components/rewards/level-up-celebration.js\";\nexport { BadgeUnlockToastContent } from \"./components/rewards/badge-unlock-toast-content.js\";\nexport type { BadgeUnlockToastContentProps } from \"./components/rewards/badge-unlock-toast-content.js\";\nexport { JourneyPath } from \"./components/rewards/journey-path.js\";\nexport type { JourneyPathProps, JourneyStep } from \"./components/rewards/journey-path.js\";\n\n// ── Primitives (shadcn-derived, deduplicated from io + starknet) ─────────────\nexport { Skeleton } from \"./components/skeleton.js\";\nexport { Badge, badgeVariants } from \"./components/badge.js\";\nexport type { BadgeProps } from \"./components/badge.js\";\nexport { Label } from \"./components/label.js\";\nexport { Input } from \"./components/input.js\";\nexport { Switch } from \"./components/switch.js\";\nexport { Checkbox } from \"./components/checkbox.js\";\nexport { Alert, AlertTitle, AlertDescription } from \"./components/alert.js\";\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./components/tabs.js\";\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from \"./components/card.js\";\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from \"./components/collapsible.js\";\nexport { Button, buttonVariants } from \"./components/button.js\";\nexport type { ButtonProps } from \"./components/button.js\";\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from \"./components/popover.js\";\nexport { HelpIcon } from \"./components/help-icon.js\";\nexport { EmptyOrError } from \"./components/empty-or-error.js\";\nexport {\n Select, SelectGroup, SelectValue, SelectTrigger, SelectContent,\n SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton,\n} from \"./components/select.js\";\nexport {\n useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField,\n} from \"./components/form.js\";\nexport { Textarea } from \"./components/textarea.js\";\nexport type { TextareaProps } from \"./components/textarea.js\";\nexport {\n Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent,\n SheetHeader, SheetFooter, SheetTitle, SheetDescription,\n} from \"./components/sheet.js\";\n\n// ── v0.106.0 additions — dedupe pass 2 (io + starknet audit) ─────────────────\nexport { ToggleGroup, Section } from \"./components/create-form-primitives.js\";\nexport { OrderSortControl, sortOrders } from \"./components/order-sort-control.js\";\nexport type { OrderSort } from \"./components/order-sort-control.js\";\nexport { AssetLightbox } from \"./components/asset-lightbox.js\";\nexport type { AssetLightboxProps } from \"./components/asset-lightbox.js\";\nexport { PriceHistoryChart } from \"./components/price-history-chart.js\";\nexport type { PriceHistoryChartProps } from \"./components/price-history-chart.js\";\nexport { NavThemeToggle } from \"./components/nav-theme-toggle.js\";\nexport { JsonLd } from \"./components/json-ld.js\";\nexport type { JsonLdProps } from \"./components/json-ld.js\";\nexport { CreationRecord } from \"./components/creation-record.js\";\nexport type { CreationRecordProps } from \"./components/creation-record.js\";\nexport { ClubOwnerActions } from \"./components/club-owner-actions.js\";\nexport type { ClubOwnerActionsProps } from \"./components/club-owner-actions.js\";\nexport { IPTypeFields } from \"./components/ip-type-fields.js\";\nexport type { IPTypeFieldsProps, MetadataField } from \"./components/ip-type-fields.js\";\nexport { readBodyWithCap } from \"./utils/proxy-body.js\";\nexport type { CappedBody } from \"./utils/proxy-body.js\";\nexport {\n formatActivity, formatOrderNotification, formatOfferAcceptedNotification, formatAssetReceivedNotification,\n} from \"./utils/format-activity.js\";\nexport type { FormattedEvent } from \"./utils/format-activity.js\";\n\n// ── v0.107.0 additions — dedupe pass 3: data-fetching hooks + their views ────\n// Same getClient-injection pattern as useRewards/useCreators — the app\n// supplies its own SDK client factory, none of this touches wallet state.\nexport { queryKeys, queryKeyPrefix, QUERY_PREFIX } from \"./utils/query-keys.js\";\nexport { useCollectionProfile, useCreatorProfile } from \"./utils/use-profiles.js\";\nexport { useActivities, useActivitiesByAddress } from \"./utils/use-activities.js\";\nexport {\n useCollections, useCollection, useCollectionsByOwner, useCollectionTokens, useNearbyCollectionTokens,\n} from \"./utils/use-collections.js\";\nexport type { CollectionSort } from \"./utils/use-collections.js\";\nexport { CreatorChip } from \"./components/creator-chip.js\";\nexport type { CreatorChipProps } from \"./components/creator-chip.js\";\nexport { CollectionActivityTab } from \"./components/collection-activity-tab.js\";\nexport type { CollectionActivityTabProps } from \"./components/collection-activity-tab.js\";\nexport { CollectionTraitsTab } from \"./components/collection-traits-tab.js\";\nexport type { CollectionTraitsTabProps } from \"./components/collection-traits-tab.js\";\nexport { PortfolioActivity } from \"./components/portfolio-activity.js\";\nexport type { PortfolioActivityProps } from \"./components/portfolio-activity.js\";\nexport { CreatorScoreInline } from \"./components/creator-score-inline.js\";\nexport type { CreatorScoreInlineProps } from \"./components/creator-score-inline.js\";\n\nexport { useMedialaneClient } from \"./utils/use-medialane-client.js\";\nexport { useCreators } from \"./utils/use-creators.js\";\nexport {\n useRewards, useLeaderboard, useRewardsEvents, useRewardsConfig, useRewardsBatch,\n} from \"./utils/use-rewards.js\";\nexport type { UserRewards, LeaderboardEntry, BadgeSummary, LevelSummary } from \"./utils/use-rewards.js\";\n// ── v0.108.0 additions — dedupe pass 4: apiFetch + orders/notifications/remixes ──\nexport { apiFetch, ApiError } from \"./utils/api-fetch.js\";\nexport type { ApiFetchConfig, ApiFetchOptions } from \"./utils/api-fetch.js\";\nexport {\n useOrders, useOrder, useTokenListings, useUserOrders, useCounterOffers,\n useReceivedOffers, useCollectionFloorListings,\n} from \"./utils/use-orders.js\";\nexport { useNotifications } from \"./utils/use-notifications.js\";\nexport type { Notification, NotificationType, NotificationPriority, Announcement } from \"./data/notification.js\";\nexport { useTokenRemixes } from \"./utils/use-remix-offers.js\";\nexport { RemixesTab } from \"./components/remixes-tab.js\";\nexport type { RemixesTabProps } from \"./components/remixes-tab.js\";\n\nexport { OwnerSetupPanel } from \"./components/owner-setup-panel.js\";\nexport { DropCountdown } from \"./components/drop-countdown.js\";\nexport { CreatorAnalytics } from \"./components/creator-analytics.js\";\nexport {\n Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger,\n DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription,\n} from \"./components/dialog.js\";\n"],"mappings":"AACA,SAAS,UAAU;AACnB,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC,SAAS,YAAY,gBAAgB;AACrC,SAAS,sBAAsB;AAG/B,SAAS,cAAc,wBAAwB;AAE/C;AAAA,EACE;AAAA,EAAU;AAAA,EAAe;AAAA,EAAmB;AAAA,EAC5C;AAAA,EAAqB;AAAA,OAChB;AAEP;AAAA,EACE;AAAA,EAAc;AAAA,EAAqB;AAAA,EAAsB;AAAA,EAAsB;AAAA,OAC1E;AAEP,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AAExC,SAAS,kBAAkB,kBAAkB,eAAe,yBAAyB;AAErF,SAAS,0BAA0B;AAEnC,SAAS,yBAAyB;AAElC,SAAS,6BAA6B;AAEtC,SAAS,aAAa;AAC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AA,OAC3D;AAGP,SAAS,UAAU,gBAAgB;AAEnC;AAAA,EACE;AAAA,EAAW;AAAA,EAAU;AAAA,EAAkB;AAAA,EAAe;AAAA,EACtD;AAAA,EAAmB;AAAA,OACd;AACP,SAAS,wBAAwB;AAEjC,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAG3B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EAAQ;AAAA,EAAc;AAAA,EAAe;AAAA,EAAa;AAAA,EAClD;AAAA,EAAe;AAAA,EAAc;AAAA,EAAc;AAAA,EAAa;AAAA,OACnD;","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var api_fetch_exports = {};
|
|
20
|
+
__export(api_fetch_exports, {
|
|
21
|
+
ApiError: () => ApiError,
|
|
22
|
+
apiFetch: () => apiFetch
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(api_fetch_exports);
|
|
25
|
+
class ApiError extends Error {
|
|
26
|
+
constructor(status, message) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.status = status;
|
|
29
|
+
this.name = "ApiError";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function apiFetch(config, path, options = {}) {
|
|
33
|
+
const { method = "GET", body, bearer, signal } = options;
|
|
34
|
+
const url = `${config.baseUrl.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
35
|
+
const headers = {};
|
|
36
|
+
if (body !== void 0) headers["Content-Type"] = "application/json";
|
|
37
|
+
if (config.apiKey) headers["x-api-key"] = config.apiKey;
|
|
38
|
+
if (bearer) headers["Authorization"] = `Bearer ${bearer}`;
|
|
39
|
+
const res = await fetch(url, {
|
|
40
|
+
method,
|
|
41
|
+
headers,
|
|
42
|
+
body: body !== void 0 ? JSON.stringify(body) : void 0,
|
|
43
|
+
signal
|
|
44
|
+
});
|
|
45
|
+
if (!res.ok) {
|
|
46
|
+
const text = await res.text().catch(() => res.statusText);
|
|
47
|
+
let message = text || `Request failed with HTTP ${res.status}`;
|
|
48
|
+
try {
|
|
49
|
+
const parsed = JSON.parse(text);
|
|
50
|
+
if (parsed && typeof parsed === "object" && "error" in parsed && typeof parsed.error === "string") {
|
|
51
|
+
message = parsed.error;
|
|
52
|
+
}
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
55
|
+
throw new ApiError(res.status, message);
|
|
56
|
+
}
|
|
57
|
+
if (res.status === 204) return void 0;
|
|
58
|
+
return res.json();
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
ApiError,
|
|
63
|
+
apiFetch
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=api-fetch.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/api-fetch.ts"],"sourcesContent":["/**\n * Thin fetch helper for backend `/v1/*` routes that are not yet exposed via\n * `@medialane/sdk`'s `ApiClient`. Takes `{ baseUrl, apiKey }` as an explicit\n * config rather than reading env vars directly — each app's own\n * `MEDIALANE_BACKEND_URL` resolution is environment-aware (server gets the\n * real backend URL + key; the browser gets a same-origin BFF proxy that\n * injects the real key server-side) and that routing/security logic stays\n * app-local, same as `getMedialaneClient`.\n *\n * Error model:\n * `ApiError` carries the HTTP `status` so callers can special-case auth\n * states (401/403) without a generic error toast.\n *\n * Headers:\n * - `x-api-key` is injected when `apiKey` is non-empty.\n * - `Authorization: Bearer <token>` is forwarded if the caller passes\n * `bearer` — used for SIWS-gated routes.\n * - `Content-Type: application/json` is set automatically when a body is\n * present.\n */\nexport class ApiError extends Error {\n constructor(public readonly status: number, message: string) {\n super(message);\n this.name = \"ApiError\";\n }\n}\n\nexport interface ApiFetchConfig {\n baseUrl: string;\n apiKey?: string;\n}\n\nexport interface ApiFetchOptions {\n method?: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n body?: unknown;\n /** Bearer token (SIWS) for identity-aware routes. */\n bearer?: string | null;\n signal?: AbortSignal;\n}\n\nexport async function apiFetch<T = unknown>(\n config: ApiFetchConfig,\n path: string,\n options: ApiFetchOptions = {}\n): Promise<T> {\n const { method = \"GET\", body, bearer, signal } = options;\n const url = `${config.baseUrl.replace(/\\/$/, \"\")}${path.startsWith(\"/\") ? path : `/${path}`}`;\n\n const headers: Record<string, string> = {};\n if (body !== undefined) headers[\"Content-Type\"] = \"application/json\";\n if (config.apiKey) headers[\"x-api-key\"] = config.apiKey;\n if (bearer) headers[\"Authorization\"] = `Bearer ${bearer}`;\n\n const res = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal,\n });\n\n if (!res.ok) {\n const text = await res.text().catch(() => res.statusText);\n let message = text || `Request failed with HTTP ${res.status}`;\n try {\n const parsed = JSON.parse(text);\n if (parsed && typeof parsed === \"object\" && \"error\" in parsed && typeof parsed.error === \"string\") {\n message = parsed.error;\n }\n } catch {\n /* response wasn't JSON — keep the text as the message */\n }\n throw new ApiError(res.status, message);\n }\n\n // 204 No Content shows up on some PATCH/DELETE paths — return undefined as T.\n if (res.status === 204) return undefined as T;\n return res.json() as Promise<T>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,MAAM,iBAAiB,MAAM;AAAA,EAClC,YAA4B,QAAgB,SAAiB;AAC3D,UAAM,OAAO;AADa;AAE1B,SAAK,OAAO;AAAA,EACd;AACF;AAeA,eAAsB,SACpB,QACA,MACA,UAA2B,CAAC,GAChB;AACZ,QAAM,EAAE,SAAS,OAAO,MAAM,QAAQ,OAAO,IAAI;AACjD,QAAM,MAAM,GAAG,OAAO,QAAQ,QAAQ,OAAO,EAAE,CAAC,GAAG,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI,IAAI,EAAE;AAE3F,QAAM,UAAkC,CAAC;AACzC,MAAI,SAAS,OAAW,SAAQ,cAAc,IAAI;AAClD,MAAI,OAAO,OAAQ,SAAQ,WAAW,IAAI,OAAO;AACjD,MAAI,OAAQ,SAAQ,eAAe,IAAI,UAAU,MAAM;AAEvD,QAAM,MAAM,MAAM,MAAM,KAAK;AAAA,IAC3B;AAAA,IACA;AAAA,IACA,MAAM,SAAS,SAAY,KAAK,UAAU,IAAI,IAAI;AAAA,IAClD;AAAA,EACF,CAAC;AAED,MAAI,CAAC,IAAI,IAAI;AACX,UAAM,OAAO,MAAM,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,UAAU;AACxD,QAAI,UAAU,QAAQ,4BAA4B,IAAI,MAAM;AAC5D,QAAI;AACF,YAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,UAAI,UAAU,OAAO,WAAW,YAAY,WAAW,UAAU,OAAO,OAAO,UAAU,UAAU;AACjG,kBAAU,OAAO;AAAA,MACnB;AAAA,IACF,QAAQ;AAAA,IAER;AACA,UAAM,IAAI,SAAS,IAAI,QAAQ,OAAO;AAAA,EACxC;AAGA,MAAI,IAAI,WAAW,IAAK,QAAO;AAC/B,SAAO,IAAI,KAAK;AAClB;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin fetch helper for backend `/v1/*` routes that are not yet exposed via
|
|
3
|
+
* `@medialane/sdk`'s `ApiClient`. Takes `{ baseUrl, apiKey }` as an explicit
|
|
4
|
+
* config rather than reading env vars directly — each app's own
|
|
5
|
+
* `MEDIALANE_BACKEND_URL` resolution is environment-aware (server gets the
|
|
6
|
+
* real backend URL + key; the browser gets a same-origin BFF proxy that
|
|
7
|
+
* injects the real key server-side) and that routing/security logic stays
|
|
8
|
+
* app-local, same as `getMedialaneClient`.
|
|
9
|
+
*
|
|
10
|
+
* Error model:
|
|
11
|
+
* `ApiError` carries the HTTP `status` so callers can special-case auth
|
|
12
|
+
* states (401/403) without a generic error toast.
|
|
13
|
+
*
|
|
14
|
+
* Headers:
|
|
15
|
+
* - `x-api-key` is injected when `apiKey` is non-empty.
|
|
16
|
+
* - `Authorization: Bearer <token>` is forwarded if the caller passes
|
|
17
|
+
* `bearer` — used for SIWS-gated routes.
|
|
18
|
+
* - `Content-Type: application/json` is set automatically when a body is
|
|
19
|
+
* present.
|
|
20
|
+
*/
|
|
21
|
+
declare class ApiError extends Error {
|
|
22
|
+
readonly status: number;
|
|
23
|
+
constructor(status: number, message: string);
|
|
24
|
+
}
|
|
25
|
+
interface ApiFetchConfig {
|
|
26
|
+
baseUrl: string;
|
|
27
|
+
apiKey?: string;
|
|
28
|
+
}
|
|
29
|
+
interface ApiFetchOptions {
|
|
30
|
+
method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
|
|
31
|
+
body?: unknown;
|
|
32
|
+
/** Bearer token (SIWS) for identity-aware routes. */
|
|
33
|
+
bearer?: string | null;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}
|
|
36
|
+
declare function apiFetch<T = unknown>(config: ApiFetchConfig, path: string, options?: ApiFetchOptions): Promise<T>;
|
|
37
|
+
|
|
38
|
+
export { ApiError, type ApiFetchConfig, type ApiFetchOptions, apiFetch };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin fetch helper for backend `/v1/*` routes that are not yet exposed via
|
|
3
|
+
* `@medialane/sdk`'s `ApiClient`. Takes `{ baseUrl, apiKey }` as an explicit
|
|
4
|
+
* config rather than reading env vars directly — each app's own
|
|
5
|
+
* `MEDIALANE_BACKEND_URL` resolution is environment-aware (server gets the
|
|
6
|
+
* real backend URL + key; the browser gets a same-origin BFF proxy that
|
|
7
|
+
* injects the real key server-side) and that routing/security logic stays
|
|
8
|
+
* app-local, same as `getMedialaneClient`.
|
|
9
|
+
*
|
|
10
|
+
* Error model:
|
|
11
|
+
* `ApiError` carries the HTTP `status` so callers can special-case auth
|
|
12
|
+
* states (401/403) without a generic error toast.
|
|
13
|
+
*
|
|
14
|
+
* Headers:
|
|
15
|
+
* - `x-api-key` is injected when `apiKey` is non-empty.
|
|
16
|
+
* - `Authorization: Bearer <token>` is forwarded if the caller passes
|
|
17
|
+
* `bearer` — used for SIWS-gated routes.
|
|
18
|
+
* - `Content-Type: application/json` is set automatically when a body is
|
|
19
|
+
* present.
|
|
20
|
+
*/
|
|
21
|
+
declare class ApiError extends Error {
|
|
22
|
+
readonly status: number;
|
|
23
|
+
constructor(status: number, message: string);
|
|
24
|
+
}
|
|
25
|
+
interface ApiFetchConfig {
|
|
26
|
+
baseUrl: string;
|
|
27
|
+
apiKey?: string;
|
|
28
|
+
}
|
|
29
|
+
interface ApiFetchOptions {
|
|
30
|
+
method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
|
|
31
|
+
body?: unknown;
|
|
32
|
+
/** Bearer token (SIWS) for identity-aware routes. */
|
|
33
|
+
bearer?: string | null;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}
|
|
36
|
+
declare function apiFetch<T = unknown>(config: ApiFetchConfig, path: string, options?: ApiFetchOptions): Promise<T>;
|
|
37
|
+
|
|
38
|
+
export { ApiError, type ApiFetchConfig, type ApiFetchOptions, apiFetch };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
class ApiError extends Error {
|
|
2
|
+
constructor(status, message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.status = status;
|
|
5
|
+
this.name = "ApiError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
async function apiFetch(config, path, options = {}) {
|
|
9
|
+
const { method = "GET", body, bearer, signal } = options;
|
|
10
|
+
const url = `${config.baseUrl.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
11
|
+
const headers = {};
|
|
12
|
+
if (body !== void 0) headers["Content-Type"] = "application/json";
|
|
13
|
+
if (config.apiKey) headers["x-api-key"] = config.apiKey;
|
|
14
|
+
if (bearer) headers["Authorization"] = `Bearer ${bearer}`;
|
|
15
|
+
const res = await fetch(url, {
|
|
16
|
+
method,
|
|
17
|
+
headers,
|
|
18
|
+
body: body !== void 0 ? JSON.stringify(body) : void 0,
|
|
19
|
+
signal
|
|
20
|
+
});
|
|
21
|
+
if (!res.ok) {
|
|
22
|
+
const text = await res.text().catch(() => res.statusText);
|
|
23
|
+
let message = text || `Request failed with HTTP ${res.status}`;
|
|
24
|
+
try {
|
|
25
|
+
const parsed = JSON.parse(text);
|
|
26
|
+
if (parsed && typeof parsed === "object" && "error" in parsed && typeof parsed.error === "string") {
|
|
27
|
+
message = parsed.error;
|
|
28
|
+
}
|
|
29
|
+
} catch {
|
|
30
|
+
}
|
|
31
|
+
throw new ApiError(res.status, message);
|
|
32
|
+
}
|
|
33
|
+
if (res.status === 204) return void 0;
|
|
34
|
+
return res.json();
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
ApiError,
|
|
38
|
+
apiFetch
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=api-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/api-fetch.ts"],"sourcesContent":["/**\n * Thin fetch helper for backend `/v1/*` routes that are not yet exposed via\n * `@medialane/sdk`'s `ApiClient`. Takes `{ baseUrl, apiKey }` as an explicit\n * config rather than reading env vars directly — each app's own\n * `MEDIALANE_BACKEND_URL` resolution is environment-aware (server gets the\n * real backend URL + key; the browser gets a same-origin BFF proxy that\n * injects the real key server-side) and that routing/security logic stays\n * app-local, same as `getMedialaneClient`.\n *\n * Error model:\n * `ApiError` carries the HTTP `status` so callers can special-case auth\n * states (401/403) without a generic error toast.\n *\n * Headers:\n * - `x-api-key` is injected when `apiKey` is non-empty.\n * - `Authorization: Bearer <token>` is forwarded if the caller passes\n * `bearer` — used for SIWS-gated routes.\n * - `Content-Type: application/json` is set automatically when a body is\n * present.\n */\nexport class ApiError extends Error {\n constructor(public readonly status: number, message: string) {\n super(message);\n this.name = \"ApiError\";\n }\n}\n\nexport interface ApiFetchConfig {\n baseUrl: string;\n apiKey?: string;\n}\n\nexport interface ApiFetchOptions {\n method?: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n body?: unknown;\n /** Bearer token (SIWS) for identity-aware routes. */\n bearer?: string | null;\n signal?: AbortSignal;\n}\n\nexport async function apiFetch<T = unknown>(\n config: ApiFetchConfig,\n path: string,\n options: ApiFetchOptions = {}\n): Promise<T> {\n const { method = \"GET\", body, bearer, signal } = options;\n const url = `${config.baseUrl.replace(/\\/$/, \"\")}${path.startsWith(\"/\") ? path : `/${path}`}`;\n\n const headers: Record<string, string> = {};\n if (body !== undefined) headers[\"Content-Type\"] = \"application/json\";\n if (config.apiKey) headers[\"x-api-key\"] = config.apiKey;\n if (bearer) headers[\"Authorization\"] = `Bearer ${bearer}`;\n\n const res = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal,\n });\n\n if (!res.ok) {\n const text = await res.text().catch(() => res.statusText);\n let message = text || `Request failed with HTTP ${res.status}`;\n try {\n const parsed = JSON.parse(text);\n if (parsed && typeof parsed === \"object\" && \"error\" in parsed && typeof parsed.error === \"string\") {\n message = parsed.error;\n }\n } catch {\n /* response wasn't JSON — keep the text as the message */\n }\n throw new ApiError(res.status, message);\n }\n\n // 204 No Content shows up on some PATCH/DELETE paths — return undefined as T.\n if (res.status === 204) return undefined as T;\n return res.json() as Promise<T>;\n}\n"],"mappings":"AAoBO,MAAM,iBAAiB,MAAM;AAAA,EAClC,YAA4B,QAAgB,SAAiB;AAC3D,UAAM,OAAO;AADa;AAE1B,SAAK,OAAO;AAAA,EACd;AACF;AAeA,eAAsB,SACpB,QACA,MACA,UAA2B,CAAC,GAChB;AACZ,QAAM,EAAE,SAAS,OAAO,MAAM,QAAQ,OAAO,IAAI;AACjD,QAAM,MAAM,GAAG,OAAO,QAAQ,QAAQ,OAAO,EAAE,CAAC,GAAG,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI,IAAI,EAAE;AAE3F,QAAM,UAAkC,CAAC;AACzC,MAAI,SAAS,OAAW,SAAQ,cAAc,IAAI;AAClD,MAAI,OAAO,OAAQ,SAAQ,WAAW,IAAI,OAAO;AACjD,MAAI,OAAQ,SAAQ,eAAe,IAAI,UAAU,MAAM;AAEvD,QAAM,MAAM,MAAM,MAAM,KAAK;AAAA,IAC3B;AAAA,IACA;AAAA,IACA,MAAM,SAAS,SAAY,KAAK,UAAU,IAAI,IAAI;AAAA,IAClD;AAAA,EACF,CAAC;AAED,MAAI,CAAC,IAAI,IAAI;AACX,UAAM,OAAO,MAAM,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,UAAU;AACxD,QAAI,UAAU,QAAQ,4BAA4B,IAAI,MAAM;AAC5D,QAAI;AACF,YAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,UAAI,UAAU,OAAO,WAAW,YAAY,WAAW,UAAU,OAAO,OAAO,UAAU,UAAU;AACjG,kBAAU,OAAO;AAAA,MACnB;AAAA,IACF,QAAQ;AAAA,IAER;AACA,UAAM,IAAI,SAAS,IAAI,QAAQ,OAAO;AAAA,EACxC;AAGA,MAAI,IAAI,WAAW,IAAK,QAAO;AAC/B,SAAO,IAAI,KAAK;AAClB;","names":[]}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var use_notifications_exports = {};
|
|
31
|
+
__export(use_notifications_exports, {
|
|
32
|
+
useNotifications: () => useNotifications
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(use_notifications_exports);
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_swr = __toESM(require("swr"), 1);
|
|
37
|
+
var import_sdk = require("@medialane/sdk");
|
|
38
|
+
var import_use_orders = require("./use-orders.js");
|
|
39
|
+
var import_use_activities = require("./use-activities.js");
|
|
40
|
+
var import_notification_storage = require("./notification-storage.js");
|
|
41
|
+
var import_format_activity = require("./format-activity.js");
|
|
42
|
+
async function fetchAnnouncements() {
|
|
43
|
+
const res = await fetch("/api/announcements");
|
|
44
|
+
if (!res.ok) return [];
|
|
45
|
+
return res.json();
|
|
46
|
+
}
|
|
47
|
+
function useNotifications(getClient, apiConfig, address) {
|
|
48
|
+
const [readIds, setReadIds] = (0, import_react.useState)(() => (0, import_notification_storage.getReadIds)());
|
|
49
|
+
const { orders: userOrders } = (0, import_use_orders.useUserOrders)(getClient, address ?? null);
|
|
50
|
+
const { orders: receivedOffers } = (0, import_use_orders.useReceivedOffers)(apiConfig, address ?? null);
|
|
51
|
+
const { activities } = (0, import_use_activities.useActivitiesByAddress)(getClient, address ?? null);
|
|
52
|
+
const { data: announcements = [] } = (0, import_swr.default)(
|
|
53
|
+
"announcements",
|
|
54
|
+
fetchAnnouncements,
|
|
55
|
+
{ revalidateOnFocus: false, dedupingInterval: 6e4 }
|
|
56
|
+
);
|
|
57
|
+
const notifications = (0, import_react.useMemo)(() => {
|
|
58
|
+
const items = [];
|
|
59
|
+
userOrders.filter((o) => o.offer.itemType === "ERC20" && o.status === "FULFILLED").forEach((order) => {
|
|
60
|
+
const id = `offer-accepted-${order.orderHash}`;
|
|
61
|
+
const fmt = (0, import_format_activity.formatOfferAcceptedNotification)(order);
|
|
62
|
+
items.push({
|
|
63
|
+
id,
|
|
64
|
+
type: "offer_accepted",
|
|
65
|
+
priority: "spotlight",
|
|
66
|
+
celebratory: true,
|
|
67
|
+
...fmt,
|
|
68
|
+
timestamp: order.updatedAt ?? order.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
69
|
+
isUnread: !readIds.has(id),
|
|
70
|
+
metadata: {
|
|
71
|
+
amount: order.price?.formatted ?? void 0,
|
|
72
|
+
currency: order.price?.currency ?? void 0,
|
|
73
|
+
txHash: order.txHash?.fulfilled ?? void 0,
|
|
74
|
+
assetName: order.token?.name ?? void 0
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
receivedOffers.forEach((order) => {
|
|
79
|
+
const id = `order-${order.orderHash}`;
|
|
80
|
+
const fmt = (0, import_format_activity.formatOrderNotification)(order);
|
|
81
|
+
items.push({
|
|
82
|
+
id,
|
|
83
|
+
type: "offer",
|
|
84
|
+
priority: "spotlight",
|
|
85
|
+
celebratory: false,
|
|
86
|
+
...fmt,
|
|
87
|
+
timestamp: order.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
88
|
+
isUnread: !readIds.has(id),
|
|
89
|
+
metadata: {
|
|
90
|
+
amount: order.price?.formatted ?? void 0,
|
|
91
|
+
currency: order.price?.currency ?? void 0,
|
|
92
|
+
assetName: order.token?.name ?? void 0
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
activities.slice(0, 50).forEach((event) => {
|
|
97
|
+
const id = `activity-${event.txHash}-${event.type}-${event.nftTokenId ?? ""}`;
|
|
98
|
+
if (event.type === "transfer" && address && !!event.to && (0, import_sdk.normalizeAddress)("STARKNET", event.to) === (0, import_sdk.normalizeAddress)("STARKNET", address)) {
|
|
99
|
+
const fmt2 = (0, import_format_activity.formatAssetReceivedNotification)(event);
|
|
100
|
+
items.push({
|
|
101
|
+
id,
|
|
102
|
+
type: "asset_received",
|
|
103
|
+
priority: "spotlight",
|
|
104
|
+
celebratory: true,
|
|
105
|
+
...fmt2,
|
|
106
|
+
timestamp: event.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
107
|
+
isUnread: !readIds.has(id),
|
|
108
|
+
metadata: {
|
|
109
|
+
txHash: event.txHash ?? void 0,
|
|
110
|
+
assetName: event.token?.name ?? void 0
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const isMySale = event.type === "sale" && address && (!!event.offerer && (0, import_sdk.normalizeAddress)("STARKNET", event.offerer) === (0, import_sdk.normalizeAddress)("STARKNET", address) || !!event.from && (0, import_sdk.normalizeAddress)("STARKNET", event.from) === (0, import_sdk.normalizeAddress)("STARKNET", address));
|
|
116
|
+
const fmt = (0, import_format_activity.formatActivity)(event);
|
|
117
|
+
items.push({
|
|
118
|
+
id,
|
|
119
|
+
type: event.type,
|
|
120
|
+
priority: isMySale ? "spotlight" : "normal",
|
|
121
|
+
celebratory: !!isMySale,
|
|
122
|
+
...fmt,
|
|
123
|
+
timestamp: event.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
124
|
+
isUnread: !readIds.has(id),
|
|
125
|
+
metadata: {
|
|
126
|
+
amount: event.price?.formatted ?? void 0,
|
|
127
|
+
currency: event.price?.currency ?? void 0,
|
|
128
|
+
txHash: event.txHash ?? void 0,
|
|
129
|
+
assetName: event.token?.name ?? void 0
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
announcements.forEach((ann) => {
|
|
134
|
+
const id = `ann-${ann.id}`;
|
|
135
|
+
items.push({
|
|
136
|
+
id,
|
|
137
|
+
type: "announcement",
|
|
138
|
+
priority: ann.pinned ? "spotlight" : "normal",
|
|
139
|
+
celebratory: false,
|
|
140
|
+
title: ann.title,
|
|
141
|
+
description: ann.body,
|
|
142
|
+
image: ann.image,
|
|
143
|
+
href: ann.href,
|
|
144
|
+
timestamp: ann.created_at,
|
|
145
|
+
isUnread: !readIds.has(id)
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
items.sort(
|
|
149
|
+
(a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
|
|
150
|
+
);
|
|
151
|
+
return items;
|
|
152
|
+
}, [userOrders, receivedOffers, activities, announcements, address, readIds]);
|
|
153
|
+
const unreadCount = notifications.filter((n) => n.isUnread).length;
|
|
154
|
+
const markNotificationsRead = (0, import_react.useCallback)((ids) => {
|
|
155
|
+
(0, import_notification_storage.markRead)(ids);
|
|
156
|
+
setReadIds((0, import_notification_storage.getReadIds)());
|
|
157
|
+
}, []);
|
|
158
|
+
return {
|
|
159
|
+
notifications,
|
|
160
|
+
unreadCount,
|
|
161
|
+
markAllRead: () => markNotificationsRead(notifications.map((n) => n.id)),
|
|
162
|
+
markRead: (id) => markNotificationsRead([id])
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
166
|
+
0 && (module.exports = {
|
|
167
|
+
useNotifications
|
|
168
|
+
});
|
|
169
|
+
//# sourceMappingURL=use-notifications.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-notifications.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useMemo, useState } from \"react\";\nimport useSWR from \"swr\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport type { ApiActivity } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useUserOrders, useReceivedOffers } from \"./use-orders.js\";\nimport { useActivitiesByAddress } from \"./use-activities.js\";\nimport { getReadIds, markRead } from \"./notification-storage.js\";\nimport {\n formatActivity,\n formatOrderNotification,\n formatOfferAcceptedNotification,\n formatAssetReceivedNotification,\n} from \"./format-activity.js\";\nimport type { Notification, Announcement } from \"../data/notification.js\";\nimport type { ApiFetchConfig } from \"./api-fetch.js\";\n\nasync function fetchAnnouncements(): Promise<Announcement[]> {\n const res = await fetch(\"/api/announcements\");\n if (!res.ok) return [];\n return res.json();\n}\n\nexport function useNotifications(\n getClient: () => MedialaneClient,\n apiConfig: ApiFetchConfig,\n address: string | null | undefined\n) {\n const [readIds, setReadIds] = useState<Set<string>>(() => getReadIds());\n\n // Offers this user placed (to detect accepted ones)\n const { orders: userOrders } = useUserOrders(getClient, address ?? null);\n // Offers received on tokens the user holds\n const { orders: receivedOffers } = useReceivedOffers(apiConfig, address ?? null);\n const { activities } = useActivitiesByAddress(getClient, address ?? null);\n const { data: announcements = [] } = useSWR<Announcement[]>(\n \"announcements\",\n fetchAnnouncements,\n { revalidateOnFocus: false, dedupingInterval: 60_000 }\n );\n\n const notifications: Notification[] = useMemo(() => {\n const items: Notification[] = [];\n\n // ── Offers accepted (buyer: my ERC20 bid was fulfilled) ──────────────────\n userOrders\n .filter((o) => o.offer.itemType === \"ERC20\" && o.status === \"FULFILLED\")\n .forEach((order) => {\n const id = `offer-accepted-${order.orderHash}`;\n const fmt = formatOfferAcceptedNotification(order);\n items.push({\n id,\n type: \"offer_accepted\",\n priority: \"spotlight\",\n celebratory: true,\n ...fmt,\n timestamp: order.updatedAt ?? order.createdAt ?? new Date().toISOString(),\n isUnread: !readIds.has(id),\n metadata: {\n amount: order.price?.formatted ?? undefined,\n currency: order.price?.currency ?? undefined,\n txHash: order.txHash?.fulfilled ?? undefined,\n assetName: order.token?.name ?? undefined,\n },\n });\n });\n\n // ── Received offers (someone bid on my asset) ────────────────────────────\n receivedOffers.forEach((order) => {\n const id = `order-${order.orderHash}`;\n const fmt = formatOrderNotification(order);\n items.push({\n id,\n type: \"offer\",\n priority: \"spotlight\",\n celebratory: false,\n ...fmt,\n timestamp: order.createdAt ?? new Date().toISOString(),\n isUnread: !readIds.has(id),\n metadata: {\n amount: order.price?.formatted ?? undefined,\n currency: order.price?.currency ?? undefined,\n assetName: order.token?.name ?? undefined,\n },\n });\n });\n\n // ── Activity events ──────────────────────────────────────────────────────\n (activities as ApiActivity[]).slice(0, 50).forEach((event) => {\n const id = `activity-${event.txHash}-${event.type}-${event.nftTokenId ?? \"\"}`;\n\n // Asset received: transfer where this user is the recipient\n if (\n event.type === \"transfer\" &&\n address &&\n !!event.to && normalizeAddress(\"STARKNET\", event.to) === normalizeAddress(\"STARKNET\", address)\n ) {\n const fmt = formatAssetReceivedNotification(event);\n items.push({\n id,\n type: \"asset_received\",\n priority: \"spotlight\",\n celebratory: true,\n ...fmt,\n timestamp: event.timestamp ?? new Date().toISOString(),\n isUnread: !readIds.has(id),\n metadata: {\n txHash: event.txHash ?? undefined,\n assetName: event.token?.name ?? undefined,\n },\n });\n return;\n }\n\n // Sale (seller perspective): activity sale where offerer = address\n const isMySale =\n event.type === \"sale\" &&\n address &&\n ((!!event.offerer && normalizeAddress(\"STARKNET\", event.offerer) === normalizeAddress(\"STARKNET\", address)) ||\n (!!event.from && normalizeAddress(\"STARKNET\", event.from) === normalizeAddress(\"STARKNET\", address)));\n\n const fmt = formatActivity(event);\n items.push({\n id,\n type: event.type as Notification[\"type\"],\n priority: isMySale ? \"spotlight\" : \"normal\",\n celebratory: !!isMySale,\n ...fmt,\n timestamp: event.timestamp ?? new Date().toISOString(),\n isUnread: !readIds.has(id),\n metadata: {\n amount: event.price?.formatted ?? undefined,\n currency: event.price?.currency ?? undefined,\n txHash: event.txHash ?? undefined,\n assetName: event.token?.name ?? undefined,\n },\n });\n });\n\n // ── Announcements ────────────────────────────────────────────────────────\n announcements.forEach((ann) => {\n const id = `ann-${ann.id}`;\n items.push({\n id,\n type: \"announcement\",\n priority: ann.pinned ? \"spotlight\" : \"normal\",\n celebratory: false,\n title: ann.title,\n description: ann.body,\n image: ann.image,\n href: ann.href,\n timestamp: ann.created_at,\n isUnread: !readIds.has(id),\n });\n });\n\n // Chronological, newest first\n items.sort(\n (a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()\n );\n\n return items;\n }, [userOrders, receivedOffers, activities, announcements, address, readIds]);\n\n const unreadCount = notifications.filter((n) => n.isUnread).length;\n\n const markNotificationsRead = useCallback((ids: string[]) => {\n markRead(ids);\n setReadIds(getReadIds());\n }, []);\n\n return {\n notifications,\n unreadCount,\n markAllRead: () => mark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WAAO;AAAA,EACT,GAAG,CAAC,YAAY,gBAAgB,YAAY,eAAe,SAAS,OAAO,CAAC;AAE5E,QAAM,cAAc,cAAc,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE;AAE5D,QAAM,4BAAwB,0BAAY,CAAC,QAAkB;AAC3D,8CAAS,GAAG;AACZ,mBAAW,wCAAW,CAAC;AAAA,EACzB,GAAG,CAAC,CAAC;AAEL,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,aAAa,MAAM,sBAAsB,cAAc,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AAAA,IACvE,UAAU,CAAC,OAAe,sBAAsB,CAAC,EAAE,CAAC;AAAA,EACtD;AACF;","names":["useSWR","fmt"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MedialaneClient } from '@medialane/sdk/starknet';
|
|
2
|
+
import { Notification } from '../data/notification.cjs';
|
|
3
|
+
import { ApiFetchConfig } from './api-fetch.cjs';
|
|
4
|
+
|
|
5
|
+
declare function useNotifications(getClient: () => MedialaneClient, apiConfig: ApiFetchConfig, address: string | null | undefined): {
|
|
6
|
+
notifications: Notification[];
|
|
7
|
+
unreadCount: number;
|
|
8
|
+
markAllRead: () => void;
|
|
9
|
+
markRead: (id: string) => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { useNotifications };
|