@medialane/ui 0.300.0 → 0.301.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/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/collection-page.cjs +2 -11
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.js +2 -11
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/collection-provenance-tab.cjs +206 -0
- package/dist/components/collection-provenance-tab.cjs.map +1 -0
- package/dist/components/collection-provenance-tab.d.cts +8 -0
- package/dist/components/collection-provenance-tab.d.ts +8 -0
- package/dist/components/collection-provenance-tab.js +172 -0
- package/dist/components/collection-provenance-tab.js.map +1 -0
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +3 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/collection-activity-tab.cjs +0 -60
- package/dist/components/collection-activity-tab.cjs.map +0 -1
- package/dist/components/collection-activity-tab.d.cts +0 -8
- package/dist/components/collection-activity-tab.d.ts +0 -8
- package/dist/components/collection-activity-tab.js +0 -36
- package/dist/components/collection-activity-tab.js.map +0 -1
- package/dist/components/collection-traits-tab.cjs +0 -79
- package/dist/components/collection-traits-tab.cjs.map +0 -1
- package/dist/components/collection-traits-tab.d.cts +0 -8
- package/dist/components/collection-traits-tab.d.ts +0 -8
- package/dist/components/collection-traits-tab.js +0 -55
- package/dist/components/collection-traits-tab.js.map +0 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var collection_provenance_tab_exports = {};
|
|
31
|
+
__export(collection_provenance_tab_exports, {
|
|
32
|
+
CollectionProvenanceTab: () => CollectionProvenanceTab
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(collection_provenance_tab_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_sdk = require("@medialane/sdk");
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var import_image = __toESM(require("./image.js"), 1);
|
|
40
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
41
|
+
var import_address_display = require("./address-display.js");
|
|
42
|
+
var import_currency_icon = require("./currency-icon.js");
|
|
43
|
+
var import_load_more_sentinel = require("./load-more-sentinel.js");
|
|
44
|
+
var import_use_activities = require("../utils/use-activities.js");
|
|
45
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
46
|
+
var import_activity = require("../data/activity.js");
|
|
47
|
+
var import_explorer_url = require("../utils/explorer-url.js");
|
|
48
|
+
var import_format = require("../utils/format.js");
|
|
49
|
+
var import_time = require("../utils/time.js");
|
|
50
|
+
var import_cn = require("../utils/cn.js");
|
|
51
|
+
const PAGE_SIZE = 30;
|
|
52
|
+
const EVENT_TITLE = {
|
|
53
|
+
mint: "Minted",
|
|
54
|
+
listing: "Listed for sale",
|
|
55
|
+
sale: "Purchased",
|
|
56
|
+
offer: "Offer made",
|
|
57
|
+
transfer: "Transferred",
|
|
58
|
+
cancelled: "Listing cancelled"
|
|
59
|
+
};
|
|
60
|
+
function dayLabel(iso) {
|
|
61
|
+
const date = new Date(iso);
|
|
62
|
+
const today = /* @__PURE__ */ new Date();
|
|
63
|
+
const yesterday = /* @__PURE__ */ new Date();
|
|
64
|
+
yesterday.setDate(today.getDate() - 1);
|
|
65
|
+
if (date.toDateString() === today.toDateString()) return "Today";
|
|
66
|
+
if (date.toDateString() === yesterday.toDateString()) return "Yesterday";
|
|
67
|
+
return date.toLocaleDateString(void 0, { day: "numeric", month: "long", year: "numeric" });
|
|
68
|
+
}
|
|
69
|
+
function groupByDay(events) {
|
|
70
|
+
const groups = [];
|
|
71
|
+
for (const event of events) {
|
|
72
|
+
const label = dayLabel(event.timestamp);
|
|
73
|
+
const last = groups[groups.length - 1];
|
|
74
|
+
if (last && last.label === label) last.events.push(event);
|
|
75
|
+
else groups.push({ label, events: [event] });
|
|
76
|
+
}
|
|
77
|
+
return groups;
|
|
78
|
+
}
|
|
79
|
+
function ProvenanceEvent({ event, showAsset }) {
|
|
80
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
81
|
+
const config = import_activity.ACTIVITY_TYPE_CONFIG[event.type];
|
|
82
|
+
const Icon = config?.icon ?? import_lucide_react.ExternalLink;
|
|
83
|
+
const contract = event.nftContract ?? event.contractAddress ?? null;
|
|
84
|
+
const tokenId = event.nftTokenId ?? event.tokenId ?? null;
|
|
85
|
+
const actor = event.offerer ?? event.fulfiller ?? (event.type === "mint" ? event.to : event.from) ?? null;
|
|
86
|
+
const amount = event.amount && Number(event.amount) > 1 ? event.amount : null;
|
|
87
|
+
const name = event.token?.name ?? (tokenId ? `#${tokenId}` : null);
|
|
88
|
+
const image = resolveImage(event.token?.image ?? null);
|
|
89
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "relative pl-12 pb-6 last:pb-0", children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
"span",
|
|
92
|
+
{
|
|
93
|
+
className: (0, import_cn.cn)(
|
|
94
|
+
"absolute left-0 top-0 flex h-8 w-8 items-center justify-center rounded-full ring-4 ring-background",
|
|
95
|
+
config?.bgClass ?? "bg-muted"
|
|
96
|
+
),
|
|
97
|
+
"aria-hidden": true,
|
|
98
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_cn.cn)("h-4 w-4", config?.colorClass ?? "text-muted-foreground") })
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-semibold leading-8 sm:leading-8", children: [
|
|
104
|
+
EVENT_TITLE[event.type] ?? event.type,
|
|
105
|
+
amount ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ml-1.5 text-xs font-medium text-muted-foreground", children: [
|
|
106
|
+
"\xD7",
|
|
107
|
+
amount
|
|
108
|
+
] }) : null,
|
|
109
|
+
actor ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "font-normal text-muted-foreground", children: [
|
|
110
|
+
" by ",
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
import_link.default,
|
|
113
|
+
{
|
|
114
|
+
href: (0, import_sdk.profileHref)({ address: actor }),
|
|
115
|
+
className: "hover:text-primary transition-colors",
|
|
116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: actor, chars: 4, showCopy: false, className: "text-xs" })
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] }) : null
|
|
120
|
+
] }),
|
|
121
|
+
showAsset && name ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
122
|
+
import_link.default,
|
|
123
|
+
{
|
|
124
|
+
href: contract && tokenId ? (0, import_sdk.assetHref)(event.chain ?? "STARKNET", contract, tokenId) : "#",
|
|
125
|
+
className: "mt-1 inline-flex max-w-full items-center gap-2 rounded-lg bg-muted/40 py-1 pl-1 pr-3 hover:bg-muted transition-colors",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "relative h-8 w-8 shrink-0 overflow-hidden rounded-md bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: image, alt: "", width: 32, height: 32, className: "h-full w-full object-cover", unoptimized: true }) : null }),
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate text-xs font-medium", children: name })
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
) : null
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex shrink-0 flex-col items-end gap-0.5 pt-1.5", children: [
|
|
134
|
+
event.price?.formatted ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5 text-sm font-bold tabular-nums", children: [
|
|
135
|
+
event.price.currency ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: event.price.currency, size: 13, "aria-hidden": true }) : null,
|
|
136
|
+
(0, import_format.formatDisplayPrice)(event.price.formatted)
|
|
137
|
+
] }) : null,
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", { dateTime: event.timestamp, title: new Date(event.timestamp).toLocaleString(), children: (0, import_time.timeAgo)(event.timestamp) }),
|
|
140
|
+
event.txHash ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
"a",
|
|
142
|
+
{
|
|
143
|
+
href: `${import_explorer_url.EXPLORER_URL}/tx/${event.txHash}`,
|
|
144
|
+
target: "_blank",
|
|
145
|
+
rel: "noopener noreferrer",
|
|
146
|
+
className: "rounded p-0.5 hover:bg-muted hover:text-foreground transition-colors",
|
|
147
|
+
"aria-label": "View transaction",
|
|
148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ExternalLink, { className: "h-3 w-3", "aria-hidden": true })
|
|
149
|
+
}
|
|
150
|
+
) : null
|
|
151
|
+
] })
|
|
152
|
+
] })
|
|
153
|
+
] })
|
|
154
|
+
] });
|
|
155
|
+
}
|
|
156
|
+
function ProvenanceSkeleton() {
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-6", "aria-hidden": true, children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start gap-4", children: [
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-8 w-8 shrink-0 rounded-full bg-muted animate-pulse" }),
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 space-y-2 pt-1", children: [
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-3.5 w-40 rounded bg-muted animate-pulse" }),
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-3 w-24 rounded bg-muted animate-pulse" })
|
|
162
|
+
] })
|
|
163
|
+
] }, i)) });
|
|
164
|
+
}
|
|
165
|
+
function CollectionProvenanceTab({ contract }) {
|
|
166
|
+
const [page, setPage] = (0, import_react.useState)(1);
|
|
167
|
+
const [all, setAll] = (0, import_react.useState)([]);
|
|
168
|
+
const { activities, meta, isLoading } = (0, import_use_activities.useActivities)({ contract, page, limit: PAGE_SIZE });
|
|
169
|
+
(0, import_react.useEffect)(() => {
|
|
170
|
+
if (activities.length === 0) return;
|
|
171
|
+
setAll((prev) => page === 1 ? activities : [...prev, ...activities]);
|
|
172
|
+
}, [activities, page]);
|
|
173
|
+
const groups = (0, import_react.useMemo)(() => groupByDay(all), [all]);
|
|
174
|
+
const showAsset = (0, import_react.useMemo)(
|
|
175
|
+
() => new Set(all.map((e) => e.nftTokenId ?? e.tokenId ?? "")).size > 1,
|
|
176
|
+
[all]
|
|
177
|
+
);
|
|
178
|
+
const hasMore = meta ? all.length < (meta.total ?? 0) : false;
|
|
179
|
+
if (isLoading && all.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProvenanceSkeleton, {});
|
|
180
|
+
if (all.length === 0) {
|
|
181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Inbox, { className: "h-10 w-10 text-muted-foreground/40" }),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium text-muted-foreground", children: "No history yet" }),
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground/70 max-w-xs", children: "Mints, transfers, listings and sales will appear here as they happen." })
|
|
185
|
+
] });
|
|
186
|
+
}
|
|
187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mx-auto max-w-2xl", children: [
|
|
188
|
+
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "mb-8 last:mb-0", children: [
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "mb-4 pl-12 text-xs font-medium text-muted-foreground", children: group.label }),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "relative before:absolute before:left-4 before:top-4 before:bottom-4 before:w-px before:bg-border", children: group.events.map((event, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
+
ProvenanceEvent,
|
|
192
|
+
{
|
|
193
|
+
event,
|
|
194
|
+
showAsset
|
|
195
|
+
},
|
|
196
|
+
`${event.txHash ?? event.orderHash}-${event.type}-${i}`
|
|
197
|
+
)) })
|
|
198
|
+
] }, group.label)),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_load_more_sentinel.LoadMoreSentinel, { hasMore, isLoading, onLoadMore: () => setPage((p) => p + 1) })
|
|
200
|
+
] });
|
|
201
|
+
}
|
|
202
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
203
|
+
0 && (module.exports = {
|
|
204
|
+
CollectionProvenanceTab
|
|
205
|
+
});
|
|
206
|
+
//# sourceMappingURL=collection-provenance-tab.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-provenance-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport type { ApiActivity } from \"@medialane/sdk\";\nimport { assetHref, profileHref } from \"@medialane/sdk\";\nimport { ExternalLink, Inbox } from \"lucide-react\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { ACTIVITY_TYPE_CONFIG } from \"../data/activity.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst PAGE_SIZE = 30;\n\nconst EVENT_TITLE: Record<string, string> = {\n mint: \"Minted\",\n listing: \"Listed for sale\",\n sale: \"Purchased\",\n offer: \"Offer made\",\n transfer: \"Transferred\",\n cancelled: \"Listing cancelled\",\n};\n\nfunction dayLabel(iso: string): string {\n const date = new Date(iso);\n const today = new Date();\n const yesterday = new Date();\n yesterday.setDate(today.getDate() - 1);\n if (date.toDateString() === today.toDateString()) return \"Today\";\n if (date.toDateString() === yesterday.toDateString()) return \"Yesterday\";\n return date.toLocaleDateString(undefined, { day: \"numeric\", month: \"long\", year: \"numeric\" });\n}\n\nfunction groupByDay(events: ApiActivity[]) {\n const groups: { label: string; events: ApiActivity[] }[] = [];\n for (const event of events) {\n const label = dayLabel(event.timestamp);\n const last = groups[groups.length - 1];\n if (last && last.label === label) last.events.push(event);\n else groups.push({ label, events: [event] });\n }\n return groups;\n}\n\nfunction ProvenanceEvent({ event, showAsset }: { event: ApiActivity; showAsset: boolean }) {\n const resolveImage = useImageUrl();\n const config = ACTIVITY_TYPE_CONFIG[event.type];\n const Icon = config?.icon ?? ExternalLink;\n const contract = event.nftContract ?? event.contractAddress ?? null;\n const tokenId = event.nftTokenId ?? event.tokenId ?? null;\n const actor =\n event.offerer ?? event.fulfiller ?? (event.type === \"mint\" ? event.to : event.from) ?? null;\n const amount = event.amount && Number(event.amount) > 1 ? event.amount : null;\n const name = event.token?.name ?? (tokenId ? `#${tokenId}` : null);\n const image = resolveImage(event.token?.image ?? null);\n\n return (\n <li className=\"relative pl-12 pb-6 last:pb-0\">\n <span\n className={cn(\n \"absolute left-0 top-0 flex h-8 w-8 items-center justify-center rounded-full ring-4 ring-background\",\n config?.bgClass ?? \"bg-muted\"\n )}\n aria-hidden\n >\n <Icon className={cn(\"h-4 w-4\", config?.colorClass ?? \"text-muted-foreground\")} />\n </span>\n\n <div className=\"flex items-start gap-3\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold leading-8 sm:leading-8\">\n {EVENT_TITLE[event.type] ?? event.type}\n {amount ? <span className=\"ml-1.5 text-xs font-medium text-muted-foreground\">×{amount}</span> : null}\n {actor ? (\n <span className=\"font-normal text-muted-foreground\">\n {\" by \"}\n <Link\n href={profileHref({ address: actor })}\n className=\"hover:text-primary transition-colors\"\n >\n <AddressDisplay address={actor} chars={4} showCopy={false} className=\"text-xs\" />\n </Link>\n </span>\n ) : null}\n </p>\n\n {showAsset && name ? (\n <Link\n href={contract && tokenId ? assetHref(event.chain ?? \"STARKNET\", contract, tokenId) : \"#\"}\n className=\"mt-1 inline-flex max-w-full items-center gap-2 rounded-lg bg-muted/40 py-1 pl-1 pr-3 hover:bg-muted transition-colors\"\n >\n <span className=\"relative h-8 w-8 shrink-0 overflow-hidden rounded-md bg-muted\">\n {image ? (\n <Image src={image} alt=\"\" width={32} height={32} className=\"h-full w-full object-cover\" unoptimized />\n ) : null}\n </span>\n <span className=\"truncate text-xs font-medium\">{name}</span>\n </Link>\n ) : null}\n </div>\n\n <div className=\"flex shrink-0 flex-col items-end gap-0.5 pt-1.5\">\n {event.price?.formatted ? (\n <span className=\"flex items-center gap-1.5 text-sm font-bold tabular-nums\">\n {event.price.currency ? <CurrencyIcon symbol={event.price.currency} size={13} aria-hidden /> : null}\n {formatDisplayPrice(event.price.formatted)}\n </span>\n ) : null}\n <span className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n <time dateTime={event.timestamp} title={new Date(event.timestamp).toLocaleString()}>\n {timeAgo(event.timestamp)}\n </time>\n {event.txHash ? (\n <a\n href={`${EXPLORER_URL}/tx/${event.txHash}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"rounded p-0.5 hover:bg-muted hover:text-foreground transition-colors\"\n aria-label=\"View transaction\"\n >\n <ExternalLink className=\"h-3 w-3\" aria-hidden />\n </a>\n ) : null}\n </span>\n </div>\n </div>\n </li>\n );\n}\n\nfunction ProvenanceSkeleton() {\n return (\n <div className=\"space-y-6\" aria-hidden>\n {Array.from({ length: 6 }).map((_, i) => (\n <div key={i} className=\"flex items-start gap-4\">\n <div className=\"h-8 w-8 shrink-0 rounded-full bg-muted animate-pulse\" />\n <div className=\"flex-1 space-y-2 pt-1\">\n <div className=\"h-3.5 w-40 rounded bg-muted animate-pulse\" />\n <div className=\"h-3 w-24 rounded bg-muted animate-pulse\" />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nexport interface CollectionProvenanceTabProps {\n contract: string;\n}\n\nexport function CollectionProvenanceTab({ contract }: CollectionProvenanceTabProps) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiActivity[]>([]);\n const { activities, meta, isLoading } = useActivities({ contract, page, limit: PAGE_SIZE });\n\n useEffect(() => {\n if (activities.length === 0) return;\n setAll((prev) => (page === 1 ? activities : [...prev, ...activities]));\n }, [activities, page]);\n\n const groups = useMemo(() => groupByDay(all), [all]);\n const showAsset = useMemo(\n () => new Set(all.map((e) => e.nftTokenId ?? e.tokenId ?? \"\")).size > 1,\n [all]\n );\n const hasMore = meta ? all.length < (meta.total ?? 0) : false;\n\n if (isLoading && all.length === 0) return <ProvenanceSkeleton />;\n\n if (all.length === 0) {\n return (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <Inbox className=\"h-10 w-10 text-muted-foreground/40\" />\n <p className=\"text-sm font-medium text-muted-foreground\">No history yet</p>\n <p className=\"text-xs text-muted-foreground/70 max-w-xs\">\n Mints, transfers, listings and sales will appear here as they happen.\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"mx-auto max-w-2xl\">\n {groups.map((group) => (\n <section key={group.label} className=\"mb-8 last:mb-0\">\n <h3 className=\"mb-4 pl-12 text-xs font-medium text-muted-foreground\">{group.label}</h3>\n <ol className=\"relative before:absolute before:left-4 before:top-4 before:bottom-4 before:w-px before:bg-border\">\n {group.events.map((event, i) => (\n <ProvenanceEvent\n key={`${event.txHash ?? event.orderHash}-${event.type}-${i}`}\n event={event}\n showAsset={showAsset}\n />\n ))}\n </ol>\n </section>\n ))}\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwEQ;AAtER,mBAA6C;AAE7C,iBAAuC;AACvC,0BAAoC;AACpC,mBAAkB;AAClB,kBAAiB;AACjB,6BAA+B;AAC/B,2BAA6B;AAC7B,gCAAiC;AACjC,4BAA8B;AAC9B,2BAA4B;AAC5B,sBAAqC;AACrC,0BAA6B;AAC7B,oBAAmC;AACnC,kBAAwB;AACxB,gBAAmB;AAEnB,MAAM,YAAY;AAElB,MAAM,cAAsC;AAAA,EAC1C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AACb;AAEA,SAAS,SAAS,KAAqB;AACrC,QAAM,OAAO,IAAI,KAAK,GAAG;AACzB,QAAM,QAAQ,oBA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,GAAG,GAAG,CAAC,GAAG,CAAC;AACnD,QAAM,gBAAY;AAAA,IAChB,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO;AAAA,IACtE,CAAC,GAAG;AAAA,EACN;AACA,QAAM,UAAU,OAAO,IAAI,UAAU,KAAK,SAAS,KAAK;AAExD,MAAI,aAAa,IAAI,WAAW,EAAG,QAAO,4CAAC,sBAAmB;AAE9D,MAAI,IAAI,WAAW,GAAG;AACpB,WACE,6CAAC,SAAI,WAAU,sDACb;AAAA,kDAAC,6BAAM,WAAU,sCAAqC;AAAA,MACtD,4CAAC,OAAE,WAAU,6CAA4C,4BAAc;AAAA,MACvE,4CAAC,OAAE,WAAU,6CAA4C,mFAEzD;AAAA,OACF;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,WAAU,qBACZ;AAAA,WAAO,IAAI,CAAC,UACX,6CAAC,aAA0B,WAAU,kBACnC;AAAA,kDAAC,QAAG,WAAU,wDAAwD,gBAAM,OAAM;AAAA,MAClF,4CAAC,QAAG,WAAU,oGACX,gBAAM,OAAO,IAAI,CAAC,OAAO,MACxB;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA;AAAA,QAFK,GAAG,MAAM,UAAU,MAAM,SAAS,IAAI,MAAM,IAAI,IAAI,CAAC;AAAA,MAG5D,CACD,GACH;AAAA,SAVY,MAAM,KAWpB,CACD;AAAA,IACD,4CAAC,8CAAiB,SAAkB,WAAsB,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG;AAAA,KACrG;AAEJ;","names":["Link","Image"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CollectionProvenanceTabProps {
|
|
4
|
+
contract: string;
|
|
5
|
+
}
|
|
6
|
+
declare function CollectionProvenanceTab({ contract }: CollectionProvenanceTabProps): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { CollectionProvenanceTab, type CollectionProvenanceTabProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CollectionProvenanceTabProps {
|
|
4
|
+
contract: string;
|
|
5
|
+
}
|
|
6
|
+
declare function CollectionProvenanceTab({ contract }: CollectionProvenanceTabProps): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { CollectionProvenanceTab, type CollectionProvenanceTabProps };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useMemo } from "react";
|
|
4
|
+
import { assetHref, profileHref } from "@medialane/sdk";
|
|
5
|
+
import { ExternalLink, Inbox } from "lucide-react";
|
|
6
|
+
import Image from "./image.js";
|
|
7
|
+
import Link from "./link.js";
|
|
8
|
+
import { AddressDisplay } from "./address-display.js";
|
|
9
|
+
import { CurrencyIcon } from "./currency-icon.js";
|
|
10
|
+
import { LoadMoreSentinel } from "./load-more-sentinel.js";
|
|
11
|
+
import { useActivities } from "../utils/use-activities.js";
|
|
12
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
13
|
+
import { ACTIVITY_TYPE_CONFIG } from "../data/activity.js";
|
|
14
|
+
import { EXPLORER_URL } from "../utils/explorer-url.js";
|
|
15
|
+
import { formatDisplayPrice } from "../utils/format.js";
|
|
16
|
+
import { timeAgo } from "../utils/time.js";
|
|
17
|
+
import { cn } from "../utils/cn.js";
|
|
18
|
+
const PAGE_SIZE = 30;
|
|
19
|
+
const EVENT_TITLE = {
|
|
20
|
+
mint: "Minted",
|
|
21
|
+
listing: "Listed for sale",
|
|
22
|
+
sale: "Purchased",
|
|
23
|
+
offer: "Offer made",
|
|
24
|
+
transfer: "Transferred",
|
|
25
|
+
cancelled: "Listing cancelled"
|
|
26
|
+
};
|
|
27
|
+
function dayLabel(iso) {
|
|
28
|
+
const date = new Date(iso);
|
|
29
|
+
const today = /* @__PURE__ */ new Date();
|
|
30
|
+
const yesterday = /* @__PURE__ */ new Date();
|
|
31
|
+
yesterday.setDate(today.getDate() - 1);
|
|
32
|
+
if (date.toDateString() === today.toDateString()) return "Today";
|
|
33
|
+
if (date.toDateString() === yesterday.toDateString()) return "Yesterday";
|
|
34
|
+
return date.toLocaleDateString(void 0, { day: "numeric", month: "long", year: "numeric" });
|
|
35
|
+
}
|
|
36
|
+
function groupByDay(events) {
|
|
37
|
+
const groups = [];
|
|
38
|
+
for (const event of events) {
|
|
39
|
+
const label = dayLabel(event.timestamp);
|
|
40
|
+
const last = groups[groups.length - 1];
|
|
41
|
+
if (last && last.label === label) last.events.push(event);
|
|
42
|
+
else groups.push({ label, events: [event] });
|
|
43
|
+
}
|
|
44
|
+
return groups;
|
|
45
|
+
}
|
|
46
|
+
function ProvenanceEvent({ event, showAsset }) {
|
|
47
|
+
const resolveImage = useImageUrl();
|
|
48
|
+
const config = ACTIVITY_TYPE_CONFIG[event.type];
|
|
49
|
+
const Icon = config?.icon ?? ExternalLink;
|
|
50
|
+
const contract = event.nftContract ?? event.contractAddress ?? null;
|
|
51
|
+
const tokenId = event.nftTokenId ?? event.tokenId ?? null;
|
|
52
|
+
const actor = event.offerer ?? event.fulfiller ?? (event.type === "mint" ? event.to : event.from) ?? null;
|
|
53
|
+
const amount = event.amount && Number(event.amount) > 1 ? event.amount : null;
|
|
54
|
+
const name = event.token?.name ?? (tokenId ? `#${tokenId}` : null);
|
|
55
|
+
const image = resolveImage(event.token?.image ?? null);
|
|
56
|
+
return /* @__PURE__ */ jsxs("li", { className: "relative pl-12 pb-6 last:pb-0", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
"span",
|
|
59
|
+
{
|
|
60
|
+
className: cn(
|
|
61
|
+
"absolute left-0 top-0 flex h-8 w-8 items-center justify-center rounded-full ring-4 ring-background",
|
|
62
|
+
config?.bgClass ?? "bg-muted"
|
|
63
|
+
),
|
|
64
|
+
"aria-hidden": true,
|
|
65
|
+
children: /* @__PURE__ */ jsx(Icon, { className: cn("h-4 w-4", config?.colorClass ?? "text-muted-foreground") })
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
69
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
70
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm font-semibold leading-8 sm:leading-8", children: [
|
|
71
|
+
EVENT_TITLE[event.type] ?? event.type,
|
|
72
|
+
amount ? /* @__PURE__ */ jsxs("span", { className: "ml-1.5 text-xs font-medium text-muted-foreground", children: [
|
|
73
|
+
"\xD7",
|
|
74
|
+
amount
|
|
75
|
+
] }) : null,
|
|
76
|
+
actor ? /* @__PURE__ */ jsxs("span", { className: "font-normal text-muted-foreground", children: [
|
|
77
|
+
" by ",
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Link,
|
|
80
|
+
{
|
|
81
|
+
href: profileHref({ address: actor }),
|
|
82
|
+
className: "hover:text-primary transition-colors",
|
|
83
|
+
children: /* @__PURE__ */ jsx(AddressDisplay, { address: actor, chars: 4, showCopy: false, className: "text-xs" })
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] }) : null
|
|
87
|
+
] }),
|
|
88
|
+
showAsset && name ? /* @__PURE__ */ jsxs(
|
|
89
|
+
Link,
|
|
90
|
+
{
|
|
91
|
+
href: contract && tokenId ? assetHref(event.chain ?? "STARKNET", contract, tokenId) : "#",
|
|
92
|
+
className: "mt-1 inline-flex max-w-full items-center gap-2 rounded-lg bg-muted/40 py-1 pl-1 pr-3 hover:bg-muted transition-colors",
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx("span", { className: "relative h-8 w-8 shrink-0 overflow-hidden rounded-md bg-muted", children: image ? /* @__PURE__ */ jsx(Image, { src: image, alt: "", width: 32, height: 32, className: "h-full w-full object-cover", unoptimized: true }) : null }),
|
|
95
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: name })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
) : null
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-col items-end gap-0.5 pt-1.5", children: [
|
|
101
|
+
event.price?.formatted ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-sm font-bold tabular-nums", children: [
|
|
102
|
+
event.price.currency ? /* @__PURE__ */ jsx(CurrencyIcon, { symbol: event.price.currency, size: 13, "aria-hidden": true }) : null,
|
|
103
|
+
formatDisplayPrice(event.price.formatted)
|
|
104
|
+
] }) : null,
|
|
105
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
106
|
+
/* @__PURE__ */ jsx("time", { dateTime: event.timestamp, title: new Date(event.timestamp).toLocaleString(), children: timeAgo(event.timestamp) }),
|
|
107
|
+
event.txHash ? /* @__PURE__ */ jsx(
|
|
108
|
+
"a",
|
|
109
|
+
{
|
|
110
|
+
href: `${EXPLORER_URL}/tx/${event.txHash}`,
|
|
111
|
+
target: "_blank",
|
|
112
|
+
rel: "noopener noreferrer",
|
|
113
|
+
className: "rounded p-0.5 hover:bg-muted hover:text-foreground transition-colors",
|
|
114
|
+
"aria-label": "View transaction",
|
|
115
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3", "aria-hidden": true })
|
|
116
|
+
}
|
|
117
|
+
) : null
|
|
118
|
+
] })
|
|
119
|
+
] })
|
|
120
|
+
] })
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
function ProvenanceSkeleton() {
|
|
124
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-6", "aria-hidden": true, children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
|
|
125
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 w-8 shrink-0 rounded-full bg-muted animate-pulse" }),
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2 pt-1", children: [
|
|
127
|
+
/* @__PURE__ */ jsx("div", { className: "h-3.5 w-40 rounded bg-muted animate-pulse" }),
|
|
128
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-24 rounded bg-muted animate-pulse" })
|
|
129
|
+
] })
|
|
130
|
+
] }, i)) });
|
|
131
|
+
}
|
|
132
|
+
function CollectionProvenanceTab({ contract }) {
|
|
133
|
+
const [page, setPage] = useState(1);
|
|
134
|
+
const [all, setAll] = useState([]);
|
|
135
|
+
const { activities, meta, isLoading } = useActivities({ contract, page, limit: PAGE_SIZE });
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (activities.length === 0) return;
|
|
138
|
+
setAll((prev) => page === 1 ? activities : [...prev, ...activities]);
|
|
139
|
+
}, [activities, page]);
|
|
140
|
+
const groups = useMemo(() => groupByDay(all), [all]);
|
|
141
|
+
const showAsset = useMemo(
|
|
142
|
+
() => new Set(all.map((e) => e.nftTokenId ?? e.tokenId ?? "")).size > 1,
|
|
143
|
+
[all]
|
|
144
|
+
);
|
|
145
|
+
const hasMore = meta ? all.length < (meta.total ?? 0) : false;
|
|
146
|
+
if (isLoading && all.length === 0) return /* @__PURE__ */ jsx(ProvenanceSkeleton, {});
|
|
147
|
+
if (all.length === 0) {
|
|
148
|
+
return /* @__PURE__ */ jsxs("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
|
|
149
|
+
/* @__PURE__ */ jsx(Inbox, { className: "h-10 w-10 text-muted-foreground/40" }),
|
|
150
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "No history yet" }),
|
|
151
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 max-w-xs", children: "Mints, transfers, listings and sales will appear here as they happen." })
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
return /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-2xl", children: [
|
|
155
|
+
groups.map((group) => /* @__PURE__ */ jsxs("section", { className: "mb-8 last:mb-0", children: [
|
|
156
|
+
/* @__PURE__ */ jsx("h3", { className: "mb-4 pl-12 text-xs font-medium text-muted-foreground", children: group.label }),
|
|
157
|
+
/* @__PURE__ */ jsx("ol", { className: "relative before:absolute before:left-4 before:top-4 before:bottom-4 before:w-px before:bg-border", children: group.events.map((event, i) => /* @__PURE__ */ jsx(
|
|
158
|
+
ProvenanceEvent,
|
|
159
|
+
{
|
|
160
|
+
event,
|
|
161
|
+
showAsset
|
|
162
|
+
},
|
|
163
|
+
`${event.txHash ?? event.orderHash}-${event.type}-${i}`
|
|
164
|
+
)) })
|
|
165
|
+
] }, group.label)),
|
|
166
|
+
/* @__PURE__ */ jsx(LoadMoreSentinel, { hasMore, isLoading, onLoadMore: () => setPage((p) => p + 1) })
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
CollectionProvenanceTab
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=collection-provenance-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-provenance-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport type { ApiActivity } from \"@medialane/sdk\";\nimport { assetHref, profileHref } from \"@medialane/sdk\";\nimport { ExternalLink, Inbox } from \"lucide-react\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { ACTIVITY_TYPE_CONFIG } from \"../data/activity.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst PAGE_SIZE = 30;\n\nconst EVENT_TITLE: Record<string, string> = {\n mint: \"Minted\",\n listing: \"Listed for sale\",\n sale: \"Purchased\",\n offer: \"Offer made\",\n transfer: \"Transferred\",\n cancelled: \"Listing cancelled\",\n};\n\nfunction dayLabel(iso: string): string {\n const date = new Date(iso);\n const today = new Date();\n const yesterday = new Date();\n yesterday.setDate(today.getDate() - 1);\n if (date.toDateString() === today.toDateString()) return \"Today\";\n if (date.toDateString() === yesterday.toDateString()) return \"Yesterday\";\n return date.toLocaleDateString(undefined, { day: \"numeric\", month: \"long\", year: \"numeric\" });\n}\n\nfunction groupByDay(events: ApiActivity[]) {\n const groups: { label: string; events: ApiActivity[] }[] = [];\n for (const event of events) {\n const label = dayLabel(event.timestamp);\n const last = groups[groups.length - 1];\n if (last && last.label === label) last.events.push(event);\n else groups.push({ label, events: [event] });\n }\n return groups;\n}\n\nfunction ProvenanceEvent({ event, showAsset }: { event: ApiActivity; showAsset: boolean }) {\n const resolveImage = useImageUrl();\n const config = ACTIVITY_TYPE_CONFIG[event.type];\n const Icon = config?.icon ?? ExternalLink;\n const contract = event.nftContract ?? event.contractAddress ?? null;\n const tokenId = event.nftTokenId ?? event.tokenId ?? null;\n const actor =\n event.offerer ?? event.fulfiller ?? (event.type === \"mint\" ? event.to : event.from) ?? null;\n const amount = event.amount && Number(event.amount) > 1 ? event.amount : null;\n const name = event.token?.name ?? (tokenId ? `#${tokenId}` : null);\n const image = resolveImage(event.token?.image ?? null);\n\n return (\n <li className=\"relative pl-12 pb-6 last:pb-0\">\n <span\n className={cn(\n \"absolute left-0 top-0 flex h-8 w-8 items-center justify-center rounded-full ring-4 ring-background\",\n config?.bgClass ?? \"bg-muted\"\n )}\n aria-hidden\n >\n <Icon className={cn(\"h-4 w-4\", config?.colorClass ?? \"text-muted-foreground\")} />\n </span>\n\n <div className=\"flex items-start gap-3\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold leading-8 sm:leading-8\">\n {EVENT_TITLE[event.type] ?? event.type}\n {amount ? <span className=\"ml-1.5 text-xs font-medium text-muted-foreground\">×{amount}</span> : null}\n {actor ? (\n <span className=\"font-normal text-muted-foreground\">\n {\" by \"}\n <Link\n href={profileHref({ address: actor })}\n className=\"hover:text-primary transition-colors\"\n >\n <AddressDisplay address={actor} chars={4} showCopy={false} className=\"text-xs\" />\n </Link>\n </span>\n ) : null}\n </p>\n\n {showAsset && name ? (\n <Link\n href={contract && tokenId ? assetHref(event.chain ?? \"STARKNET\", contract, tokenId) : \"#\"}\n className=\"mt-1 inline-flex max-w-full items-center gap-2 rounded-lg bg-muted/40 py-1 pl-1 pr-3 hover:bg-muted transition-colors\"\n >\n <span className=\"relative h-8 w-8 shrink-0 overflow-hidden rounded-md bg-muted\">\n {image ? (\n <Image src={image} alt=\"\" width={32} height={32} className=\"h-full w-full object-cover\" unoptimized />\n ) : null}\n </span>\n <span className=\"truncate text-xs font-medium\">{name}</span>\n </Link>\n ) : null}\n </div>\n\n <div className=\"flex shrink-0 flex-col items-end gap-0.5 pt-1.5\">\n {event.price?.formatted ? (\n <span className=\"flex items-center gap-1.5 text-sm font-bold tabular-nums\">\n {event.price.currency ? <CurrencyIcon symbol={event.price.currency} size={13} aria-hidden /> : null}\n {formatDisplayPrice(event.price.formatted)}\n </span>\n ) : null}\n <span className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n <time dateTime={event.timestamp} title={new Date(event.timestamp).toLocaleString()}>\n {timeAgo(event.timestamp)}\n </time>\n {event.txHash ? (\n <a\n href={`${EXPLORER_URL}/tx/${event.txHash}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"rounded p-0.5 hover:bg-muted hover:text-foreground transition-colors\"\n aria-label=\"View transaction\"\n >\n <ExternalLink className=\"h-3 w-3\" aria-hidden />\n </a>\n ) : null}\n </span>\n </div>\n </div>\n </li>\n );\n}\n\nfunction ProvenanceSkeleton() {\n return (\n <div className=\"space-y-6\" aria-hidden>\n {Array.from({ length: 6 }).map((_, i) => (\n <div key={i} className=\"flex items-start gap-4\">\n <div className=\"h-8 w-8 shrink-0 rounded-full bg-muted animate-pulse\" />\n <div className=\"flex-1 space-y-2 pt-1\">\n <div className=\"h-3.5 w-40 rounded bg-muted animate-pulse\" />\n <div className=\"h-3 w-24 rounded bg-muted animate-pulse\" />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nexport interface CollectionProvenanceTabProps {\n contract: string;\n}\n\nexport function CollectionProvenanceTab({ contract }: CollectionProvenanceTabProps) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiActivity[]>([]);\n const { activities, meta, isLoading } = useActivities({ contract, page, limit: PAGE_SIZE });\n\n useEffect(() => {\n if (activities.length === 0) return;\n setAll((prev) => (page === 1 ? activities : [...prev, ...activities]));\n }, [activities, page]);\n\n const groups = useMemo(() => groupByDay(all), [all]);\n const showAsset = useMemo(\n () => new Set(all.map((e) => e.nftTokenId ?? e.tokenId ?? \"\")).size > 1,\n [all]\n );\n const hasMore = meta ? all.length < (meta.total ?? 0) : false;\n\n if (isLoading && all.length === 0) return <ProvenanceSkeleton />;\n\n if (all.length === 0) {\n return (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <Inbox className=\"h-10 w-10 text-muted-foreground/40\" />\n <p className=\"text-sm font-medium text-muted-foreground\">No history yet</p>\n <p className=\"text-xs text-muted-foreground/70 max-w-xs\">\n Mints, transfers, listings and sales will appear here as they happen.\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"mx-auto max-w-2xl\">\n {groups.map((group) => (\n <section key={group.label} className=\"mb-8 last:mb-0\">\n <h3 className=\"mb-4 pl-12 text-xs font-medium text-muted-foreground\">{group.label}</h3>\n <ol className=\"relative before:absolute before:left-4 before:top-4 before:bottom-4 before:w-px before:bg-border\">\n {group.events.map((event, i) => (\n <ProvenanceEvent\n key={`${event.txHash ?? event.orderHash}-${event.type}-${i}`}\n event={event}\n showAsset={showAsset}\n />\n ))}\n </ol>\n </section>\n ))}\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </div>\n );\n}\n"],"mappings":";AAwEQ,cAOc,YAPd;AAtER,SAAS,UAAU,WAAW,eAAe;AAE7C,SAAS,WAAW,mBAAmB;AACvC,SAAS,cAAc,aAAa;AACpC,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,eAAe;AACxB,SAAS,UAAU;AAEnB,MAAM,YAAY;AAElB,MAAM,cAAsC;AAAA,EAC1C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AACb;AAEA,SAAS,SAAS,KAAqB;AACrC,QAAM,OAAO,IAAI,KAAK,GAAG;AACzB,QAAM,QAAQ,oBAAI,KAAK;AACvB,QAAM,YAAY,oBAAI,KAAK;AAC3B,YAAU,QAAQ,MAAM,QAAQ,IAAI,CAAC;AACrC,MAAI,KAAK,aAAa,MAAM,MAAM,aAAa,EAAG,QAAO;AACzD,MAAI,KAAK,aAAa,MAAM,UAAU,aAAa,EAAG,QAAO;AAC7D,SAAO,KAAK,mBAAmB,QAAW,EAAE,KAAK,WAAW,OAAO,QAAQ,MAAM,UAAU,CAAC;AAC9F;AAEA,SAAS,WAAW,QAAuB;AACzC,QAAM,SAAqD,CAAC;AAC5D,aAAW,SAAS,QAAQ;AAC1B,UAAM,QAAQ,SAAS,MAAM,SAAS;AACtC,UAAM,OAAO,OAAO,OAAO,SAAS,CAAC;AACrC,QAAI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AAA,EAEJ;AAEA,SACE,qBAAC,SAAI,WAAU,qBACZ;AAAA,WAAO,IAAI,CAAC,UACX,qBAAC,aAA0B,WAAU,kBACnC;AAAA,0BAAC,QAAG,WAAU,wDAAwD,gBAAM,OAAM;AAAA,MAClF,oBAAC,QAAG,WAAU,oGACX,gBAAM,OAAO,IAAI,CAAC,OAAO,MACxB;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA;AAAA,QAFK,GAAG,MAAM,UAAU,MAAM,SAAS,IAAI,MAAM,IAAI,IAAI,CAAC;AAAA,MAG5D,CACD,GACH;AAAA,SAVY,MAAM,KAWpB,CACD;AAAA,IACD,oBAAC,oBAAiB,SAAkB,WAAsB,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG;AAAA,KACrG;AAEJ;","names":[]}
|
|
@@ -16,7 +16,6 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
16
16
|
royalty: zod.ZodNumber;
|
|
17
17
|
}, "strip", zod.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
-
value: string;
|
|
20
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
21
20
|
licenseType: string;
|
|
22
21
|
commercialUse: "Yes" | "No";
|
|
@@ -25,12 +24,12 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
25
24
|
geographicScope: string;
|
|
26
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
27
26
|
royalty: number;
|
|
27
|
+
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
name: string;
|
|
33
|
-
value: string;
|
|
34
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
35
34
|
licenseType: string;
|
|
36
35
|
commercialUse: "Yes" | "No";
|
|
@@ -39,6 +38,7 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
39
38
|
geographicScope: string;
|
|
40
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
41
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -16,7 +16,6 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
16
16
|
royalty: zod.ZodNumber;
|
|
17
17
|
}, "strip", zod.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
-
value: string;
|
|
20
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
21
20
|
licenseType: string;
|
|
22
21
|
commercialUse: "Yes" | "No";
|
|
@@ -25,12 +24,12 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
25
24
|
geographicScope: string;
|
|
26
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
27
26
|
royalty: number;
|
|
27
|
+
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
name: string;
|
|
33
|
-
value: string;
|
|
34
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
35
34
|
licenseType: string;
|
|
36
35
|
commercialUse: "Yes" | "No";
|
|
@@ -39,6 +38,7 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
39
38
|
geographicScope: string;
|
|
40
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
41
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
package/dist/index.cjs
CHANGED
|
@@ -98,7 +98,6 @@ __export(index_exports, {
|
|
|
98
98
|
CollapsibleContent: () => import_collapsible.CollapsibleContent,
|
|
99
99
|
CollapsibleSection: () => import_collapsible_section.CollapsibleSection,
|
|
100
100
|
CollapsibleTrigger: () => import_collapsible.CollapsibleTrigger,
|
|
101
|
-
CollectionActivityTab: () => import_collection_activity_tab.CollectionActivityTab,
|
|
102
101
|
CollectionCard: () => import_collection_card.CollectionCard,
|
|
103
102
|
CollectionCardSkeleton: () => import_collection_card.CollectionCardSkeleton,
|
|
104
103
|
CollectionCreateForm: () => import_collection_create_form.CollectionCreateForm,
|
|
@@ -109,8 +108,8 @@ __export(index_exports, {
|
|
|
109
108
|
CollectionNameClaim: () => import_collection_name_claim.CollectionNameClaim,
|
|
110
109
|
CollectionPage: () => import_collection_page.CollectionPage,
|
|
111
110
|
CollectionPicker: () => import_collection_picker.CollectionPicker,
|
|
111
|
+
CollectionProvenanceTab: () => import_collection_provenance_tab.CollectionProvenanceTab,
|
|
112
112
|
CollectionSettings: () => import_collection_settings.CollectionSettings,
|
|
113
|
-
CollectionTraitsTab: () => import_collection_traits_tab.CollectionTraitsTab,
|
|
114
113
|
CollectionTypeChoices: () => import_new_collection_menu.CollectionTypeChoices,
|
|
115
114
|
CollectionsLoading: () => import_page_skeletons.CollectionsLoading,
|
|
116
115
|
CollectionsPage: () => import_collections_page.CollectionsPage,
|
|
@@ -878,8 +877,7 @@ var import_use_profiles = require("./utils/use-profiles.js");
|
|
|
878
877
|
var import_use_activities = require("./utils/use-activities.js");
|
|
879
878
|
var import_use_collections = require("./utils/use-collections.js");
|
|
880
879
|
var import_creator_chip = require("./components/creator-chip.js");
|
|
881
|
-
var
|
|
882
|
-
var import_collection_traits_tab = require("./components/collection-traits-tab.js");
|
|
880
|
+
var import_collection_provenance_tab = require("./components/collection-provenance-tab.js");
|
|
883
881
|
var import_portfolio_activity = require("./components/portfolio-activity.js");
|
|
884
882
|
var import_creator_score_inline = require("./components/creator-score-inline.js");
|
|
885
883
|
var import_use_medialane_client = require("./utils/use-medialane-client.js");
|
|
@@ -992,7 +990,6 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
992
990
|
CollapsibleContent,
|
|
993
991
|
CollapsibleSection,
|
|
994
992
|
CollapsibleTrigger,
|
|
995
|
-
CollectionActivityTab,
|
|
996
993
|
CollectionCard,
|
|
997
994
|
CollectionCardSkeleton,
|
|
998
995
|
CollectionCreateForm,
|
|
@@ -1003,8 +1000,8 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1003
1000
|
CollectionNameClaim,
|
|
1004
1001
|
CollectionPage,
|
|
1005
1002
|
CollectionPicker,
|
|
1003
|
+
CollectionProvenanceTab,
|
|
1006
1004
|
CollectionSettings,
|
|
1007
|
-
CollectionTraitsTab,
|
|
1008
1005
|
CollectionTypeChoices,
|
|
1009
1006
|
CollectionsLoading,
|
|
1010
1007
|
CollectionsPage,
|