@medialane/ui 0.399.1 → 0.400.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/account-page.cjs +2 -2
- package/dist/components/account-page.cjs.map +1 -1
- package/dist/components/account-page.js +2 -2
- package/dist/components/account-page.js.map +1 -1
- package/dist/components/accounts-page.cjs +1 -1
- package/dist/components/accounts-page.cjs.map +1 -1
- package/dist/components/accounts-page.js +1 -1
- package/dist/components/accounts-page.js.map +1 -1
- package/dist/components/approve-mint-dialog.cjs +6 -6
- package/dist/components/approve-mint-dialog.cjs.map +1 -1
- package/dist/components/approve-mint-dialog.js +6 -6
- package/dist/components/approve-mint-dialog.js.map +1 -1
- 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/asset-owners-panel.cjs +1 -1
- package/dist/components/asset-owners-panel.cjs.map +1 -1
- package/dist/components/asset-owners-panel.js +1 -1
- package/dist/components/asset-owners-panel.js.map +1 -1
- package/dist/components/asset-picker.cjs +5 -5
- package/dist/components/asset-picker.cjs.map +1 -1
- package/dist/components/asset-picker.js +5 -5
- package/dist/components/asset-picker.js.map +1 -1
- package/dist/components/asset-search-picker.cjs +1 -1
- package/dist/components/asset-search-picker.cjs.map +1 -1
- package/dist/components/asset-search-picker.js +1 -1
- package/dist/components/asset-search-picker.js.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/collection-header.cjs +1 -1
- package/dist/components/collection-header.cjs.map +1 -1
- package/dist/components/collection-header.js +1 -1
- package/dist/components/collection-header.js.map +1 -1
- package/dist/components/collection-name-claim.cjs +2 -2
- package/dist/components/collection-name-claim.cjs.map +1 -1
- package/dist/components/collection-name-claim.js +2 -2
- package/dist/components/collection-name-claim.js.map +1 -1
- package/dist/components/collection-page.cjs +2 -2
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.js +2 -2
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/collection-slug-claim.cjs +3 -3
- package/dist/components/collection-slug-claim.cjs.map +1 -1
- package/dist/components/collection-slug-claim.js +3 -3
- package/dist/components/collection-slug-claim.js.map +1 -1
- package/dist/components/collections-page.cjs +2 -2
- package/dist/components/collections-page.cjs.map +1 -1
- package/dist/components/collections-page.js +2 -2
- package/dist/components/collections-page.js.map +1 -1
- package/dist/components/create-form-primitives.cjs +1 -1
- package/dist/components/create-form-primitives.cjs.map +1 -1
- package/dist/components/create-form-primitives.js +1 -1
- package/dist/components/create-form-primitives.js.map +1 -1
- package/dist/components/creator-page.cjs +2 -2
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.js +2 -2
- package/dist/components/creator-page.js.map +1 -1
- package/dist/components/drop/create/asset-editor.cjs +1 -1
- package/dist/components/drop/create/asset-editor.cjs.map +1 -1
- package/dist/components/drop/create/asset-editor.js +1 -1
- package/dist/components/drop/create/asset-editor.js.map +1 -1
- package/dist/components/drop/create/assets-panel.cjs +3 -3
- package/dist/components/drop/create/assets-panel.cjs.map +1 -1
- package/dist/components/drop/create/assets-panel.js +3 -3
- package/dist/components/drop/create/assets-panel.js.map +1 -1
- package/dist/components/drop/create/collection-panel.cjs +1 -1
- package/dist/components/drop/create/collection-panel.cjs.map +1 -1
- package/dist/components/drop/create/collection-panel.js +1 -1
- package/dist/components/drop/create/collection-panel.js.map +1 -1
- package/dist/components/drop/create/drop-create.cjs +4 -4
- package/dist/components/drop/create/drop-create.cjs.map +1 -1
- package/dist/components/drop/create/drop-create.js +4 -4
- package/dist/components/drop/create/drop-create.js.map +1 -1
- package/dist/components/drop/create/drop-fields.cjs +1 -1
- package/dist/components/drop/create/drop-fields.cjs.map +1 -1
- package/dist/components/drop/create/drop-fields.js +1 -1
- package/dist/components/drop/create/drop-fields.js.map +1 -1
- package/dist/components/drop/create/settings-panel.cjs +1 -1
- package/dist/components/drop/create/settings-panel.cjs.map +1 -1
- package/dist/components/drop/create/settings-panel.js +1 -1
- package/dist/components/drop/create/settings-panel.js.map +1 -1
- package/dist/components/drop/drop-listing.cjs +2 -2
- package/dist/components/drop/drop-listing.cjs.map +1 -1
- package/dist/components/drop/drop-listing.js +2 -2
- package/dist/components/drop/drop-listing.js.map +1 -1
- package/dist/components/drop/my-drops-page.cjs +1 -1
- package/dist/components/drop/my-drops-page.cjs.map +1 -1
- package/dist/components/drop/my-drops-page.js +1 -1
- package/dist/components/drop/my-drops-page.js.map +1 -1
- package/dist/components/drop/my-drops.cjs +2 -2
- package/dist/components/drop/my-drops.cjs.map +1 -1
- package/dist/components/drop/my-drops.js +2 -2
- package/dist/components/drop/my-drops.js.map +1 -1
- package/dist/components/drops-page.cjs +1 -1
- package/dist/components/drops-page.cjs.map +1 -1
- package/dist/components/drops-page.js +1 -1
- package/dist/components/drops-page.js.map +1 -1
- package/dist/components/editions-page.cjs +5 -5
- package/dist/components/editions-page.cjs.map +1 -1
- package/dist/components/editions-page.js +5 -5
- package/dist/components/editions-page.js.map +1 -1
- package/dist/components/fast-mint/collection-section.cjs +2 -2
- package/dist/components/fast-mint/collection-section.cjs.map +1 -1
- package/dist/components/fast-mint/collection-section.js +2 -2
- package/dist/components/fast-mint/collection-section.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +2 -2
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/fast-mint/fast-mint.js +2 -2
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/formats/nft.cjs +7 -7
- package/dist/components/fast-mint/formats/nft.cjs.map +1 -1
- package/dist/components/fast-mint/formats/nft.js +7 -7
- package/dist/components/fast-mint/formats/nft.js.map +1 -1
- package/dist/components/fast-mint/formats/tiers.cjs +2 -2
- package/dist/components/fast-mint/formats/tiers.cjs.map +1 -1
- package/dist/components/fast-mint/formats/tiers.js +2 -2
- package/dist/components/fast-mint/formats/tiers.js.map +1 -1
- package/dist/components/fast-mint/ip-type-section.cjs +1 -1
- package/dist/components/fast-mint/ip-type-section.cjs.map +1 -1
- package/dist/components/fast-mint/ip-type-section.js +1 -1
- package/dist/components/fast-mint/ip-type-section.js.map +1 -1
- package/dist/components/fast-mint/success-view.cjs +1 -1
- package/dist/components/fast-mint/success-view.cjs.map +1 -1
- package/dist/components/fast-mint/success-view.js +1 -1
- package/dist/components/fast-mint/success-view.js.map +1 -1
- package/dist/components/ip-type-page.cjs +1 -1
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +1 -1
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs +16 -16
- package/dist/components/launchpad/collection-create-presets.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-presets.js +16 -16
- package/dist/components/launchpad/collection-create-presets.js.map +1 -1
- package/dist/components/launchpad/collection-picker.cjs +2 -2
- package/dist/components/launchpad/collection-picker.cjs.map +1 -1
- package/dist/components/launchpad/collection-picker.js +2 -2
- package/dist/components/launchpad/collection-picker.js.map +1 -1
- package/dist/components/launchpad/edition-mint-fields.cjs +4 -4
- package/dist/components/launchpad/edition-mint-fields.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint-fields.js +4 -4
- package/dist/components/launchpad/edition-mint-fields.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/launchpad/edition-mint.cjs +13 -13
- package/dist/components/launchpad/edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint.js +13 -13
- package/dist/components/launchpad/edition-mint.js.map +1 -1
- package/dist/components/launchpad/remix-mint.cjs +12 -12
- package/dist/components/launchpad/remix-mint.cjs.map +1 -1
- package/dist/components/launchpad/remix-mint.js +12 -12
- package/dist/components/launchpad/remix-mint.js.map +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs +13 -13
- package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/single-edition-mint.js +13 -13
- package/dist/components/launchpad/single-edition-mint.js.map +1 -1
- package/dist/components/launchpad/sponsorship-create.cjs +8 -8
- package/dist/components/launchpad/sponsorship-create.cjs.map +1 -1
- package/dist/components/launchpad/sponsorship-create.js +8 -8
- package/dist/components/launchpad/sponsorship-create.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +1 -1
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.cjs +5 -5
- package/dist/components/launchpad/tier-mint-presets.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.js +5 -5
- package/dist/components/launchpad/tier-mint-presets.js.map +1 -1
- package/dist/components/launchpad-services.cjs +3 -3
- package/dist/components/launchpad-services.cjs.map +1 -1
- package/dist/components/launchpad-services.js +3 -3
- package/dist/components/launchpad-services.js.map +1 -1
- package/dist/components/launchpad-strip.cjs +1 -1
- package/dist/components/launchpad-strip.cjs.map +1 -1
- package/dist/components/launchpad-strip.js +1 -1
- package/dist/components/launchpad-strip.js.map +1 -1
- package/dist/components/license-terms-builder.cjs +1 -1
- package/dist/components/license-terms-builder.cjs.map +1 -1
- package/dist/components/license-terms-builder.js +1 -1
- package/dist/components/license-terms-builder.js.map +1 -1
- package/dist/components/marketplace-search.cjs +1 -1
- package/dist/components/marketplace-search.cjs.map +1 -1
- package/dist/components/marketplace-search.js +1 -1
- package/dist/components/marketplace-search.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.cjs +1 -1
- package/dist/components/media-wallet/media-wallet-home.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.js +1 -1
- package/dist/components/media-wallet/media-wallet-home.js.map +1 -1
- package/dist/components/new-collection-menu.cjs +2 -2
- package/dist/components/new-collection-menu.cjs.map +1 -1
- package/dist/components/new-collection-menu.js +2 -2
- package/dist/components/new-collection-menu.js.map +1 -1
- package/dist/components/page-aside.cjs +15 -15
- package/dist/components/page-aside.cjs.map +1 -1
- package/dist/components/page-aside.js +15 -15
- package/dist/components/page-aside.js.map +1 -1
- package/dist/components/portfolio-assets.cjs +1 -1
- package/dist/components/portfolio-assets.cjs.map +1 -1
- package/dist/components/portfolio-assets.js +1 -1
- package/dist/components/portfolio-assets.js.map +1 -1
- package/dist/components/portfolio-sponsorships.cjs +1 -1
- package/dist/components/portfolio-sponsorships.cjs.map +1 -1
- package/dist/components/portfolio-sponsorships.js +1 -1
- package/dist/components/portfolio-sponsorships.js.map +1 -1
- package/dist/components/remix-browse-page.cjs +5 -5
- package/dist/components/remix-browse-page.cjs.map +1 -1
- package/dist/components/remix-browse-page.js +5 -5
- package/dist/components/remix-browse-page.js.map +1 -1
- package/dist/components/rewards/rewards-dashboard.cjs +7 -7
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
- package/dist/components/rewards/rewards-dashboard.js +7 -7
- package/dist/components/rewards/rewards-dashboard.js.map +1 -1
- package/dist/components/sponsorship-offers-page.cjs +1 -1
- package/dist/components/sponsorship-offers-page.cjs.map +1 -1
- package/dist/components/sponsorship-offers-page.js +1 -1
- package/dist/components/sponsorship-offers-page.js.map +1 -1
- package/dist/components/transfer-collection-ownership.cjs +1 -1
- package/dist/components/transfer-collection-ownership.cjs.map +1 -1
- package/dist/components/transfer-collection-ownership.js +1 -1
- package/dist/components/transfer-collection-ownership.js.map +1 -1
- package/dist/data/launchpad-services.cjs +76 -120
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.d.cts +2 -5
- package/dist/data/launchpad-services.d.ts +2 -5
- package/dist/data/launchpad-services.js +76 -120
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/data/nav-commands.cjs +11 -11
- package/dist/data/nav-commands.cjs.map +1 -1
- package/dist/data/nav-commands.d.cts +10 -10
- package/dist/data/nav-commands.d.ts +10 -10
- package/dist/data/nav-commands.js +12 -11
- package/dist/data/nav-commands.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +150 -218
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +150 -218
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/utils/drop/actions.cjs +1 -1
- package/dist/utils/drop/actions.cjs.map +1 -1
- package/dist/utils/drop/actions.js +1 -1
- package/dist/utils/drop/actions.js.map +1 -1
- package/dist/utils/drop/draft.cjs +1 -1
- package/dist/utils/drop/draft.cjs.map +1 -1
- package/dist/utils/drop/draft.js +1 -1
- package/dist/utils/drop/draft.js.map +1 -1
- package/dist/utils/empty-messages.cjs +1 -1
- package/dist/utils/empty-messages.cjs.map +1 -1
- package/dist/utils/empty-messages.js +1 -1
- package/dist/utils/empty-messages.js.map +1 -1
- package/dist/utils/success-messages.cjs +1 -1
- package/dist/utils/success-messages.cjs.map +1 -1
- package/dist/utils/success-messages.js +1 -1
- package/dist/utils/success-messages.js.map +1 -1
- package/package.json +1 -1
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
import { ClaimRail } from "./claim-rail.js";
|
|
28
28
|
import { useT } from "../i18n/provider.js";
|
|
29
29
|
import { msg } from "../i18n/translate.js";
|
|
30
|
-
const LICENSE = { icon: Scale, title: msg("Your license terms"), desc: msg("Set how others can use your
|
|
30
|
+
const LICENSE = { icon: Scale, title: msg("Your license terms"), desc: msg("Set how others can use your NFT.") };
|
|
31
31
|
const AUTHORSHIP = { icon: FileCheck, title: msg("Proof of authorship"), desc: msg("A permanent, dated record shows you created it.") };
|
|
32
|
-
const SHARE_PAGE = { icon: LayoutGrid, title: msg("A page to share"), desc: msg("Every
|
|
32
|
+
const SHARE_PAGE = { icon: LayoutGrid, title: msg("A page to share"), desc: msg("Every NFT in the collection in one place.") };
|
|
33
33
|
const COLLECTION_STEPS = [msg("Add a cover, name and short code"), msg("Create the collection")];
|
|
34
34
|
const ASIDES = {
|
|
35
35
|
asset: {
|
|
@@ -42,27 +42,27 @@ const ASIDES = {
|
|
|
42
42
|
},
|
|
43
43
|
mintEdition: {
|
|
44
44
|
included: [
|
|
45
|
-
{ icon: Layers, title: msg("
|
|
45
|
+
{ icon: Layers, title: msg("Copies"), desc: msg("Choose how many to create.") },
|
|
46
46
|
LICENSE,
|
|
47
47
|
AUTHORSHIP
|
|
48
48
|
],
|
|
49
|
-
steps: [msg("Add your image, name and story"), msg("Choose
|
|
49
|
+
steps: [msg("Add your image, name and story"), msg("Choose the number of copies and your license terms"), msg("Create, then sell or send your copies")]
|
|
50
50
|
},
|
|
51
51
|
collection: {
|
|
52
52
|
included: [
|
|
53
|
-
{ icon: Layers, title: msg("A home for your
|
|
53
|
+
{ icon: Layers, title: msg("A home for your NFTs"), desc: msg("Your cover, name and description bring it together.") },
|
|
54
54
|
SHARE_PAGE,
|
|
55
|
-
{ icon: ShieldCheck, title: msg("Yours to manage"), desc: msg("Only you can add
|
|
55
|
+
{ icon: ShieldCheck, title: msg("Yours to manage"), desc: msg("Only you can add NFTs to it.") }
|
|
56
56
|
],
|
|
57
|
-
steps: [...COLLECTION_STEPS, msg("Add
|
|
57
|
+
steps: [...COLLECTION_STEPS, msg("Add NFTs to it whenever you like")]
|
|
58
58
|
},
|
|
59
59
|
editions: {
|
|
60
60
|
included: [
|
|
61
|
-
{ icon: Layers, title: msg("
|
|
61
|
+
{ icon: Layers, title: msg("Copies"), desc: msg("Choose how many for each NFT.") },
|
|
62
62
|
SHARE_PAGE,
|
|
63
|
-
{ icon: ShieldCheck, title: msg("Yours to manage"), desc: msg("Only you can add
|
|
63
|
+
{ icon: ShieldCheck, title: msg("Yours to manage"), desc: msg("Only you can add NFTs to it.") }
|
|
64
64
|
],
|
|
65
|
-
steps: [...COLLECTION_STEPS, msg("
|
|
65
|
+
steps: [...COLLECTION_STEPS, msg("Create Limited Edition NFTs in it")]
|
|
66
66
|
},
|
|
67
67
|
club: {
|
|
68
68
|
included: [
|
|
@@ -102,14 +102,14 @@ const ASIDES = {
|
|
|
102
102
|
included: [
|
|
103
103
|
{ icon: Handshake, title: msg("Paid directly"), desc: msg("Funds go from the sponsor to the author.") },
|
|
104
104
|
{ icon: FileCheck, title: msg("A license in return"), desc: msg("The sponsor receives it on the agreed terms.") },
|
|
105
|
-
{ icon: Plus, title: msg("Start from either side"), desc: msg("Offer your own
|
|
105
|
+
{ icon: Plus, title: msg("Start from either side"), desc: msg("Offer your own NFT or propose to sponsor another.") }
|
|
106
106
|
],
|
|
107
|
-
steps: [msg("Choose the
|
|
107
|
+
steps: [msg("Choose the NFT and set the terms"), msg("The other side responds"), msg("License and payment settle together")]
|
|
108
108
|
},
|
|
109
109
|
claimCollection: {
|
|
110
110
|
included: [
|
|
111
111
|
{ icon: LayoutGrid, title: msg("A page for your collection"), desc: msg("Edit its name and cover.") },
|
|
112
|
-
{ icon: UserCircle, title: msg("On your profile"), desc: msg("Shown with
|
|
112
|
+
{ icon: UserCircle, title: msg("On your profile"), desc: msg("Shown with your NFTs.") },
|
|
113
113
|
{ icon: ShieldCheck, title: msg("Stays where it is"), desc: msg("Assets remain in the collection contract.") }
|
|
114
114
|
],
|
|
115
115
|
steps: [msg("Paste the contract address"), msg("Ownership check on Starknet"), msg("Live on your profile")]
|
|
@@ -124,7 +124,7 @@ const ASIDES = {
|
|
|
124
124
|
claimMemecoin: {
|
|
125
125
|
included: [
|
|
126
126
|
{ icon: Coins, title: msg("Listed on the Coins page"), desc: msg("Where people find and trade coins.") },
|
|
127
|
-
{ icon: UserCircle, title: msg("On your profile"), desc: msg("Shown with
|
|
127
|
+
{ icon: UserCircle, title: msg("On your profile"), desc: msg("Shown with your NFTs.") },
|
|
128
128
|
{ icon: TrendingUp, title: msg("Linked to your account"), desc: msg("Claiming only links the coin to the account.") }
|
|
129
129
|
],
|
|
130
130
|
steps: [msg("Paste the coin contract address"), msg("Ownership check on Starknet"), msg("Live once confirmed")]
|
|
@@ -132,7 +132,7 @@ const ASIDES = {
|
|
|
132
132
|
claimUsername: {
|
|
133
133
|
included: [
|
|
134
134
|
{ icon: AtSign, title: msg("Your own creator address"), desc: msg("Like medialane.io/creator/yourname.") },
|
|
135
|
-
{ icon: UserCircle, title: msg("One public profile"), desc: msg("
|
|
135
|
+
{ icon: UserCircle, title: msg("One public profile"), desc: msg("Everything you create in one place.") }
|
|
136
136
|
],
|
|
137
137
|
steps: [msg("Pick a username"), msg("Availability check"), msg("Yours after DAO review")]
|
|
138
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/page-aside.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ArrowLeftRight, Award, CalendarDays, Coins, FileCheck, Handshake, KeyRound, Layers, LayoutGrid, Link2, Lock, Plus, Scale, Share2,\n ShieldCheck, Sparkles, Ticket, TrendingUp, UserCircle, Users, Wallet, AtSign,\n} from \"lucide-react\";\nimport { ClaimRail, type ClaimRailProps } from \"./claim-rail.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\n\nconst LICENSE = { icon: Scale, title: msg(\"Your license terms\"), desc: msg(\"Set how others can use your work.\") };\nconst AUTHORSHIP = { icon: FileCheck, title: msg(\"Proof of authorship\"), desc: msg(\"A permanent, dated record shows you created it.\") };\nconst SHARE_PAGE = { icon: LayoutGrid, title: msg(\"A page to share\"), desc: msg(\"Every work in the collection in one place.\") };\nconst COLLECTION_STEPS = [msg(\"Add a cover, name and short code\"), msg(\"Create the collection\")];\n\nconst ASIDES = {\n asset: {\n included: [\n { icon: Sparkles, title: msg(\"One of a kind\"), desc: msg(\"A single copy with one owner at a time.\") },\n LICENSE,\n AUTHORSHIP,\n ],\n steps: [msg(\"Add your image, name and story\"), msg(\"Choose a collection and license terms\"), msg(\"Sell or send it from your account\")],\n },\n mintEdition: {\n included: [\n { icon: Layers, title: msg(\"Limited Editions\"), desc: msg(\"Choose how many to mint.\") },\n LICENSE,\n AUTHORSHIP,\n ],\n steps: [msg(\"Add your image, name and story\"), msg(\"Choose how many Limited Editions and your license terms\"), msg(\"Mint, then sell or send your Limited Editions\")],\n },\n collection: {\n included: [\n { icon: Layers, title: msg(\"A home for your work\"), desc: msg(\"Your cover, name and description bring it together.\") },\n SHARE_PAGE,\n { icon: ShieldCheck, title: msg(\"Yours to manage\"), desc: msg(\"Only you can add works to it.\") },\n ],\n steps: [...COLLECTION_STEPS, msg(\"Add works to it whenever you like\")],\n },\n editions: {\n included: [\n { icon: Layers, title: msg(\"Limited Editions\"), desc: msg(\"Choose how many to mint for each work.\") },\n SHARE_PAGE,\n { icon: ShieldCheck, title: msg(\"Yours to manage\"), desc: msg(\"Only you can add works to it.\") },\n ],\n steps: [...COLLECTION_STEPS, msg(\"Mint limited editions into it\")],\n },\n club: {\n included: [\n { icon: Users, title: msg(\"Membership tiers\"), desc: msg(\"Add new tiers whenever you like.\") },\n { icon: ArrowLeftRight, title: msg(\"Cards members can trade\"), desc: msg(\"Members can sell or send their cards.\") },\n { icon: ShieldCheck, title: msg(\"Yours to manage\"), desc: msg(\"Only you can add membership cards.\") },\n ],\n steps: [msg(\"Create your club\"), msg(\"Add membership tiers\"), msg(\"Sell the cards on the marketplace\")],\n },\n tickets: {\n included: [\n { icon: Ticket, title: msg(\"Ticket types\"), desc: msg(\"Add one for each event or seating level.\") },\n { icon: CalendarDays, title: msg(\"Dates you set\"), desc: msg(\"Choose when each ticket is valid.\") },\n { icon: Wallet, title: msg(\"Held by your audience\"), desc: msg(\"Tickets stay in each holder's account.\") },\n ],\n steps: [msg(\"Create your ticket collection\"), msg(\"Add your ticket types\"), msg(\"Sell or send the tickets\")],\n },\n pop: {\n included: [\n { icon: Award, title: msg(\"Stays with its holder\"), desc: msg(\"Each certificate is permanently tied to one account.\") },\n { icon: Users, title: msg(\"One per participant\"), desc: msg(\"Each participant on your list claims one.\") },\n { icon: Share2, title: msg(\"Links to share\"), desc: msg(\"Participants claim through their link.\") },\n ],\n steps: [msg(\"Add your event details\"), msg(\"Publish your participant list\"), msg(\"Share the claim links\")],\n },\n coin: {\n included: [\n { icon: ShieldCheck, title: msg(\"Fixed supply forever\"), desc: msg(\"No more can ever be created.\") },\n { icon: Wallet, title: msg(\"Purchased at market price\"), desc: msg(\"Creator buy capped at 10%.\") },\n { icon: KeyRound, title: msg(\"Ownership renounced\"), desc: msg(\"Renounced automatically at launch.\") },\n { icon: ArrowLeftRight, title: msg(\"You choose the pair\"), desc: msg(\"Pick any supported coin.\") },\n { icon: Lock, title: msg(\"Locked liquidity\"), desc: msg(\"Locked forever, and fees stay collectible.\") },\n ],\n steps: [msg(\"Add a name, symbol and image\"), msg(\"Set the supply, price and your share\"), msg(\"Launch and trade\")],\n },\n sponsorship: {\n included: [\n { icon: Handshake, title: msg(\"Paid directly\"), desc: msg(\"Funds go from the sponsor to the author.\") },\n { icon: FileCheck, title: msg(\"A license in return\"), desc: msg(\"The sponsor receives it on the agreed terms.\") },\n { icon: Plus, title: msg(\"Start from either side\"), desc: msg(\"Offer your own work or propose to sponsor one.\") },\n ],\n steps: [msg(\"Choose the work and set the terms\"), msg(\"The other side responds\"), msg(\"License and payment settle together\")],\n },\n claimCollection: {\n included: [\n { icon: LayoutGrid, title: msg(\"A page for your collection\"), desc: msg(\"Edit its name and cover.\") },\n { icon: UserCircle, title: msg(\"On your profile\"), desc: msg(\"Shown with the rest of your work.\") },\n { icon: ShieldCheck, title: msg(\"Stays where it is\"), desc: msg(\"Assets remain in the collection contract.\") },\n ],\n steps: [msg(\"Paste the contract address\"), msg(\"Ownership check on Starknet\"), msg(\"Live on your profile\")],\n },\n claimCollectionName: {\n included: [\n { icon: Link2, title: msg(\"A short web address\"), desc: msg(\"Like medialane.io/collection/your-name.\") },\n { icon: LayoutGrid, title: msg(\"Opens your collection\"), desc: msg(\"Visitors land on its page.\") },\n ],\n steps: [msg(\"Pick a collection\"), msg(\"Choose a name\"), msg(\"Live after review\")],\n },\n claimMemecoin: {\n included: [\n { icon: Coins, title: msg(\"Listed on the Coins page\"), desc: msg(\"Where people find and trade coins.\") },\n { icon: UserCircle, title: msg(\"On your profile\"), desc: msg(\"Shown with the rest of your work.\") },\n { icon: TrendingUp, title: msg(\"Linked to your account\"), desc: msg(\"Claiming only links the coin to the account.\") },\n ],\n steps: [msg(\"Paste the coin contract address\"), msg(\"Ownership check on Starknet\"), msg(\"Live once confirmed\")],\n },\n claimUsername: {\n included: [\n { icon: AtSign, title: msg(\"Your own creator address\"), desc: msg(\"Like medialane.io/creator/yourname.\") },\n { icon: UserCircle, title: msg(\"One public profile\"), desc: msg(\"All your work in one place.\") },\n ],\n steps: [msg(\"Pick a username\"), msg(\"Availability check\"), msg(\"Yours after DAO review\")],\n },\n} satisfies Record<string, ClaimRailProps>;\n\nexport type PageAsideKind = keyof typeof ASIDES;\n\nexport const PAGE_ASIDE_KINDS = Object.keys(ASIDES) as PageAsideKind[];\n\nexport function PageAside({ kind }: { kind: PageAsideKind }) {\n const t = useT();\n const { included = [], steps }: ClaimRailProps = ASIDES[kind];\n return (\n <ClaimRail\n included={included.map((item) => ({ ...item, title: t(item.title), desc: t(item.desc) }))}\n steps={steps.map((step) => t(step))}\n />\n );\n}\n"],"mappings":";AAkII;AAhIJ;AAAA,EACE;AAAA,EAAgB;AAAA,EAAO;AAAA,EAAc;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAY;AAAA,EAAO;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EAC1H;AAAA,EAAa;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAY;AAAA,EAAY;AAAA,EAAO;AAAA,EAAQ;AAAA,OACjE;AACP,SAAS,iBAAsC;AAC/C,SAAS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,IAAI,oBAAoB,GAAG,IAAI,wBAAwB,CAAC;AAAA,EAC1F;AACF;AAIO,MAAM,mBAAmB,OAAO,KAAK,MAAM;AAE3C,SAAS,UAAU,EAAE,KAAK,GAA4B;AAC3D,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,WAAW,CAAC,GAAG,MAAM,IAAoB,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,SAAS,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,OAAO,EAAE,KAAK,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,EAAE,EAAE;AAAA,MACxF,OAAO,MAAM,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC;AAAA;AAAA,EACpC;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/page-aside.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ArrowLeftRight, Award, CalendarDays, Coins, FileCheck, Handshake, KeyRound, Layers, LayoutGrid, Link2, Lock, Plus, Scale, Share2,\n ShieldCheck, Sparkles, Ticket, TrendingUp, UserCircle, Users, Wallet, AtSign,\n} from \"lucide-react\";\nimport { ClaimRail, type ClaimRailProps } from \"./claim-rail.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\n\nconst LICENSE = { icon: Scale, title: msg(\"Your license terms\"), desc: msg(\"Set how others can use your NFT.\") };\nconst AUTHORSHIP = { icon: FileCheck, title: msg(\"Proof of authorship\"), desc: msg(\"A permanent, dated record shows you created it.\") };\nconst SHARE_PAGE = { icon: LayoutGrid, title: msg(\"A page to share\"), desc: msg(\"Every NFT in the collection in one place.\") };\nconst COLLECTION_STEPS = [msg(\"Add a cover, name and short code\"), msg(\"Create the collection\")];\n\nconst ASIDES = {\n asset: {\n included: [\n { icon: Sparkles, title: msg(\"One of a kind\"), desc: msg(\"A single copy with one owner at a time.\") },\n LICENSE,\n AUTHORSHIP,\n ],\n steps: [msg(\"Add your image, name and story\"), msg(\"Choose a collection and license terms\"), msg(\"Sell or send it from your account\")],\n },\n mintEdition: {\n included: [\n { icon: Layers, title: msg(\"Copies\"), desc: msg(\"Choose how many to create.\") },\n LICENSE,\n AUTHORSHIP,\n ],\n steps: [msg(\"Add your image, name and story\"), msg(\"Choose the number of copies and your license terms\"), msg(\"Create, then sell or send your copies\")],\n },\n collection: {\n included: [\n { icon: Layers, title: msg(\"A home for your NFTs\"), desc: msg(\"Your cover, name and description bring it together.\") },\n SHARE_PAGE,\n { icon: ShieldCheck, title: msg(\"Yours to manage\"), desc: msg(\"Only you can add NFTs to it.\") },\n ],\n steps: [...COLLECTION_STEPS, msg(\"Add NFTs to it whenever you like\")],\n },\n editions: {\n included: [\n { icon: Layers, title: msg(\"Copies\"), desc: msg(\"Choose how many for each NFT.\") },\n SHARE_PAGE,\n { icon: ShieldCheck, title: msg(\"Yours to manage\"), desc: msg(\"Only you can add NFTs to it.\") },\n ],\n steps: [...COLLECTION_STEPS, msg(\"Create Limited Edition NFTs in it\")],\n },\n club: {\n included: [\n { icon: Users, title: msg(\"Membership tiers\"), desc: msg(\"Add new tiers whenever you like.\") },\n { icon: ArrowLeftRight, title: msg(\"Cards members can trade\"), desc: msg(\"Members can sell or send their cards.\") },\n { icon: ShieldCheck, title: msg(\"Yours to manage\"), desc: msg(\"Only you can add membership cards.\") },\n ],\n steps: [msg(\"Create your club\"), msg(\"Add membership tiers\"), msg(\"Sell the cards on the marketplace\")],\n },\n tickets: {\n included: [\n { icon: Ticket, title: msg(\"Ticket types\"), desc: msg(\"Add one for each event or seating level.\") },\n { icon: CalendarDays, title: msg(\"Dates you set\"), desc: msg(\"Choose when each ticket is valid.\") },\n { icon: Wallet, title: msg(\"Held by your audience\"), desc: msg(\"Tickets stay in each holder's account.\") },\n ],\n steps: [msg(\"Create your ticket collection\"), msg(\"Add your ticket types\"), msg(\"Sell or send the tickets\")],\n },\n pop: {\n included: [\n { icon: Award, title: msg(\"Stays with its holder\"), desc: msg(\"Each certificate is permanently tied to one account.\") },\n { icon: Users, title: msg(\"One per participant\"), desc: msg(\"Each participant on your list claims one.\") },\n { icon: Share2, title: msg(\"Links to share\"), desc: msg(\"Participants claim through their link.\") },\n ],\n steps: [msg(\"Add your event details\"), msg(\"Publish your participant list\"), msg(\"Share the claim links\")],\n },\n coin: {\n included: [\n { icon: ShieldCheck, title: msg(\"Fixed supply forever\"), desc: msg(\"No more can ever be created.\") },\n { icon: Wallet, title: msg(\"Purchased at market price\"), desc: msg(\"Creator buy capped at 10%.\") },\n { icon: KeyRound, title: msg(\"Ownership renounced\"), desc: msg(\"Renounced automatically at launch.\") },\n { icon: ArrowLeftRight, title: msg(\"You choose the pair\"), desc: msg(\"Pick any supported coin.\") },\n { icon: Lock, title: msg(\"Locked liquidity\"), desc: msg(\"Locked forever, and fees stay collectible.\") },\n ],\n steps: [msg(\"Add a name, symbol and image\"), msg(\"Set the supply, price and your share\"), msg(\"Launch and trade\")],\n },\n sponsorship: {\n included: [\n { icon: Handshake, title: msg(\"Paid directly\"), desc: msg(\"Funds go from the sponsor to the author.\") },\n { icon: FileCheck, title: msg(\"A license in return\"), desc: msg(\"The sponsor receives it on the agreed terms.\") },\n { icon: Plus, title: msg(\"Start from either side\"), desc: msg(\"Offer your own NFT or propose to sponsor another.\") },\n ],\n steps: [msg(\"Choose the NFT and set the terms\"), msg(\"The other side responds\"), msg(\"License and payment settle together\")],\n },\n claimCollection: {\n included: [\n { icon: LayoutGrid, title: msg(\"A page for your collection\"), desc: msg(\"Edit its name and cover.\") },\n { icon: UserCircle, title: msg(\"On your profile\"), desc: msg(\"Shown with your NFTs.\") },\n { icon: ShieldCheck, title: msg(\"Stays where it is\"), desc: msg(\"Assets remain in the collection contract.\") },\n ],\n steps: [msg(\"Paste the contract address\"), msg(\"Ownership check on Starknet\"), msg(\"Live on your profile\")],\n },\n claimCollectionName: {\n included: [\n { icon: Link2, title: msg(\"A short web address\"), desc: msg(\"Like medialane.io/collection/your-name.\") },\n { icon: LayoutGrid, title: msg(\"Opens your collection\"), desc: msg(\"Visitors land on its page.\") },\n ],\n steps: [msg(\"Pick a collection\"), msg(\"Choose a name\"), msg(\"Live after review\")],\n },\n claimMemecoin: {\n included: [\n { icon: Coins, title: msg(\"Listed on the Coins page\"), desc: msg(\"Where people find and trade coins.\") },\n { icon: UserCircle, title: msg(\"On your profile\"), desc: msg(\"Shown with your NFTs.\") },\n { icon: TrendingUp, title: msg(\"Linked to your account\"), desc: msg(\"Claiming only links the coin to the account.\") },\n ],\n steps: [msg(\"Paste the coin contract address\"), msg(\"Ownership check on Starknet\"), msg(\"Live once confirmed\")],\n },\n claimUsername: {\n included: [\n { icon: AtSign, title: msg(\"Your own creator address\"), desc: msg(\"Like medialane.io/creator/yourname.\") },\n { icon: UserCircle, title: msg(\"One public profile\"), desc: msg(\"Everything you create in one place.\") },\n ],\n steps: [msg(\"Pick a username\"), msg(\"Availability check\"), msg(\"Yours after DAO review\")],\n },\n} satisfies Record<string, ClaimRailProps>;\n\nexport type PageAsideKind = keyof typeof ASIDES;\n\nexport const PAGE_ASIDE_KINDS = Object.keys(ASIDES) as PageAsideKind[];\n\nexport function PageAside({ kind }: { kind: PageAsideKind }) {\n const t = useT();\n const { included = [], steps }: ClaimRailProps = ASIDES[kind];\n return (\n <ClaimRail\n included={included.map((item) => ({ ...item, title: t(item.title), desc: t(item.desc) }))}\n steps={steps.map((step) => t(step))}\n />\n );\n}\n"],"mappings":";AAkII;AAhIJ;AAAA,EACE;AAAA,EAAgB;AAAA,EAAO;AAAA,EAAc;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAY;AAAA,EAAO;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EAC1H;AAAA,EAAa;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAY;AAAA,EAAY;AAAA,EAAO;AAAA,EAAQ;AAAA,OACjE;AACP,SAAS,iBAAsC;AAC/C,SAAS,YAAY;AACrB,SAAS,WA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,IAAI,wBAAwB,CAAC;AAAA,EAC1F;AACF;AAIO,MAAM,mBAAmB,OAAO,KAAK,MAAM;AAE3C,SAAS,UAAU,EAAE,KAAK,GAA4B;AAC3D,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,WAAW,CAAC,GAAG,MAAM,IAAoB,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,SAAS,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,OAAO,EAAE,KAAK,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,EAAE,EAAE;AAAA,MACxF,OAAO,MAAM,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC;AAAA;AAAA,EACpC;AAEJ;","names":[]}
|
|
@@ -68,7 +68,7 @@ function PortfolioAssets({ address, useActions }) {
|
|
|
68
68
|
onRetry: () => void mutate(),
|
|
69
69
|
emptyTitle: t("No assets yet"),
|
|
70
70
|
emptyDescription: t("Create your first asset to get started."),
|
|
71
|
-
emptyCta: { label: t("Create your first
|
|
71
|
+
emptyCta: { label: t("Create your first NFT"), href: "/launchpad/single-editions" },
|
|
72
72
|
emptyIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImageIcon, { className: "h-7 w-7 text-muted-foreground" }),
|
|
73
73
|
skeletonNode: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: GRID, children: Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_token_card.TokenCardSkeleton, {}, i)) }),
|
|
74
74
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard, TokenCardSkeleton } from \"./token-card.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { useTokensByOwner } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PortfolioAssetActions {\n list: (token: ApiToken) => void;\n transfer: (token: ApiToken) => void;\n cancel: (token: ApiToken) => void;\n archive?: (token: ApiToken) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioAssetActions = (context: { refresh: () => void }) => PortfolioAssetActions;\n\nconst PAGE_SIZE = 20;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nfunction usdFor(token: ApiToken, prices: ReturnType<typeof useUsdPrices>): string | null {\n const order = token.activeOrders?.find((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\");\n return orderUsd(order?.price, prices);\n}\n\nexport function PortfolioAssets({ address, useActions }: { address: string; useActions: UsePortfolioAssetActions }) {\n const t = useT();\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const [reportToken, setReportToken] = useState<ApiToken | null>(null);\n const { tokens, meta, isLoading, error, mutate } = useTokensByOwner(address, page, PAGE_SIZE);\n const prices = useUsdPrices();\n\n useEffect(() => setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens])), [tokens, page]);\n useEffect(() => { setPage(1); setAll([]); }, [address]);\n\n const actions = useActions({ refresh: () => { setPage(1); setAll([]); void mutate(); } });\n const shown = page === 1 ? tokens : all;\n const hasMore = meta ? (meta.total ?? 0) > shown.length : false;\n\n return (\n <>\n <EmptyOrError\n isLoading={isLoading && page === 1}\n error={error}\n isEmpty={shown.length === 0 && !isLoading}\n onRetry={() => void mutate()}\n emptyTitle={t(\"No assets yet\")}\n emptyDescription={t(\"Create your first asset to get started.\")}\n emptyCta={{ label: t(\"Create your first
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard, TokenCardSkeleton } from \"./token-card.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { useTokensByOwner } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PortfolioAssetActions {\n list: (token: ApiToken) => void;\n transfer: (token: ApiToken) => void;\n cancel: (token: ApiToken) => void;\n archive?: (token: ApiToken) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioAssetActions = (context: { refresh: () => void }) => PortfolioAssetActions;\n\nconst PAGE_SIZE = 20;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nfunction usdFor(token: ApiToken, prices: ReturnType<typeof useUsdPrices>): string | null {\n const order = token.activeOrders?.find((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\");\n return orderUsd(order?.price, prices);\n}\n\nexport function PortfolioAssets({ address, useActions }: { address: string; useActions: UsePortfolioAssetActions }) {\n const t = useT();\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const [reportToken, setReportToken] = useState<ApiToken | null>(null);\n const { tokens, meta, isLoading, error, mutate } = useTokensByOwner(address, page, PAGE_SIZE);\n const prices = useUsdPrices();\n\n useEffect(() => setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens])), [tokens, page]);\n useEffect(() => { setPage(1); setAll([]); }, [address]);\n\n const actions = useActions({ refresh: () => { setPage(1); setAll([]); void mutate(); } });\n const shown = page === 1 ? tokens : all;\n const hasMore = meta ? (meta.total ?? 0) > shown.length : false;\n\n return (\n <>\n <EmptyOrError\n isLoading={isLoading && page === 1}\n error={error}\n isEmpty={shown.length === 0 && !isLoading}\n onRetry={() => void mutate()}\n emptyTitle={t(\"No assets yet\")}\n emptyDescription={t(\"Create your first asset to get started.\")}\n emptyCta={{ label: t(\"Create your first NFT\"), href: \"/launchpad/single-editions\" }}\n emptyIcon={<ImageIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => <TokenCardSkeleton key={i} />)}\n </div>\n }\n >\n <div className={GRID}>\n {shown.map((token) => (\n <TokenCard\n key={`${token.contractAddress}-${token.tokenId}`}\n token={token}\n isOwner\n usdValue={usdFor(token, prices)}\n onList={actions.list}\n onTransfer={actions.transfer}\n onCancel={actions.cancel}\n onArchive={actions.archive}\n onReport={setReportToken}\n />\n ))}\n </div>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </EmptyOrError>\n {actions.dialogs}\n {reportToken && (\n <ReportDialog\n open={!!reportToken}\n onOpenChange={(open) => { if (!open) setReportToken(null); }}\n target={{ type: \"TOKEN\", contract: reportToken.contractAddress, tokenId: reportToken.tokenId, name: reportToken.metadata?.name ?? undefined }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDI;AA9CJ,mBAAoD;AAEpD,0BAA0B;AAC1B,4BAA6B;AAC7B,gCAAiC;AACjC,wBAA6C;AAC7C,2BAA6B;AAC7B,uBAAyB;AACzB,4BAA6B;AAC7B,wBAAiC;AACjC,sBAAqB;AAYrB,MAAM,YAAY;AAClB,MAAM,OAAO;AAEb,SAAS,OAAO,OAAiB,QAAwD;AACvF,QAAM,QAAQ,MAAM,cAAc,KAAK,CAAC,MAAM,EAAE,MAAM,aAAa,YAAY,EAAE,MAAM,aAAa,SAAS;AAC7G,aAAO,2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AAE,IAAI,CAAC,GAAG,MAAM,4CAAC,yCAAuB,CAAG,CAAE,GACzE;AAAA,QAGF;AAAA,sDAAC,SAAI,WAAW,MACb,gBAAM,IAAI,CAAC,UACV;AAAA,YAAC;AAAA;AAAA,cAEC;AAAA,cACA,SAAO;AAAA,cACP,UAAU,OAAO,OAAO,MAAM;AAAA,cAC9B,QAAQ,QAAQ;AAAA,cAChB,YAAY,QAAQ;AAAA,cACpB,UAAU,QAAQ;AAAA,cAClB,WAAW,QAAQ;AAAA,cACnB,UAAU;AAAA;AAAA,YARL,GAAG,MAAM,eAAe,IAAI,MAAM,OAAO;AAAA,UAShD,CACD,GACH;AAAA,UACA,4CAAC,8CAAiB,SAAkB,WAAsB,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG;AAAA;AAAA;AAAA,IACrG;AAAA,IACC,QAAQ;AAAA,IACR,eACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,CAAC,CAAC;AAAA,QACR,cAAc,CAAC,SAAS;AAAE,cAAI,CAAC,KAAM,gBAAe,IAAI;AAAA,QAAG;AAAA,QAC3D,QAAQ,EAAE,MAAM,SAAS,UAAU,YAAY,iBAAiB,SAAS,YAAY,SAAS,MAAM,YAAY,UAAU,QAAQ,OAAU;AAAA;AAAA,IAC9I;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -45,7 +45,7 @@ function PortfolioAssets({ address, useActions }) {
|
|
|
45
45
|
onRetry: () => void mutate(),
|
|
46
46
|
emptyTitle: t("No assets yet"),
|
|
47
47
|
emptyDescription: t("Create your first asset to get started."),
|
|
48
|
-
emptyCta: { label: t("Create your first
|
|
48
|
+
emptyCta: { label: t("Create your first NFT"), href: "/launchpad/single-editions" },
|
|
49
49
|
emptyIcon: /* @__PURE__ */ jsx(ImageIcon, { className: "h-7 w-7 text-muted-foreground" }),
|
|
50
50
|
skeletonNode: /* @__PURE__ */ jsx("div", { className: GRID, children: Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ jsx(TokenCardSkeleton, {}, i)) }),
|
|
51
51
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard, TokenCardSkeleton } from \"./token-card.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { useTokensByOwner } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PortfolioAssetActions {\n list: (token: ApiToken) => void;\n transfer: (token: ApiToken) => void;\n cancel: (token: ApiToken) => void;\n archive?: (token: ApiToken) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioAssetActions = (context: { refresh: () => void }) => PortfolioAssetActions;\n\nconst PAGE_SIZE = 20;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nfunction usdFor(token: ApiToken, prices: ReturnType<typeof useUsdPrices>): string | null {\n const order = token.activeOrders?.find((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\");\n return orderUsd(order?.price, prices);\n}\n\nexport function PortfolioAssets({ address, useActions }: { address: string; useActions: UsePortfolioAssetActions }) {\n const t = useT();\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const [reportToken, setReportToken] = useState<ApiToken | null>(null);\n const { tokens, meta, isLoading, error, mutate } = useTokensByOwner(address, page, PAGE_SIZE);\n const prices = useUsdPrices();\n\n useEffect(() => setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens])), [tokens, page]);\n useEffect(() => { setPage(1); setAll([]); }, [address]);\n\n const actions = useActions({ refresh: () => { setPage(1); setAll([]); void mutate(); } });\n const shown = page === 1 ? tokens : all;\n const hasMore = meta ? (meta.total ?? 0) > shown.length : false;\n\n return (\n <>\n <EmptyOrError\n isLoading={isLoading && page === 1}\n error={error}\n isEmpty={shown.length === 0 && !isLoading}\n onRetry={() => void mutate()}\n emptyTitle={t(\"No assets yet\")}\n emptyDescription={t(\"Create your first asset to get started.\")}\n emptyCta={{ label: t(\"Create your first
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard, TokenCardSkeleton } from \"./token-card.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { useTokensByOwner } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PortfolioAssetActions {\n list: (token: ApiToken) => void;\n transfer: (token: ApiToken) => void;\n cancel: (token: ApiToken) => void;\n archive?: (token: ApiToken) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioAssetActions = (context: { refresh: () => void }) => PortfolioAssetActions;\n\nconst PAGE_SIZE = 20;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nfunction usdFor(token: ApiToken, prices: ReturnType<typeof useUsdPrices>): string | null {\n const order = token.activeOrders?.find((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\");\n return orderUsd(order?.price, prices);\n}\n\nexport function PortfolioAssets({ address, useActions }: { address: string; useActions: UsePortfolioAssetActions }) {\n const t = useT();\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const [reportToken, setReportToken] = useState<ApiToken | null>(null);\n const { tokens, meta, isLoading, error, mutate } = useTokensByOwner(address, page, PAGE_SIZE);\n const prices = useUsdPrices();\n\n useEffect(() => setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens])), [tokens, page]);\n useEffect(() => { setPage(1); setAll([]); }, [address]);\n\n const actions = useActions({ refresh: () => { setPage(1); setAll([]); void mutate(); } });\n const shown = page === 1 ? tokens : all;\n const hasMore = meta ? (meta.total ?? 0) > shown.length : false;\n\n return (\n <>\n <EmptyOrError\n isLoading={isLoading && page === 1}\n error={error}\n isEmpty={shown.length === 0 && !isLoading}\n onRetry={() => void mutate()}\n emptyTitle={t(\"No assets yet\")}\n emptyDescription={t(\"Create your first asset to get started.\")}\n emptyCta={{ label: t(\"Create your first NFT\"), href: \"/launchpad/single-editions\" }}\n emptyIcon={<ImageIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => <TokenCardSkeleton key={i} />)}\n </div>\n }\n >\n <div className={GRID}>\n {shown.map((token) => (\n <TokenCard\n key={`${token.contractAddress}-${token.tokenId}`}\n token={token}\n isOwner\n usdValue={usdFor(token, prices)}\n onList={actions.list}\n onTransfer={actions.transfer}\n onCancel={actions.cancel}\n onArchive={actions.archive}\n onReport={setReportToken}\n />\n ))}\n </div>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </EmptyOrError>\n {actions.dialogs}\n {reportToken && (\n <ReportDialog\n open={!!reportToken}\n onOpenChange={(open) => { if (!open) setReportToken(null); }}\n target={{ type: \"TOKEN\", contract: reportToken.contractAddress, tokenId: reportToken.tokenId, name: reportToken.metadata?.name ?? undefined }}\n />\n )}\n </>\n );\n}\n"],"mappings":";AAgDI,mBASe,KARb,YADF;AA9CJ,SAAS,WAAW,gBAAgC;AAEpD,SAAS,iBAAiB;AAC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] }, l.id)) })
|
|
205
205
|
] }),
|
|
206
206
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
207
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section_heading.SectionHeading, { title: t("Licenses issued on your
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section_heading.SectionHeading, { title: t("Licenses issued on your NFTs") }),
|
|
208
208
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LicenseList, { loading: issuedLoading, empty: import_empty_messages.emptyMessages.issuedLicenses, children: issued.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel relative overflow-hidden p-4", children: [
|
|
209
209
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", l.assetContract, l.assetTokenId), className: "hover:underline", children: t("License on this asset") }) }),
|
|
210
210
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-sponsorships.tsx"],"sourcesContent":["\"use client\";\n\nimport { SectionHeading } from \"./section-heading.js\";\nimport { useState } from \"react\";\nimport { CheckCircle2, Handshake, Loader2, X } from \"lucide-react\";\nimport { assetHref, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useSponsorshipBids, useSponsorshipLicenses, useSponsorshipOffers, useSponsorshipProposals } from \"../utils/use-sponsorship.js\";\nimport { emptyMessages, type EmptyMessage } from \"../utils/empty-messages.js\";\nimport { successMessages, type SuccessMessage } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport type { T } from \"../i18n/make-t.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\n\ntype Api = ReturnType<ReturnType<typeof useMedialaneApp>[\"getClient\"]>[\"api\"];\n\nfunction useRowAction(copy: { title: string; working: string; message: (t: T) => SuccessMessage }) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [activeId, setActiveId] = useState<string | null>(null);\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const run = (id: string, create: (api: Api) => ReturnType<Parameters<typeof runIntentCalls>[1]>, then: () => Promise<unknown>) => {\n setActiveId(id);\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => create(app.getClient().api));\n })\n .then((ok) => (ok ? then() : undefined))\n .finally(() => setActiveId(null));\n };\n\n const dialog = (\n <TransactionDialog tx={tx} title={t(copy.title)} workingLabel={t(copy.working)} firstStepLabel={t(\"Prepare\")}>\n <TransactionSuccess name={t(copy.title)} {...copy.message(t)} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n );\n\n return { run, dialog, busy, activeId };\n}\n\nfunction Spinner({ active, idle, className }: { active: boolean; idle: React.ReactNode; className?: string }) {\n return active ? <Loader2 className={`h-3 w-3 animate-spin ${className ?? \"\"}`} /> : <>{idle}</>;\n}\n\nfunction OfferBidsRow({ offer }: { offer: ApiSponsorshipOffer }) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { bids, isLoading, mutate } = useSponsorshipBids(offer.offerId);\n const action = useRowAction({ title: msg(\"Accept bid\"), working: msg(\"Accepting the bid…\"), message: successMessages.bidAccepted });\n\n if (isLoading || bids.length === 0) return null;\n\n return (\n <div className=\"space-y-1.5 rounded-2xl bg-muted/30 p-3\">\n {action.dialog}\n <p className=\"text-xs font-semibold text-muted-foreground\">\n {t(\"Bids on\")} <Link href={assetHref(\"STARKNET\", offer.nftContract, offer.tokenId)} className=\"underline underline-offset-2\">{t(\"View asset\")}</Link>\n </p>\n {bids.map((bid) => (\n <div key={bid.id} className=\"flex items-center justify-between gap-2 text-xs\">\n <AddressDisplay address={bid.sponsor} chars={4} showCopy={false} className=\"text-muted-foreground\" />\n <ActionButton\n small\n className=\"h-7 px-2.5\"\n aria-label={t(\"Accept bid\")}\n disabled={action.busy || !walletAddress}\n onClick={() =>\n action.run(\n bid.id,\n (api) => api.intents.create(\"sponsorship-bid-accept\", { author: walletAddress!, offerId: offer.offerId, sponsor: bid.sponsor }),\n () => mutate(),\n )\n }\n >\n <Spinner active={action.busy && action.activeId === bid.id} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n ))}\n </div>\n );\n}\n\nfunction ReceivedProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ owner: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Respond to proposal\"), working: msg(\"Sending your response…\"), message: successMessages.responseSent });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No proposals awaiting your decision.\")}</p>;\n\n const respond = (proposalId: string, decision: \"accept\" | \"reject\") =>\n action.run(\n proposalId,\n (api) =>\n decision === \"accept\"\n ? api.intents.create(\"sponsorship-proposal-accept\", { owner: walletAddress, proposalId })\n : api.intents.create(\"sponsorship-proposal-reject\", { owner: walletAddress, proposalId }),\n () => mutate(),\n );\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">\n <AddressDisplay address={p.proposer} chars={4} showCopy={false} />{\" \"}{t(\"proposed {amount}\", { amount: p.amount })}\n </p>\n </div>\n <div className=\"flex gap-1.5 shrink-0\">\n <Button size=\"sm\" variant=\"soft\" aria-label={t(\"Decline proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"reject\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<X className=\"h-3 w-3\" />} />\n </Button>\n <ActionButton small aria-label={t(\"Accept proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"accept\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction SentProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ proposer: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Withdraw proposal\"), working: msg(\"Withdrawing your proposal…\"), message: successMessages.proposalWithdrawn });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No pending proposals sent.\")}</p>;\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"You proposed {amount}\", { amount: p.amount })}</p>\n </div>\n <Button\n size=\"sm\"\n variant=\"soft\"\n disabled={action.busy}\n onClick={() =>\n action.run(p.proposalId, (api) => api.intents.create(\"sponsorship-proposal-withdraw\", { proposer: walletAddress, proposalId: p.proposalId }), () => mutate())\n }\n >\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={null} className=\"mr-1.5\" />\n {t(\"Withdraw\")}\n </Button>\n </div>\n ))}\n </div>\n );\n}\n\nfunction LicenseList({ loading, empty, children }: { loading: boolean; empty: EmptyMessage; children: React.ReactNode[] }) {\n const t = useT();\n if (loading) return <Skeleton className=\"h-16 w-full rounded-xl\" />;\n if (children.length === 0) {\n return (\n <div>\n <p className=\"text-sm font-medium\">{t(empty.title)}</p>\n <p className=\"text-sm text-muted-foreground\">{t(empty.description)}</p>\n </div>\n );\n }\n return <div className=\"space-y-2\">{children}</div>;\n}\n\nexport function PortfolioSponsorships() {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { offers } = useSponsorshipOffers(walletAddress ? { author: walletAddress, open: true } : undefined);\n const { licenses: held, isLoading: heldLoading } = useSponsorshipLicenses(walletAddress ? { holder: walletAddress } : undefined);\n const { licenses: issued, isLoading: issuedLoading } = useSponsorshipLicenses(walletAddress ? { author: walletAddress } : undefined);\n\n if (!walletAddress) return null;\n\n return (\n <div className=\"space-y-8\">\n <section className=\"space-y-3\">\n <SectionHeading icon={<Handshake />} title={t(\"Proposals awaiting your decision\")} />\n <ReceivedProposals walletAddress={walletAddress} />\n </section>\n\n {offers.length > 0 && (\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Bids on your offers\")} />\n <div className=\"space-y-2\">\n {offers.map((o) => <OfferBidsRow key={o.id} offer={o} />)}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Proposals you've sent\")} />\n <SentProposals walletAddress={walletAddress} />\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses you hold\")} />\n <LicenseList loading={heldLoading} empty={emptyMessages.heldLicenses}>\n {held.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"from\")} <AddressDisplay address={l.author} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses issued on your work\")} />\n <LicenseList loading={issuedLoading} empty={emptyMessages.issuedLicenses}>\n {issued.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"held by\")} <AddressDisplay address={l.currentHolder ?? l.recipient} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CM;AA1CN,6BAA+B;AAC/B,mBAAyB;AACzB,0BAAoD;AACpD,iBAAoD;AACpD,6BAA+B;AAC/B,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,sBAAyB;AACzB,gCAAkC;AAClC,iCAAmC;AACnC,8BAA+B;AAC/B,6BAA0G;AAC1G,4BAAiD;AACjD,8BAAqD;AACrD,6BAA+B;AAC/B,sBAAqB;AAErB,uBAAoB;AACpB,2BAA6B;AAI7B,SAAS,aAAa,MAA6E;AACjG,QAAM,QAAI,sBAAK;AACf,QAAM,UAAM,sCAAgB;AAC5B,QAAM,SAAK,uCAAe;AAC1B,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAwB,IAAI;AAC5D,QAAM,OAAO,GAAG,UAAU,eAAe,GAAG,UAAU,gBAAgB,GAAG,UAAU;AAEnF,QAAM,MAAM,CAAC,IAAY,QAAwE,SAAiC;AAChI,gBAAY,EAAE;AACd,SAAK,GACF,I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AC/C;AAAA,IAEA,6CAAC,aAAQ,WAAU,aACjB;AAAA,kDAAC,yCAAe,OAAO,EAAE,mBAAmB,GAAG;AAAA,MAC/C,4CAAC,eAAY,SAAS,aAAa,OAAO,oCAAc,cACrD,eAAK,IAAI,CAAC,MACT,6CAAC,SAAe,WAAU,sCACxB;AAAA,oDAAC,OAAE,WAAU,yBACX,sDAAC,YAAAA,SAAA,EAAK,UAAM,sBAAU,YAAY,EAAE,eAAe,EAAE,YAAY,GAAG,WAAU,mBAAmB,YAAE,uBAAuB,GAAE,GAC9H;AAAA,QACA,6CAAC,OAAE,WAAU,iCAAiC;AAAA,YAAE,MAAM;AAAA,UAAE;AAAA,UAAC,4CAAC,yCAAe,SAAS,EAAE,QAAQ,OAAO,GAAG,UAAU,OAAO;AAAA,WAAE;AAAA,WAJjH,EAAE,EAKZ,CACD,GACH;AAAA,OACF;AAAA,IAEA,6CAAC,aAAQ,WAAU,aACjB;AAAA,kDAAC,yCAAe,OAAO,EAAE,8BAA8B,GAAG;AAAA,MAC1D,4CAAC,eAAY,SAAS,eAAe,OAAO,oCAAc,gBACvD,iBAAO,IAAI,CAAC,MACX,6CAAC,SAAe,WAAU,sCACxB;AAAA,oDAAC,OAAE,WAAU,yBACX,sDAAC,YAAAA,SAAA,EAAK,UAAM,sBAAU,YAAY,EAAE,eAAe,EAAE,YAAY,GAAG,WAAU,mBAAmB,YAAE,uBAAuB,GAAE,GAC9H;AAAA,QACA,6CAAC,OAAE,WAAU,iCAAiC;AAAA,YAAE,SAAS;AAAA,UAAE;AAAA,UAAC,4CAAC,yCAAe,SAAS,EAAE,iBAAiB,EAAE,WAAW,OAAO,GAAG,UAAU,OAAO;AAAA,WAAE;AAAA,WAJ1I,EAAE,EAKZ,CACD,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":["Link"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-sponsorships.tsx"],"sourcesContent":["\"use client\";\n\nimport { SectionHeading } from \"./section-heading.js\";\nimport { useState } from \"react\";\nimport { CheckCircle2, Handshake, Loader2, X } from \"lucide-react\";\nimport { assetHref, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useSponsorshipBids, useSponsorshipLicenses, useSponsorshipOffers, useSponsorshipProposals } from \"../utils/use-sponsorship.js\";\nimport { emptyMessages, type EmptyMessage } from \"../utils/empty-messages.js\";\nimport { successMessages, type SuccessMessage } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport type { T } from \"../i18n/make-t.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\n\ntype Api = ReturnType<ReturnType<typeof useMedialaneApp>[\"getClient\"]>[\"api\"];\n\nfunction useRowAction(copy: { title: string; working: string; message: (t: T) => SuccessMessage }) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [activeId, setActiveId] = useState<string | null>(null);\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const run = (id: string, create: (api: Api) => ReturnType<Parameters<typeof runIntentCalls>[1]>, then: () => Promise<unknown>) => {\n setActiveId(id);\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => create(app.getClient().api));\n })\n .then((ok) => (ok ? then() : undefined))\n .finally(() => setActiveId(null));\n };\n\n const dialog = (\n <TransactionDialog tx={tx} title={t(copy.title)} workingLabel={t(copy.working)} firstStepLabel={t(\"Prepare\")}>\n <TransactionSuccess name={t(copy.title)} {...copy.message(t)} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n );\n\n return { run, dialog, busy, activeId };\n}\n\nfunction Spinner({ active, idle, className }: { active: boolean; idle: React.ReactNode; className?: string }) {\n return active ? <Loader2 className={`h-3 w-3 animate-spin ${className ?? \"\"}`} /> : <>{idle}</>;\n}\n\nfunction OfferBidsRow({ offer }: { offer: ApiSponsorshipOffer }) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { bids, isLoading, mutate } = useSponsorshipBids(offer.offerId);\n const action = useRowAction({ title: msg(\"Accept bid\"), working: msg(\"Accepting the bid…\"), message: successMessages.bidAccepted });\n\n if (isLoading || bids.length === 0) return null;\n\n return (\n <div className=\"space-y-1.5 rounded-2xl bg-muted/30 p-3\">\n {action.dialog}\n <p className=\"text-xs font-semibold text-muted-foreground\">\n {t(\"Bids on\")} <Link href={assetHref(\"STARKNET\", offer.nftContract, offer.tokenId)} className=\"underline underline-offset-2\">{t(\"View asset\")}</Link>\n </p>\n {bids.map((bid) => (\n <div key={bid.id} className=\"flex items-center justify-between gap-2 text-xs\">\n <AddressDisplay address={bid.sponsor} chars={4} showCopy={false} className=\"text-muted-foreground\" />\n <ActionButton\n small\n className=\"h-7 px-2.5\"\n aria-label={t(\"Accept bid\")}\n disabled={action.busy || !walletAddress}\n onClick={() =>\n action.run(\n bid.id,\n (api) => api.intents.create(\"sponsorship-bid-accept\", { author: walletAddress!, offerId: offer.offerId, sponsor: bid.sponsor }),\n () => mutate(),\n )\n }\n >\n <Spinner active={action.busy && action.activeId === bid.id} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n ))}\n </div>\n );\n}\n\nfunction ReceivedProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ owner: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Respond to proposal\"), working: msg(\"Sending your response…\"), message: successMessages.responseSent });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No proposals awaiting your decision.\")}</p>;\n\n const respond = (proposalId: string, decision: \"accept\" | \"reject\") =>\n action.run(\n proposalId,\n (api) =>\n decision === \"accept\"\n ? api.intents.create(\"sponsorship-proposal-accept\", { owner: walletAddress, proposalId })\n : api.intents.create(\"sponsorship-proposal-reject\", { owner: walletAddress, proposalId }),\n () => mutate(),\n );\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">\n <AddressDisplay address={p.proposer} chars={4} showCopy={false} />{\" \"}{t(\"proposed {amount}\", { amount: p.amount })}\n </p>\n </div>\n <div className=\"flex gap-1.5 shrink-0\">\n <Button size=\"sm\" variant=\"soft\" aria-label={t(\"Decline proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"reject\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<X className=\"h-3 w-3\" />} />\n </Button>\n <ActionButton small aria-label={t(\"Accept proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"accept\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction SentProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ proposer: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Withdraw proposal\"), working: msg(\"Withdrawing your proposal…\"), message: successMessages.proposalWithdrawn });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No pending proposals sent.\")}</p>;\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"You proposed {amount}\", { amount: p.amount })}</p>\n </div>\n <Button\n size=\"sm\"\n variant=\"soft\"\n disabled={action.busy}\n onClick={() =>\n action.run(p.proposalId, (api) => api.intents.create(\"sponsorship-proposal-withdraw\", { proposer: walletAddress, proposalId: p.proposalId }), () => mutate())\n }\n >\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={null} className=\"mr-1.5\" />\n {t(\"Withdraw\")}\n </Button>\n </div>\n ))}\n </div>\n );\n}\n\nfunction LicenseList({ loading, empty, children }: { loading: boolean; empty: EmptyMessage; children: React.ReactNode[] }) {\n const t = useT();\n if (loading) return <Skeleton className=\"h-16 w-full rounded-xl\" />;\n if (children.length === 0) {\n return (\n <div>\n <p className=\"text-sm font-medium\">{t(empty.title)}</p>\n <p className=\"text-sm text-muted-foreground\">{t(empty.description)}</p>\n </div>\n );\n }\n return <div className=\"space-y-2\">{children}</div>;\n}\n\nexport function PortfolioSponsorships() {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { offers } = useSponsorshipOffers(walletAddress ? { author: walletAddress, open: true } : undefined);\n const { licenses: held, isLoading: heldLoading } = useSponsorshipLicenses(walletAddress ? { holder: walletAddress } : undefined);\n const { licenses: issued, isLoading: issuedLoading } = useSponsorshipLicenses(walletAddress ? { author: walletAddress } : undefined);\n\n if (!walletAddress) return null;\n\n return (\n <div className=\"space-y-8\">\n <section className=\"space-y-3\">\n <SectionHeading icon={<Handshake />} title={t(\"Proposals awaiting your decision\")} />\n <ReceivedProposals walletAddress={walletAddress} />\n </section>\n\n {offers.length > 0 && (\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Bids on your offers\")} />\n <div className=\"space-y-2\">\n {offers.map((o) => <OfferBidsRow key={o.id} offer={o} />)}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Proposals you've sent\")} />\n <SentProposals walletAddress={walletAddress} />\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses you hold\")} />\n <LicenseList loading={heldLoading} empty={emptyMessages.heldLicenses}>\n {held.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"from\")} <AddressDisplay address={l.author} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses issued on your NFTs\")} />\n <LicenseList loading={issuedLoading} empty={emptyMessages.issuedLicenses}>\n {issued.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"held by\")} <AddressDisplay address={l.currentHolder ?? l.recipient} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CM;AA1CN,6BAA+B;AAC/B,mBAAyB;AACzB,0BAAoD;AACpD,iBAAoD;AACpD,6BAA+B;AAC/B,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,sBAAyB;AACzB,gCAAkC;AAClC,iCAAmC;AACnC,8BAA+B;AAC/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Ae,EAAE,YAAY,GAAG,WAAU,mBAAmB,YAAE,uBAAuB,GAAE,GAC9H;AAAA,QACA,6CAAC,OAAE,WAAU,iCAAiC;AAAA,YAAE,SAAS;AAAA,UAAE;AAAA,UAAC,4CAAC,yCAAe,SAAS,EAAE,iBAAiB,EAAE,WAAW,OAAO,GAAG,UAAU,OAAO;AAAA,WAAE;AAAA,WAJ1I,EAAE,EAKZ,CACD,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":["Link"]}
|
|
@@ -171,7 +171,7 @@ function PortfolioSponsorships() {
|
|
|
171
171
|
] }, l.id)) })
|
|
172
172
|
] }),
|
|
173
173
|
/* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
174
|
-
/* @__PURE__ */ jsx(SectionHeading, { title: t("Licenses issued on your
|
|
174
|
+
/* @__PURE__ */ jsx(SectionHeading, { title: t("Licenses issued on your NFTs") }),
|
|
175
175
|
/* @__PURE__ */ jsx(LicenseList, { loading: issuedLoading, empty: emptyMessages.issuedLicenses, children: issued.map((l) => /* @__PURE__ */ jsxs("div", { className: "panel relative overflow-hidden p-4", children: [
|
|
176
176
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ jsx(Link, { href: assetHref("STARKNET", l.assetContract, l.assetTokenId), className: "hover:underline", children: t("License on this asset") }) }),
|
|
177
177
|
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-sponsorships.tsx"],"sourcesContent":["\"use client\";\n\nimport { SectionHeading } from \"./section-heading.js\";\nimport { useState } from \"react\";\nimport { CheckCircle2, Handshake, Loader2, X } from \"lucide-react\";\nimport { assetHref, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useSponsorshipBids, useSponsorshipLicenses, useSponsorshipOffers, useSponsorshipProposals } from \"../utils/use-sponsorship.js\";\nimport { emptyMessages, type EmptyMessage } from \"../utils/empty-messages.js\";\nimport { successMessages, type SuccessMessage } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport type { T } from \"../i18n/make-t.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\n\ntype Api = ReturnType<ReturnType<typeof useMedialaneApp>[\"getClient\"]>[\"api\"];\n\nfunction useRowAction(copy: { title: string; working: string; message: (t: T) => SuccessMessage }) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [activeId, setActiveId] = useState<string | null>(null);\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const run = (id: string, create: (api: Api) => ReturnType<Parameters<typeof runIntentCalls>[1]>, then: () => Promise<unknown>) => {\n setActiveId(id);\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => create(app.getClient().api));\n })\n .then((ok) => (ok ? then() : undefined))\n .finally(() => setActiveId(null));\n };\n\n const dialog = (\n <TransactionDialog tx={tx} title={t(copy.title)} workingLabel={t(copy.working)} firstStepLabel={t(\"Prepare\")}>\n <TransactionSuccess name={t(copy.title)} {...copy.message(t)} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n );\n\n return { run, dialog, busy, activeId };\n}\n\nfunction Spinner({ active, idle, className }: { active: boolean; idle: React.ReactNode; className?: string }) {\n return active ? <Loader2 className={`h-3 w-3 animate-spin ${className ?? \"\"}`} /> : <>{idle}</>;\n}\n\nfunction OfferBidsRow({ offer }: { offer: ApiSponsorshipOffer }) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { bids, isLoading, mutate } = useSponsorshipBids(offer.offerId);\n const action = useRowAction({ title: msg(\"Accept bid\"), working: msg(\"Accepting the bid…\"), message: successMessages.bidAccepted });\n\n if (isLoading || bids.length === 0) return null;\n\n return (\n <div className=\"space-y-1.5 rounded-2xl bg-muted/30 p-3\">\n {action.dialog}\n <p className=\"text-xs font-semibold text-muted-foreground\">\n {t(\"Bids on\")} <Link href={assetHref(\"STARKNET\", offer.nftContract, offer.tokenId)} className=\"underline underline-offset-2\">{t(\"View asset\")}</Link>\n </p>\n {bids.map((bid) => (\n <div key={bid.id} className=\"flex items-center justify-between gap-2 text-xs\">\n <AddressDisplay address={bid.sponsor} chars={4} showCopy={false} className=\"text-muted-foreground\" />\n <ActionButton\n small\n className=\"h-7 px-2.5\"\n aria-label={t(\"Accept bid\")}\n disabled={action.busy || !walletAddress}\n onClick={() =>\n action.run(\n bid.id,\n (api) => api.intents.create(\"sponsorship-bid-accept\", { author: walletAddress!, offerId: offer.offerId, sponsor: bid.sponsor }),\n () => mutate(),\n )\n }\n >\n <Spinner active={action.busy && action.activeId === bid.id} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n ))}\n </div>\n );\n}\n\nfunction ReceivedProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ owner: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Respond to proposal\"), working: msg(\"Sending your response…\"), message: successMessages.responseSent });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No proposals awaiting your decision.\")}</p>;\n\n const respond = (proposalId: string, decision: \"accept\" | \"reject\") =>\n action.run(\n proposalId,\n (api) =>\n decision === \"accept\"\n ? api.intents.create(\"sponsorship-proposal-accept\", { owner: walletAddress, proposalId })\n : api.intents.create(\"sponsorship-proposal-reject\", { owner: walletAddress, proposalId }),\n () => mutate(),\n );\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">\n <AddressDisplay address={p.proposer} chars={4} showCopy={false} />{\" \"}{t(\"proposed {amount}\", { amount: p.amount })}\n </p>\n </div>\n <div className=\"flex gap-1.5 shrink-0\">\n <Button size=\"sm\" variant=\"soft\" aria-label={t(\"Decline proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"reject\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<X className=\"h-3 w-3\" />} />\n </Button>\n <ActionButton small aria-label={t(\"Accept proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"accept\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction SentProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ proposer: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Withdraw proposal\"), working: msg(\"Withdrawing your proposal…\"), message: successMessages.proposalWithdrawn });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No pending proposals sent.\")}</p>;\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"You proposed {amount}\", { amount: p.amount })}</p>\n </div>\n <Button\n size=\"sm\"\n variant=\"soft\"\n disabled={action.busy}\n onClick={() =>\n action.run(p.proposalId, (api) => api.intents.create(\"sponsorship-proposal-withdraw\", { proposer: walletAddress, proposalId: p.proposalId }), () => mutate())\n }\n >\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={null} className=\"mr-1.5\" />\n {t(\"Withdraw\")}\n </Button>\n </div>\n ))}\n </div>\n );\n}\n\nfunction LicenseList({ loading, empty, children }: { loading: boolean; empty: EmptyMessage; children: React.ReactNode[] }) {\n const t = useT();\n if (loading) return <Skeleton className=\"h-16 w-full rounded-xl\" />;\n if (children.length === 0) {\n return (\n <div>\n <p className=\"text-sm font-medium\">{t(empty.title)}</p>\n <p className=\"text-sm text-muted-foreground\">{t(empty.description)}</p>\n </div>\n );\n }\n return <div className=\"space-y-2\">{children}</div>;\n}\n\nexport function PortfolioSponsorships() {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { offers } = useSponsorshipOffers(walletAddress ? { author: walletAddress, open: true } : undefined);\n const { licenses: held, isLoading: heldLoading } = useSponsorshipLicenses(walletAddress ? { holder: walletAddress } : undefined);\n const { licenses: issued, isLoading: issuedLoading } = useSponsorshipLicenses(walletAddress ? { author: walletAddress } : undefined);\n\n if (!walletAddress) return null;\n\n return (\n <div className=\"space-y-8\">\n <section className=\"space-y-3\">\n <SectionHeading icon={<Handshake />} title={t(\"Proposals awaiting your decision\")} />\n <ReceivedProposals walletAddress={walletAddress} />\n </section>\n\n {offers.length > 0 && (\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Bids on your offers\")} />\n <div className=\"space-y-2\">\n {offers.map((o) => <OfferBidsRow key={o.id} offer={o} />)}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Proposals you've sent\")} />\n <SentProposals walletAddress={walletAddress} />\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses you hold\")} />\n <LicenseList loading={heldLoading} empty={emptyMessages.heldLicenses}>\n {held.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"from\")} <AddressDisplay address={l.author} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses issued on your work\")} />\n <LicenseList loading={issuedLoading} empty={emptyMessages.issuedLicenses}>\n {issued.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"held by\")} <AddressDisplay address={l.currentHolder ?? l.recipient} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n </div>\n );\n}\n"],"mappings":";AA4CM,SAQgF,UARhF,KAsBA,YAtBA;AA1CN,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,cAAc,WAAW,SAAS,SAAS;AACpD,SAAS,iBAA2C;AACpD,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB,wBAAwB,sBAAsB,+BAA+B;AAC1G,SAAS,qBAAwC;AACjD,SAAS,uBAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAErB,SAAS,WAAW;AACpB,SAAS,oBAAoB;AAI7B,SAAS,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AAAA,WAAE;AAAA,WAJ1I,EAAE,EAKZ,CACD,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-sponsorships.tsx"],"sourcesContent":["\"use client\";\n\nimport { SectionHeading } from \"./section-heading.js\";\nimport { useState } from \"react\";\nimport { CheckCircle2, Handshake, Loader2, X } from \"lucide-react\";\nimport { assetHref, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useSponsorshipBids, useSponsorshipLicenses, useSponsorshipOffers, useSponsorshipProposals } from \"../utils/use-sponsorship.js\";\nimport { emptyMessages, type EmptyMessage } from \"../utils/empty-messages.js\";\nimport { successMessages, type SuccessMessage } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport type { T } from \"../i18n/make-t.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\n\ntype Api = ReturnType<ReturnType<typeof useMedialaneApp>[\"getClient\"]>[\"api\"];\n\nfunction useRowAction(copy: { title: string; working: string; message: (t: T) => SuccessMessage }) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [activeId, setActiveId] = useState<string | null>(null);\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const run = (id: string, create: (api: Api) => ReturnType<Parameters<typeof runIntentCalls>[1]>, then: () => Promise<unknown>) => {\n setActiveId(id);\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => create(app.getClient().api));\n })\n .then((ok) => (ok ? then() : undefined))\n .finally(() => setActiveId(null));\n };\n\n const dialog = (\n <TransactionDialog tx={tx} title={t(copy.title)} workingLabel={t(copy.working)} firstStepLabel={t(\"Prepare\")}>\n <TransactionSuccess name={t(copy.title)} {...copy.message(t)} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n );\n\n return { run, dialog, busy, activeId };\n}\n\nfunction Spinner({ active, idle, className }: { active: boolean; idle: React.ReactNode; className?: string }) {\n return active ? <Loader2 className={`h-3 w-3 animate-spin ${className ?? \"\"}`} /> : <>{idle}</>;\n}\n\nfunction OfferBidsRow({ offer }: { offer: ApiSponsorshipOffer }) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { bids, isLoading, mutate } = useSponsorshipBids(offer.offerId);\n const action = useRowAction({ title: msg(\"Accept bid\"), working: msg(\"Accepting the bid…\"), message: successMessages.bidAccepted });\n\n if (isLoading || bids.length === 0) return null;\n\n return (\n <div className=\"space-y-1.5 rounded-2xl bg-muted/30 p-3\">\n {action.dialog}\n <p className=\"text-xs font-semibold text-muted-foreground\">\n {t(\"Bids on\")} <Link href={assetHref(\"STARKNET\", offer.nftContract, offer.tokenId)} className=\"underline underline-offset-2\">{t(\"View asset\")}</Link>\n </p>\n {bids.map((bid) => (\n <div key={bid.id} className=\"flex items-center justify-between gap-2 text-xs\">\n <AddressDisplay address={bid.sponsor} chars={4} showCopy={false} className=\"text-muted-foreground\" />\n <ActionButton\n small\n className=\"h-7 px-2.5\"\n aria-label={t(\"Accept bid\")}\n disabled={action.busy || !walletAddress}\n onClick={() =>\n action.run(\n bid.id,\n (api) => api.intents.create(\"sponsorship-bid-accept\", { author: walletAddress!, offerId: offer.offerId, sponsor: bid.sponsor }),\n () => mutate(),\n )\n }\n >\n <Spinner active={action.busy && action.activeId === bid.id} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n ))}\n </div>\n );\n}\n\nfunction ReceivedProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ owner: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Respond to proposal\"), working: msg(\"Sending your response…\"), message: successMessages.responseSent });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No proposals awaiting your decision.\")}</p>;\n\n const respond = (proposalId: string, decision: \"accept\" | \"reject\") =>\n action.run(\n proposalId,\n (api) =>\n decision === \"accept\"\n ? api.intents.create(\"sponsorship-proposal-accept\", { owner: walletAddress, proposalId })\n : api.intents.create(\"sponsorship-proposal-reject\", { owner: walletAddress, proposalId }),\n () => mutate(),\n );\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">\n <AddressDisplay address={p.proposer} chars={4} showCopy={false} />{\" \"}{t(\"proposed {amount}\", { amount: p.amount })}\n </p>\n </div>\n <div className=\"flex gap-1.5 shrink-0\">\n <Button size=\"sm\" variant=\"soft\" aria-label={t(\"Decline proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"reject\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<X className=\"h-3 w-3\" />} />\n </Button>\n <ActionButton small aria-label={t(\"Accept proposal\")} disabled={action.busy} onClick={() => respond(p.proposalId, \"accept\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </ActionButton>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction SentProposals({ walletAddress }: { walletAddress: string }) {\n const t = useT();\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ proposer: walletAddress, open: true });\n const action = useRowAction({ title: msg(\"Withdraw proposal\"), working: msg(\"Withdrawing your proposal…\"), message: successMessages.proposalWithdrawn });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">{t(\"No pending proposals sent.\")}</p>;\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"panel relative overflow-hidden p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">{t(\"View asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"You proposed {amount}\", { amount: p.amount })}</p>\n </div>\n <Button\n size=\"sm\"\n variant=\"soft\"\n disabled={action.busy}\n onClick={() =>\n action.run(p.proposalId, (api) => api.intents.create(\"sponsorship-proposal-withdraw\", { proposer: walletAddress, proposalId: p.proposalId }), () => mutate())\n }\n >\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={null} className=\"mr-1.5\" />\n {t(\"Withdraw\")}\n </Button>\n </div>\n ))}\n </div>\n );\n}\n\nfunction LicenseList({ loading, empty, children }: { loading: boolean; empty: EmptyMessage; children: React.ReactNode[] }) {\n const t = useT();\n if (loading) return <Skeleton className=\"h-16 w-full rounded-xl\" />;\n if (children.length === 0) {\n return (\n <div>\n <p className=\"text-sm font-medium\">{t(empty.title)}</p>\n <p className=\"text-sm text-muted-foreground\">{t(empty.description)}</p>\n </div>\n );\n }\n return <div className=\"space-y-2\">{children}</div>;\n}\n\nexport function PortfolioSponsorships() {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const { offers } = useSponsorshipOffers(walletAddress ? { author: walletAddress, open: true } : undefined);\n const { licenses: held, isLoading: heldLoading } = useSponsorshipLicenses(walletAddress ? { holder: walletAddress } : undefined);\n const { licenses: issued, isLoading: issuedLoading } = useSponsorshipLicenses(walletAddress ? { author: walletAddress } : undefined);\n\n if (!walletAddress) return null;\n\n return (\n <div className=\"space-y-8\">\n <section className=\"space-y-3\">\n <SectionHeading icon={<Handshake />} title={t(\"Proposals awaiting your decision\")} />\n <ReceivedProposals walletAddress={walletAddress} />\n </section>\n\n {offers.length > 0 && (\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Bids on your offers\")} />\n <div className=\"space-y-2\">\n {offers.map((o) => <OfferBidsRow key={o.id} offer={o} />)}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Proposals you've sent\")} />\n <SentProposals walletAddress={walletAddress} />\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses you hold\")} />\n <LicenseList loading={heldLoading} empty={emptyMessages.heldLicenses}>\n {held.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"from\")} <AddressDisplay address={l.author} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n\n <section className=\"space-y-3\">\n <SectionHeading title={t(\"Licenses issued on your NFTs\")} />\n <LicenseList loading={issuedLoading} empty={emptyMessages.issuedLicenses}>\n {issued.map((l) => (\n <div key={l.id} className=\"panel relative overflow-hidden p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">{t(\"License on this asset\")}</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">{t(\"held by\")} <AddressDisplay address={l.currentHolder ?? l.recipient} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n </div>\n );\n}\n"],"mappings":";AA4CM,SAQgF,UARhF,KAsBA,YAtBA;AA1CN,SAAS,sBAAsB;AAC/B,S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,8BAA8B,GAAG;AAAA,MAC1D,oBAAC,eAAY,SAAS,eAAe,OAAO,cAAc,gBACvD,iBAAO,IAAI,CAAC,MACX,qBAAC,SAAe,WAAU,sCACxB;AAAA,4BAAC,OAAE,WAAU,yBACX,8BAAC,QAAK,MAAM,UAAU,YAAY,EAAE,eAAe,EAAE,YAAY,GAAG,WAAU,mBAAmB,YAAE,uBAAuB,GAAE,GAC9H;AAAA,QACA,qBAAC,OAAE,WAAU,iCAAiC;AAAA,YAAE,SAAS;AAAA,UAAE;AAAA,UAAC,oBAAC,kBAAe,SAAS,EAAE,iBAAiB,EAAE,WAAW,OAAO,GAAG,UAAU,OAAO;AAAA,WAAE;AAAA,WAJ1I,EAAE,EAKZ,CACD,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -100,7 +100,7 @@ function RemixableCard({ token }) {
|
|
|
100
100
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: t("Derivatives: allowed") }),
|
|
101
101
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs font-semibold pt-1 inline-flex items-center gap-1.5", children: [
|
|
102
102
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.GitBranch, { className: "h-3 w-3" }),
|
|
103
|
-
t("Remix this
|
|
103
|
+
t("Remix this NFT")
|
|
104
104
|
] })
|
|
105
105
|
] })
|
|
106
106
|
]
|
|
@@ -126,18 +126,18 @@ function RemixBrowsePage() {
|
|
|
126
126
|
back: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.BackButton, {}),
|
|
127
127
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.GitBranch, {}),
|
|
128
128
|
title: t("Remix"),
|
|
129
|
-
subtitle: t("Pick
|
|
129
|
+
subtitle: t("Pick an NFT open to remixing.")
|
|
130
130
|
}
|
|
131
131
|
),
|
|
132
132
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "space-y-6", children: isLoading && tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RemixableCardSkeleton, {}, i)) }) : error && tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel relative overflow-hidden p-10 flex flex-col items-center gap-3 text-center", children: [
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold", children: t("Could not load
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold", children: t("Could not load NFTs") }),
|
|
134
134
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: t("Check your connection and try again.") }),
|
|
135
135
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "soft", size: "sm", onClick: () => location.reload(), children: t("Retry") })
|
|
136
136
|
] }) : tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel relative overflow-hidden p-10 flex flex-col items-center gap-4 text-center", children: [
|
|
137
137
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Inbox, { className: "h-10 w-10 text-muted-foreground/30" }),
|
|
138
138
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
139
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold", children: t("No
|
|
140
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground mt-1 max-w-sm", children: t("Remixable
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold", children: t("No NFTs open to remixing yet") }),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground mt-1 max-w-sm", children: t("Remixable NFTs appear here.") })
|
|
141
141
|
] })
|
|
142
142
|
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
143
143
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.Stagger, { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: tokens.map((t2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.StaggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RemixableCard, { token: t2 }) }, `${t2.contractAddress}-${t2.tokenId}`)) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/remix-browse-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader } from \"./page-header.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneClient } from \"../utils/use-medialane-client.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { GitBranch, ImageIcon, Inbox } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\n\nconst PAGE_SIZE = 24;\n\nfunction useRemixableTokens() {\n const client = useMedialaneClient();\n const [tokens, setTokens] = useState<ApiToken[]>([]);\n const [page, setPage] = useState(1);\n const [isLoading, setIsLoading] = useState(true);\n const [hasMore, setHasMore] = useState(false);\n const [error, setError] = useState(false);\n\n useEffect(() => {\n let cancelled = false;\n setIsLoading(true);\n client.api.tokens.list({ derivatives: \"allowed\", limit: PAGE_SIZE, page })\n .then((json) => {\n if (cancelled) return;\n setTokens((prev) => (page === 1 ? json.data : [...prev, ...json.data]));\n setHasMore(page * PAGE_SIZE < (json.meta?.total ?? 0));\n })\n .catch(() => { if (!cancelled) setError(true); })\n .finally(() => { if (!cancelled) setIsLoading(false); });\n return () => { cancelled = true; };\n }, [client, page]);\n\n return { tokens, isLoading, hasMore, error, loadMore: () => setPage((p) => p + 1) };\n}\n\nfunction RemixableCard({ token }: { token: ApiToken }) {\n const t = useT();\n const [imgError, setImgError] = useState(false);\n const imageUrl = useImageUrl()(token.metadata?.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const name = token.metadata?.name ?? `#${token.tokenId}`;\n\n return (\n <Link\n href={`/create/remix/${token.contractAddress}/${token.tokenId}`}\n className=\"panel group flex flex-col overflow-hidden transition-colors sm:hover:border-brand-blue/50 active:scale-[0.99] motion-reduce:transform-none\"\n >\n <div className=\"relative aspect-square bg-muted overflow-hidden\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={name}\n fill\n className=\"object-cover card-media\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <ImageIcon className=\"h-8 w-8 text-muted-foreground/30\" />\n </div>\n )}\n </div>\n <div className=\"p-4 space-y-1\">\n <p className=\"font-semibold text-sm leading-tight truncate\">{name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Derivatives: allowed\")}\n </p>\n <p className=\"text-xs font-semibold pt-1 inline-flex items-center gap-1.5\">\n <GitBranch className=\"h-3 w-3\" />\n {t(\"Remix this
|
|
1
|
+
{"version":3,"sources":["../../src/components/remix-browse-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader } from \"./page-header.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneClient } from \"../utils/use-medialane-client.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { GitBranch, ImageIcon, Inbox } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\n\nconst PAGE_SIZE = 24;\n\nfunction useRemixableTokens() {\n const client = useMedialaneClient();\n const [tokens, setTokens] = useState<ApiToken[]>([]);\n const [page, setPage] = useState(1);\n const [isLoading, setIsLoading] = useState(true);\n const [hasMore, setHasMore] = useState(false);\n const [error, setError] = useState(false);\n\n useEffect(() => {\n let cancelled = false;\n setIsLoading(true);\n client.api.tokens.list({ derivatives: \"allowed\", limit: PAGE_SIZE, page })\n .then((json) => {\n if (cancelled) return;\n setTokens((prev) => (page === 1 ? json.data : [...prev, ...json.data]));\n setHasMore(page * PAGE_SIZE < (json.meta?.total ?? 0));\n })\n .catch(() => { if (!cancelled) setError(true); })\n .finally(() => { if (!cancelled) setIsLoading(false); });\n return () => { cancelled = true; };\n }, [client, page]);\n\n return { tokens, isLoading, hasMore, error, loadMore: () => setPage((p) => p + 1) };\n}\n\nfunction RemixableCard({ token }: { token: ApiToken }) {\n const t = useT();\n const [imgError, setImgError] = useState(false);\n const imageUrl = useImageUrl()(token.metadata?.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const name = token.metadata?.name ?? `#${token.tokenId}`;\n\n return (\n <Link\n href={`/create/remix/${token.contractAddress}/${token.tokenId}`}\n className=\"panel group flex flex-col overflow-hidden transition-colors sm:hover:border-brand-blue/50 active:scale-[0.99] motion-reduce:transform-none\"\n >\n <div className=\"relative aspect-square bg-muted overflow-hidden\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={name}\n fill\n className=\"object-cover card-media\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <ImageIcon className=\"h-8 w-8 text-muted-foreground/30\" />\n </div>\n )}\n </div>\n <div className=\"p-4 space-y-1\">\n <p className=\"font-semibold text-sm leading-tight truncate\">{name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Derivatives: allowed\")}\n </p>\n <p className=\"text-xs font-semibold pt-1 inline-flex items-center gap-1.5\">\n <GitBranch className=\"h-3 w-3\" />\n {t(\"Remix this NFT\")}\n </p>\n </div>\n </Link>\n );\n}\n\nfunction RemixableCardSkeleton() {\n return (\n <div className=\"panel overflow-hidden\">\n <Skeleton className=\"aspect-square rounded-none\" />\n <div className=\"p-4 space-y-2\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-3 w-24\" />\n </div>\n </div>\n );\n}\n\nexport function RemixBrowsePage() {\n const t = useT();\n const { tokens, isLoading, hasMore, error, loadMore } = useRemixableTokens();\n\n return (\n <PageContainer variant=\"narrow\" className=\"space-y-8\">\n <PageHeader\n back={<BackButton />}\n icon={<GitBranch />}\n title={t(\"Remix\")}\n subtitle={t(\"Pick an NFT open to remixing.\")}\n />\n\n <section className=\"space-y-6\">\n {isLoading && tokens.length === 0 ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => (\n <RemixableCardSkeleton key={i} />\n ))}\n </div>\n ) : error && tokens.length === 0 ? (\n <div className=\"panel relative overflow-hidden p-10 flex flex-col items-center gap-3 text-center\">\n <p className=\"font-semibold\">{t(\"Could not load NFTs\")}</p>\n <p className=\"text-sm text-muted-foreground\">{t(\"Check your connection and try again.\")}</p>\n <Button variant=\"soft\" size=\"sm\" onClick={() => location.reload()}>{t(\"Retry\")}</Button>\n </div>\n ) : tokens.length === 0 ? (\n <FadeIn>\n <div className=\"panel relative overflow-hidden p-10 flex flex-col items-center gap-4 text-center\">\n <Inbox className=\"h-10 w-10 text-muted-foreground/30\" />\n <div>\n <p className=\"font-semibold\">{t(\"No NFTs open to remixing yet\")}</p>\n <p className=\"text-sm text-muted-foreground mt-1 max-w-sm\">\n {t(\"Remixable NFTs appear here.\")}\n </p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <>\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {tokens.map((t) => (\n <StaggerItem key={`${t.contractAddress}-${t.tokenId}`}>\n <RemixableCard token={t} />\n </StaggerItem>\n ))}\n </Stagger>\n {hasMore && (\n <div className=\"flex justify-center\">\n <Button variant=\"soft\" onClick={loadMore} disabled={isLoading}>\n {isLoading ? t(\"Loading…\") : t(\"Load more\")}\n </Button>\n </div>\n )}\n </>\n )}\n </section>\n </PageContainer>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0DU;AAxDV,mBAAoC;AACpC,kBAAiB;AACjB,mBAAkB;AAClB,4BAA8B;AAC9B,yBAA2B;AAC3B,yBAA2B;AAC3B,+BAA6C;AAC7C,sBAAyB;AACzB,oBAAuB;AACvB,kCAAmC;AACnC,2BAA4B;AAE5B,0BAA4C;AAC5C,sBAAqB;AAErB,MAAM,YAAY;AAElB,SAAS,qBAAqB;AAC5B,QAAM,aAAS,gDAAmB;AAClC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAqB,CAAC,CAAC;AACnD,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,CAAC;AAClC,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,IAAI;AAC/C,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,KAAK;AAC5C,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAS,KAAK;AAExC,8BAAU,MAAM;AACd,QAAI,YAAY;AAChB,iBAAa,IAAI;AACjB,WAAO,IAAI,OAAO,KAAK,EAAE,aAAa,WAAW,OAAO,WAAW,KAAK,CAAC,EACtE,KAAK,CAAC,SAAS;AACd,UAAI,UAAW;AACf,gBAAU,CAAC,SAAU,SAAS,IAAI,KAAK,OAAO,C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IACpB,4CAAC,mCACC,uDAAC,SAAI,WAAU,oFACb;AAAA,kDAAC,6BAAM,WAAU,sCAAqC;AAAA,MACtD,6CAAC,SACC;AAAA,oDAAC,OAAE,WAAU,iBAAiB,YAAE,8BAA8B,GAAE;AAAA,QAChE,4CAAC,OAAE,WAAU,+CACV,YAAE,6BAA6B,GAClC;AAAA,SACF;AAAA,OACF,GACF,IAEA,4EACE;AAAA,kDAAC,oCAAQ,WAAU,wDAChB,iBAAO,IAAI,CAACC,OACX,4CAAC,wCACC,sDAAC,iBAAc,OAAOA,IAAG,KADT,GAAGA,GAAE,eAAe,IAAIA,GAAE,OAAO,EAEnD,CACD,GACH;AAAA,MACC,WACC,4CAAC,SAAI,WAAU,uBACb,sDAAC,wBAAO,SAAQ,QAAO,SAAS,UAAU,UAAU,WACjD,sBAAY,EAAE,eAAU,IAAI,EAAE,WAAW,GAC5C,GACF;AAAA,OAEJ,GAEJ;AAAA,KACF;AAEJ;","names":["Link","Image","t"]}
|
|
@@ -67,7 +67,7 @@ function RemixableCard({ token }) {
|
|
|
67
67
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("Derivatives: allowed") }),
|
|
68
68
|
/* @__PURE__ */ jsxs("p", { className: "text-xs font-semibold pt-1 inline-flex items-center gap-1.5", children: [
|
|
69
69
|
/* @__PURE__ */ jsx(GitBranch, { className: "h-3 w-3" }),
|
|
70
|
-
t("Remix this
|
|
70
|
+
t("Remix this NFT")
|
|
71
71
|
] })
|
|
72
72
|
] })
|
|
73
73
|
]
|
|
@@ -93,18 +93,18 @@ function RemixBrowsePage() {
|
|
|
93
93
|
back: /* @__PURE__ */ jsx(BackButton, {}),
|
|
94
94
|
icon: /* @__PURE__ */ jsx(GitBranch, {}),
|
|
95
95
|
title: t("Remix"),
|
|
96
|
-
subtitle: t("Pick
|
|
96
|
+
subtitle: t("Pick an NFT open to remixing.")
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
99
|
/* @__PURE__ */ jsx("section", { className: "space-y-6", children: isLoading && tokens.length === 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx(RemixableCardSkeleton, {}, i)) }) : error && tokens.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "panel relative overflow-hidden p-10 flex flex-col items-center gap-3 text-center", children: [
|
|
100
|
-
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: t("Could not load
|
|
100
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: t("Could not load NFTs") }),
|
|
101
101
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("Check your connection and try again.") }),
|
|
102
102
|
/* @__PURE__ */ jsx(Button, { variant: "soft", size: "sm", onClick: () => location.reload(), children: t("Retry") })
|
|
103
103
|
] }) : tokens.length === 0 ? /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "panel relative overflow-hidden p-10 flex flex-col items-center gap-4 text-center", children: [
|
|
104
104
|
/* @__PURE__ */ jsx(Inbox, { className: "h-10 w-10 text-muted-foreground/30" }),
|
|
105
105
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
106
|
-
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: t("No
|
|
107
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1 max-w-sm", children: t("Remixable
|
|
106
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: t("No NFTs open to remixing yet") }),
|
|
107
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1 max-w-sm", children: t("Remixable NFTs appear here.") })
|
|
108
108
|
] })
|
|
109
109
|
] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
110
110
|
/* @__PURE__ */ jsx(Stagger, { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: tokens.map((t2) => /* @__PURE__ */ jsx(StaggerItem, { children: /* @__PURE__ */ jsx(RemixableCard, { token: t2 }) }, `${t2.contractAddress}-${t2.tokenId}`)) }),
|