@medialane/ui 0.40.0 → 0.41.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/asset-collection-bar.cjs +8 -1
- package/dist/components/asset-collection-bar.cjs.map +1 -1
- package/dist/components/asset-collection-bar.d.cts +12 -7
- package/dist/components/asset-collection-bar.d.ts +12 -7
- package/dist/components/asset-collection-bar.js +8 -1
- package/dist/components/asset-collection-bar.js.map +1 -1
- package/dist/components/asset-license-summary.cjs +1 -1
- package/dist/components/asset-license-summary.cjs.map +1 -1
- package/dist/components/asset-license-summary.js +1 -1
- package/dist/components/asset-license-summary.js.map +1 -1
- package/dist/components/asset-marketplace-panel.cjs +18 -16
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.js +18 -16
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/asset-markets-tab.cjs +2 -2
- package/dist/components/asset-markets-tab.cjs.map +1 -1
- package/dist/components/asset-markets-tab.js +2 -2
- package/dist/components/asset-markets-tab.js.map +1 -1
- package/dist/components/asset-overview-content.cjs +3 -3
- package/dist/components/asset-overview-content.cjs.map +1 -1
- package/dist/components/asset-overview-content.js +3 -3
- package/dist/components/asset-overview-content.js.map +1 -1
- package/dist/components/asset-top-sections.cjs +1 -15
- package/dist/components/asset-top-sections.cjs.map +1 -1
- package/dist/components/asset-top-sections.d.cts +4 -2
- package/dist/components/asset-top-sections.d.ts +4 -2
- package/dist/components/asset-top-sections.js +1 -15
- package/dist/components/asset-top-sections.js.map +1 -1
- package/package.json +1 -1
|
@@ -36,6 +36,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_image = __toESM(require("next/image"), 1);
|
|
37
37
|
var import_link = __toESM(require("next/link"), 1);
|
|
38
38
|
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var import_address_display = require("./address-display.js");
|
|
39
40
|
var import_cn = require("../utils/cn.js");
|
|
40
41
|
function AssetCollectionBar({
|
|
41
42
|
collectionName,
|
|
@@ -43,7 +44,9 @@ function AssetCollectionBar({
|
|
|
43
44
|
collectionHref,
|
|
44
45
|
currentTokenId,
|
|
45
46
|
siblingTokens,
|
|
46
|
-
onNavigate
|
|
47
|
+
onNavigate,
|
|
48
|
+
ownerAddress,
|
|
49
|
+
ownerHref
|
|
47
50
|
}) {
|
|
48
51
|
const currentIndex = siblingTokens.findIndex((t) => String(t.tokenId) === String(currentTokenId));
|
|
49
52
|
const prevToken = currentIndex > 0 ? siblingTokens[currentIndex - 1] : null;
|
|
@@ -54,6 +57,10 @@ function AssetCollectionBar({
|
|
|
54
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-10 w-10 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-primary/20 to-purple-500/20 ring-1 ring-border/60 group-hover:ring-primary/40 transition", children: collectionImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: collectionImage, alt: "", fill: true, className: "object-cover", unoptimized: true }) : null }),
|
|
55
58
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold truncate group-hover:text-primary transition-colors", children: collectionName })
|
|
56
59
|
] }),
|
|
60
|
+
ownerAddress && ownerHref ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-center gap-1.5 text-xs text-muted-foreground -mt-1.5", children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Owner" }),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: ownerHref, className: "hover:text-primary transition-colors font-medium", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: ownerAddress }) })
|
|
63
|
+
] }) : null,
|
|
57
64
|
showFilmstrip ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
58
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
66
|
"button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport Link from \"next/link\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). `null` renders a placeholder. */\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). */\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n}\n\n/**\n * Collection identity bar: centered avatar+name, with a filmstrip of
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport Link from \"next/link\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). `null` renders a placeholder. */\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). */\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n /** Single-owner identity (ERC-721) — rendered under the collection name so\n * \"who owns it\" and \"where it lives\" sit together. Omit for ERC-1155\n * editions (multiple owners; use `AssetOwnersPanel` instead). */\n ownerAddress?: string | null;\n ownerHref?: string;\n}\n\n/**\n * Collection identity bar: centered avatar+name (+ owner, when given), with\n * a filmstrip of collection siblings on a second row for browsing (replaces\n * plain-text Prev/Next). Soft `bg-card/40` surface, no hard border — matches\n * the aurora-glow design language instead of an OpenSea-style boxed panel.\n * Other asset-level concerns (IP-type, explorer/share/report) still live\n * elsewhere (`AssetHeaderBlock`, `AssetUtilityIcons`).\n */\nexport function AssetCollectionBar({\n collectionName,\n collectionImage,\n collectionHref,\n currentTokenId,\n siblingTokens,\n onNavigate,\n ownerAddress,\n ownerHref,\n}: AssetCollectionBarProps) {\n const currentIndex = siblingTokens.findIndex((t) => String(t.tokenId) === String(currentTokenId));\n const prevToken = currentIndex > 0 ? siblingTokens[currentIndex - 1] : null;\n const nextToken =\n currentIndex >= 0 && currentIndex < siblingTokens.length - 1 ? siblingTokens[currentIndex + 1] : null;\n const showFilmstrip = siblingTokens.length > 1;\n\n return (\n <div className=\"rounded-2xl bg-card/40 px-4 py-3 space-y-3\">\n <Link href={collectionHref} className=\"flex items-center justify-center gap-3 min-w-0 group\">\n <div className=\"relative h-10 w-10 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-primary/20 to-purple-500/20 ring-1 ring-border/60 group-hover:ring-primary/40 transition\">\n {collectionImage ? (\n <Image src={collectionImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : null}\n </div>\n <p className=\"text-sm font-semibold truncate group-hover:text-primary transition-colors\">\n {collectionName}\n </p>\n </Link>\n\n {ownerAddress && ownerHref ? (\n <div className=\"flex items-center justify-center gap-1.5 text-xs text-muted-foreground -mt-1.5\">\n <span>Owner</span>\n <Link href={ownerHref} className=\"hover:text-primary transition-colors font-medium\">\n <AddressDisplay address={ownerAddress} />\n </Link>\n </div>\n ) : null}\n\n {showFilmstrip ? (\n <div className=\"flex items-center gap-1.5\">\n <button\n type=\"button\"\n disabled={!prevToken}\n onClick={() => prevToken && onNavigate(prevToken.tokenId)}\n className=\"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition hover:text-foreground active:scale-95 disabled:opacity-30 disabled:pointer-events-none\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </button>\n <div className=\"flex items-center gap-2 overflow-x-auto scroll-smooth [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {siblingTokens.map((sibling) => {\n const isCurrent = String(sibling.tokenId) === String(currentTokenId);\n return (\n <button\n key={sibling.tokenId}\n type=\"button\"\n onClick={() => onNavigate(sibling.tokenId)}\n className={cn(\n \"relative h-11 w-11 shrink-0 rounded-lg overflow-hidden ring-2 transition\",\n isCurrent ? \"ring-primary\" : \"ring-transparent hover:ring-border\"\n )}\n >\n {sibling.image ? (\n <Image src={sibling.image} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"h-full w-full bg-muted\" />\n )}\n </button>\n );\n })}\n </div>\n <button\n type=\"button\"\n disabled={!nextToken}\n onClick={() => nextToken && onNavigate(nextToken.tokenId)}\n className=\"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition hover:text-foreground active:scale-95 disabled:opacity-30 disabled:pointer-events-none\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuDM;AArDN,mBAAkB;AAClB,kBAAiB;AACjB,0BAA0C;AAC1C,6BAA+B;AAC/B,gBAAmB;AA+BZ,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,eAAe,cAAc,UAAU,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,OAAO,cAAc,CAAC;AAChG,QAAM,YAAY,eAAe,IAAI,cAAc,eAAe,CAAC,IAAI;AACvE,QAAM,YACJ,gBAAgB,KAAK,eAAe,cAAc,SAAS,IAAI,cAAc,eAAe,CAAC,IAAI;AACnG,QAAM,gBAAgB,cAAc,SAA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;AAAA,UACC,MAAK;AAAA,UACL,UAAU,CAAC;AAAA,UACX,SAAS,MAAM,aAAa,WAAW,UAAU,OAAO;AAAA,UACxD,WAAU;AAAA,UAEV,sDAAC,oCAAa,WAAU,WAAU;AAAA;AAAA,MACpC;AAAA,OACF,IACE;AAAA,KACN;AAEJ;","names":["Link","Image"]}
|
|
@@ -13,15 +13,20 @@ interface AssetCollectionBarProps {
|
|
|
13
13
|
currentTokenId: string;
|
|
14
14
|
siblingTokens: AssetCollectionBarSibling[];
|
|
15
15
|
onNavigate: (tokenId: string) => void;
|
|
16
|
+
/** Single-owner identity (ERC-721) — rendered under the collection name so
|
|
17
|
+
* "who owns it" and "where it lives" sit together. Omit for ERC-1155
|
|
18
|
+
* editions (multiple owners; use `AssetOwnersPanel` instead). */
|
|
19
|
+
ownerAddress?: string | null;
|
|
20
|
+
ownerHref?: string;
|
|
16
21
|
}
|
|
17
22
|
/**
|
|
18
|
-
* Collection identity bar: centered avatar+name,
|
|
19
|
-
* collection siblings on a second row for browsing (replaces
|
|
20
|
-
* Prev/Next). Soft `bg-card/40` surface, no hard border — matches
|
|
21
|
-
* aurora-glow design language instead of an OpenSea-style boxed panel.
|
|
22
|
-
*
|
|
23
|
-
* (`AssetHeaderBlock`, `AssetUtilityIcons`)
|
|
23
|
+
* Collection identity bar: centered avatar+name (+ owner, when given), with
|
|
24
|
+
* a filmstrip of collection siblings on a second row for browsing (replaces
|
|
25
|
+
* plain-text Prev/Next). Soft `bg-card/40` surface, no hard border — matches
|
|
26
|
+
* the aurora-glow design language instead of an OpenSea-style boxed panel.
|
|
27
|
+
* Other asset-level concerns (IP-type, explorer/share/report) still live
|
|
28
|
+
* elsewhere (`AssetHeaderBlock`, `AssetUtilityIcons`).
|
|
24
29
|
*/
|
|
25
|
-
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, ownerAddress, ownerHref, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
26
31
|
|
|
27
32
|
export { AssetCollectionBar, type AssetCollectionBarProps, type AssetCollectionBarSibling };
|
|
@@ -13,15 +13,20 @@ interface AssetCollectionBarProps {
|
|
|
13
13
|
currentTokenId: string;
|
|
14
14
|
siblingTokens: AssetCollectionBarSibling[];
|
|
15
15
|
onNavigate: (tokenId: string) => void;
|
|
16
|
+
/** Single-owner identity (ERC-721) — rendered under the collection name so
|
|
17
|
+
* "who owns it" and "where it lives" sit together. Omit for ERC-1155
|
|
18
|
+
* editions (multiple owners; use `AssetOwnersPanel` instead). */
|
|
19
|
+
ownerAddress?: string | null;
|
|
20
|
+
ownerHref?: string;
|
|
16
21
|
}
|
|
17
22
|
/**
|
|
18
|
-
* Collection identity bar: centered avatar+name,
|
|
19
|
-
* collection siblings on a second row for browsing (replaces
|
|
20
|
-
* Prev/Next). Soft `bg-card/40` surface, no hard border — matches
|
|
21
|
-
* aurora-glow design language instead of an OpenSea-style boxed panel.
|
|
22
|
-
*
|
|
23
|
-
* (`AssetHeaderBlock`, `AssetUtilityIcons`)
|
|
23
|
+
* Collection identity bar: centered avatar+name (+ owner, when given), with
|
|
24
|
+
* a filmstrip of collection siblings on a second row for browsing (replaces
|
|
25
|
+
* plain-text Prev/Next). Soft `bg-card/40` surface, no hard border — matches
|
|
26
|
+
* the aurora-glow design language instead of an OpenSea-style boxed panel.
|
|
27
|
+
* Other asset-level concerns (IP-type, explorer/share/report) still live
|
|
28
|
+
* elsewhere (`AssetHeaderBlock`, `AssetUtilityIcons`).
|
|
24
29
|
*/
|
|
25
|
-
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, ownerAddress, ownerHref, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
26
31
|
|
|
27
32
|
export { AssetCollectionBar, type AssetCollectionBarProps, type AssetCollectionBarSibling };
|
|
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import Image from "next/image";
|
|
4
4
|
import Link from "next/link";
|
|
5
5
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
6
|
+
import { AddressDisplay } from "./address-display.js";
|
|
6
7
|
import { cn } from "../utils/cn.js";
|
|
7
8
|
function AssetCollectionBar({
|
|
8
9
|
collectionName,
|
|
@@ -10,7 +11,9 @@ function AssetCollectionBar({
|
|
|
10
11
|
collectionHref,
|
|
11
12
|
currentTokenId,
|
|
12
13
|
siblingTokens,
|
|
13
|
-
onNavigate
|
|
14
|
+
onNavigate,
|
|
15
|
+
ownerAddress,
|
|
16
|
+
ownerHref
|
|
14
17
|
}) {
|
|
15
18
|
const currentIndex = siblingTokens.findIndex((t) => String(t.tokenId) === String(currentTokenId));
|
|
16
19
|
const prevToken = currentIndex > 0 ? siblingTokens[currentIndex - 1] : null;
|
|
@@ -21,6 +24,10 @@ function AssetCollectionBar({
|
|
|
21
24
|
/* @__PURE__ */ jsx("div", { className: "relative h-10 w-10 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-primary/20 to-purple-500/20 ring-1 ring-border/60 group-hover:ring-primary/40 transition", children: collectionImage ? /* @__PURE__ */ jsx(Image, { src: collectionImage, alt: "", fill: true, className: "object-cover", unoptimized: true }) : null }),
|
|
22
25
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold truncate group-hover:text-primary transition-colors", children: collectionName })
|
|
23
26
|
] }),
|
|
27
|
+
ownerAddress && ownerHref ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-1.5 text-xs text-muted-foreground -mt-1.5", children: [
|
|
28
|
+
/* @__PURE__ */ jsx("span", { children: "Owner" }),
|
|
29
|
+
/* @__PURE__ */ jsx(Link, { href: ownerHref, className: "hover:text-primary transition-colors font-medium", children: /* @__PURE__ */ jsx(AddressDisplay, { address: ownerAddress }) })
|
|
30
|
+
] }) : null,
|
|
24
31
|
showFilmstrip ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
25
32
|
/* @__PURE__ */ jsx(
|
|
26
33
|
"button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport Link from \"next/link\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). `null` renders a placeholder. */\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). */\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n}\n\n/**\n * Collection identity bar: centered avatar+name, with a filmstrip of
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport Link from \"next/link\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). `null` renders a placeholder. */\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n /** Already-resolved, ready-to-render src (e.g. via the caller's ipfsToHttp). */\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n /** Single-owner identity (ERC-721) — rendered under the collection name so\n * \"who owns it\" and \"where it lives\" sit together. Omit for ERC-1155\n * editions (multiple owners; use `AssetOwnersPanel` instead). */\n ownerAddress?: string | null;\n ownerHref?: string;\n}\n\n/**\n * Collection identity bar: centered avatar+name (+ owner, when given), with\n * a filmstrip of collection siblings on a second row for browsing (replaces\n * plain-text Prev/Next). Soft `bg-card/40` surface, no hard border — matches\n * the aurora-glow design language instead of an OpenSea-style boxed panel.\n * Other asset-level concerns (IP-type, explorer/share/report) still live\n * elsewhere (`AssetHeaderBlock`, `AssetUtilityIcons`).\n */\nexport function AssetCollectionBar({\n collectionName,\n collectionImage,\n collectionHref,\n currentTokenId,\n siblingTokens,\n onNavigate,\n ownerAddress,\n ownerHref,\n}: AssetCollectionBarProps) {\n const currentIndex = siblingTokens.findIndex((t) => String(t.tokenId) === String(currentTokenId));\n const prevToken = currentIndex > 0 ? siblingTokens[currentIndex - 1] : null;\n const nextToken =\n currentIndex >= 0 && currentIndex < siblingTokens.length - 1 ? siblingTokens[currentIndex + 1] : null;\n const showFilmstrip = siblingTokens.length > 1;\n\n return (\n <div className=\"rounded-2xl bg-card/40 px-4 py-3 space-y-3\">\n <Link href={collectionHref} className=\"flex items-center justify-center gap-3 min-w-0 group\">\n <div className=\"relative h-10 w-10 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-primary/20 to-purple-500/20 ring-1 ring-border/60 group-hover:ring-primary/40 transition\">\n {collectionImage ? (\n <Image src={collectionImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : null}\n </div>\n <p className=\"text-sm font-semibold truncate group-hover:text-primary transition-colors\">\n {collectionName}\n </p>\n </Link>\n\n {ownerAddress && ownerHref ? (\n <div className=\"flex items-center justify-center gap-1.5 text-xs text-muted-foreground -mt-1.5\">\n <span>Owner</span>\n <Link href={ownerHref} className=\"hover:text-primary transition-colors font-medium\">\n <AddressDisplay address={ownerAddress} />\n </Link>\n </div>\n ) : null}\n\n {showFilmstrip ? (\n <div className=\"flex items-center gap-1.5\">\n <button\n type=\"button\"\n disabled={!prevToken}\n onClick={() => prevToken && onNavigate(prevToken.tokenId)}\n className=\"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition hover:text-foreground active:scale-95 disabled:opacity-30 disabled:pointer-events-none\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </button>\n <div className=\"flex items-center gap-2 overflow-x-auto scroll-smooth [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {siblingTokens.map((sibling) => {\n const isCurrent = String(sibling.tokenId) === String(currentTokenId);\n return (\n <button\n key={sibling.tokenId}\n type=\"button\"\n onClick={() => onNavigate(sibling.tokenId)}\n className={cn(\n \"relative h-11 w-11 shrink-0 rounded-lg overflow-hidden ring-2 transition\",\n isCurrent ? \"ring-primary\" : \"ring-transparent hover:ring-border\"\n )}\n >\n {sibling.image ? (\n <Image src={sibling.image} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"h-full w-full bg-muted\" />\n )}\n </button>\n );\n })}\n </div>\n <button\n type=\"button\"\n disabled={!nextToken}\n onClick={() => nextToken && onNavigate(nextToken.tokenId)}\n className=\"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition hover:text-foreground active:scale-95 disabled:opacity-30 disabled:pointer-events-none\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAuDM,SAGM,KAHN;AArDN,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,aAAa,oBAAoB;AAC1C,SAAS,sBAAsB;AAC/B,SAAS,UAAU;AA+BZ,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,eAAe,cAAc,UAAU,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,OAAO,cAAc,CA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AC,SAAI,WAAU,0BAAyB;AAAA;AAAA,UAXrC,QAAQ;AAAA,QAaf;AAAA,MAEJ,CAAC,GACH;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU,CAAC;AAAA,UACX,SAAS,MAAM,aAAa,WAAW,UAAU,OAAO;AAAA,UACxD,WAAU;AAAA,UAEV,8BAAC,gBAAa,WAAU,WAAU;AAAA;AAAA,MACpC;AAAA,OACF,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -56,7 +56,7 @@ function AssetLicenseSummary({ attributes }) {
|
|
|
56
56
|
pills.push({ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Globe, { className: "h-3.5 w-3.5" }), label: territory });
|
|
57
57
|
}
|
|
58
58
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2.5", children: [
|
|
59
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[10px] font-medium
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[10px] font-medium text-muted-foreground", children: "License" }),
|
|
60
60
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[15px] font-medium leading-relaxed text-foreground/90", children: summary }),
|
|
61
61
|
pills.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2 pt-0.5", children: pills.map((pill) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
62
62
|
"span",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-license-summary.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, GitBranch, Globe } from \"lucide-react\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ntype AssetAttribute = { trait_type?: string; value?: string };\n\n/**\n * Human-first license callout for the asset hero column. Leads with one\n * plain-language sentence (the same one the metadata implies), then a row of\n * glanceable fact pills — so a buyer understands the rights at a glance without\n * digging into the Overview tab. The detailed receipts (full license bento +\n * worldwide-protection banner) still live in the Overview tab. Renders nothing\n * when the asset carries no license data.\n */\nexport function AssetLicenseSummary({ attributes }: { attributes: AssetAttribute[] }) {\n const summary = licenseSummary(attributes);\n if (!summary) return null;\n\n const get = (key: string) =>\n attributes.find((a) => a.trait_type?.toLowerCase() === key.toLowerCase())?.value;\n\n const commercialRaw = get(\"Commercial Use\");\n const derivatives = (get(\"Derivatives\") ?? \"\").toLowerCase();\n const ai = (get(\"AI Policy\") ?? get(\"AI & Data Mining\") ?? \"\").toLowerCase();\n const territory = get(\"Territory\");\n\n const pills: { icon: ReactNode; label: string }[] = [];\n if (commercialRaw) {\n pills.push({\n icon: <DollarSign className=\"h-3.5 w-3.5\" />,\n label: commercialRaw.toLowerCase() === \"yes\" ? \"Commercial use\" : \"Non-commercial\",\n });\n }\n if (derivatives) {\n pills.push({\n icon: <GitBranch className=\"h-3.5 w-3.5\" />,\n label: derivatives === \"not allowed\" ? \"No remixing\" : \"Remixable\",\n });\n }\n if (ai) {\n pills.push({\n icon: <Bot className=\"h-3.5 w-3.5\" />,\n label: ai.includes(\"not\") ? \"No AI training\" : \"AI allowed\",\n });\n }\n if (territory) {\n pills.push({ icon: <Globe className=\"h-3.5 w-3.5\" />, label: territory });\n }\n\n return (\n <div className=\"space-y-2.5\">\n <p className=\"text-[10px] font-medium
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-license-summary.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, GitBranch, Globe } from \"lucide-react\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ntype AssetAttribute = { trait_type?: string; value?: string };\n\n/**\n * Human-first license callout for the asset hero column. Leads with one\n * plain-language sentence (the same one the metadata implies), then a row of\n * glanceable fact pills — so a buyer understands the rights at a glance without\n * digging into the Overview tab. The detailed receipts (full license bento +\n * worldwide-protection banner) still live in the Overview tab. Renders nothing\n * when the asset carries no license data.\n */\nexport function AssetLicenseSummary({ attributes }: { attributes: AssetAttribute[] }) {\n const summary = licenseSummary(attributes);\n if (!summary) return null;\n\n const get = (key: string) =>\n attributes.find((a) => a.trait_type?.toLowerCase() === key.toLowerCase())?.value;\n\n const commercialRaw = get(\"Commercial Use\");\n const derivatives = (get(\"Derivatives\") ?? \"\").toLowerCase();\n const ai = (get(\"AI Policy\") ?? get(\"AI & Data Mining\") ?? \"\").toLowerCase();\n const territory = get(\"Territory\");\n\n const pills: { icon: ReactNode; label: string }[] = [];\n if (commercialRaw) {\n pills.push({\n icon: <DollarSign className=\"h-3.5 w-3.5\" />,\n label: commercialRaw.toLowerCase() === \"yes\" ? \"Commercial use\" : \"Non-commercial\",\n });\n }\n if (derivatives) {\n pills.push({\n icon: <GitBranch className=\"h-3.5 w-3.5\" />,\n label: derivatives === \"not allowed\" ? \"No remixing\" : \"Remixable\",\n });\n }\n if (ai) {\n pills.push({\n icon: <Bot className=\"h-3.5 w-3.5\" />,\n label: ai.includes(\"not\") ? \"No AI training\" : \"AI allowed\",\n });\n }\n if (territory) {\n pills.push({ icon: <Globe className=\"h-3.5 w-3.5\" />, label: territory });\n }\n\n return (\n <div className=\"space-y-2.5\">\n <p className=\"text-[10px] font-medium text-muted-foreground\">License</p>\n <p className=\"text-[15px] font-medium leading-relaxed text-foreground/90\">{summary}</p>\n {pills.length > 0 ? (\n <div className=\"flex flex-wrap gap-2 pt-0.5\">\n {pills.map((pill) => (\n <span\n key={pill.label}\n className=\"inline-flex items-center gap-1.5 rounded-full border border-border/60 bg-muted/30 px-3 py-1 text-xs font-medium text-foreground/80\"\n >\n {pill.icon}\n {pill.label}\n </span>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BY;AA5BZ,0BAAkD;AAClD,6BAA+B;AAYxB,SAAS,oBAAoB,EAA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AA,UACL,KAAK;AAAA;AAAA;AAAA,MAJD,KAAK;AAAA,IAKZ,CACD,GACH,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -33,7 +33,7 @@ function AssetLicenseSummary({ attributes }) {
|
|
|
33
33
|
pills.push({ icon: /* @__PURE__ */ jsx(Globe, { className: "h-3.5 w-3.5" }), label: territory });
|
|
34
34
|
}
|
|
35
35
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-2.5", children: [
|
|
36
|
-
/* @__PURE__ */ jsx("p", { className: "text-[10px] font-medium
|
|
36
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] font-medium text-muted-foreground", children: "License" }),
|
|
37
37
|
/* @__PURE__ */ jsx("p", { className: "text-[15px] font-medium leading-relaxed text-foreground/90", children: summary }),
|
|
38
38
|
pills.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 pt-0.5", children: pills.map((pill) => /* @__PURE__ */ jsxs(
|
|
39
39
|
"span",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-license-summary.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, GitBranch, Globe } from \"lucide-react\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ntype AssetAttribute = { trait_type?: string; value?: string };\n\n/**\n * Human-first license callout for the asset hero column. Leads with one\n * plain-language sentence (the same one the metadata implies), then a row of\n * glanceable fact pills — so a buyer understands the rights at a glance without\n * digging into the Overview tab. The detailed receipts (full license bento +\n * worldwide-protection banner) still live in the Overview tab. Renders nothing\n * when the asset carries no license data.\n */\nexport function AssetLicenseSummary({ attributes }: { attributes: AssetAttribute[] }) {\n const summary = licenseSummary(attributes);\n if (!summary) return null;\n\n const get = (key: string) =>\n attributes.find((a) => a.trait_type?.toLowerCase() === key.toLowerCase())?.value;\n\n const commercialRaw = get(\"Commercial Use\");\n const derivatives = (get(\"Derivatives\") ?? \"\").toLowerCase();\n const ai = (get(\"AI Policy\") ?? get(\"AI & Data Mining\") ?? \"\").toLowerCase();\n const territory = get(\"Territory\");\n\n const pills: { icon: ReactNode; label: string }[] = [];\n if (commercialRaw) {\n pills.push({\n icon: <DollarSign className=\"h-3.5 w-3.5\" />,\n label: commercialRaw.toLowerCase() === \"yes\" ? \"Commercial use\" : \"Non-commercial\",\n });\n }\n if (derivatives) {\n pills.push({\n icon: <GitBranch className=\"h-3.5 w-3.5\" />,\n label: derivatives === \"not allowed\" ? \"No remixing\" : \"Remixable\",\n });\n }\n if (ai) {\n pills.push({\n icon: <Bot className=\"h-3.5 w-3.5\" />,\n label: ai.includes(\"not\") ? \"No AI training\" : \"AI allowed\",\n });\n }\n if (territory) {\n pills.push({ icon: <Globe className=\"h-3.5 w-3.5\" />, label: territory });\n }\n\n return (\n <div className=\"space-y-2.5\">\n <p className=\"text-[10px] font-medium
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-license-summary.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, GitBranch, Globe } from \"lucide-react\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ntype AssetAttribute = { trait_type?: string; value?: string };\n\n/**\n * Human-first license callout for the asset hero column. Leads with one\n * plain-language sentence (the same one the metadata implies), then a row of\n * glanceable fact pills — so a buyer understands the rights at a glance without\n * digging into the Overview tab. The detailed receipts (full license bento +\n * worldwide-protection banner) still live in the Overview tab. Renders nothing\n * when the asset carries no license data.\n */\nexport function AssetLicenseSummary({ attributes }: { attributes: AssetAttribute[] }) {\n const summary = licenseSummary(attributes);\n if (!summary) return null;\n\n const get = (key: string) =>\n attributes.find((a) => a.trait_type?.toLowerCase() === key.toLowerCase())?.value;\n\n const commercialRaw = get(\"Commercial Use\");\n const derivatives = (get(\"Derivatives\") ?? \"\").toLowerCase();\n const ai = (get(\"AI Policy\") ?? get(\"AI & Data Mining\") ?? \"\").toLowerCase();\n const territory = get(\"Territory\");\n\n const pills: { icon: ReactNode; label: string }[] = [];\n if (commercialRaw) {\n pills.push({\n icon: <DollarSign className=\"h-3.5 w-3.5\" />,\n label: commercialRaw.toLowerCase() === \"yes\" ? \"Commercial use\" : \"Non-commercial\",\n });\n }\n if (derivatives) {\n pills.push({\n icon: <GitBranch className=\"h-3.5 w-3.5\" />,\n label: derivatives === \"not allowed\" ? \"No remixing\" : \"Remixable\",\n });\n }\n if (ai) {\n pills.push({\n icon: <Bot className=\"h-3.5 w-3.5\" />,\n label: ai.includes(\"not\") ? \"No AI training\" : \"AI allowed\",\n });\n }\n if (territory) {\n pills.push({ icon: <Globe className=\"h-3.5 w-3.5\" />, label: territory });\n }\n\n return (\n <div className=\"space-y-2.5\">\n <p className=\"text-[10px] font-medium text-muted-foreground\">License</p>\n <p className=\"text-[15px] font-medium leading-relaxed text-foreground/90\">{summary}</p>\n {pills.length > 0 ? (\n <div className=\"flex flex-wrap gap-2 pt-0.5\">\n {pills.map((pill) => (\n <span\n key={pill.label}\n className=\"inline-flex items-center gap-1.5 rounded-full border border-border/60 bg-muted/30 px-3 py-1 text-xs font-medium text-foreground/80\"\n >\n {pill.icon}\n {pill.label}\n </span>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AA+BY,cA2BA,YA3BA;AA5BZ,SAAS,KAAK,YAAY,WAAW,aAAa;AAClD,SAAS,sBAAsB;AAYxB,SAAS,oBAAoB,EAAE,WAAW,GAAqC;AACpF,QAAM,UAAU,eAAe,UAAU;AACzC,MAAI,CAAC,QAAS,QAAO;AAErB,QAAM,MAAM,CAAC,QACX,WAAW,KAAK,CAAC,MAAM,EAAE,YAAY,YAAY,MAAM,IAAI,YAAY,CAAC,GAAG;AAE7E,QAAM,gBAAgB,IAAI,gBAAgB;AAC1C,QAAM,eAAe,IAAI,aAAa,KAAK,IAAI,YAAY;AAC3D,QAAM,MAAM,IAAI,WAAW,KAAK,IAAI,kBAAkB,KAAK,IAAI,YAAY;AAC3E,QAAM,YAAY,IAAI,WAAW;AAEjC,QAAM,QAA8C,CAAC;AACrD,MAAI,eAAe;AACjB,UAAM,KAAK;AAAA,MACT,MAAM,oBAAC,cAAW,WAAU,eAAc;AAAA,MAC1C,OAAO,cAAc,YAAY,MAAM,QAAQ,mBAAmB;AAAA,IACpE,CAAC;AAAA,EACH;AACA,MAAI,aAAa;AACf,UAAM,KAAK;AAAA,MACT,MAAM,oBAAC,aAAU,WAAU,eAAc;AAAA,MACzC,OAAO,gBAAgB,gBAAgB,gBAAgB;AAAA,IACzD,CAAC;AAAA,EACH;AACA,MAAI,IAAI;AACN,UAAM,KAAK;AAAA,MACT,MAAM,oBAAC,OAAI,WAAU,eAAc;AAAA,MACnC,OAAO,GAAG,SAAS,KAAK,IAAI,mBAAmB;AAAA,IACjD,CAAC;AAAA,EACH;AACA,MAAI,WAAW;AACb,UAAM,KAAK,EAAE,MAAM,oBAAC,SAAM,WAAU,eAAc,GAAI,OAAO,UAAU,CAAC;AAAA,EAC1E;AAEA,SACE,qBAAC,SAAI,WAAU,eACb;AAAA,wBAAC,OAAE,WAAU,iDAAgD,qBAAO;AAAA,IACpE,oBAAC,OAAE,WAAU,8DAA8D,mBAAQ;AAAA,IAClF,MAAM,SAAS,IACd,oBAAC,SAAI,WAAU,+BACZ,gBAAM,IAAI,CAAC,SACV;AAAA,MAAC;AAAA;AAAA,QAEC,WAAU;AAAA,QAET;AAAA,eAAK;AAAA,UACL,KAAK;AAAA;AAAA;AAAA,MAJD,KAAK;AAAA,IAKZ,CACD,GACH,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -51,17 +51,17 @@ function ActionButton({ label, icon, onClick, tone, disabled = false, helpConten
|
|
|
51
51
|
) });
|
|
52
52
|
}
|
|
53
53
|
function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
54
|
-
if (!floorPriceRaw && !lastSaleRaw) return null;
|
|
55
54
|
const floor = floorPriceRaw ? (0, import_format.parsePriceDisplay)(floorPriceRaw) : null;
|
|
56
55
|
const lastSale = lastSaleRaw ? (0, import_format.parsePriceDisplay)(lastSaleRaw) : null;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
if (!floor?.symbol && !lastSale?.symbol) return null;
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", children: [
|
|
58
|
+
floor?.symbol && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Floor" }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: floor.numStr, symbol: floor.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
61
61
|
] }),
|
|
62
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
63
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
64
|
-
|
|
62
|
+
lastSale?.symbol && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Last sale" }),
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: lastSale.numStr, symbol: lastSale.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
65
65
|
] })
|
|
66
66
|
] });
|
|
67
67
|
}
|
|
@@ -109,14 +109,16 @@ function AssetMarketplacePanel({
|
|
|
109
109
|
),
|
|
110
110
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-4", children: [
|
|
111
111
|
cheapest ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
112
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-baseline gap-
|
|
113
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5", children: [
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-baseline gap-2", children: [
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: cheapest.price.currency ?? "", size: 26 }),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-4xl font-bold tracking-tight", children: (0, import_format.formatDisplayPrice)(cheapest.price.formatted) }),
|
|
116
|
+
renderHelp(
|
|
117
|
+
`${isOwner && !canBuyMore ? "Your listing" : "Current price"} \xB7 Expires ${(0, import_time.timeUntil)(cheapest.endTime)}`
|
|
118
|
+
)
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatRow, { floorPriceRaw, lastSaleRaw })
|
|
118
121
|
] }),
|
|
119
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
120
122
|
isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
121
123
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
122
124
|
myListing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -240,7 +242,7 @@ function AssetMarketplacePanel({
|
|
|
240
242
|
)
|
|
241
243
|
] }) : null,
|
|
242
244
|
isOwner && activeBids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-card/40 p-5 space-y-3", children: [
|
|
243
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs font-semibold
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs font-semibold text-muted-foreground", children: [
|
|
244
246
|
"Incoming offers (",
|
|
245
247
|
activeBids.length,
|
|
246
248
|
")"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\n\n/** Structural subset of `ApiOrder` (both apps' `@medialane/sdk` types satisfy this). */\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\ninterface ActionButtonProps {\n label: string;\n icon: ReactNode;\n onClick: () => void;\n tone: \"blue\" | \"orange\" | \"purple\" | \"destructive\" | \"transparent\";\n disabled?: boolean;\n helpContent?: string;\n renderHelp: (content: string) => ReactNode;\n}\n\nconst actionToneClass: Record<ActionButtonProps[\"tone\"], string> = {\n blue: \"bg-brand-blue\",\n orange: \"bg-brand-orange\",\n purple: \"bg-brand-purple\",\n destructive: \"bg-destructive\",\n transparent: \"bg-transparent\",\n};\n\nfunction ActionButton({ label, icon, onClick, tone, disabled = false, helpContent, renderHelp }: ActionButtonProps) {\n return (\n <div className={`btn-border-animated p-[1px] rounded-2xl ${disabled ? \"opacity-40 pointer-events-none\" : \"\"}`}>\n <button\n className={`w-full h-10 rounded-[15px] flex items-center justify-center gap-2 px-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] disabled:opacity-50 ${actionToneClass[tone]}`}\n disabled={disabled}\n onClick={onClick}\n >\n {icon}\n {label}\n {helpContent ? renderHelp(helpContent) : null}\n </button>\n </div>\n );\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n /** Raw \"0.07 STRK\"-style strings — already resolved by the caller. `null`/undefined renders \"—\". */\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n /** Renders the sign-in/connect-wallet CTA for the given label (e.g. \"Sign in to trade\"). */\n renderAuthAction: (label: string) => ReactNode;\n /** Renders an inline help/info affordance for the given tooltip text. */\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n}\n\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n if (!floorPriceRaw && !lastSaleRaw) return null;\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n return (\n <div className=\"flex items-center gap-4 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1.5\">\n <span className=\"uppercase tracking-wider font-semibold\">Floor</span>\n {floor && floor.symbol ? (\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n ) : (\n <span className=\"text-foreground font-semibold\">—</span>\n )}\n </span>\n <span className=\"flex items-center gap-1.5\">\n <span className=\"uppercase tracking-wider font-semibold\">Last sale</span>\n {lastSale && lastSale.symbol ? (\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n ) : (\n <span className=\"text-foreground font-semibold\">—</span>\n )}\n </span>\n </div>\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n floorPriceRaw,\n lastSaleRaw,\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n {/* soft brand light-leak behind the trade zone — no hard border, per §III */}\n <div\n aria-hidden\n className=\"aurora-purple pointer-events-none\"\n style={{ position: \"absolute\", width: 280, height: 280, top: -60, left: \"20%\" }}\n />\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-baseline gap-2\">\n <CurrencyIcon symbol={cheapest.price.currency ?? \"\"} size={26} />\n <span className=\"text-4xl font-bold tracking-tight\">\n {formatDisplayPrice(cheapest.price.formatted)}\n </span>\n {renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n </div>\n\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton\n label=\"Cancel\"\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"destructive\"\n renderHelp={renderHelp}\n />\n ) : null}\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"blue\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n label=\"License\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n tone=\"blue\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCI;AArCJ,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,oBAAsD;AACtD,kBAA0B;AAoB1B,MAAM,kBAA6D;AAAA,EACjE,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,aAAa;AACf;AAEA,SAAS,aAAa,EAAE,OAAO,MAAM,SAAS,MAAM,WAAW,OAAO,aAAa,WAAW,GAAsB;AAClH,SACE,4CAAC,SAAI,WAAW,2CAA2C,WAAW,mCAAmC,EAAE,IACzG;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,uLAAuL,gBAAgB,IAAI,CAAC;AAAA,MACvN;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,QACA;AAAA,QACA,cAAc,WAAW,WAAW,IAAI;AAAA;AAAA;AAAA,EAC3C,GACF;AAEJ;AA+BA,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,MAAI,CAAC,iBAAiB,CAAC,YAAa,QAAO;AAC3C,QAAM,QAAQ,oBAAgB,iCAAkB,aAAa,IAAI;AACjE,QAAM,WAAW,kBAAc,iCAAkB,WAAW,IAAI;AAChE,SACE,6CAAC,SAAI,WAAU,yDACb;AAAA,iDAAC,UAAK,WAAU,6BACd;AAAA,kDAAC,UAAK,WAAU,0CAAyC,mBAAK;AAAA,MAC7D,SAAS,MAAM,S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A,SACF,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\n\n/** Structural subset of `ApiOrder` (both apps' `@medialane/sdk` types satisfy this). */\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\ninterface ActionButtonProps {\n label: string;\n icon: ReactNode;\n onClick: () => void;\n tone: \"blue\" | \"orange\" | \"purple\" | \"destructive\" | \"transparent\";\n disabled?: boolean;\n helpContent?: string;\n renderHelp: (content: string) => ReactNode;\n}\n\nconst actionToneClass: Record<ActionButtonProps[\"tone\"], string> = {\n blue: \"bg-brand-blue\",\n orange: \"bg-brand-orange\",\n purple: \"bg-brand-purple\",\n destructive: \"bg-destructive\",\n transparent: \"bg-transparent\",\n};\n\nfunction ActionButton({ label, icon, onClick, tone, disabled = false, helpContent, renderHelp }: ActionButtonProps) {\n return (\n <div className={`btn-border-animated p-[1px] rounded-2xl ${disabled ? \"opacity-40 pointer-events-none\" : \"\"}`}>\n <button\n className={`w-full h-10 rounded-[15px] flex items-center justify-center gap-2 px-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] disabled:opacity-50 ${actionToneClass[tone]}`}\n disabled={disabled}\n onClick={onClick}\n >\n {icon}\n {label}\n {helpContent ? renderHelp(helpContent) : null}\n </button>\n </div>\n );\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n /** Raw \"0.07 STRK\"-style strings — already resolved by the caller. `null`/undefined renders \"—\". */\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n /** Renders the sign-in/connect-wallet CTA for the given label (e.g. \"Sign in to trade\"). */\n renderAuthAction: (label: string) => ReactNode;\n /** Renders an inline help/info affordance for the given tooltip text. */\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n}\n\n/** Floor + last-sale stats — each hides itself when its data is absent\n * (no dangling \"—\" placeholders), and the whole row disappears when\n * neither is available. */\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n if (!floor?.symbol && !lastSale?.symbol) return null;\n return (\n <div className=\"flex items-center gap-4 text-sm text-muted-foreground\">\n {floor?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n {lastSale?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Last sale</span>\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n </div>\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n floorPriceRaw,\n lastSaleRaw,\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n {/* soft brand light-leak behind the trade zone — no hard border, per §III */}\n <div\n aria-hidden\n className=\"aurora-purple pointer-events-none\"\n style={{ position: \"absolute\", width: 280, height: 280, top: -60, left: \"20%\" }}\n />\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-baseline gap-x-5 gap-y-1.5\">\n <div className=\"flex items-baseline gap-2\">\n <CurrencyIcon symbol={cheapest.price.currency ?? \"\"} size={26} />\n <span className=\"text-4xl font-bold tracking-tight\">\n {formatDisplayPrice(cheapest.price.formatted)}\n </span>\n {renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n </div>\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n </div>\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton\n label=\"Cancel\"\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"destructive\"\n renderHelp={renderHelp}\n />\n ) : null}\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"blue\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n label=\"License\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n tone=\"blue\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCI;AArCJ,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,oBAAsD;AACtD,kBAA0B;AAoB1B,MAAM,kBAA6D;AAAA,EACjE,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,aAAa;AACf;AAEA,SAAS,aAAa,EAAE,OAAO,MAAM,SAAS,MAAM,WAAW,OAAO,aAAa,WAAW,GAAsB;AAClH,SACE,4CAAC,SAAI,WAAW,2CAA2C,WAAW,mCAAmC,EAAE,IACzG;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,uLAAuL,gBAAgB,IAAI,CAAC;AAAA,MACvN;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,QACA;AAAA,QACA,cAAc,WAAW,WAAW,IAAI;AAAA;AAAA;AAAA,EAC3C,GACF;AAEJ;AAkCA,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,QAAM,QAAQ,oBAAgB,iCAAkB,aAAa,IAAI;AACjE,QAAM,WAAW,kBAAc,iCAAkB,WAAW,IAAI;AAChE,MAAI,CAAC,OAAO,UAAU,CAAC,UAAU,OAAQ,QAAO;AAChD,SACE,6CAAC,SAAI,WAAU,yDACZ;AAAA,WAAO,UACN,6CAAC,UAAK,WAAU,6BACd;AAAA,kDAAC,UAAK,mBAAK;AAAA,MACX,4CAAC,uCAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,OAC5H;AAAA,IAED,UAAU,UACT,6CAAC,UAAK,WAAU,6BACd;AAAA,kDAAC,UAAK,uBAAS;AAAA,MACf,4CAAC,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AAA,SACF,IACE;AAAA,MAEH,WAAW,WAAW,SAAS,IAC9B,6CAAC,SAAI,WAAU,uCACb;AAAA,qDAAC,OAAE,WAAU,+CAA8C;AAAA;AAAA,UACvC,WAAW;AAAA,UAAO;AAAA,WACtC;AAAA,QACA,4CAAC,SAAI,WAAU,aACZ,qBAAW,IAAI,CAAC,QACf,6CAAC,SAAwB,WAAU,4EACjC;AAAA,uDAAC,SAAI,WAAU,WACb;AAAA,wDAAC,OAAE,WAAU,qBACX,uDAAC,UAAK,WAAU,oCACb;AAAA,oDAAmB,IAAI,MAAM,SAAS;AAAA,cACvC,4CAAC,qCAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,eAC5D,GACF;AAAA,YACA,6CAAC,SAAI,WAAU,kCACb;AAAA,0DAAC,yCAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,cAC3G,4CAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,cACjD,6CAAC,SAAI,WAAU,yDACb;AAAA,4DAAC,6BAAM,WAAU,WAAU;AAAA,oBAC1B,uBAAU,IAAI,OAAO;AAAA,iBACxB;AAAA,eACF;AAAA,aACF;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,SAAS,MAAM,YAAY,GAAG;AAAA,cAC9B,WAAU;AAAA,cAEV;AAAA,4DAAC,mCAAY,WAAU,eAAc;AAAA,gBAAE;AAAA;AAAA;AAAA,UAEzC;AAAA,aAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,SACF,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -38,17 +38,17 @@ function ActionButton({ label, icon, onClick, tone, disabled = false, helpConten
|
|
|
38
38
|
) });
|
|
39
39
|
}
|
|
40
40
|
function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
41
|
-
if (!floorPriceRaw && !lastSaleRaw) return null;
|
|
42
41
|
const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;
|
|
43
42
|
const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
if (!floor?.symbol && !lastSale?.symbol) return null;
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", children: [
|
|
45
|
+
floor?.symbol && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { children: "Floor" }),
|
|
47
|
+
/* @__PURE__ */ jsx(CurrencyAmount, { amount: floor.numStr, symbol: floor.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
48
48
|
] }),
|
|
49
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
50
|
-
/* @__PURE__ */ jsx("span", {
|
|
51
|
-
|
|
49
|
+
lastSale?.symbol && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
50
|
+
/* @__PURE__ */ jsx("span", { children: "Last sale" }),
|
|
51
|
+
/* @__PURE__ */ jsx(CurrencyAmount, { amount: lastSale.numStr, symbol: lastSale.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
52
52
|
] })
|
|
53
53
|
] });
|
|
54
54
|
}
|
|
@@ -96,14 +96,16 @@ function AssetMarketplacePanel({
|
|
|
96
96
|
),
|
|
97
97
|
/* @__PURE__ */ jsxs("div", { className: "relative space-y-4", children: [
|
|
98
98
|
cheapest ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
99
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5", children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
|
|
101
|
+
/* @__PURE__ */ jsx(CurrencyIcon, { symbol: cheapest.price.currency ?? "", size: 26 }),
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: "text-4xl font-bold tracking-tight", children: formatDisplayPrice(cheapest.price.formatted) }),
|
|
103
|
+
renderHelp(
|
|
104
|
+
`${isOwner && !canBuyMore ? "Your listing" : "Current price"} \xB7 Expires ${timeUntil(cheapest.endTime)}`
|
|
105
|
+
)
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw })
|
|
105
108
|
] }),
|
|
106
|
-
/* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
107
109
|
isOwner ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
108
110
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
109
111
|
myListing ? /* @__PURE__ */ jsx(
|
|
@@ -227,7 +229,7 @@ function AssetMarketplacePanel({
|
|
|
227
229
|
)
|
|
228
230
|
] }) : null,
|
|
229
231
|
isOwner && activeBids.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-card/40 p-5 space-y-3", children: [
|
|
230
|
-
/* @__PURE__ */ jsxs("p", { className: "text-xs font-semibold
|
|
232
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs font-semibold text-muted-foreground", children: [
|
|
231
233
|
"Incoming offers (",
|
|
232
234
|
activeBids.length,
|
|
233
235
|
")"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\n\n/** Structural subset of `ApiOrder` (both apps' `@medialane/sdk` types satisfy this). */\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\ninterface ActionButtonProps {\n label: string;\n icon: ReactNode;\n onClick: () => void;\n tone: \"blue\" | \"orange\" | \"purple\" | \"destructive\" | \"transparent\";\n disabled?: boolean;\n helpContent?: string;\n renderHelp: (content: string) => ReactNode;\n}\n\nconst actionToneClass: Record<ActionButtonProps[\"tone\"], string> = {\n blue: \"bg-brand-blue\",\n orange: \"bg-brand-orange\",\n purple: \"bg-brand-purple\",\n destructive: \"bg-destructive\",\n transparent: \"bg-transparent\",\n};\n\nfunction ActionButton({ label, icon, onClick, tone, disabled = false, helpContent, renderHelp }: ActionButtonProps) {\n return (\n <div className={`btn-border-animated p-[1px] rounded-2xl ${disabled ? \"opacity-40 pointer-events-none\" : \"\"}`}>\n <button\n className={`w-full h-10 rounded-[15px] flex items-center justify-center gap-2 px-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] disabled:opacity-50 ${actionToneClass[tone]}`}\n disabled={disabled}\n onClick={onClick}\n >\n {icon}\n {label}\n {helpContent ? renderHelp(helpContent) : null}\n </button>\n </div>\n );\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n /** Raw \"0.07 STRK\"-style strings — already resolved by the caller. `null`/undefined renders \"—\". */\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n /** Renders the sign-in/connect-wallet CTA for the given label (e.g. \"Sign in to trade\"). */\n renderAuthAction: (label: string) => ReactNode;\n /** Renders an inline help/info affordance for the given tooltip text. */\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n}\n\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n if (!floorPriceRaw && !lastSaleRaw) return null;\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n return (\n <div className=\"flex items-center gap-4 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1.5\">\n <span className=\"uppercase tracking-wider font-semibold\">Floor</span>\n {floor && floor.symbol ? (\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n ) : (\n <span className=\"text-foreground font-semibold\">—</span>\n )}\n </span>\n <span className=\"flex items-center gap-1.5\">\n <span className=\"uppercase tracking-wider font-semibold\">Last sale</span>\n {lastSale && lastSale.symbol ? (\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n ) : (\n <span className=\"text-foreground font-semibold\">—</span>\n )}\n </span>\n </div>\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n floorPriceRaw,\n lastSaleRaw,\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n {/* soft brand light-leak behind the trade zone — no hard border, per §III */}\n <div\n aria-hidden\n className=\"aurora-purple pointer-events-none\"\n style={{ position: \"absolute\", width: 280, height: 280, top: -60, left: \"20%\" }}\n />\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-baseline gap-2\">\n <CurrencyIcon symbol={cheapest.price.currency ?? \"\"} size={26} />\n <span className=\"text-4xl font-bold tracking-tight\">\n {formatDisplayPrice(cheapest.price.formatted)}\n </span>\n {renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n </div>\n\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton\n label=\"Cancel\"\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"destructive\"\n renderHelp={renderHelp}\n />\n ) : null}\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"blue\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n label=\"License\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n tone=\"blue\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";AAwCI,SAkKc,UAlKd,KACE,YADF;AArCJ;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;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ACb;AAAA,6BAAC,OAAE,WAAU,wEAAuE;AAAA;AAAA,UAChE,WAAW;AAAA,UAAO;AAAA,WACtC;AAAA,QACA,oBAAC,SAAI,WAAU,aACZ,qBAAW,IAAI,CAAC,QACf,qBAAC,SAAwB,WAAU,4EACjC;AAAA,+BAAC,SAAI,WAAU,WACb;AAAA,gCAAC,OAAE,WAAU,qBACX,+BAAC,UAAK,WAAU,oCACb;AAAA,iCAAmB,IAAI,MAAM,SAAS;AAAA,cACvC,oBAAC,gBAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,eAC5D,GACF;AAAA,YACA,qBAAC,SAAI,WAAU,kCACb;AAAA,kCAAC,kBAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,cAC3G,oBAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,cACjD,qBAAC,SAAI,WAAU,yDACb;AAAA,oCAAC,SAAM,WAAU,WAAU;AAAA,gBAC1B,UAAU,IAAI,OAAO;AAAA,iBACxB;AAAA,eACF;AAAA,aACF;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,SAAS,MAAM,YAAY,GAAG;AAAA,cAC9B,WAAU;AAAA,cAEV;AAAA,oCAAC,eAAY,WAAU,eAAc;AAAA,gBAAE;AAAA;AAAA;AAAA,UAEzC;AAAA,aAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,SACF,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\n\n/** Structural subset of `ApiOrder` (both apps' `@medialane/sdk` types satisfy this). */\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\ninterface ActionButtonProps {\n label: string;\n icon: ReactNode;\n onClick: () => void;\n tone: \"blue\" | \"orange\" | \"purple\" | \"destructive\" | \"transparent\";\n disabled?: boolean;\n helpContent?: string;\n renderHelp: (content: string) => ReactNode;\n}\n\nconst actionToneClass: Record<ActionButtonProps[\"tone\"], string> = {\n blue: \"bg-brand-blue\",\n orange: \"bg-brand-orange\",\n purple: \"bg-brand-purple\",\n destructive: \"bg-destructive\",\n transparent: \"bg-transparent\",\n};\n\nfunction ActionButton({ label, icon, onClick, tone, disabled = false, helpContent, renderHelp }: ActionButtonProps) {\n return (\n <div className={`btn-border-animated p-[1px] rounded-2xl ${disabled ? \"opacity-40 pointer-events-none\" : \"\"}`}>\n <button\n className={`w-full h-10 rounded-[15px] flex items-center justify-center gap-2 px-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] disabled:opacity-50 ${actionToneClass[tone]}`}\n disabled={disabled}\n onClick={onClick}\n >\n {icon}\n {label}\n {helpContent ? renderHelp(helpContent) : null}\n </button>\n </div>\n );\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n /** Raw \"0.07 STRK\"-style strings — already resolved by the caller. `null`/undefined renders \"—\". */\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n /** Renders the sign-in/connect-wallet CTA for the given label (e.g. \"Sign in to trade\"). */\n renderAuthAction: (label: string) => ReactNode;\n /** Renders an inline help/info affordance for the given tooltip text. */\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n}\n\n/** Floor + last-sale stats — each hides itself when its data is absent\n * (no dangling \"—\" placeholders), and the whole row disappears when\n * neither is available. */\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n if (!floor?.symbol && !lastSale?.symbol) return null;\n return (\n <div className=\"flex items-center gap-4 text-sm text-muted-foreground\">\n {floor?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n {lastSale?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Last sale</span>\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n </div>\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n floorPriceRaw,\n lastSaleRaw,\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n {/* soft brand light-leak behind the trade zone — no hard border, per §III */}\n <div\n aria-hidden\n className=\"aurora-purple pointer-events-none\"\n style={{ position: \"absolute\", width: 280, height: 280, top: -60, left: \"20%\" }}\n />\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-baseline gap-x-5 gap-y-1.5\">\n <div className=\"flex items-baseline gap-2\">\n <CurrencyIcon symbol={cheapest.price.currency ?? \"\"} size={26} />\n <span className=\"text-4xl font-bold tracking-tight\">\n {formatDisplayPrice(cheapest.price.formatted)}\n </span>\n {renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n </div>\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n </div>\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton\n label=\"Cancel\"\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"destructive\"\n renderHelp={renderHelp}\n />\n ) : null}\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"blue\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n label=\"License\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n tone=\"blue\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";AAwCI,SAkKc,UAlKd,KACE,YADF;AArCJ;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAC1D;AAAA,EAAc;AAAA,EAAK;AAAA,OACd;AACP,SAAS,cAAc,sBAAs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B,WAAU,4EACjC;AAAA,+BAAC,SAAI,WAAU,WACb;AAAA,gCAAC,OAAE,WAAU,qBACX,+BAAC,UAAK,WAAU,oCACb;AAAA,iCAAmB,IAAI,MAAM,SAAS;AAAA,cACvC,oBAAC,gBAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,eAC5D,GACF;AAAA,YACA,qBAAC,SAAI,WAAU,kCACb;AAAA,kCAAC,kBAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,cAC3G,oBAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,cACjD,qBAAC,SAAI,WAAU,yDACb;AAAA,oCAAC,SAAM,WAAU,WAAU;AAAA,gBAC1B,UAAU,IAAI,OAAO;AAAA,iBACxB;AAAA,eACF;AAAA,aACF;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,SAAS,MAAM,YAAY,GAAG;AAAA,cAC9B,WAAU;AAAA,cAEV;AAAA,oCAAC,eAAY,WAAU,eAAc;AAAA,gBAAE;AAAA;AAAA;AAAA,UAEzC;AAAA,aAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,SACF,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -59,7 +59,7 @@ function AssetMarketsTab({
|
|
|
59
59
|
}) {
|
|
60
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-4 space-y-6", children: [
|
|
61
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
62
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Listings" }),
|
|
63
63
|
activeListings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground py-4 text-center", children: "No active listings." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-xl border border-border divide-y divide-border", children: activeListings.map((order) => {
|
|
64
64
|
const isMyOrder = walletAddress && order.offerer.toLowerCase() === walletAddress.toLowerCase();
|
|
65
65
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 gap-4", children: [
|
|
@@ -81,7 +81,7 @@ function AssetMarketsTab({
|
|
|
81
81
|
}) })
|
|
82
82
|
] }),
|
|
83
83
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
84
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Offers" }),
|
|
85
85
|
activeBids.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground py-4 text-center", children: "No active offers." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-xl border border-border divide-y divide-border", children: activeBids.map((bid) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 gap-4", children: [
|
|
86
86
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
87
87
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-bold text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-markets-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { Clock, CheckCircle } from \"lucide-react\";\nimport type { ApiOrder } from \"@medialane/sdk\";\n\n/** shadcn-equivalent small button (ui package carries no Radix/shadcn primitives) */\nfunction ActionButton({\n variant = \"default\",\n className,\n ...props\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & { variant?: \"default\" | \"destructive\" }) {\n return (\n <button\n className={cn(\n \"inline-flex items-center justify-center h-9 rounded-md px-3 text-xs font-medium transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface AssetMarketsTabProps {\n activeListings: ApiOrder[];\n activeBids: ApiOrder[];\n walletAddress?: string;\n isOwner: boolean;\n isProcessing: boolean;\n onBuyClick: (order: ApiOrder) => void;\n onCancelClick: (order: ApiOrder) => void;\n onAcceptClick: (order: ApiOrder) => void;\n}\n\nexport function AssetMarketsTab({\n activeListings,\n activeBids,\n walletAddress,\n isOwner,\n isProcessing,\n onBuyClick,\n onCancelClick,\n onAcceptClick,\n}: AssetMarketsTabProps) {\n return (\n <div className=\"mt-4 space-y-6\">\n <div>\n <p className=\"text-xs font-semibold
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-markets-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { Clock, CheckCircle } from \"lucide-react\";\nimport type { ApiOrder } from \"@medialane/sdk\";\n\n/** shadcn-equivalent small button (ui package carries no Radix/shadcn primitives) */\nfunction ActionButton({\n variant = \"default\",\n className,\n ...props\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & { variant?: \"default\" | \"destructive\" }) {\n return (\n <button\n className={cn(\n \"inline-flex items-center justify-center h-9 rounded-md px-3 text-xs font-medium transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface AssetMarketsTabProps {\n activeListings: ApiOrder[];\n activeBids: ApiOrder[];\n walletAddress?: string;\n isOwner: boolean;\n isProcessing: boolean;\n onBuyClick: (order: ApiOrder) => void;\n onCancelClick: (order: ApiOrder) => void;\n onAcceptClick: (order: ApiOrder) => void;\n}\n\nexport function AssetMarketsTab({\n activeListings,\n activeBids,\n walletAddress,\n isOwner,\n isProcessing,\n onBuyClick,\n onCancelClick,\n onAcceptClick,\n}: AssetMarketsTabProps) {\n return (\n <div className=\"mt-4 space-y-6\">\n <div>\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Listings</p>\n {activeListings.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-4 text-center\">No active listings.</p>\n ) : (\n <div className=\"rounded-xl border border-border divide-y divide-border\">\n {activeListings.map((order) => {\n const isMyOrder = walletAddress && order.offerer.toLowerCase() === walletAddress.toLowerCase();\n return (\n <div key={order.orderHash} className=\"flex items-center justify-between px-4 py-3 gap-4\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-sm inline-flex items-center gap-1.5\">\n {formatDisplayPrice(order.price.formatted)}\n <CurrencyIcon symbol={order.price.currency ?? \"\"} size={14} />\n </p>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground mt-0.5\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(order.endTime)}\n </div>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <AddressDisplay address={order.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n {isMyOrder ? (\n <ActionButton variant=\"destructive\" disabled={isProcessing} onClick={() => onCancelClick(order)}>\n Cancel\n </ActionButton>\n ) : (\n <ActionButton onClick={() => onBuyClick(order)}>Buy</ActionButton>\n )}\n </div>\n </div>\n );\n })}\n </div>\n )}\n </div>\n\n <div>\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Offers</p>\n {activeBids.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-4 text-center\">No active offers.</p>\n ) : (\n <div className=\"rounded-xl border border-border divide-y divide-border\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between px-4 py-3 gap-4\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-sm\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground mt-0.5\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n {isOwner && (\n <ActionButton disabled={isProcessing} onClick={() => onAcceptClick(bid)}>\n <CheckCircle className=\"h-3.5 w-3.5 mr-1.5\" />\n Accept\n </ActionButton>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBI;AAfJ,6BAA+B;AAC/B,2BAA6B;AAC7B,oBAAmC;AACnC,kBAA0B;AAC1B,gBAAmB;AACnB,0BAAmC;AAInC,SAAS,aAAa;AAAA,EACpB,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAA4F;AAC1F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,YAAY,gBACR,uEACA;AAAA,QACJ;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAaO,SAAS,gBAAgB;AAA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ACZ,qBAAW,IAAI,CAAC,QACf,6CAAC,SAAwB,WAAU,qDACjC;AAAA,qDAAC,SAAI,WAAU,WACb;AAAA,sDAAC,OAAE,WAAU,qBACX,uDAAC,UAAK,WAAU,oCACb;AAAA,kDAAmB,IAAI,MAAM,SAAS;AAAA,YACvC,4CAAC,qCAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,aAC5D,GACF;AAAA,UACA,6CAAC,SAAI,WAAU,gEACb;AAAA,wDAAC,6BAAM,WAAU,WAAU;AAAA,gBAC1B,uBAAU,IAAI,OAAO;AAAA,aACxB;AAAA,WACF;AAAA,QACA,6CAAC,SAAI,WAAU,oCACb;AAAA,sDAAC,yCAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,UAC1G,WACC,6CAAC,gBAAa,UAAU,cAAc,SAAS,MAAM,cAAc,GAAG,GACpE;AAAA,wDAAC,mCAAY,WAAU,sBAAqB;AAAA,YAAE;AAAA,aAEhD;AAAA,WAEJ;AAAA,WArBQ,IAAI,SAsBd,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -36,7 +36,7 @@ function AssetMarketsTab({
|
|
|
36
36
|
}) {
|
|
37
37
|
return /* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-6", children: [
|
|
38
38
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
39
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold
|
|
39
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Listings" }),
|
|
40
40
|
activeListings.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground py-4 text-center", children: "No active listings." }) : /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-border divide-y divide-border", children: activeListings.map((order) => {
|
|
41
41
|
const isMyOrder = walletAddress && order.offerer.toLowerCase() === walletAddress.toLowerCase();
|
|
42
42
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 gap-4", children: [
|
|
@@ -58,7 +58,7 @@ function AssetMarketsTab({
|
|
|
58
58
|
}) })
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
61
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold
|
|
61
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Offers" }),
|
|
62
62
|
activeBids.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground py-4 text-center", children: "No active offers." }) : /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-border divide-y divide-border", children: activeBids.map((bid) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 gap-4", children: [
|
|
63
63
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
64
64
|
/* @__PURE__ */ jsx("p", { className: "font-bold text-sm", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-markets-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { Clock, CheckCircle } from \"lucide-react\";\nimport type { ApiOrder } from \"@medialane/sdk\";\n\n/** shadcn-equivalent small button (ui package carries no Radix/shadcn primitives) */\nfunction ActionButton({\n variant = \"default\",\n className,\n ...props\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & { variant?: \"default\" | \"destructive\" }) {\n return (\n <button\n className={cn(\n \"inline-flex items-center justify-center h-9 rounded-md px-3 text-xs font-medium transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface AssetMarketsTabProps {\n activeListings: ApiOrder[];\n activeBids: ApiOrder[];\n walletAddress?: string;\n isOwner: boolean;\n isProcessing: boolean;\n onBuyClick: (order: ApiOrder) => void;\n onCancelClick: (order: ApiOrder) => void;\n onAcceptClick: (order: ApiOrder) => void;\n}\n\nexport function AssetMarketsTab({\n activeListings,\n activeBids,\n walletAddress,\n isOwner,\n isProcessing,\n onBuyClick,\n onCancelClick,\n onAcceptClick,\n}: AssetMarketsTabProps) {\n return (\n <div className=\"mt-4 space-y-6\">\n <div>\n <p className=\"text-xs font-semibold
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-markets-tab.tsx"],"sourcesContent":["\"use client\";\n\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { Clock, CheckCircle } from \"lucide-react\";\nimport type { ApiOrder } from \"@medialane/sdk\";\n\n/** shadcn-equivalent small button (ui package carries no Radix/shadcn primitives) */\nfunction ActionButton({\n variant = \"default\",\n className,\n ...props\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & { variant?: \"default\" | \"destructive\" }) {\n return (\n <button\n className={cn(\n \"inline-flex items-center justify-center h-9 rounded-md px-3 text-xs font-medium transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface AssetMarketsTabProps {\n activeListings: ApiOrder[];\n activeBids: ApiOrder[];\n walletAddress?: string;\n isOwner: boolean;\n isProcessing: boolean;\n onBuyClick: (order: ApiOrder) => void;\n onCancelClick: (order: ApiOrder) => void;\n onAcceptClick: (order: ApiOrder) => void;\n}\n\nexport function AssetMarketsTab({\n activeListings,\n activeBids,\n walletAddress,\n isOwner,\n isProcessing,\n onBuyClick,\n onCancelClick,\n onAcceptClick,\n}: AssetMarketsTabProps) {\n return (\n <div className=\"mt-4 space-y-6\">\n <div>\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Listings</p>\n {activeListings.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-4 text-center\">No active listings.</p>\n ) : (\n <div className=\"rounded-xl border border-border divide-y divide-border\">\n {activeListings.map((order) => {\n const isMyOrder = walletAddress && order.offerer.toLowerCase() === walletAddress.toLowerCase();\n return (\n <div key={order.orderHash} className=\"flex items-center justify-between px-4 py-3 gap-4\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-sm inline-flex items-center gap-1.5\">\n {formatDisplayPrice(order.price.formatted)}\n <CurrencyIcon symbol={order.price.currency ?? \"\"} size={14} />\n </p>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground mt-0.5\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(order.endTime)}\n </div>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <AddressDisplay address={order.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n {isMyOrder ? (\n <ActionButton variant=\"destructive\" disabled={isProcessing} onClick={() => onCancelClick(order)}>\n Cancel\n </ActionButton>\n ) : (\n <ActionButton onClick={() => onBuyClick(order)}>Buy</ActionButton>\n )}\n </div>\n </div>\n );\n })}\n </div>\n )}\n </div>\n\n <div>\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Offers</p>\n {activeBids.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-4 text-center\">No active offers.</p>\n ) : (\n <div className=\"rounded-xl border border-border divide-y divide-border\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between px-4 py-3 gap-4\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-sm\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground mt-0.5\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n {isOwner && (\n <ActionButton disabled={isProcessing} onClick={() => onAcceptClick(bid)}>\n <CheckCircle className=\"h-3.5 w-3.5 mr-1.5\" />\n Accept\n </ActionButton>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";AAiBI,cAgDgB,YAhDhB;AAfJ,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB,SAAS,OAAO,mBAAmB;AAInC,SAAS,aAAa;AAAA,EACpB,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAA4F;AAC1F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,YAAY,gBACR,uEACA;AAAA,QACJ;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAaO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyB;AACvB,SACE,qBAAC,SAAI,WAAU,kBACb;AAAA,yBAAC,SACC;AAAA,0BAAC,OAAE,WAAU,oDAAmD,sBAAQ;AAAA,MACvE,eAAe,WAAW,IACzB,oBAAC,OAAE,WAAU,kDAAiD,iCAAmB,IAEjF,oBAAC,SAAI,WAAU,0DACZ,yBAAe,IAAI,CAAC,UAAU;AAC7B,cAAM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A,YAC1B,UAAU,IAAI,OAAO;AAAA,aACxB;AAAA,WACF;AAAA,QACA,qBAAC,SAAI,WAAU,oCACb;AAAA,8BAAC,kBAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,UAC1G,WACC,qBAAC,gBAAa,UAAU,cAAc,SAAS,MAAM,cAAc,GAAG,GACpE;AAAA,gCAAC,eAAY,WAAU,sBAAqB;AAAA,YAAE;AAAA,aAEhD;AAAA,WAEJ;AAAA,WArBQ,IAAI,SAsBd,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -41,7 +41,7 @@ function Cell({
|
|
|
41
41
|
children: [
|
|
42
42
|
icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-primary/70", children: icon }) : null,
|
|
43
43
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-0.5", children: [
|
|
44
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[10px] font-medium
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[10px] font-medium text-muted-foreground truncate", title: label, children: label }),
|
|
45
45
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-bold text-foreground truncate", children: value })
|
|
46
46
|
] })
|
|
47
47
|
]
|
|
@@ -77,7 +77,7 @@ function AssetOverviewContent({
|
|
|
77
77
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-4 space-y-7", children: [
|
|
78
78
|
hasTemplateData ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ip_type_display.IPTypeDisplay, { attributes }) : null,
|
|
79
79
|
hasLicenseData ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
80
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Rights" }),
|
|
81
81
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
82
82
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
83
|
"div",
|
|
@@ -98,7 +98,7 @@ function AssetOverviewContent({
|
|
|
98
98
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground/70", children: "Kept in permanent, tamper-proof storage \xB7 recognized under international copyright law" })
|
|
99
99
|
] }) : null,
|
|
100
100
|
displayAttributes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
101
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Details" }),
|
|
102
102
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]", children: displayAttributes.map((attribute, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
103
|
Cell,
|
|
104
104
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, Calendar, DollarSign, GitBranch, Globe, Percent, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n}\n\n// Attribute values can be numbers (OpenSea allows numeric trait `value`s), so\n// guard against non-strings — `(123).trim()` would throw and crash the page.\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\n/** A standard bento square: a brand-tinted icon,
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, Calendar, DollarSign, GitBranch, Globe, Percent, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n}\n\n// Attribute values can be numbers (OpenSea allows numeric trait `value`s), so\n// guard against non-strings — `(123).trim()` would throw and crash the page.\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\n/** A standard bento square: a brand-tinted icon, a plain label, a bold value.\n * `wide` stretches it across two columns for an emphasized detail. */\nfunction Cell({\n icon,\n label,\n value,\n wide,\n}: {\n icon?: ReactNode;\n label: string;\n value: ReactNode;\n wide?: boolean;\n}) {\n return (\n <div\n className={`flex flex-col justify-between gap-2 rounded-xl bg-muted/25 ring-1 ring-border/40 p-3.5 ${\n wide ? \"col-span-2\" : \"\"\n }`}\n >\n {icon ? <span className=\"text-primary/70\">{icon}</span> : null}\n <div className=\"space-y-0.5\">\n <p className=\"text-[10px] font-medium text-muted-foreground truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-sm font-bold text-foreground truncate\">{value}</div>\n </div>\n </div>\n );\n}\n\n/**\n * Asset Overview tab, as a Bento 2.0 grid: an asymmetrical lattice of rounded\n * compartments on a soft brand light-leak, uniform gaps throughout. The license\n * summary is the emphasized cell (stretched 2×2, brand-gradient wash + license\n * stamp + emerald trust seal); each right is a standard square; Details follow.\n * Uses only design-system tokens (brand-* / primary / aurora / emerald-for-trust).\n */\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n}: AssetOverviewContentProps) {\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const registration = attr(\"Registration\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const facts = [\n { icon: <DollarSign className=\"h-4 w-4\" />, label: \"Commercial use\", value: commercialUse },\n { icon: <GitBranch className=\"h-4 w-4\" />, label: \"Derivatives\", value: derivatives },\n { icon: <UserCheck className=\"h-4 w-4\" />, label: \"Attribution\", value: attribution },\n { icon: <Globe className=\"h-4 w-4\" />, label: \"Territory\", value: territory },\n { icon: <Bot className=\"h-4 w-4\" />, label: \"AI & data mining\", value: aiPolicy },\n { icon: <Percent className=\"h-4 w-4\" />, label: \"Royalty\", value: royalty },\n { icon: <Calendar className=\"h-4 w-4\" />, label: \"Registered\", value: registration },\n ].filter((row) => !!row.value);\n\n return (\n <div className=\"mt-4 space-y-7\">\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Rights</h3>\n <div className=\"relative\">\n {/* soft brand light-leak behind the lattice */}\n <div\n aria-hidden\n className=\"aurora-purple pointer-events-none\"\n style={{ position: \"absolute\", width: 260, height: 260, top: -40, left: \"30%\" }}\n />\n <div className=\"relative grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]\">\n {/* emphasized cell — the license summary, stretched 2×2 */}\n <div className=\"col-span-2 sm:row-span-2 flex flex-col justify-between gap-4 rounded-2xl bg-gradient-to-br from-primary/10 via-primary/5 to-accent/10 ring-1 ring-primary/15 p-5\">\n {licenseType ? (\n <span className=\"pill-badge self-start text-[10px] uppercase tracking-wider\">{licenseType}</span>\n ) : null}\n {summary ? (\n <p className=\"text-base sm:text-lg font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </div>\n\n {facts.map(({ icon, label, value }) => (\n <Cell key={label} icon={icon} label={label} value={value} />\n ))}\n </div>\n </div>\n <p className=\"text-xs text-muted-foreground/70\">\n Kept in permanent, tamper-proof storage · recognized under international copyright law\n </p>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n wide={isAddressLike(attribute.value)}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-sm font-bold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Cc;AAxCd,0BAAgF;AAChF,6BAA8B;AAC9B,6BAA+B;AAC/B,6BAA+B;AAe/B,MAAM,gBAAgB,CAAC,MACrB,OAAO,MAAM,YAAY,uBAAuB,KAAK,EAAE,KAAK,CAAC;AAI/D,SAAS,KAAK;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AI,CAAC,WAAW,UACjC;AAAA,QAAC;AAAA;AAAA,UAEC,OAAO,UAAU,cAAc;AAAA,UAC/B,MAAM,cAAc,UAAU,KAAK;AAAA,UACnC,OACE,cAAc,UAAU,KAAK,IAC3B,4CAAC,yCAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,qBAAoB,IAEnF,UAAU,SAAS;AAAA;AAAA,QAPlB;AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,4CAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -18,7 +18,7 @@ function Cell({
|
|
|
18
18
|
children: [
|
|
19
19
|
icon ? /* @__PURE__ */ jsx("span", { className: "text-primary/70", children: icon }) : null,
|
|
20
20
|
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
21
|
-
/* @__PURE__ */ jsx("p", { className: "text-[10px] font-medium
|
|
21
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] font-medium text-muted-foreground truncate", title: label, children: label }),
|
|
22
22
|
/* @__PURE__ */ jsx("div", { className: "text-sm font-bold text-foreground truncate", children: value })
|
|
23
23
|
] })
|
|
24
24
|
]
|
|
@@ -54,7 +54,7 @@ function AssetOverviewContent({
|
|
|
54
54
|
return /* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-7", children: [
|
|
55
55
|
hasTemplateData ? /* @__PURE__ */ jsx(IPTypeDisplay, { attributes }) : null,
|
|
56
56
|
hasLicenseData ? /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
57
|
-
/* @__PURE__ */ jsx("h3", { className: "text-
|
|
57
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Rights" }),
|
|
58
58
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
59
59
|
/* @__PURE__ */ jsx(
|
|
60
60
|
"div",
|
|
@@ -75,7 +75,7 @@ function AssetOverviewContent({
|
|
|
75
75
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70", children: "Kept in permanent, tamper-proof storage \xB7 recognized under international copyright law" })
|
|
76
76
|
] }) : null,
|
|
77
77
|
displayAttributes.length > 0 ? /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
78
|
-
/* @__PURE__ */ jsx("h3", { className: "text-
|
|
78
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Details" }),
|
|
79
79
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]", children: displayAttributes.map((attribute, index) => /* @__PURE__ */ jsx(
|
|
80
80
|
Cell,
|
|
81
81
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, Calendar, DollarSign, GitBranch, Globe, Percent, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n}\n\n// Attribute values can be numbers (OpenSea allows numeric trait `value`s), so\n// guard against non-strings — `(123).trim()` would throw and crash the page.\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\n/** A standard bento square: a brand-tinted icon,
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, Calendar, DollarSign, GitBranch, Globe, Percent, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n}\n\n// Attribute values can be numbers (OpenSea allows numeric trait `value`s), so\n// guard against non-strings — `(123).trim()` would throw and crash the page.\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\n/** A standard bento square: a brand-tinted icon, a plain label, a bold value.\n * `wide` stretches it across two columns for an emphasized detail. */\nfunction Cell({\n icon,\n label,\n value,\n wide,\n}: {\n icon?: ReactNode;\n label: string;\n value: ReactNode;\n wide?: boolean;\n}) {\n return (\n <div\n className={`flex flex-col justify-between gap-2 rounded-xl bg-muted/25 ring-1 ring-border/40 p-3.5 ${\n wide ? \"col-span-2\" : \"\"\n }`}\n >\n {icon ? <span className=\"text-primary/70\">{icon}</span> : null}\n <div className=\"space-y-0.5\">\n <p className=\"text-[10px] font-medium text-muted-foreground truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-sm font-bold text-foreground truncate\">{value}</div>\n </div>\n </div>\n );\n}\n\n/**\n * Asset Overview tab, as a Bento 2.0 grid: an asymmetrical lattice of rounded\n * compartments on a soft brand light-leak, uniform gaps throughout. The license\n * summary is the emphasized cell (stretched 2×2, brand-gradient wash + license\n * stamp + emerald trust seal); each right is a standard square; Details follow.\n * Uses only design-system tokens (brand-* / primary / aurora / emerald-for-trust).\n */\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n}: AssetOverviewContentProps) {\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const registration = attr(\"Registration\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const facts = [\n { icon: <DollarSign className=\"h-4 w-4\" />, label: \"Commercial use\", value: commercialUse },\n { icon: <GitBranch className=\"h-4 w-4\" />, label: \"Derivatives\", value: derivatives },\n { icon: <UserCheck className=\"h-4 w-4\" />, label: \"Attribution\", value: attribution },\n { icon: <Globe className=\"h-4 w-4\" />, label: \"Territory\", value: territory },\n { icon: <Bot className=\"h-4 w-4\" />, label: \"AI & data mining\", value: aiPolicy },\n { icon: <Percent className=\"h-4 w-4\" />, label: \"Royalty\", value: royalty },\n { icon: <Calendar className=\"h-4 w-4\" />, label: \"Registered\", value: registration },\n ].filter((row) => !!row.value);\n\n return (\n <div className=\"mt-4 space-y-7\">\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Rights</h3>\n <div className=\"relative\">\n {/* soft brand light-leak behind the lattice */}\n <div\n aria-hidden\n className=\"aurora-purple pointer-events-none\"\n style={{ position: \"absolute\", width: 260, height: 260, top: -40, left: \"30%\" }}\n />\n <div className=\"relative grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]\">\n {/* emphasized cell — the license summary, stretched 2×2 */}\n <div className=\"col-span-2 sm:row-span-2 flex flex-col justify-between gap-4 rounded-2xl bg-gradient-to-br from-primary/10 via-primary/5 to-accent/10 ring-1 ring-primary/15 p-5\">\n {licenseType ? (\n <span className=\"pill-badge self-start text-[10px] uppercase tracking-wider\">{licenseType}</span>\n ) : null}\n {summary ? (\n <p className=\"text-base sm:text-lg font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </div>\n\n {facts.map(({ icon, label, value }) => (\n <Cell key={label} icon={icon} label={label} value={value} />\n ))}\n </div>\n </div>\n <p className=\"text-xs text-muted-foreground/70\">\n Kept in permanent, tamper-proof storage · recognized under international copyright law\n </p>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n wide={isAddressLike(attribute.value)}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-sm font-bold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AA2Cc,cACR,YADQ;AAxCd,SAAS,KAAK,UAAU,YAAY,WAAW,OAAO,SAAS,iBAAiB;AAChF,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAe/B,MAAM,gBAAgB,CAAC,MACrB,OAAO,MAAM,YAAY,uBAAuB,KAAK,EAAE,KAAK,CAAC;AAI/D,SAAS,KAAK;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,0FACT,OAAO,eAAe,EACxB;AAAA,MAEC;AAAA,eAAO,oBAAC,UAAK,WAAU,mBAAmB,gBAAK,IAAU;AAAA,QAC1D,qBAAC,SAAI,WAAU,eACb;AAAA,8BAAC,OAAE,WAAU,0DAAyD,OAAO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,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,oBAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -36,9 +36,7 @@ __export(asset_top_sections_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(asset_top_sections_exports);
|
|
37
37
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
38
|
var import_image = __toESM(require("next/image"), 1);
|
|
39
|
-
var import_link = __toESM(require("next/link"), 1);
|
|
40
39
|
var import_framer_motion = require("framer-motion");
|
|
41
|
-
var import_address_display = require("./address-display.js");
|
|
42
40
|
var import_parent_attribution_banner = require("./parent-attribution-banner.js");
|
|
43
41
|
var import_ip_type_badge = require("./ip-type-badge.js");
|
|
44
42
|
var import_lucide_react = require("lucide-react");
|
|
@@ -90,8 +88,7 @@ function AssetHeaderBlock({
|
|
|
90
88
|
ipType,
|
|
91
89
|
showMultiEditionBadge = false,
|
|
92
90
|
parentContract,
|
|
93
|
-
parentTokenId
|
|
94
|
-
ownerAddress
|
|
91
|
+
parentTokenId
|
|
95
92
|
}) {
|
|
96
93
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
97
94
|
ipType || showMultiEditionBadge ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [
|
|
@@ -109,17 +106,6 @@ function AssetHeaderBlock({
|
|
|
109
106
|
parentName: `Token #${parentTokenId}`
|
|
110
107
|
}
|
|
111
108
|
) }) : null,
|
|
112
|
-
ownerAddress ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-1 flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
113
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold uppercase tracking-wider", children: "Owner" }),
|
|
114
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
-
import_link.default,
|
|
116
|
-
{
|
|
117
|
-
href: `/creator/${ownerAddress}`,
|
|
118
|
-
className: "hover:text-primary transition-colors font-medium",
|
|
119
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: ownerAddress })
|
|
120
|
-
}
|
|
121
|
-
)
|
|
122
|
-
] }) : null,
|
|
123
109
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl lg:text-5xl font-bold", children: name }),
|
|
124
110
|
description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed mt-1", children: description }) : null
|
|
125
111
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport { motion } from \"framer-motion\";\nimport { ParentAttributionBanner } from \"./parent-attribution-banner.js\";\nimport { IpTypeBadge } from \"./ip-type-badge.js\";\nimport { Layers, Users } from \"lucide-react\";\n\ninterface AssetMediaColumnProps {\n shouldReduce: boolean;\n image: string;\n imageAlt: string;\n imgError: boolean;\n onImageError: () => void;\n fallback: React.ReactNode;\n stats?: Array<{\n value: string;\n label: string;\n icon: React.ReactNode;\n }>;\n}\n\nexport function AssetMediaColumn({\n shouldReduce,\n image,\n imageAlt,\n imgError,\n onImageError,\n fallback,\n stats,\n}: AssetMediaColumnProps) {\n return (\n <motion.div\n initial={shouldReduce ? false : { scale: 1.0, opacity: 0 }}\n animate={{ scale: 1.02, opacity: 1 }}\n transition={{ duration: 0.6, ease: \"easeOut\" }}\n className=\"overflow-hidden rounded-xl lg:sticky lg:top-16\"\n >\n <div className=\"rounded-2xl overflow-hidden border border-border bg-muted\">\n {image && !imgError ? (\n <Image\n src={image}\n alt={imageAlt}\n width={0}\n height={0}\n sizes=\"(max-width: 1024px) 100vw, 66vw\"\n className=\"w-full h-auto\"\n onError={onImageError}\n crossOrigin=\"anonymous\"\n priority\n />\n ) : (\n fallback\n )}\n </div>\n\n {stats && stats.length > 0 ? (\n <div className={`grid gap-3 mt-4 ${stats.length === 2 ? \"grid-cols-2\" : \"grid-cols-1\"}`}>\n {stats.map((stat) => (\n <div key={stat.label} className=\"rounded-xl border border-border bg-muted/20 p-4 text-center\">\n <p className=\"text-2xl font-black\">{stat.value}</p>\n <div className=\"flex items-center justify-center gap-1 text-xs text-muted-foreground mt-1\">\n {stat.icon}\n {stat.label}\n </div>\n </div>\n ))}\n </div>\n ) : null}\n </motion.div>\n );\n}\n\ninterface AssetHeaderBlockProps {\n name: string;\n description?: string | null;\n ipType?: string | null;\n showMultiEditionBadge?: boolean;\n parentContract?: string | null;\n parentTokenId?: string | null;\n}\n\n/** Owner identity moved out of this block (2026-07-05) — it now renders next\n * to the collection bar (`AssetCollectionBar`'s `ownerAddress` prop) instead\n * of floating above the title, pairing \"who owns it\" with \"where it lives\". */\nexport function AssetHeaderBlock({\n name,\n description,\n ipType,\n showMultiEditionBadge = false,\n parentContract,\n parentTokenId,\n}: AssetHeaderBlockProps) {\n return (\n <div>\n {ipType || showMultiEditionBadge ? (\n <div className=\"flex items-center gap-2 flex-wrap mb-2\">\n {ipType ? <IpTypeBadge ipType={ipType} size=\"md\" /> : null}\n {showMultiEditionBadge ? (\n <span className=\"inline-flex items-center gap-1 text-[11px] font-semibold px-2.5 py-1 rounded-full border border-violet-500/30 bg-violet-500/10 text-violet-500\">\n <Layers className=\"h-3 w-3\" />\n Multi-edition\n </span>\n ) : null}\n </div>\n ) : null}\n {parentContract && parentTokenId ? (\n <div className=\"mb-3\">\n <ParentAttributionBanner\n parentContract={parentContract}\n parentTokenId={parentTokenId}\n parentName={`Token #${parentTokenId}`}\n />\n </div>\n ) : null}\n <h1 className=\"text-3xl lg:text-5xl font-bold\">{name}</h1>\n {description ? (\n <p className=\"text-sm text-muted-foreground leading-relaxed mt-1\">{description}</p>\n ) : null}\n </div>\n );\n}\n\nexport function buildEditionStats(totalEditions: number, uniqueOwners: number) {\n return [\n {\n value: totalEditions.toLocaleString(),\n label: \"editions minted\",\n icon: <Layers className=\"h-3 w-3\" />,\n },\n {\n value: uniqueOwners.toLocaleString(),\n label: \"unique owners\",\n icon: <Users className=\"h-3 w-3\" />,\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCU;AAtCV,mBAAkB;AAClB,2BAAuB;AACvB,uCAAwC;AACxC,2BAA4B;AAC5B,0BAA8B;AAgBvB,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,SACE;AAAA,IAAC,4BAAO;AAAA,IAAP;AAAA,MACC,SAAS,eAAe,QAAQ,EAAE,OAAO,GAAK,SAAS,EAAE;AAAA,MACzD,SAAS,EAAE,OAAO,MAAM,SAAS,EAAE;AAAA,MACnC,YAAY,EAAE,UAAU,KAAK,MAAM,UAAU;AAAA,MAC7C,WAAU;AAAA,MAEV;AAAA,oDAAC,SAAI,WAAU,6DACZ,mBAAS,CAAC,WACT;AAAA,UAAC,aAAAA;AAAA,UAAA;AAAA,YACC,KAAK;AAAA,YACL,KAAK;AAAA,YACL,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAS;AAAA,YACT,aAAY;AAAA,YACZ,UAAQ;AAAA;AAAA,QACV,IAEA,UAEJ;AAAA,QAEC,SAAS,MAAM,SAAS,IACvB,4CAAC,SAAI,WAAW,mBAAmB,MAAM,WAAW,IAAI,gBAAgB,aAAa,IAClF,gBAAM,IAAI,CAAC,SACV,6CAAC,SAAqB,WAAU,+DAC9B;AAAA,sDAAC,OAAE,WAAU,uBAAuB,eAAK,OAAM;AAAA,UAC/C,6CAAC,SAAI,WAAU,6EACZ;AAAA,iBAAK;AAAA,YACL,KAAK;AAAA,aACR;AAAA,aALQ,KAAK,KAMf,CACD,GACH,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AAcO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB;AAAA,EACA;AACF,GAA0B;AACxB,SACE,6CAAC,SACE;AAAA,cAAU,wBACT,6CAAC,SAAI,WAAU,0CACZ;AAAA,eAAS,4CAAC,oCAAY,QAAgB,MAAK,MAAK,IAAK;AAAA,MACrD,wBACC,6CAAC,UAAK,WAAU,kJACd;AAAA,oDAAC,8BAAO,WAAU,WAAU;AAAA,QAAE;AAAA,SAEhC,IACE;AAAA,OACN,IACE;AAAA,IACH,kBAAkB,gBACjB,4CAAC,SAAI,WAAU,QACb;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,YAAY,UAAU,aAAa;AAAA;AAAA,IACrC,GACF,IACE;AAAA,IACJ,4CAAC,QAAG,WAAU,kCAAkC,gBAAK;AAAA,IACpD,cACC,4CAAC,OAAE,WAAU,sDAAsD,uBAAY,IAC7E;AAAA,KACN;AAEJ;AAEO,SAAS,kBAAkB,eAAuB,cAAsB;AAC7E,SAAO;AAAA,IACL;AAAA,MACE,OAAO,cAAc,eAAe;AAAA,MACpC,OAAO;AAAA,MACP,MAAM,4CAAC,8BAAO,WAAU,WAAU;AAAA,IACpC;AAAA,IACA;AAAA,MACE,OAAO,aAAa,eAAe;AAAA,MACnC,OAAO;AAAA,MACP,MAAM,4CAAC,6BAAM,WAAU,WAAU;AAAA,IACnC;AAAA,EACF;AACF;","names":["Image"]}
|
|
@@ -21,9 +21,11 @@ interface AssetHeaderBlockProps {
|
|
|
21
21
|
showMultiEditionBadge?: boolean;
|
|
22
22
|
parentContract?: string | null;
|
|
23
23
|
parentTokenId?: string | null;
|
|
24
|
-
ownerAddress?: string | null;
|
|
25
24
|
}
|
|
26
|
-
|
|
25
|
+
/** Owner identity moved out of this block (2026-07-05) — it now renders next
|
|
26
|
+
* to the collection bar (`AssetCollectionBar`'s `ownerAddress` prop) instead
|
|
27
|
+
* of floating above the title, pairing "who owns it" with "where it lives". */
|
|
28
|
+
declare function AssetHeaderBlock({ name, description, ipType, showMultiEditionBadge, parentContract, parentTokenId, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
|
|
27
29
|
declare function buildEditionStats(totalEditions: number, uniqueOwners: number): {
|
|
28
30
|
value: string;
|
|
29
31
|
label: string;
|
|
@@ -21,9 +21,11 @@ interface AssetHeaderBlockProps {
|
|
|
21
21
|
showMultiEditionBadge?: boolean;
|
|
22
22
|
parentContract?: string | null;
|
|
23
23
|
parentTokenId?: string | null;
|
|
24
|
-
ownerAddress?: string | null;
|
|
25
24
|
}
|
|
26
|
-
|
|
25
|
+
/** Owner identity moved out of this block (2026-07-05) — it now renders next
|
|
26
|
+
* to the collection bar (`AssetCollectionBar`'s `ownerAddress` prop) instead
|
|
27
|
+
* of floating above the title, pairing "who owns it" with "where it lives". */
|
|
28
|
+
declare function AssetHeaderBlock({ name, description, ipType, showMultiEditionBadge, parentContract, parentTokenId, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
|
|
27
29
|
declare function buildEditionStats(totalEditions: number, uniqueOwners: number): {
|
|
28
30
|
value: string;
|
|
29
31
|
label: string;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Image from "next/image";
|
|
4
|
-
import Link from "next/link";
|
|
5
4
|
import { motion } from "framer-motion";
|
|
6
|
-
import { AddressDisplay } from "./address-display.js";
|
|
7
5
|
import { ParentAttributionBanner } from "./parent-attribution-banner.js";
|
|
8
6
|
import { IpTypeBadge } from "./ip-type-badge.js";
|
|
9
7
|
import { Layers, Users } from "lucide-react";
|
|
@@ -55,8 +53,7 @@ function AssetHeaderBlock({
|
|
|
55
53
|
ipType,
|
|
56
54
|
showMultiEditionBadge = false,
|
|
57
55
|
parentContract,
|
|
58
|
-
parentTokenId
|
|
59
|
-
ownerAddress
|
|
56
|
+
parentTokenId
|
|
60
57
|
}) {
|
|
61
58
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
62
59
|
ipType || showMultiEditionBadge ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [
|
|
@@ -74,17 +71,6 @@ function AssetHeaderBlock({
|
|
|
74
71
|
parentName: `Token #${parentTokenId}`
|
|
75
72
|
}
|
|
76
73
|
) }) : null,
|
|
77
|
-
ownerAddress ? /* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
78
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold uppercase tracking-wider", children: "Owner" }),
|
|
79
|
-
/* @__PURE__ */ jsx(
|
|
80
|
-
Link,
|
|
81
|
-
{
|
|
82
|
-
href: `/creator/${ownerAddress}`,
|
|
83
|
-
className: "hover:text-primary transition-colors font-medium",
|
|
84
|
-
children: /* @__PURE__ */ jsx(AddressDisplay, { address: ownerAddress })
|
|
85
|
-
}
|
|
86
|
-
)
|
|
87
|
-
] }) : null,
|
|
88
74
|
/* @__PURE__ */ jsx("h1", { className: "text-3xl lg:text-5xl font-bold", children: name }),
|
|
89
75
|
description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed mt-1", children: description }) : null
|
|
90
76
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport { motion } from \"framer-motion\";\nimport { ParentAttributionBanner } from \"./parent-attribution-banner.js\";\nimport { IpTypeBadge } from \"./ip-type-badge.js\";\nimport { Layers, Users } from \"lucide-react\";\n\ninterface AssetMediaColumnProps {\n shouldReduce: boolean;\n image: string;\n imageAlt: string;\n imgError: boolean;\n onImageError: () => void;\n fallback: React.ReactNode;\n stats?: Array<{\n value: string;\n label: string;\n icon: React.ReactNode;\n }>;\n}\n\nexport function AssetMediaColumn({\n shouldReduce,\n image,\n imageAlt,\n imgError,\n onImageError,\n fallback,\n stats,\n}: AssetMediaColumnProps) {\n return (\n <motion.div\n initial={shouldReduce ? false : { scale: 1.0, opacity: 0 }}\n animate={{ scale: 1.02, opacity: 1 }}\n transition={{ duration: 0.6, ease: \"easeOut\" }}\n className=\"overflow-hidden rounded-xl lg:sticky lg:top-16\"\n >\n <div className=\"rounded-2xl overflow-hidden border border-border bg-muted\">\n {image && !imgError ? (\n <Image\n src={image}\n alt={imageAlt}\n width={0}\n height={0}\n sizes=\"(max-width: 1024px) 100vw, 66vw\"\n className=\"w-full h-auto\"\n onError={onImageError}\n crossOrigin=\"anonymous\"\n priority\n />\n ) : (\n fallback\n )}\n </div>\n\n {stats && stats.length > 0 ? (\n <div className={`grid gap-3 mt-4 ${stats.length === 2 ? \"grid-cols-2\" : \"grid-cols-1\"}`}>\n {stats.map((stat) => (\n <div key={stat.label} className=\"rounded-xl border border-border bg-muted/20 p-4 text-center\">\n <p className=\"text-2xl font-black\">{stat.value}</p>\n <div className=\"flex items-center justify-center gap-1 text-xs text-muted-foreground mt-1\">\n {stat.icon}\n {stat.label}\n </div>\n </div>\n ))}\n </div>\n ) : null}\n </motion.div>\n );\n}\n\ninterface AssetHeaderBlockProps {\n name: string;\n description?: string | null;\n ipType?: string | null;\n showMultiEditionBadge?: boolean;\n parentContract?: string | null;\n parentTokenId?: string | null;\n}\n\n/** Owner identity moved out of this block (2026-07-05) — it now renders next\n * to the collection bar (`AssetCollectionBar`'s `ownerAddress` prop) instead\n * of floating above the title, pairing \"who owns it\" with \"where it lives\". */\nexport function AssetHeaderBlock({\n name,\n description,\n ipType,\n showMultiEditionBadge = false,\n parentContract,\n parentTokenId,\n}: AssetHeaderBlockProps) {\n return (\n <div>\n {ipType || showMultiEditionBadge ? (\n <div className=\"flex items-center gap-2 flex-wrap mb-2\">\n {ipType ? <IpTypeBadge ipType={ipType} size=\"md\" /> : null}\n {showMultiEditionBadge ? (\n <span className=\"inline-flex items-center gap-1 text-[11px] font-semibold px-2.5 py-1 rounded-full border border-violet-500/30 bg-violet-500/10 text-violet-500\">\n <Layers className=\"h-3 w-3\" />\n Multi-edition\n </span>\n ) : null}\n </div>\n ) : null}\n {parentContract && parentTokenId ? (\n <div className=\"mb-3\">\n <ParentAttributionBanner\n parentContract={parentContract}\n parentTokenId={parentTokenId}\n parentName={`Token #${parentTokenId}`}\n />\n </div>\n ) : null}\n <h1 className=\"text-3xl lg:text-5xl font-bold\">{name}</h1>\n {description ? (\n <p className=\"text-sm text-muted-foreground leading-relaxed mt-1\">{description}</p>\n ) : null}\n </div>\n );\n}\n\nexport function buildEditionStats(totalEditions: number, uniqueOwners: number) {\n return [\n {\n value: totalEditions.toLocaleString(),\n label: \"editions minted\",\n icon: <Layers className=\"h-3 w-3\" />,\n },\n {\n value: uniqueOwners.toLocaleString(),\n label: \"unique owners\",\n icon: <Users className=\"h-3 w-3\" />,\n },\n ];\n}\n"],"mappings":";AAwCU,cAqBI,YArBJ;AAtCV,OAAO,WAAW;AAClB,SAAS,cAAc;AACvB,SAAS,+BAA+B;AACxC,SAAS,mBAAmB;AAC5B,SAAS,QAAQ,aAAa;AAgBvB,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACC,SAAS,eAAe,QAAQ,EAAE,OAAO,GAAK,SAAS,EAAE;AAAA,MACzD,SAAS,EAAE,OAAO,MAAM,SAAS,EAAE;AAA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