@medialane/ui 0.236.0 → 0.238.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/account/guardian-recovery-section.cjs +1 -1
- package/dist/components/account/guardian-recovery-section.cjs.map +1 -1
- package/dist/components/account/guardian-recovery-section.js +1 -1
- package/dist/components/account/guardian-recovery-section.js.map +1 -1
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/activities-feed.cjs +1 -1
- package/dist/components/activities-feed.cjs.map +1 -1
- package/dist/components/activities-feed.js +1 -1
- package/dist/components/activities-feed.js.map +1 -1
- package/dist/components/activity-row.cjs +3 -3
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.js +3 -3
- package/dist/components/activity-row.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.js +3 -3
- package/dist/components/activity-timeline-row.js.map +1 -1
- package/dist/components/asset-comments-dialog.cjs +1 -1
- package/dist/components/asset-comments-dialog.cjs.map +1 -1
- package/dist/components/asset-comments-dialog.js +1 -1
- package/dist/components/asset-comments-dialog.js.map +1 -1
- package/dist/components/asset-provenance-tab.cjs +7 -7
- package/dist/components/asset-provenance-tab.cjs.map +1 -1
- package/dist/components/asset-provenance-tab.js +7 -7
- package/dist/components/asset-provenance-tab.js.map +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/collection-filters-dialog.cjs +2 -2
- package/dist/components/collection-filters-dialog.cjs.map +1 -1
- package/dist/components/collection-filters-dialog.js +2 -2
- package/dist/components/collection-filters-dialog.js.map +1 -1
- package/dist/components/creator-page.cjs +1 -1
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.js +1 -1
- package/dist/components/creator-page.js.map +1 -1
- package/dist/components/creators-page.cjs +1 -1
- package/dist/components/creators-page.cjs.map +1 -1
- package/dist/components/creators-page.js +1 -1
- package/dist/components/creators-page.js.map +1 -1
- package/dist/components/discover-community-section.cjs +1 -1
- package/dist/components/discover-community-section.cjs.map +1 -1
- package/dist/components/discover-community-section.js +1 -1
- package/dist/components/discover-community-section.js.map +1 -1
- package/dist/components/drop-countdown.cjs +1 -1
- package/dist/components/drop-countdown.cjs.map +1 -1
- package/dist/components/drop-countdown.js +1 -1
- package/dist/components/drop-countdown.js.map +1 -1
- package/dist/components/drop-item-list.cjs +1 -1
- package/dist/components/drop-item-list.cjs.map +1 -1
- package/dist/components/drop-item-list.js +1 -1
- package/dist/components/drop-item-list.js.map +1 -1
- package/dist/components/floating-comments-button.cjs +1 -1
- package/dist/components/floating-comments-button.cjs.map +1 -1
- package/dist/components/floating-comments-button.js +1 -1
- package/dist/components/floating-comments-button.js.map +1 -1
- package/dist/components/gated-content.cjs +3 -3
- package/dist/components/gated-content.cjs.map +1 -1
- package/dist/components/gated-content.js +3 -3
- package/dist/components/gated-content.js.map +1 -1
- package/dist/components/ip-type-fields.cjs +4 -4
- package/dist/components/ip-type-fields.cjs.map +1 -1
- package/dist/components/ip-type-fields.js +4 -4
- package/dist/components/ip-type-fields.js.map +1 -1
- package/dist/components/launchpad/edition-mint-fields.cjs +308 -0
- package/dist/components/launchpad/edition-mint-fields.cjs.map +1 -0
- package/dist/components/launchpad/edition-mint-fields.d.cts +24 -0
- package/dist/components/launchpad/edition-mint-fields.d.ts +24 -0
- package/dist/components/launchpad/edition-mint-fields.js +274 -0
- package/dist/components/launchpad/edition-mint-fields.js.map +1 -0
- package/dist/components/launchpad/edition-mint-schema.cjs +58 -0
- package/dist/components/launchpad/edition-mint-schema.cjs.map +1 -0
- package/dist/components/launchpad/edition-mint-schema.d.cts +48 -0
- package/dist/components/launchpad/edition-mint-schema.d.ts +48 -0
- package/dist/components/launchpad/edition-mint-schema.js +24 -0
- package/dist/components/launchpad/edition-mint-schema.js.map +1 -0
- package/dist/components/launchpad/edition-mint.cjs +244 -0
- package/dist/components/launchpad/edition-mint.cjs.map +1 -0
- package/dist/components/launchpad/edition-mint.d.cts +9 -0
- package/dist/components/launchpad/edition-mint.d.ts +9 -0
- package/dist/components/launchpad/edition-mint.js +210 -0
- package/dist/components/launchpad/edition-mint.js.map +1 -0
- package/dist/components/make-offer-picker.cjs +1 -1
- package/dist/components/make-offer-picker.cjs.map +1 -1
- package/dist/components/make-offer-picker.js +1 -1
- package/dist/components/make-offer-picker.js.map +1 -1
- package/dist/components/media-wallet/action-button.cjs +1 -1
- package/dist/components/media-wallet/action-button.cjs.map +1 -1
- package/dist/components/media-wallet/action-button.js +1 -1
- package/dist/components/media-wallet/action-button.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-header.cjs +1 -1
- package/dist/components/media-wallet/media-wallet-header.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-header.js +1 -1
- package/dist/components/media-wallet/media-wallet-header.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.cjs +1 -1
- package/dist/components/media-wallet/media-wallet-send.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.js +1 -1
- package/dist/components/media-wallet/media-wallet-send.js.map +1 -1
- package/dist/components/media-wallet/quick-action.cjs +1 -1
- package/dist/components/media-wallet/quick-action.cjs.map +1 -1
- package/dist/components/media-wallet/quick-action.js +1 -1
- package/dist/components/media-wallet/quick-action.js.map +1 -1
- package/dist/components/medialane-collection-card.cjs +1 -1
- package/dist/components/medialane-collection-card.cjs.map +1 -1
- package/dist/components/medialane-collection-card.js +1 -1
- package/dist/components/medialane-collection-card.js.map +1 -1
- package/dist/components/notification-row.cjs +1 -1
- package/dist/components/notification-row.cjs.map +1 -1
- package/dist/components/notification-row.js +1 -1
- package/dist/components/notification-row.js.map +1 -1
- package/dist/components/portfolio-activity.cjs +1 -1
- package/dist/components/portfolio-activity.cjs.map +1 -1
- package/dist/components/portfolio-activity.js +1 -1
- package/dist/components/portfolio-activity.js.map +1 -1
- package/dist/components/portfolio-orders.cjs +1 -1
- package/dist/components/portfolio-orders.cjs.map +1 -1
- package/dist/components/portfolio-orders.js +1 -1
- package/dist/components/portfolio-orders.js.map +1 -1
- package/dist/components/remixes-tab.cjs +3 -3
- package/dist/components/remixes-tab.cjs.map +1 -1
- package/dist/components/remixes-tab.js +3 -3
- package/dist/components/remixes-tab.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/activity-timeline-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport {\n Tag, Handshake, TrendingUp, ArrowRightLeft, Sparkles,\n} from \"lucide-react\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { assetHref, type ApiActivity } from \"@medialane/sdk\";\nimport { cn } from \"../utils/cn.js\";\n\n\nconst ACTIVITY_META: Record<string, { label: string; textColor: string; bg: string }> = {\n mint: { label: \"Minted\", textColor: \"text-yellow-400\", bg: \"bg-yellow-500/8 border-yellow-500/15\" },\n listing: { label: \"Listed\", textColor: \"text-violet-400\", bg: \"bg-violet-500/8 border-violet-500/15\" },\n sale: { label: \"Sold\", textColor: \"text-emerald-400\", bg: \"bg-emerald-500/8 border-emerald-500/15\" },\n offer: { label: \"Offer\", textColor: \"text-amber-400\", bg: \"bg-amber-500/8 border-amber-500/15\" },\n transfer: { label: \"Transfer\", textColor: \"text-blue-400\", bg: \"bg-blue-500/8 border-blue-500/15\" },\n cancelled: { label: \"Cancelled\", textColor: \"text-muted-foreground\", bg: \"bg-muted/30 border-border\" },\n};\n\nconst ACTIVITY_ICONS: Record<string, React.ElementType> = {\n mint: Sparkles,\n listing: Tag,\n sale: Handshake,\n offer: TrendingUp,\n transfer: ArrowRightLeft,\n cancelled: ArrowRightLeft,\n};\n\nexport interface ActivityTimelineRowProps {\n event: ApiActivity;\n isLast: boolean;\n}\n\nexport function ActivityTimelineRow({\n event,\n isLast,\n}: ActivityTimelineRowProps) {\n const meta = ACTIVITY_META[event.type] ?? ACTIVITY_META.transfer;\n const Icon = ACTIVITY_ICONS[event.type] ?? ArrowRightLeft;\n const tokenId = event.nftTokenId ?? event.tokenId;\n const contract = event.nftContract ?? event.contractAddress;\n\n return (\n <div className=\"flex gap-4 group\">\n <div className=\"flex flex-col items-center shrink-0 w-9\">\n <div className={cn(\"h-9 w-9 rounded-xl border flex items-center justify-center shrink-0\", meta.bg)}>\n <Icon className={cn(\"h-3.5 w-3.5\", meta.textColor)} />\n </div>\n {!isLast && <div className=\"flex-1 w-px bg-border/50 mt-1.5 min-h-4\" />}\n </div>\n <div className=\"flex-1 pb-5 min-w-0 pt-1\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={cn(\"text-
|
|
1
|
+
{"version":3,"sources":["../../src/components/activity-timeline-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport {\n Tag, Handshake, TrendingUp, ArrowRightLeft, Sparkles,\n} from \"lucide-react\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { assetHref, type ApiActivity } from \"@medialane/sdk\";\nimport { cn } from \"../utils/cn.js\";\n\n\nconst ACTIVITY_META: Record<string, { label: string; textColor: string; bg: string }> = {\n mint: { label: \"Minted\", textColor: \"text-yellow-400\", bg: \"bg-yellow-500/8 border-yellow-500/15\" },\n listing: { label: \"Listed\", textColor: \"text-violet-400\", bg: \"bg-violet-500/8 border-violet-500/15\" },\n sale: { label: \"Sold\", textColor: \"text-emerald-400\", bg: \"bg-emerald-500/8 border-emerald-500/15\" },\n offer: { label: \"Offer\", textColor: \"text-amber-400\", bg: \"bg-amber-500/8 border-amber-500/15\" },\n transfer: { label: \"Transfer\", textColor: \"text-blue-400\", bg: \"bg-blue-500/8 border-blue-500/15\" },\n cancelled: { label: \"Cancelled\", textColor: \"text-muted-foreground\", bg: \"bg-muted/30 border-border\" },\n};\n\nconst ACTIVITY_ICONS: Record<string, React.ElementType> = {\n mint: Sparkles,\n listing: Tag,\n sale: Handshake,\n offer: TrendingUp,\n transfer: ArrowRightLeft,\n cancelled: ArrowRightLeft,\n};\n\nexport interface ActivityTimelineRowProps {\n event: ApiActivity;\n isLast: boolean;\n}\n\nexport function ActivityTimelineRow({\n event,\n isLast,\n}: ActivityTimelineRowProps) {\n const meta = ACTIVITY_META[event.type] ?? ACTIVITY_META.transfer;\n const Icon = ACTIVITY_ICONS[event.type] ?? ArrowRightLeft;\n const tokenId = event.nftTokenId ?? event.tokenId;\n const contract = event.nftContract ?? event.contractAddress;\n\n return (\n <div className=\"flex gap-4 group\">\n <div className=\"flex flex-col items-center shrink-0 w-9\">\n <div className={cn(\"h-9 w-9 rounded-xl border flex items-center justify-center shrink-0\", meta.bg)}>\n <Icon className={cn(\"h-3.5 w-3.5\", meta.textColor)} />\n </div>\n {!isLast && <div className=\"flex-1 w-px bg-border/50 mt-1.5 min-h-4\" />}\n </div>\n <div className=\"flex-1 pb-5 min-w-0 pt-1\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={cn(\"text-2xs font-bold\", meta.textColor)}>\n {meta.label}\n </span>\n {contract && tokenId && (\n <Link href={assetHref(event.chain ?? \"STARKNET\", contract, tokenId)} className=\"text-xs text-muted-foreground hover:text-foreground transition-colors\">\n View asset\n </Link>\n )}\n </div>\n {contract && (\n <p className=\"text-2xs text-muted-foreground/60 tabular-nums mt-0.5 truncate\">\n {contract.slice(0, 10)}…{contract.slice(-6)}\n </p>\n )}\n </div>\n <div className=\"text-right shrink-0\">\n {event.price?.formatted && (\n <p className=\"text-sm font-semibold price-value leading-none\">\n {formatDisplayPrice(event.price.formatted)}\n </p>\n )}\n <p className=\"text-2xs text-muted-foreground mt-1\">{timeAgo(event.timestamp)}</p>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AA8CM,SAEI,KAFJ;AA5CN,OAAO,UAAU;AACjB;AAAA,EACE;AAAA,EAAK;AAAA,EAAW;AAAA,EAAY;AAAA,EAAgB;AAAA,OACvC;AACP,SAAS,eAAe;AACxB,SAAS,0BAA0B;AACnC,SAAS,iBAAmC;AAC5C,SAAS,UAAU;AAGnB,MAAM,gBAAkF;AAAA,EACtF,MAAW,EAAE,OAAO,UAAa,WAAW,mBAAoB,IAAI,uCAAuC;AAAA,EAC3G,SAAW,EAAE,OAAO,UAAa,WAAW,mBAAoB,IAAI,uCAAuC;AAAA,EAC3G,MAAW,EAAE,OAAO,QAAa,WAAW,oBAAoB,IAAI,yCAAyC;AAAA,EAC7G,OAAW,EAAE,OAAO,SAAa,WAAW,kBAAoB,IAAI,qCAAqC;AAAA,EACzG,UAAW,EAAE,OAAO,YAAa,WAAW,iBAAoB,IAAI,mCAAmC;AAAA,EACvG,WAAW,EAAE,OAAO,aAAa,WAAW,yBAAyB,IAAI,4BAA4B;AACvG;AAEA,MAAM,iBAAoD;AAAA,EACxD,MAAW;AAAA,EACX,SAAW;AAAA,EACX,MAAW;AAAA,EACX,OAAW;AAAA,EACX,UAAW;AAAA,EACX,WAAW;AACb;AAOO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAA6B;AAC3B,QAAM,OAAO,cAAc,MAAM,IAAI,KAAK,cAAc;AACxD,QAAM,OAAO,eAAe,MAAM,IAAI,KAAK;AAC3C,QAAM,UAAU,MAAM,cAAc,MAAM;AAC1C,QAAM,WAAW,MAAM,eAAe,MAAM;AAE5C,SACE,qBAAC,SAAI,WAAU,oBACb;AAAA,yBAAC,SAAI,WAAU,2CACb;AAAA,0BAAC,SAAI,WAAW,GAAG,uEAAuE,KAAK,EAAE,GAC/F,8BAAC,QAAK,WAAW,GAAG,eAAe,KAAK,SAAS,GAAG,GACtD;AAAA,MACC,CAAC,UAAU,oBAAC,SAAI,WAAU,2CAA0C;AAAA,OACvE;AAAA,IACA,oBAAC,SAAI,WAAU,4BACb,+BAAC,SAAI,WAAU,0CACb;AAAA,2BAAC,SAAI,WAAU,WACb;AAAA,6BAAC,SAAI,WAAU,qCACb;AAAA,8BAAC,UAAK,WAAW,GAAG,sBAAsB,KAAK,SAAS,GACrD,eAAK,OACR;AAAA,UACC,YAAY,WACX,oBAAC,QAAK,MAAM,UAAU,MAAM,SAAS,YAAY,UAAU,OAAO,GAAG,WAAU,yEAAwE,wBAEvJ;AAAA,WAEJ;AAAA,QACC,YACC,qBAAC,OAAE,WAAU,kEACV;AAAA,mBAAS,MAAM,GAAG,EAAE;AAAA,UAAE;AAAA,UAAE,SAAS,MAAM,EAAE;AAAA,WAC5C;AAAA,SAEJ;AAAA,MACA,qBAAC,SAAI,WAAU,uBACZ;AAAA,cAAM,OAAO,aACZ,oBAAC,OAAE,WAAU,kDACV,6BAAmB,MAAM,MAAM,SAAS,GAC3C;AAAA,QAEF,oBAAC,OAAE,WAAU,uCAAuC,kBAAQ,MAAM,SAAS,GAAE;AAAA,SAC/E;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -59,7 +59,7 @@ function AssetCommentsDialog({
|
|
|
59
59
|
children: [
|
|
60
60
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-9 w-9 rounded-full overflow-hidden shrink-0 ring-2 ring-white/20", style: { background: accentAvatarStyle }, children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: imageUrl, alt: name, fill: true, className: "object-cover", unoptimized: true }) : null }),
|
|
61
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
62
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: `text-
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: `text-2xs font-medium ${accentLabelClassName ?? ""}`, children: "Comments" }) }),
|
|
63
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold truncate text-foreground", children: name })
|
|
64
64
|
] }),
|
|
65
65
|
commentTotal > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0 text-xs font-bold rounded-full px-2 py-0.5 text-white", style: accentCountStyle, children: commentTotal }) : null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-comments-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentType, CSSProperties } from \"react\";\nimport Image from \"./image.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetCommentsProps {\n contract: string;\n tokenId: string;\n className?: string;\n}\n\nexport interface AssetCommentsDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n contract: string;\n tokenId: string;\n name: string;\n imageUrl?: string | null;\n commentTotal: number;\n Comments: ComponentType<AssetCommentsProps>;\n accentBorderClassName: string;\n accentHeaderStyle: string;\n accentAvatarStyle: string;\n accentLabelClassName?: string;\n accentCountStyle?: CSSProperties;\n}\n\nexport function AssetCommentsDialog({\n open,\n onOpenChange,\n contract,\n tokenId,\n name,\n imageUrl,\n commentTotal,\n Comments,\n accentBorderClassName,\n accentHeaderStyle,\n accentAvatarStyle,\n accentLabelClassName,\n accentCountStyle,\n}: AssetCommentsDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"w-full max-w-md p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n <div\n className={`flex items-center gap-3 pr-10 pl-4 pt-4 pb-3 shrink-0 border-b ${accentBorderClassName}`}\n style={{ background: accentHeaderStyle }}\n >\n <div className=\"relative h-9 w-9 rounded-full overflow-hidden shrink-0 ring-2 ring-white/20\" style={{ background: accentAvatarStyle }}>\n {imageUrl ? <Image src={imageUrl} alt={name} fill className=\"object-cover\" unoptimized /> : null}\n </div>\n <div className=\"min-w-0 flex-1\">\n <DialogTitle asChild>\n <p className={`text-
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-comments-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentType, CSSProperties } from \"react\";\nimport Image from \"./image.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetCommentsProps {\n contract: string;\n tokenId: string;\n className?: string;\n}\n\nexport interface AssetCommentsDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n contract: string;\n tokenId: string;\n name: string;\n imageUrl?: string | null;\n commentTotal: number;\n Comments: ComponentType<AssetCommentsProps>;\n accentBorderClassName: string;\n accentHeaderStyle: string;\n accentAvatarStyle: string;\n accentLabelClassName?: string;\n accentCountStyle?: CSSProperties;\n}\n\nexport function AssetCommentsDialog({\n open,\n onOpenChange,\n contract,\n tokenId,\n name,\n imageUrl,\n commentTotal,\n Comments,\n accentBorderClassName,\n accentHeaderStyle,\n accentAvatarStyle,\n accentLabelClassName,\n accentCountStyle,\n}: AssetCommentsDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"w-full max-w-md p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n <div\n className={`flex items-center gap-3 pr-10 pl-4 pt-4 pb-3 shrink-0 border-b ${accentBorderClassName}`}\n style={{ background: accentHeaderStyle }}\n >\n <div className=\"relative h-9 w-9 rounded-full overflow-hidden shrink-0 ring-2 ring-white/20\" style={{ background: accentAvatarStyle }}>\n {imageUrl ? <Image src={imageUrl} alt={name} fill className=\"object-cover\" unoptimized /> : null}\n </div>\n <div className=\"min-w-0 flex-1\">\n <DialogTitle asChild>\n <p className={`text-2xs font-medium ${accentLabelClassName ?? \"\"}`}>Comments</p>\n </DialogTitle>\n <p className=\"text-sm font-semibold truncate text-foreground\">{name}</p>\n </div>\n {commentTotal > 0 ? (\n <span className=\"shrink-0 text-xs font-bold rounded-full px-2 py-0.5 text-white\" style={accentCountStyle}>\n {commentTotal}\n </span>\n ) : null}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <Comments contract={contract} tokenId={tokenId} className=\"h-full rounded-none border-0\" />\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDwB;AAhDxB,mBAAkB;AAClB,oBAAmD;AAwB5C,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA6B;AAC3B,SACE,4CAAC,wBAAO,MAAY,cAClB,uDAAC,+BAAc,WAAU,yEACvB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,kEAAkE,qBAAqB;AAAA,QAClG,OAAO,EAAE,YAAY,kBAAkB;AAAA,QAEvC;AAAA,sDAAC,SAAI,WAAU,+EAA8E,OAAO,EAAE,YAAY,kBAAkB,GACjI,qBAAW,4CAAC,aAAAA,SAAA,EAAM,KAAK,UAAU,KAAK,MAAM,MAAI,MAAC,WAAU,gBAAe,aAAW,MAAC,IAAK,MAC9F;AAAA,UACA,6CAAC,SAAI,WAAU,kBACb;AAAA,wDAAC,6BAAY,SAAO,MAClB,sDAAC,OAAE,WAAW,wBAAwB,wBAAwB,EAAE,IAAI,sBAAQ,GAC9E;AAAA,YACA,4CAAC,OAAE,WAAU,kDAAkD,gBAAK;AAAA,aACtE;AAAA,UACC,eAAe,IACd,4CAAC,UAAK,WAAU,kEAAiE,OAAO,kBACrF,wBACH,IACE;AAAA;AAAA;AAAA,IACN;AAAA,IACA,4CAAC,SAAI,WAAU,0BACb,sDAAC,YAAS,UAAoB,SAAkB,WAAU,gCAA+B,GAC3F;AAAA,KACF,GACF;AAEJ;","names":["Image"]}
|
|
@@ -26,7 +26,7 @@ function AssetCommentsDialog({
|
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ jsx("div", { className: "relative h-9 w-9 rounded-full overflow-hidden shrink-0 ring-2 ring-white/20", style: { background: accentAvatarStyle }, children: imageUrl ? /* @__PURE__ */ jsx(Image, { src: imageUrl, alt: name, fill: true, className: "object-cover", unoptimized: true }) : null }),
|
|
28
28
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
29
|
-
/* @__PURE__ */ jsx(DialogTitle, { asChild: true, children: /* @__PURE__ */ jsx("p", { className: `text-
|
|
29
|
+
/* @__PURE__ */ jsx(DialogTitle, { asChild: true, children: /* @__PURE__ */ jsx("p", { className: `text-2xs font-medium ${accentLabelClassName ?? ""}`, children: "Comments" }) }),
|
|
30
30
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold truncate text-foreground", children: name })
|
|
31
31
|
] }),
|
|
32
32
|
commentTotal > 0 ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs font-bold rounded-full px-2 py-0.5 text-white", style: accentCountStyle, children: commentTotal }) : null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-comments-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentType, CSSProperties } from \"react\";\nimport Image from \"./image.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetCommentsProps {\n contract: string;\n tokenId: string;\n className?: string;\n}\n\nexport interface AssetCommentsDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n contract: string;\n tokenId: string;\n name: string;\n imageUrl?: string | null;\n commentTotal: number;\n Comments: ComponentType<AssetCommentsProps>;\n accentBorderClassName: string;\n accentHeaderStyle: string;\n accentAvatarStyle: string;\n accentLabelClassName?: string;\n accentCountStyle?: CSSProperties;\n}\n\nexport function AssetCommentsDialog({\n open,\n onOpenChange,\n contract,\n tokenId,\n name,\n imageUrl,\n commentTotal,\n Comments,\n accentBorderClassName,\n accentHeaderStyle,\n accentAvatarStyle,\n accentLabelClassName,\n accentCountStyle,\n}: AssetCommentsDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"w-full max-w-md p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n <div\n className={`flex items-center gap-3 pr-10 pl-4 pt-4 pb-3 shrink-0 border-b ${accentBorderClassName}`}\n style={{ background: accentHeaderStyle }}\n >\n <div className=\"relative h-9 w-9 rounded-full overflow-hidden shrink-0 ring-2 ring-white/20\" style={{ background: accentAvatarStyle }}>\n {imageUrl ? <Image src={imageUrl} alt={name} fill className=\"object-cover\" unoptimized /> : null}\n </div>\n <div className=\"min-w-0 flex-1\">\n <DialogTitle asChild>\n <p className={`text-
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-comments-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentType, CSSProperties } from \"react\";\nimport Image from \"./image.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetCommentsProps {\n contract: string;\n tokenId: string;\n className?: string;\n}\n\nexport interface AssetCommentsDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n contract: string;\n tokenId: string;\n name: string;\n imageUrl?: string | null;\n commentTotal: number;\n Comments: ComponentType<AssetCommentsProps>;\n accentBorderClassName: string;\n accentHeaderStyle: string;\n accentAvatarStyle: string;\n accentLabelClassName?: string;\n accentCountStyle?: CSSProperties;\n}\n\nexport function AssetCommentsDialog({\n open,\n onOpenChange,\n contract,\n tokenId,\n name,\n imageUrl,\n commentTotal,\n Comments,\n accentBorderClassName,\n accentHeaderStyle,\n accentAvatarStyle,\n accentLabelClassName,\n accentCountStyle,\n}: AssetCommentsDialogProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"w-full max-w-md p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n <div\n className={`flex items-center gap-3 pr-10 pl-4 pt-4 pb-3 shrink-0 border-b ${accentBorderClassName}`}\n style={{ background: accentHeaderStyle }}\n >\n <div className=\"relative h-9 w-9 rounded-full overflow-hidden shrink-0 ring-2 ring-white/20\" style={{ background: accentAvatarStyle }}>\n {imageUrl ? <Image src={imageUrl} alt={name} fill className=\"object-cover\" unoptimized /> : null}\n </div>\n <div className=\"min-w-0 flex-1\">\n <DialogTitle asChild>\n <p className={`text-2xs font-medium ${accentLabelClassName ?? \"\"}`}>Comments</p>\n </DialogTitle>\n <p className=\"text-sm font-semibold truncate text-foreground\">{name}</p>\n </div>\n {commentTotal > 0 ? (\n <span className=\"shrink-0 text-xs font-bold rounded-full px-2 py-0.5 text-white\" style={accentCountStyle}>\n {commentTotal}\n </span>\n ) : null}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <Comments contract={contract} tokenId={tokenId} className=\"h-full rounded-none border-0\" />\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAmDwB,cAEd,YAFc;AAhDxB,OAAO,WAAW;AAClB,SAAS,QAAQ,eAAe,mBAAmB;AAwB5C,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA6B;AAC3B,SACE,oBAAC,UAAO,MAAY,cAClB,+BAAC,iBAAc,WAAU,yEACvB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,kEAAkE,qBAAqB;AAAA,QAClG,OAAO,EAAE,YAAY,kBAAkB;AAAA,QAEvC;AAAA,8BAAC,SAAI,WAAU,+EAA8E,OAAO,EAAE,YAAY,kBAAkB,GACjI,qBAAW,oBAAC,SAAM,KAAK,UAAU,KAAK,MAAM,MAAI,MAAC,WAAU,gBAAe,aAAW,MAAC,IAAK,MAC9F;AAAA,UACA,qBAAC,SAAI,WAAU,kBACb;AAAA,gCAAC,eAAY,SAAO,MAClB,8BAAC,OAAE,WAAW,wBAAwB,wBAAwB,EAAE,IAAI,sBAAQ,GAC9E;AAAA,YACA,oBAAC,OAAE,WAAU,kDAAkD,gBAAK;AAAA,aACtE;AAAA,UACC,eAAe,IACd,oBAAC,UAAK,WAAU,kEAAiE,OAAO,kBACrF,wBACH,IACE;AAAA;AAAA;AAAA,IACN;AAAA,IACA,oBAAC,SAAI,WAAU,0BACb,8BAAC,YAAS,UAAoB,SAAkB,WAAU,gCAA+B,GAC3F;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -92,7 +92,7 @@ function AssetProvenanceTab({
|
|
|
92
92
|
href: `${import_explorer_url.EXPLORER_URL}/contract/${contract}`,
|
|
93
93
|
target: "_blank",
|
|
94
94
|
rel: "noopener noreferrer",
|
|
95
|
-
className: "shrink-0 flex items-center gap-1 text-
|
|
95
|
+
className: "shrink-0 flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors ml-auto",
|
|
96
96
|
children: [
|
|
97
97
|
"Contract ",
|
|
98
98
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ExternalLink, { className: "h-3 w-3" })
|
|
@@ -105,12 +105,12 @@ function AssetProvenanceTab({
|
|
|
105
105
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
106
106
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Activity, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
107
107
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-lg font-bold", children: history.length }),
|
|
108
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground", children: "Events" })
|
|
109
109
|
] }),
|
|
110
110
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
111
111
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShoppingCart, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
112
112
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-lg font-bold", children: sales.length }),
|
|
113
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground", children: "Sales" })
|
|
114
114
|
] }),
|
|
115
115
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
116
116
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TrendingUp, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
@@ -119,12 +119,12 @@ function AssetProvenanceTab({
|
|
|
119
119
|
" ",
|
|
120
120
|
v.currency
|
|
121
121
|
] }, v.currency)) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-lg font-bold", children: "\u2014" }),
|
|
122
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground", children: "Volume" })
|
|
123
123
|
] }),
|
|
124
124
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
125
125
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.UserCheck, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
126
126
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-lg font-bold", children: allActors.size }),
|
|
127
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground", children: "Participants" })
|
|
128
128
|
] })
|
|
129
129
|
] }),
|
|
130
130
|
remixCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
@@ -213,7 +213,7 @@ function AssetProvenanceTab({
|
|
|
213
213
|
] })
|
|
214
214
|
] }) }),
|
|
215
215
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
216
|
-
amount && BigInt(amount) > 1n && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-
|
|
216
|
+
amount && BigInt(amount) > 1n && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-2xs text-muted-foreground tabular-nums bg-muted/60 px-1.5 py-0.5 rounded", children: [
|
|
217
217
|
"\xD7",
|
|
218
218
|
amount
|
|
219
219
|
] }),
|
|
@@ -224,7 +224,7 @@ function AssetProvenanceTab({
|
|
|
224
224
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
225
|
"span",
|
|
226
226
|
{
|
|
227
|
-
className: "text-
|
|
227
|
+
className: "text-2xs text-muted-foreground/60 whitespace-nowrap",
|
|
228
228
|
title: new Date(event.timestamp).toLocaleString(),
|
|
229
229
|
children: (0, import_time.timeAgo)(event.timestamp)
|
|
230
230
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-provenance-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport dynamic from \"next/dynamic\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { RemixesTab } from \"./remixes-tab.js\";\nimport { CreationRecord } from \"./creation-record.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport {\n ShoppingCart, Tag, HandCoins, ArrowRightLeft, X, CheckCircle,\n TrendingUp, Activity, ArrowRight, ExternalLink, Fingerprint, UserCheck,\n} from \"lucide-react\";\nimport type { ApiActivity } from \"@medialane/sdk\";\n\nconst PriceHistoryChart = dynamic(\n () => import(\"./price-history-chart.js\").then((m) => m.PriceHistoryChart),\n {\n ssr: false,\n loading: () => <div className=\"h-48 w-full animate-pulse rounded-xl bg-muted/40\" />,\n },\n);\n\nconst EVENT_STYLE: Record<string, { label: string; icon: React.ReactNode; badgeCls: string }> = {\n sale: { label: \"Sale\", icon: <ShoppingCart className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-emerald-500/15 text-emerald-500 border-emerald-500/20\" },\n mint: { label: \"Minted\", icon: <CheckCircle className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-teal-500/15 text-teal-500 border-teal-500/20\" },\n listing: { label: \"Listed\", icon: <Tag className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-blue/15 text-brand-blue border-brand-blue/20\" },\n offer: { label: \"Offer\", icon: <HandCoins className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-amber-500/15 text-amber-500 border-amber-500/20\" },\n transfer: { label: \"Transfer\", icon: <ArrowRightLeft className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-purple/15 text-brand-purple border-brand-purple/20\" },\n cancelled: { label: \"Cancelled\", icon: <X className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-red-500/15 text-red-400 border-red-500/20\" },\n};\n\ninterface AssetProvenanceTabProps {\n history: ApiActivity[];\n contract: string;\n tokenId: string;\n remixCount: number;\n originalCreator?: string;\n registeredAt?: number;\n}\n\nexport function AssetProvenanceTab({\n history,\n contract,\n tokenId,\n remixCount,\n originalCreator,\n registeredAt,\n}: AssetProvenanceTabProps) {\n const sales = history.filter((e) => e.type === \"sale\");\n\n const totalVolumeParts = sales.reduce<Record<string, { amount: number; currency: string }>>((acc, e) => {\n if (!e.price?.formatted || !e.price.currency) return acc;\n const key = e.price.currency;\n const parsed = parseFloat(e.price.formatted.replace(/,/g, \"\"));\n if (!isNaN(parsed)) {\n acc[key] = { amount: (acc[key]?.amount ?? 0) + parsed, currency: key };\n }\n return acc;\n }, {});\n const volumeSummary = Object.values(totalVolumeParts);\n\n const allActors = new Set(\n history.flatMap((e) => [e.offerer, e.fulfiller, e.from].filter(Boolean))\n );\n const firstEvent = history[history.length - 1];\n\n return (\n <div className=\"mt-4 space-y-6\">\n\n <div className=\"flex items-center gap-2 rounded-lg bg-primary/5 px-4 py-2.5\">\n <Fingerprint className=\"h-4 w-4 text-primary shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-primary\">Onchain Provenance</p>\n <p className=\"text-xs text-muted-foreground\">Every transfer and sale is immutably recorded on Starknet — this history cannot be altered.</p>\n </div>\n <a\n href={`${EXPLORER_URL}/contract/${contract}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"shrink-0 flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors ml-auto\"\n >\n Contract <ExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n\n {originalCreator && registeredAt ? (\n <CreationRecord originalCreator={originalCreator} registeredAt={registeredAt} />\n ) : null}\n\n {history.length > 0 && (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <Activity className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{history.length}</p>\n <p className=\"text-[10px] text-muted-foreground\">Events</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <ShoppingCart className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{sales.length}</p>\n <p className=\"text-[10px] text-muted-foreground\">Sales</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <TrendingUp className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n {volumeSummary.length > 0 ? (\n <div className=\"space-y-0.5\">\n {volumeSummary.map((v) => (\n <p key={v.currency} className=\"text-sm font-bold leading-tight\">\n {v.amount.toFixed(v.amount < 1 ? 4 : 2)} {v.currency}\n </p>\n ))}\n </div>\n ) : (\n <p className=\"text-lg font-bold\">—</p>\n )}\n <p className=\"text-[10px] text-muted-foreground\">Volume</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <UserCheck className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{allActors.size}</p>\n <p className=\"text-[10px] text-muted-foreground\">Participants</p>\n </div>\n </div>\n )}\n\n {remixCount > 0 && (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">Remixes ({remixCount})</p>\n <RemixesTab contractAddress={contract} tokenId={tokenId} />\n </div>\n )}\n\n <PriceHistoryChart history={history} />\n\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n History\n {firstEvent && (\n <span className=\"ml-2 font-normal normal-case\">\n · first activity {timeAgo(firstEvent.timestamp)}\n </span>\n )}\n </p>\n\n {history.length === 0 ? (\n <div className=\"rounded-xl bg-muted/10 py-12 flex flex-col items-center gap-3 text-center\">\n <Activity className=\"h-8 w-8 text-muted-foreground/30\" />\n <p className=\"text-sm text-muted-foreground\">No activity recorded yet.</p>\n </div>\n ) : (\n <div className=\"relative\">\n\n <div className=\"absolute left-[19px] top-6 bottom-6 w-px bg-border/60\" />\n\n <div className=\"space-y-1\">\n {history.map((event, i) => {\n const style = EVENT_STYLE[event.type] ?? {\n label: event.type,\n icon: <Activity className=\"h-3.5 w-3.5\" />,\n badgeCls: \"bg-muted/60 text-muted-foreground border-border\",\n };\n const actor = event.offerer ?? event.from ?? \"\";\n const toAddr = event.to;\n const counterpart = event.fulfiller && event.fulfiller !== actor\n ? event.fulfiller\n : (event.type === \"transfer\" || event.type === \"mint\") && toAddr\n ? toAddr\n : null;\n const amount = event.amount;\n const txLink = event.txHash ? `${EXPLORER_URL}/tx/${event.txHash}` : null;\n const voyagerActor = actor ? `${EXPLORER_URL}/contract/${actor}` : null;\n\n return (\n <div key={i} className=\"relative flex gap-4 group\">\n\n <div className={`relative z-10 h-10 w-10 rounded-full border flex items-center justify-center shrink-0 mt-1 transition-colors group-hover:border-primary/50 ${style.badgeCls}`}>\n {style.icon}\n </div>\n\n <div\n className={`flex-1 min-w-0 rounded-xl bg-card/40 px-3 py-2.5 transition-colors group-hover:bg-card/60 ${txLink ? \"cursor-pointer\" : \"\"}`}\n onClick={() => txLink && window.open(txLink, \"_blank\", \"noopener,noreferrer\")}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={`inline-flex items-center gap-1 text-xs font-semibold px-2 py-0.5 rounded-full border ${style.badgeCls}`}>\n {style.icon}\n {style.label}\n </span>\n {actor && (\n <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n {voyagerActor ? (\n <a\n href={voyagerActor}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"hover:text-foreground transition-colors tabular-nums\"\n >\n {actor.slice(0, 6)}…{actor.slice(-4)}\n </a>\n ) : (\n <span className=\"tabular-nums\">{actor.slice(0, 6)}…{actor.slice(-4)}</span>\n )}\n </span>\n )}\n {counterpart && (\n <>\n <ArrowRight className=\"h-3 w-3 text-muted-foreground/50 shrink-0\" />\n <a\n href={`${EXPLORER_URL}/contract/${counterpart}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-xs text-muted-foreground hover:text-foreground transition-colors tabular-nums\"\n >\n {counterpart.slice(0, 6)}…{counterpart.slice(-4)}\n </a>\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 shrink-0\">\n {amount && BigInt(amount) > 1n && (\n <span className=\"text-[11px] text-muted-foreground tabular-nums bg-muted/60 px-1.5 py-0.5 rounded\">\n ×{amount}\n </span>\n )}\n {event.price?.formatted && (\n <span className=\"text-sm font-bold inline-flex items-center gap-1\">\n {formatDisplayPrice(event.price.formatted)}\n <CurrencyIcon symbol={event.price.currency ?? \"\"} size={13} />\n </span>\n )}\n <span\n className=\"text-[11px] text-muted-foreground/60 whitespace-nowrap\"\n title={new Date(event.timestamp).toLocaleString()}\n >\n {timeAgo(event.timestamp)}\n </span>\n {txLink && (\n <a\n href={txLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-muted-foreground/40 hover:text-muted-foreground transition-colors\"\n title=\"View transaction\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n </div>\n\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBmB;AAjBnB,qBAAoB;AACpB,2BAA6B;AAC7B,yBAA2B;AAC3B,6BAA+B;AAC/B,oBAAmC;AACnC,kBAAwB;AACxB,0BAA6B;AAC7B,0BAGO;AAGP,MAAM,wBAAoB,eAAAA;AAAA,EACxB,MAAM,OAAO,0BAA0B,EAAE,KAAK,CAAC,MAAM,EAAE,iBAAiB;AAAA,EACxE;AAAA,IACE,KAAK;AAAA,IACL,SAAS,MAAM,4CAAC,SAAI,WAAU,oDAAmD;AAAA,EACnF;AACF;AAEA,MAAM,cAA0F;AAAA,EAC9F,MAAW,EAAE,OAAO,QAAa,MAAM,4CAAC,oCAAa,WAAU,eAAc,GAAM,UAAU,2DAA2D;AAAA,EACxJ,MAAW,EAAE,OAAO,UAAa,MAAM,4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P,KAAI;AAAA,0BACJ,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,0BAClC,WAAU;AAAA,0BAET;AAAA,wCAAY,MAAM,GAAG,CAAC;AAAA,4BAAE;AAAA,4BAAE,YAAY,MAAM,EAAE;AAAA;AAAA;AAAA,sBACjD;AAAA,uBACF;AAAA,qBAEJ,GACF;AAAA,kBAEA,6CAAC,SAAI,WAAU,oCACZ;AAAA,8BAAU,OAAO,MAAM,IAAI,MAC1B,6CAAC,UAAK,WAAU,oFAAmF;AAAA;AAAA,sBAC/F;AAAA,uBACJ;AAAA,oBAED,MAAM,OAAO,aACZ,6CAAC,UAAK,WAAU,oDACb;AAAA,4DAAmB,MAAM,MAAM,SAAS;AAAA,sBACzC,4CAAC,qCAAa,QAAQ,MAAM,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,uBAC9D;AAAA,oBAEF;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV,OAAO,IAAI,KAAK,MAAM,SAAS,EAAE,eAAe;AAAA,wBAE/C,mCAAQ,MAAM,SAAS;AAAA;AAAA,oBAC1B;AAAA,oBACC,UACC;AAAA,sBAAC;AAAA;AAAA,wBACC,MAAM;AAAA,wBACN,QAAO;AAAA,wBACP,KAAI;AAAA,wBACJ,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,wBAClC,WAAU;AAAA,wBACV,OAAM;AAAA,wBAEN,sDAAC,oCAAa,WAAU,WAAU;AAAA;AAAA,oBACpC;AAAA,qBAEJ;AAAA,mBACF;AAAA;AAAA,YACF;AAAA,eAnFQ,CAoFV;AAAA,QAEJ,CAAC,GACH;AAAA,SACF;AAAA,OAEJ;AAAA,KAEF;AAEJ;","names":["dynamic"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-provenance-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport dynamic from \"next/dynamic\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { RemixesTab } from \"./remixes-tab.js\";\nimport { CreationRecord } from \"./creation-record.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport {\n ShoppingCart, Tag, HandCoins, ArrowRightLeft, X, CheckCircle,\n TrendingUp, Activity, ArrowRight, ExternalLink, Fingerprint, UserCheck,\n} from \"lucide-react\";\nimport type { ApiActivity } from \"@medialane/sdk\";\n\nconst PriceHistoryChart = dynamic(\n () => import(\"./price-history-chart.js\").then((m) => m.PriceHistoryChart),\n {\n ssr: false,\n loading: () => <div className=\"h-48 w-full animate-pulse rounded-xl bg-muted/40\" />,\n },\n);\n\nconst EVENT_STYLE: Record<string, { label: string; icon: React.ReactNode; badgeCls: string }> = {\n sale: { label: \"Sale\", icon: <ShoppingCart className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-emerald-500/15 text-emerald-500 border-emerald-500/20\" },\n mint: { label: \"Minted\", icon: <CheckCircle className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-teal-500/15 text-teal-500 border-teal-500/20\" },\n listing: { label: \"Listed\", icon: <Tag className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-blue/15 text-brand-blue border-brand-blue/20\" },\n offer: { label: \"Offer\", icon: <HandCoins className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-amber-500/15 text-amber-500 border-amber-500/20\" },\n transfer: { label: \"Transfer\", icon: <ArrowRightLeft className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-purple/15 text-brand-purple border-brand-purple/20\" },\n cancelled: { label: \"Cancelled\", icon: <X className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-red-500/15 text-red-400 border-red-500/20\" },\n};\n\ninterface AssetProvenanceTabProps {\n history: ApiActivity[];\n contract: string;\n tokenId: string;\n remixCount: number;\n originalCreator?: string;\n registeredAt?: number;\n}\n\nexport function AssetProvenanceTab({\n history,\n contract,\n tokenId,\n remixCount,\n originalCreator,\n registeredAt,\n}: AssetProvenanceTabProps) {\n const sales = history.filter((e) => e.type === \"sale\");\n\n const totalVolumeParts = sales.reduce<Record<string, { amount: number; currency: string }>>((acc, e) => {\n if (!e.price?.formatted || !e.price.currency) return acc;\n const key = e.price.currency;\n const parsed = parseFloat(e.price.formatted.replace(/,/g, \"\"));\n if (!isNaN(parsed)) {\n acc[key] = { amount: (acc[key]?.amount ?? 0) + parsed, currency: key };\n }\n return acc;\n }, {});\n const volumeSummary = Object.values(totalVolumeParts);\n\n const allActors = new Set(\n history.flatMap((e) => [e.offerer, e.fulfiller, e.from].filter(Boolean))\n );\n const firstEvent = history[history.length - 1];\n\n return (\n <div className=\"mt-4 space-y-6\">\n\n <div className=\"flex items-center gap-2 rounded-lg bg-primary/5 px-4 py-2.5\">\n <Fingerprint className=\"h-4 w-4 text-primary shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-primary\">Onchain Provenance</p>\n <p className=\"text-xs text-muted-foreground\">Every transfer and sale is immutably recorded on Starknet — this history cannot be altered.</p>\n </div>\n <a\n href={`${EXPLORER_URL}/contract/${contract}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"shrink-0 flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors ml-auto\"\n >\n Contract <ExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n\n {originalCreator && registeredAt ? (\n <CreationRecord originalCreator={originalCreator} registeredAt={registeredAt} />\n ) : null}\n\n {history.length > 0 && (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <Activity className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{history.length}</p>\n <p className=\"text-2xs text-muted-foreground\">Events</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <ShoppingCart className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{sales.length}</p>\n <p className=\"text-2xs text-muted-foreground\">Sales</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <TrendingUp className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n {volumeSummary.length > 0 ? (\n <div className=\"space-y-0.5\">\n {volumeSummary.map((v) => (\n <p key={v.currency} className=\"text-sm font-bold leading-tight\">\n {v.amount.toFixed(v.amount < 1 ? 4 : 2)} {v.currency}\n </p>\n ))}\n </div>\n ) : (\n <p className=\"text-lg font-bold\">—</p>\n )}\n <p className=\"text-2xs text-muted-foreground\">Volume</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <UserCheck className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{allActors.size}</p>\n <p className=\"text-2xs text-muted-foreground\">Participants</p>\n </div>\n </div>\n )}\n\n {remixCount > 0 && (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">Remixes ({remixCount})</p>\n <RemixesTab contractAddress={contract} tokenId={tokenId} />\n </div>\n )}\n\n <PriceHistoryChart history={history} />\n\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n History\n {firstEvent && (\n <span className=\"ml-2 font-normal normal-case\">\n · first activity {timeAgo(firstEvent.timestamp)}\n </span>\n )}\n </p>\n\n {history.length === 0 ? (\n <div className=\"rounded-xl bg-muted/10 py-12 flex flex-col items-center gap-3 text-center\">\n <Activity className=\"h-8 w-8 text-muted-foreground/30\" />\n <p className=\"text-sm text-muted-foreground\">No activity recorded yet.</p>\n </div>\n ) : (\n <div className=\"relative\">\n\n <div className=\"absolute left-[19px] top-6 bottom-6 w-px bg-border/60\" />\n\n <div className=\"space-y-1\">\n {history.map((event, i) => {\n const style = EVENT_STYLE[event.type] ?? {\n label: event.type,\n icon: <Activity className=\"h-3.5 w-3.5\" />,\n badgeCls: \"bg-muted/60 text-muted-foreground border-border\",\n };\n const actor = event.offerer ?? event.from ?? \"\";\n const toAddr = event.to;\n const counterpart = event.fulfiller && event.fulfiller !== actor\n ? event.fulfiller\n : (event.type === \"transfer\" || event.type === \"mint\") && toAddr\n ? toAddr\n : null;\n const amount = event.amount;\n const txLink = event.txHash ? `${EXPLORER_URL}/tx/${event.txHash}` : null;\n const voyagerActor = actor ? `${EXPLORER_URL}/contract/${actor}` : null;\n\n return (\n <div key={i} className=\"relative flex gap-4 group\">\n\n <div className={`relative z-10 h-10 w-10 rounded-full border flex items-center justify-center shrink-0 mt-1 transition-colors group-hover:border-primary/50 ${style.badgeCls}`}>\n {style.icon}\n </div>\n\n <div\n className={`flex-1 min-w-0 rounded-xl bg-card/40 px-3 py-2.5 transition-colors group-hover:bg-card/60 ${txLink ? \"cursor-pointer\" : \"\"}`}\n onClick={() => txLink && window.open(txLink, \"_blank\", \"noopener,noreferrer\")}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={`inline-flex items-center gap-1 text-xs font-semibold px-2 py-0.5 rounded-full border ${style.badgeCls}`}>\n {style.icon}\n {style.label}\n </span>\n {actor && (\n <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n {voyagerActor ? (\n <a\n href={voyagerActor}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"hover:text-foreground transition-colors tabular-nums\"\n >\n {actor.slice(0, 6)}…{actor.slice(-4)}\n </a>\n ) : (\n <span className=\"tabular-nums\">{actor.slice(0, 6)}…{actor.slice(-4)}</span>\n )}\n </span>\n )}\n {counterpart && (\n <>\n <ArrowRight className=\"h-3 w-3 text-muted-foreground/50 shrink-0\" />\n <a\n href={`${EXPLORER_URL}/contract/${counterpart}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-xs text-muted-foreground hover:text-foreground transition-colors tabular-nums\"\n >\n {counterpart.slice(0, 6)}…{counterpart.slice(-4)}\n </a>\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 shrink-0\">\n {amount && BigInt(amount) > 1n && (\n <span className=\"text-2xs text-muted-foreground tabular-nums bg-muted/60 px-1.5 py-0.5 rounded\">\n ×{amount}\n </span>\n )}\n {event.price?.formatted && (\n <span className=\"text-sm font-bold inline-flex items-center gap-1\">\n {formatDisplayPrice(event.price.formatted)}\n <CurrencyIcon symbol={event.price.currency ?? \"\"} size={13} />\n </span>\n )}\n <span\n className=\"text-2xs text-muted-foreground/60 whitespace-nowrap\"\n title={new Date(event.timestamp).toLocaleString()}\n >\n {timeAgo(event.timestamp)}\n </span>\n {txLink && (\n <a\n href={txLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-muted-foreground/40 hover:text-muted-foreground transition-colors\"\n title=\"View transaction\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n </div>\n\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBmB;AAjBnB,qBAAoB;AACpB,2BAA6B;AAC7B,yBAA2B;AAC3B,6BAA+B;AAC/B,oBAAmC;AACnC,kBAAwB;AACxB,0BAA6B;AAC7B,0BAGO;AAGP,MAAM,wBAAoB,eAAAA;AAAA,EACxB,MAAM,OAAO,0BAA0B,EAAE,KAAK,CAAC,MAAM,EAAE,iBAAiB;AAAA,EACxE;AAAA,IACE,KAAK;AAAA,IACL,SAAS,MAAM,4CAAC,SAAI,WAAU,oDAAmD;AAAA,EACnF;AACF;AAEA,MAAM,cAA0F;AAAA,EAC9F,MAAW,EAAE,OAAO,QAAa,MAAM,4CAAC,oCAAa,WAAU,eAAc,GAAM,UAAU,2DAA2D;AAAA,EACxJ,MAAW,EAAE,OAAO,UAAa,MAAM,4CAAC,mCAAY,WA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BACJ,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,0BAClC,WAAU;AAAA,0BAET;AAAA,wCAAY,MAAM,GAAG,CAAC;AAAA,4BAAE;AAAA,4BAAE,YAAY,MAAM,EAAE;AAAA;AAAA;AAAA,sBACjD;AAAA,uBACF;AAAA,qBAEJ,GACF;AAAA,kBAEA,6CAAC,SAAI,WAAU,oCACZ;AAAA,8BAAU,OAAO,MAAM,IAAI,MAC1B,6CAAC,UAAK,WAAU,iFAAgF;AAAA;AAAA,sBAC5F;AAAA,uBACJ;AAAA,oBAED,MAAM,OAAO,aACZ,6CAAC,UAAK,WAAU,oDACb;AAAA,4DAAmB,MAAM,MAAM,SAAS;AAAA,sBACzC,4CAAC,qCAAa,QAAQ,MAAM,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,uBAC9D;AAAA,oBAEF;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV,OAAO,IAAI,KAAK,MAAM,SAAS,EAAE,eAAe;AAAA,wBAE/C,mCAAQ,MAAM,SAAS;AAAA;AAAA,oBAC1B;AAAA,oBACC,UACC;AAAA,sBAAC;AAAA;AAAA,wBACC,MAAM;AAAA,wBACN,QAAO;AAAA,wBACP,KAAI;AAAA,wBACJ,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,wBAClC,WAAU;AAAA,wBACV,OAAM;AAAA,wBAEN,sDAAC,oCAAa,WAAU,WAAU;AAAA;AAAA,oBACpC;AAAA,qBAEJ;AAAA,mBACF;AAAA;AAAA,YACF;AAAA,eAnFQ,CAoFV;AAAA,QAEJ,CAAC,GACH;AAAA,SACF;AAAA,OAEJ;AAAA,KAEF;AAEJ;","names":["dynamic"]}
|
|
@@ -72,7 +72,7 @@ function AssetProvenanceTab({
|
|
|
72
72
|
href: `${EXPLORER_URL}/contract/${contract}`,
|
|
73
73
|
target: "_blank",
|
|
74
74
|
rel: "noopener noreferrer",
|
|
75
|
-
className: "shrink-0 flex items-center gap-1 text-
|
|
75
|
+
className: "shrink-0 flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors ml-auto",
|
|
76
76
|
children: [
|
|
77
77
|
"Contract ",
|
|
78
78
|
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
@@ -85,12 +85,12 @@ function AssetProvenanceTab({
|
|
|
85
85
|
/* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
86
86
|
/* @__PURE__ */ jsx(Activity, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
87
87
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-bold", children: history.length }),
|
|
88
|
-
/* @__PURE__ */ jsx("p", { className: "text-
|
|
88
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xs text-muted-foreground", children: "Events" })
|
|
89
89
|
] }),
|
|
90
90
|
/* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
91
91
|
/* @__PURE__ */ jsx(ShoppingCart, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
92
92
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-bold", children: sales.length }),
|
|
93
|
-
/* @__PURE__ */ jsx("p", { className: "text-
|
|
93
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xs text-muted-foreground", children: "Sales" })
|
|
94
94
|
] }),
|
|
95
95
|
/* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
96
96
|
/* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
@@ -99,12 +99,12 @@ function AssetProvenanceTab({
|
|
|
99
99
|
" ",
|
|
100
100
|
v.currency
|
|
101
101
|
] }, v.currency)) }) : /* @__PURE__ */ jsx("p", { className: "text-lg font-bold", children: "\u2014" }),
|
|
102
|
-
/* @__PURE__ */ jsx("p", { className: "text-
|
|
102
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xs text-muted-foreground", children: "Volume" })
|
|
103
103
|
] }),
|
|
104
104
|
/* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-muted/20 p-3 text-center", children: [
|
|
105
105
|
/* @__PURE__ */ jsx(UserCheck, { className: "h-4 w-4 text-muted-foreground mx-auto mb-1" }),
|
|
106
106
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-bold", children: allActors.size }),
|
|
107
|
-
/* @__PURE__ */ jsx("p", { className: "text-
|
|
107
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xs text-muted-foreground", children: "Participants" })
|
|
108
108
|
] })
|
|
109
109
|
] }),
|
|
110
110
|
remixCount > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -193,7 +193,7 @@ function AssetProvenanceTab({
|
|
|
193
193
|
] })
|
|
194
194
|
] }) }),
|
|
195
195
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
196
|
-
amount && BigInt(amount) > 1n && /* @__PURE__ */ jsxs("span", { className: "text-
|
|
196
|
+
amount && BigInt(amount) > 1n && /* @__PURE__ */ jsxs("span", { className: "text-2xs text-muted-foreground tabular-nums bg-muted/60 px-1.5 py-0.5 rounded", children: [
|
|
197
197
|
"\xD7",
|
|
198
198
|
amount
|
|
199
199
|
] }),
|
|
@@ -204,7 +204,7 @@ function AssetProvenanceTab({
|
|
|
204
204
|
/* @__PURE__ */ jsx(
|
|
205
205
|
"span",
|
|
206
206
|
{
|
|
207
|
-
className: "text-
|
|
207
|
+
className: "text-2xs text-muted-foreground/60 whitespace-nowrap",
|
|
208
208
|
title: new Date(event.timestamp).toLocaleString(),
|
|
209
209
|
children: timeAgo(event.timestamp)
|
|
210
210
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-provenance-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport dynamic from \"next/dynamic\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { RemixesTab } from \"./remixes-tab.js\";\nimport { CreationRecord } from \"./creation-record.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport {\n ShoppingCart, Tag, HandCoins, ArrowRightLeft, X, CheckCircle,\n TrendingUp, Activity, ArrowRight, ExternalLink, Fingerprint, UserCheck,\n} from \"lucide-react\";\nimport type { ApiActivity } from \"@medialane/sdk\";\n\nconst PriceHistoryChart = dynamic(\n () => import(\"./price-history-chart.js\").then((m) => m.PriceHistoryChart),\n {\n ssr: false,\n loading: () => <div className=\"h-48 w-full animate-pulse rounded-xl bg-muted/40\" />,\n },\n);\n\nconst EVENT_STYLE: Record<string, { label: string; icon: React.ReactNode; badgeCls: string }> = {\n sale: { label: \"Sale\", icon: <ShoppingCart className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-emerald-500/15 text-emerald-500 border-emerald-500/20\" },\n mint: { label: \"Minted\", icon: <CheckCircle className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-teal-500/15 text-teal-500 border-teal-500/20\" },\n listing: { label: \"Listed\", icon: <Tag className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-blue/15 text-brand-blue border-brand-blue/20\" },\n offer: { label: \"Offer\", icon: <HandCoins className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-amber-500/15 text-amber-500 border-amber-500/20\" },\n transfer: { label: \"Transfer\", icon: <ArrowRightLeft className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-purple/15 text-brand-purple border-brand-purple/20\" },\n cancelled: { label: \"Cancelled\", icon: <X className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-red-500/15 text-red-400 border-red-500/20\" },\n};\n\ninterface AssetProvenanceTabProps {\n history: ApiActivity[];\n contract: string;\n tokenId: string;\n remixCount: number;\n originalCreator?: string;\n registeredAt?: number;\n}\n\nexport function AssetProvenanceTab({\n history,\n contract,\n tokenId,\n remixCount,\n originalCreator,\n registeredAt,\n}: AssetProvenanceTabProps) {\n const sales = history.filter((e) => e.type === \"sale\");\n\n const totalVolumeParts = sales.reduce<Record<string, { amount: number; currency: string }>>((acc, e) => {\n if (!e.price?.formatted || !e.price.currency) return acc;\n const key = e.price.currency;\n const parsed = parseFloat(e.price.formatted.replace(/,/g, \"\"));\n if (!isNaN(parsed)) {\n acc[key] = { amount: (acc[key]?.amount ?? 0) + parsed, currency: key };\n }\n return acc;\n }, {});\n const volumeSummary = Object.values(totalVolumeParts);\n\n const allActors = new Set(\n history.flatMap((e) => [e.offerer, e.fulfiller, e.from].filter(Boolean))\n );\n const firstEvent = history[history.length - 1];\n\n return (\n <div className=\"mt-4 space-y-6\">\n\n <div className=\"flex items-center gap-2 rounded-lg bg-primary/5 px-4 py-2.5\">\n <Fingerprint className=\"h-4 w-4 text-primary shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-primary\">Onchain Provenance</p>\n <p className=\"text-xs text-muted-foreground\">Every transfer and sale is immutably recorded on Starknet — this history cannot be altered.</p>\n </div>\n <a\n href={`${EXPLORER_URL}/contract/${contract}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"shrink-0 flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors ml-auto\"\n >\n Contract <ExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n\n {originalCreator && registeredAt ? (\n <CreationRecord originalCreator={originalCreator} registeredAt={registeredAt} />\n ) : null}\n\n {history.length > 0 && (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <Activity className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{history.length}</p>\n <p className=\"text-[10px] text-muted-foreground\">Events</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <ShoppingCart className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{sales.length}</p>\n <p className=\"text-[10px] text-muted-foreground\">Sales</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <TrendingUp className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n {volumeSummary.length > 0 ? (\n <div className=\"space-y-0.5\">\n {volumeSummary.map((v) => (\n <p key={v.currency} className=\"text-sm font-bold leading-tight\">\n {v.amount.toFixed(v.amount < 1 ? 4 : 2)} {v.currency}\n </p>\n ))}\n </div>\n ) : (\n <p className=\"text-lg font-bold\">—</p>\n )}\n <p className=\"text-[10px] text-muted-foreground\">Volume</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <UserCheck className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{allActors.size}</p>\n <p className=\"text-[10px] text-muted-foreground\">Participants</p>\n </div>\n </div>\n )}\n\n {remixCount > 0 && (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">Remixes ({remixCount})</p>\n <RemixesTab contractAddress={contract} tokenId={tokenId} />\n </div>\n )}\n\n <PriceHistoryChart history={history} />\n\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n History\n {firstEvent && (\n <span className=\"ml-2 font-normal normal-case\">\n · first activity {timeAgo(firstEvent.timestamp)}\n </span>\n )}\n </p>\n\n {history.length === 0 ? (\n <div className=\"rounded-xl bg-muted/10 py-12 flex flex-col items-center gap-3 text-center\">\n <Activity className=\"h-8 w-8 text-muted-foreground/30\" />\n <p className=\"text-sm text-muted-foreground\">No activity recorded yet.</p>\n </div>\n ) : (\n <div className=\"relative\">\n\n <div className=\"absolute left-[19px] top-6 bottom-6 w-px bg-border/60\" />\n\n <div className=\"space-y-1\">\n {history.map((event, i) => {\n const style = EVENT_STYLE[event.type] ?? {\n label: event.type,\n icon: <Activity className=\"h-3.5 w-3.5\" />,\n badgeCls: \"bg-muted/60 text-muted-foreground border-border\",\n };\n const actor = event.offerer ?? event.from ?? \"\";\n const toAddr = event.to;\n const counterpart = event.fulfiller && event.fulfiller !== actor\n ? event.fulfiller\n : (event.type === \"transfer\" || event.type === \"mint\") && toAddr\n ? toAddr\n : null;\n const amount = event.amount;\n const txLink = event.txHash ? `${EXPLORER_URL}/tx/${event.txHash}` : null;\n const voyagerActor = actor ? `${EXPLORER_URL}/contract/${actor}` : null;\n\n return (\n <div key={i} className=\"relative flex gap-4 group\">\n\n <div className={`relative z-10 h-10 w-10 rounded-full border flex items-center justify-center shrink-0 mt-1 transition-colors group-hover:border-primary/50 ${style.badgeCls}`}>\n {style.icon}\n </div>\n\n <div\n className={`flex-1 min-w-0 rounded-xl bg-card/40 px-3 py-2.5 transition-colors group-hover:bg-card/60 ${txLink ? \"cursor-pointer\" : \"\"}`}\n onClick={() => txLink && window.open(txLink, \"_blank\", \"noopener,noreferrer\")}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={`inline-flex items-center gap-1 text-xs font-semibold px-2 py-0.5 rounded-full border ${style.badgeCls}`}>\n {style.icon}\n {style.label}\n </span>\n {actor && (\n <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n {voyagerActor ? (\n <a\n href={voyagerActor}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"hover:text-foreground transition-colors tabular-nums\"\n >\n {actor.slice(0, 6)}…{actor.slice(-4)}\n </a>\n ) : (\n <span className=\"tabular-nums\">{actor.slice(0, 6)}…{actor.slice(-4)}</span>\n )}\n </span>\n )}\n {counterpart && (\n <>\n <ArrowRight className=\"h-3 w-3 text-muted-foreground/50 shrink-0\" />\n <a\n href={`${EXPLORER_URL}/contract/${counterpart}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-xs text-muted-foreground hover:text-foreground transition-colors tabular-nums\"\n >\n {counterpart.slice(0, 6)}…{counterpart.slice(-4)}\n </a>\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 shrink-0\">\n {amount && BigInt(amount) > 1n && (\n <span className=\"text-[11px] text-muted-foreground tabular-nums bg-muted/60 px-1.5 py-0.5 rounded\">\n ×{amount}\n </span>\n )}\n {event.price?.formatted && (\n <span className=\"text-sm font-bold inline-flex items-center gap-1\">\n {formatDisplayPrice(event.price.formatted)}\n <CurrencyIcon symbol={event.price.currency ?? \"\"} size={13} />\n </span>\n )}\n <span\n className=\"text-[11px] text-muted-foreground/60 whitespace-nowrap\"\n title={new Date(event.timestamp).toLocaleString()}\n >\n {timeAgo(event.timestamp)}\n </span>\n {txLink && (\n <a\n href={txLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-muted-foreground/40 hover:text-muted-foreground transition-colors\"\n title=\"View transaction\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n </div>\n\n </div>\n );\n}\n"],"mappings":";AAmBmB,SA6LW,UA7LX,KAqDX,YArDW;AAjBnB,OAAO,aAAa;AACpB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EAAc;AAAA,EAAK;AAAA,EAAW;AAAA,EAAgB;AAAA,EAAG;AAAA,EACjD;AAAA,EAAY;AAAA,EAAU;AAAA,EAAY;AAAA,EAAc;AAAA,EAAa;AAAA,OACxD;AAGP,MAAM,oBAAoB;AAAA,EACxB,MAAM,OAAO,0BAA0B,EAAE,KAAK,CAAC,MAAM,EAAE,iBAAiB;AAAA,EACxE;AAAA,IACE,KAAK;AAAA,IACL,SAAS,MAAM,oBAAC,SAAI,WAAU,oDAAmD;A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"sources":["../../src/components/asset-provenance-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport dynamic from \"next/dynamic\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { RemixesTab } from \"./remixes-tab.js\";\nimport { CreationRecord } from \"./creation-record.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport {\n ShoppingCart, Tag, HandCoins, ArrowRightLeft, X, CheckCircle,\n TrendingUp, Activity, ArrowRight, ExternalLink, Fingerprint, UserCheck,\n} from \"lucide-react\";\nimport type { ApiActivity } from \"@medialane/sdk\";\n\nconst PriceHistoryChart = dynamic(\n () => import(\"./price-history-chart.js\").then((m) => m.PriceHistoryChart),\n {\n ssr: false,\n loading: () => <div className=\"h-48 w-full animate-pulse rounded-xl bg-muted/40\" />,\n },\n);\n\nconst EVENT_STYLE: Record<string, { label: string; icon: React.ReactNode; badgeCls: string }> = {\n sale: { label: \"Sale\", icon: <ShoppingCart className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-emerald-500/15 text-emerald-500 border-emerald-500/20\" },\n mint: { label: \"Minted\", icon: <CheckCircle className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-teal-500/15 text-teal-500 border-teal-500/20\" },\n listing: { label: \"Listed\", icon: <Tag className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-blue/15 text-brand-blue border-brand-blue/20\" },\n offer: { label: \"Offer\", icon: <HandCoins className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-amber-500/15 text-amber-500 border-amber-500/20\" },\n transfer: { label: \"Transfer\", icon: <ArrowRightLeft className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-brand-purple/15 text-brand-purple border-brand-purple/20\" },\n cancelled: { label: \"Cancelled\", icon: <X className=\"h-3.5 w-3.5\" />, badgeCls: \"bg-red-500/15 text-red-400 border-red-500/20\" },\n};\n\ninterface AssetProvenanceTabProps {\n history: ApiActivity[];\n contract: string;\n tokenId: string;\n remixCount: number;\n originalCreator?: string;\n registeredAt?: number;\n}\n\nexport function AssetProvenanceTab({\n history,\n contract,\n tokenId,\n remixCount,\n originalCreator,\n registeredAt,\n}: AssetProvenanceTabProps) {\n const sales = history.filter((e) => e.type === \"sale\");\n\n const totalVolumeParts = sales.reduce<Record<string, { amount: number; currency: string }>>((acc, e) => {\n if (!e.price?.formatted || !e.price.currency) return acc;\n const key = e.price.currency;\n const parsed = parseFloat(e.price.formatted.replace(/,/g, \"\"));\n if (!isNaN(parsed)) {\n acc[key] = { amount: (acc[key]?.amount ?? 0) + parsed, currency: key };\n }\n return acc;\n }, {});\n const volumeSummary = Object.values(totalVolumeParts);\n\n const allActors = new Set(\n history.flatMap((e) => [e.offerer, e.fulfiller, e.from].filter(Boolean))\n );\n const firstEvent = history[history.length - 1];\n\n return (\n <div className=\"mt-4 space-y-6\">\n\n <div className=\"flex items-center gap-2 rounded-lg bg-primary/5 px-4 py-2.5\">\n <Fingerprint className=\"h-4 w-4 text-primary shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-primary\">Onchain Provenance</p>\n <p className=\"text-xs text-muted-foreground\">Every transfer and sale is immutably recorded on Starknet — this history cannot be altered.</p>\n </div>\n <a\n href={`${EXPLORER_URL}/contract/${contract}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"shrink-0 flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors ml-auto\"\n >\n Contract <ExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n\n {originalCreator && registeredAt ? (\n <CreationRecord originalCreator={originalCreator} registeredAt={registeredAt} />\n ) : null}\n\n {history.length > 0 && (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <Activity className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{history.length}</p>\n <p className=\"text-2xs text-muted-foreground\">Events</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <ShoppingCart className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{sales.length}</p>\n <p className=\"text-2xs text-muted-foreground\">Sales</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <TrendingUp className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n {volumeSummary.length > 0 ? (\n <div className=\"space-y-0.5\">\n {volumeSummary.map((v) => (\n <p key={v.currency} className=\"text-sm font-bold leading-tight\">\n {v.amount.toFixed(v.amount < 1 ? 4 : 2)} {v.currency}\n </p>\n ))}\n </div>\n ) : (\n <p className=\"text-lg font-bold\">—</p>\n )}\n <p className=\"text-2xs text-muted-foreground\">Volume</p>\n </div>\n <div className=\"rounded-xl bg-muted/20 p-3 text-center\">\n <UserCheck className=\"h-4 w-4 text-muted-foreground mx-auto mb-1\" />\n <p className=\"text-lg font-bold\">{allActors.size}</p>\n <p className=\"text-2xs text-muted-foreground\">Participants</p>\n </div>\n </div>\n )}\n\n {remixCount > 0 && (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">Remixes ({remixCount})</p>\n <RemixesTab contractAddress={contract} tokenId={tokenId} />\n </div>\n )}\n\n <PriceHistoryChart history={history} />\n\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n History\n {firstEvent && (\n <span className=\"ml-2 font-normal normal-case\">\n · first activity {timeAgo(firstEvent.timestamp)}\n </span>\n )}\n </p>\n\n {history.length === 0 ? (\n <div className=\"rounded-xl bg-muted/10 py-12 flex flex-col items-center gap-3 text-center\">\n <Activity className=\"h-8 w-8 text-muted-foreground/30\" />\n <p className=\"text-sm text-muted-foreground\">No activity recorded yet.</p>\n </div>\n ) : (\n <div className=\"relative\">\n\n <div className=\"absolute left-[19px] top-6 bottom-6 w-px bg-border/60\" />\n\n <div className=\"space-y-1\">\n {history.map((event, i) => {\n const style = EVENT_STYLE[event.type] ?? {\n label: event.type,\n icon: <Activity className=\"h-3.5 w-3.5\" />,\n badgeCls: \"bg-muted/60 text-muted-foreground border-border\",\n };\n const actor = event.offerer ?? event.from ?? \"\";\n const toAddr = event.to;\n const counterpart = event.fulfiller && event.fulfiller !== actor\n ? event.fulfiller\n : (event.type === \"transfer\" || event.type === \"mint\") && toAddr\n ? toAddr\n : null;\n const amount = event.amount;\n const txLink = event.txHash ? `${EXPLORER_URL}/tx/${event.txHash}` : null;\n const voyagerActor = actor ? `${EXPLORER_URL}/contract/${actor}` : null;\n\n return (\n <div key={i} className=\"relative flex gap-4 group\">\n\n <div className={`relative z-10 h-10 w-10 rounded-full border flex items-center justify-center shrink-0 mt-1 transition-colors group-hover:border-primary/50 ${style.badgeCls}`}>\n {style.icon}\n </div>\n\n <div\n className={`flex-1 min-w-0 rounded-xl bg-card/40 px-3 py-2.5 transition-colors group-hover:bg-card/60 ${txLink ? \"cursor-pointer\" : \"\"}`}\n onClick={() => txLink && window.open(txLink, \"_blank\", \"noopener,noreferrer\")}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={`inline-flex items-center gap-1 text-xs font-semibold px-2 py-0.5 rounded-full border ${style.badgeCls}`}>\n {style.icon}\n {style.label}\n </span>\n {actor && (\n <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n {voyagerActor ? (\n <a\n href={voyagerActor}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"hover:text-foreground transition-colors tabular-nums\"\n >\n {actor.slice(0, 6)}…{actor.slice(-4)}\n </a>\n ) : (\n <span className=\"tabular-nums\">{actor.slice(0, 6)}…{actor.slice(-4)}</span>\n )}\n </span>\n )}\n {counterpart && (\n <>\n <ArrowRight className=\"h-3 w-3 text-muted-foreground/50 shrink-0\" />\n <a\n href={`${EXPLORER_URL}/contract/${counterpart}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-xs text-muted-foreground hover:text-foreground transition-colors tabular-nums\"\n >\n {counterpart.slice(0, 6)}…{counterpart.slice(-4)}\n </a>\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 shrink-0\">\n {amount && BigInt(amount) > 1n && (\n <span className=\"text-2xs text-muted-foreground tabular-nums bg-muted/60 px-1.5 py-0.5 rounded\">\n ×{amount}\n </span>\n )}\n {event.price?.formatted && (\n <span className=\"text-sm font-bold inline-flex items-center gap-1\">\n {formatDisplayPrice(event.price.formatted)}\n <CurrencyIcon symbol={event.price.currency ?? \"\"} size={13} />\n </span>\n )}\n <span\n className=\"text-2xs text-muted-foreground/60 whitespace-nowrap\"\n title={new Date(event.timestamp).toLocaleString()}\n >\n {timeAgo(event.timestamp)}\n </span>\n {txLink && (\n <a\n href={txLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => e.stopPropagation()}\n className=\"text-muted-foreground/40 hover:text-muted-foreground transition-colors\"\n title=\"View transaction\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n </div>\n\n </div>\n );\n}\n"],"mappings":";AAmBmB,SA6LW,UA7LX,KAqDX,YArDW;AAjBnB,OAAO,aAAa;AACpB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EAAc;AAAA,EAAK;AAAA,EAAW;AAAA,EAAgB;AAAA,EAAG;AAAA,EACjD;AAAA,EAAY;AAAA,EAAU;AAAA,EAAY;AAAA,EAAc;AAAA,EAAa;AAAA,OACxD;AAGP,MAAM,oBAAoB;AAAA,EACxB,MAAM,OAAO,0BAA0B,EAAE,KAAK,CAAC,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AoFV;AAAA,QAEJ,CAAC,GACH;AAAA,SACF;AAAA,OAEJ;AAAA,KAEF;AAEJ;","names":[]}
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -59,7 +59,7 @@ function CollectionFiltersDialog({
|
|
|
59
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogTitle, { className: "text-base font-bold flex items-center gap-2", children: [
|
|
60
60
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.SlidersHorizontal, { className: "h-4 w-4" }),
|
|
61
61
|
"Filters",
|
|
62
|
-
totalActiveCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_badge.Badge, { variant: "secondary", className: "text-
|
|
62
|
+
totalActiveCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_badge.Badge, { variant: "secondary", className: "text-2xs font-medium", children: [
|
|
63
63
|
totalActiveCount,
|
|
64
64
|
" active"
|
|
65
65
|
] })
|
|
@@ -68,7 +68,7 @@ function CollectionFiltersDialog({
|
|
|
68
68
|
"button",
|
|
69
69
|
{
|
|
70
70
|
onClick: clearAll,
|
|
71
|
-
className: "text-
|
|
71
|
+
className: "text-2xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors",
|
|
72
72
|
children: "Clear all"
|
|
73
73
|
}
|
|
74
74
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-filters-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { SlidersHorizontal } from \"lucide-react\";\nimport { Badge } from \"./badge.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { useCollectionFilters, CollectionFiltersTrigger, CollectionFiltersBody } from \"./collection-filters.js\";\nimport type { ApiToken, CollectionTokensSort } from \"@medialane/sdk\";\n\nexport interface CollectionFiltersDialogProps {\n tokens: ApiToken[];\n selected: Record<string, string[]>;\n onChange: (filters: Record<string, string[]>) => void;\n sort: CollectionTokensSort;\n onSortChange: (sort: CollectionTokensSort) => void;\n chips?: boolean;\n}\n\nexport function CollectionFiltersDialog({\n tokens,\n selected,\n onChange,\n sort,\n onSortChange,\n chips = true,\n}: CollectionFiltersDialogProps) {\n const [open, setOpen] = useState(false);\n const { traitSections, activeEntries, totalActiveCount, sortIsDefault, toggleValue, clearAll, removeFilter } =\n useCollectionFilters(tokens, selected, onChange, sort, onSortChange);\n\n return (\n <>\n <CollectionFiltersTrigger\n totalActiveCount={totalActiveCount}\n sortIsDefault={sortIsDefault}\n sort={sort}\n activeEntries={activeEntries}\n onOpen={() => setOpen(true)}\n onSortReset={() => onSortChange(\"recent\")}\n onRemoveFilter={removeFilter}\n onClearAll={clearAll}\n showChips={chips}\n />\n\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"w-full max-w-sm p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n\n <div className=\"flex items-center justify-between pr-10 pl-5 py-4 border-b border-border/60 shrink-0\">\n <DialogTitle className=\"text-base font-bold flex items-center gap-2\">\n <SlidersHorizontal className=\"h-4 w-4\" />\n Filters\n {totalActiveCount > 0 && (\n <Badge variant=\"secondary\" className=\"text-
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-filters-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { SlidersHorizontal } from \"lucide-react\";\nimport { Badge } from \"./badge.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { useCollectionFilters, CollectionFiltersTrigger, CollectionFiltersBody } from \"./collection-filters.js\";\nimport type { ApiToken, CollectionTokensSort } from \"@medialane/sdk\";\n\nexport interface CollectionFiltersDialogProps {\n tokens: ApiToken[];\n selected: Record<string, string[]>;\n onChange: (filters: Record<string, string[]>) => void;\n sort: CollectionTokensSort;\n onSortChange: (sort: CollectionTokensSort) => void;\n chips?: boolean;\n}\n\nexport function CollectionFiltersDialog({\n tokens,\n selected,\n onChange,\n sort,\n onSortChange,\n chips = true,\n}: CollectionFiltersDialogProps) {\n const [open, setOpen] = useState(false);\n const { traitSections, activeEntries, totalActiveCount, sortIsDefault, toggleValue, clearAll, removeFilter } =\n useCollectionFilters(tokens, selected, onChange, sort, onSortChange);\n\n return (\n <>\n <CollectionFiltersTrigger\n totalActiveCount={totalActiveCount}\n sortIsDefault={sortIsDefault}\n sort={sort}\n activeEntries={activeEntries}\n onOpen={() => setOpen(true)}\n onSortReset={() => onSortChange(\"recent\")}\n onRemoveFilter={removeFilter}\n onClearAll={clearAll}\n showChips={chips}\n />\n\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"w-full max-w-sm p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n\n <div className=\"flex items-center justify-between pr-10 pl-5 py-4 border-b border-border/60 shrink-0\">\n <DialogTitle className=\"text-base font-bold flex items-center gap-2\">\n <SlidersHorizontal className=\"h-4 w-4\" />\n Filters\n {totalActiveCount > 0 && (\n <Badge variant=\"secondary\" className=\"text-2xs font-medium\">\n {totalActiveCount} active\n </Badge>\n )}\n </DialogTitle>\n {totalActiveCount > 0 && (\n <button\n onClick={clearAll}\n className=\"text-2xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors\"\n >\n Clear all\n </button>\n )}\n </div>\n\n <CollectionFiltersBody\n sort={sort}\n onSortChange={onSortChange}\n traitSections={traitSections}\n selected={selected}\n onToggleValue={toggleValue}\n />\n\n <div className=\"px-5 pt-3 pb-5 border-t border-border/60 shrink-0\">\n <button\n className=\"w-full h-11 rounded-[11px] bg-brand-purple text-white text-sm font-semibold flex items-center justify-center gap-2 hover:brightness-110 active:scale-[0.98] transition-all\"\n onClick={() => setOpen(false)}\n >\n {totalActiveCount > 0\n ? `Show results (${totalActiveCount} filter${totalActiveCount > 1 ? \"s\" : \"\"})`\n : \"Close\"}\n </button>\n </div>\n\n </DialogContent>\n </Dialog>\n </>\n );\n}\n\nexport function CollectionActiveFilters({ tokens, selected, onChange, sort, onSortChange }: Omit<CollectionFiltersDialogProps, \"chips\">) {\n const { activeEntries, totalActiveCount, sortIsDefault, clearAll, removeFilter } =\n useCollectionFilters(tokens, selected, onChange, sort, onSortChange);\n return (\n <CollectionFiltersTrigger\n totalActiveCount={totalActiveCount}\n sortIsDefault={sortIsDefault}\n sort={sort}\n activeEntries={activeEntries}\n onOpen={() => {}}\n onSortReset={() => onSortChange(\"recent\")}\n onRemoveFilter={removeFilter}\n onClearAll={clearAll}\n showButton={false}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA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AAA,UAE3B,6BAAmB,IAChB,iBAAiB,gBAAgB,UAAU,mBAAmB,IAAI,MAAM,EAAE,MAC1E;AAAA;AAAA,MACN,GACF;AAAA,OAEF,GACF;AAAA,KACF;AAEJ;AAEO,SAAS,wBAAwB,EAAE,QAAQ,UAAU,UAAU,MAAM,aAAa,GAAgD;AACvI,QAAM,EAAE,eAAe,kBAAkB,eAAe,UAAU,aAAa,QAC7E,gDAAqB,QAAQ,UAAU,UAAU,MAAM,YAAY;AACrE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,MAAM;AAAA,MAAC;AAAA,MACf,aAAa,MAAM,aAAa,QAAQ;AAAA,MACxC,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,YAAY;AAAA;AAAA,EACd;AAEJ;","names":[]}
|
|
@@ -35,7 +35,7 @@ function CollectionFiltersDialog({
|
|
|
35
35
|
/* @__PURE__ */ jsxs(DialogTitle, { className: "text-base font-bold flex items-center gap-2", children: [
|
|
36
36
|
/* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-4 w-4" }),
|
|
37
37
|
"Filters",
|
|
38
|
-
totalActiveCount > 0 && /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "text-
|
|
38
|
+
totalActiveCount > 0 && /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "text-2xs font-medium", children: [
|
|
39
39
|
totalActiveCount,
|
|
40
40
|
" active"
|
|
41
41
|
] })
|
|
@@ -44,7 +44,7 @@ function CollectionFiltersDialog({
|
|
|
44
44
|
"button",
|
|
45
45
|
{
|
|
46
46
|
onClick: clearAll,
|
|
47
|
-
className: "text-
|
|
47
|
+
className: "text-2xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors",
|
|
48
48
|
children: "Clear all"
|
|
49
49
|
}
|
|
50
50
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-filters-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { SlidersHorizontal } from \"lucide-react\";\nimport { Badge } from \"./badge.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { useCollectionFilters, CollectionFiltersTrigger, CollectionFiltersBody } from \"./collection-filters.js\";\nimport type { ApiToken, CollectionTokensSort } from \"@medialane/sdk\";\n\nexport interface CollectionFiltersDialogProps {\n tokens: ApiToken[];\n selected: Record<string, string[]>;\n onChange: (filters: Record<string, string[]>) => void;\n sort: CollectionTokensSort;\n onSortChange: (sort: CollectionTokensSort) => void;\n chips?: boolean;\n}\n\nexport function CollectionFiltersDialog({\n tokens,\n selected,\n onChange,\n sort,\n onSortChange,\n chips = true,\n}: CollectionFiltersDialogProps) {\n const [open, setOpen] = useState(false);\n const { traitSections, activeEntries, totalActiveCount, sortIsDefault, toggleValue, clearAll, removeFilter } =\n useCollectionFilters(tokens, selected, onChange, sort, onSortChange);\n\n return (\n <>\n <CollectionFiltersTrigger\n totalActiveCount={totalActiveCount}\n sortIsDefault={sortIsDefault}\n sort={sort}\n activeEntries={activeEntries}\n onOpen={() => setOpen(true)}\n onSortReset={() => onSortChange(\"recent\")}\n onRemoveFilter={removeFilter}\n onClearAll={clearAll}\n showChips={chips}\n />\n\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"w-full max-w-sm p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n\n <div className=\"flex items-center justify-between pr-10 pl-5 py-4 border-b border-border/60 shrink-0\">\n <DialogTitle className=\"text-base font-bold flex items-center gap-2\">\n <SlidersHorizontal className=\"h-4 w-4\" />\n Filters\n {totalActiveCount > 0 && (\n <Badge variant=\"secondary\" className=\"text-
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-filters-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { SlidersHorizontal } from \"lucide-react\";\nimport { Badge } from \"./badge.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { useCollectionFilters, CollectionFiltersTrigger, CollectionFiltersBody } from \"./collection-filters.js\";\nimport type { ApiToken, CollectionTokensSort } from \"@medialane/sdk\";\n\nexport interface CollectionFiltersDialogProps {\n tokens: ApiToken[];\n selected: Record<string, string[]>;\n onChange: (filters: Record<string, string[]>) => void;\n sort: CollectionTokensSort;\n onSortChange: (sort: CollectionTokensSort) => void;\n chips?: boolean;\n}\n\nexport function CollectionFiltersDialog({\n tokens,\n selected,\n onChange,\n sort,\n onSortChange,\n chips = true,\n}: CollectionFiltersDialogProps) {\n const [open, setOpen] = useState(false);\n const { traitSections, activeEntries, totalActiveCount, sortIsDefault, toggleValue, clearAll, removeFilter } =\n useCollectionFilters(tokens, selected, onChange, sort, onSortChange);\n\n return (\n <>\n <CollectionFiltersTrigger\n totalActiveCount={totalActiveCount}\n sortIsDefault={sortIsDefault}\n sort={sort}\n activeEntries={activeEntries}\n onOpen={() => setOpen(true)}\n onSortReset={() => onSortChange(\"recent\")}\n onRemoveFilter={removeFilter}\n onClearAll={clearAll}\n showChips={chips}\n />\n\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"w-full max-w-sm p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n\n <div className=\"flex items-center justify-between pr-10 pl-5 py-4 border-b border-border/60 shrink-0\">\n <DialogTitle className=\"text-base font-bold flex items-center gap-2\">\n <SlidersHorizontal className=\"h-4 w-4\" />\n Filters\n {totalActiveCount > 0 && (\n <Badge variant=\"secondary\" className=\"text-2xs font-medium\">\n {totalActiveCount} active\n </Badge>\n )}\n </DialogTitle>\n {totalActiveCount > 0 && (\n <button\n onClick={clearAll}\n className=\"text-2xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors\"\n >\n Clear all\n </button>\n )}\n </div>\n\n <CollectionFiltersBody\n sort={sort}\n onSortChange={onSortChange}\n traitSections={traitSections}\n selected={selected}\n onToggleValue={toggleValue}\n />\n\n <div className=\"px-5 pt-3 pb-5 border-t border-border/60 shrink-0\">\n <button\n className=\"w-full h-11 rounded-[11px] bg-brand-purple text-white text-sm font-semibold flex items-center justify-center gap-2 hover:brightness-110 active:scale-[0.98] transition-all\"\n onClick={() => setOpen(false)}\n >\n {totalActiveCount > 0\n ? `Show results (${totalActiveCount} filter${totalActiveCount > 1 ? \"s\" : \"\"})`\n : \"Close\"}\n </button>\n </div>\n\n </DialogContent>\n </Dialog>\n </>\n );\n}\n\nexport function CollectionActiveFilters({ tokens, selected, onChange, sort, onSortChange }: Omit<CollectionFiltersDialogProps, \"chips\">) {\n const { activeEntries, totalActiveCount, sortIsDefault, clearAll, removeFilter } =\n useCollectionFilters(tokens, selected, onChange, sort, onSortChange);\n return (\n <CollectionFiltersTrigger\n totalActiveCount={totalActiveCount}\n sortIsDefault={sortIsDefault}\n sort={sort}\n activeEntries={activeEntries}\n onOpen={() => {}}\n onSortReset={() => onSortChange(\"recent\")}\n onRemoveFilter={removeFilter}\n onClearAll={clearAll}\n showButton={false}\n />\n );\n}\n"],"mappings":";AA+BI,mBACE,KAoBU,YArBZ;AA7BJ,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,mBAAmB;AACnD,SAAS,sBAAsB,0BAA0B,6BAA6B;AAY/E,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,GAAiC;AAC/B,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,EAAE,eAAe,eAAe,kBAAkB,eAAe,aAAa,UAAU,aAAa,IACzG,qBAAqB,QAAQ,UAAU,UAAU,MAAM,YAAY;AAErE,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QAAQ,MAAM,QAAQ,IAAI;AAAA,QAC1B,aAAa,MAAM,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d;AAEJ;","names":[]}
|
|
@@ -147,7 +147,7 @@ function CreatorPage({ address: addressProp, username, useAssetActions, useMarke
|
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-3.5 w-3.5" }),
|
|
149
149
|
label,
|
|
150
|
-
count ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("min-w-[18px] rounded-full px-1.5 py-px text-center text-
|
|
150
|
+
count ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("min-w-[18px] rounded-full px-1.5 py-px text-center text-2xs font-bold tabular-nums", active ? "bg-primary/15 text-primary" : "bg-muted text-muted-foreground"), children: count }) : null,
|
|
151
151
|
active ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "absolute inset-x-0 bottom-0 h-0.5 rounded-full bg-primary" }) : null
|
|
152
152
|
]
|
|
153
153
|
},
|