@medialane/ui 0.233.0 → 0.235.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/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/launchpad/collection-create-form.cjs +302 -0
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -0
- package/dist/components/launchpad/collection-create-form.d.cts +11 -0
- package/dist/components/launchpad/collection-create-form.d.ts +11 -0
- package/dist/components/launchpad/collection-create-form.js +275 -0
- package/dist/components/launchpad/collection-create-form.js.map +1 -0
- package/dist/components/launchpad/collection-create-presets.cjs +147 -0
- package/dist/components/launchpad/collection-create-presets.cjs.map +1 -0
- package/dist/components/launchpad/collection-create-presets.d.cts +60 -0
- package/dist/components/launchpad/collection-create-presets.d.ts +60 -0
- package/dist/components/launchpad/collection-create-presets.js +120 -0
- package/dist/components/launchpad/collection-create-presets.js.map +1 -0
- package/dist/components/launchpad/tier-mint-form.cjs +425 -0
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -0
- package/dist/components/launchpad/tier-mint-form.d.cts +13 -0
- package/dist/components/launchpad/tier-mint-form.d.ts +13 -0
- package/dist/components/launchpad/tier-mint-form.js +391 -0
- package/dist/components/launchpad/tier-mint-form.js.map +1 -0
- package/dist/components/launchpad/tier-mint-presets.cjs +96 -0
- package/dist/components/launchpad/tier-mint-presets.cjs.map +1 -0
- package/dist/components/launchpad/tier-mint-presets.d.cts +58 -0
- package/dist/components/launchpad/tier-mint-presets.d.ts +58 -0
- package/dist/components/launchpad/tier-mint-presets.js +71 -0
- package/dist/components/launchpad/tier-mint-presets.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/run-intent-calls.cjs +9 -2
- package/dist/utils/run-intent-calls.cjs.map +1 -1
- package/dist/utils/run-intent-calls.d.cts +10 -1
- package/dist/utils/run-intent-calls.d.ts +10 -1
- package/dist/utils/run-intent-calls.js +7 -1
- package/dist/utils/run-intent-calls.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Layers, Ticket, Users } from "lucide-react";
|
|
2
|
+
const FREE = "Free to publish \u2014 protocol fee is zero.";
|
|
3
|
+
const CLUB_PRESET = {
|
|
4
|
+
service: "ip-club",
|
|
5
|
+
icon: Users,
|
|
6
|
+
iconClass: "text-brand-purple",
|
|
7
|
+
buttonClass: "bg-brand-purple",
|
|
8
|
+
signedOut: { title: "Secure your account to create a club", description: "Create a club, then mint membership cards for your community." },
|
|
9
|
+
shell: { title: "Create Club", subtitle: "One club \u2014 create membership tiers and mint cards to your community." },
|
|
10
|
+
dialog: { title: "Create club", workingLabel: "Creating your club\u2026", firstStepLabel: "Prepare metadata" },
|
|
11
|
+
success: { caption: "Your club is live", fallbackName: "Your club", reward: "create_club", againLabel: "Create another" },
|
|
12
|
+
cardFallbackSymbol: "Club",
|
|
13
|
+
copy: {
|
|
14
|
+
imageHeading: "Club image",
|
|
15
|
+
nameLabel: "Club name *",
|
|
16
|
+
namePlaceholder: "My Club",
|
|
17
|
+
nameHint: "Shown in wallets, explorers, and on every membership card.",
|
|
18
|
+
symbolPlaceholder: "CLUB",
|
|
19
|
+
symbolHint: "Short ticker \u2014 2 to 10 uppercase letters.",
|
|
20
|
+
descriptionPlaceholder: "Describe your club \u2014 what does membership unlock?",
|
|
21
|
+
submit: "Create Club",
|
|
22
|
+
footnotes: [FREE]
|
|
23
|
+
},
|
|
24
|
+
suggestSymbol: false,
|
|
25
|
+
registerAfterDeploy: false,
|
|
26
|
+
actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: "Create memberships" } : void 0 })
|
|
27
|
+
};
|
|
28
|
+
const TICKETS_PRESET = {
|
|
29
|
+
service: "ip-tickets",
|
|
30
|
+
icon: Ticket,
|
|
31
|
+
iconClass: "text-teal-500",
|
|
32
|
+
buttonClass: "bg-teal-600",
|
|
33
|
+
signedOut: { title: "Secure your account to create tickets", description: "Create a tickets collection, then mint tickets to your audience." },
|
|
34
|
+
shell: { title: "Create Ticket Collection", subtitle: "One collection \u2014 create tickets and mint them to your audience." },
|
|
35
|
+
dialog: { title: "Create tickets collection", workingLabel: "Creating your collection\u2026", firstStepLabel: "Prepare metadata" },
|
|
36
|
+
success: { caption: "Your collection is live", fallbackName: "Your collection", reward: "create_ticket_collection", againLabel: "Create another" },
|
|
37
|
+
cardFallbackSymbol: "Tickets",
|
|
38
|
+
copy: {
|
|
39
|
+
imageHeading: "Collection image",
|
|
40
|
+
nameLabel: "Collection name *",
|
|
41
|
+
namePlaceholder: "My Tickets",
|
|
42
|
+
nameHint: "Shown in wallets, explorers, and on every ticket.",
|
|
43
|
+
symbolPlaceholder: "TIX",
|
|
44
|
+
symbolHint: "Short ticker \u2014 2 to 10 uppercase letters.",
|
|
45
|
+
descriptionPlaceholder: "Describe your tickets \u2014 what do they admit or unlock?",
|
|
46
|
+
submit: "Create Ticket Collection",
|
|
47
|
+
footnotes: [FREE]
|
|
48
|
+
},
|
|
49
|
+
suggestSymbol: false,
|
|
50
|
+
registerAfterDeploy: false,
|
|
51
|
+
actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: "Create tickets" } : void 0 })
|
|
52
|
+
};
|
|
53
|
+
const EDITIONS_PRESET = {
|
|
54
|
+
service: "mip-erc1155",
|
|
55
|
+
icon: Layers,
|
|
56
|
+
iconClass: "text-brand-purple",
|
|
57
|
+
buttonClass: "bg-brand-purple",
|
|
58
|
+
signedOut: { title: "Secure your account to create a collection", description: "Create a collection where each piece can have multiple editions." },
|
|
59
|
+
shell: { title: "Create an Edition Collection", subtitle: "Create a collection where each piece can have multiple editions \u2014 free to publish, and it's yours." },
|
|
60
|
+
dialog: { title: "Create collection", workingLabel: "Creating your collection\u2026", firstStepLabel: "Prepare metadata" },
|
|
61
|
+
success: { caption: "Your collection is live", fallbackName: "Your collection", reward: "create_collection", againLabel: "Create another" },
|
|
62
|
+
cardFallbackSymbol: "Editions",
|
|
63
|
+
copy: {
|
|
64
|
+
imageHeading: "Collection image",
|
|
65
|
+
imageHelp: "This becomes the cover for your collection.",
|
|
66
|
+
nameLabel: "Collection name *",
|
|
67
|
+
namePlaceholder: "My Creative Works",
|
|
68
|
+
nameHint: "The main title collectors see across the collection page, wallets, and future listings.",
|
|
69
|
+
symbolPlaceholder: "MCW",
|
|
70
|
+
symbolHint: "Short ticker (2\u201310 uppercase letters). We suggest one from the collection name.",
|
|
71
|
+
descriptionPlaceholder: "Describe your collection and what kind of work it contains\u2026",
|
|
72
|
+
descriptionHint: "Use this to explain the creative direction, media type, or audience for the collection.",
|
|
73
|
+
submit: "Publish Collection",
|
|
74
|
+
footnotes: [
|
|
75
|
+
FREE,
|
|
76
|
+
"Next step: mint pieces into this collection \u2014 you set the number of copies for each piece when you mint it, and can add more copies later."
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
suggestSymbol: true,
|
|
80
|
+
registerAfterDeploy: true,
|
|
81
|
+
actions: ({ address, collectionHref }) => ({
|
|
82
|
+
primary: address ? { href: `/launchpad/nfteditions/${address}/mint`, label: "Mint tokens" } : void 0,
|
|
83
|
+
secondary: collectionHref ? { href: collectionHref, label: "View collection" } : void 0
|
|
84
|
+
})
|
|
85
|
+
};
|
|
86
|
+
const SINGLE_PRESET = {
|
|
87
|
+
service: null,
|
|
88
|
+
icon: Layers,
|
|
89
|
+
iconClass: "text-brand-blue",
|
|
90
|
+
buttonClass: "bg-brand-blue",
|
|
91
|
+
signedOut: { title: "Secure your account to create a collection", description: "Set up a collection to mint your work into." },
|
|
92
|
+
shell: { title: "Create a Collection", subtitle: "Set up a collection to mint your work into \u2014 free to publish, and it's yours." },
|
|
93
|
+
dialog: { title: "Create collection", workingLabel: "Creating your collection\u2026", firstStepLabel: "Prepare metadata" },
|
|
94
|
+
success: { caption: "Your collection is live", fallbackName: "Your collection", reward: "create_collection", againLabel: "Create another" },
|
|
95
|
+
cardFallbackSymbol: "Collection",
|
|
96
|
+
copy: {
|
|
97
|
+
imageHeading: "Collection image",
|
|
98
|
+
nameLabel: "Collection name *",
|
|
99
|
+
namePlaceholder: "My Creative Works",
|
|
100
|
+
nameHint: "The display name for your collection.",
|
|
101
|
+
symbolPlaceholder: "MCW",
|
|
102
|
+
symbolHint: "Short ticker (2\u201310 uppercase letters). Shown in wallets and marketplaces.",
|
|
103
|
+
descriptionPlaceholder: "Describe your collection and what kind of work it contains\u2026",
|
|
104
|
+
submit: "Create collection",
|
|
105
|
+
footnotes: [FREE]
|
|
106
|
+
},
|
|
107
|
+
suggestSymbol: false,
|
|
108
|
+
registerAfterDeploy: false,
|
|
109
|
+
actions: ({ collectionHref }) => ({
|
|
110
|
+
primary: { href: "/launchpad/single-editions", label: "Mint an asset" },
|
|
111
|
+
secondary: collectionHref ? { href: collectionHref, label: "View collection" } : void 0
|
|
112
|
+
})
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
CLUB_PRESET,
|
|
116
|
+
EDITIONS_PRESET,
|
|
117
|
+
SINGLE_PRESET,
|
|
118
|
+
TICKETS_PRESET
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=collection-create-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/launchpad/collection-create-presets.ts"],"sourcesContent":["import { Layers, Ticket, Users } from \"lucide-react\";\nimport type { ElementType } from \"react\";\n\nexport interface CollectionCreateAction {\n href: string;\n label: string;\n}\n\nexport interface CollectionCreatePreset {\n service: \"ip-club\" | \"ip-tickets\" | \"mip-erc1155\" | null;\n icon: ElementType;\n iconClass: string;\n buttonClass: string;\n signedOut: { title: string; description: string };\n shell: { title: string; subtitle: string };\n dialog: { title: string; workingLabel: string; firstStepLabel: string };\n success: { caption: string; fallbackName: string; reward: string; againLabel: string };\n cardFallbackSymbol: string;\n copy: {\n imageHeading: string;\n imageHelp?: string;\n nameLabel: string;\n namePlaceholder: string;\n nameHint: string;\n symbolPlaceholder: string;\n symbolHint: string;\n descriptionPlaceholder: string;\n descriptionHint?: string;\n submit: string;\n footnotes: string[];\n };\n suggestSymbol: boolean;\n registerAfterDeploy: boolean;\n actions: (found: { address: string | null; collectionHref: string | null }) => {\n primary?: CollectionCreateAction;\n secondary?: CollectionCreateAction;\n };\n}\n\nconst FREE = \"Free to publish — protocol fee is zero.\";\n\nexport const CLUB_PRESET: CollectionCreatePreset = {\n service: \"ip-club\",\n icon: Users,\n iconClass: \"text-brand-purple\",\n buttonClass: \"bg-brand-purple\",\n signedOut: { title: \"Secure your account to create a club\", description: \"Create a club, then mint membership cards for your community.\" },\n shell: { title: \"Create Club\", subtitle: \"One club — create membership tiers and mint cards to your community.\" },\n dialog: { title: \"Create club\", workingLabel: \"Creating your club…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your club is live\", fallbackName: \"Your club\", reward: \"create_club\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Club\",\n copy: {\n imageHeading: \"Club image\",\n nameLabel: \"Club name *\",\n namePlaceholder: \"My Club\",\n nameHint: \"Shown in wallets, explorers, and on every membership card.\",\n symbolPlaceholder: \"CLUB\",\n symbolHint: \"Short ticker — 2 to 10 uppercase letters.\",\n descriptionPlaceholder: \"Describe your club — what does membership unlock?\",\n submit: \"Create Club\",\n footnotes: [FREE],\n },\n suggestSymbol: false,\n registerAfterDeploy: false,\n actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: \"Create memberships\" } : undefined }),\n};\n\nexport const TICKETS_PRESET: CollectionCreatePreset = {\n service: \"ip-tickets\",\n icon: Ticket,\n iconClass: \"text-teal-500\",\n buttonClass: \"bg-teal-600\",\n signedOut: { title: \"Secure your account to create tickets\", description: \"Create a tickets collection, then mint tickets to your audience.\" },\n shell: { title: \"Create Ticket Collection\", subtitle: \"One collection — create tickets and mint them to your audience.\" },\n dialog: { title: \"Create tickets collection\", workingLabel: \"Creating your collection…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your collection is live\", fallbackName: \"Your collection\", reward: \"create_ticket_collection\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Tickets\",\n copy: {\n imageHeading: \"Collection image\",\n nameLabel: \"Collection name *\",\n namePlaceholder: \"My Tickets\",\n nameHint: \"Shown in wallets, explorers, and on every ticket.\",\n symbolPlaceholder: \"TIX\",\n symbolHint: \"Short ticker — 2 to 10 uppercase letters.\",\n descriptionPlaceholder: \"Describe your tickets — what do they admit or unlock?\",\n submit: \"Create Ticket Collection\",\n footnotes: [FREE],\n },\n suggestSymbol: false,\n registerAfterDeploy: false,\n actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: \"Create tickets\" } : undefined }),\n};\n\nexport const EDITIONS_PRESET: CollectionCreatePreset = {\n service: \"mip-erc1155\",\n icon: Layers,\n iconClass: \"text-brand-purple\",\n buttonClass: \"bg-brand-purple\",\n signedOut: { title: \"Secure your account to create a collection\", description: \"Create a collection where each piece can have multiple editions.\" },\n shell: { title: \"Create an Edition Collection\", subtitle: \"Create a collection where each piece can have multiple editions — free to publish, and it's yours.\" },\n dialog: { title: \"Create collection\", workingLabel: \"Creating your collection…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your collection is live\", fallbackName: \"Your collection\", reward: \"create_collection\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Editions\",\n copy: {\n imageHeading: \"Collection image\",\n imageHelp: \"This becomes the cover for your collection.\",\n nameLabel: \"Collection name *\",\n namePlaceholder: \"My Creative Works\",\n nameHint: \"The main title collectors see across the collection page, wallets, and future listings.\",\n symbolPlaceholder: \"MCW\",\n symbolHint: \"Short ticker (2–10 uppercase letters). We suggest one from the collection name.\",\n descriptionPlaceholder: \"Describe your collection and what kind of work it contains…\",\n descriptionHint: \"Use this to explain the creative direction, media type, or audience for the collection.\",\n submit: \"Publish Collection\",\n footnotes: [\n FREE,\n \"Next step: mint pieces into this collection — you set the number of copies for each piece when you mint it, and can add more copies later.\",\n ],\n },\n suggestSymbol: true,\n registerAfterDeploy: true,\n actions: ({ address, collectionHref }) => ({\n primary: address ? { href: `/launchpad/nfteditions/${address}/mint`, label: \"Mint tokens\" } : undefined,\n secondary: collectionHref ? { href: collectionHref, label: \"View collection\" } : undefined,\n }),\n};\n\nexport const SINGLE_PRESET: CollectionCreatePreset = {\n service: null,\n icon: Layers,\n iconClass: \"text-brand-blue\",\n buttonClass: \"bg-brand-blue\",\n signedOut: { title: \"Secure your account to create a collection\", description: \"Set up a collection to mint your work into.\" },\n shell: { title: \"Create a Collection\", subtitle: \"Set up a collection to mint your work into — free to publish, and it's yours.\" },\n dialog: { title: \"Create collection\", workingLabel: \"Creating your collection…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your collection is live\", fallbackName: \"Your collection\", reward: \"create_collection\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Collection\",\n copy: {\n imageHeading: \"Collection image\",\n nameLabel: \"Collection name *\",\n namePlaceholder: \"My Creative Works\",\n nameHint: \"The display name for your collection.\",\n symbolPlaceholder: \"MCW\",\n symbolHint: \"Short ticker (2–10 uppercase letters). Shown in wallets and marketplaces.\",\n descriptionPlaceholder: \"Describe your collection and what kind of work it contains…\",\n submit: \"Create collection\",\n footnotes: [FREE],\n },\n suggestSymbol: false,\n registerAfterDeploy: false,\n actions: ({ collectionHref }) => ({\n primary: { href: \"/launchpad/single-editions\", label: \"Mint an asset\" },\n secondary: collectionHref ? { href: collectionHref, label: \"View collection\" } : undefined,\n }),\n};\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var tier_mint_form_exports = {};
|
|
31
|
+
__export(tier_mint_form_exports, {
|
|
32
|
+
TierMintForm: () => TierMintForm
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(tier_mint_form_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_react_hook_form = require("react-hook-form");
|
|
38
|
+
var import_zod = require("@hookform/resolvers/zod");
|
|
39
|
+
var z = __toESM(require("zod"), 1);
|
|
40
|
+
var import_lucide_react = require("lucide-react");
|
|
41
|
+
var import_sdk = require("@medialane/sdk");
|
|
42
|
+
var import_image = __toESM(require("../image.js"), 1);
|
|
43
|
+
var import_link = __toESM(require("../link.js"), 1);
|
|
44
|
+
var import_button = require("../button.js");
|
|
45
|
+
var import_input = require("../input.js");
|
|
46
|
+
var import_textarea = require("../textarea.js");
|
|
47
|
+
var import_skeleton = require("../skeleton.js");
|
|
48
|
+
var import_select = require("../select.js");
|
|
49
|
+
var import_collapsible = require("../collapsible.js");
|
|
50
|
+
var import_form = require("../form.js");
|
|
51
|
+
var import_create_form_primitives = require("../create-form-primitives.js");
|
|
52
|
+
var import_claim_route_shell = require("../claim-route-shell.js");
|
|
53
|
+
var import_creation_success = require("../creation-success.js");
|
|
54
|
+
var import_medialane_collection_card = require("../medialane-collection-card.js");
|
|
55
|
+
var import_transaction_dialog = require("../transaction-dialog.js");
|
|
56
|
+
var import_wallet_required = require("../wallet-required.js");
|
|
57
|
+
var import_medialane_app = require("../medialane-app.js");
|
|
58
|
+
var import_reward_earned = require("../rewards/reward-earned.js");
|
|
59
|
+
var import_ip = require("../../data/ip.js");
|
|
60
|
+
var import_cn = require("../../utils/cn.js");
|
|
61
|
+
var import_run_intent_calls = require("../../utils/run-intent-calls.js");
|
|
62
|
+
var import_ipfs_upload = require("../../utils/ipfs-upload.js");
|
|
63
|
+
var import_use_collections = require("../../utils/use-collections.js");
|
|
64
|
+
var import_use_profiles = require("../../utils/use-profiles.js");
|
|
65
|
+
var import_use_transaction = require("../../utils/use-transaction.js");
|
|
66
|
+
var import_use_launchpad_image_upload = require("../../utils/use-launchpad-image-upload.js");
|
|
67
|
+
function dateToUnixTimestamp(dateStr) {
|
|
68
|
+
if (!dateStr) return void 0;
|
|
69
|
+
const d = new Date(dateStr);
|
|
70
|
+
if (isNaN(d.getTime())) return void 0;
|
|
71
|
+
return Math.floor(d.getTime() / 1e3);
|
|
72
|
+
}
|
|
73
|
+
function makeSchema(preset) {
|
|
74
|
+
return z.object({
|
|
75
|
+
name: z.string().min(1, preset.copy.nameRequired).max(import_sdk.FIELD_LIMITS.name),
|
|
76
|
+
description: z.string().max(import_sdk.FIELD_LIMITS.description).optional(),
|
|
77
|
+
external_url: z.string().max(500).refine((v) => !v || v.startsWith("http://") || v.startsWith("https://"), { message: "Must start with http:// or https://" }).optional(),
|
|
78
|
+
maxSupply: z.string().min(1, "Supply required").regex(/^\d+$/, "Must be a positive integer").refine((v) => parseInt(v, 10) >= 1, "Minimum supply is 1"),
|
|
79
|
+
royalty: z.coerce.number().min(0).max(50).default(2.5),
|
|
80
|
+
licenseType: z.string().min(1),
|
|
81
|
+
commercialUse: z.enum(["Yes", "No"]),
|
|
82
|
+
derivatives: z.enum(["Allowed", "Not Allowed", "Share-Alike"]),
|
|
83
|
+
attribution: z.enum(["Required", "Not Required"]),
|
|
84
|
+
geographicScope: z.string(),
|
|
85
|
+
aiPolicy: z.enum(["Allowed", "Not Allowed", "Training Only"]),
|
|
86
|
+
startDate: z.string().optional(),
|
|
87
|
+
endDate: z.string().optional(),
|
|
88
|
+
imageUri: z.string().min(1, preset.copy.imageRequired)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function TierMintForm({ contract: rawContract, preset, aside }) {
|
|
92
|
+
const app = (0, import_medialane_app.useMedialaneApp)();
|
|
93
|
+
const address = app.walletAddress;
|
|
94
|
+
const contract = (0, import_sdk.normalizeAddress)("STARKNET", rawContract);
|
|
95
|
+
const { collection, isLoading } = (0, import_use_collections.useCollection)(contract);
|
|
96
|
+
const { profile, isLoading: profileLoading } = (0, import_use_profiles.useCollectionProfile)(preset.suggestExternalLink ? contract : void 0);
|
|
97
|
+
const tx = (0, import_use_transaction.useTransaction)();
|
|
98
|
+
const upload = (0, import_use_launchpad_image_upload.useLaunchpadImageUpload)({ successMessage: "Image uploaded" });
|
|
99
|
+
const { imagePreview, imageUri, imageUploading, uploadError, fileInputRef, handleImageSelect, clearImage } = upload;
|
|
100
|
+
const [licensingOpen, setLicensingOpen] = (0, import_react.useState)(false);
|
|
101
|
+
const [advancedOpen, setAdvancedOpen] = (0, import_react.useState)(false);
|
|
102
|
+
const Icon = preset.icon;
|
|
103
|
+
const form = (0, import_react_hook_form.useForm)({
|
|
104
|
+
resolver: (0, import_zod.zodResolver)(makeSchema(preset)),
|
|
105
|
+
defaultValues: {
|
|
106
|
+
name: "",
|
|
107
|
+
imageUri: "",
|
|
108
|
+
description: "",
|
|
109
|
+
external_url: "",
|
|
110
|
+
maxSupply: "100",
|
|
111
|
+
royalty: 2.5,
|
|
112
|
+
licenseType: "CC BY-SA",
|
|
113
|
+
commercialUse: "Yes",
|
|
114
|
+
derivatives: "Share-Alike",
|
|
115
|
+
attribution: "Required",
|
|
116
|
+
geographicScope: "Worldwide",
|
|
117
|
+
aiPolicy: "Not Allowed"
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
(0, import_react.useEffect)(() => {
|
|
121
|
+
form.setValue("imageUri", imageUri ?? "", { shouldValidate: !!imageUri });
|
|
122
|
+
}, [imageUri, form]);
|
|
123
|
+
(0, import_react.useEffect)(() => {
|
|
124
|
+
if (!preset.suggestExternalLink || profileLoading) return;
|
|
125
|
+
const suggested = profile?.slug ? `https://medialane.io/collection/${profile.slug}` : `https://medialane.io${(0, import_sdk.collectionHref)("STARKNET", contract)}`;
|
|
126
|
+
if (!form.getValues("external_url")) form.setValue("external_url", suggested);
|
|
127
|
+
}, [contract, profileLoading, profile?.slug, form, preset.suggestExternalLink]);
|
|
128
|
+
const isOwner = !!address && !!collection?.owner && (0, import_sdk.normalizeAddress)("STARKNET", address) === (0, import_sdk.normalizeAddress)("STARKNET", collection.owner);
|
|
129
|
+
const handleAgain = () => {
|
|
130
|
+
tx.reset();
|
|
131
|
+
form.reset({ ...form.getValues(), name: "", description: "", maxSupply: "100" });
|
|
132
|
+
clearImage();
|
|
133
|
+
};
|
|
134
|
+
const onSubmit = (values) => {
|
|
135
|
+
if (!address) return;
|
|
136
|
+
void tx.run(async (signer) => {
|
|
137
|
+
await app.ensureSignedIn?.();
|
|
138
|
+
const api = app.getClient().api;
|
|
139
|
+
const pinned = await (0, import_ipfs_upload.pinAssetMetadata)(api, {
|
|
140
|
+
name: values.name,
|
|
141
|
+
description: values.description ?? "",
|
|
142
|
+
imageUri,
|
|
143
|
+
externalUrl: values.external_url,
|
|
144
|
+
ipType: "NFT",
|
|
145
|
+
licenseType: values.licenseType,
|
|
146
|
+
commercialUse: values.commercialUse,
|
|
147
|
+
derivatives: values.derivatives,
|
|
148
|
+
attribution: values.attribution,
|
|
149
|
+
geographicScope: values.geographicScope,
|
|
150
|
+
aiPolicy: values.aiPolicy,
|
|
151
|
+
royalty: String(values.royalty),
|
|
152
|
+
creator: address,
|
|
153
|
+
templateTraits: [
|
|
154
|
+
{ traitType: "Type", value: preset.traitType },
|
|
155
|
+
{ traitType: "Token Standard", value: "ERC-1155" },
|
|
156
|
+
{ traitType: "Max Supply", value: values.maxSupply },
|
|
157
|
+
{ traitType: "Collection Contract", value: contract }
|
|
158
|
+
]
|
|
159
|
+
});
|
|
160
|
+
const tierId = await preset.predictNextId(api, contract);
|
|
161
|
+
const tierRes = await api.intents.create("create-tier", {
|
|
162
|
+
owner: address,
|
|
163
|
+
collection: contract,
|
|
164
|
+
service: preset.service,
|
|
165
|
+
maxSupply: values.maxSupply,
|
|
166
|
+
startTime: dateToUnixTimestamp(values.startDate),
|
|
167
|
+
endTime: dateToUnixTimestamp(values.endDate),
|
|
168
|
+
royaltyBps: Math.round(values.royalty * 100),
|
|
169
|
+
metadataUri: pinned.uri
|
|
170
|
+
});
|
|
171
|
+
const mintRes = await api.intents.create("mint", {
|
|
172
|
+
owner: address,
|
|
173
|
+
recipient: address,
|
|
174
|
+
collectionContract: contract,
|
|
175
|
+
tokenId: String(tierId),
|
|
176
|
+
amount: values.maxSupply
|
|
177
|
+
});
|
|
178
|
+
await (0, import_run_intent_calls.runIntentsCalls)(signer, [tierRes, mintRes]);
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
const gateProps = { icon: Icon, iconClassName: preset.iconClass, title: preset.signedOut.title, description: preset.signedOut.description };
|
|
182
|
+
const inputId = `mint-${preset.service}-file-input`;
|
|
183
|
+
const busy = tx.phase !== "idle" || imageUploading;
|
|
184
|
+
if (isLoading) {
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { ...gateProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 pt-10 pb-16 space-y-4", children: [
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-6 w-24" }),
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-32 w-full rounded-2xl" }),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-64 w-full rounded-2xl" })
|
|
189
|
+
] }) });
|
|
190
|
+
}
|
|
191
|
+
if (!collection) {
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { ...gateProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: "Collection not found." }),
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: preset.back.href, children: preset.back.label }) })
|
|
196
|
+
] }) });
|
|
197
|
+
}
|
|
198
|
+
if (!isOwner) {
|
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { ...gateProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: preset.notOwner.message }),
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: preset.notOwner.back.href, children: preset.notOwner.back.label }) })
|
|
203
|
+
] }) });
|
|
204
|
+
}
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_wallet_required.WalletRequired, { ...gateProps, children: [
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: preset.dialog.title, workingLabel: preset.dialog.workingLabel, firstStepLabel: preset.dialog.firstStepLabel, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
207
|
+
import_creation_success.CreationSuccess,
|
|
208
|
+
{
|
|
209
|
+
name: form.getValues("name"),
|
|
210
|
+
image: imagePreview,
|
|
211
|
+
caption: preset.success.caption,
|
|
212
|
+
primary: { href: (0, import_sdk.collectionHref)("STARKNET", contract), label: "View collection" },
|
|
213
|
+
onAgain: handleAgain,
|
|
214
|
+
againLabel: preset.success.againLabel,
|
|
215
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reward_earned.RewardEarned, { actionType: "launch_launchpad" })
|
|
216
|
+
}
|
|
217
|
+
) }),
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
219
|
+
import_claim_route_shell.ClaimRouteShell,
|
|
220
|
+
{
|
|
221
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-4 w-4 text-white" }),
|
|
222
|
+
title: preset.shell.title,
|
|
223
|
+
subtitle: preset.shell.subtitle(collection.name ?? null),
|
|
224
|
+
aside: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
226
|
+
import_medialane_collection_card.MedialaneCollectionCard,
|
|
227
|
+
{
|
|
228
|
+
image: imagePreview,
|
|
229
|
+
name: form.watch("name"),
|
|
230
|
+
collection: collection.symbol || preset.cardFallbackSymbol,
|
|
231
|
+
creator: address ? `${address.slice(0, 6)}\u2026${address.slice(-4)}` : void 0,
|
|
232
|
+
creatorHref: address ? (0, import_sdk.profileHref)({ address }) : void 0
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
aside
|
|
236
|
+
] }),
|
|
237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-5", children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-medium", children: [
|
|
240
|
+
preset.copy.imageHeading,
|
|
241
|
+
" ",
|
|
242
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-destructive", children: "*" })
|
|
243
|
+
] }),
|
|
244
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
246
|
+
"div",
|
|
247
|
+
{
|
|
248
|
+
role: "button",
|
|
249
|
+
tabIndex: 0,
|
|
250
|
+
onClick: () => !imageUploading && fileInputRef.current?.click(),
|
|
251
|
+
onKeyDown: (e) => {
|
|
252
|
+
if (e.key === "Enter") fileInputRef.current?.click();
|
|
253
|
+
},
|
|
254
|
+
className: (0, import_cn.cn)("relative h-20 w-20 rounded-2xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer transition-colors", preset.hoverBorderClass),
|
|
255
|
+
children: [
|
|
256
|
+
imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: imagePreview, alt: preset.copy.imageAlt, fill: true, unoptimized: true, className: "object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImagePlus, { className: "h-6 w-6 text-muted-foreground" }),
|
|
257
|
+
imageUploading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-background/70 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-4 w-4 animate-spin" }) })
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
262
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: inputId, ref: fileInputRef, type: "file", accept: (0, import_sdk.acceptFor)("image"), className: "hidden", onChange: (e) => {
|
|
263
|
+
const f = e.target.files?.[0];
|
|
264
|
+
if (f) void handleImageSelect(f);
|
|
265
|
+
} }),
|
|
266
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { type: "button", variant: "outline", size: "sm", disabled: imageUploading, onClick: () => fileInputRef.current?.click(), children: imageUploading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3.5 w-3.5 mr-1.5 animate-spin" }),
|
|
268
|
+
"Uploading\u2026"
|
|
269
|
+
] }) : imagePreview ? "Change" : "Upload image" }),
|
|
270
|
+
imagePreview && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", onClick: clearImage, className: "flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors", children: [
|
|
271
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-3 w-3" }),
|
|
272
|
+
" Remove"
|
|
273
|
+
] }),
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: imageUri ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: preset.uploadedClass, children: "\u2713 Uploaded" }) : "JPG, PNG, SVG or WebP" })
|
|
275
|
+
] })
|
|
276
|
+
] })
|
|
277
|
+
] }),
|
|
278
|
+
(uploadError || form.formState.errors.imageUri) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: uploadError ?? form.formState.errors.imageUri?.message }),
|
|
279
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "name", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
|
|
281
|
+
preset.copy.nameLabel,
|
|
282
|
+
" ",
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-destructive", children: "*" })
|
|
284
|
+
] }),
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { placeholder: preset.copy.namePlaceholder, ...field }) }),
|
|
286
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
287
|
+
] }) }),
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "description", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
289
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
|
|
290
|
+
"Description ",
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
|
|
292
|
+
] }),
|
|
293
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_textarea.Textarea, { placeholder: preset.copy.descriptionPlaceholder, rows: 3, ...field }) }),
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
295
|
+
] }) }),
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "external_url", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
297
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
|
|
298
|
+
"External link ",
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
|
|
300
|
+
] }),
|
|
301
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { placeholder: "https://yourwebsite.com", ...field }) }),
|
|
302
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
303
|
+
] }) }),
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.Collapsible, { open: licensingOpen, onOpenChange: setLicensingOpen, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sm:overflow-hidden sm:rounded-xl sm:border sm:border-border", children: [
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "w-full flex items-center justify-between px-0 py-3 sm:px-5 sm:py-4 hover:bg-muted/30 transition-colors", children: [
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
307
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShieldCheck, { className: "h-4 w-4 text-primary" }),
|
|
308
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-semibold", children: "Licensing Terms" }),
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground font-normal", children: "Optional \xB7 Berne Convention" })
|
|
310
|
+
] }),
|
|
311
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { className: (0, import_cn.cn)("h-4 w-4 text-muted-foreground transition-transform", licensingOpen && "rotate-180") })
|
|
312
|
+
] }) }),
|
|
313
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-0 pb-4 sm:px-5 sm:pb-5 space-y-4 border-t border-border/60 pt-4", children: [
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "licenseType", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "License" }),
|
|
316
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select, { value: field.value, onValueChange: (value) => {
|
|
317
|
+
form.setValue("licenseType", value);
|
|
318
|
+
const def = import_ip.LICENSE_TYPES.find((l) => l.value === value);
|
|
319
|
+
if (def) {
|
|
320
|
+
form.setValue("commercialUse", def.commercialUse);
|
|
321
|
+
form.setValue("derivatives", def.derivatives);
|
|
322
|
+
form.setValue("attribution", def.attribution);
|
|
323
|
+
}
|
|
324
|
+
}, children: [
|
|
325
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, {}) }) }),
|
|
326
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { children: import_ip.LICENSE_TYPES.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: l.value, children: l.label }, l.value)) })
|
|
327
|
+
] }),
|
|
328
|
+
(() => {
|
|
329
|
+
const def = import_ip.LICENSE_TYPES.find((l) => l.value === field.value);
|
|
330
|
+
return def ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground mt-1", children: def.description }) : null;
|
|
331
|
+
})(),
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
333
|
+
] }) }),
|
|
334
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "commercialUse", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
335
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Commercial Use" }),
|
|
336
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: ["Yes", "No"], onChange: field.onChange })
|
|
337
|
+
] }) }),
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "derivatives", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Derivatives" }),
|
|
340
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: import_ip.DERIVATIVES_OPTIONS, onChange: field.onChange })
|
|
341
|
+
] }) }),
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "attribution", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Attribution" }),
|
|
344
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: ["Required", "Not Required"], onChange: field.onChange })
|
|
345
|
+
] }) }),
|
|
346
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_collapsible.Collapsible, { open: advancedOpen, onOpenChange: setAdvancedOpen, children: [
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors", children: [
|
|
348
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { className: (0, import_cn.cn)("h-3.5 w-3.5 transition-transform", advancedOpen && "rotate-180") }),
|
|
349
|
+
"Advanced options"
|
|
350
|
+
] }) }),
|
|
351
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_collapsible.CollapsibleContent, { className: "space-y-4 pt-3", children: [
|
|
352
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "geographicScope", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
353
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Territory" }),
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select, { onValueChange: field.onChange, value: field.value, children: [
|
|
355
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, {}) }) }),
|
|
356
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { children: import_ip.GEOGRAPHIC_SCOPES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: s, children: s }, s)) })
|
|
357
|
+
] })
|
|
358
|
+
] }) }),
|
|
359
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "aiPolicy", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
360
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "AI & Data Mining" }),
|
|
361
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: import_ip.AI_POLICIES, onChange: field.onChange })
|
|
362
|
+
] }) })
|
|
363
|
+
] })
|
|
364
|
+
] })
|
|
365
|
+
] }) })
|
|
366
|
+
] }) }),
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
368
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "maxSupply", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
369
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
|
|
370
|
+
"Supply ",
|
|
371
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-destructive", children: "*" })
|
|
372
|
+
] }),
|
|
373
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "number", min: "1", placeholder: "100", ...field }) }),
|
|
374
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: "Minted to your account." }),
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
376
|
+
] }) }),
|
|
377
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "royalty", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Royalty % (0\u201350)" }),
|
|
379
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "number", min: 0, max: 50, step: 0.5, placeholder: "2.5", ...field, onChange: (e) => field.onChange(parseFloat(e.target.value) || 0) }) }),
|
|
380
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: "On secondary sales." }),
|
|
381
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
382
|
+
] }) })
|
|
383
|
+
] }),
|
|
384
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
385
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "startDate", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
|
|
387
|
+
"Valid from ",
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
|
|
389
|
+
] }),
|
|
390
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "datetime-local", ...field }) }),
|
|
391
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: "You can mint and sell before it opens." }),
|
|
392
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
393
|
+
] }) }),
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "endDate", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
395
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
|
|
396
|
+
"Valid until ",
|
|
397
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
|
|
398
|
+
] }),
|
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "datetime-local", ...field }) }),
|
|
400
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: preset.copy.validUntilHint }),
|
|
401
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
402
|
+
] }) })
|
|
403
|
+
] }),
|
|
404
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
405
|
+
"button",
|
|
406
|
+
{
|
|
407
|
+
type: "submit",
|
|
408
|
+
disabled: busy,
|
|
409
|
+
className: `w-full h-12 text-base font-semibold text-white rounded-xl flex items-center justify-center gap-2 transition-all hover:brightness-110 active:scale-[0.98] ${preset.buttonClass} ${busy ? "opacity-40 pointer-events-none" : ""}`,
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-4 w-4 mr-2" }),
|
|
412
|
+
preset.copy.submit
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
] }) })
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
] });
|
|
420
|
+
}
|
|
421
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
422
|
+
0 && (module.exports = {
|
|
423
|
+
TierMintForm
|
|
424
|
+
});
|
|
425
|
+
//# sourceMappingURL=tier-mint-form.cjs.map
|