@medialane/ui 0.126.2 → 0.126.4
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/README.md +86 -62
- package/dist/components/asset-marketplace-panel.cjs +2 -2
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.js +2 -2
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/email-verification-gate.cjs +21 -13
- package/dist/components/email-verification-gate.cjs.map +1 -1
- package/dist/components/email-verification-gate.d.cts +1 -4
- package/dist/components/email-verification-gate.d.ts +1 -4
- package/dist/components/email-verification-gate.js +22 -14
- package/dist/components/email-verification-gate.js.map +1 -1
- package/dist/utils/ipfs.cjs +7 -2
- package/dist/utils/ipfs.cjs.map +1 -1
- package/dist/utils/ipfs.js +7 -2
- package/dist/utils/ipfs.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @medialane/ui
|
|
2
2
|
|
|
3
|
-
Shared UI component library for Medialane apps. Used by `medialane-starknet`, `medialane-io`, and `
|
|
3
|
+
Shared UI component library for Medialane apps. Used by `medialane-starknet`, `medialane-io`, `medialane-portal`, and `media-wallet`.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@medialane/ui)
|
|
6
6
|
|
|
@@ -43,12 +43,28 @@ import "@medialane/ui/styles";
|
|
|
43
43
|
| `react` | >=18.0.0 |
|
|
44
44
|
| `react-dom` | >=18.0.0 |
|
|
45
45
|
| `next` | >=14.0.0 |
|
|
46
|
+
| `next-themes` | >=0.3.0 |
|
|
46
47
|
| `framer-motion` | >=10.0.0 |
|
|
47
48
|
| `lucide-react` | >=0.400.0 |
|
|
48
49
|
| `sonner` | >=1.0.0 |
|
|
49
50
|
| `tailwind-merge` | >=2.0.0 |
|
|
50
51
|
| `clsx` | >=2.0.0 |
|
|
51
|
-
|
|
|
52
|
+
| `class-variance-authority` | >=0.7.0 |
|
|
53
|
+
| `cmdk` | >=1.0.0 |
|
|
54
|
+
| `react-hook-form` | >=7.50.0 |
|
|
55
|
+
| `recharts` | >=2.0.0 |
|
|
56
|
+
| `swr` | >=2.0.0 |
|
|
57
|
+
| `@medialane/sdk` | >=0.73.0 |
|
|
58
|
+
| `@radix-ui/react-checkbox` | >=1.1.0 |
|
|
59
|
+
| `@radix-ui/react-collapsible` | >=1.1.0 |
|
|
60
|
+
| `@radix-ui/react-dialog` | >=1.1.0 |
|
|
61
|
+
| `@radix-ui/react-dropdown-menu` | >=2.1.0 |
|
|
62
|
+
| `@radix-ui/react-label` | >=2.1.0 |
|
|
63
|
+
| `@radix-ui/react-popover` | >=1.1.0 |
|
|
64
|
+
| `@radix-ui/react-select` | >=2.1.0 |
|
|
65
|
+
| `@radix-ui/react-slot` | >=1.1.0 |
|
|
66
|
+
| `@radix-ui/react-switch` | >=1.1.0 |
|
|
67
|
+
| `@radix-ui/react-tabs` | >=1.1.0 |
|
|
52
68
|
|
|
53
69
|
---
|
|
54
70
|
|
|
@@ -64,13 +80,13 @@ import { cn, formatDisplayPrice, shortenAddress, ipfsToHttp, timeAgo } from "@me
|
|
|
64
80
|
|---|---|
|
|
65
81
|
| `cn(...classes)` | clsx + tailwind-merge class combiner |
|
|
66
82
|
| `formatDisplayPrice(price)` | Format price string for display |
|
|
67
|
-
| `shortenAddress(addr)` | Truncate 0x address
|
|
68
|
-
| `ipfsToHttp(uri)` | Convert `ipfs://`
|
|
69
|
-
| `timeAgo(timestamp)` | Relative time string
|
|
83
|
+
| `shortenAddress(addr)` | Truncate 0x address to `0x1234…abcd` |
|
|
84
|
+
| `ipfsToHttp(uri)` | Convert `ipfs://` URIs (and known IPFS gateway URLs) to the app's own `/api/ipfs/` proxy path |
|
|
85
|
+
| `timeAgo(timestamp)` | Relative time string, e.g. "3 hours ago" |
|
|
70
86
|
|
|
71
87
|
---
|
|
72
88
|
|
|
73
|
-
### Data (server-safe
|
|
89
|
+
### Data (server-safe: no React, works directly in Server Components)
|
|
74
90
|
|
|
75
91
|
```ts
|
|
76
92
|
import { IP_TYPE_DATA, IP_TYPE_DATA_MAP, BRAND, ACTIVITY_TYPE_CONFIG, TYPE_FILTERS, LAUNCHPAD_SERVICE_DEFINITIONS } from "@medialane/ui";
|
|
@@ -87,7 +103,7 @@ import { IP_TYPE_DATA, IP_TYPE_DATA_MAP, BRAND, ACTIVITY_TYPE_CONFIG, TYPE_FILTE
|
|
|
87
103
|
|
|
88
104
|
---
|
|
89
105
|
|
|
90
|
-
### v0.1
|
|
106
|
+
### v0.1: Base Components
|
|
91
107
|
|
|
92
108
|
```ts
|
|
93
109
|
import { CurrencyIcon, CurrencyAmount, IpTypeBadge, AddressDisplay, MedialaneIcon, MedialaneLogoFull } from "@medialane/ui";
|
|
@@ -104,7 +120,7 @@ import { CurrencyIcon, CurrencyAmount, IpTypeBadge, AddressDisplay, MedialaneIco
|
|
|
104
120
|
|
|
105
121
|
---
|
|
106
122
|
|
|
107
|
-
### v0.2
|
|
123
|
+
### v0.2: Motion + Cards
|
|
108
124
|
|
|
109
125
|
```ts
|
|
110
126
|
import {
|
|
@@ -125,12 +141,12 @@ import {
|
|
|
125
141
|
| `<ShareButton>` | Native share API with clipboard fallback |
|
|
126
142
|
| `<CollectionCard collection={c} />` | Collection grid card with image, name, stats |
|
|
127
143
|
| `<CollectionCardSkeleton />` | Loading skeleton for CollectionCard |
|
|
128
|
-
| `<TokenCard token={t} />` | Unified NFT/token card
|
|
144
|
+
| `<TokenCard token={t} />` | Unified NFT/token card, used on marketplace, portfolio, collections |
|
|
129
145
|
| `<TokenCardSkeleton />` | Loading skeleton for TokenCard |
|
|
130
146
|
|
|
131
147
|
---
|
|
132
148
|
|
|
133
|
-
### v0.3
|
|
149
|
+
### v0.3: Activity + Launchpad + Marketplace
|
|
134
150
|
|
|
135
151
|
```ts
|
|
136
152
|
import {
|
|
@@ -153,7 +169,7 @@ import {
|
|
|
153
169
|
|
|
154
170
|
---
|
|
155
171
|
|
|
156
|
-
### v0.3.2
|
|
172
|
+
### v0.3.2: Discover Components
|
|
157
173
|
|
|
158
174
|
```ts
|
|
159
175
|
import {
|
|
@@ -181,8 +197,8 @@ import { LaunchpadGroupedSections, LaunchpadStrip, LAUNCHPAD_SERVICE_DEFINITIONS
|
|
|
181
197
|
|
|
182
198
|
| Export | Description |
|
|
183
199
|
|---|---|
|
|
184
|
-
| `<LaunchpadGroupedSections overrides={...} />` | The full grouped launchpad page UI
|
|
185
|
-
| `<LaunchpadStrip hrefs={...} />` | Homepage launchpad carousel
|
|
200
|
+
| `<LaunchpadGroupedSections overrides={...} />` | The full grouped launchpad page UI; apps inject only hrefs / per-app rollout flips |
|
|
201
|
+
| `<LaunchpadStrip hrefs={...} />` | Homepage launchpad carousel; cards derive from the shared service definitions |
|
|
186
202
|
| `LAUNCHPAD_SERVICE_DEFINITIONS` / `SERVICE_HUES` | Canonical service copy (titles, blurbs, examples) + one unique hue per service |
|
|
187
203
|
|
|
188
204
|
### Asset page modules (v0.13+)
|
|
@@ -191,7 +207,7 @@ import { LaunchpadGroupedSections, LaunchpadStrip, LAUNCHPAD_SERVICE_DEFINITIONS
|
|
|
191
207
|
import { AssetOverviewContent, AssetMarketsTab, AssetMediaColumn, AssetHeaderBlock, ParentAttributionBanner, IPTypeDisplay } from "@medialane/ui";
|
|
192
208
|
```
|
|
193
209
|
|
|
194
|
-
Shared presentation modules for the asset detail pages
|
|
210
|
+
Shared presentation modules for the asset detail pages; both apps re-export
|
|
195
211
|
them as shims at their original paths and inject wallet hooks/dialogs locally.
|
|
196
212
|
|
|
197
213
|
### IP data layer (v0.13+)
|
|
@@ -203,16 +219,17 @@ import { IP_TYPES, LICENSE_TYPES, IP_TEMPLATES, DOC_UPLOAD, TEMPLATE_TRAIT_TYPES
|
|
|
203
219
|
Canonical IP types, license presets, and per-type templates (embeds, socials,
|
|
204
220
|
trait suggestions, and the `docUpload` config powering the document/PDF-to-IPFS
|
|
205
221
|
upload on Documents / Patents / Publications / Software). The apps' `types/ip`
|
|
206
|
-
and `lib/ip-templates` are re-export shims of this layer
|
|
222
|
+
and `lib/ip-templates` are re-export shims of this layer; edit here, and the
|
|
223
|
+
shims pick it up automatically.
|
|
207
224
|
|
|
208
225
|
---
|
|
209
226
|
|
|
210
227
|
## Deep imports (v0.90.1+)
|
|
211
228
|
|
|
212
|
-
The bare `import { X } from "@medialane/ui"` barrel
|
|
213
|
-
supported way to use this package
|
|
214
|
-
|
|
215
|
-
|
|
229
|
+
The bare `import { X } from "@medialane/ui"` barrel stays the primary,
|
|
230
|
+
supported way to use this package. The package also builds one file per
|
|
231
|
+
component (`tsup`'s `bundle: false`), so each component is reachable
|
|
232
|
+
directly too:
|
|
216
233
|
|
|
217
234
|
```ts
|
|
218
235
|
import { CurrencyIcon } from "@medialane/ui/currency-icon";
|
|
@@ -220,33 +237,32 @@ import { cn } from "@medialane/ui/utils/cn";
|
|
|
220
237
|
import { IP_TYPE_DATA } from "@medialane/ui/data/ip-types";
|
|
221
238
|
```
|
|
222
239
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
isn't available.
|
|
240
|
+
In a Next.js app, adding `experimental.optimizePackageImports: ["@medialane/ui"]`
|
|
241
|
+
to `next.config` gets the same result automatically: Next rewrites barrel
|
|
242
|
+
imports to per-component imports at build time, confirmed to cut a route's
|
|
243
|
+
First Load JS by ~50% in media-wallet with zero import changes in app code
|
|
244
|
+
(see `medialane-core/docs/superpowers/plans/2026-08-03-medialane-ui-subpath-exports.md`).
|
|
245
|
+
The deep-import subpaths are there directly for non-Next consumers, or
|
|
246
|
+
anywhere that flag is unavailable.
|
|
231
247
|
|
|
232
248
|
---
|
|
233
249
|
|
|
234
250
|
## Safe-area utilities
|
|
235
251
|
|
|
236
|
-
`.pb-safe` / `.pt-safe`
|
|
252
|
+
`.pb-safe` / `.pt-safe` add padding using `env(safe-area-inset-*)`, for
|
|
237
253
|
anything pinned to the viewport edge (bottom sheets, fixed tab bars) on
|
|
238
254
|
notched/home-indicator devices. Used internally by `NavCommandMenu`/
|
|
239
255
|
`NavAccountSheet`; apply the same classes to any app-level fixed bottom
|
|
240
256
|
bar (e.g. a mobile tab bar) for the same treatment.
|
|
241
257
|
|
|
242
258
|
**Composing with an existing base padding:** these classes are purely
|
|
243
|
-
additive (`0px` on a non-notched device)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
`
|
|
249
|
-
|
|
259
|
+
additive (`0px` on a non-notched device), on top of whatever padding an
|
|
260
|
+
element already carries. Since Tailwind resolves two padding-bottom classes
|
|
261
|
+
by letting the later one in source order win rather than merging them, an
|
|
262
|
+
element with its own bottom padding should combine both into one arbitrary
|
|
263
|
+
value: `pb-[calc(1rem+env(safe-area-inset-bottom))]`. `NavCommandMenu`/
|
|
264
|
+
`NavAccountSheet` use this composed form, since they already carry a `pb-4`
|
|
265
|
+
baseline.
|
|
250
266
|
|
|
251
267
|
---
|
|
252
268
|
|
|
@@ -264,7 +280,13 @@ cd medialane-ui
|
|
|
264
280
|
# Watch mode during development
|
|
265
281
|
~/.bun/bin/bun run dev
|
|
266
282
|
|
|
267
|
-
# Publish to npm
|
|
283
|
+
# Publish to npm: bump package.json version first.
|
|
284
|
+
# If `npm` is on PATH, use it directly. Otherwise use bun with a
|
|
285
|
+
# project-local .npmrc, which carries auth through to `bun publish`
|
|
286
|
+
# (NPM_CONFIG_USERCONFIG alone does not):
|
|
287
|
+
# echo "//registry.npmjs.org/:_authToken=<token>" > .npmrc
|
|
288
|
+
# NPM_CONFIG_USERCONFIG=$(pwd)/.npmrc bun publish
|
|
289
|
+
# .npmrc is gitignored; remove it after publishing if it holds a live token.
|
|
268
290
|
npm publish
|
|
269
291
|
```
|
|
270
292
|
|
|
@@ -276,57 +298,59 @@ The package uses [tsup](https://tsup.egoist.dev/) and outputs ESM + CJS + type d
|
|
|
276
298
|
|
|
277
299
|
| Version | Added |
|
|
278
300
|
|---|---|
|
|
279
|
-
| **v0.
|
|
280
|
-
| **v0.
|
|
281
|
-
| **v0.
|
|
282
|
-
| **v0.
|
|
283
|
-
| **v0.
|
|
301
|
+
| **v0.126.3** | `ipfsToHttp` now also recognizes known IPFS gateway hosts (`*.mypinata.cloud`, `gateway.pinata.cloud`, `ipfs.io`, `dweb.link`, `cloudflare-ipfs.com`, `nftstorage.link`, `w3s.link`) in an absolute `https://` URI and routes them through the app's own `/api/ipfs/` proxy, same as `ipfs://`. Extends the gateway-recognition that `ipfs://` already had to these hosts too. |
|
|
302
|
+
| **v0.91.0-v0.126.2** | *Not individually documented, see `git log`* |
|
|
303
|
+
| **v0.90.1** | Wildcard subpath exports (`./*` → components, `./utils/*`, `./data/*`), additive; the barrel import stays unchanged. See "Deep imports" above |
|
|
304
|
+
| **v0.88.0-v0.90.0** | *Not individually documented, see `git log`* |
|
|
305
|
+
| **v0.87.0** | `NavWalletTrigger` gains optional `disconnectedIcon`, overriding the default `Wallet` glyph in the disconnected-state ring, for apps whose real connect entry point is something else (e.g. a Google mark for an email/social-login app). Omitting it keeps the `Wallet` default |
|
|
306
|
+
| **v0.86.0** | `NavWalletTrigger`'s disconnected state shows a plain `Wallet` glyph inside the rotating ring, making the ring itself easier to notice as a connect entry point. Connected state unchanged |
|
|
307
|
+
| **v0.85.0** | `NavCommandMenu` gains two optional props: `showKeyboardHints` (default `true`; set `false` to hide the "↑↓ Navigate / ↵ Open" footer hint) and `brandSlot` (replace the static "medialane ⌘K" footer brandmark entirely, e.g. with a "Connect" button). Both default to the prior, non-breaking behavior |
|
|
284
308
|
| **v0.84.0** | gol_starknet living-render support: `useIntersectionActive` + `AnimatedTokenMedia` swap a token's static image for a sandboxed iframe of its on-chain `animation_url` once visible, wired into `TokenCard`/`AssetCard`; SDK peer floor `>=0.73.0`. **Also replaces `AssetMediaColumn`** with the borderless/real-aspect-ratio/click-to-zoom design both apps had already forked locally |
|
|
285
|
-
| **v0.83.0** | `NavWalletTrigger` gains optional `iconSrc
|
|
286
|
-
| **v0.82.x** | *Not individually documented
|
|
287
|
-
| **v0.81.0** | `NavAccountSheet` redesigned to match `NavCommandMenu`'s glass-panel treatment. **Breaking:** dropped the `title` prop
|
|
309
|
+
| **v0.83.0** | `NavWalletTrigger` gains optional `iconSrc`, rendering the connected wallet's own icon in place of a generic glyph when set; omitting it keeps the prior behavior |
|
|
310
|
+
| **v0.82.x** | *Not individually documented, see `git log`* |
|
|
311
|
+
| **v0.81.0** | `NavAccountSheet` redesigned to match `NavCommandMenu`'s glass-panel treatment. **Breaking:** dropped the `title` prop; content is now 100% `children`-driven. `NavWalletTrigger` resized `h-11 w-11` → `h-8 w-8`; connected-state ring stays at full opacity |
|
|
288
312
|
| **v0.80.1** | `NavWalletTrigger` is now `React.forwardRef` (needed for `SheetTrigger asChild`); no visual change |
|
|
289
|
-
| **v0.80.0** | `NavWalletTrigger` added to `nav-shell.tsx
|
|
313
|
+
| **v0.80.0** | `NavWalletTrigger` added to `nav-shell.tsx`: spinning brand-gradient ring while disconnected, static low-opacity ring + `User` glyph once connected, both drawn from real wallet state |
|
|
290
314
|
| **v0.79.2** | `AssetMarketplacePanel`: "List on Marketplace" hidden next to "Cancel Listing" for single-instance (ERC-721) assets; ERC-1155 owners still see both |
|
|
291
|
-
| **v0.79.1** | Export-only fix
|
|
292
|
-
| **v0.79.0** | `LicenseTermsBuilder`: licensing subpanel wrapper removed, fields flow in the main form. **Breaking:** `SponsorshipTerms.durationDays: string` → `durationValue` + `durationUnit` (new `DURATION_UNITS`); new `toDurationDays(terms)` export. Territory is free text
|
|
315
|
+
| **v0.79.1** | Export-only fix: `toDurationDays`/`DURATION_UNITS`/`DurationUnit` (shipped in 0.79.0) now re-exported from `src/index.ts` |
|
|
316
|
+
| **v0.79.0** | `LicenseTermsBuilder`: licensing subpanel wrapper removed, fields flow in the main form. **Breaking:** `SponsorshipTerms.durationDays: string` → `durationValue` + `durationUnit` (new `DURATION_UNITS`); new `toDurationDays(terms)` export. Territory is now free text |
|
|
293
317
|
| **v0.78.2** | `LicenseTermsBuilder`: removed "Resale royalty (%)" from the UI; licensing panel no longer collapsible; "License length (days)" has no default |
|
|
294
|
-
| **v0.78.1** | `LicenseTermsBuilder` currency-picker layout fix
|
|
318
|
+
| **v0.78.1** | `LicenseTermsBuilder` currency-picker layout fix, now stacked rows; collapsed trigger shows a live summary |
|
|
295
319
|
| **v0.78.0** | `LicenseTermsBuilder` rebuilt: icon-enhanced currency picker, collapsible panel (License Type presets, Territory, AI Policy, Scope, Deliverables, Exclusivity, media multi-select); new `toLicenseMetadata` export. `SponsorshipTerms` gains matching fields |
|
|
296
320
|
| **v0.77.0** | `AssetSearchPicker` (server-searched asset picker for the IP Sponsorship "propose to sponsor" flow). `AssetMarketplacePanel` gains `showSponsorOption`/`onOpenSponsorProposal` + `showSponsorSolicitOption`/`onOpenSponsorSolicit`. `derivePortfolioCounts` gains `sponsorshipPendingCount` → `PortfolioCounts.sponsorships` |
|
|
297
321
|
| **v0.76.0** | `CollectionFilters` shared logic lifted from both apps' near-identical local copies: `useCollectionFilters`, `CollectionFiltersTrigger`, `CollectionFiltersBody`, `SORT_OPTIONS`/`TraitSection` |
|
|
298
322
|
| **v0.75.0** | `TokenCard` replaced with the real implementation (dropdown menu, price chip, indexing badge) both apps had forked locally; hrefs computed via the SDK's `assetHref`/`collectionHref` using `token.chain`. New dep `@radix-ui/react-dropdown-menu`. SDK peer floor `>=0.72.0`. `RarityTier` and several unused props removed |
|
|
299
323
|
| **v0.74.2** | SDK peer floor `>=0.6.0` → `>=0.71.0` (no component code changed) |
|
|
300
|
-
| **v0.74.1** | Creator's Fund family: `CreatorAirdropBanner` lifted into the package; `CommunityRewardsSection` redesigned to brand tokens, borderless panels. (**v0.74.0 is deprecated on npm
|
|
324
|
+
| **v0.74.1** | Creator's Fund family: `CreatorAirdropBanner` lifted into the package; `CommunityRewardsSection` redesigned to brand tokens, borderless panels. (**v0.74.0 is deprecated on npm**, published from an incomplete checkout; use v0.74.1) |
|
|
301
325
|
| **v0.73.6** | `AssetMarketplacePanel` cancel-listing button label: "Cancel" → "Cancel Listing" |
|
|
302
|
-
| **v0.73.5** | `MedialaneCollectionCard` follows the app's light/dark theme
|
|
326
|
+
| **v0.73.5** | `MedialaneCollectionCard` now follows the app's light/dark theme |
|
|
303
327
|
| **v0.73.4** | `NavBrandButton` left padding 6px → 10px |
|
|
304
328
|
| **v0.73.3** | Launchpad cards: resting hairline in each group's accent hue (was hover-only); gradient ring fades in on hover-capable devices |
|
|
305
329
|
| **v0.73.2** | Launchpad copy: "Single Editions" → "Single Edition NFTs"; "NFTs" group pill → "Originals" |
|
|
306
330
|
| **v0.73.1** | IP Club launchpad card copy rewritten to the membership-tiers model |
|
|
307
331
|
| **v0.73.0** | `AssetPicker` + `LicenseTermsBuilder` (initial versions), for the IP Sponsorship v3 create/accept forms |
|
|
308
332
|
| **v0.67.0–0.72.0** | *Not individually documented.* Only v0.72.0 is known: display face set to semibold, filter bar drops the services count |
|
|
309
|
-
| **v0.66.0** | Launchpad redesign
|
|
333
|
+
| **v0.66.0** | Launchpad redesign: one card per service, one dynamic grid (`mint-ip-asset`+`create-collection` → `nfts`, `ip-collection-1155`+`mint-editions` → `limited-editions`); `LaunchpadGroupedSections` renders a single grid keyed by `GROUP_ACCENTS`; all service copy rewritten to plain language |
|
|
310
334
|
| **v0.65.1** | IP Tickets copy rewritten to event vocabulary (kept verbatim through v0.66.0) |
|
|
311
|
-
| **v0.65.0** | `ServiceFormShell` form compartment removed
|
|
312
|
-
| **v0.64.1** | `ActivityTicker` hover-zoom removed
|
|
335
|
+
| **v0.65.0** | `ServiceFormShell` form compartment removed; forms render directly on the page |
|
|
336
|
+
| **v0.64.1** | `ActivityTicker` hover-zoom removed, keeping effects mobile-first and touch-friendly |
|
|
313
337
|
| **v0.64.0** | `NavBrandButton.onClick` defaults to opening the nav command menu; dead `MedialaneIcon` removed from the package |
|
|
314
338
|
| **v0.63.2** | Header triggers borderless (`NavBrandButton`/`NavIconButton`) |
|
|
315
|
-
| **v0.63.1 / v0.62.0** | Nav shell redesign: `NavCommandMenu` restyled (620px glass panel, icon-chip rows, optional `description`, localStorage "Recent" group, keycap footer hints, mobile bottom-sheet). New `nav-shell.tsx`: `NavBrandButton`, `NavIconButton`, `NavAccountSheet`/`useNavAccountSheet` (exported
|
|
316
|
-
| **v0.61.0** | Typography restraint
|
|
339
|
+
| **v0.63.1 / v0.62.0** | Nav shell redesign: `NavCommandMenu` restyled (620px glass panel, icon-chip rows, optional `description`, localStorage "Recent" group, keycap footer hints, mobile bottom-sheet). New `nav-shell.tsx`: `NavBrandButton`, `NavIconButton`, `NavAccountSheet`/`useNavAccountSheet` (exported, ready for either app to mount) |
|
|
340
|
+
| **v0.61.0** | Typography restraint: Urbanist display face scoped to h1 (previously h1-h3); rewards chip simplified to a plain pill; `PortfolioOverview` stats → compact pill row |
|
|
317
341
|
| **v0.60.0** | `PortfolioHeader` drops stat chips, rewards chip becomes a journey badge (`levelName`+`totalXp`, no numeric level); `PortfolioOverview` gains `quickActions` |
|
|
318
342
|
| **v0.59.0** | Portfolio shell redesign: `PortfolioNav` (two-level nav), `PortfolioHeader` (compact block), `PortfolioOverview` (landing page). `PortfolioSubnav` removed |
|
|
319
343
|
| **v0.58.0** | `ListingCard` gains optional `imageUrl` override prop |
|
|
320
|
-
| **v0.57.2** | `AssetCard` redesigned
|
|
344
|
+
| **v0.57.2** | `AssetCard` redesigned: inset 4:5 gallery artwork, display-face title, price as a glass pill |
|
|
321
345
|
| **v0.56.0** | `CoinLaunchPreview` lifted from the apps and redesigned to brand tokens |
|
|
322
|
-
| **v0.55.1** | `MedialaneCollectionCard
|
|
346
|
+
| **v0.55.1** | `MedialaneCollectionCard`: branded collectors-card preview (3D tilt, holographic sheen, serial pill) |
|
|
323
347
|
| **v0.53.1** | Borderless launchpad panels (`ServiceFormShell`, `ClaimRail`); Geist Mono removed everywhere in favor of `tabular-nums`; new `font-display` preset token |
|
|
324
|
-
| **v0.29.0
|
|
325
|
-
| **v0.28.0** | `StepNav` (presentation-only step indicator
|
|
326
|
-
| **v0.27.0** | `ServiceHeader` gains a `plain` variant (neutral border
|
|
348
|
+
| **v0.29.0-0.52.x** | *Not individually documented; changelog notes for this range didn't survive in `CLAUDE.md`.* Component-inventory milestone recorded at v0.50.1 (78 components) |
|
|
349
|
+
| **v0.28.0** | `StepNav` (presentation-only step indicator: solid active dot, outlined check for done, filling connector, accent-themed). `ServiceFormShell` gains an `aboveForm` slot (left column, between header and form, e.g. a stepper) and a **sticky right rail** on desktop. Lets the Creator Coin page adopt the standard form layout |
|
|
350
|
+
| **v0.27.0** | `ServiceHeader` gains a `plain` variant (neutral border); `ServiceFormShell` renders the header `plain` so create/mint form pages carry the gradient border on the form itself. Standalone headers (browse pages, coin page, `/claim` hub) keep the gradient |
|
|
327
351
|
| **v0.26.0** | `LaunchpadServiceCard` "living color cards" high-fidelity pass: per-hue aurora light-leaks, gradient icon tile, hairline gradient frame that ignites on interaction, staggered entrance reveal, press/hover microinteractions, animated CTA arrow; roomier grid gaps + section rhythm. Touch-first, reduced-motion safe |
|
|
328
|
-
| **v0.25.0** | `CoinsExplorer`/`CoinCard` refined: kind label over the artwork
|
|
329
|
-
| **v0.24.0** | Art-forward `CoinCard` redesign
|
|
352
|
+
| **v0.25.0** | `CoinsExplorer`/`CoinCard` refined: kind label over the artwork in brand hues, quote-currency icon on price, marketplace-style Filters dialog; simplified by dropping the Verified badge / FDV / holders / per-card glow / Trade button |
|
|
353
|
+
| **v0.24.0** | Art-forward `CoinCard` redesign, making the coin's cover artwork the hero of the tile |
|
|
330
354
|
| **v0.14.0** | `docUpload` template config + `DOC_UPLOAD` (document/PDF → IPFS for Documents/Patents/Publications/Software), `IPTypeDisplay` document card |
|
|
331
355
|
| **v0.13.x** | Asset-page modules lifted: `AssetOverviewContent`, `AssetMarketsTab`, `AssetMediaColumn`/`AssetHeaderBlock`, `ParentAttributionBanner`, `IPTypeDisplay`; IP data layer (`data/ip`, `data/ip-templates`); `timeUntil` |
|
|
332
356
|
| **v0.12.x** | `LaunchpadStrip` (homepage carousel from service defs); Discover strips restyled to the approved design; `CollectionCard` gated-content border + currency floor |
|
|
@@ -114,7 +114,7 @@ function AssetMarketplacePanel({
|
|
|
114
114
|
children: "Cancel Listing"
|
|
115
115
|
}
|
|
116
116
|
) : null,
|
|
117
|
-
!myListing || isERC1155 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_email_verification_gate.EmailVerificationGate, {
|
|
117
|
+
!myListing || isERC1155 ? listingRequiresEmailVerification ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_email_verification_gate.EmailVerificationGate, { reason: "list assets for sale", settingsHref }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { big: true, tone: "blue", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Tag, { className: "h-4 w-4" }), onClick: onOpenListing, renderHelp, children: "List on Marketplace" }) : null,
|
|
118
118
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { big: true, tone: "orange", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRightLeft, { className: "h-4 w-4" }), onClick: onOpenTransfer, renderHelp, children: "Transfer" }),
|
|
119
119
|
remixEnabled && onOpenRemix ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
120
|
import_action_button.ActionButton,
|
|
@@ -194,7 +194,7 @@ function AssetMarketplacePanel({
|
|
|
194
194
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
|
|
195
195
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
196
196
|
isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
197
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_email_verification_gate.EmailVerificationGate, {
|
|
197
|
+
listingRequiresEmailVerification ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_email_verification_gate.EmailVerificationGate, { reason: "list assets for sale", settingsHref }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { big: true, tone: "blue", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Tag, { className: "h-4 w-4" }), onClick: onOpenListing, renderHelp, children: "List on Marketplace" }),
|
|
198
198
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { big: true, tone: "orange", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRightLeft, { className: "h-4 w-4" }), onClick: onOpenTransfer, renderHelp, children: "Transfer" }),
|
|
199
199
|
remixEnabled && onOpenRemix ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
200
200
|
import_action_button.ActionButton,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n ShoppingCart, 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 { DualPrice } from \"./dual-price.js\";\nimport { EmailVerificationGate } from \"./email-verification-gate.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.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 cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n renderAuthAction: (label: string) => ReactNode;\n\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n\n listingRequiresEmailVerification?: boolean;\n settingsHref?: string;\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\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\n listingRequiresEmailVerification = false,\n settingsHref = \"/settings\",\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <DualPrice\n amountFormatted={cheapest.price.formatted}\n currency={cheapest.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n\n {(!myListing || isERC1155) ? (\n <EmailVerificationGate required={listingRequiresEmailVerification} reason=\"list assets for sale\" settingsHref={settingsHref}>\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} disabled={listingRequiresEmailVerification} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n </EmailVerificationGate>\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <EmailVerificationGate required={listingRequiresEmailVerification} reason=\"list assets for sale\" settingsHref={settingsHref}>\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} disabled={listingRequiresEmailVerification} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n </EmailVerificationGate>\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqEQ;AAlER,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,2BAA6B;AAC7B,wBAA0B;AAC1B,qCAAsC;AACtC,oBAAsD;AACtD,kBAA0B;AAiD1B,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,QAAM,QAAQ,oBAAgB,iCAAk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c,KAAK;AAAA,UAElC;AAAA,wDAAC,yBAAE,WAAU,eAAc;AAAA,YAAE;AAAA;AAAA;AAAA,MAE/B;AAAA,OACF,IACE;AAAA,IAEH,WAAW,WAAW,SAAS,IAC9B,6CAAC,SAAI,WAAU,uCACb;AAAA,mDAAC,OAAE,WAAU,+CAA8C;AAAA;AAAA,QACvC,WAAW;AAAA,QAAO;AAAA,SACtC;AAAA,MACA,4CAAC,SAAI,WAAU,aACZ,qBAAW,IAAI,CAAC,QACf,6CAAC,SAAwB,WAAU,4EACjC;AAAA,qDAAC,SAAI,WAAU,WACb;AAAA,sDAAC,OAAE,WAAU,qBACX,uDAAC,UAAK,WAAU,oCACb;AAAA,kDAAmB,IAAI,MAAM,SAAS;AAAA,YACvC,4CAAC,qCAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,aAC5D,GACF;AAAA,UACA,6CAAC,SAAI,WAAU,kCACb;AAAA,wDAAC,yCAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,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,KACN,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n ShoppingCart, 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 { DualPrice } from \"./dual-price.js\";\nimport { EmailVerificationGate } from \"./email-verification-gate.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.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 cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n renderAuthAction: (label: string) => ReactNode;\n\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n\n listingRequiresEmailVerification?: boolean;\n settingsHref?: string;\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\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\n listingRequiresEmailVerification = false,\n settingsHref = \"/settings\",\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <DualPrice\n amountFormatted={cheapest.price.formatted}\n currency={cheapest.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n\n {(!myListing || isERC1155) ? (\n listingRequiresEmailVerification ? (\n <EmailVerificationGate reason=\"list assets for sale\" settingsHref={settingsHref} />\n ) : (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n )\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n {listingRequiresEmailVerification ? (\n <EmailVerificationGate reason=\"list assets for sale\" settingsHref={settingsHref} />\n ) : (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n )}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqEQ;AAlER,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,2BAA6B;AAC7B,wBAA0B;AAC1B,qCAAsC;AACtC,oBAAsD;AACtD,kBAA0B;AAiD1B,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;AAEO,SAAS,sBAA6D;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB;AAAA,EACA,2BAA2B;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AA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AAA,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,KACN,GACF;AAEJ;","names":[]}
|
|
@@ -102,7 +102,7 @@ function AssetMarketplacePanel({
|
|
|
102
102
|
children: "Cancel Listing"
|
|
103
103
|
}
|
|
104
104
|
) : null,
|
|
105
|
-
!myListing || isERC1155 ? /* @__PURE__ */ jsx(EmailVerificationGate, {
|
|
105
|
+
!myListing || isERC1155 ? listingRequiresEmailVerification ? /* @__PURE__ */ jsx(EmailVerificationGate, { reason: "list assets for sale", settingsHref }) : /* @__PURE__ */ jsx(ActionButton, { big: true, tone: "blue", icon: /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4" }), onClick: onOpenListing, renderHelp, children: "List on Marketplace" }) : null,
|
|
106
106
|
/* @__PURE__ */ jsx(ActionButton, { big: true, tone: "orange", icon: /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-4 w-4" }), onClick: onOpenTransfer, renderHelp, children: "Transfer" }),
|
|
107
107
|
remixEnabled && onOpenRemix ? /* @__PURE__ */ jsx(
|
|
108
108
|
ActionButton,
|
|
@@ -182,7 +182,7 @@ function AssetMarketplacePanel({
|
|
|
182
182
|
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
183
183
|
/* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
184
184
|
isOwner ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
185
|
-
/* @__PURE__ */ jsx(EmailVerificationGate, {
|
|
185
|
+
listingRequiresEmailVerification ? /* @__PURE__ */ jsx(EmailVerificationGate, { reason: "list assets for sale", settingsHref }) : /* @__PURE__ */ jsx(ActionButton, { big: true, tone: "blue", icon: /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4" }), onClick: onOpenListing, renderHelp, children: "List on Marketplace" }),
|
|
186
186
|
/* @__PURE__ */ jsx(ActionButton, { big: true, tone: "orange", icon: /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-4 w-4" }), onClick: onOpenTransfer, renderHelp, children: "Transfer" }),
|
|
187
187
|
remixEnabled && onOpenRemix ? /* @__PURE__ */ jsx(
|
|
188
188
|
ActionButton,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n ShoppingCart, 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 { DualPrice } from \"./dual-price.js\";\nimport { EmailVerificationGate } from \"./email-verification-gate.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.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 cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n renderAuthAction: (label: string) => ReactNode;\n\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n\n listingRequiresEmailVerification?: boolean;\n settingsHref?: string;\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\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\n listingRequiresEmailVerification = false,\n settingsHref = \"/settings\",\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <DualPrice\n amountFormatted={cheapest.price.formatted}\n currency={cheapest.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n\n {(!myListing || isERC1155) ? (\n <EmailVerificationGate required={listingRequiresEmailVerification} reason=\"list assets for sale\" settingsHref={settingsHref}>\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} disabled={listingRequiresEmailVerification} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n </EmailVerificationGate>\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <EmailVerificationGate required={listingRequiresEmailVerification} reason=\"list assets for sale\" settingsHref={settingsHref}>\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} disabled={listingRequiresEmailVerification} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n </EmailVerificationGate>\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";AAqEQ,SA8HU,UA7HR,KADF;AAlER;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACrE;AAAA,EAAc;AAAA,EAAK;AAAA,OACd;AACP,SAAS,cAAc,sBAAsB;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,6BAA6B;AACtC,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,iBAAiB;AAiD1B,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,QAAM,QAAQ,gBAAgB,kBAAkB,aAAa,IAAI;AACjE,QAAM,WAAW,cAAc,kBAAkB,WAAW,IAAI;AAChE,MAAI,CAAC,OAAO,UAAU,CAAC,UAAU,OAAQ,QAAO;A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qBAAC,SAAI,WAAU,uCACb;AAAA,2BAAC,OAAE,WAAU,+CAA8C;AAAA;AAAA,QACvC,WAAW;AAAA,QAAO;AAAA,SACtC;AAAA,MACA,oBAAC,SAAI,WAAU,aACZ,qBAAW,IAAI,CAAC,QACf,qBAAC,SAAwB,WAAU,4EACjC;AAAA,6BAAC,SAAI,WAAU,WACb;AAAA,8BAAC,OAAE,WAAU,qBACX,+BAAC,UAAK,WAAU,oCACb;AAAA,+BAAmB,IAAI,MAAM,SAAS;AAAA,YACvC,oBAAC,gBAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,aAC5D,GACF;AAAA,UACA,qBAAC,SAAI,WAAU,kCACb;AAAA,gCAAC,kBAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,YAC3G,oBAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,qBAAC,SAAI,WAAU,yDACb;AAAA,kCAAC,SAAM,WAAU,WAAU;AAAA,cAC1B,UAAU,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,kCAAC,eAAY,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,KACN,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n ShoppingCart, 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 { DualPrice } from \"./dual-price.js\";\nimport { EmailVerificationGate } from \"./email-verification-gate.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.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 cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n renderAuthAction: (label: string) => ReactNode;\n\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n\n listingRequiresEmailVerification?: boolean;\n settingsHref?: string;\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\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\n listingRequiresEmailVerification = false,\n settingsHref = \"/settings\",\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <DualPrice\n amountFormatted={cheapest.price.formatted}\n currency={cheapest.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n\n {(!myListing || isERC1155) ? (\n listingRequiresEmailVerification ? (\n <EmailVerificationGate reason=\"list assets for sale\" settingsHref={settingsHref} />\n ) : (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n )\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n {listingRequiresEmailVerification ? (\n <EmailVerificationGate reason=\"list assets for sale\" settingsHref={settingsHref} />\n ) : (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n )}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\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 renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\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AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,MAAM,YAAY,GAAG;AAAA,YAC9B,WAAU;AAAA,YAEV;AAAA,kCAAC,eAAY,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,KACN,GACF;AAEJ;","names":[]}
|
|
@@ -23,25 +23,33 @@ __export(email_verification_gate_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(email_verification_gate_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_lucide_react = require("lucide-react");
|
|
26
27
|
var import_cn = require("../utils/cn.js");
|
|
27
28
|
function EmailVerificationGate({
|
|
28
|
-
required,
|
|
29
29
|
reason,
|
|
30
30
|
settingsHref,
|
|
31
|
-
children,
|
|
32
31
|
className
|
|
33
32
|
}) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
34
|
+
"a",
|
|
35
|
+
{
|
|
36
|
+
href: settingsHref,
|
|
37
|
+
className: (0, import_cn.cn)(
|
|
38
|
+
"col-span-2 flex items-center gap-3 rounded-2xl bg-brand-orange/10 px-4 py-3 transition-colors hover:bg-brand-orange/15",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid h-9 w-9 shrink-0 place-items-center rounded-full bg-brand-orange/15", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Mail, { className: "h-4 w-4 text-brand-orange" }) }),
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm font-semibold", children: [
|
|
45
|
+
"Verify your email to ",
|
|
46
|
+
reason
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-muted-foreground", children: "Takes under a minute \u2014 go to Settings" })
|
|
49
|
+
] })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
45
53
|
}
|
|
46
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
55
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/email-verification-gate.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/components/email-verification-gate.tsx"],"sourcesContent":["\"use client\";\n\nimport { Mail } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface EmailVerificationGateProps {\n reason: string;\n settingsHref: string;\n className?: string;\n}\n\nexport function EmailVerificationGate({\n reason,\n settingsHref,\n className,\n}: EmailVerificationGateProps) {\n return (\n <a\n href={settingsHref}\n className={cn(\n \"col-span-2 flex items-center gap-3 rounded-2xl bg-brand-orange/10 px-4 py-3 transition-colors hover:bg-brand-orange/15\",\n className,\n )}\n >\n <div className=\"grid h-9 w-9 shrink-0 place-items-center rounded-full bg-brand-orange/15\">\n <Mail className=\"h-4 w-4 text-brand-orange\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-sm font-semibold\">Verify your email to {reason}</div>\n <div className=\"text-xs text-muted-foreground\">Takes under a minute — go to Settings</div>\n </div>\n </a>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBQ;AAvBR,0BAAqB;AACrB,gBAAmB;AAQZ,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AACF,GAA+B;AAC7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,eAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MAEA;AAAA,oDAAC,SAAI,WAAU,4EACb,sDAAC,4BAAK,WAAU,6BAA4B,GAC9C;AAAA,QACA,6CAAC,SAAI,WAAU,kBACb;AAAA,uDAAC,SAAI,WAAU,yBAAwB;AAAA;AAAA,YAAsB;AAAA,aAAO;AAAA,UACpE,4CAAC,SAAI,WAAU,iCAAgC,wDAAqC;AAAA,WACtF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
2
|
|
|
4
3
|
interface EmailVerificationGateProps {
|
|
5
|
-
required: boolean;
|
|
6
4
|
reason: string;
|
|
7
5
|
settingsHref: string;
|
|
8
|
-
children: ReactNode;
|
|
9
6
|
className?: string;
|
|
10
7
|
}
|
|
11
|
-
declare function EmailVerificationGate({
|
|
8
|
+
declare function EmailVerificationGate({ reason, settingsHref, className, }: EmailVerificationGateProps): react_jsx_runtime.JSX.Element;
|
|
12
9
|
|
|
13
10
|
export { EmailVerificationGate, type EmailVerificationGateProps };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
2
|
|
|
4
3
|
interface EmailVerificationGateProps {
|
|
5
|
-
required: boolean;
|
|
6
4
|
reason: string;
|
|
7
5
|
settingsHref: string;
|
|
8
|
-
children: ReactNode;
|
|
9
6
|
className?: string;
|
|
10
7
|
}
|
|
11
|
-
declare function EmailVerificationGate({
|
|
8
|
+
declare function EmailVerificationGate({ reason, settingsHref, className, }: EmailVerificationGateProps): react_jsx_runtime.JSX.Element;
|
|
12
9
|
|
|
13
10
|
export { EmailVerificationGate, type EmailVerificationGateProps };
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Mail } from "lucide-react";
|
|
3
4
|
import { cn } from "../utils/cn.js";
|
|
4
5
|
function EmailVerificationGate({
|
|
5
|
-
required,
|
|
6
6
|
reason,
|
|
7
7
|
settingsHref,
|
|
8
|
-
children,
|
|
9
8
|
className
|
|
10
9
|
}) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
11
|
+
"a",
|
|
12
|
+
{
|
|
13
|
+
href: settingsHref,
|
|
14
|
+
className: cn(
|
|
15
|
+
"col-span-2 flex items-center gap-3 rounded-2xl bg-brand-orange/10 px-4 py-3 transition-colors hover:bg-brand-orange/15",
|
|
16
|
+
className
|
|
17
|
+
),
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "grid h-9 w-9 shrink-0 place-items-center rounded-full bg-brand-orange/15", children: /* @__PURE__ */ jsx(Mail, { className: "h-4 w-4 text-brand-orange" }) }),
|
|
20
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm font-semibold", children: [
|
|
22
|
+
"Verify your email to ",
|
|
23
|
+
reason
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "Takes under a minute \u2014 go to Settings" })
|
|
26
|
+
] })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
22
30
|
}
|
|
23
31
|
export {
|
|
24
32
|
EmailVerificationGate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/email-verification-gate.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/components/email-verification-gate.tsx"],"sourcesContent":["\"use client\";\n\nimport { Mail } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface EmailVerificationGateProps {\n reason: string;\n settingsHref: string;\n className?: string;\n}\n\nexport function EmailVerificationGate({\n reason,\n settingsHref,\n className,\n}: EmailVerificationGateProps) {\n return (\n <a\n href={settingsHref}\n className={cn(\n \"col-span-2 flex items-center gap-3 rounded-2xl bg-brand-orange/10 px-4 py-3 transition-colors hover:bg-brand-orange/15\",\n className,\n )}\n >\n <div className=\"grid h-9 w-9 shrink-0 place-items-center rounded-full bg-brand-orange/15\">\n <Mail className=\"h-4 w-4 text-brand-orange\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-sm font-semibold\">Verify your email to {reason}</div>\n <div className=\"text-xs text-muted-foreground\">Takes under a minute — go to Settings</div>\n </div>\n </a>\n );\n}\n"],"mappings":";AAyBQ,cAGA,YAHA;AAvBR,SAAS,YAAY;AACrB,SAAS,UAAU;AAQZ,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AACF,GAA+B;AAC7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MAEA;AAAA,4BAAC,SAAI,WAAU,4EACb,8BAAC,QAAK,WAAU,6BAA4B,GAC9C;AAAA,QACA,qBAAC,SAAI,WAAU,kBACb;AAAA,+BAAC,SAAI,WAAU,yBAAwB;AAAA;AAAA,YAAsB;AAAA,aAAO;AAAA,UACpE,oBAAC,SAAI,WAAU,iCAAgC,wDAAqC;AAAA,WACtF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/dist/utils/ipfs.cjs
CHANGED
|
@@ -23,6 +23,7 @@ __export(ipfs_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(ipfs_exports);
|
|
24
24
|
const DEFAULT_GATEWAY = "/api/ipfs/";
|
|
25
25
|
const ALLOWED_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "ipfs:"]);
|
|
26
|
+
const KNOWN_IPFS_GATEWAY_HOSTS = /(^|\.)(mypinata\.cloud|pinata\.cloud|ipfs\.io|dweb\.link|cloudflare-ipfs\.com|nftstorage\.link|w3s\.link)$/i;
|
|
26
27
|
function ipfsToHttp(uri, gateway = DEFAULT_GATEWAY) {
|
|
27
28
|
if (!uri) return "";
|
|
28
29
|
if (uri.startsWith("ipfs://")) {
|
|
@@ -32,8 +33,12 @@ function ipfsToHttp(uri, gateway = DEFAULT_GATEWAY) {
|
|
|
32
33
|
return uri;
|
|
33
34
|
}
|
|
34
35
|
try {
|
|
35
|
-
const
|
|
36
|
-
if (!ALLOWED_PROTOCOLS.has(protocol)) return "";
|
|
36
|
+
const parsed = new URL(uri);
|
|
37
|
+
if (!ALLOWED_PROTOCOLS.has(parsed.protocol)) return "";
|
|
38
|
+
if (KNOWN_IPFS_GATEWAY_HOSTS.test(parsed.hostname)) {
|
|
39
|
+
const match = parsed.pathname.match(/\/ipfs\/(.+)$/);
|
|
40
|
+
if (match) return `${gateway}${match[1]}`;
|
|
41
|
+
}
|
|
37
42
|
} catch {
|
|
38
43
|
return "";
|
|
39
44
|
}
|
package/dist/utils/ipfs.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/ipfs.ts"],"sourcesContent":["const DEFAULT_GATEWAY = \"/api/ipfs/\";\n\nconst ALLOWED_PROTOCOLS = new Set([\"http:\", \"https:\", \"ipfs:\"]);\n\nexport function ipfsToHttp(\n uri: string | null | undefined,\n gateway = DEFAULT_GATEWAY\n): string {\n if (!uri) return \"\";\n if (uri.startsWith(\"ipfs://\")) {\n return uri.replace(\"ipfs://\", gateway);\n }\n if (uri.startsWith(\"data:image/\")) {\n return uri;\n }\n try {\n const
|
|
1
|
+
{"version":3,"sources":["../../src/utils/ipfs.ts"],"sourcesContent":["const DEFAULT_GATEWAY = \"/api/ipfs/\";\n\nconst ALLOWED_PROTOCOLS = new Set([\"http:\", \"https:\", \"ipfs:\"]);\n\nconst KNOWN_IPFS_GATEWAY_HOSTS = /(^|\\.)(mypinata\\.cloud|pinata\\.cloud|ipfs\\.io|dweb\\.link|cloudflare-ipfs\\.com|nftstorage\\.link|w3s\\.link)$/i;\n\nexport function ipfsToHttp(\n uri: string | null | undefined,\n gateway = DEFAULT_GATEWAY\n): string {\n if (!uri) return \"\";\n if (uri.startsWith(\"ipfs://\")) {\n return uri.replace(\"ipfs://\", gateway);\n }\n if (uri.startsWith(\"data:image/\")) {\n return uri;\n }\n try {\n const parsed = new URL(uri);\n if (!ALLOWED_PROTOCOLS.has(parsed.protocol)) return \"\";\n\n if (KNOWN_IPFS_GATEWAY_HOSTS.test(parsed.hostname)) {\n const match = parsed.pathname.match(/\\/ipfs\\/(.+)$/);\n if (match) return `${gateway}${match[1]}`;\n }\n } catch {\n return \"\";\n }\n return uri;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,kBAAkB;AAExB,MAAM,oBAAoB,oBAAI,IAAI,CAAC,SAAS,UAAU,OAAO,CAAC;AAE9D,MAAM,2BAA2B;AAE1B,SAAS,WACd,KACA,UAAU,iBACF;AACR,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,IAAI,WAAW,SAAS,GAAG;AAC7B,WAAO,IAAI,QAAQ,WAAW,OAAO;AAAA,EACvC;AACA,MAAI,IAAI,WAAW,aAAa,GAAG;AACjC,WAAO;AAAA,EACT;AACA,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,GAAG;AAC1B,QAAI,CAAC,kBAAkB,IAAI,OAAO,QAAQ,EAAG,QAAO;AAEpD,QAAI,yBAAyB,KAAK,OAAO,QAAQ,GAAG;AAClD,YAAM,QAAQ,OAAO,SAAS,MAAM,eAAe;AACnD,UAAI,MAAO,QAAO,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAAA,IACzC;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACA,SAAO;AACT;","names":[]}
|
package/dist/utils/ipfs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const DEFAULT_GATEWAY = "/api/ipfs/";
|
|
2
2
|
const ALLOWED_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "ipfs:"]);
|
|
3
|
+
const KNOWN_IPFS_GATEWAY_HOSTS = /(^|\.)(mypinata\.cloud|pinata\.cloud|ipfs\.io|dweb\.link|cloudflare-ipfs\.com|nftstorage\.link|w3s\.link)$/i;
|
|
3
4
|
function ipfsToHttp(uri, gateway = DEFAULT_GATEWAY) {
|
|
4
5
|
if (!uri) return "";
|
|
5
6
|
if (uri.startsWith("ipfs://")) {
|
|
@@ -9,8 +10,12 @@ function ipfsToHttp(uri, gateway = DEFAULT_GATEWAY) {
|
|
|
9
10
|
return uri;
|
|
10
11
|
}
|
|
11
12
|
try {
|
|
12
|
-
const
|
|
13
|
-
if (!ALLOWED_PROTOCOLS.has(protocol)) return "";
|
|
13
|
+
const parsed = new URL(uri);
|
|
14
|
+
if (!ALLOWED_PROTOCOLS.has(parsed.protocol)) return "";
|
|
15
|
+
if (KNOWN_IPFS_GATEWAY_HOSTS.test(parsed.hostname)) {
|
|
16
|
+
const match = parsed.pathname.match(/\/ipfs\/(.+)$/);
|
|
17
|
+
if (match) return `${gateway}${match[1]}`;
|
|
18
|
+
}
|
|
14
19
|
} catch {
|
|
15
20
|
return "";
|
|
16
21
|
}
|
package/dist/utils/ipfs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/ipfs.ts"],"sourcesContent":["const DEFAULT_GATEWAY = \"/api/ipfs/\";\n\nconst ALLOWED_PROTOCOLS = new Set([\"http:\", \"https:\", \"ipfs:\"]);\n\nexport function ipfsToHttp(\n uri: string | null | undefined,\n gateway = DEFAULT_GATEWAY\n): string {\n if (!uri) return \"\";\n if (uri.startsWith(\"ipfs://\")) {\n return uri.replace(\"ipfs://\", gateway);\n }\n if (uri.startsWith(\"data:image/\")) {\n return uri;\n }\n try {\n const
|
|
1
|
+
{"version":3,"sources":["../../src/utils/ipfs.ts"],"sourcesContent":["const DEFAULT_GATEWAY = \"/api/ipfs/\";\n\nconst ALLOWED_PROTOCOLS = new Set([\"http:\", \"https:\", \"ipfs:\"]);\n\nconst KNOWN_IPFS_GATEWAY_HOSTS = /(^|\\.)(mypinata\\.cloud|pinata\\.cloud|ipfs\\.io|dweb\\.link|cloudflare-ipfs\\.com|nftstorage\\.link|w3s\\.link)$/i;\n\nexport function ipfsToHttp(\n uri: string | null | undefined,\n gateway = DEFAULT_GATEWAY\n): string {\n if (!uri) return \"\";\n if (uri.startsWith(\"ipfs://\")) {\n return uri.replace(\"ipfs://\", gateway);\n }\n if (uri.startsWith(\"data:image/\")) {\n return uri;\n }\n try {\n const parsed = new URL(uri);\n if (!ALLOWED_PROTOCOLS.has(parsed.protocol)) return \"\";\n\n if (KNOWN_IPFS_GATEWAY_HOSTS.test(parsed.hostname)) {\n const match = parsed.pathname.match(/\\/ipfs\\/(.+)$/);\n if (match) return `${gateway}${match[1]}`;\n }\n } catch {\n return \"\";\n }\n return uri;\n}\n"],"mappings":"AAAA,MAAM,kBAAkB;AAExB,MAAM,oBAAoB,oBAAI,IAAI,CAAC,SAAS,UAAU,OAAO,CAAC;AAE9D,MAAM,2BAA2B;AAE1B,SAAS,WACd,KACA,UAAU,iBACF;AACR,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,IAAI,WAAW,SAAS,GAAG;AAC7B,WAAO,IAAI,QAAQ,WAAW,OAAO;AAAA,EACvC;AACA,MAAI,IAAI,WAAW,aAAa,GAAG;AACjC,WAAO;AAAA,EACT;AACA,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,GAAG;AAC1B,QAAI,CAAC,kBAAkB,IAAI,OAAO,QAAQ,EAAG,QAAO;AAEpD,QAAI,yBAAyB,KAAK,OAAO,QAAQ,GAAG;AAClD,YAAM,QAAQ,OAAO,SAAS,MAAM,eAAe;AACnD,UAAI,MAAO,QAAO,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAAA,IACzC;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACA,SAAO;AACT;","names":[]}
|