@medialane/ui 0.313.0 → 0.314.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.
Files changed (39) hide show
  1. package/dist/components/approve-mint-dialog.cjs +1 -1
  2. package/dist/components/approve-mint-dialog.cjs.map +1 -1
  3. package/dist/components/approve-mint-dialog.js +1 -1
  4. package/dist/components/approve-mint-dialog.js.map +1 -1
  5. package/dist/components/asset-marketplace-panel.cjs +1 -1
  6. package/dist/components/asset-marketplace-panel.cjs.map +1 -1
  7. package/dist/components/asset-marketplace-panel.js +1 -1
  8. package/dist/components/asset-marketplace-panel.js.map +1 -1
  9. package/dist/components/fast-mint/success-view.cjs +1 -1
  10. package/dist/components/fast-mint/success-view.cjs.map +1 -1
  11. package/dist/components/fast-mint/success-view.js +1 -1
  12. package/dist/components/fast-mint/success-view.js.map +1 -1
  13. package/dist/components/home-page.cjs +1 -1
  14. package/dist/components/home-page.cjs.map +1 -1
  15. package/dist/components/home-page.js +1 -1
  16. package/dist/components/home-page.js.map +1 -1
  17. package/dist/components/launchpad/tier-mint-presets.cjs +3 -3
  18. package/dist/components/launchpad/tier-mint-presets.cjs.map +1 -1
  19. package/dist/components/launchpad/tier-mint-presets.js +3 -3
  20. package/dist/components/launchpad/tier-mint-presets.js.map +1 -1
  21. package/dist/components/listings-grid.cjs +1 -1
  22. package/dist/components/listings-grid.cjs.map +1 -1
  23. package/dist/components/listings-grid.js +1 -1
  24. package/dist/components/listings-grid.js.map +1 -1
  25. package/dist/components/portfolio-orders.cjs +1 -1
  26. package/dist/components/portfolio-orders.cjs.map +1 -1
  27. package/dist/components/portfolio-orders.js +1 -1
  28. package/dist/components/portfolio-orders.js.map +1 -1
  29. package/dist/components/rewards/rewards-dashboard.cjs +2 -2
  30. package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
  31. package/dist/components/rewards/rewards-dashboard.js +2 -2
  32. package/dist/components/rewards/rewards-dashboard.js.map +1 -1
  33. package/dist/components/route-error.cjs +2 -6
  34. package/dist/components/route-error.cjs.map +1 -1
  35. package/dist/components/route-error.d.cts +1 -2
  36. package/dist/components/route-error.d.ts +1 -2
  37. package/dist/components/route-error.js +2 -6
  38. package/dist/components/route-error.js.map +1 -1
  39. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/rewards/rewards-dashboard.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { useRewards, useRewardsConfig, useRewardsEvents } from \"../../utils/use-rewards.js\";\nimport { LevelBadge } from \"./level-badge.js\";\nimport { LevelUpCelebration } from \"./level-up-celebration.js\";\nimport { BadgeUnlocked } from \"./badge-unlocked.js\";\nimport { useRewardsCelebrations } from \"./use-rewards-celebrations.js\";\nimport { LeaderboardPanel } from \"./leaderboard-panel.js\";\nimport type { ApiRewardsBadge } from \"@medialane/sdk\";\nimport {\n Gift,\n ExternalLink,\n Palette,\n Layers,\n Tag,\n Handshake,\n ShoppingBag,\n Rocket,\n GitBranch,\n UserRoundCheck,\n Ticket,\n MessageSquare,\n Users,\n type LucideIcon,\n Package,\n CheckCircle2,\n TrendingUp,\n Crown,\n Coins,\n Star,\n Gem,\n Award,\n HandCoins,\n Flame,\n Zap,\n} from \"lucide-react\";\n\nexport const REWARD_ACTION_LABELS: Record<string, string> = {\n complete_profile: \"Complete profile\",\n mint_asset: \"Mint assets\",\n create_collection: \"Create collections\",\n launch_launchpad: \"Launch drops / POPs\",\n create_remix: \"Create remixes\",\n list_asset: \"List assets\",\n buy_asset: \"Buy assets\",\n make_offer: \"Make offers\",\n counter_offer: \"Counter offers\",\n offer_accepted_seller: \"Offers accepted (sold)\",\n offer_accepted_buyer: \"Offers accepted (bought)\",\n claim_pop: \"POP claims\",\n claim_drop: \"Drop claims\",\n comment: \"On-chain comments\",\n create_ticket_collection: \"Ticketed events created\",\n buy_ticket: \"Tickets received\",\n create_club: \"Clubs started\",\n join_club: \"Clubs joined\",\n create_sponsorship_offer: \"Sponsorships opened\",\n place_sponsorship_bid: \"Sponsorship bids\",\n sponsorship_licensed_sponsor: \"Sponsorships secured (sponsor)\",\n sponsorship_licensed_author: \"Sponsorships secured (creator)\",\n launch_coin: \"Creator coins launched\",\n};\n\nconst BADGE_ICONS: Record<string, LucideIcon> = {\n Flame, Package, CheckCircle2, GitBranch, TrendingUp, Layers,\n Ticket, Crown, Coins, Star, Gem, Zap, Award, Users, MessageSquare, HandCoins,\n Handshake,\n};\n\nconst EARN_GROUPS: {\n title: string;\n textClass: string;\n tileClass: string;\n items: { label: string; href: string; Icon: LucideIcon }[];\n}[] = [\n {\n title: \"Create\",\n textClass: \"text-brand-purple\",\n tileClass: \"bg-brand-purple\",\n items: [\n { label: \"Create a collection\", href: \"/launchpad/single-editions/collection\", Icon: Layers },\n { label: \"Mint an asset\", href: \"/launchpad/single-editions\", Icon: Palette },\n { label: \"Launch a drop or POP\", href: \"/launchpad\", Icon: Rocket },\n { label: \"Launch a creator coin\", href: \"/launchpad/coin/create\", Icon: Coins },\n { label: \"Remix existing work\", href: \"/marketplace\", Icon: GitBranch },\n ],\n },\n {\n title: \"Collect\",\n textClass: \"text-brand-blue\",\n tileClass: \"bg-brand-blue\",\n items: [\n { label: \"Collect an asset\", href: \"/marketplace\", Icon: ShoppingBag },\n { label: \"Make an offer\", href: \"/marketplace\", Icon: Handshake },\n { label: \"List an asset for sale\", href: \"/portfolio/assets\", Icon: Tag },\n { label: \"Get an event ticket\", href: \"/launchpad\", Icon: Ticket },\n ],\n },\n {\n title: \"Connect\",\n textClass: \"text-brand-rose\",\n tileClass: \"bg-brand-rose\",\n items: [\n { label: \"Start or join a club\", href: \"/launchpad\", Icon: UserRoundCheck },\n { label: \"Open a sponsorship\", href: \"/launchpad\", Icon: Handshake },\n { label: \"Join the conversation\", href: \"/marketplace\", Icon: MessageSquare },\n { label: \"Complete your profile\", href: \"/settings\", Icon: UserRoundCheck },\n ],\n },\n];\n\nfunction Hero() {\n return (\n <section className=\"space-y-5\">\n <h1 className=\"text-5xl sm:text-6xl font-black tracking-tight leading-[1.02]\">\n Community <span className=\"bg-gradient-to-r from-brand-rose to-brand-orange bg-clip-text text-transparent\">Rewards</span>\n </h1>\n <p className=\"text-lg text-foreground/70 max-w-xl leading-relaxed font-medium\">\n Every action earns XP, and active members receive allocations from the\n Creator&apos;s Fund based on how much they participate. Scores and\n badges are recalculated weekly.{\" \"}\n <Link href=\"/journey\" className=\"text-foreground underline underline-offset-2 hover:text-brand-orange transition-colors\">\n See the full system\n </Link>\n .\n </p>\n </section>\n );\n}\n\nfunction SignInButton() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <Button size=\"lg\" className=\"w-full rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n );\n}\n\nfunction StatusPanel({ address }: { address: string | null | undefined }) {\n const { data: rewards, isLoading } = useRewards(address);\n const { data: config } = useRewardsConfig();\n\n if (!address) {\n return (\n <div className=\"shrink-0 rounded-3xl bg-gradient-to-br from-brand-rose/10 via-brand-orange/[0.06] to-transparent p-6 space-y-3 sm:max-w-xs\">\n <p className=\"text-sm text-foreground/70 font-medium\">Sign in to see your score.</p>\n <SignInButton />\n </div>\n );\n }\n\n if (isLoading || !rewards || !config) {\n return <Skeleton className=\"h-40 w-full sm:w-80 rounded-3xl shrink-0\" />;\n }\n\n const levelXp = config.levels.find((l) => l.level === rewards.currentLevel)?.xpRequired ?? 0;\n const nextLevelXp = rewards.nextLevel?.xpRequired ?? null;\n const hasXp = rewards.totalXp > 0;\n const pct = nextLevelXp ? Math.min(100, Math.round(((rewards.totalXp - levelXp) / (nextLevelXp - levelXp)) * 100)) : 100;\n\n return (\n <div className=\"shrink-0 rounded-3xl bg-gradient-to-br from-brand-rose/10 via-brand-orange/[0.06] to-transparent p-6 sm:min-w-[300px]\">\n <p className=\"text-6xl font-black tabular-nums leading-none tracking-tight\">\n {rewards.totalXp.toLocaleString()}\n </p>\n <p className=\"text-xs font-bold uppercase tracking-widest text-foreground/40 mt-1.5\">XP earned</p>\n\n <div className=\"mt-4 flex items-center gap-2\">\n <LevelBadge level={rewards.currentLevel} name={rewards.currentLevelName} badgeColor={rewards.badgeColor} size=\"md\" />\n </div>\n {!hasXp && (\n <p className=\"text-sm text-foreground/60 font-medium mt-2\">Mint, collect, or complete your profile to start.</p>\n )}\n {rewards.nextLevel && (\n <div className=\"mt-3 space-y-1.5\">\n <div className=\"h-2 w-full rounded-full bg-foreground/[0.08] overflow-hidden\">\n <div\n className=\"h-full rounded-full bg-gradient-to-r from-brand-rose to-brand-orange transition-[width]\"\n style={{ width: `${pct}%` }}\n />\n </div>\n <p className=\"text-sm font-semibold text-foreground/60\">\n {(nextLevelXp! - rewards.totalXp).toLocaleString()} XP to {rewards.nextLevel.name}\n </p>\n </div>\n )}\n </div>\n );\n}\n\nfunction PersonalPanel({ address }: { address: string | null | undefined }) {\n const { data: rewards } = useRewards(address);\n const { data: events } = useRewardsEvents(address, 1, 6);\n const { data: config } = useRewardsConfig();\n\n const actionLabel = (type: string) =>\n config?.actions.find((a) => a.type === type)?.label ?? REWARD_ACTION_LABELS[type] ?? type;\n\n if (!address || !rewards || Object.keys(rewards.breakdown).length === 0) return null;\n\n return (\n <section className=\"space-y-5\">\n <SectionTitle>Your breakdown</SectionTitle>\n <div className=\"divide-y divide-foreground/[0.06]\">\n {Object.entries(rewards.breakdown)\n .sort(([, a], [, b]) => b - a)\n .map(([action, xp]) => (\n <div key={action} className=\"flex items-center justify-between py-3.5\">\n <span className=\"text-base font-medium text-foreground/70\">{actionLabel(action)}</span>\n <span className=\"text-lg font-black tabular-nums\">+{xp.toLocaleString()}</span>\n </div>\n ))}\n </div>\n {events && events.data.length > 0 && (\n <div className=\"divide-y divide-foreground/[0.06]\">\n {events.data.map((e) => (\n <div key={e.id} className=\"flex items-center justify-between py-3.5\">\n <span className=\"text-base font-medium text-foreground/70\">{actionLabel(e.actionType)}</span>\n <span className=\"text-lg font-black tabular-nums text-brand-rose\">+{e.finalXp}</span>\n </div>\n ))}\n </div>\n )}\n </section>\n );\n}\n\nfunction CommunityPanel({ address }: { address: string | null | undefined }) {\n return (\n <section className=\"space-y-5\">\n <div>\n <SectionTitle>Community</SectionTitle>\n <p className=\"text-base text-foreground/60 mt-1.5 font-medium\">Real members already earning XP.</p>\n </div>\n <LeaderboardPanel myAddress={address} showHeading={false} limit={12} />\n </section>\n );\n}\n\nfunction EarnMorePanel() {\n return (\n <section className=\"space-y-6\">\n <SectionTitle>Ways to earn</SectionTitle>\n {EARN_GROUPS.map((group) => (\n <div key={group.title} className=\"space-y-3\">\n <p className={`text-sm font-black uppercase tracking-wide ${group.textClass}`}>{group.title}</p>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 gap-3\">\n {group.items.map(({ label, href, Icon }) => (\n <Link\n key={href + label}\n href={href}\n className=\"group flex flex-col gap-3 rounded-2xl bg-foreground/[0.04] hover:bg-foreground/[0.07] p-4 transition-colors\"\n >\n <span className={`flex h-10 w-10 items-center justify-center rounded-xl text-white shrink-0 ${group.tileClass}`}>\n <Icon className=\"h-5 w-5\" />\n </span>\n <span className=\"text-sm font-bold leading-snug text-foreground\">{label}</span>\n </Link>\n ))}\n </div>\n </div>\n ))}\n </section>\n );\n}\n\nfunction CreatorsFundCard() {\n return (\n <section className=\"relative overflow-hidden rounded-3xl bg-gradient-to-br from-brand-rose to-brand-orange p-8 text-white\">\n <div className=\"pointer-events-none absolute -top-16 -right-16 h-56 w-56 rounded-full bg-white/10 blur-3xl\" />\n <div className=\"pointer-events-none absolute -bottom-20 -left-10 h-56 w-56 rounded-full bg-black/10 blur-3xl\" />\n\n <div className=\"relative space-y-6\">\n <h2 className=\"text-3xl font-black tracking-tight leading-none\">\n Creator&apos;s Fund\n </h2>\n\n <p className=\"text-base font-medium text-white/90 leading-relaxed max-w-sm\">\n A share of what Medialane earns is set aside in one public wallet and airdropped back\n to the people creating and trading here, split by XP.\n </p>\n\n <div className=\"flex flex-wrap items-center gap-4 pt-2\">\n <Link\n href=\"/airdrop\"\n className=\"inline-flex items-center gap-2 rounded-full bg-white px-6 py-3 text-sm font-black text-brand-rose hover:bg-white/90 transition-colors\"\n >\n <Gift className=\"h-4 w-4\" />\n How the fund works\n </Link>\n <a\n href=\"https://medialane.org/creators-fund\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-sm font-bold text-white/90 hover:text-white transition-colors\"\n >\n Watch the wallet\n <ExternalLink className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n </div>\n </section>\n );\n}\n\nfunction BadgesPanel({ address }: { address: string | null | undefined }) {\n const { data: config, isLoading } = useRewardsConfig();\n const { data: rewards } = useRewards(address);\n\n if (isLoading) {\n return (\n <div className=\"grid grid-cols-3 gap-3\">\n {Array.from({ length: 6 }).map((_, i) => (\n <Skeleton key={i} className=\"h-16 rounded-2xl\" />\n ))}\n </div>\n );\n }\n\n if (!config) return null;\n\n const earnedKeys = new Set(rewards?.badges.map((b) => b.key) ?? []);\n\n return (\n <section className=\"space-y-4\">\n <SectionTitle>Badges to earn</SectionTitle>\n <div className=\"grid grid-cols-3 gap-3\">\n {config.badges.map((badge: ApiRewardsBadge) => {\n const isEarned = earnedKeys.has(badge.key);\n const Icon = BADGE_ICONS[badge.icon] ?? Award;\n return (\n <div\n key={badge.key}\n title={badge.description}\n className={`flex flex-col items-center gap-1.5 rounded-2xl p-3 text-center transition-colors ${\n isEarned ? \"bg-brand-blue text-white\" : \"bg-foreground/[0.04] text-foreground/40\"\n }`}\n >\n <Icon className=\"h-5 w-5\" />\n <span className=\"text-xs font-bold leading-tight\">{badge.name}</span>\n </div>\n );\n })}\n </div>\n </section>\n );\n}\n\nfunction SectionTitle({ children }: { children: React.ReactNode }) {\n return <h2 className=\"text-2xl font-black tracking-tight text-foreground\">{children}</h2>;\n}\n\nexport function RewardsDashboard() {\n const { walletAddress: address } = useMedialaneApp();\n const { data: rewards } = useRewards(address);\n const { leveledUpTo, newBadgeKeys, dismiss } = useRewardsCelebrations(address, rewards ?? null);\n\n const unlockedBadges = rewards\n ? newBadgeKeys.map((key) => rewards.badges.find((b) => b.key === key)).filter((b) => b !== undefined)\n : [];\n\n return (\n <div className=\"space-y-14\">\n {unlockedBadges.length > 0 && (\n <div className=\"space-y-3\">\n {unlockedBadges.map((badge) => (\n <BadgeUnlocked key={badge.key} badge={badge} />\n ))}\n </div>\n )}\n\n {leveledUpTo !== null && rewards && (\n <LevelUpCelebration\n level={leveledUpTo}\n name={rewards.currentLevelName}\n badgeColor={rewards.badgeColor}\n onDismiss={dismiss}\n />\n )}\n\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-8\">\n <Hero />\n <StatusPanel address={address} />\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-12 gap-14 items-start\">\n\n <div className=\"lg:col-span-7 space-y-14\">\n <CommunityPanel address={address} />\n <PersonalPanel address={address} />\n </div>\n\n <div className=\"lg:col-span-5 space-y-10\">\n <EarnMorePanel />\n <CreatorsFundCard />\n <BadgesPanel address={address} />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AAsHM,SACY,KADZ;AApHN,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,YAAY,kBAAkB,wBAAwB;AAC/D,SAAS,kBAAkB;AAC3B,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SAAS,wBAAwB;AAEjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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BAAgB;AACnD,QAAM,EAAE,MAAM,QAAQ,IAAI,WAAW,OAAO;AAC5C,QAAM,EAAE,aAAa,cAAc,QAAQ,IAAI,uBAAuB,SAAS,WAAW,IAAI;AAE9F,QAAM,iBAAiB,UACnB,aAAa,IAAI,CAAC,QAAQ,QAAQ,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,MAAM,MAAS,IAClG,CAAC;AAEL,SACE,qBAAC,SAAI,WAAU,cACZ;AAAA,mBAAe,SAAS,KACvB,oBAAC,SAAI,WAAU,aACZ,yBAAe,IAAI,CAAC,UACnB,oBAAC,iBAA8B,SAAX,MAAM,GAAmB,CAC9C,GACH;AAAA,IAGD,gBAAgB,QAAQ,WACvB;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,MAAM,QAAQ;AAAA,QACd,YAAY,QAAQ;AAAA,QACpB,WAAW;AAAA;AAAA,IACb;AAAA,IAGF,qBAAC,SAAI,WAAU,qEACb;AAAA,0BAAC,QAAK;AAAA,MACN,oBAAC,eAAY,SAAkB;AAAA,OACjC;AAAA,IAEA,qBAAC,SAAI,WAAU,uDAEb;AAAA,2BAAC,SAAI,WAAU,4BACb;AAAA,4BAAC,kBAAe,SAAkB;AAAA,QAClC,oBAAC,iBAAc,SAAkB;AAAA,SACnC;AAAA,MAEA,qBAAC,SAAI,WAAU,4BACb;AAAA,4BAAC,iBAAc;AAAA,QACf,oBAAC,oBAAiB;AAAA,QAClB,oBAAC,eAAY,SAAkB;AAAA,SACjC;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/rewards/rewards-dashboard.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { useRewards, useRewardsConfig, useRewardsEvents } from \"../../utils/use-rewards.js\";\nimport { LevelBadge } from \"./level-badge.js\";\nimport { LevelUpCelebration } from \"./level-up-celebration.js\";\nimport { BadgeUnlocked } from \"./badge-unlocked.js\";\nimport { useRewardsCelebrations } from \"./use-rewards-celebrations.js\";\nimport { LeaderboardPanel } from \"./leaderboard-panel.js\";\nimport type { ApiRewardsBadge } from \"@medialane/sdk\";\nimport {\n Gift,\n ExternalLink,\n Palette,\n Layers,\n Tag,\n Handshake,\n ShoppingBag,\n Rocket,\n GitBranch,\n UserRoundCheck,\n Ticket,\n MessageSquare,\n Users,\n type LucideIcon,\n Package,\n CheckCircle2,\n TrendingUp,\n Crown,\n Coins,\n Star,\n Gem,\n Award,\n HandCoins,\n Flame,\n Zap,\n} from \"lucide-react\";\n\nexport const REWARD_ACTION_LABELS: Record<string, string> = {\n complete_profile: \"Complete profile\",\n mint_asset: \"Mint assets\",\n create_collection: \"Create collections\",\n launch_launchpad: \"Launch drops / POPs\",\n create_remix: \"Create remixes\",\n list_asset: \"Sell assets\",\n buy_asset: \"Buy assets\",\n make_offer: \"Make offers\",\n counter_offer: \"Counter offers\",\n offer_accepted_seller: \"Offers accepted (sold)\",\n offer_accepted_buyer: \"Offers accepted (bought)\",\n claim_pop: \"POP claims\",\n claim_drop: \"Drop claims\",\n comment: \"On-chain comments\",\n create_ticket_collection: \"Ticketed events created\",\n buy_ticket: \"Tickets received\",\n create_club: \"Clubs started\",\n join_club: \"Clubs joined\",\n create_sponsorship_offer: \"Sponsorships opened\",\n place_sponsorship_bid: \"Sponsorship bids\",\n sponsorship_licensed_sponsor: \"Sponsorships secured (sponsor)\",\n sponsorship_licensed_author: \"Sponsorships secured (creator)\",\n launch_coin: \"Creator coins launched\",\n};\n\nconst BADGE_ICONS: Record<string, LucideIcon> = {\n Flame, Package, CheckCircle2, GitBranch, TrendingUp, Layers,\n Ticket, Crown, Coins, Star, Gem, Zap, Award, Users, MessageSquare, HandCoins,\n Handshake,\n};\n\nconst EARN_GROUPS: {\n title: string;\n textClass: string;\n tileClass: string;\n items: { label: string; href: string; Icon: LucideIcon }[];\n}[] = [\n {\n title: \"Create\",\n textClass: \"text-brand-purple\",\n tileClass: \"bg-brand-purple\",\n items: [\n { label: \"Create a collection\", href: \"/launchpad/single-editions/collection\", Icon: Layers },\n { label: \"Mint an asset\", href: \"/launchpad/single-editions\", Icon: Palette },\n { label: \"Launch a drop or POP\", href: \"/launchpad\", Icon: Rocket },\n { label: \"Launch a creator coin\", href: \"/launchpad/coin/create\", Icon: Coins },\n { label: \"Remix existing work\", href: \"/marketplace\", Icon: GitBranch },\n ],\n },\n {\n title: \"Collect\",\n textClass: \"text-brand-blue\",\n tileClass: \"bg-brand-blue\",\n items: [\n { label: \"Collect an asset\", href: \"/marketplace\", Icon: ShoppingBag },\n { label: \"Make an offer\", href: \"/marketplace\", Icon: Handshake },\n { label: \"Sell an asset\", href: \"/portfolio/assets\", Icon: Tag },\n { label: \"Get an event ticket\", href: \"/launchpad\", Icon: Ticket },\n ],\n },\n {\n title: \"Connect\",\n textClass: \"text-brand-rose\",\n tileClass: \"bg-brand-rose\",\n items: [\n { label: \"Start or join a club\", href: \"/launchpad\", Icon: UserRoundCheck },\n { label: \"Open a sponsorship\", href: \"/launchpad\", Icon: Handshake },\n { label: \"Join the conversation\", href: \"/marketplace\", Icon: MessageSquare },\n { label: \"Complete your profile\", href: \"/settings\", Icon: UserRoundCheck },\n ],\n },\n];\n\nfunction Hero() {\n return (\n <section className=\"space-y-5\">\n <h1 className=\"text-5xl sm:text-6xl font-black tracking-tight leading-[1.02]\">\n Community <span className=\"bg-gradient-to-r from-brand-rose to-brand-orange bg-clip-text text-transparent\">Rewards</span>\n </h1>\n <p className=\"text-lg text-foreground/70 max-w-xl leading-relaxed font-medium\">\n Every action earns XP, and active members receive allocations from the\n Creator&apos;s Fund based on how much they participate. Scores and\n badges are recalculated weekly.{\" \"}\n <Link href=\"/journey\" className=\"text-foreground underline underline-offset-2 hover:text-brand-orange transition-colors\">\n See the full system\n </Link>\n .\n </p>\n </section>\n );\n}\n\nfunction SignInButton() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <Button size=\"lg\" className=\"w-full rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n );\n}\n\nfunction StatusPanel({ address }: { address: string | null | undefined }) {\n const { data: rewards, isLoading } = useRewards(address);\n const { data: config } = useRewardsConfig();\n\n if (!address) {\n return (\n <div className=\"shrink-0 rounded-3xl bg-gradient-to-br from-brand-rose/10 via-brand-orange/[0.06] to-transparent p-6 space-y-3 sm:max-w-xs\">\n <p className=\"text-sm text-foreground/70 font-medium\">Sign in to see your score.</p>\n <SignInButton />\n </div>\n );\n }\n\n if (isLoading || !rewards || !config) {\n return <Skeleton className=\"h-40 w-full sm:w-80 rounded-3xl shrink-0\" />;\n }\n\n const levelXp = config.levels.find((l) => l.level === rewards.currentLevel)?.xpRequired ?? 0;\n const nextLevelXp = rewards.nextLevel?.xpRequired ?? null;\n const hasXp = rewards.totalXp > 0;\n const pct = nextLevelXp ? Math.min(100, Math.round(((rewards.totalXp - levelXp) / (nextLevelXp - levelXp)) * 100)) : 100;\n\n return (\n <div className=\"shrink-0 rounded-3xl bg-gradient-to-br from-brand-rose/10 via-brand-orange/[0.06] to-transparent p-6 sm:min-w-[300px]\">\n <p className=\"text-6xl font-black tabular-nums leading-none tracking-tight\">\n {rewards.totalXp.toLocaleString()}\n </p>\n <p className=\"text-xs font-bold uppercase tracking-widest text-foreground/40 mt-1.5\">XP earned</p>\n\n <div className=\"mt-4 flex items-center gap-2\">\n <LevelBadge level={rewards.currentLevel} name={rewards.currentLevelName} badgeColor={rewards.badgeColor} size=\"md\" />\n </div>\n {!hasXp && (\n <p className=\"text-sm text-foreground/60 font-medium mt-2\">Mint, collect, or complete your profile to start.</p>\n )}\n {rewards.nextLevel && (\n <div className=\"mt-3 space-y-1.5\">\n <div className=\"h-2 w-full rounded-full bg-foreground/[0.08] overflow-hidden\">\n <div\n className=\"h-full rounded-full bg-gradient-to-r from-brand-rose to-brand-orange transition-[width]\"\n style={{ width: `${pct}%` }}\n />\n </div>\n <p className=\"text-sm font-semibold text-foreground/60\">\n {(nextLevelXp! - rewards.totalXp).toLocaleString()} XP to {rewards.nextLevel.name}\n </p>\n </div>\n )}\n </div>\n );\n}\n\nfunction PersonalPanel({ address }: { address: string | null | undefined }) {\n const { data: rewards } = useRewards(address);\n const { data: events } = useRewardsEvents(address, 1, 6);\n const { data: config } = useRewardsConfig();\n\n const actionLabel = (type: string) =>\n config?.actions.find((a) => a.type === type)?.label ?? REWARD_ACTION_LABELS[type] ?? type;\n\n if (!address || !rewards || Object.keys(rewards.breakdown).length === 0) return null;\n\n return (\n <section className=\"space-y-5\">\n <SectionTitle>Your breakdown</SectionTitle>\n <div className=\"divide-y divide-foreground/[0.06]\">\n {Object.entries(rewards.breakdown)\n .sort(([, a], [, b]) => b - a)\n .map(([action, xp]) => (\n <div key={action} className=\"flex items-center justify-between py-3.5\">\n <span className=\"text-base font-medium text-foreground/70\">{actionLabel(action)}</span>\n <span className=\"text-lg font-black tabular-nums\">+{xp.toLocaleString()}</span>\n </div>\n ))}\n </div>\n {events && events.data.length > 0 && (\n <div className=\"divide-y divide-foreground/[0.06]\">\n {events.data.map((e) => (\n <div key={e.id} className=\"flex items-center justify-between py-3.5\">\n <span className=\"text-base font-medium text-foreground/70\">{actionLabel(e.actionType)}</span>\n <span className=\"text-lg font-black tabular-nums text-brand-rose\">+{e.finalXp}</span>\n </div>\n ))}\n </div>\n )}\n </section>\n );\n}\n\nfunction CommunityPanel({ address }: { address: string | null | undefined }) {\n return (\n <section className=\"space-y-5\">\n <div>\n <SectionTitle>Community</SectionTitle>\n <p className=\"text-base text-foreground/60 mt-1.5 font-medium\">Real members already earning XP.</p>\n </div>\n <LeaderboardPanel myAddress={address} showHeading={false} limit={12} />\n </section>\n );\n}\n\nfunction EarnMorePanel() {\n return (\n <section className=\"space-y-6\">\n <SectionTitle>Ways to earn</SectionTitle>\n {EARN_GROUPS.map((group) => (\n <div key={group.title} className=\"space-y-3\">\n <p className={`text-sm font-black uppercase tracking-wide ${group.textClass}`}>{group.title}</p>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 gap-3\">\n {group.items.map(({ label, href, Icon }) => (\n <Link\n key={href + label}\n href={href}\n className=\"group flex flex-col gap-3 rounded-2xl bg-foreground/[0.04] hover:bg-foreground/[0.07] p-4 transition-colors\"\n >\n <span className={`flex h-10 w-10 items-center justify-center rounded-xl text-white shrink-0 ${group.tileClass}`}>\n <Icon className=\"h-5 w-5\" />\n </span>\n <span className=\"text-sm font-bold leading-snug text-foreground\">{label}</span>\n </Link>\n ))}\n </div>\n </div>\n ))}\n </section>\n );\n}\n\nfunction CreatorsFundCard() {\n return (\n <section className=\"relative overflow-hidden rounded-3xl bg-gradient-to-br from-brand-rose to-brand-orange p-8 text-white\">\n <div className=\"pointer-events-none absolute -top-16 -right-16 h-56 w-56 rounded-full bg-white/10 blur-3xl\" />\n <div className=\"pointer-events-none absolute -bottom-20 -left-10 h-56 w-56 rounded-full bg-black/10 blur-3xl\" />\n\n <div className=\"relative space-y-6\">\n <h2 className=\"text-3xl font-black tracking-tight leading-none\">\n Creator&apos;s Fund\n </h2>\n\n <p className=\"text-base font-medium text-white/90 leading-relaxed max-w-sm\">\n A share of what Medialane earns is set aside in one public wallet and airdropped back\n to the people creating and trading here, split by XP.\n </p>\n\n <div className=\"flex flex-wrap items-center gap-4 pt-2\">\n <Link\n href=\"/airdrop\"\n className=\"inline-flex items-center gap-2 rounded-full bg-white px-6 py-3 text-sm font-black text-brand-rose hover:bg-white/90 transition-colors\"\n >\n <Gift className=\"h-4 w-4\" />\n How the fund works\n </Link>\n <a\n href=\"https://medialane.org/creators-fund\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-sm font-bold text-white/90 hover:text-white transition-colors\"\n >\n Watch the wallet\n <ExternalLink className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n </div>\n </section>\n );\n}\n\nfunction BadgesPanel({ address }: { address: string | null | undefined }) {\n const { data: config, isLoading } = useRewardsConfig();\n const { data: rewards } = useRewards(address);\n\n if (isLoading) {\n return (\n <div className=\"grid grid-cols-3 gap-3\">\n {Array.from({ length: 6 }).map((_, i) => (\n <Skeleton key={i} className=\"h-16 rounded-2xl\" />\n ))}\n </div>\n );\n }\n\n if (!config) return null;\n\n const earnedKeys = new Set(rewards?.badges.map((b) => b.key) ?? []);\n\n return (\n <section className=\"space-y-4\">\n <SectionTitle>Badges to earn</SectionTitle>\n <div className=\"grid grid-cols-3 gap-3\">\n {config.badges.map((badge: ApiRewardsBadge) => {\n const isEarned = earnedKeys.has(badge.key);\n const Icon = BADGE_ICONS[badge.icon] ?? Award;\n return (\n <div\n key={badge.key}\n title={badge.description}\n className={`flex flex-col items-center gap-1.5 rounded-2xl p-3 text-center transition-colors ${\n isEarned ? \"bg-brand-blue text-white\" : \"bg-foreground/[0.04] text-foreground/40\"\n }`}\n >\n <Icon className=\"h-5 w-5\" />\n <span className=\"text-xs font-bold leading-tight\">{badge.name}</span>\n </div>\n );\n })}\n </div>\n </section>\n );\n}\n\nfunction SectionTitle({ children }: { children: React.ReactNode }) {\n return <h2 className=\"text-2xl font-black tracking-tight text-foreground\">{children}</h2>;\n}\n\nexport function RewardsDashboard() {\n const { walletAddress: address } = useMedialaneApp();\n const { data: rewards } = useRewards(address);\n const { leveledUpTo, newBadgeKeys, dismiss } = useRewardsCelebrations(address, rewards ?? null);\n\n const unlockedBadges = rewards\n ? newBadgeKeys.map((key) => rewards.badges.find((b) => b.key === key)).filter((b) => b !== undefined)\n : [];\n\n return (\n <div className=\"space-y-14\">\n {unlockedBadges.length > 0 && (\n <div className=\"space-y-3\">\n {unlockedBadges.map((badge) => (\n <BadgeUnlocked key={badge.key} badge={badge} />\n ))}\n </div>\n )}\n\n {leveledUpTo !== null && rewards && (\n <LevelUpCelebration\n level={leveledUpTo}\n name={rewards.currentLevelName}\n badgeColor={rewards.badgeColor}\n onDismiss={dismiss}\n />\n )}\n\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-8\">\n <Hero />\n <StatusPanel address={address} />\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-12 gap-14 items-start\">\n\n <div className=\"lg:col-span-7 space-y-14\">\n <CommunityPanel address={address} />\n <PersonalPanel address={address} />\n </div>\n\n <div className=\"lg:col-span-5 space-y-10\">\n <EarnMorePanel />\n <CreatorsFundCard />\n <BadgesPanel address={address} />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AAsHM,SACY,KADZ;AApHN,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,YAAY,kBAAkB,wBAAwB;AAC/D,SAAS,kBAAkB;AAC3B,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SAAS,wBAAwB;AAEjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,uBAA+C;AAAA,EAC1D,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,0BAA0B;AAAA,EAC1B,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,0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,SAAX,MAAM,GAAmB,CAC9C,GACH;AAAA,IAGD,gBAAgB,QAAQ,WACvB;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,MAAM,QAAQ;AAAA,QACd,YAAY,QAAQ;AAAA,QACpB,WAAW;AAAA;AAAA,IACb;AAAA,IAGF,qBAAC,SAAI,WAAU,qEACb;AAAA,0BAAC,QAAK;AAAA,MACN,oBAAC,eAAY,SAAkB;AAAA,OACjC;AAAA,IAEA,qBAAC,SAAI,WAAU,uDAEb;AAAA,2BAAC,SAAI,WAAU,4BACb;AAAA,4BAAC,kBAAe,SAAkB;AAAA,QAClC,oBAAC,iBAAc,SAAkB;AAAA,SACnC;AAAA,MAEA,qBAAC,SAAI,WAAU,4BACb;AAAA,4BAAC,iBAAc;AAAA,QACf,oBAAC,oBAAiB;AAAA,QAClB,oBAAC,eAAY,SAAkB;AAAA,SACjC;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -31,10 +31,7 @@ function isStaleChunkError(error) {
31
31
  `${error.name} ${error.message}`
32
32
  );
33
33
  }
34
- function RouteError({
35
- error,
36
- reset
37
- }) {
34
+ function RouteError({ error }) {
38
35
  (0, import_react.useEffect)(() => {
39
36
  console.error(error);
40
37
  if (isStaleChunkError(error) && !sessionStorage.getItem("ml_chunk_reload")) {
@@ -46,13 +43,12 @@ function RouteError({
46
43
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-14 w-14 rounded-2xl bg-destructive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertTriangle, { className: "h-7 w-7 text-destructive" }) }),
47
44
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
48
45
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-2xl font-bold", children: "Reload to continue" }),
49
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground text-sm max-w-xs", children: "This page is ready to reload." }),
50
46
  error.digest && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-2xs text-muted-foreground/60 tabular-nums", children: [
51
47
  "Error ID: ",
52
48
  error.digest
53
49
  ] })
54
50
  ] }),
55
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { onClick: reset, children: [
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { onClick: () => window.location.reload(), children: [
56
52
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.RefreshCw, { className: "h-4 w-4 mr-2" }),
57
53
  "Reload"
58
54
  ] })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/route-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { Button } from \"./button.js\";\nimport { AlertTriangle, RefreshCw } from \"lucide-react\";\n\nfunction isStaleChunkError(error: Error): boolean {\n return /ChunkLoadError|Loading chunk .* failed|dynamically imported module|Importing a module script failed/i.test(\n `${error.name} ${error.message}`\n );\n}\n\nexport function RouteError({\n error,\n reset,\n}: {\n error: Error & { digest?: string };\n reset: () => void;\n}) {\n useEffect(() => {\n console.error(error);\n\n if (isStaleChunkError(error) && !sessionStorage.getItem(\"ml_chunk_reload\")) {\n sessionStorage.setItem(\"ml_chunk_reload\", \"1\");\n window.location.reload();\n }\n }, [error]);\n\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[60vh] px-4 text-center space-y-6\">\n <div className=\"h-14 w-14 rounded-2xl bg-destructive/10 flex items-center justify-center\">\n <AlertTriangle className=\"h-7 w-7 text-destructive\" />\n </div>\n <div className=\"space-y-2\">\n <h1 className=\"text-2xl font-bold\">Reload to continue</h1>\n <p className=\"text-muted-foreground text-sm max-w-xs\">\n This page is ready to reload.\n </p>\n {error.digest && (\n <p className=\"text-2xs text-muted-foreground/60 tabular-nums\">\n Error ID: {error.digest}\n </p>\n )}\n </div>\n <Button onClick={reset}>\n <RefreshCw className=\"h-4 w-4 mr-2\" />\n Reload\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BQ;AA7BR,mBAA0B;AAC1B,oBAAuB;AACvB,0BAAyC;AAEzC,SAAS,kBAAkB,OAAuB;AAChD,SAAO,uGAAuG;AAAA,IAC5G,GAAG,MAAM,IAAI,IAAI,MAAM,OAAO;AAAA,EAChC;AACF;AAEO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AACF,GAGG;AACD,8BAAU,MAAM;AACd,YAAQ,MAAM,KAAK;AAEnB,QAAI,kBAAkB,KAAK,KAAK,CAAC,eAAe,QAAQ,iBAAiB,GAAG;AAC1E,qBAAe,QAAQ,mBAAmB,GAAG;AAC7C,aAAO,SAAS,OAAO;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SACE,6CAAC,SAAI,WAAU,qFACb;AAAA,gDAAC,SAAI,WAAU,4EACb,sDAAC,qCAAc,WAAU,4BAA2B,GACtD;AAAA,IACA,6CAAC,SAAI,WAAU,aACb;AAAA,kDAAC,QAAG,WAAU,sBAAqB,gCAAkB;AAAA,MACrD,4CAAC,OAAE,WAAU,0CAAyC,2CAEtD;AAAA,MACC,MAAM,UACL,6CAAC,OAAE,WAAU,kDAAiD;AAAA;AAAA,QACjD,MAAM;AAAA,SACnB;AAAA,OAEJ;AAAA,IACA,6CAAC,wBAAO,SAAS,OACf;AAAA,kDAAC,iCAAU,WAAU,gBAAe;AAAA,MAAE;AAAA,OAExC;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/route-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { Button } from \"./button.js\";\nimport { AlertTriangle, RefreshCw } from \"lucide-react\";\n\nfunction isStaleChunkError(error: Error): boolean {\n return /ChunkLoadError|Loading chunk .* failed|dynamically imported module|Importing a module script failed/i.test(\n `${error.name} ${error.message}`\n );\n}\n\nexport function RouteError({ error }: { error: Error & { digest?: string } }) {\n useEffect(() => {\n console.error(error);\n\n if (isStaleChunkError(error) && !sessionStorage.getItem(\"ml_chunk_reload\")) {\n sessionStorage.setItem(\"ml_chunk_reload\", \"1\");\n window.location.reload();\n }\n }, [error]);\n\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[60vh] px-4 text-center space-y-6\">\n <div className=\"h-14 w-14 rounded-2xl bg-destructive/10 flex items-center justify-center\">\n <AlertTriangle className=\"h-7 w-7 text-destructive\" />\n </div>\n <div className=\"space-y-2\">\n <h1 className=\"text-2xl font-bold\">Reload to continue</h1>\n {error.digest && (\n <p className=\"text-2xs text-muted-foreground/60 tabular-nums\">\n Error ID: {error.digest}\n </p>\n )}\n </div>\n <Button onClick={() => window.location.reload()}>\n <RefreshCw className=\"h-4 w-4 mr-2\" />\n Reload\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBQ;AAvBR,mBAA0B;AAC1B,oBAAuB;AACvB,0BAAyC;AAEzC,SAAS,kBAAkB,OAAuB;AAChD,SAAO,uGAAuG;AAAA,IAC5G,GAAG,MAAM,IAAI,IAAI,MAAM,OAAO;AAAA,EAChC;AACF;AAEO,SAAS,WAAW,EAAE,MAAM,GAA2C;AAC5E,8BAAU,MAAM;AACd,YAAQ,MAAM,KAAK;AAEnB,QAAI,kBAAkB,KAAK,KAAK,CAAC,eAAe,QAAQ,iBAAiB,GAAG;AAC1E,qBAAe,QAAQ,mBAAmB,GAAG;AAC7C,aAAO,SAAS,OAAO;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SACE,6CAAC,SAAI,WAAU,qFACb;AAAA,gDAAC,SAAI,WAAU,4EACb,sDAAC,qCAAc,WAAU,4BAA2B,GACtD;AAAA,IACA,6CAAC,SAAI,WAAU,aACb;AAAA,kDAAC,QAAG,WAAU,sBAAqB,gCAAkB;AAAA,MACpD,MAAM,UACL,6CAAC,OAAE,WAAU,kDAAiD;AAAA;AAAA,QACjD,MAAM;AAAA,SACnB;AAAA,OAEJ;AAAA,IACA,6CAAC,wBAAO,SAAS,MAAM,OAAO,SAAS,OAAO,GAC5C;AAAA,kDAAC,iCAAU,WAAU,gBAAe;AAAA,MAAE;AAAA,OAExC;AAAA,KACF;AAEJ;","names":[]}
@@ -1,10 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
- declare function RouteError({ error, reset, }: {
3
+ declare function RouteError({ error }: {
4
4
  error: Error & {
5
5
  digest?: string;
6
6
  };
7
- reset: () => void;
8
7
  }): react_jsx_runtime.JSX.Element;
9
8
 
10
9
  export { RouteError };
@@ -1,10 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
- declare function RouteError({ error, reset, }: {
3
+ declare function RouteError({ error }: {
4
4
  error: Error & {
5
5
  digest?: string;
6
6
  };
7
- reset: () => void;
8
7
  }): react_jsx_runtime.JSX.Element;
9
8
 
10
9
  export { RouteError };
@@ -8,10 +8,7 @@ function isStaleChunkError(error) {
8
8
  `${error.name} ${error.message}`
9
9
  );
10
10
  }
11
- function RouteError({
12
- error,
13
- reset
14
- }) {
11
+ function RouteError({ error }) {
15
12
  useEffect(() => {
16
13
  console.error(error);
17
14
  if (isStaleChunkError(error) && !sessionStorage.getItem("ml_chunk_reload")) {
@@ -23,13 +20,12 @@ function RouteError({
23
20
  /* @__PURE__ */ jsx("div", { className: "h-14 w-14 rounded-2xl bg-destructive/10 flex items-center justify-center", children: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-7 w-7 text-destructive" }) }),
24
21
  /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
25
22
  /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold", children: "Reload to continue" }),
26
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm max-w-xs", children: "This page is ready to reload." }),
27
23
  error.digest && /* @__PURE__ */ jsxs("p", { className: "text-2xs text-muted-foreground/60 tabular-nums", children: [
28
24
  "Error ID: ",
29
25
  error.digest
30
26
  ] })
31
27
  ] }),
32
- /* @__PURE__ */ jsxs(Button, { onClick: reset, children: [
28
+ /* @__PURE__ */ jsxs(Button, { onClick: () => window.location.reload(), children: [
33
29
  /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4 mr-2" }),
34
30
  "Reload"
35
31
  ] })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/route-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { Button } from \"./button.js\";\nimport { AlertTriangle, RefreshCw } from \"lucide-react\";\n\nfunction isStaleChunkError(error: Error): boolean {\n return /ChunkLoadError|Loading chunk .* failed|dynamically imported module|Importing a module script failed/i.test(\n `${error.name} ${error.message}`\n );\n}\n\nexport function RouteError({\n error,\n reset,\n}: {\n error: Error & { digest?: string };\n reset: () => void;\n}) {\n useEffect(() => {\n console.error(error);\n\n if (isStaleChunkError(error) && !sessionStorage.getItem(\"ml_chunk_reload\")) {\n sessionStorage.setItem(\"ml_chunk_reload\", \"1\");\n window.location.reload();\n }\n }, [error]);\n\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[60vh] px-4 text-center space-y-6\">\n <div className=\"h-14 w-14 rounded-2xl bg-destructive/10 flex items-center justify-center\">\n <AlertTriangle className=\"h-7 w-7 text-destructive\" />\n </div>\n <div className=\"space-y-2\">\n <h1 className=\"text-2xl font-bold\">Reload to continue</h1>\n <p className=\"text-muted-foreground text-sm max-w-xs\">\n This page is ready to reload.\n </p>\n {error.digest && (\n <p className=\"text-2xs text-muted-foreground/60 tabular-nums\">\n Error ID: {error.digest}\n </p>\n )}\n </div>\n <Button onClick={reset}>\n <RefreshCw className=\"h-4 w-4 mr-2\" />\n Reload\n </Button>\n </div>\n );\n}\n"],"mappings":";AA+BQ,cAQE,YARF;AA7BR,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,eAAe,iBAAiB;AAEzC,SAAS,kBAAkB,OAAuB;AAChD,SAAO,uGAAuG;AAAA,IAC5G,GAAG,MAAM,IAAI,IAAI,MAAM,OAAO;AAAA,EAChC;AACF;AAEO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AACF,GAGG;AACD,YAAU,MAAM;AACd,YAAQ,MAAM,KAAK;AAEnB,QAAI,kBAAkB,KAAK,KAAK,CAAC,eAAe,QAAQ,iBAAiB,GAAG;AAC1E,qBAAe,QAAQ,mBAAmB,GAAG;AAC7C,aAAO,SAAS,OAAO;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SACE,qBAAC,SAAI,WAAU,qFACb;AAAA,wBAAC,SAAI,WAAU,4EACb,8BAAC,iBAAc,WAAU,4BAA2B,GACtD;AAAA,IACA,qBAAC,SAAI,WAAU,aACb;AAAA,0BAAC,QAAG,WAAU,sBAAqB,gCAAkB;AAAA,MACrD,oBAAC,OAAE,WAAU,0CAAyC,2CAEtD;AAAA,MACC,MAAM,UACL,qBAAC,OAAE,WAAU,kDAAiD;AAAA;AAAA,QACjD,MAAM;AAAA,SACnB;AAAA,OAEJ;AAAA,IACA,qBAAC,UAAO,SAAS,OACf;AAAA,0BAAC,aAAU,WAAU,gBAAe;AAAA,MAAE;AAAA,OAExC;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/route-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { Button } from \"./button.js\";\nimport { AlertTriangle, RefreshCw } from \"lucide-react\";\n\nfunction isStaleChunkError(error: Error): boolean {\n return /ChunkLoadError|Loading chunk .* failed|dynamically imported module|Importing a module script failed/i.test(\n `${error.name} ${error.message}`\n );\n}\n\nexport function RouteError({ error }: { error: Error & { digest?: string } }) {\n useEffect(() => {\n console.error(error);\n\n if (isStaleChunkError(error) && !sessionStorage.getItem(\"ml_chunk_reload\")) {\n sessionStorage.setItem(\"ml_chunk_reload\", \"1\");\n window.location.reload();\n }\n }, [error]);\n\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[60vh] px-4 text-center space-y-6\">\n <div className=\"h-14 w-14 rounded-2xl bg-destructive/10 flex items-center justify-center\">\n <AlertTriangle className=\"h-7 w-7 text-destructive\" />\n </div>\n <div className=\"space-y-2\">\n <h1 className=\"text-2xl font-bold\">Reload to continue</h1>\n {error.digest && (\n <p className=\"text-2xs text-muted-foreground/60 tabular-nums\">\n Error ID: {error.digest}\n </p>\n )}\n </div>\n <Button onClick={() => window.location.reload()}>\n <RefreshCw className=\"h-4 w-4 mr-2\" />\n Reload\n </Button>\n </div>\n );\n}\n"],"mappings":";AAyBQ,cAKE,YALF;AAvBR,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,eAAe,iBAAiB;AAEzC,SAAS,kBAAkB,OAAuB;AAChD,SAAO,uGAAuG;AAAA,IAC5G,GAAG,MAAM,IAAI,IAAI,MAAM,OAAO;AAAA,EAChC;AACF;AAEO,SAAS,WAAW,EAAE,MAAM,GAA2C;AAC5E,YAAU,MAAM;AACd,YAAQ,MAAM,KAAK;AAEnB,QAAI,kBAAkB,KAAK,KAAK,CAAC,eAAe,QAAQ,iBAAiB,GAAG;AAC1E,qBAAe,QAAQ,mBAAmB,GAAG;AAC7C,aAAO,SAAS,OAAO;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SACE,qBAAC,SAAI,WAAU,qFACb;AAAA,wBAAC,SAAI,WAAU,4EACb,8BAAC,iBAAc,WAAU,4BAA2B,GACtD;AAAA,IACA,qBAAC,SAAI,WAAU,aACb;AAAA,0BAAC,QAAG,WAAU,sBAAqB,gCAAkB;AAAA,MACpD,MAAM,UACL,qBAAC,OAAE,WAAU,kDAAiD;AAAA;AAAA,QACjD,MAAM;AAAA,SACnB;AAAA,OAEJ;AAAA,IACA,qBAAC,UAAO,SAAS,MAAM,OAAO,SAAS,OAAO,GAC5C;AAAA,0BAAC,aAAU,WAAU,gBAAe;AAAA,MAAE;AAAA,OAExC;AAAA,KACF;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/ui",
3
- "version": "0.313.0",
3
+ "version": "0.314.0",
4
4
  "description": "Shared UI components for Medialane apps",
5
5
  "type": "module",
6
6
  "sideEffects": false,