@medialane/ui 0.369.1 → 0.370.1
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/activities-feed.cjs +1 -16
- package/dist/components/activities-feed.cjs.map +1 -1
- package/dist/components/activities-feed.js +2 -17
- package/dist/components/activities-feed.js.map +1 -1
- package/dist/components/activity-row.cjs +20 -0
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.d.cts +4 -1
- package/dist/components/activity-row.d.ts +4 -1
- package/dist/components/activity-row.js +19 -0
- package/dist/components/activity-row.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/creator-page.cjs +2 -7
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.js +2 -7
- package/dist/components/creator-page.js.map +1 -1
- 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/launchpad/edition-mint-schema.d.cts +4 -4
- package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
- package/dist/components/marketplace-dialog-primitives.cjs +10 -5
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.js +10 -5
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/page-skeletons.cjs +16 -45
- package/dist/components/page-skeletons.cjs.map +1 -1
- package/dist/components/page-skeletons.js +16 -45
- package/dist/components/page-skeletons.js.map +1 -1
- package/dist/components/portfolio-activity.cjs +1 -1
- package/dist/components/portfolio-activity.cjs.map +1 -1
- package/dist/components/portfolio-activity.js +2 -2
- package/dist/components/portfolio-activity.js.map +1 -1
- package/dist/components/portfolio-assets.cjs +1 -7
- package/dist/components/portfolio-assets.cjs.map +1 -1
- package/dist/components/portfolio-assets.js +2 -8
- package/dist/components/portfolio-assets.js.map +1 -1
- package/dist/components/portfolio-collections.cjs +3 -1
- package/dist/components/portfolio-collections.cjs.map +1 -1
- package/dist/components/portfolio-collections.js +4 -2
- package/dist/components/portfolio-collections.js.map +1 -1
- package/dist/components/portfolio-orders.cjs +13 -1
- package/dist/components/portfolio-orders.cjs.map +1 -1
- package/dist/components/portfolio-orders.js +13 -1
- package/dist/components/portfolio-orders.js.map +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/data/launchpad-services.cjs +45 -45
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.js +45 -45
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Download, Layers } from "lucide-react";
|
|
4
4
|
import { useCollectionsByOwner } from "../utils/use-collections.js";
|
|
5
|
-
import { CollectionCard } from "./collection-card.js";
|
|
5
|
+
import { CollectionCard, CollectionCardSkeleton } from "./collection-card.js";
|
|
6
6
|
import { EmptyOrError } from "./empty-or-error.js";
|
|
7
7
|
import { useMedialaneApp } from "./medialane-app.js";
|
|
8
8
|
import { CollectionTypeChoices, NewCollectionMenu } from "./new-collection-menu.js";
|
|
9
|
+
const GRID = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4";
|
|
9
10
|
function PortfolioCollections({ claimPanel }) {
|
|
10
11
|
const { walletAddress } = useMedialaneApp();
|
|
11
12
|
const { collections, isLoading, error, mutate } = useCollectionsByOwner(walletAddress ?? null);
|
|
@@ -32,7 +33,8 @@ function PortfolioCollections({ claimPanel }) {
|
|
|
32
33
|
emptyDescription: "If you just created a collection, it may take a few seconds to appear.",
|
|
33
34
|
emptyActions: /* @__PURE__ */ jsx(CollectionTypeChoices, {}),
|
|
34
35
|
emptyIcon: /* @__PURE__ */ jsx(Layers, { className: "h-7 w-7 text-muted-foreground" }),
|
|
35
|
-
|
|
36
|
+
skeletonNode: /* @__PURE__ */ jsx("div", { className: GRID, children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx(CollectionCardSkeleton, {}, i)) }),
|
|
37
|
+
children: /* @__PURE__ */ jsx("div", { className: GRID, children: collections.map((col) => /* @__PURE__ */ jsx(
|
|
36
38
|
CollectionCard,
|
|
37
39
|
{
|
|
38
40
|
collection: col,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-collections.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Download, Layers } from \"lucide-react\";\nimport { useCollectionsByOwner } from \"../utils/use-collections.js\";\nimport { CollectionCard } from \"./collection-card.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { CollectionTypeChoices, NewCollectionMenu } from \"./new-collection-menu.js\";\n\nexport function PortfolioCollections({ claimPanel }: { claimPanel: ReactNode }) {\n const { walletAddress } = useMedialaneApp();\n const { collections, isLoading, error, mutate } = useCollectionsByOwner(walletAddress ?? null);\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <h2 className=\"text-lg font-semibold\">Collections</h2>\n {collections.length > 0 && (\n <span className=\"text-sm text-muted-foreground\">({collections.length})</span>\n )}\n </div>\n <NewCollectionMenu />\n </div>\n\n <EmptyOrError\n isLoading={isLoading}\n error={error}\n isEmpty={collections.length === 0}\n onRetry={mutate}\n emptyTitle=\"No collections yet\"\n emptyDescription=\"If you just created a collection, it may take a few seconds to appear.\"\n emptyActions={<CollectionTypeChoices />}\n emptyIcon={<Layers className=\"h-7 w-7 text-muted-foreground\" />}\n
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-collections.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Download, Layers } from \"lucide-react\";\nimport { useCollectionsByOwner } from \"../utils/use-collections.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { CollectionTypeChoices, NewCollectionMenu } from \"./new-collection-menu.js\";\n\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\";\n\nexport function PortfolioCollections({ claimPanel }: { claimPanel: ReactNode }) {\n const { walletAddress } = useMedialaneApp();\n const { collections, isLoading, error, mutate } = useCollectionsByOwner(walletAddress ?? null);\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <h2 className=\"text-lg font-semibold\">Collections</h2>\n {collections.length > 0 && (\n <span className=\"text-sm text-muted-foreground\">({collections.length})</span>\n )}\n </div>\n <NewCollectionMenu />\n </div>\n\n <EmptyOrError\n isLoading={isLoading}\n error={error}\n isEmpty={collections.length === 0}\n onRetry={mutate}\n emptyTitle=\"No collections yet\"\n emptyDescription=\"If you just created a collection, it may take a few seconds to appear.\"\n emptyActions={<CollectionTypeChoices />}\n emptyIcon={<Layers className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={\n <div className={GRID}>\n {Array.from({ length: 8 }).map((_, i) => <CollectionCardSkeleton key={i} />)}\n </div>\n }\n >\n <div className={GRID}>\n {collections.map((col) => (\n <CollectionCard\n key={col.contractAddress}\n collection={col}\n settingsHref={`/portfolio/collections/${col.contractAddress}/settings`}\n />\n ))}\n </div>\n </EmptyOrError>\n\n <div className=\"pt-6 border-t border-border space-y-4\">\n <div className=\"flex items-center gap-2\">\n <Download className=\"h-4 w-4 text-muted-foreground\" />\n <h3 className=\"text-sm font-semibold\">Claim a collection</h3>\n </div>\n <p className=\"text-xs text-muted-foreground -mt-2\">\n Import an existing Starknet ERC-721 collection into your Medialane profile.\n </p>\n {claimPanel}\n </div>\n </div>\n );\n}\n"],"mappings":";AAoBU,cAEE,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AI,WAAU,2BACb;AAAA,4BAAC,YAAS,WAAU,iCAAgC;AAAA,QACpD,oBAAC,QAAG,WAAU,yBAAwB,gCAAkB;AAAA,SAC1D;AAAA,MACA,oBAAC,OAAE,WAAU,uCAAsC,yFAEnD;AAAA,MACC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -40,6 +40,7 @@ var import_link = __toESM(require("./link.js"), 1);
|
|
|
40
40
|
var import_badge = require("./badge.js");
|
|
41
41
|
var import_button = require("./button.js");
|
|
42
42
|
var import_empty_or_error = require("./empty-or-error.js");
|
|
43
|
+
var import_skeleton = require("./skeleton.js");
|
|
43
44
|
var import_cn = require("../utils/cn.js");
|
|
44
45
|
var import_explorer_url = require("../utils/explorer-url.js");
|
|
45
46
|
var import_format = require("../utils/format.js");
|
|
@@ -91,6 +92,17 @@ function expiryOf(order) {
|
|
|
91
92
|
function price(o) {
|
|
92
93
|
return `${(0, import_format.formatDisplayPrice)(o.price.formatted)} ${o.price.currency ?? ""}`.trim();
|
|
93
94
|
}
|
|
95
|
+
function OrderRowsSkeleton() {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4 px-4 py-3", children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-12 w-12 shrink-0 rounded-lg" }),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-40" }),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-3 w-20" })
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "hidden h-4 w-20 sm:block" }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-8 w-20 rounded-md" })
|
|
104
|
+
] }, i)) });
|
|
105
|
+
}
|
|
94
106
|
function OrderRow({ order, subtitle, from, priceCell, actions, isNew }) {
|
|
95
107
|
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
96
108
|
const name = order.token?.name || `#${order.nftTokenId}`;
|
|
@@ -164,7 +176,7 @@ function PortfolioOrders({ view, address, useActions }) {
|
|
|
164
176
|
emptyDescription: config.emptyDescription,
|
|
165
177
|
emptyCta: config.emptyCta,
|
|
166
178
|
emptyIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyIcon, { className: "h-7 w-7 text-muted-foreground" }),
|
|
167
|
-
|
|
179
|
+
skeletonNode: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OrderRowsSkeleton, {}),
|
|
168
180
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
|
|
169
181
|
config.count && orders.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pb-2 text-sm text-muted-foreground", children: config.count(orders.length) }),
|
|
170
182
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "overflow-hidden rounded-lg border border-border", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-orders.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { assetHref, profileHref, type ApiOrder } from \"@medialane/sdk\";\nimport { ArrowLeftRight, ExternalLink, HandCoins, Inbox, Tag } from \"lucide-react\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { Badge } from \"./badge.js\";\nimport { Button } from \"./button.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { getSeenOffers } from \"../utils/seen-offers.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useCounterOffers, useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\n\nexport type PortfolioOrdersView = \"listings\" | \"offers\" | \"received\" | \"counter-offers\";\n\nexport interface PortfolioOrderActions {\n isProcessing: boolean;\n cancel?: (order: ApiOrder) => void;\n accept?: (order: ApiOrder, original?: ApiOrder) => void;\n counter?: (order: ApiOrder) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioOrderActions = (context: { view: PortfolioOrdersView; refresh: () => void }) => PortfolioOrderActions;\n\nconst VIEWS = {\n listings: {\n emptyTitle: \"No active listings\",\n emptyDescription: \"Sell an asset to get started.\",\n emptyCta: { label: \"Browse assets\", href: \"/portfolio/assets\" },\n emptyIcon: Tag,\n priceLabel: \"Price\",\n count: (n: number) => `${n} active listing${n === 1 ? \"\" : \"s\"}`,\n },\n offers: {\n emptyTitle: \"No offers sent yet\",\n emptyDescription: \"Browse the marketplace to make offers on assets.\",\n emptyCta: { label: \"Browse marketplace\", href: \"/marketplace\" },\n emptyIcon: HandCoins,\n priceLabel: \"Offer price\",\n count: (n: number) => `${n} active offer${n === 1 ? \"\" : \"s\"}`,\n },\n received: {\n emptyTitle: \"No offers received yet\",\n emptyDescription: \"When someone makes an offer on your asset, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Offer price\",\n count: null,\n },\n \"counter-offers\": {\n emptyTitle: \"No counter-offers yet\",\n emptyDescription: \"When a seller responds to your bid with a counter-offer, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Their price / Your bid\",\n count: null,\n },\n} as const;\n\nconst isNft = (o: ApiOrder) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\";\n\nfunction expiryOf(order: ApiOrder) {\n const expired = isExpired(order.endTime);\n const urgent = !expired && Number(order.endTime) * 1000 - Date.now() < 86400000;\n return { label: timeUntil(order.endTime), expired, urgent };\n}\n\nfunction price(o: ApiOrder) {\n return `${formatDisplayPrice(o.price.formatted)} ${o.price.currency ?? \"\"}`.trim();\n}\n\nfunction OrderRow({ order, subtitle, from, priceCell, actions, isNew }: {\n order: ApiOrder;\n subtitle: ReactNode;\n from?: string;\n priceCell: ReactNode;\n actions: ReactNode;\n isNew?: boolean;\n}) {\n const resolveImage = useImageUrl();\n const name = order.token?.name || `#${order.nftTokenId}`;\n const image = resolveImage(order.token?.image, { width: 96 });\n const expiry = expiryOf(order);\n return (\n <div data-new={isNew ? \"true\" : undefined} className={cn(\"flex items-center gap-4 px-4 py-3 transition-colors hover:bg-muted/40\", isNew && \"border-l-2 border-primary\")}>\n <div className=\"relative h-12 w-12 shrink-0 overflow-hidden rounded-lg border border-border bg-muted\">\n {image && <Image src={image} alt={name} fill sizes=\"48px\" unoptimized className=\"object-cover\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <Link href={assetHref(\"STARKNET\", order.nftContract, order.nftTokenId)} className=\"block truncate text-sm font-medium transition-colors hover:text-primary\">\n {name}\n </Link>\n {subtitle}\n </div>\n {from && (\n <div className=\"hidden shrink-0 sm:block\">\n <Link href={profileHref({ address: from })} className=\"text-xs tabular-nums text-muted-foreground transition-colors hover:text-foreground\">\n {from.slice(0, 6)}…{from.slice(-4)}\n </Link>\n </div>\n )}\n <div className=\"hidden shrink-0 text-right sm:block\">{priceCell}</div>\n <div className=\"hidden shrink-0 md:block\">\n <p className={cn(\"text-sm\", expiry.expired && \"text-muted-foreground\", expiry.urgent && \"font-medium text-destructive\")}>{expiry.label}</p>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {order.txHash?.created && (\n <a href={`${EXPLORER_URL}/tx/${order.txHash.created}`} target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"View on explorer\" className=\"inline-flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-muted\">\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground\" />\n </a>\n )}\n {actions}\n </div>\n </div>\n );\n}\n\nfunction PriceText({ order }: { order: ApiOrder }) {\n return (\n <p className=\"text-sm font-semibold\">\n {formatDisplayPrice(order.price.formatted)} <span className=\"text-xs font-normal text-muted-foreground\">{order.price.currency}</span>\n </p>\n );\n}\n\nfunction CounterOfferRow({ bid, actions }: { bid: ApiOrder; actions: PortfolioOrderActions }) {\n const { counterOffers } = useCounterOffers({ originalOrderHash: bid.orderHash });\n const counter = counterOffers[0];\n if (!counter) return null;\n const closed = counter.status !== \"ACTIVE\" || isExpired(counter.endTime);\n return (\n <OrderRow\n order={counter}\n subtitle={\n <Badge variant=\"secondary\" className=\"mt-0.5 h-4 px-1.5 text-2xs\">\n <ArrowLeftRight className=\"mr-1 h-2.5 w-2.5\" />\n Counter-offer\n </Badge>\n }\n priceCell={\n <div className=\"flex flex-col items-end gap-0.5\">\n <p className=\"text-xs text-muted-foreground line-through\">{price(bid)}</p>\n <p className=\"text-sm font-semibold\">{counter.price.formatted ? price(counter) : \"—\"}</p>\n </div>\n }\n actions={\n closed ? (\n <span className=\"text-xs text-muted-foreground\">{counter.status !== \"ACTIVE\" ? counter.status.toLowerCase() : \"Expired\"}</span>\n ) : (\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(counter, bid)}>\n Accept\n </Button>\n )\n }\n />\n );\n}\n\nexport function PortfolioOrders({ view, address, useActions }: {\n view: PortfolioOrdersView;\n address: string;\n useActions: UsePortfolioOrderActions;\n}) {\n const mine = useUserOrders(view === \"received\" ? null : address);\n const received = useReceivedOffers(view === \"received\" ? address : null);\n const source = view === \"received\" ? received : mine;\n const actions = useActions({ view, refresh: () => void source.mutate() });\n const config = VIEWS[view];\n\n const orders =\n view === \"listings\" ? mine.orders.filter((o) => isNft(o) && o.status === \"ACTIVE\")\n : view === \"offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && o.status === \"ACTIVE\")\n : view === \"counter-offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && isSameAddress(o.offerer, address) && o.hasActiveCounterOffer === true)\n : received.orders;\n\n const seen = view === \"received\" ? getSeenOffers() : null;\n const EmptyIcon = config.emptyIcon;\n\n return (\n <>\n <EmptyOrError\n isLoading={source.isLoading}\n error={source.error}\n isEmpty={orders.length === 0}\n onRetry={() => void source.mutate()}\n emptyTitle={config.emptyTitle}\n emptyDescription={config.emptyDescription}\n emptyCta={config.emptyCta}\n emptyIcon={<EmptyIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonCount={3}\n >\n <div className=\"space-y-1\">\n {config.count && orders.length > 0 && <p className=\"pb-2 text-sm text-muted-foreground\">{config.count(orders.length)}</p>}\n <div className=\"overflow-hidden rounded-lg border border-border\">\n <div className=\"flex items-center gap-4 border-b border-border bg-muted/30 px-4 py-2 text-xs uppercase tracking-wide text-muted-foreground\">\n <div className=\"w-12 shrink-0\" />\n <div className=\"flex-1\">Asset</div>\n {view === \"received\" && <div className=\"hidden w-28 sm:block\">From</div>}\n <div className={cn(\"hidden text-right sm:block\", view === \"counter-offers\" ? \"w-40\" : \"w-24\")}>{config.priceLabel}</div>\n <div className=\"hidden w-28 md:block\">Expires</div>\n <div className=\"w-24 text-right\">Actions</div>\n </div>\n {view === \"counter-offers\"\n ? orders.map((bid) => <CounterOfferRow key={bid.orderHash} bid={bid} actions={actions} />)\n : orders.map((order) => (\n <OrderRow\n key={order.orderHash}\n order={order}\n isNew={seen ? !seen.has(order.orderHash) : false}\n from={view === \"received\" ? order.offerer : undefined}\n subtitle={<span className=\"text-xs text-muted-foreground\">{view === \"received\" ? \"Received offer\" : view === \"offers\" ? \"Offer\" : \"Active\"}</span>}\n priceCell={<PriceText order={order} />}\n actions={\n view === \"received\" ? (\n <>\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.counter?.(order)}>Counter</Button>\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(order)}>Accept</Button>\n </>\n ) : (\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs text-destructive hover:text-destructive\" disabled={actions.isProcessing} onClick={() => actions.cancel?.(order)}>Cancel</Button>\n )\n }\n />\n ))}\n </div>\n </div>\n </EmptyOrError>\n {actions.dialogs}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6FkB;AA1FlB,iBAAsD;AACtD,0BAAoE;AACpE,mBAAkB;AAClB,kBAAiB;AACjB,mBAAsB;AACtB,oBAAuB;AACvB,4BAA6B;AAC7B,gBAAmB;AACnB,0BAA6B;AAC7B,oBAAmC;AACnC,kBAAqC;AACrC,0BAA8B;AAC9B,yBAA8B;AAC9B,2BAA4B;AAC5B,wBAAmE;AAcnE,MAAM,QAAQ;AAAA,EACZ,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,UAAU,EAAE,OAAO,iBAAiB,MAAM,oBAAoB;AAAA,IAC9D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO,CAAC,MAAc,GAAG,CAAC,kBAAkB,MAAM,IAAI,KAAK,GAAG;AAAA,EAChE;AAAA,EACA,QAAQ;AAAA,IACN,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,UAAU,EAAE,OAAO,sBAAsB,MAAM,eAAe;AAAA,IAC9D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO,CAAC,MAAc,GAAG,CAAC,gBAAgB,MAAM,IAAI,KAAK,GAAG;AAAA,EAC9D;AAAA,EACA,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,UAAU;AAAA,IACV,WAAW;AAAA,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AAU,eAAc,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,UAAU,KAAK,GAAG,qBAAO;AAAA,kBAC5I,4CAAC,wBAAO,MAAK,MAAK,WAAU,eAAc,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,SAAS,KAAK,GAAG,oBAAM;AAAA,mBAC1H,IAEA,4CAAC,wBAAO,MAAK,MAAK,SAAQ,WAAU,WAAU,uDAAsD,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,SAAS,KAAK,GAAG,oBAAM;AAAA;AAAA,cAbjL,MAAM;AAAA,YAgBb,CACD;AAAA,aACP;AAAA,WACF;AAAA;AAAA,IACF;AAAA,IACC,QAAQ;AAAA,KACX;AAEJ;","names":["Image","Link"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-orders.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { assetHref, profileHref, type ApiOrder } from \"@medialane/sdk\";\nimport { ArrowLeftRight, ExternalLink, HandCoins, Inbox, Tag } from \"lucide-react\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { Badge } from \"./badge.js\";\nimport { Button } from \"./button.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { getSeenOffers } from \"../utils/seen-offers.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useCounterOffers, useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\n\nexport type PortfolioOrdersView = \"listings\" | \"offers\" | \"received\" | \"counter-offers\";\n\nexport interface PortfolioOrderActions {\n isProcessing: boolean;\n cancel?: (order: ApiOrder) => void;\n accept?: (order: ApiOrder, original?: ApiOrder) => void;\n counter?: (order: ApiOrder) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioOrderActions = (context: { view: PortfolioOrdersView; refresh: () => void }) => PortfolioOrderActions;\n\nconst VIEWS = {\n listings: {\n emptyTitle: \"No active listings\",\n emptyDescription: \"Sell an asset to get started.\",\n emptyCta: { label: \"Browse assets\", href: \"/portfolio/assets\" },\n emptyIcon: Tag,\n priceLabel: \"Price\",\n count: (n: number) => `${n} active listing${n === 1 ? \"\" : \"s\"}`,\n },\n offers: {\n emptyTitle: \"No offers sent yet\",\n emptyDescription: \"Browse the marketplace to make offers on assets.\",\n emptyCta: { label: \"Browse marketplace\", href: \"/marketplace\" },\n emptyIcon: HandCoins,\n priceLabel: \"Offer price\",\n count: (n: number) => `${n} active offer${n === 1 ? \"\" : \"s\"}`,\n },\n received: {\n emptyTitle: \"No offers received yet\",\n emptyDescription: \"When someone makes an offer on your asset, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Offer price\",\n count: null,\n },\n \"counter-offers\": {\n emptyTitle: \"No counter-offers yet\",\n emptyDescription: \"When a seller responds to your bid with a counter-offer, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Their price / Your bid\",\n count: null,\n },\n} as const;\n\nconst isNft = (o: ApiOrder) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\";\n\nfunction expiryOf(order: ApiOrder) {\n const expired = isExpired(order.endTime);\n const urgent = !expired && Number(order.endTime) * 1000 - Date.now() < 86400000;\n return { label: timeUntil(order.endTime), expired, urgent };\n}\n\nfunction price(o: ApiOrder) {\n return `${formatDisplayPrice(o.price.formatted)} ${o.price.currency ?? \"\"}`.trim();\n}\n\nfunction OrderRowsSkeleton() {\n return (\n <div className=\"divide-y divide-border overflow-hidden rounded-lg border border-border\">\n {Array.from({ length: 3 }).map((_, i) => (\n <div key={i} className=\"flex items-center gap-4 px-4 py-3\">\n <Skeleton className=\"h-12 w-12 shrink-0 rounded-lg\" />\n <div className=\"flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"h-3 w-20\" />\n </div>\n <Skeleton className=\"hidden h-4 w-20 sm:block\" />\n <Skeleton className=\"h-8 w-20 rounded-md\" />\n </div>\n ))}\n </div>\n );\n}\n\nfunction OrderRow({ order, subtitle, from, priceCell, actions, isNew }: {\n order: ApiOrder;\n subtitle: ReactNode;\n from?: string;\n priceCell: ReactNode;\n actions: ReactNode;\n isNew?: boolean;\n}) {\n const resolveImage = useImageUrl();\n const name = order.token?.name || `#${order.nftTokenId}`;\n const image = resolveImage(order.token?.image, { width: 96 });\n const expiry = expiryOf(order);\n return (\n <div data-new={isNew ? \"true\" : undefined} className={cn(\"flex items-center gap-4 px-4 py-3 transition-colors hover:bg-muted/40\", isNew && \"border-l-2 border-primary\")}>\n <div className=\"relative h-12 w-12 shrink-0 overflow-hidden rounded-lg border border-border bg-muted\">\n {image && <Image src={image} alt={name} fill sizes=\"48px\" unoptimized className=\"object-cover\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <Link href={assetHref(\"STARKNET\", order.nftContract, order.nftTokenId)} className=\"block truncate text-sm font-medium transition-colors hover:text-primary\">\n {name}\n </Link>\n {subtitle}\n </div>\n {from && (\n <div className=\"hidden shrink-0 sm:block\">\n <Link href={profileHref({ address: from })} className=\"text-xs tabular-nums text-muted-foreground transition-colors hover:text-foreground\">\n {from.slice(0, 6)}…{from.slice(-4)}\n </Link>\n </div>\n )}\n <div className=\"hidden shrink-0 text-right sm:block\">{priceCell}</div>\n <div className=\"hidden shrink-0 md:block\">\n <p className={cn(\"text-sm\", expiry.expired && \"text-muted-foreground\", expiry.urgent && \"font-medium text-destructive\")}>{expiry.label}</p>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {order.txHash?.created && (\n <a href={`${EXPLORER_URL}/tx/${order.txHash.created}`} target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"View on explorer\" className=\"inline-flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-muted\">\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground\" />\n </a>\n )}\n {actions}\n </div>\n </div>\n );\n}\n\nfunction PriceText({ order }: { order: ApiOrder }) {\n return (\n <p className=\"text-sm font-semibold\">\n {formatDisplayPrice(order.price.formatted)} <span className=\"text-xs font-normal text-muted-foreground\">{order.price.currency}</span>\n </p>\n );\n}\n\nfunction CounterOfferRow({ bid, actions }: { bid: ApiOrder; actions: PortfolioOrderActions }) {\n const { counterOffers } = useCounterOffers({ originalOrderHash: bid.orderHash });\n const counter = counterOffers[0];\n if (!counter) return null;\n const closed = counter.status !== \"ACTIVE\" || isExpired(counter.endTime);\n return (\n <OrderRow\n order={counter}\n subtitle={\n <Badge variant=\"secondary\" className=\"mt-0.5 h-4 px-1.5 text-2xs\">\n <ArrowLeftRight className=\"mr-1 h-2.5 w-2.5\" />\n Counter-offer\n </Badge>\n }\n priceCell={\n <div className=\"flex flex-col items-end gap-0.5\">\n <p className=\"text-xs text-muted-foreground line-through\">{price(bid)}</p>\n <p className=\"text-sm font-semibold\">{counter.price.formatted ? price(counter) : \"—\"}</p>\n </div>\n }\n actions={\n closed ? (\n <span className=\"text-xs text-muted-foreground\">{counter.status !== \"ACTIVE\" ? counter.status.toLowerCase() : \"Expired\"}</span>\n ) : (\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(counter, bid)}>\n Accept\n </Button>\n )\n }\n />\n );\n}\n\nexport function PortfolioOrders({ view, address, useActions }: {\n view: PortfolioOrdersView;\n address: string;\n useActions: UsePortfolioOrderActions;\n}) {\n const mine = useUserOrders(view === \"received\" ? null : address);\n const received = useReceivedOffers(view === \"received\" ? address : null);\n const source = view === \"received\" ? received : mine;\n const actions = useActions({ view, refresh: () => void source.mutate() });\n const config = VIEWS[view];\n\n const orders =\n view === \"listings\" ? mine.orders.filter((o) => isNft(o) && o.status === \"ACTIVE\")\n : view === \"offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && o.status === \"ACTIVE\")\n : view === \"counter-offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && isSameAddress(o.offerer, address) && o.hasActiveCounterOffer === true)\n : received.orders;\n\n const seen = view === \"received\" ? getSeenOffers() : null;\n const EmptyIcon = config.emptyIcon;\n\n return (\n <>\n <EmptyOrError\n isLoading={source.isLoading}\n error={source.error}\n isEmpty={orders.length === 0}\n onRetry={() => void source.mutate()}\n emptyTitle={config.emptyTitle}\n emptyDescription={config.emptyDescription}\n emptyCta={config.emptyCta}\n emptyIcon={<EmptyIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={<OrderRowsSkeleton />}\n >\n <div className=\"space-y-1\">\n {config.count && orders.length > 0 && <p className=\"pb-2 text-sm text-muted-foreground\">{config.count(orders.length)}</p>}\n <div className=\"overflow-hidden rounded-lg border border-border\">\n <div className=\"flex items-center gap-4 border-b border-border bg-muted/30 px-4 py-2 text-xs uppercase tracking-wide text-muted-foreground\">\n <div className=\"w-12 shrink-0\" />\n <div className=\"flex-1\">Asset</div>\n {view === \"received\" && <div className=\"hidden w-28 sm:block\">From</div>}\n <div className={cn(\"hidden text-right sm:block\", view === \"counter-offers\" ? \"w-40\" : \"w-24\")}>{config.priceLabel}</div>\n <div className=\"hidden w-28 md:block\">Expires</div>\n <div className=\"w-24 text-right\">Actions</div>\n </div>\n {view === \"counter-offers\"\n ? orders.map((bid) => <CounterOfferRow key={bid.orderHash} bid={bid} actions={actions} />)\n : orders.map((order) => (\n <OrderRow\n key={order.orderHash}\n order={order}\n isNew={seen ? !seen.has(order.orderHash) : false}\n from={view === \"received\" ? order.offerer : undefined}\n subtitle={<span className=\"text-xs text-muted-foreground\">{view === \"received\" ? \"Received offer\" : view === \"offers\" ? \"Offer\" : \"Active\"}</span>}\n priceCell={<PriceText order={order} />}\n actions={\n view === \"received\" ? (\n <>\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.counter?.(order)}>Counter</Button>\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(order)}>Accept</Button>\n </>\n ) : (\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs text-destructive hover:text-destructive\" disabled={actions.isProcessing} onClick={() => actions.cancel?.(order)}>Cancel</Button>\n )\n }\n />\n ))}\n </div>\n </div>\n </EmptyOrError>\n {actions.dialogs}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoFU;AAjFV,iBAAsD;AACtD,0BAAoE;AACpE,mBAAkB;AAClB,kBAAiB;AACjB,mBAAsB;AACtB,oBAAuB;AACvB,4BAA6B;AAC7B,sBAAyB;AACzB,gBAAmB;AACnB,0BAA6B;AAC7B,oBAAmC;AACnC,kBAAqC;AACrC,0BAA8B;AAC9B,yBAA8B;AAC9B,2BAA4B;AAC5B,wBAAmE;AAcnE,MAAM,QAAQ;AAAA,EACZ,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,UAAU,EAAE,OAAO,iBAAiB,MAAM,oBAAoB;AAAA,IAC9D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO,CAAC,MAAc,GAAG,CAAC,kBAAkB,MAAM,IAAI,KAAK,GAAG;AAAA,EAChE;AAAA,EACA,QAAQ;AAAA,IACN,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,UAAU,EAAE,OAAO,sBAAsB,MAAM,eAAe;AAAA,IAC9D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO,CAAC,MAAc,GAAG,CAAC,gBAAgB,MAAM,IAAI,KAAK,GAAG;AAAA,EAC9D;AAAA,EACA,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,O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mBAAoC,KAAU,WAAzB,IAAI,SAAuC,CAAE,IACvF,OAAO,IAAI,CAAC,UACV;AAAA,cAAC;AAAA;AAAA,gBAEC;AAAA,gBACA,OAAO,OAAO,CAAC,KAAK,IAAI,MAAM,SAAS,IAAI;AAAA,gBAC3C,MAAM,SAAS,aAAa,MAAM,UAAU;AAAA,gBAC5C,UAAU,4CAAC,UAAK,WAAU,iCAAiC,mBAAS,aAAa,mBAAmB,SAAS,WAAW,UAAU,UAAS;AAAA,gBAC3I,WAAW,4CAAC,aAAU,OAAc;AAAA,gBACpC,SACE,SAAS,aACP,4EACE;AAAA,8DAAC,wBAAO,MAAK,MAAK,SAAQ,WAAU,WAAU,eAAc,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,UAAU,KAAK,GAAG,qBAAO;AAAA,kBAC5I,4CAAC,wBAAO,MAAK,MAAK,WAAU,eAAc,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,SAAS,KAAK,GAAG,oBAAM;AAAA,mBAC1H,IAEA,4CAAC,wBAAO,MAAK,MAAK,SAAQ,WAAU,WAAU,uDAAsD,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,SAAS,KAAK,GAAG,oBAAM;AAAA;AAAA,cAbjL,MAAM;AAAA,YAgBb,CACD;AAAA,aACP;AAAA,WACF;AAAA;AAAA,IACF;AAAA,IACC,QAAQ;AAAA,KACX;AAEJ;","names":["Image","Link"]}
|
|
@@ -7,6 +7,7 @@ import Link from "./link.js";
|
|
|
7
7
|
import { Badge } from "./badge.js";
|
|
8
8
|
import { Button } from "./button.js";
|
|
9
9
|
import { EmptyOrError } from "./empty-or-error.js";
|
|
10
|
+
import { Skeleton } from "./skeleton.js";
|
|
10
11
|
import { cn } from "../utils/cn.js";
|
|
11
12
|
import { EXPLORER_URL } from "../utils/explorer-url.js";
|
|
12
13
|
import { formatDisplayPrice } from "../utils/format.js";
|
|
@@ -58,6 +59,17 @@ function expiryOf(order) {
|
|
|
58
59
|
function price(o) {
|
|
59
60
|
return `${formatDisplayPrice(o.price.formatted)} ${o.price.currency ?? ""}`.trim();
|
|
60
61
|
}
|
|
62
|
+
function OrderRowsSkeleton() {
|
|
63
|
+
return /* @__PURE__ */ jsx("div", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 px-4 py-3", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-12 shrink-0 rounded-lg" }),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-40" }),
|
|
67
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-20" })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "hidden h-4 w-20 sm:block" }),
|
|
70
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-20 rounded-md" })
|
|
71
|
+
] }, i)) });
|
|
72
|
+
}
|
|
61
73
|
function OrderRow({ order, subtitle, from, priceCell, actions, isNew }) {
|
|
62
74
|
const resolveImage = useImageUrl();
|
|
63
75
|
const name = order.token?.name || `#${order.nftTokenId}`;
|
|
@@ -131,7 +143,7 @@ function PortfolioOrders({ view, address, useActions }) {
|
|
|
131
143
|
emptyDescription: config.emptyDescription,
|
|
132
144
|
emptyCta: config.emptyCta,
|
|
133
145
|
emptyIcon: /* @__PURE__ */ jsx(EmptyIcon, { className: "h-7 w-7 text-muted-foreground" }),
|
|
134
|
-
|
|
146
|
+
skeletonNode: /* @__PURE__ */ jsx(OrderRowsSkeleton, {}),
|
|
135
147
|
children: /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
136
148
|
config.count && orders.length > 0 && /* @__PURE__ */ jsx("p", { className: "pb-2 text-sm text-muted-foreground", children: config.count(orders.length) }),
|
|
137
149
|
/* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-lg border border-border", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-orders.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { assetHref, profileHref, type ApiOrder } from \"@medialane/sdk\";\nimport { ArrowLeftRight, ExternalLink, HandCoins, Inbox, Tag } from \"lucide-react\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { Badge } from \"./badge.js\";\nimport { Button } from \"./button.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { getSeenOffers } from \"../utils/seen-offers.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useCounterOffers, useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\n\nexport type PortfolioOrdersView = \"listings\" | \"offers\" | \"received\" | \"counter-offers\";\n\nexport interface PortfolioOrderActions {\n isProcessing: boolean;\n cancel?: (order: ApiOrder) => void;\n accept?: (order: ApiOrder, original?: ApiOrder) => void;\n counter?: (order: ApiOrder) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioOrderActions = (context: { view: PortfolioOrdersView; refresh: () => void }) => PortfolioOrderActions;\n\nconst VIEWS = {\n listings: {\n emptyTitle: \"No active listings\",\n emptyDescription: \"Sell an asset to get started.\",\n emptyCta: { label: \"Browse assets\", href: \"/portfolio/assets\" },\n emptyIcon: Tag,\n priceLabel: \"Price\",\n count: (n: number) => `${n} active listing${n === 1 ? \"\" : \"s\"}`,\n },\n offers: {\n emptyTitle: \"No offers sent yet\",\n emptyDescription: \"Browse the marketplace to make offers on assets.\",\n emptyCta: { label: \"Browse marketplace\", href: \"/marketplace\" },\n emptyIcon: HandCoins,\n priceLabel: \"Offer price\",\n count: (n: number) => `${n} active offer${n === 1 ? \"\" : \"s\"}`,\n },\n received: {\n emptyTitle: \"No offers received yet\",\n emptyDescription: \"When someone makes an offer on your asset, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Offer price\",\n count: null,\n },\n \"counter-offers\": {\n emptyTitle: \"No counter-offers yet\",\n emptyDescription: \"When a seller responds to your bid with a counter-offer, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Their price / Your bid\",\n count: null,\n },\n} as const;\n\nconst isNft = (o: ApiOrder) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\";\n\nfunction expiryOf(order: ApiOrder) {\n const expired = isExpired(order.endTime);\n const urgent = !expired && Number(order.endTime) * 1000 - Date.now() < 86400000;\n return { label: timeUntil(order.endTime), expired, urgent };\n}\n\nfunction price(o: ApiOrder) {\n return `${formatDisplayPrice(o.price.formatted)} ${o.price.currency ?? \"\"}`.trim();\n}\n\nfunction OrderRow({ order, subtitle, from, priceCell, actions, isNew }: {\n order: ApiOrder;\n subtitle: ReactNode;\n from?: string;\n priceCell: ReactNode;\n actions: ReactNode;\n isNew?: boolean;\n}) {\n const resolveImage = useImageUrl();\n const name = order.token?.name || `#${order.nftTokenId}`;\n const image = resolveImage(order.token?.image, { width: 96 });\n const expiry = expiryOf(order);\n return (\n <div data-new={isNew ? \"true\" : undefined} className={cn(\"flex items-center gap-4 px-4 py-3 transition-colors hover:bg-muted/40\", isNew && \"border-l-2 border-primary\")}>\n <div className=\"relative h-12 w-12 shrink-0 overflow-hidden rounded-lg border border-border bg-muted\">\n {image && <Image src={image} alt={name} fill sizes=\"48px\" unoptimized className=\"object-cover\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <Link href={assetHref(\"STARKNET\", order.nftContract, order.nftTokenId)} className=\"block truncate text-sm font-medium transition-colors hover:text-primary\">\n {name}\n </Link>\n {subtitle}\n </div>\n {from && (\n <div className=\"hidden shrink-0 sm:block\">\n <Link href={profileHref({ address: from })} className=\"text-xs tabular-nums text-muted-foreground transition-colors hover:text-foreground\">\n {from.slice(0, 6)}…{from.slice(-4)}\n </Link>\n </div>\n )}\n <div className=\"hidden shrink-0 text-right sm:block\">{priceCell}</div>\n <div className=\"hidden shrink-0 md:block\">\n <p className={cn(\"text-sm\", expiry.expired && \"text-muted-foreground\", expiry.urgent && \"font-medium text-destructive\")}>{expiry.label}</p>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {order.txHash?.created && (\n <a href={`${EXPLORER_URL}/tx/${order.txHash.created}`} target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"View on explorer\" className=\"inline-flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-muted\">\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground\" />\n </a>\n )}\n {actions}\n </div>\n </div>\n );\n}\n\nfunction PriceText({ order }: { order: ApiOrder }) {\n return (\n <p className=\"text-sm font-semibold\">\n {formatDisplayPrice(order.price.formatted)} <span className=\"text-xs font-normal text-muted-foreground\">{order.price.currency}</span>\n </p>\n );\n}\n\nfunction CounterOfferRow({ bid, actions }: { bid: ApiOrder; actions: PortfolioOrderActions }) {\n const { counterOffers } = useCounterOffers({ originalOrderHash: bid.orderHash });\n const counter = counterOffers[0];\n if (!counter) return null;\n const closed = counter.status !== \"ACTIVE\" || isExpired(counter.endTime);\n return (\n <OrderRow\n order={counter}\n subtitle={\n <Badge variant=\"secondary\" className=\"mt-0.5 h-4 px-1.5 text-2xs\">\n <ArrowLeftRight className=\"mr-1 h-2.5 w-2.5\" />\n Counter-offer\n </Badge>\n }\n priceCell={\n <div className=\"flex flex-col items-end gap-0.5\">\n <p className=\"text-xs text-muted-foreground line-through\">{price(bid)}</p>\n <p className=\"text-sm font-semibold\">{counter.price.formatted ? price(counter) : \"—\"}</p>\n </div>\n }\n actions={\n closed ? (\n <span className=\"text-xs text-muted-foreground\">{counter.status !== \"ACTIVE\" ? counter.status.toLowerCase() : \"Expired\"}</span>\n ) : (\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(counter, bid)}>\n Accept\n </Button>\n )\n }\n />\n );\n}\n\nexport function PortfolioOrders({ view, address, useActions }: {\n view: PortfolioOrdersView;\n address: string;\n useActions: UsePortfolioOrderActions;\n}) {\n const mine = useUserOrders(view === \"received\" ? null : address);\n const received = useReceivedOffers(view === \"received\" ? address : null);\n const source = view === \"received\" ? received : mine;\n const actions = useActions({ view, refresh: () => void source.mutate() });\n const config = VIEWS[view];\n\n const orders =\n view === \"listings\" ? mine.orders.filter((o) => isNft(o) && o.status === \"ACTIVE\")\n : view === \"offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && o.status === \"ACTIVE\")\n : view === \"counter-offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && isSameAddress(o.offerer, address) && o.hasActiveCounterOffer === true)\n : received.orders;\n\n const seen = view === \"received\" ? getSeenOffers() : null;\n const EmptyIcon = config.emptyIcon;\n\n return (\n <>\n <EmptyOrError\n isLoading={source.isLoading}\n error={source.error}\n isEmpty={orders.length === 0}\n onRetry={() => void source.mutate()}\n emptyTitle={config.emptyTitle}\n emptyDescription={config.emptyDescription}\n emptyCta={config.emptyCta}\n emptyIcon={<EmptyIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonCount={3}\n >\n <div className=\"space-y-1\">\n {config.count && orders.length > 0 && <p className=\"pb-2 text-sm text-muted-foreground\">{config.count(orders.length)}</p>}\n <div className=\"overflow-hidden rounded-lg border border-border\">\n <div className=\"flex items-center gap-4 border-b border-border bg-muted/30 px-4 py-2 text-xs uppercase tracking-wide text-muted-foreground\">\n <div className=\"w-12 shrink-0\" />\n <div className=\"flex-1\">Asset</div>\n {view === \"received\" && <div className=\"hidden w-28 sm:block\">From</div>}\n <div className={cn(\"hidden text-right sm:block\", view === \"counter-offers\" ? \"w-40\" : \"w-24\")}>{config.priceLabel}</div>\n <div className=\"hidden w-28 md:block\">Expires</div>\n <div className=\"w-24 text-right\">Actions</div>\n </div>\n {view === \"counter-offers\"\n ? orders.map((bid) => <CounterOfferRow key={bid.orderHash} bid={bid} actions={actions} />)\n : orders.map((order) => (\n <OrderRow\n key={order.orderHash}\n order={order}\n isNew={seen ? !seen.has(order.orderHash) : false}\n from={view === \"received\" ? order.offerer : undefined}\n subtitle={<span className=\"text-xs text-muted-foreground\">{view === \"received\" ? \"Received offer\" : view === \"offers\" ? \"Offer\" : \"Active\"}</span>}\n priceCell={<PriceText order={order} />}\n actions={\n view === \"received\" ? (\n <>\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.counter?.(order)}>Counter</Button>\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(order)}>Accept</Button>\n </>\n ) : (\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs text-destructive hover:text-destructive\" disabled={actions.isProcessing} onClick={() => actions.cancel?.(order)}>Cancel</Button>\n )\n }\n />\n ))}\n </div>\n </div>\n </EmptyOrError>\n {actions.dialogs}\n </>\n );\n}\n"],"mappings":";AA6FkB,SAgIM,UAhIN,KAEZ,YAFY;AA1FlB,SAAS,WAAW,mBAAkC;AACtD,SAAS,gBAAgB,cAAc,WAAW,OAAO,WAAW;AACpE,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,WAAW,iBAAiB;AACrC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB,mBAAmB,qBAAqB;AAcnE,MAAM,QAAQ;AAAA,EACZ,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,UA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oBAAC,mBAAoC,KAAU,WAAzB,IAAI,SAAuC,CAAE,IACvF,OAAO,IAAI,CAAC,UACV;AAAA,cAAC;AAAA;AAAA,gBAEC;AAAA,gBACA,OAAO,OAAO,CAAC,KAAK,IAAI,MAAM,SAAS,IAAI;AAAA,gBAC3C,MAAM,SAAS,aAAa,MAAM,UAAU;AAAA,gBAC5C,UAAU,oBAAC,UAAK,WAAU,iCAAiC,mBAAS,aAAa,mBAAmB,SAAS,WAAW,UAAU,UAAS;AAAA,gBAC3I,WAAW,oBAAC,aAAU,OAAc;AAAA,gBACpC,SACE,SAAS,aACP,iCACE;AAAA,sCAAC,UAAO,MAAK,MAAK,SAAQ,WAAU,WAAU,eAAc,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,UAAU,KAAK,GAAG,qBAAO;AAAA,kBAC5I,oBAAC,UAAO,MAAK,MAAK,WAAU,eAAc,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,SAAS,KAAK,GAAG,oBAAM;AAAA,mBAC1H,IAEA,oBAAC,UAAO,MAAK,MAAK,SAAQ,WAAU,WAAU,uDAAsD,UAAU,QAAQ,cAAc,SAAS,MAAM,QAAQ,SAAS,KAAK,GAAG,oBAAM;AAAA;AAAA,cAbjL,MAAM;AAAA,YAgBb,CACD;AAAA,aACP;AAAA,WACF;AAAA;AAAA,IACF;AAAA,IACC,QAAQ;AAAA,KACX;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-orders.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { assetHref, profileHref, type ApiOrder } from \"@medialane/sdk\";\nimport { ArrowLeftRight, ExternalLink, HandCoins, Inbox, Tag } from \"lucide-react\";\nimport Image from \"./image.js\";\nimport Link from \"./link.js\";\nimport { Badge } from \"./badge.js\";\nimport { Button } from \"./button.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { getSeenOffers } from \"../utils/seen-offers.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useCounterOffers, useReceivedOffers, useUserOrders } from \"../utils/use-orders.js\";\n\nexport type PortfolioOrdersView = \"listings\" | \"offers\" | \"received\" | \"counter-offers\";\n\nexport interface PortfolioOrderActions {\n isProcessing: boolean;\n cancel?: (order: ApiOrder) => void;\n accept?: (order: ApiOrder, original?: ApiOrder) => void;\n counter?: (order: ApiOrder) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioOrderActions = (context: { view: PortfolioOrdersView; refresh: () => void }) => PortfolioOrderActions;\n\nconst VIEWS = {\n listings: {\n emptyTitle: \"No active listings\",\n emptyDescription: \"Sell an asset to get started.\",\n emptyCta: { label: \"Browse assets\", href: \"/portfolio/assets\" },\n emptyIcon: Tag,\n priceLabel: \"Price\",\n count: (n: number) => `${n} active listing${n === 1 ? \"\" : \"s\"}`,\n },\n offers: {\n emptyTitle: \"No offers sent yet\",\n emptyDescription: \"Browse the marketplace to make offers on assets.\",\n emptyCta: { label: \"Browse marketplace\", href: \"/marketplace\" },\n emptyIcon: HandCoins,\n priceLabel: \"Offer price\",\n count: (n: number) => `${n} active offer${n === 1 ? \"\" : \"s\"}`,\n },\n received: {\n emptyTitle: \"No offers received yet\",\n emptyDescription: \"When someone makes an offer on your asset, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Offer price\",\n count: null,\n },\n \"counter-offers\": {\n emptyTitle: \"No counter-offers yet\",\n emptyDescription: \"When a seller responds to your bid with a counter-offer, it will appear here.\",\n emptyCta: undefined,\n emptyIcon: Inbox,\n priceLabel: \"Their price / Your bid\",\n count: null,\n },\n} as const;\n\nconst isNft = (o: ApiOrder) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\";\n\nfunction expiryOf(order: ApiOrder) {\n const expired = isExpired(order.endTime);\n const urgent = !expired && Number(order.endTime) * 1000 - Date.now() < 86400000;\n return { label: timeUntil(order.endTime), expired, urgent };\n}\n\nfunction price(o: ApiOrder) {\n return `${formatDisplayPrice(o.price.formatted)} ${o.price.currency ?? \"\"}`.trim();\n}\n\nfunction OrderRowsSkeleton() {\n return (\n <div className=\"divide-y divide-border overflow-hidden rounded-lg border border-border\">\n {Array.from({ length: 3 }).map((_, i) => (\n <div key={i} className=\"flex items-center gap-4 px-4 py-3\">\n <Skeleton className=\"h-12 w-12 shrink-0 rounded-lg\" />\n <div className=\"flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"h-3 w-20\" />\n </div>\n <Skeleton className=\"hidden h-4 w-20 sm:block\" />\n <Skeleton className=\"h-8 w-20 rounded-md\" />\n </div>\n ))}\n </div>\n );\n}\n\nfunction OrderRow({ order, subtitle, from, priceCell, actions, isNew }: {\n order: ApiOrder;\n subtitle: ReactNode;\n from?: string;\n priceCell: ReactNode;\n actions: ReactNode;\n isNew?: boolean;\n}) {\n const resolveImage = useImageUrl();\n const name = order.token?.name || `#${order.nftTokenId}`;\n const image = resolveImage(order.token?.image, { width: 96 });\n const expiry = expiryOf(order);\n return (\n <div data-new={isNew ? \"true\" : undefined} className={cn(\"flex items-center gap-4 px-4 py-3 transition-colors hover:bg-muted/40\", isNew && \"border-l-2 border-primary\")}>\n <div className=\"relative h-12 w-12 shrink-0 overflow-hidden rounded-lg border border-border bg-muted\">\n {image && <Image src={image} alt={name} fill sizes=\"48px\" unoptimized className=\"object-cover\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <Link href={assetHref(\"STARKNET\", order.nftContract, order.nftTokenId)} className=\"block truncate text-sm font-medium transition-colors hover:text-primary\">\n {name}\n </Link>\n {subtitle}\n </div>\n {from && (\n <div className=\"hidden shrink-0 sm:block\">\n <Link href={profileHref({ address: from })} className=\"text-xs tabular-nums text-muted-foreground transition-colors hover:text-foreground\">\n {from.slice(0, 6)}…{from.slice(-4)}\n </Link>\n </div>\n )}\n <div className=\"hidden shrink-0 text-right sm:block\">{priceCell}</div>\n <div className=\"hidden shrink-0 md:block\">\n <p className={cn(\"text-sm\", expiry.expired && \"text-muted-foreground\", expiry.urgent && \"font-medium text-destructive\")}>{expiry.label}</p>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {order.txHash?.created && (\n <a href={`${EXPLORER_URL}/tx/${order.txHash.created}`} target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"View on explorer\" className=\"inline-flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-muted\">\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground\" />\n </a>\n )}\n {actions}\n </div>\n </div>\n );\n}\n\nfunction PriceText({ order }: { order: ApiOrder }) {\n return (\n <p className=\"text-sm font-semibold\">\n {formatDisplayPrice(order.price.formatted)} <span className=\"text-xs font-normal text-muted-foreground\">{order.price.currency}</span>\n </p>\n );\n}\n\nfunction CounterOfferRow({ bid, actions }: { bid: ApiOrder; actions: PortfolioOrderActions }) {\n const { counterOffers } = useCounterOffers({ originalOrderHash: bid.orderHash });\n const counter = counterOffers[0];\n if (!counter) return null;\n const closed = counter.status !== \"ACTIVE\" || isExpired(counter.endTime);\n return (\n <OrderRow\n order={counter}\n subtitle={\n <Badge variant=\"secondary\" className=\"mt-0.5 h-4 px-1.5 text-2xs\">\n <ArrowLeftRight className=\"mr-1 h-2.5 w-2.5\" />\n Counter-offer\n </Badge>\n }\n priceCell={\n <div className=\"flex flex-col items-end gap-0.5\">\n <p className=\"text-xs text-muted-foreground line-through\">{price(bid)}</p>\n <p className=\"text-sm font-semibold\">{counter.price.formatted ? price(counter) : \"—\"}</p>\n </div>\n }\n actions={\n closed ? (\n <span className=\"text-xs text-muted-foreground\">{counter.status !== \"ACTIVE\" ? counter.status.toLowerCase() : \"Expired\"}</span>\n ) : (\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(counter, bid)}>\n Accept\n </Button>\n )\n }\n />\n );\n}\n\nexport function PortfolioOrders({ view, address, useActions }: {\n view: PortfolioOrdersView;\n address: string;\n useActions: UsePortfolioOrderActions;\n}) {\n const mine = useUserOrders(view === \"received\" ? null : address);\n const received = useReceivedOffers(view === \"received\" ? address : null);\n const source = view === \"received\" ? received : mine;\n const actions = useActions({ view, refresh: () => void source.mutate() });\n const config = VIEWS[view];\n\n const orders =\n view === \"listings\" ? mine.orders.filter((o) => isNft(o) && o.status === \"ACTIVE\")\n : view === \"offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && o.status === \"ACTIVE\")\n : view === \"counter-offers\" ? mine.orders.filter((o) => o.offer.itemType === \"ERC20\" && isSameAddress(o.offerer, address) && o.hasActiveCounterOffer === true)\n : received.orders;\n\n const seen = view === \"received\" ? getSeenOffers() : null;\n const EmptyIcon = config.emptyIcon;\n\n return (\n <>\n <EmptyOrError\n isLoading={source.isLoading}\n error={source.error}\n isEmpty={orders.length === 0}\n onRetry={() => void source.mutate()}\n emptyTitle={config.emptyTitle}\n emptyDescription={config.emptyDescription}\n emptyCta={config.emptyCta}\n emptyIcon={<EmptyIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={<OrderRowsSkeleton />}\n >\n <div className=\"space-y-1\">\n {config.count && orders.length > 0 && <p className=\"pb-2 text-sm text-muted-foreground\">{config.count(orders.length)}</p>}\n <div className=\"overflow-hidden rounded-lg border border-border\">\n <div className=\"flex items-center gap-4 border-b border-border bg-muted/30 px-4 py-2 text-xs uppercase tracking-wide text-muted-foreground\">\n <div className=\"w-12 shrink-0\" />\n <div className=\"flex-1\">Asset</div>\n {view === \"received\" && <div className=\"hidden w-28 sm:block\">From</div>}\n <div className={cn(\"hidden text-right sm:block\", view === \"counter-offers\" ? \"w-40\" : \"w-24\")}>{config.priceLabel}</div>\n <div className=\"hidden w-28 md:block\">Expires</div>\n <div className=\"w-24 text-right\">Actions</div>\n </div>\n {view === \"counter-offers\"\n ? orders.map((bid) => <CounterOfferRow key={bid.orderHash} bid={bid} actions={actions} />)\n : orders.map((order) => (\n <OrderRow\n key={order.orderHash}\n order={order}\n isNew={seen ? !seen.has(order.orderHash) : false}\n from={view === \"received\" ? order.offerer : undefined}\n subtitle={<span className=\"text-xs text-muted-foreground\">{view === \"received\" ? \"Received offer\" : view === \"offers\" ? \"Offer\" : \"Active\"}</span>}\n priceCell={<PriceText order={order} />}\n actions={\n view === \"received\" ? (\n <>\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.counter?.(order)}>Counter</Button>\n <Button size=\"sm\" className=\"h-8 text-xs\" disabled={actions.isProcessing} onClick={() => actions.accept?.(order)}>Accept</Button>\n </>\n ) : (\n <Button size=\"sm\" variant=\"outline\" className=\"h-8 text-xs text-destructive hover:text-destructive\" disabled={actions.isProcessing} onClick={() => actions.cancel?.(order)}>Cancel</Button>\n )\n }\n />\n ))}\n </div>\n </div>\n </EmptyOrError>\n {actions.dialogs}\n </>\n );\n}\n"],"mappings":";AAoFU,SA4Jc,UA5Jd,KACA,YADA;AAjFV,SAAS,WAAW,mBAAkC;AACtD,SAAS,gBAAgB,cAAc,WAAW,OAAO,WAAW;AACpE,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,WAAW,iBAAiB;AACrC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB,mBAAmB,qBAAqB;AAcnE,MAAM,QAAQ;AAAA,EACZ,UAAU;AAAA,IACR,YAAY;AAAA,IACZ,kBAAkB;AAAA,I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YAgBb,CACD;AAAA,aACP;AAAA,WACF;AAAA;AAAA,IACF;AAAA,IACC,QAAQ;AAAA,KACX;AAEJ;","names":[]}
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
|
@@ -70,11 +70,11 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
70
70
|
key: "nfts",
|
|
71
71
|
format: { name: "Single NFT", hint: "One copy to keep or sell" },
|
|
72
72
|
cta: "Create",
|
|
73
|
-
blurb: "Publish each work as a single copy in a collection
|
|
73
|
+
blurb: "Publish each work as a single copy in a creator-owned collection.",
|
|
74
74
|
title: "Single Edition NFT",
|
|
75
75
|
subtitle: "Each work is minted once",
|
|
76
|
-
description: "Publish any photo, video, audio, or document, minted once inside
|
|
77
|
-
features: ["One mint per work", "Collections with their own page and name", "
|
|
76
|
+
description: "Publish any photo, video, audio, or document, minted once inside a creator-owned collection. Licensing, provenance, and ownership live on-chain.",
|
|
77
|
+
features: ["One mint per work", "Collections with their own page and name", "License terms set by the creator"],
|
|
78
78
|
example: "A song, a photo, an ebook, a short film",
|
|
79
79
|
icon: import_lucide_react.ImagePlus,
|
|
80
80
|
status: "live",
|
|
@@ -84,11 +84,11 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
84
84
|
key: "limited-editions",
|
|
85
85
|
format: { name: "Limited Editions", hint: "Numbered copies people can collect" },
|
|
86
86
|
cta: "Mint",
|
|
87
|
-
blurb: "Release
|
|
87
|
+
blurb: "Release a work in numbered copies that can be collected and traded.",
|
|
88
88
|
title: "Limited Editions NFT",
|
|
89
|
-
subtitle: "Numbered copies from a collection
|
|
90
|
-
description: "Create an editions collection and release each work in as many numbered copies as
|
|
91
|
-
features: ["Numbered copies, set by
|
|
89
|
+
subtitle: "Numbered copies from a creator-owned collection",
|
|
90
|
+
description: "Create an editions collection and release each work in as many numbered copies as the creator chooses.",
|
|
91
|
+
features: ["Numbered copies, set by the creator", "Fans collect and trade", "One home for every release"],
|
|
92
92
|
example: "50 copies of a limited print, a music EP in 100 editions",
|
|
93
93
|
icon: import_lucide_react.Layers,
|
|
94
94
|
status: "live",
|
|
@@ -97,11 +97,11 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
97
97
|
{
|
|
98
98
|
key: "create-collection",
|
|
99
99
|
cta: "Create",
|
|
100
|
-
blurb: "Deploy
|
|
100
|
+
blurb: "Deploy a collection to mint single-edition works into.",
|
|
101
101
|
title: "NFT Collection",
|
|
102
|
-
subtitle: "
|
|
103
|
-
description: "Deploy
|
|
104
|
-
features: ["
|
|
102
|
+
subtitle: "An ERC-721 collection, ready to mint into",
|
|
103
|
+
description: "Deploy an owned and controlled collection with its own name, symbol, and page. Mint single-edition works into it at any time.",
|
|
104
|
+
features: ["Own collection contract", "Set the name and symbol", "Mint into it anytime"],
|
|
105
105
|
example: "A photography collection, an album of singles",
|
|
106
106
|
icon: import_lucide_react.LayoutGrid,
|
|
107
107
|
status: "live",
|
|
@@ -123,11 +123,11 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
123
123
|
{
|
|
124
124
|
key: "create-1155",
|
|
125
125
|
cta: "Create",
|
|
126
|
-
blurb: "Deploy
|
|
126
|
+
blurb: "Deploy a collection to release numbered editions from.",
|
|
127
127
|
title: "Limited Editions Collection",
|
|
128
|
-
subtitle: "
|
|
129
|
-
description: "Deploy an
|
|
130
|
-
features: ["
|
|
128
|
+
subtitle: "An ERC-1155 collection, ready for editions",
|
|
129
|
+
description: "Deploy an owned and controlled editions collection. Release each work in as many numbered copies as needed.",
|
|
130
|
+
features: ["Own collection contract", "Set the name and symbol", "Release editions anytime"],
|
|
131
131
|
example: "A print series, a music EP with numbered editions",
|
|
132
132
|
icon: import_lucide_react.Boxes,
|
|
133
133
|
status: "live",
|
|
@@ -154,8 +154,8 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
154
154
|
blurb: "Release a limited run at a set price and time window.",
|
|
155
155
|
title: "Collection Drop",
|
|
156
156
|
subtitle: "Timed NFT releases with mint windows",
|
|
157
|
-
description: "Set a price, a supply, and a start and end time. Collectors mint directly from
|
|
158
|
-
features: ["
|
|
157
|
+
description: "Set a price, a supply, and a start and end time. Collectors mint directly from the drop page.",
|
|
158
|
+
features: ["Price and supply set by the creator", "Opens and closes on a set schedule", "Branded drop page to share"],
|
|
159
159
|
example: "A 48-hour drop of 200 pieces at 5 USDC each",
|
|
160
160
|
icon: import_lucide_react.Package,
|
|
161
161
|
browseLinkLabel: "Browse drops",
|
|
@@ -166,11 +166,11 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
166
166
|
key: "ip-tickets",
|
|
167
167
|
format: { name: "IP Ticket", hint: "Tickets people hold and show at the door" },
|
|
168
168
|
cta: "Create",
|
|
169
|
-
blurb: "Create on-chain tickets
|
|
169
|
+
blurb: "Create on-chain tickets that holders can keep and trade.",
|
|
170
170
|
title: "IP Tickets",
|
|
171
171
|
subtitle: "Verifiable tickets, held in the wallet",
|
|
172
172
|
description: "Create tickets with their own supply and validity window, then mint them to attendees. Every ticket is verifiable on-chain.",
|
|
173
|
-
features: ["Verifiable at the door", "Supply and validity
|
|
173
|
+
features: ["Verifiable at the door", "Supply and validity set at creation", TICKETS_TRANSFERABLE_FEATURE],
|
|
174
174
|
icon: import_lucide_react.Ticket,
|
|
175
175
|
browseLinkLabel: "Browse tickets",
|
|
176
176
|
status: "live",
|
|
@@ -180,7 +180,7 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
180
180
|
key: "ip-club",
|
|
181
181
|
format: { name: "IP Club", hint: "Membership cards for a community" },
|
|
182
182
|
cta: "Create",
|
|
183
|
-
blurb: "Membership cards for
|
|
183
|
+
blurb: "Membership cards for a community.",
|
|
184
184
|
title: "IP Club",
|
|
185
185
|
subtitle: "Membership tiers, minted as cards",
|
|
186
186
|
description: "Create a club with membership tiers \u2014 fans, supporters, press, season passes. Mint the cards and sell them like any collection.",
|
|
@@ -193,10 +193,10 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
193
193
|
{
|
|
194
194
|
key: "ip-sponsorship",
|
|
195
195
|
cta: "Browse",
|
|
196
|
-
blurb: "Let a sponsor back
|
|
196
|
+
blurb: "Let a sponsor back a work directly, for a license in return.",
|
|
197
197
|
title: "IP Sponsorship",
|
|
198
198
|
subtitle: "Direct sponsorship offers, settled asset-to-asset",
|
|
199
|
-
description: "Create a sponsorship offer on an asset
|
|
199
|
+
description: "Create a sponsorship offer on an owned asset. Sponsors bid, the owner accepts, and the sponsor receives a license. Payment settles directly between sponsor and author.",
|
|
200
200
|
features: ["Direct settlement", "Owner-verified on-chain", "Open bidding or one invited sponsor"],
|
|
201
201
|
example: "Sponsor a song or an artwork for a license",
|
|
202
202
|
icon: import_lucide_react.Handshake,
|
|
@@ -207,12 +207,12 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
207
207
|
{
|
|
208
208
|
key: "creator-coins",
|
|
209
209
|
cta: "Launch",
|
|
210
|
-
blurb: "Launch
|
|
210
|
+
blurb: "Launch a coin in a few clicks and stay in control of it.",
|
|
211
211
|
title: "Creator Coin",
|
|
212
|
-
subtitle: "
|
|
213
|
-
description: "Launch
|
|
214
|
-
features: ["Launch in a few clicks", "
|
|
215
|
-
example: "A fan coin for
|
|
212
|
+
subtitle: "A coin and its liquidity, under creator control",
|
|
213
|
+
description: "Launch a coin with a public trading pool. The creator sets the supply and allocation and stays in control of the liquidity.",
|
|
214
|
+
features: ["Launch in a few clicks", "Creator keeps control of the liquidity", "Traded on a public pool"],
|
|
215
|
+
example: "A fan coin for a channel, a coin for a music project",
|
|
216
216
|
icon: import_lucide_react.TrendingUp,
|
|
217
217
|
status: "live",
|
|
218
218
|
group: "coins"
|
|
@@ -220,12 +220,12 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
220
220
|
{
|
|
221
221
|
key: "claim-memecoin",
|
|
222
222
|
cta: "Claim",
|
|
223
|
-
blurb: "Add
|
|
223
|
+
blurb: "Add an already launched coin to a profile.",
|
|
224
224
|
title: "Claim Memecoin",
|
|
225
|
-
subtitle: "Bring
|
|
226
|
-
description: "Claim
|
|
227
|
-
features: ["Bring
|
|
228
|
-
example: "
|
|
225
|
+
subtitle: "Bring an already launched coin",
|
|
226
|
+
description: "Claim an already launched coin to list it on the Coins page and a profile. Claims are reviewed before going live.",
|
|
227
|
+
features: ["Bring an already launched coin", "Reviewed by our team", "Featured on the Coins page"],
|
|
228
|
+
example: "An unrug memecoin, listed on a creator profile",
|
|
229
229
|
icon: import_lucide_react.Coins,
|
|
230
230
|
status: "live",
|
|
231
231
|
group: "coins"
|
|
@@ -233,12 +233,12 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
233
233
|
{
|
|
234
234
|
key: "claim-username",
|
|
235
235
|
cta: "Claim",
|
|
236
|
-
blurb: "Reserve
|
|
236
|
+
blurb: "Reserve a name and get a creator page of its own.",
|
|
237
237
|
title: "Claim Username",
|
|
238
|
-
subtitle: "Reserve
|
|
239
|
-
description: "Claim
|
|
240
|
-
features: ["Free claim", "Shareable creator page", "
|
|
241
|
-
example: "medialane.io/creator/your-name \u2014
|
|
238
|
+
subtitle: "Reserve a creator page URL",
|
|
239
|
+
description: "Claim a username to get a shareable creator page, a public portfolio at a clean, memorable URL.",
|
|
240
|
+
features: ["Free claim", "Shareable creator page", "Public portfolio"],
|
|
241
|
+
example: "medialane.io/creator/your-name \u2014 a portfolio at its own name",
|
|
242
242
|
icon: import_lucide_react.AtSign,
|
|
243
243
|
status: "live",
|
|
244
244
|
group: "claims"
|
|
@@ -246,12 +246,12 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
246
246
|
{
|
|
247
247
|
key: "claim-collection",
|
|
248
248
|
cta: "Claim",
|
|
249
|
-
blurb: "Made a collection somewhere else? Bring it to
|
|
249
|
+
blurb: "Made a collection somewhere else? Bring it to a profile.",
|
|
250
250
|
title: "Claim Collection",
|
|
251
|
-
subtitle: "Bring
|
|
252
|
-
description: "Claim a collection
|
|
253
|
-
features: ["Bring an existing collection", "Linked to
|
|
254
|
-
example: "A collection
|
|
251
|
+
subtitle: "Bring an already made collection",
|
|
252
|
+
description: "Claim a collection made elsewhere to link it to a profile and give it a branded collection page.",
|
|
253
|
+
features: ["Bring an existing collection", "Linked to a profile", "Branded collection page"],
|
|
254
|
+
example: "A collection made elsewhere joins a profile",
|
|
255
255
|
icon: import_lucide_react.FolderInput,
|
|
256
256
|
status: "live",
|
|
257
257
|
group: "claims"
|
|
@@ -260,10 +260,10 @@ const LAUNCHPAD_SERVICE_DEFINITIONS = [
|
|
|
260
260
|
const COLLECTION_NAME_CLAIM = {
|
|
261
261
|
key: "claim-collection-name",
|
|
262
262
|
cta: "Claim",
|
|
263
|
-
blurb: "Give
|
|
263
|
+
blurb: "Give a collection a clean, memorable web address of its own.",
|
|
264
264
|
title: "Claim Collection Name",
|
|
265
|
-
subtitle: "Reserve
|
|
266
|
-
description: "Claim a custom name for
|
|
265
|
+
subtitle: "Reserve a collection page URL",
|
|
266
|
+
description: "Claim a custom name for a collection page and get a clean, shareable URL instead of a long technical address.",
|
|
267
267
|
features: ["Free claim", "Clean shareable URL", "Easy to remember and share"],
|
|
268
268
|
example: "medialane.io/collection/your-collection",
|
|
269
269
|
icon: import_lucide_react.Link2,
|