@medialane/ui 0.207.0 → 0.209.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/asset-collection-bar.cjs +12 -2
- package/dist/components/asset-collection-bar.cjs.map +1 -1
- package/dist/components/asset-collection-bar.d.cts +2 -1
- package/dist/components/asset-collection-bar.d.ts +2 -1
- package/dist/components/asset-collection-bar.js +12 -2
- package/dist/components/asset-collection-bar.js.map +1 -1
- package/dist/components/asset-lightbox.cjs +1 -1
- package/dist/components/asset-lightbox.cjs.map +1 -1
- package/dist/components/asset-lightbox.js +1 -1
- package/dist/components/asset-lightbox.js.map +1 -1
- package/dist/components/asset-marketplace-panel.cjs +11 -28
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.d.cts +1 -3
- package/dist/components/asset-marketplace-panel.d.ts +1 -3
- package/dist/components/asset-marketplace-panel.js +12 -29
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/asset-page.cjs +2 -3
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.js +2 -3
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/license-request-page.cjs +238 -0
- package/dist/components/license-request-page.cjs.map +1 -0
- package/dist/components/license-request-page.d.cts +8 -0
- package/dist/components/license-request-page.d.ts +8 -0
- package/dist/components/license-request-page.js +204 -0
- package/dist/components/license-request-page.js.map +1 -0
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +1 -0
- package/dist/components/medialane-app.d.ts +1 -0
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -36,14 +36,18 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_image = __toESM(require("./image.js"), 1);
|
|
37
37
|
var import_link = __toESM(require("./link.js"), 1);
|
|
38
38
|
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var import_currency_icon = require("./currency-icon.js");
|
|
40
|
+
var import_format = require("../utils/format.js");
|
|
39
41
|
function AssetCollectionBar({
|
|
40
42
|
collectionName,
|
|
41
43
|
collectionImage,
|
|
42
44
|
collectionHref,
|
|
43
45
|
currentTokenId,
|
|
44
46
|
siblingTokens,
|
|
45
|
-
onNavigate
|
|
47
|
+
onNavigate,
|
|
48
|
+
floorPriceRaw
|
|
46
49
|
}) {
|
|
50
|
+
const floor = floorPriceRaw ? (0, import_format.parsePriceDisplay)(floorPriceRaw) : null;
|
|
47
51
|
const others = siblingTokens.filter(
|
|
48
52
|
(t) => String(t.tokenId) !== String(currentTokenId)
|
|
49
53
|
);
|
|
@@ -51,7 +55,13 @@ function AssetCollectionBar({
|
|
|
51
55
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl bg-gradient-to-br from-muted/40 to-transparent overflow-hidden p-4 space-y-3", children: [
|
|
52
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: collectionHref, className: "flex items-center gap-3 group min-w-0", children: [
|
|
53
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-11 w-11 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-brand-blue/20 to-brand-purple/20 ring-1 ring-border/30 group-hover:ring-border/60 transition-all", children: collectionImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: collectionImage, alt: "", fill: true, className: "object-cover", unoptimized: true }) : null }),
|
|
54
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-base font-bold leading-tight truncate group-hover:text-primary transition-colors", children: collectionName }),
|
|
60
|
+
floor?.symbol ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Floor" }),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: floor.numStr, symbol: floor.symbol, iconSize: 11, amountClassName: "font-semibold text-foreground" })
|
|
63
|
+
] }) : null
|
|
64
|
+
] }),
|
|
55
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 h-8 w-8 rounded-xl bg-background/40 flex items-center justify-center text-muted-foreground group-hover:bg-background/70 group-hover:text-foreground transition-all", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-3.5 w-3.5" }) })
|
|
56
66
|
] }),
|
|
57
67
|
preview.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-4 gap-1.5", children: Array.from({ length: 4 }).map((_, i) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n}\n\nexport function AssetCollectionBar({\n collectionName,\n collectionImage,\n collectionHref,\n currentTokenId,\n siblingTokens,\n onNavigate,\n}: AssetCollectionBarProps) {\n\n const others = siblingTokens.filter(\n (t) => String(t.tokenId) !== String(currentTokenId)\n );\n const preview = others.slice(0, 4);\n\n return (\n <div className=\"rounded-2xl bg-gradient-to-br from-muted/40 to-transparent overflow-hidden p-4 space-y-3\">\n\n <Link href={collectionHref} className=\"flex items-center gap-3 group min-w-0\">\n <div className=\"relative h-11 w-11 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-brand-blue/20 to-brand-purple/20 ring-1 ring-border/30 group-hover:ring-border/60 transition-all\">\n {collectionImage ? (\n <Image src={collectionImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : null}\n </div>\n <p className=\"text-base font-bold leading-tight truncate
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n floorPriceRaw?: string | null;\n}\n\nexport function AssetCollectionBar({\n collectionName,\n collectionImage,\n collectionHref,\n currentTokenId,\n siblingTokens,\n onNavigate,\n floorPriceRaw,\n}: AssetCollectionBarProps) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n\n const others = siblingTokens.filter(\n (t) => String(t.tokenId) !== String(currentTokenId)\n );\n const preview = others.slice(0, 4);\n\n return (\n <div className=\"rounded-2xl bg-gradient-to-br from-muted/40 to-transparent overflow-hidden p-4 space-y-3\">\n\n <Link href={collectionHref} className=\"flex items-center gap-3 group min-w-0\">\n <div className=\"relative h-11 w-11 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-brand-blue/20 to-brand-purple/20 ring-1 ring-border/30 group-hover:ring-border/60 transition-all\">\n {collectionImage ? (\n <Image src={collectionImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : null}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-base font-bold leading-tight truncate group-hover:text-primary transition-colors\">\n {collectionName}\n </p>\n {floor?.symbol ? (\n <p className=\"mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={11} amountClassName=\"font-semibold text-foreground\" />\n </p>\n ) : null}\n </div>\n <div className=\"shrink-0 h-8 w-8 rounded-xl bg-background/40 flex items-center justify-center text-muted-foreground group-hover:bg-background/70 group-hover:text-foreground transition-all\">\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </div>\n </Link>\n\n {preview.length > 0 && (\n <div className=\"grid grid-cols-4 gap-1.5\">\n {Array.from({ length: 4 }).map((_, i) => {\n const sibling = preview[i];\n if (!sibling) {\n return <div key={`empty-${i}`} className=\"aspect-square rounded-xl bg-muted/20\" />;\n }\n return (\n <button\n key={sibling.tokenId}\n type=\"button\"\n onClick={() => onNavigate(sibling.tokenId)}\n className=\"group relative aspect-square rounded-xl overflow-hidden transition-all duration-200 hover:scale-[1.02] active:scale-95\"\n >\n {sibling.image ? (\n <Image\n src={sibling.image}\n alt=\"\"\n fill\n className=\"object-cover transition-transform duration-300 group-hover:scale-105\"\n unoptimized\n />\n ) : (\n <div className=\"h-full w-full bg-muted\" />\n )}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CY;AA3CZ,mBAAkB;AAClB,kBAAiB;AACjB,0BAA2B;AAC3B,2BAA+B;AAC/B,oBAAkC;AAiB3B,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,QAAQ,oBAAgB,iCAAkB,aAAa,IAAI;AAEjE,QAAM,SAAS,cAAc;AAAA,IAC3B,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,OAAO,cAAc;AAAA,EACpD;AACA,QAAM,UAAU,OAAO,MAAM,GAAG,CAAC;AAEjC,SACE,6CAAC,SAAI,WAAU,4FAEb;AAAA,iDAAC,YAAAA,SAAA,EAAK,MAAM,gBAAgB,WAAU,yCACpC;AAAA,kDAAC,SAAI,WAAU,kLACZ,4BACC,4CAAC,aAAAC,SAAA,EAAM,KAAK,iBAAiB,KAAI,IAAG,MAAI,MAAC,WAAU,gBAAe,aAAW,MAAC,IAC5E,MACN;AAAA,MACA,6CAAC,SAAI,WAAU,kBACb;AAAA,oDAAC,OAAE,WAAU,yFACV,0BACH;AAAA,QACC,OAAO,SACN,6CAAC,OAAE,WAAU,kEACX;AAAA,sDAAC,UAAK,mBAAK;AAAA,UACX,4CAAC,uCAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,WAC5H,IACE;AAAA,SACN;AAAA,MACA,4CAAC,SAAI,WAAU,+KACb,sDAAC,kCAAW,WAAU,eAAc,GACtC;AAAA,OACF;AAAA,IAEC,QAAQ,SAAS,KAChB,4CAAC,SAAI,WAAU,4BACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM;AACvC,YAAM,UAAU,QAAQ,CAAC;AACzB,UAAI,CAAC,SAAS;AACZ,eAAO,4CAAC,SAAuB,WAAU,0CAAxB,SAAS,CAAC,EAAqD;AAAA,MAClF;AACA,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,MAAK;AAAA,UACL,SAAS,MAAM,WAAW,QAAQ,OAAO;AAAA,UACzC,WAAU;AAAA,UAET,kBAAQ,QACP;AAAA,YAAC,aAAAA;AAAA,YAAA;AAAA,cACC,KAAK,QAAQ;AAAA,cACb,KAAI;AAAA,cACJ,MAAI;AAAA,cACJ,WAAU;AAAA,cACV,aAAW;AAAA;AAAA,UACb,IAEA,4CAAC,SAAI,WAAU,0BAAyB;AAAA;AAAA,QAdrC,QAAQ;AAAA,MAgBf;AAAA,IAEJ,CAAC,GACH;AAAA,KAEJ;AAEJ;","names":["Link","Image"]}
|
|
@@ -11,7 +11,8 @@ interface AssetCollectionBarProps {
|
|
|
11
11
|
currentTokenId: string;
|
|
12
12
|
siblingTokens: AssetCollectionBarSibling[];
|
|
13
13
|
onNavigate: (tokenId: string) => void;
|
|
14
|
+
floorPriceRaw?: string | null;
|
|
14
15
|
}
|
|
15
|
-
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, floorPriceRaw, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
16
17
|
|
|
17
18
|
export { AssetCollectionBar, type AssetCollectionBarProps, type AssetCollectionBarSibling };
|
|
@@ -11,7 +11,8 @@ interface AssetCollectionBarProps {
|
|
|
11
11
|
currentTokenId: string;
|
|
12
12
|
siblingTokens: AssetCollectionBarSibling[];
|
|
13
13
|
onNavigate: (tokenId: string) => void;
|
|
14
|
+
floorPriceRaw?: string | null;
|
|
14
15
|
}
|
|
15
|
-
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function AssetCollectionBar({ collectionName, collectionImage, collectionHref, currentTokenId, siblingTokens, onNavigate, floorPriceRaw, }: AssetCollectionBarProps): react_jsx_runtime.JSX.Element;
|
|
16
17
|
|
|
17
18
|
export { AssetCollectionBar, type AssetCollectionBarProps, type AssetCollectionBarSibling };
|
|
@@ -3,14 +3,18 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import Image from "./image.js";
|
|
4
4
|
import Link from "./link.js";
|
|
5
5
|
import { ArrowRight } from "lucide-react";
|
|
6
|
+
import { CurrencyAmount } from "./currency-icon.js";
|
|
7
|
+
import { parsePriceDisplay } from "../utils/format.js";
|
|
6
8
|
function AssetCollectionBar({
|
|
7
9
|
collectionName,
|
|
8
10
|
collectionImage,
|
|
9
11
|
collectionHref,
|
|
10
12
|
currentTokenId,
|
|
11
13
|
siblingTokens,
|
|
12
|
-
onNavigate
|
|
14
|
+
onNavigate,
|
|
15
|
+
floorPriceRaw
|
|
13
16
|
}) {
|
|
17
|
+
const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;
|
|
14
18
|
const others = siblingTokens.filter(
|
|
15
19
|
(t) => String(t.tokenId) !== String(currentTokenId)
|
|
16
20
|
);
|
|
@@ -18,7 +22,13 @@ function AssetCollectionBar({
|
|
|
18
22
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl bg-gradient-to-br from-muted/40 to-transparent overflow-hidden p-4 space-y-3", children: [
|
|
19
23
|
/* @__PURE__ */ jsxs(Link, { href: collectionHref, className: "flex items-center gap-3 group min-w-0", children: [
|
|
20
24
|
/* @__PURE__ */ jsx("div", { className: "relative h-11 w-11 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-brand-blue/20 to-brand-purple/20 ring-1 ring-border/30 group-hover:ring-border/60 transition-all", children: collectionImage ? /* @__PURE__ */ jsx(Image, { src: collectionImage, alt: "", fill: true, className: "object-cover", unoptimized: true }) : null }),
|
|
21
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("p", { className: "text-base font-bold leading-tight truncate group-hover:text-primary transition-colors", children: collectionName }),
|
|
27
|
+
floor?.symbol ? /* @__PURE__ */ jsxs("p", { className: "mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
28
|
+
/* @__PURE__ */ jsx("span", { children: "Floor" }),
|
|
29
|
+
/* @__PURE__ */ jsx(CurrencyAmount, { amount: floor.numStr, symbol: floor.symbol, iconSize: 11, amountClassName: "font-semibold text-foreground" })
|
|
30
|
+
] }) : null
|
|
31
|
+
] }),
|
|
22
32
|
/* @__PURE__ */ jsx("div", { className: "shrink-0 h-8 w-8 rounded-xl bg-background/40 flex items-center justify-center text-muted-foreground group-hover:bg-background/70 group-hover:text-foreground transition-all", children: /* @__PURE__ */ jsx(ArrowRight, { className: "h-3.5 w-3.5" }) })
|
|
23
33
|
] }),
|
|
24
34
|
preview.length > 0 && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 gap-1.5", children: Array.from({ length: 4 }).map((_, i) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n}\n\nexport function AssetCollectionBar({\n collectionName,\n collectionImage,\n collectionHref,\n currentTokenId,\n siblingTokens,\n onNavigate,\n}: AssetCollectionBarProps) {\n\n const others = siblingTokens.filter(\n (t) => String(t.tokenId) !== String(currentTokenId)\n );\n const preview = others.slice(0, 4);\n\n return (\n <div className=\"rounded-2xl bg-gradient-to-br from-muted/40 to-transparent overflow-hidden p-4 space-y-3\">\n\n <Link href={collectionHref} className=\"flex items-center gap-3 group min-w-0\">\n <div className=\"relative h-11 w-11 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-brand-blue/20 to-brand-purple/20 ring-1 ring-border/30 group-hover:ring-border/60 transition-all\">\n {collectionImage ? (\n <Image src={collectionImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : null}\n </div>\n <p className=\"text-base font-bold leading-tight truncate
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-collection-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nexport interface AssetCollectionBarSibling {\n tokenId: string;\n\n image: string | null;\n}\n\nexport interface AssetCollectionBarProps {\n collectionName: string;\n collectionImage?: string | null;\n collectionHref: string;\n currentTokenId: string;\n siblingTokens: AssetCollectionBarSibling[];\n onNavigate: (tokenId: string) => void;\n floorPriceRaw?: string | null;\n}\n\nexport function AssetCollectionBar({\n collectionName,\n collectionImage,\n collectionHref,\n currentTokenId,\n siblingTokens,\n onNavigate,\n floorPriceRaw,\n}: AssetCollectionBarProps) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n\n const others = siblingTokens.filter(\n (t) => String(t.tokenId) !== String(currentTokenId)\n );\n const preview = others.slice(0, 4);\n\n return (\n <div className=\"rounded-2xl bg-gradient-to-br from-muted/40 to-transparent overflow-hidden p-4 space-y-3\">\n\n <Link href={collectionHref} className=\"flex items-center gap-3 group min-w-0\">\n <div className=\"relative h-11 w-11 rounded-xl overflow-hidden shrink-0 bg-gradient-to-br from-brand-blue/20 to-brand-purple/20 ring-1 ring-border/30 group-hover:ring-border/60 transition-all\">\n {collectionImage ? (\n <Image src={collectionImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : null}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-base font-bold leading-tight truncate group-hover:text-primary transition-colors\">\n {collectionName}\n </p>\n {floor?.symbol ? (\n <p className=\"mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={11} amountClassName=\"font-semibold text-foreground\" />\n </p>\n ) : null}\n </div>\n <div className=\"shrink-0 h-8 w-8 rounded-xl bg-background/40 flex items-center justify-center text-muted-foreground group-hover:bg-background/70 group-hover:text-foreground transition-all\">\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </div>\n </Link>\n\n {preview.length > 0 && (\n <div className=\"grid grid-cols-4 gap-1.5\">\n {Array.from({ length: 4 }).map((_, i) => {\n const sibling = preview[i];\n if (!sibling) {\n return <div key={`empty-${i}`} className=\"aspect-square rounded-xl bg-muted/20\" />;\n }\n return (\n <button\n key={sibling.tokenId}\n type=\"button\"\n onClick={() => onNavigate(sibling.tokenId)}\n className=\"group relative aspect-square rounded-xl overflow-hidden transition-all duration-200 hover:scale-[1.02] active:scale-95\"\n >\n {sibling.image ? (\n <Image\n src={sibling.image}\n alt=\"\"\n fill\n className=\"object-cover transition-transform duration-300 group-hover:scale-105\"\n unoptimized\n />\n ) : (\n <div className=\"h-full w-full bg-muted\" />\n )}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";AA6CY,cAQA,YARA;AA3CZ,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAiB3B,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,QAAQ,gBAAgB,kBAAkB,aAAa,IAAI;AAEjE,QAAM,SAAS,cAAc;AAAA,IAC3B,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,OAAO,cAAc;AAAA,EACpD;AACA,QAAM,UAAU,OAAO,MAAM,GAAG,CAAC;AAEjC,SACE,qBAAC,SAAI,WAAU,4FAEb;AAAA,yBAAC,QAAK,MAAM,gBAAgB,WAAU,yCACpC;AAAA,0BAAC,SAAI,WAAU,kLACZ,4BACC,oBAAC,SAAM,KAAK,iBAAiB,KAAI,IAAG,MAAI,MAAC,WAAU,gBAAe,aAAW,MAAC,IAC5E,MACN;AAAA,MACA,qBAAC,SAAI,WAAU,kBACb;AAAA,4BAAC,OAAE,WAAU,yFACV,0BACH;AAAA,QACC,OAAO,SACN,qBAAC,OAAE,WAAU,kEACX;AAAA,8BAAC,UAAK,mBAAK;AAAA,UACX,oBAAC,kBAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,WAC5H,IACE;AAAA,SACN;AAAA,MACA,oBAAC,SAAI,WAAU,+KACb,8BAAC,cAAW,WAAU,eAAc,GACtC;AAAA,OACF;AAAA,IAEC,QAAQ,SAAS,KAChB,oBAAC,SAAI,WAAU,4BACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM;AACvC,YAAM,UAAU,QAAQ,CAAC;AACzB,UAAI,CAAC,SAAS;AACZ,eAAO,oBAAC,SAAuB,WAAU,0CAAxB,SAAS,CAAC,EAAqD;AAAA,MAClF;AACA,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,MAAK;AAAA,UACL,SAAS,MAAM,WAAW,QAAQ,OAAO;AAAA,UACzC,WAAU;AAAA,UAET,kBAAQ,QACP;AAAA,YAAC;AAAA;AAAA,cACC,KAAK,QAAQ;AAAA,cACb,KAAI;AAAA,cACJ,MAAI;AAAA,cACJ,WAAU;AAAA,cACV,aAAW;AAAA;AAAA,UACb,IAEA,oBAAC,SAAI,WAAU,0BAAyB;AAAA;AAAA,QAdrC,QAAQ;AAAA,MAgBf;AAAA,IAEJ,CAAC,GACH;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -31,7 +31,7 @@ function AssetLightbox({ open, onOpenChange, image, alt }) {
|
|
|
31
31
|
import_dialog.DialogContent,
|
|
32
32
|
{
|
|
33
33
|
hideClose: true,
|
|
34
|
-
className: "max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none",
|
|
34
|
+
className: "max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none",
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { className: "sr-only", children: alt }),
|
|
37
37
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-lightbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { X } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetLightboxProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n image: string | null;\n alt: string;\n}\n\nexport function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps) {\n if (!image) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n hideClose\n className=\"max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt}</DialogTitle>\n <div className=\"relative\">\n\n <img\n src={image}\n alt={alt}\n style={{ maxHeight: \"92svh\", maxWidth: \"96vw\" }}\n className=\"block h-auto w-auto object-contain rounded-2xl\"\n />\n <button\n onClick={() => onOpenChange(false)}\n aria-label=\"Close\"\n className=\"absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBQ;AAnBR,0BAAkB;AAClB,oBAAmD;AAS5C,SAAS,cAAc,EAAE,MAAM,cAAc,OAAO,IAAI,GAAuB;AACpF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,4CAAC,wBAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,oDAAC,6BAAY,WAAU,WAAW,eAAI;AAAA,QACtC,6CAAC,SAAI,WAAU,YAEb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,EAAE,WAAW,SAAS,UAAU,OAAO;AAAA,cAC9C,WAAU;AAAA;AAAA,UACZ;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,MAAM,aAAa,KAAK;AAAA,cACjC,cAAW;AAAA,cACX,WAAU;AAAA,cAEV,sDAAC,yBAAE,WAAU,WAAU;AAAA;AAAA,UACzB;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-lightbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { X } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetLightboxProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n image: string | null;\n alt: string;\n}\n\nexport function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps) {\n if (!image) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n hideClose\n className=\"max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt}</DialogTitle>\n <div className=\"relative\">\n\n <img\n src={image}\n alt={alt}\n style={{ maxHeight: \"92svh\", maxWidth: \"96vw\" }}\n className=\"block h-auto w-auto object-contain rounded-2xl\"\n />\n <button\n onClick={() => onOpenChange(false)}\n aria-label=\"Close\"\n className=\"absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBQ;AAnBR,0BAAkB;AAClB,oBAAmD;AAS5C,SAAS,cAAc,EAAE,MAAM,cAAc,OAAO,IAAI,GAAuB;AACpF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,4CAAC,wBAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,oDAAC,6BAAY,WAAU,WAAW,eAAI;AAAA,QACtC,6CAAC,SAAI,WAAU,YAEb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,EAAE,WAAW,SAAS,UAAU,OAAO;AAAA,cAC9C,WAAU;AAAA;AAAA,UACZ;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,MAAM,aAAa,KAAK;AAAA,cACjC,cAAW;AAAA,cACX,WAAU;AAAA,cAEV,sDAAC,yBAAE,WAAU,WAAU;AAAA;AAAA,UACzB;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -8,7 +8,7 @@ function AssetLightbox({ open, onOpenChange, image, alt }) {
|
|
|
8
8
|
DialogContent,
|
|
9
9
|
{
|
|
10
10
|
hideClose: true,
|
|
11
|
-
className: "max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none",
|
|
11
|
+
className: "max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none",
|
|
12
12
|
children: [
|
|
13
13
|
/* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: alt }),
|
|
14
14
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-lightbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { X } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetLightboxProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n image: string | null;\n alt: string;\n}\n\nexport function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps) {\n if (!image) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n hideClose\n className=\"max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt}</DialogTitle>\n <div className=\"relative\">\n\n <img\n src={image}\n alt={alt}\n style={{ maxHeight: \"92svh\", maxWidth: \"96vw\" }}\n className=\"block h-auto w-auto object-contain rounded-2xl\"\n />\n <button\n onClick={() => onOpenChange(false)}\n aria-label=\"Close\"\n className=\"absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAqBQ,cACA,YADA;AAnBR,SAAS,SAAS;AAClB,SAAS,QAAQ,eAAe,mBAAmB;AAS5C,SAAS,cAAc,EAAE,MAAM,cAAc,OAAO,IAAI,GAAuB;AACpF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,oBAAC,UAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,4BAAC,eAAY,WAAU,WAAW,eAAI;AAAA,QACtC,qBAAC,SAAI,WAAU,YAEb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,EAAE,WAAW,SAAS,UAAU,OAAO;AAAA,cAC9C,WAAU;AAAA;AAAA,UACZ;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,MAAM,aAAa,KAAK;AAAA,cACjC,cAAW;AAAA,cACX,WAAU;AAAA,cAEV,8BAAC,KAAE,WAAU,WAAU;AAAA;AAAA,UACzB;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-lightbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { X } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetLightboxProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n image: string | null;\n alt: string;\n}\n\nexport function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps) {\n if (!image) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n hideClose\n className=\"max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt}</DialogTitle>\n <div className=\"relative\">\n\n <img\n src={image}\n alt={alt}\n style={{ maxHeight: \"92svh\", maxWidth: \"96vw\" }}\n className=\"block h-auto w-auto object-contain rounded-2xl\"\n />\n <button\n onClick={() => onOpenChange(false)}\n aria-label=\"Close\"\n className=\"absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAqBQ,cACA,YADA;AAnBR,SAAS,SAAS;AAClB,SAAS,QAAQ,eAAe,mBAAmB;AAS5C,SAAS,cAAc,EAAE,MAAM,cAAc,OAAO,IAAI,GAAuB;AACpF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,oBAAC,UAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,4BAAC,eAAY,WAAU,WAAW,eAAI;AAAA,QACtC,qBAAC,SAAI,WAAU,YAEb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,EAAE,WAAW,SAAS,UAAU,OAAO;AAAA,cAC9C,WAAU;AAAA;AAAA,UACZ;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,MAAM,aAAa,KAAK;AAAA,cACjC,cAAW;AAAA,cACX,WAAU;AAAA,cAEV,8BAAC,KAAE,WAAU,WAAU;AAAA;AAAA,UACzB;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -35,21 +35,6 @@ var import_cn = require("../utils/cn.js");
|
|
|
35
35
|
var import_asset_access_cards = require("./asset-access-cards.js");
|
|
36
36
|
var import_medialane_app = require("./medialane-app.js");
|
|
37
37
|
var import_help_icon = require("./help-icon.js");
|
|
38
|
-
function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
39
|
-
const floor = floorPriceRaw ? (0, import_format.parsePriceDisplay)(floorPriceRaw) : null;
|
|
40
|
-
const lastSale = lastSaleRaw ? (0, import_format.parsePriceDisplay)(lastSaleRaw) : null;
|
|
41
|
-
if (!floor?.symbol && !lastSale?.symbol) return null;
|
|
42
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", children: [
|
|
43
|
-
floor?.symbol && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
44
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Floor" }),
|
|
45
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: floor.numStr, symbol: floor.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
46
|
-
] }),
|
|
47
|
-
lastSale?.symbol && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
48
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Last sale" }),
|
|
49
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: lastSale.numStr, symbol: lastSale.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
50
|
-
] })
|
|
51
|
-
] });
|
|
52
|
-
}
|
|
53
38
|
function ActionRow({ children }) {
|
|
54
39
|
const odd = import_react.Children.toArray(children).length % 2 === 1;
|
|
55
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("grid grid-cols-2 gap-2", odd && "[&>*:first-child]:col-span-2"), children });
|
|
@@ -82,8 +67,6 @@ function AssetMarketplacePanel({
|
|
|
82
67
|
onOpenSponsorProposal,
|
|
83
68
|
showSponsorSolicitOption = false,
|
|
84
69
|
onOpenSponsorSolicit,
|
|
85
|
-
floorPriceRaw,
|
|
86
|
-
lastSaleRaw,
|
|
87
70
|
usdValue,
|
|
88
71
|
onCancelClick,
|
|
89
72
|
onAcceptBid,
|
|
@@ -126,27 +109,27 @@ function AssetMarketplacePanel({
|
|
|
126
109
|
usdValue
|
|
127
110
|
] }) : null
|
|
128
111
|
] }) : null;
|
|
129
|
-
const listedPrice = isOwner &&
|
|
130
|
-
PriceLine,
|
|
131
|
-
{
|
|
132
|
-
label: "Listed for",
|
|
133
|
-
order: liveMyListing,
|
|
134
|
-
usdValue: liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null
|
|
135
|
-
}
|
|
136
|
-
) : !isSignedIn && liveCheapest ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceLine, { label: "Price", order: liveCheapest, usdValue }) : null;
|
|
112
|
+
const listedPrice = !isOwner && !isSignedIn && liveCheapest ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceLine, { label: "Price", order: liveCheapest, usdValue }) : null;
|
|
137
113
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-4", children: [
|
|
138
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
139
114
|
listedPrice,
|
|
140
115
|
isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
|
|
141
116
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ActionRow, { children: [
|
|
142
|
-
liveMyListing ? /* @__PURE__ */ (0, import_jsx_runtime.
|
|
117
|
+
liveMyListing ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
143
118
|
import_action_button.ActionButton,
|
|
144
119
|
{
|
|
145
120
|
icon: isProcessing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-4 w-4" }),
|
|
146
121
|
onClick: () => onCancelClick(liveMyListing),
|
|
147
122
|
disabled: isProcessing,
|
|
148
123
|
tone: "red",
|
|
149
|
-
|
|
124
|
+
helpContent: `Expires ${(0, import_time.timeUntil)(liveMyListing.endTime)}`,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Cancel listing" }),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: (0, import_format.formatDisplayPrice)(liveMyListing.price.formatted), symbol: liveMyListing.price.currency ?? "", iconSize: 14, amountClassName: "tabular-nums" }),
|
|
128
|
+
liveMyListing.orderHash === liveCheapest?.orderHash && usdValue ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "font-normal text-muted-foreground tabular-nums", children: [
|
|
129
|
+
"\xB7 ",
|
|
130
|
+
usdValue
|
|
131
|
+
] }) : null
|
|
132
|
+
]
|
|
150
133
|
}
|
|
151
134
|
) : null,
|
|
152
135
|
!liveMyListing || isERC1155 && canListMoreEditions !== false ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { tone: "blue", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Tag, { className: "h-4 w-4" }), onClick: onOpenListing, children: liveMyListing ? "List more" : "List for sale" }) : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { AssetAccessCards, CompanionAppCard } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { HelpIcon } from \"./help-icon.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\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 showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n\n}\n\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\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceLine({ label, order, usdValue }: { label: string; order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground\">\n <span>{label}</span>\n <CurrencyAmount amount={formatDisplayPrice(order.price.formatted)} symbol={order.price.currency ?? \"\"} iconSize={14} amountClassName=\"text-base font-bold text-foreground tabular-nums\" />\n <span className=\"font-semibold text-foreground\">{order.price.currency}</span>\n {usdValue ? <span className=\"tabular-nums\">· {usdValue}</span> : null}\n <HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />\n </div>\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\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 const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n Remix\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n Make offer\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n <span>Buy</span>\n <CurrencyAmount amount={formatDisplayPrice(liveCheapest.price.formatted)} symbol={liveCheapest.price.currency ?? \"\"} iconSize={14} amountClassName=\"tabular-nums\" />\n {usdValue ? <span className=\"font-normal text-muted-foreground tabular-nums\">· {usdValue}</span> : null}\n </ActionButton>\n ) : null;\n\n const listedPrice = isOwner && liveMyListing ? (\n <PriceLine\n label=\"Listed for\"\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : !isSignedIn && liveCheapest ? (\n <PriceLine label=\"Price\" order={liveCheapest} usdValue={usdValue} />\n ) : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {listedPrice}\n\n {isOwner ? (\n <div className=\"space-y-3\">\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n >\n Cancel listing\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? \"List more\" : \"List for sale\"}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>Transfer</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n Open for sponsorship\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton ? <ActionRow>{buyButton}</ActionRow> : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"space-y-3\">\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"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 >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n Sponsor\n </ActionButton>\n ) : null}\n </ActionRow>\n </div>\n ) : (\n <AssetAccessCards asset={asset} />\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 && liveBids.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 ({liveBids.length})\n </p>\n <div className=\"space-y-2\">\n {liveBids.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\n {isSignedIn ? <CompanionAppCard asset={asset} /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmEQ;AAjER,mBAAyC;AACzC,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,2BAA6B;AAC7B,oBAAsD;AACtD,kBAAqC;AACrC,0BAA8B;AAC9B,gBAAmB;AACnB,gCAAmD;AACnD,2BAA+C;AAC/C,uBAAyB;AA4CzB,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,uCAAe,QAAQ,SAAS,QAAQ,QAAQ,SAAS,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,OAClI;AAAA,KAEJ;AAEJ;AAEA,SAAS,UAAU,EAAE,SAAS,GAA4B;AACxD,QAAM,MAAM,sBAAS,QAAQ,QAAQ,EAAE,SAAS,MAAM;AACtD,SAAO,4CAAC,SAAI,eAAW,cAAG,0BAA0B,OAAO,8BAA8B,GAAI,UAAS;AACxG;AAEA,S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AAA,YAC3G,4CAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,6CAAC,SAAI,WAAU,yDACb;AAAA,0DAAC,6BAAM,WAAU,WAAU;AAAA,kBAC1B,uBAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,MAAM,YAAY,GAAG;AAAA,YAC9B,WAAU;AAAA,YAEV;AAAA,0DAAC,mCAAY,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,4CAAC,8CAAiB,OAAc,IAAK;AAAA,KACrD,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { AssetAccessCards, CompanionAppCard } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { HelpIcon } from \"./help-icon.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\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 showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceLine({ label, order, usdValue }: { label: string; order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground\">\n <span>{label}</span>\n <CurrencyAmount amount={formatDisplayPrice(order.price.formatted)} symbol={order.price.currency ?? \"\"} iconSize={14} amountClassName=\"text-base font-bold text-foreground tabular-nums\" />\n <span className=\"font-semibold text-foreground\">{order.price.currency}</span>\n {usdValue ? <span className=\"tabular-nums\">· {usdValue}</span> : null}\n <HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />\n </div>\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\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 const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n Remix\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n Make offer\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n <span>Buy</span>\n <CurrencyAmount amount={formatDisplayPrice(liveCheapest.price.formatted)} symbol={liveCheapest.price.currency ?? \"\"} iconSize={14} amountClassName=\"tabular-nums\" />\n {usdValue ? <span className=\"font-normal text-muted-foreground tabular-nums\">· {usdValue}</span> : null}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && !isSignedIn && liveCheapest ? (\n <PriceLine label=\"Price\" order={liveCheapest} usdValue={usdValue} />\n ) : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {listedPrice}\n\n {isOwner ? (\n <div className=\"space-y-3\">\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n <span>Cancel listing</span>\n <CurrencyAmount amount={formatDisplayPrice(liveMyListing.price.formatted)} symbol={liveMyListing.price.currency ?? \"\"} iconSize={14} amountClassName=\"tabular-nums\" />\n {liveMyListing.orderHash === liveCheapest?.orderHash && usdValue ? <span className=\"font-normal text-muted-foreground tabular-nums\">· {usdValue}</span> : null}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? \"List more\" : \"List for sale\"}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>Transfer</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n Open for sponsorship\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton ? <ActionRow>{buyButton}</ActionRow> : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"space-y-3\">\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"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 >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n Sponsor\n </ActionButton>\n ) : null}\n </ActionRow>\n </div>\n ) : (\n <AssetAccessCards asset={asset} />\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 && liveBids.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 ({liveBids.length})\n </p>\n <div className=\"space-y-2\">\n {liveBids.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\n {isSignedIn ? <CompanionAppCard asset={asset} /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DS;AA1DT,mBAAyC;AACzC,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,2BAA6B;AAC7B,oBAAmC;AACnC,kBAAqC;AACrC,0BAA8B;AAC9B,gBAAmB;AACnB,gCAAmD;AACnD,2BAA+C;AAC/C,uBAAyB;AA0CzB,SAAS,UAAU,EAAE,SAAS,GAA4B;AACxD,QAAM,MAAM,sBAAS,QAAQ,QAAQ,EAAE,SAAS,MAAM;AACtD,SAAO,4CAAC,SAAI,eAAW,cAAG,0BAA0B,OAAO,8BAA8B,GAAI,UAAS;AACxG;AAEA,SAAS,UAAU,EAAE,OAAO,OAAO,SAAS,GAAqE;AAC/G,SACE,6CAAC,SAAI,WAAU,6EACb;AAAA,gDAAC,UAAM,iBAAM;AAAA,IACb,4CAAC,uCAAe,YAAQ,kCAAmB,MAAM,MAAM,SAAS,GAAG,QAAQ,MAAM,MAAM,YAAY,IAAI,UAAU,IAAI,iBAAgB,oDAAmD;AAAA,IACxL,4CAAC,UAAK,WAAU,iCAAiC,gBAAM,MAAM,UAAS;AAAA,IACrE,WAAW,6CAAC,UAAK,WAAU,gBAAe;AAAA;AAAA,MAAG;AAAA,OAAS,IAAU;AAAA,IACjE,4CAAC,6BAAS,SAAS,eAAW,uBAAU,MAAM,OAAO,CAAC,IAAI;AAAA,KAC5D;AAEJ;AAEO,S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AAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,4CAAC,8CAAiB,OAAc,IAAK;AAAA,KACrD,GACF;AAEJ;","names":[]}
|
|
@@ -41,9 +41,7 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
41
41
|
onOpenSponsorProposal?: () => void;
|
|
42
42
|
showSponsorSolicitOption?: boolean;
|
|
43
43
|
onOpenSponsorSolicit?: () => void;
|
|
44
|
-
floorPriceRaw?: string | null;
|
|
45
|
-
lastSaleRaw?: string | null;
|
|
46
44
|
}
|
|
47
|
-
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ asset, cheapest, isOwner, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit,
|
|
45
|
+
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ asset, cheapest, isOwner, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, usdValue, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps<T>): react_jsx_runtime.JSX.Element;
|
|
48
46
|
|
|
49
47
|
export { type ApiOrderLike, AssetMarketplacePanel, type AssetMarketplacePanelProps };
|
|
@@ -41,9 +41,7 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
41
41
|
onOpenSponsorProposal?: () => void;
|
|
42
42
|
showSponsorSolicitOption?: boolean;
|
|
43
43
|
onOpenSponsorSolicit?: () => void;
|
|
44
|
-
floorPriceRaw?: string | null;
|
|
45
|
-
lastSaleRaw?: string | null;
|
|
46
44
|
}
|
|
47
|
-
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ asset, cheapest, isOwner, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit,
|
|
45
|
+
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ asset, cheapest, isOwner, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, usdValue, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps<T>): react_jsx_runtime.JSX.Element;
|
|
48
46
|
|
|
49
47
|
export { type ApiOrderLike, AssetMarketplacePanel, type AssetMarketplacePanelProps };
|
|
@@ -15,28 +15,13 @@ import {
|
|
|
15
15
|
import { CurrencyIcon, CurrencyAmount } from "./currency-icon.js";
|
|
16
16
|
import { AddressDisplay } from "./address-display.js";
|
|
17
17
|
import { ActionButton } from "./action-button.js";
|
|
18
|
-
import { formatDisplayPrice
|
|
18
|
+
import { formatDisplayPrice } from "../utils/format.js";
|
|
19
19
|
import { isExpired, timeUntil } from "../utils/time.js";
|
|
20
20
|
import { isSameAddress } from "../utils/same-address.js";
|
|
21
21
|
import { cn } from "../utils/cn.js";
|
|
22
22
|
import { AssetAccessCards, CompanionAppCard } from "./asset-access-cards.js";
|
|
23
23
|
import { useMedialaneApp } from "./medialane-app.js";
|
|
24
24
|
import { HelpIcon } from "./help-icon.js";
|
|
25
|
-
function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
26
|
-
const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;
|
|
27
|
-
const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;
|
|
28
|
-
if (!floor?.symbol && !lastSale?.symbol) return null;
|
|
29
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", children: [
|
|
30
|
-
floor?.symbol && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
31
|
-
/* @__PURE__ */ jsx("span", { children: "Floor" }),
|
|
32
|
-
/* @__PURE__ */ jsx(CurrencyAmount, { amount: floor.numStr, symbol: floor.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
33
|
-
] }),
|
|
34
|
-
lastSale?.symbol && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
35
|
-
/* @__PURE__ */ jsx("span", { children: "Last sale" }),
|
|
36
|
-
/* @__PURE__ */ jsx(CurrencyAmount, { amount: lastSale.numStr, symbol: lastSale.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" })
|
|
37
|
-
] })
|
|
38
|
-
] });
|
|
39
|
-
}
|
|
40
25
|
function ActionRow({ children }) {
|
|
41
26
|
const odd = Children.toArray(children).length % 2 === 1;
|
|
42
27
|
return /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-2 gap-2", odd && "[&>*:first-child]:col-span-2"), children });
|
|
@@ -69,8 +54,6 @@ function AssetMarketplacePanel({
|
|
|
69
54
|
onOpenSponsorProposal,
|
|
70
55
|
showSponsorSolicitOption = false,
|
|
71
56
|
onOpenSponsorSolicit,
|
|
72
|
-
floorPriceRaw,
|
|
73
|
-
lastSaleRaw,
|
|
74
57
|
usdValue,
|
|
75
58
|
onCancelClick,
|
|
76
59
|
onAcceptBid,
|
|
@@ -113,27 +96,27 @@ function AssetMarketplacePanel({
|
|
|
113
96
|
usdValue
|
|
114
97
|
] }) : null
|
|
115
98
|
] }) : null;
|
|
116
|
-
const listedPrice = isOwner &&
|
|
117
|
-
PriceLine,
|
|
118
|
-
{
|
|
119
|
-
label: "Listed for",
|
|
120
|
-
order: liveMyListing,
|
|
121
|
-
usdValue: liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null
|
|
122
|
-
}
|
|
123
|
-
) : !isSignedIn && liveCheapest ? /* @__PURE__ */ jsx(PriceLine, { label: "Price", order: liveCheapest, usdValue }) : null;
|
|
99
|
+
const listedPrice = !isOwner && !isSignedIn && liveCheapest ? /* @__PURE__ */ jsx(PriceLine, { label: "Price", order: liveCheapest, usdValue }) : null;
|
|
124
100
|
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs("div", { className: "relative space-y-4", children: [
|
|
125
|
-
/* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
126
101
|
listedPrice,
|
|
127
102
|
isOwner ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
128
103
|
/* @__PURE__ */ jsxs(ActionRow, { children: [
|
|
129
|
-
liveMyListing ? /* @__PURE__ */
|
|
104
|
+
liveMyListing ? /* @__PURE__ */ jsxs(
|
|
130
105
|
ActionButton,
|
|
131
106
|
{
|
|
132
107
|
icon: isProcessing ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
133
108
|
onClick: () => onCancelClick(liveMyListing),
|
|
134
109
|
disabled: isProcessing,
|
|
135
110
|
tone: "red",
|
|
136
|
-
|
|
111
|
+
helpContent: `Expires ${timeUntil(liveMyListing.endTime)}`,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx("span", { children: "Cancel listing" }),
|
|
114
|
+
/* @__PURE__ */ jsx(CurrencyAmount, { amount: formatDisplayPrice(liveMyListing.price.formatted), symbol: liveMyListing.price.currency ?? "", iconSize: 14, amountClassName: "tabular-nums" }),
|
|
115
|
+
liveMyListing.orderHash === liveCheapest?.orderHash && usdValue ? /* @__PURE__ */ jsxs("span", { className: "font-normal text-muted-foreground tabular-nums", children: [
|
|
116
|
+
"\xB7 ",
|
|
117
|
+
usdValue
|
|
118
|
+
] }) : null
|
|
119
|
+
]
|
|
137
120
|
}
|
|
138
121
|
) : null,
|
|
139
122
|
!liveMyListing || isERC1155 && canListMoreEditions !== false ? /* @__PURE__ */ jsx(ActionButton, { tone: "blue", icon: /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4" }), onClick: onOpenListing, children: liveMyListing ? "List more" : "List for sale" }) : null,
|