@medialane/ui 0.201.10 → 0.203.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/activity-card.cjs +6 -5
- package/dist/components/activity-card.cjs.map +1 -1
- package/dist/components/activity-card.d.cts +1 -2
- package/dist/components/activity-card.d.ts +1 -2
- package/dist/components/activity-card.js +6 -5
- package/dist/components/activity-card.js.map +1 -1
- package/dist/components/activity-row.cjs +7 -7
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.d.cts +1 -3
- package/dist/components/activity-row.d.ts +1 -3
- package/dist/components/activity-row.js +7 -7
- package/dist/components/activity-row.js.map +1 -1
- package/dist/components/activity-ticker.cjs +3 -2
- package/dist/components/activity-ticker.cjs.map +1 -1
- package/dist/components/activity-ticker.js +3 -2
- package/dist/components/activity-ticker.js.map +1 -1
- package/dist/components/activity-timeline-row.cjs +3 -3
- package/dist/components/activity-timeline-row.cjs.map +1 -1
- package/dist/components/activity-timeline-row.d.cts +1 -2
- package/dist/components/activity-timeline-row.d.ts +1 -2
- package/dist/components/activity-timeline-row.js +3 -3
- package/dist/components/activity-timeline-row.js.map +1 -1
- package/dist/components/asset-access-cards.d.cts +1 -0
- package/dist/components/asset-access-cards.d.ts +1 -0
- package/dist/components/asset-card.cjs +3 -2
- package/dist/components/asset-card.cjs.map +1 -1
- package/dist/components/asset-card.js +3 -2
- package/dist/components/asset-card.js.map +1 -1
- package/dist/components/asset-marketplace-panel.d.cts +1 -0
- package/dist/components/asset-marketplace-panel.d.ts +1 -0
- package/dist/components/asset-owners-panel.cjs +2 -1
- package/dist/components/asset-owners-panel.cjs.map +1 -1
- package/dist/components/asset-owners-panel.js +2 -1
- package/dist/components/asset-owners-panel.js.map +1 -1
- package/dist/components/asset-page.cjs +7 -5
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.js +7 -5
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/coin-row.cjs +3 -2
- package/dist/components/coin-row.cjs.map +1 -1
- package/dist/components/coin-row.js +3 -2
- package/dist/components/coin-row.js.map +1 -1
- package/dist/components/collection-card.cjs +3 -2
- package/dist/components/collection-card.cjs.map +1 -1
- package/dist/components/collection-card.js +3 -2
- package/dist/components/collection-card.js.map +1 -1
- package/dist/components/collection-header.cjs +3 -2
- package/dist/components/collection-header.cjs.map +1 -1
- package/dist/components/collection-header.js +3 -2
- package/dist/components/collection-header.js.map +1 -1
- package/dist/components/creation-record.cjs +2 -1
- package/dist/components/creation-record.cjs.map +1 -1
- package/dist/components/creation-record.js +2 -1
- package/dist/components/creation-record.js.map +1 -1
- package/dist/components/creator-chip.cjs +2 -1
- package/dist/components/creator-chip.cjs.map +1 -1
- package/dist/components/creator-chip.js +2 -1
- package/dist/components/creator-chip.js.map +1 -1
- package/dist/components/discover-creators-strip.cjs +3 -2
- package/dist/components/discover-creators-strip.cjs.map +1 -1
- package/dist/components/discover-creators-strip.js +3 -2
- package/dist/components/discover-creators-strip.js.map +1 -1
- package/dist/components/discover-feed-section.cjs +1 -2
- package/dist/components/discover-feed-section.cjs.map +1 -1
- package/dist/components/discover-feed-section.d.cts +1 -3
- package/dist/components/discover-feed-section.d.ts +1 -3
- package/dist/components/discover-feed-section.js +1 -2
- package/dist/components/discover-feed-section.js.map +1 -1
- package/dist/components/drop/drop-card.cjs +3 -2
- package/dist/components/drop/drop-card.cjs.map +1 -1
- package/dist/components/drop/drop-card.js +3 -2
- package/dist/components/drop/drop-card.js.map +1 -1
- package/dist/components/drop/page/drop-page.cjs +4 -3
- package/dist/components/drop/page/drop-page.cjs.map +1 -1
- package/dist/components/drop/page/drop-page.js +4 -3
- package/dist/components/drop/page/drop-page.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +5 -3
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +5 -3
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/featured-carousel.cjs +3 -2
- package/dist/components/featured-carousel.cjs.map +1 -1
- package/dist/components/featured-carousel.js +3 -2
- package/dist/components/featured-carousel.js.map +1 -1
- package/dist/components/hero-slider.cjs +3 -2
- package/dist/components/hero-slider.cjs.map +1 -1
- package/dist/components/hero-slider.js +3 -2
- package/dist/components/hero-slider.js.map +1 -1
- package/dist/components/listing-card.cjs +3 -2
- package/dist/components/listing-card.cjs.map +1 -1
- package/dist/components/listing-card.js +3 -2
- package/dist/components/listing-card.js.map +1 -1
- package/dist/components/make-offer-picker.cjs +3 -2
- package/dist/components/make-offer-picker.cjs.map +1 -1
- package/dist/components/make-offer-picker.js +3 -2
- package/dist/components/make-offer-picker.js.map +1 -1
- package/dist/components/medialane-app.cjs +2 -0
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +6 -1
- package/dist/components/medialane-app.d.ts +6 -1
- package/dist/components/medialane-app.js +1 -0
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/nav-command-menu.cjs +141 -16
- package/dist/components/nav-command-menu.cjs.map +1 -1
- package/dist/components/nav-command-menu.d.cts +4 -2
- package/dist/components/nav-command-menu.d.ts +4 -2
- package/dist/components/nav-command-menu.js +141 -17
- package/dist/components/nav-command-menu.js.map +1 -1
- package/dist/components/portfolio-activity.cjs +1 -3
- package/dist/components/portfolio-activity.cjs.map +1 -1
- package/dist/components/portfolio-activity.js +1 -3
- package/dist/components/portfolio-activity.js.map +1 -1
- package/dist/components/portfolio-assets.cjs +117 -0
- package/dist/components/portfolio-assets.cjs.map +1 -0
- package/dist/components/portfolio-assets.d.cts +19 -0
- package/dist/components/portfolio-assets.d.ts +19 -0
- package/dist/components/portfolio-assets.js +93 -0
- package/dist/components/portfolio-assets.js.map +1 -0
- package/dist/components/portfolio-orders.cjs +205 -0
- package/dist/components/portfolio-orders.cjs.map +1 -0
- package/dist/components/portfolio-orders.d.cts +23 -0
- package/dist/components/portfolio-orders.d.ts +23 -0
- package/dist/components/portfolio-orders.js +171 -0
- package/dist/components/portfolio-orders.js.map +1 -0
- package/dist/components/portfolio-shell.cjs +106 -0
- package/dist/components/portfolio-shell.cjs.map +1 -0
- package/dist/components/portfolio-shell.d.cts +18 -0
- package/dist/components/portfolio-shell.d.ts +18 -0
- package/dist/components/portfolio-shell.js +81 -0
- package/dist/components/portfolio-shell.js.map +1 -0
- package/dist/components/result-thumbnail.cjs +60 -0
- package/dist/components/result-thumbnail.cjs.map +1 -0
- package/dist/components/result-thumbnail.d.cts +9 -0
- package/dist/components/result-thumbnail.d.ts +9 -0
- package/dist/components/result-thumbnail.js +26 -0
- package/dist/components/result-thumbnail.js.map +1 -0
- package/dist/components/router.cjs +6 -2
- package/dist/components/router.cjs.map +1 -1
- package/dist/components/router.d.cts +1 -1
- package/dist/components/router.d.ts +1 -1
- package/dist/components/router.js +4 -2
- package/dist/components/router.js.map +1 -1
- package/dist/components/search-page.cjs +178 -0
- package/dist/components/search-page.cjs.map +1 -0
- package/dist/components/search-page.d.cts +5 -0
- package/dist/components/search-page.d.ts +5 -0
- package/dist/components/search-page.js +144 -0
- package/dist/components/search-page.js.map +1 -0
- package/dist/components/token-card.cjs +3 -2
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +3 -2
- package/dist/components/token-card.js.map +1 -1
- package/dist/data/nav-commands.cjs +85 -0
- package/dist/data/nav-commands.cjs.map +1 -0
- package/dist/data/nav-commands.d.cts +342 -0
- package/dist/data/nav-commands.d.ts +342 -0
- package/dist/data/nav-commands.js +89 -0
- package/dist/data/nav-commands.js.map +1 -0
- package/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/format-activity.cjs +9 -8
- package/dist/utils/format-activity.cjs.map +1 -1
- package/dist/utils/format-activity.d.cts +5 -4
- package/dist/utils/format-activity.d.ts +5 -4
- package/dist/utils/format-activity.js +10 -9
- package/dist/utils/format-activity.js.map +1 -1
- package/dist/utils/ipfs.cjs +6 -1
- package/dist/utils/ipfs.cjs.map +1 -1
- package/dist/utils/ipfs.d.cts +6 -1
- package/dist/utils/ipfs.d.ts +6 -1
- package/dist/utils/ipfs.js +5 -1
- package/dist/utils/ipfs.js.map +1 -1
- package/dist/utils/portfolio-counts.cjs +8 -2
- package/dist/utils/portfolio-counts.cjs.map +1 -1
- package/dist/utils/portfolio-counts.d.cts +9 -3
- package/dist/utils/portfolio-counts.d.ts +9 -3
- package/dist/utils/portfolio-counts.js +8 -2
- package/dist/utils/portfolio-counts.js.map +1 -1
- package/dist/utils/seen-offers.cjs +52 -0
- package/dist/utils/seen-offers.cjs.map +1 -0
- package/dist/utils/seen-offers.d.cts +4 -0
- package/dist/utils/seen-offers.d.ts +4 -0
- package/dist/utils/seen-offers.js +27 -0
- package/dist/utils/seen-offers.js.map +1 -0
- package/dist/utils/token-profile-link.cjs +3 -2
- package/dist/utils/token-profile-link.cjs.map +1 -1
- package/dist/utils/token-profile-link.js +3 -2
- package/dist/utils/token-profile-link.js.map +1 -1
- package/dist/utils/use-image-url.cjs +36 -0
- package/dist/utils/use-image-url.cjs.map +1 -0
- package/dist/utils/use-image-url.d.cts +5 -0
- package/dist/utils/use-image-url.d.ts +5 -0
- package/dist/utils/use-image-url.js +12 -0
- package/dist/utils/use-image-url.js.map +1 -0
- package/dist/utils/use-notifications.cjs +7 -5
- package/dist/utils/use-notifications.cjs.map +1 -1
- package/dist/utils/use-notifications.js +7 -5
- package/dist/utils/use-notifications.js.map +1 -1
- package/dist/utils/use-search.cjs +59 -0
- package/dist/utils/use-search.cjs.map +1 -0
- package/dist/utils/use-search.d.cts +14 -0
- package/dist/utils/use-search.d.ts +14 -0
- package/dist/utils/use-search.js +24 -0
- package/dist/utils/use-search.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\" },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\" },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\" },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\" },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\" },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\" },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders } = useUserOrders(address);\n const { orders: receivedOffers } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const { pendingCount } = useMySponsorshipDealCounts(address);\n\n useEffect(() => {\n if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));\n }, [receivedOffers]);\n\n if (!address) return walletLoading ? <Loading /> : <SignedOut />;\n\n const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: pendingCount });\n const countFor: Record<string, number> = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };\n\n return (\n <div className=\"space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8\">\n <PortfolioHeader\n address={address}\n score={rewards ? { levelName: rewards.currentLevelName, totalXp: rewards.totalXp, href: \"/rewards\" } : null}\n />\n <PortfolioChipFilter\n options={tabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label }))}\n value={pathname ?? \"\"}\n onChange={() => {}}\n showAll={false}\n />\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCI;AAnCJ,mBAA0C;AAC1C,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KACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface PortfolioTab {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
}
|
|
9
|
+
declare const PORTFOLIO_TABS: PortfolioTab[];
|
|
10
|
+
declare function PortfolioShell({ tabs, remixOffers, children }: {
|
|
11
|
+
tabs?: PortfolioTab[];
|
|
12
|
+
remixOffers?: ReadonlyArray<{
|
|
13
|
+
status: string;
|
|
14
|
+
}>;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { PORTFOLIO_TABS, PortfolioShell, type PortfolioTab };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface PortfolioTab {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
}
|
|
9
|
+
declare const PORTFOLIO_TABS: PortfolioTab[];
|
|
10
|
+
declare function PortfolioShell({ tabs, remixOffers, children }: {
|
|
11
|
+
tabs?: PortfolioTab[];
|
|
12
|
+
remixOffers?: ReadonlyArray<{
|
|
13
|
+
status: string;
|
|
14
|
+
}>;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { PORTFOLIO_TABS, PortfolioShell, type PortfolioTab };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { Wallet } from "lucide-react";
|
|
5
|
+
import { usePathname } from "./router.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { Skeleton } from "./skeleton.js";
|
|
8
|
+
import { PortfolioHeader } from "./portfolio-header.js";
|
|
9
|
+
import { PortfolioChipFilter } from "./portfolio-chip-filter.js";
|
|
10
|
+
import { useMedialaneApp } from "./medialane-app.js";
|
|
11
|
+
import { derivePortfolioCounts } from "../utils/portfolio-counts.js";
|
|
12
|
+
import { markOffersAsSeen } from "../utils/seen-offers.js";
|
|
13
|
+
import { useReceivedOffers, useUserOrders } from "../utils/use-orders.js";
|
|
14
|
+
import { useRewards } from "../utils/use-rewards.js";
|
|
15
|
+
import { useMySponsorshipDealCounts } from "../utils/use-sponsorship.js";
|
|
16
|
+
const PORTFOLIO_TABS = [
|
|
17
|
+
{ key: "assets", label: "Assets", href: "/portfolio/assets" },
|
|
18
|
+
{ key: "collections", label: "Collections", href: "/portfolio/collections" },
|
|
19
|
+
{ key: "listings", label: "Listings", href: "/portfolio/listings" },
|
|
20
|
+
{ key: "received", label: "Offers received", href: "/portfolio/received" },
|
|
21
|
+
{ key: "offers", label: "Offers sent", href: "/portfolio/offers" },
|
|
22
|
+
{ key: "counter", label: "Counter-offers", href: "/portfolio/counter-offers" },
|
|
23
|
+
{ key: "licensing", label: "Licensing", href: "/portfolio/licensing" },
|
|
24
|
+
{ key: "sponsorship", label: "Sponsorships", href: "/portfolio/sponsorships" },
|
|
25
|
+
{ key: "activity", label: "Activity", href: "/portfolio/activity" }
|
|
26
|
+
];
|
|
27
|
+
function SignedOut() {
|
|
28
|
+
const { onRequireWallet, connectLabel } = useMedialaneApp();
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center", children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Wallet, { className: "mx-auto h-10 w-10 text-muted-foreground" }),
|
|
31
|
+
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold", children: "Your portfolio" }),
|
|
32
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Sign in to see your assets, listings and offers." }),
|
|
33
|
+
/* @__PURE__ */ jsx(Button, { size: "lg", className: "rounded-full px-7", onClick: onRequireWallet, children: connectLabel ?? "Sign in" })
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
function Loading() {
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8", children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto h-10 w-10 rounded-full" }),
|
|
39
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto h-7 w-56" }),
|
|
40
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto h-4 w-72" })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }) {
|
|
44
|
+
const { walletAddress: address, walletLoading } = useMedialaneApp();
|
|
45
|
+
const pathname = usePathname();
|
|
46
|
+
const { orders } = useUserOrders(address);
|
|
47
|
+
const { orders: receivedOffers } = useReceivedOffers(address);
|
|
48
|
+
const { data: rewards } = useRewards(address);
|
|
49
|
+
const { pendingCount } = useMySponsorshipDealCounts(address);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));
|
|
52
|
+
}, [receivedOffers]);
|
|
53
|
+
if (!address) return walletLoading ? /* @__PURE__ */ jsx(Loading, {}) : /* @__PURE__ */ jsx(SignedOut, {});
|
|
54
|
+
const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: pendingCount });
|
|
55
|
+
const countFor = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };
|
|
56
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
PortfolioHeader,
|
|
59
|
+
{
|
|
60
|
+
address,
|
|
61
|
+
score: rewards ? { levelName: rewards.currentLevelName, totalXp: rewards.totalXp, href: "/rewards" } : null
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
PortfolioChipFilter,
|
|
66
|
+
{
|
|
67
|
+
options: tabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label })),
|
|
68
|
+
value: pathname ?? "",
|
|
69
|
+
onChange: () => {
|
|
70
|
+
},
|
|
71
|
+
showAll: false
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
children
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
PORTFOLIO_TABS,
|
|
79
|
+
PortfolioShell
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=portfolio-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, type ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { usePathname } from \"./router.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PortfolioHeader } from \"./portfolio-header.js\";\nimport { PortfolioChipFilter } from \"./portfolio-chip-filter.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { derivePortfolioCounts } from \"../utils/portfolio-counts.js\";\nimport { markOffersAsSeen } from \"../utils/seen-offers.js\";\nimport { useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\nimport { useRewards } from \"../utils/use-rewards.js\";\nimport { useMySponsorshipDealCounts } from \"../utils/use-sponsorship.js\";\n\nexport interface PortfolioTab {\n key: string;\n label: string;\n href: string;\n}\n\nexport const PORTFOLIO_TABS: PortfolioTab[] = [\n { key: \"assets\", label: \"Assets\", href: \"/portfolio/assets\" },\n { key: \"collections\", label: \"Collections\", href: \"/portfolio/collections\" },\n { key: \"listings\", label: \"Listings\", href: \"/portfolio/listings\" },\n { key: \"received\", label: \"Offers received\", href: \"/portfolio/received\" },\n { key: \"offers\", label: \"Offers sent\", href: \"/portfolio/offers\" },\n { key: \"counter\", label: \"Counter-offers\", href: \"/portfolio/counter-offers\" },\n { key: \"licensing\", label: \"Licensing\", href: \"/portfolio/licensing\" },\n { key: \"sponsorship\", label: \"Sponsorships\", href: \"/portfolio/sponsorships\" },\n { key: \"activity\", label: \"Activity\", href: \"/portfolio/activity\" },\n];\n\nfunction SignedOut() {\n const { onRequireWallet, connectLabel } = useMedialaneApp();\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8 text-center\">\n <Wallet className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h1 className=\"text-2xl font-bold\">Your portfolio</h1>\n <p className=\"text-muted-foreground\">Sign in to see your assets, listings and offers.</p>\n <Button size=\"lg\" className=\"rounded-full px-7\" onClick={onRequireWallet}>\n {connectLabel ?? \"Sign in\"}\n </Button>\n </div>\n );\n}\n\nfunction Loading() {\n return (\n <div className=\"mx-auto max-w-lg space-y-4 px-4 pt-24 pb-8\">\n <Skeleton className=\"mx-auto h-10 w-10 rounded-full\" />\n <Skeleton className=\"mx-auto h-7 w-56\" />\n <Skeleton className=\"mx-auto h-4 w-72\" />\n </div>\n );\n}\n\nexport function PortfolioShell({ tabs = PORTFOLIO_TABS, remixOffers, children }: {\n tabs?: PortfolioTab[];\n remixOffers?: ReadonlyArray<{ status: string }>;\n children: ReactNode;\n}) {\n const { walletAddress: address, walletLoading } = useMedialaneApp();\n const pathname = usePathname();\n const { orders } = useUserOrders(address);\n const { orders: receivedOffers } = useReceivedOffers(address);\n const { data: rewards } = useRewards(address);\n const { pendingCount } = useMySponsorshipDealCounts(address);\n\n useEffect(() => {\n if (receivedOffers.length > 0) markOffersAsSeen(receivedOffers.map((o) => o.orderHash));\n }, [receivedOffers]);\n\n if (!address) return walletLoading ? <Loading /> : <SignedOut />;\n\n const counts = derivePortfolioCounts({ orders, receivedOffers, remixOffers, address, sponsorshipPendingCount: pendingCount });\n const countFor: Record<string, number> = { received: counts.received, counter: counts.counter, licensing: counts.remix, sponsorship: counts.sponsorships };\n\n return (\n <div className=\"space-y-6 px-4 pt-20 pb-8 sm:px-6 lg:px-8\">\n <PortfolioHeader\n address={address}\n score={rewards ? { levelName: rewards.currentLevelName, totalXp: rewards.totalXp, href: \"/rewards\" } : null}\n />\n <PortfolioChipFilter\n options={tabs.map((t) => ({ key: t.key, href: t.href, label: countFor[t.key] ? `${t.label} (${countFor[t.key]})` : t.label }))}\n value={pathname ?? \"\"}\n onChange={() => {}}\n showAll={false}\n />\n {children}\n </div>\n );\n}\n"],"mappings":";AAqCI,SACE,KADF;AAnCJ,SAAS,iBAAiC;AAC1C,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,mBAAmB,qBAAqB;AACjD,SAAS,kBAAkB;AAC3B,SAAS,kCAAkC;AAQpC,MAAM,iBAAiC;AAAA,EAC5C,EAAE,KAAK,UAAU,OAAO,UAAU,MAAM,oBAAoB;AAAA,EAC5D,EAAE,KAAK,eAAe,OAAO,eAAe,MAAM,yBAAyB;AAAA,EAC3E,EAAE,KAAK,YAAY,OAAO,YAAY,MAAM,sBAAsB;AAAA,EAClE,EAAE,KAAK,YAAY,OAAO,mBAAmB,MAAM,sBAAsB;AAAA,EACzE,EAAE,KAAK,UAAU,OAAO,eAAe,MAAM,oBAAoB;AAAA,EACjE,EAAE,KAAK,WAAW,OAAO,kBAAkB,MAAM,4BAA4B;AAAA,EAC7E,EAAE,KAAK,aAAa,OAAO,aAAa,MAAM,uBAAuB;AAAA,EACrE,EAAE,KAAK,eAAe,OA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WAAmC,EAAE,UAAU,OAAO,UAAU,SAAS,OAAO,SAAS,WAAW,OAAO,OAAO,aAAa,OAAO,aAAa;AAEzJ,SACE,qBAAC,SAAI,WAAU,6CACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO,UAAU,EAAE,WAAW,QAAQ,kBAAkB,SAAS,QAAQ,SAAS,MAAM,WAAW,IAAI;AAAA;AAAA,IACzG;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,KAAK,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,OAAO,SAAS,EAAE,GAAG,IAAI,GAAG,EAAE,KAAK,KAAK,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE;AAAA,QAC7H,OAAO,YAAY;AAAA,QACnB,UAAU,MAAM;AAAA,QAAC;AAAA,QACjB,SAAS;AAAA;AAAA,IACX;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 result_thumbnail_exports = {};
|
|
31
|
+
__export(result_thumbnail_exports, {
|
|
32
|
+
ResultThumbnail: () => ResultThumbnail
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(result_thumbnail_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_image = __toESM(require("./image.js"), 1);
|
|
38
|
+
var import_cn = require("../utils/cn.js");
|
|
39
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
40
|
+
function ResultThumbnail({ src, label, round }) {
|
|
41
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
42
|
+
const [failed, setFailed] = (0, import_react.useState)(false);
|
|
43
|
+
const url = src && !failed ? resolveImage(src, { width: 96 }) : null;
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
"span",
|
|
46
|
+
{
|
|
47
|
+
className: (0, import_cn.cn)(
|
|
48
|
+
"relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden bg-muted/50",
|
|
49
|
+
"text-xs font-semibold text-muted-foreground",
|
|
50
|
+
round ? "rounded-full" : "rounded-lg"
|
|
51
|
+
),
|
|
52
|
+
children: url ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: url, alt: "", fill: true, sizes: "32px", className: "object-cover", unoptimized: true, onError: () => setFailed(true) }) : label.replace("@", "").charAt(0).toUpperCase()
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
ResultThumbnail
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=result-thumbnail.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/result-thumbnail.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Image from \"./image.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport function ResultThumbnail({ src, label, round }: { src: string | null; label: string; round?: boolean }) {\n const resolveImage = useImageUrl();\n const [failed, setFailed] = useState(false);\n const url = src && !failed ? resolveImage(src, { width: 96 }) : null;\n return (\n <span\n className={cn(\n \"relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden bg-muted/50\",\n \"text-xs font-semibold text-muted-foreground\",\n round ? \"rounded-full\" : \"rounded-lg\"\n )}\n >\n {url ? (\n <Image src={url} alt=\"\" fill sizes=\"32px\" className=\"object-cover\" unoptimized onError={() => setFailed(true)} />\n ) : (\n label.replace(\"@\", \"\").charAt(0).toUpperCase()\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBQ;AAlBR,mBAAyB;AACzB,mBAAkB;AAClB,gBAAmB;AACnB,2BAA4B;AAErB,SAAS,gBAAgB,EAAE,KAAK,OAAO,MAAM,GAA2D;AAC7G,QAAM,mBAAe,kCAAY;AACjC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,QAAM,MAAM,OAAO,CAAC,SAAS,aAAa,KAAK,EAAE,OAAO,GAAG,CAAC,IAAI;AAChE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,QAAQ,iBAAiB;AAAA,MAC3B;AAAA,MAEC,gBACC,4CAAC,aAAAA,SAAA,EAAM,KAAK,KAAK,KAAI,IAAG,MAAI,MAAC,OAAM,QAAO,WAAU,gBAAe,aAAW,MAAC,SAAS,MAAM,UAAU,IAAI,GAAG,IAE/G,MAAM,QAAQ,KAAK,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY;AAAA;AAAA,EAEjD;AAEJ;","names":["Image"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import Image from "./image.js";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
6
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
7
|
+
function ResultThumbnail({ src, label, round }) {
|
|
8
|
+
const resolveImage = useImageUrl();
|
|
9
|
+
const [failed, setFailed] = useState(false);
|
|
10
|
+
const url = src && !failed ? resolveImage(src, { width: 96 }) : null;
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
className: cn(
|
|
15
|
+
"relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden bg-muted/50",
|
|
16
|
+
"text-xs font-semibold text-muted-foreground",
|
|
17
|
+
round ? "rounded-full" : "rounded-lg"
|
|
18
|
+
),
|
|
19
|
+
children: url ? /* @__PURE__ */ jsx(Image, { src: url, alt: "", fill: true, sizes: "32px", className: "object-cover", unoptimized: true, onError: () => setFailed(true) }) : label.replace("@", "").charAt(0).toUpperCase()
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
ResultThumbnail
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=result-thumbnail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/result-thumbnail.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Image from \"./image.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport function ResultThumbnail({ src, label, round }: { src: string | null; label: string; round?: boolean }) {\n const resolveImage = useImageUrl();\n const [failed, setFailed] = useState(false);\n const url = src && !failed ? resolveImage(src, { width: 96 }) : null;\n return (\n <span\n className={cn(\n \"relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden bg-muted/50\",\n \"text-xs font-semibold text-muted-foreground\",\n round ? \"rounded-full\" : \"rounded-lg\"\n )}\n >\n {url ? (\n <Image src={url} alt=\"\" fill sizes=\"32px\" className=\"object-cover\" unoptimized onError={() => setFailed(true)} />\n ) : (\n label.replace(\"@\", \"\").charAt(0).toUpperCase()\n )}\n </span>\n );\n}\n"],"mappings":";AAoBQ;AAlBR,SAAS,gBAAgB;AACzB,OAAO,WAAW;AAClB,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAErB,SAAS,gBAAgB,EAAE,KAAK,OAAO,MAAM,GAA2D;AAC7G,QAAM,eAAe,YAAY;AACjC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,MAAM,OAAO,CAAC,SAAS,aAAa,KAAK,EAAE,OAAO,GAAG,CAAC,IAAI;AAChE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,QAAQ,iBAAiB;AAAA,MAC3B;AAAA,MAEC,gBACC,oBAAC,SAAM,KAAK,KAAK,KAAI,IAAG,MAAI,MAAC,OAAM,QAAO,WAAU,gBAAe,aAAW,MAAC,SAAS,MAAM,UAAU,IAAI,GAAG,IAE/G,MAAM,QAAQ,KAAK,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY;AAAA;AAAA,EAEjD;AAEJ;","names":[]}
|
|
@@ -18,12 +18,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var router_exports = {};
|
|
20
20
|
__export(router_exports, {
|
|
21
|
-
|
|
21
|
+
usePathname: () => import_navigation.usePathname,
|
|
22
|
+
useRouter: () => import_navigation.useRouter,
|
|
23
|
+
useSearchParams: () => import_navigation.useSearchParams
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(router_exports);
|
|
24
26
|
var import_navigation = require("next/navigation");
|
|
25
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
28
|
0 && (module.exports = {
|
|
27
|
-
|
|
29
|
+
usePathname,
|
|
30
|
+
useRouter,
|
|
31
|
+
useSearchParams
|
|
28
32
|
});
|
|
29
33
|
//# sourceMappingURL=router.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/router.tsx"],"sourcesContent":["export { useRouter } from \"next/navigation\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/components/router.tsx"],"sourcesContent":["export { useRouter, useSearchParams, usePathname } from \"next/navigation\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAwD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useRouter } from 'next/navigation';
|
|
1
|
+
export { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useRouter } from 'next/navigation';
|
|
1
|
+
export { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/router.tsx"],"sourcesContent":["export { useRouter } from \"next/navigation\";\n"],"mappings":"AAAA,SAAS,iBAAiB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/router.tsx"],"sourcesContent":["export { useRouter, useSearchParams, usePathname } from \"next/navigation\";\n"],"mappings":"AAAA,SAAS,WAAW,iBAAiB,mBAAmB;","names":[]}
|
|
@@ -0,0 +1,178 @@
|
|
|
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 search_page_exports = {};
|
|
31
|
+
__export(search_page_exports, {
|
|
32
|
+
SearchPage: () => SearchPage
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(search_page_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_sdk = require("@medialane/sdk");
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
40
|
+
var import_router = require("./router.js");
|
|
41
|
+
var import_input = require("./input.js");
|
|
42
|
+
var import_button = require("./button.js");
|
|
43
|
+
var import_skeleton = require("./skeleton.js");
|
|
44
|
+
var import_page_container = require("./page-container.js");
|
|
45
|
+
var import_asset_card = require("./asset-card.js");
|
|
46
|
+
var import_result_thumbnail = require("./result-thumbnail.js");
|
|
47
|
+
var import_profile_identity = require("../utils/profile-identity.js");
|
|
48
|
+
var import_use_search = require("../utils/use-search.js");
|
|
49
|
+
const INPUT_DEBOUNCE_MS = 350;
|
|
50
|
+
const RESULT_LIMIT = 50;
|
|
51
|
+
const GRID = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4";
|
|
52
|
+
const ROWS = "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2";
|
|
53
|
+
function ResultLink({ href, label, description, thumbnail }) {
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href, className: "flex items-center gap-3 rounded-xl px-3 py-2.5 transition-colors hover:bg-muted/50", children: [
|
|
55
|
+
thumbnail,
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "min-w-0", children: [
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-sm font-medium", children: label }),
|
|
58
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-xs text-muted-foreground", children: description })
|
|
59
|
+
] })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
function Section({ title, count, children }) {
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h2", { className: "text-sm font-semibold", children: [
|
|
65
|
+
title,
|
|
66
|
+
" ",
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "font-normal text-muted-foreground", children: [
|
|
68
|
+
"(",
|
|
69
|
+
count,
|
|
70
|
+
")"
|
|
71
|
+
] })
|
|
72
|
+
] }),
|
|
73
|
+
children
|
|
74
|
+
] });
|
|
75
|
+
}
|
|
76
|
+
function SearchPage() {
|
|
77
|
+
const router = (0, import_router.useRouter)();
|
|
78
|
+
const q = (0, import_router.useSearchParams)()?.get("q") ?? "";
|
|
79
|
+
const [inputValue, setInputValue] = (0, import_react.useState)(q);
|
|
80
|
+
const debounceRef = (0, import_react.useRef)(null);
|
|
81
|
+
const { results, isLoading, error } = (0, import_use_search.useSearch)(q, { limit: RESULT_LIMIT });
|
|
82
|
+
(0, import_react.useEffect)(() => setInputValue(q), [q]);
|
|
83
|
+
(0, import_react.useEffect)(() => () => {
|
|
84
|
+
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
85
|
+
}, []);
|
|
86
|
+
function navigate(value) {
|
|
87
|
+
const v = value.trim();
|
|
88
|
+
router.replace(v ? `/search?q=${encodeURIComponent(v)}` : "/search");
|
|
89
|
+
}
|
|
90
|
+
function handleInputChange(value) {
|
|
91
|
+
setInputValue(value);
|
|
92
|
+
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
93
|
+
debounceRef.current = setTimeout(() => navigate(value), INPUT_DEBOUNCE_MS);
|
|
94
|
+
}
|
|
95
|
+
function handleClear() {
|
|
96
|
+
setInputValue("");
|
|
97
|
+
navigate("");
|
|
98
|
+
}
|
|
99
|
+
const creators = results?.creators ?? [];
|
|
100
|
+
const collections = results?.collections ?? [];
|
|
101
|
+
const tokens = results?.tokens ?? [];
|
|
102
|
+
const total = creators.length + collections.length + tokens.length;
|
|
103
|
+
const showEmpty = Boolean(q.trim()) && !isLoading && (Boolean(error) || results !== null && total === 0);
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_page_container.PageContainer, { className: "box-border max-w-full space-y-8 pt-14 pb-8", children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl font-bold", children: "Search" }),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative max-w-xl", children: [
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Search, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
import_input.Input,
|
|
111
|
+
{
|
|
112
|
+
autoFocus: true,
|
|
113
|
+
className: "h-11 pl-9 pr-10 text-base",
|
|
114
|
+
placeholder: "Search assets, collections, creators\u2026",
|
|
115
|
+
value: inputValue,
|
|
116
|
+
onChange: (e) => handleInputChange(e.target.value)
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
inputValue && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
+
import_button.Button,
|
|
121
|
+
{
|
|
122
|
+
variant: "ghost",
|
|
123
|
+
size: "icon",
|
|
124
|
+
"aria-label": "Clear",
|
|
125
|
+
className: "absolute right-1 top-1/2 h-8 w-8 -translate-y-1/2 text-muted-foreground hover:text-foreground",
|
|
126
|
+
onClick: handleClear,
|
|
127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-4 w-4" })
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }),
|
|
131
|
+
results && total > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: `${total} result${total === 1 ? "" : "s"} for "${q.trim()}"` })
|
|
132
|
+
] }),
|
|
133
|
+
!q.trim() && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "py-24 text-center text-muted-foreground", children: "Type above to search assets, collections and creators." }),
|
|
134
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: GRID, children: Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "aspect-square w-full rounded-xl" }, i)) }),
|
|
135
|
+
showEmpty && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "py-24 text-center font-medium", children: `Nothing here for "${q.trim()}" yet` }),
|
|
136
|
+
!isLoading && total > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
137
|
+
creators.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, { title: "Creators", count: creators.length, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: ROWS, children: creators.map((c) => {
|
|
138
|
+
const { identity, name } = (0, import_profile_identity.profileIdentity)(c);
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
+
ResultLink,
|
|
141
|
+
{
|
|
142
|
+
href: (0, import_sdk.profileHref)({ username: c.username, address: c.walletAddress }),
|
|
143
|
+
label: identity,
|
|
144
|
+
description: name,
|
|
145
|
+
thumbnail: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_result_thumbnail.ResultThumbnail, { src: c.avatarImage, label: identity, round: true })
|
|
146
|
+
},
|
|
147
|
+
c.walletAddress
|
|
148
|
+
);
|
|
149
|
+
}) }) }),
|
|
150
|
+
collections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, { title: "Collections", count: collections.length, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: ROWS, children: collections.map((col) => {
|
|
151
|
+
const label = col.name ?? "Untitled";
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
+
ResultLink,
|
|
154
|
+
{
|
|
155
|
+
href: (0, import_sdk.collectionHref)("STARKNET", col.contractAddress),
|
|
156
|
+
label,
|
|
157
|
+
thumbnail: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_result_thumbnail.ResultThumbnail, { src: col.image, label })
|
|
158
|
+
},
|
|
159
|
+
col.contractAddress
|
|
160
|
+
);
|
|
161
|
+
}) }) }),
|
|
162
|
+
tokens.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, { title: "Assets", count: tokens.length, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: GRID, children: tokens.map((t) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
+
import_asset_card.AssetCard,
|
|
164
|
+
{
|
|
165
|
+
href: (0, import_sdk.assetHref)("STARKNET", t.contractAddress, t.tokenId),
|
|
166
|
+
name: t.name ?? `#${t.tokenId}`,
|
|
167
|
+
image: t.image
|
|
168
|
+
},
|
|
169
|
+
`${t.contractAddress}-${t.tokenId}`
|
|
170
|
+
)) }) })
|
|
171
|
+
] })
|
|
172
|
+
] });
|
|
173
|
+
}
|
|
174
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
175
|
+
0 && (module.exports = {
|
|
176
|
+
SearchPage
|
|
177
|
+
});
|
|
178
|
+
//# sourceMappingURL=search-page.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/search-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { assetHref, collectionHref, profileHref } from \"@medialane/sdk\";\nimport { Search, X } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { useRouter, useSearchParams } from \"./router.js\";\nimport { Input } from \"./input.js\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { AssetCard } from \"./asset-card.js\";\nimport { ResultThumbnail } from \"./result-thumbnail.js\";\nimport { profileIdentity } from \"../utils/profile-identity.js\";\nimport { useSearch } from \"../utils/use-search.js\";\n\nconst INPUT_DEBOUNCE_MS = 350;\nconst RESULT_LIMIT = 50;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\";\nconst ROWS = \"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2\";\n\nfunction ResultLink({ href, label, description, thumbnail }: { href: string; label: string; description?: string | null; thumbnail: React.ReactNode }) {\n return (\n <Link href={href} className=\"flex items-center gap-3 rounded-xl px-3 py-2.5 transition-colors hover:bg-muted/50\">\n {thumbnail}\n <span className=\"min-w-0\">\n <span className=\"block truncate text-sm font-medium\">{label}</span>\n {description && <span className=\"block truncate text-xs text-muted-foreground\">{description}</span>}\n </span>\n </Link>\n );\n}\n\nfunction Section({ title, count, children }: { title: string; count: number; children: React.ReactNode }) {\n return (\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold\">\n {title} <span className=\"font-normal text-muted-foreground\">({count})</span>\n </h2>\n {children}\n </section>\n );\n}\n\nexport function SearchPage() {\n const router = useRouter();\n const q = useSearchParams()?.get(\"q\") ?? \"\";\n const [inputValue, setInputValue] = useState(q);\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const { results, isLoading, error } = useSearch(q, { limit: RESULT_LIMIT });\n\n useEffect(() => setInputValue(q), [q]);\n useEffect(() => () => { if (debounceRef.current) clearTimeout(debounceRef.current); }, []);\n\n function navigate(value: string) {\n const v = value.trim();\n router.replace(v ? `/search?q=${encodeURIComponent(v)}` : \"/search\");\n }\n\n function handleInputChange(value: string) {\n setInputValue(value);\n if (debounceRef.current) clearTimeout(debounceRef.current);\n debounceRef.current = setTimeout(() => navigate(value), INPUT_DEBOUNCE_MS);\n }\n\n function handleClear() {\n setInputValue(\"\");\n navigate(\"\");\n }\n\n const creators = results?.creators ?? [];\n const collections = results?.collections ?? [];\n const tokens = results?.tokens ?? [];\n const total = creators.length + collections.length + tokens.length;\n const showEmpty = Boolean(q.trim()) && !isLoading && (Boolean(error) || (results !== null && total === 0));\n\n return (\n <PageContainer className=\"box-border max-w-full space-y-8 pt-14 pb-8\">\n <div className=\"space-y-4\">\n <h1 className=\"text-3xl font-bold\">Search</h1>\n <div className=\"relative max-w-xl\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <Input\n autoFocus\n className=\"h-11 pl-9 pr-10 text-base\"\n placeholder=\"Search assets, collections, creators…\"\n value={inputValue}\n onChange={(e) => handleInputChange(e.target.value)}\n />\n {inputValue && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Clear\"\n className=\"absolute right-1 top-1/2 h-8 w-8 -translate-y-1/2 text-muted-foreground hover:text-foreground\"\n onClick={handleClear}\n >\n <X className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n {results && total > 0 && (\n <p className=\"text-sm text-muted-foreground\">{`${total} result${total === 1 ? \"\" : \"s\"} for \"${q.trim()}\"`}</p>\n )}\n </div>\n\n {!q.trim() && (\n <p className=\"py-24 text-center text-muted-foreground\">Type above to search assets, collections and creators.</p>\n )}\n\n {isLoading && (\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => <Skeleton key={i} className=\"aspect-square w-full rounded-xl\" />)}\n </div>\n )}\n\n {showEmpty && <p className=\"py-24 text-center font-medium\">{`Nothing here for \"${q.trim()}\" yet`}</p>}\n\n {!isLoading && total > 0 && (\n <>\n {creators.length > 0 && (\n <Section title=\"Creators\" count={creators.length}>\n <div className={ROWS}>\n {creators.map((c) => {\n const { identity, name } = profileIdentity(c);\n return (\n <ResultLink\n key={c.walletAddress}\n href={profileHref({ username: c.username, address: c.walletAddress })}\n label={identity}\n description={name}\n thumbnail={<ResultThumbnail src={c.avatarImage} label={identity} round />}\n />\n );\n })}\n </div>\n </Section>\n )}\n {collections.length > 0 && (\n <Section title=\"Collections\" count={collections.length}>\n <div className={ROWS}>\n {collections.map((col) => {\n const label = col.name ?? \"Untitled\";\n return (\n <ResultLink\n key={col.contractAddress}\n href={collectionHref(\"STARKNET\", col.contractAddress)}\n label={label}\n thumbnail={<ResultThumbnail src={col.image} label={label} />}\n />\n );\n })}\n </div>\n </Section>\n )}\n {tokens.length > 0 && (\n <Section title=\"Assets\" count={tokens.length}>\n <div className={GRID}>\n {tokens.map((t) => (\n <AssetCard\n key={`${t.contractAddress}-${t.tokenId}`}\n href={assetHref(\"STARKNET\", t.contractAddress, t.tokenId)}\n name={t.name ?? `#${t.tokenId}`}\n image={t.image}\n />\n ))}\n </div>\n </Section>\n )}\n </>\n )}\n </PageContainer>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBM;AAvBN,mBAA4C;AAC5C,iBAAuD;AACvD,0BAA0B;AAC1B,kBAAiB;AACjB,oBAA2C;AAC3C,mBAAsB;AACtB,oBAAuB;AACvB,sBAAyB;AACzB,4BAA8B;AAC9B,wBAA0B;AAC1B,8BAAgC;AAChC,8BAAgC;AAChC,wBAA0B;AAE1B,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AACrB,MAAM,OAAO;AACb,MAAM,OAAO;AAEb,SAAS,WAAW,EAAE,MAAM,OAAO,aAAa,UAAU,GAA6F;AACrJ,SACE,6CAAC,YAAAA,SAAA,EAAK,MAAY,WAAU,sFACzB;AAAA;AAAA,IACD,6CAAC,UAAK,WAAU,WACd;AAAA,kDAAC,UAAK,WAAU,sCAAsC,iBAAM;AAAA,MAC3D,eAAe,4CAAC,UAAK,WAAU,gDAAgD,uBAAY;AA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