@medialane/ui 0.364.0 → 0.366.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/fast-mint/asset-form-parts.cjs +19 -12
- package/dist/components/fast-mint/asset-form-parts.cjs.map +1 -1
- package/dist/components/fast-mint/asset-form-parts.d.cts +14 -6
- package/dist/components/fast-mint/asset-form-parts.d.ts +14 -6
- package/dist/components/fast-mint/asset-form-parts.js +18 -12
- package/dist/components/fast-mint/asset-form-parts.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +111 -73
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +112 -74
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/types.cjs.map +1 -1
- package/dist/components/fast-mint/types.d.cts +1 -0
- package/dist/components/fast-mint/types.d.ts +1 -0
- package/dist/components/launchpad/collection-create-form.cjs +12 -3
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +12 -3
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs +10 -1
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js +10 -1
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad-filter-bar.cjs +20 -35
- package/dist/components/launchpad-filter-bar.cjs.map +1 -1
- package/dist/components/launchpad-filter-bar.d.cts +6 -6
- package/dist/components/launchpad-filter-bar.d.ts +6 -6
- package/dist/components/launchpad-filter-bar.js +21 -38
- package/dist/components/launchpad-filter-bar.js.map +1 -1
- package/dist/components/launchpad-page.cjs +10 -22
- package/dist/components/launchpad-page.cjs.map +1 -1
- package/dist/components/launchpad-page.js +11 -23
- package/dist/components/launchpad-page.js.map +1 -1
- package/dist/components/launchpad-services.cjs +41 -52
- package/dist/components/launchpad-services.cjs.map +1 -1
- package/dist/components/launchpad-services.d.cts +11 -10
- package/dist/components/launchpad-services.d.ts +11 -10
- package/dist/components/launchpad-services.js +40 -53
- package/dist/components/launchpad-services.js.map +1 -1
- package/dist/data/launchpad-services.cjs +21 -16
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.d.cts +1 -1
- package/dist/data/launchpad-services.d.ts +1 -1
- package/dist/data/launchpad-services.js +21 -16
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/utils/launchpad-handoff.cjs +62 -0
- package/dist/utils/launchpad-handoff.cjs.map +1 -0
- package/dist/utils/launchpad-handoff.d.cts +11 -0
- package/dist/utils/launchpad-handoff.d.ts +11 -0
- package/dist/utils/launchpad-handoff.js +35 -0
- package/dist/utils/launchpad-handoff.js.map +1 -0
- package/package.json +1 -1
|
@@ -29,8 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
var asset_form_parts_exports = {};
|
|
31
31
|
__export(asset_form_parts_exports, {
|
|
32
|
-
AssetTypePicker: () => AssetTypePicker,
|
|
33
32
|
CoverUpload: () => CoverUpload,
|
|
33
|
+
FormatPicker: () => FormatPicker,
|
|
34
|
+
MINT_FORMATS: () => MINT_FORMATS,
|
|
34
35
|
MediaRow: () => MediaRow
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(asset_form_parts_exports);
|
|
@@ -137,11 +138,14 @@ function CoverUpload({
|
|
|
137
138
|
] })
|
|
138
139
|
] });
|
|
139
140
|
}
|
|
140
|
-
const
|
|
141
|
-
{ value: "single", icon: import_lucide_react.ImagePlus, title: "Single
|
|
142
|
-
{ value: "editions", icon: import_lucide_react.Layers, title: "Limited Editions
|
|
141
|
+
const MINT_FORMATS = [
|
|
142
|
+
{ value: "single", icon: import_lucide_react.ImagePlus, title: "Single NFT", hint: "One copy, yours to keep or sell" },
|
|
143
|
+
{ value: "editions", icon: import_lucide_react.Layers, title: "Limited Editions", hint: "Numbered copies people can collect" },
|
|
144
|
+
{ value: "pop", icon: import_lucide_react.Award, title: "POP badge", hint: "A badge people claim to show they took part" },
|
|
145
|
+
{ value: "tickets", icon: import_lucide_react.Ticket, title: "IP Ticket", hint: "Tickets people hold and show at the door" },
|
|
146
|
+
{ value: "club", icon: import_lucide_react.Users, title: "IP Club", hint: "Membership cards for your community" }
|
|
143
147
|
];
|
|
144
|
-
function
|
|
148
|
+
function FormatPicker({
|
|
145
149
|
value,
|
|
146
150
|
onChange,
|
|
147
151
|
editionCount,
|
|
@@ -149,25 +153,27 @@ function AssetTypePicker({
|
|
|
149
153
|
}) {
|
|
150
154
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
151
155
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", children: "
|
|
153
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-3", children:
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", id: "fast-mint-format", children: "What do you want to make with it?" }),
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { role: "radiogroup", "aria-labelledby": "fast-mint-format", className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: MINT_FORMATS.map(({ value: format, icon: Icon, title, hint }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
154
158
|
"button",
|
|
155
159
|
{
|
|
156
160
|
type: "button",
|
|
157
|
-
|
|
161
|
+
role: "radio",
|
|
162
|
+
"aria-checked": value === format,
|
|
163
|
+
onClick: () => onChange(format),
|
|
158
164
|
className: (0, import_cn.cn)(
|
|
159
165
|
"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors",
|
|
160
|
-
value ===
|
|
166
|
+
value === format ? "border-brand-blue bg-brand-blue/5" : "border-border hover:bg-muted/40"
|
|
161
167
|
),
|
|
162
168
|
children: [
|
|
163
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_cn.cn)("h-5 w-5 shrink-0 mt-0.5", value ===
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_cn.cn)("h-5 w-5 shrink-0 mt-0.5", value === format ? "text-brand-blue" : "text-muted-foreground") }),
|
|
164
170
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
165
171
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block text-sm font-semibold", children: title }),
|
|
166
172
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block text-xs mt-0.5 text-muted-foreground", children: hint })
|
|
167
173
|
] })
|
|
168
174
|
]
|
|
169
175
|
},
|
|
170
|
-
|
|
176
|
+
format
|
|
171
177
|
)) })
|
|
172
178
|
] }),
|
|
173
179
|
value === "editions" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
@@ -187,8 +193,9 @@ function AssetTypePicker({
|
|
|
187
193
|
}
|
|
188
194
|
// Annotate the CommonJS export names for ESM import in node:
|
|
189
195
|
0 && (module.exports = {
|
|
190
|
-
AssetTypePicker,
|
|
191
196
|
CoverUpload,
|
|
197
|
+
FormatPicker,
|
|
198
|
+
MINT_FORMATS,
|
|
192
199
|
MediaRow
|
|
193
200
|
});
|
|
194
201
|
//# sourceMappingURL=asset-form-parts.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/asset-form-parts.tsx"],"sourcesContent":["\"use client\";\n\nimport type { RefObject } from \"react\";\nimport Image from \"next/image\";\nimport { FileText, ImagePlus, ImagePlus as SingleIcon, Layers, Loader2, Music, Video } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport type { IPType } from \"../../data/ip.js\";\nimport { acceptFor } from \"../../utils/upload-limits.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { MintAssetType } from \"./mintable-collections.js\";\nimport type { MediaKind } from \"./types.js\";\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nexport function MediaRow({\n file, kind, preview, uri, uploading, ipType, inputRef, onSelect,\n}: {\n file: File;\n kind: MediaKind;\n preview: string | null;\n uri: string | null;\n uploading: boolean;\n ipType: IPType;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n const KindIcon = MEDIA_KIND_ICON[kind];\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {kind === \"image\" && preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{file.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {uploading ? \"Uploading…\" : uri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {uri && (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => inputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={inputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n );\n}\n\nexport function CoverUpload({\n preview, uploading, inputRef, onSelect,\n}: {\n preview: string | null;\n uploading: boolean;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n return (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !uploading && inputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !uploading) { e.preventDefault(); inputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={inputRef} type=\"file\" accept={acceptFor(\"image\")} className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n );\n}\n\nconst ASSET_TYPES = [\n { value: \"single\", icon: SingleIcon, title: \"Single Edition NFT\", hint: \"Minted once\" },\n { value: \"editions\", icon: Layers, title: \"Limited Editions NFT\", hint: \"Several numbered copies\" },\n] as const;\n\nexport function AssetTypePicker({\n value, onChange, editionCount, onEditionCount,\n}: {\n value: MintAssetType;\n onChange: (type: MintAssetType) => void;\n editionCount: string;\n onEditionCount: (count: string) => void;\n}) {\n return (\n <>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Asset Type</label>\n <div className=\"grid grid-cols-2 gap-3\">\n {ASSET_TYPES.map(({ value: type, icon: Icon, title, hint }) => (\n <button\n key={type}\n type=\"button\"\n onClick={() => onChange(type)}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n value === type ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Icon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", value === type ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">{title}</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">{hint}</span>\n </span>\n </button>\n ))}\n </div>\n </div>\n\n {value === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => onEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCM;AAlCN,mBAAkB;AAClB,0BAA4F;AAC5F,mBAAsB;AACtB,0BAA6B;AAE7B,2BAA0B;AAC1B,gBAAmB;AAInB,MAAM,kBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AACZ;AAEO,SAAS,SAAS;AAAA,EACvB;AAAA,EAAM;AAAA,EAAM;AAAA,EAAS;AAAA,EAAK;AAAA,EAAW;AAAA,EAAQ;AAAA,EAAU;AACzD,GASG;AACD,QAAM,WAAW,gBAAgB,IAAI;AACrC,QAAM,WAAW,iCAAa,MAAM;AACpC,QAAM,eAAe,SAAS;AAC9B,SACE,6CAAC,SAAI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AU,0BACZ,sBAAY,IAAI,CAAC,EAAE,OAAO,MAAM,MAAM,MAAM,OAAO,KAAK,MACvD;AAAA,QAAC;AAAA;AAAA,UAEC,MAAK;AAAA,UACL,SAAS,MAAM,SAAS,IAAI;AAAA,UAC5B,eAAW;AAAA,YAAG;AAAA,YACZ,UAAU,OAAO,sCAAsC;AAAA,UAAiC;AAAA,UAE1F;AAAA,wDAAC,QAAK,eAAW,cAAG,2BAA2B,UAAU,OAAO,oBAAoB,uBAAuB,GAAG;AAAA,YAC9G,6CAAC,UACC;AAAA,0DAAC,UAAK,WAAU,+BAA+B,iBAAM;AAAA,cACrD,4CAAC,UAAK,WAAU,8CAA8C,gBAAK;AAAA,eACrE;AAAA;AAAA;AAAA,QAVK;AAAA,MAWP,CACD,GACH;AAAA,OACF;AAAA,IAEC,UAAU,cACT,6CAAC,SAAI,WAAU,aACb;AAAA,kDAAC,WAAM,WAAU,uBAAsB,8BAAgB;AAAA,MACvD;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,KAAK;AAAA,UACL,OAAO;AAAA,UACP,UAAU,CAAC,MAAM,eAAe,EAAE,OAAO,KAAK;AAAA,UAC9C,WAAU;AAAA;AAAA,MACZ;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":["Image","SingleIcon"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/asset-form-parts.tsx"],"sourcesContent":["\"use client\";\n\nimport type { RefObject } from \"react\";\nimport Image from \"next/image\";\nimport { Award, FileText, ImagePlus, Layers, Loader2, Music, Ticket, Users, Video } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport type { IPType } from \"../../data/ip.js\";\nimport { acceptFor } from \"../../utils/upload-limits.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { HandoffFormat } from \"../../utils/launchpad-handoff.js\";\nimport type { MediaKind } from \"./types.js\";\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nexport function MediaRow({\n file, kind, preview, uri, uploading, ipType, inputRef, onSelect,\n}: {\n file: File;\n kind: MediaKind;\n preview: string | null;\n uri: string | null;\n uploading: boolean;\n ipType: IPType;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n const KindIcon = MEDIA_KIND_ICON[kind];\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {kind === \"image\" && preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{file.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {uploading ? \"Uploading…\" : uri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {uri && (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => inputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={inputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n );\n}\n\nexport function CoverUpload({\n preview, uploading, inputRef, onSelect,\n}: {\n preview: string | null;\n uploading: boolean;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n return (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !uploading && inputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !uploading) { e.preventDefault(); inputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={inputRef} type=\"file\" accept={acceptFor(\"image\")} className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n );\n}\n\nexport type MintFormat = \"single\" | \"editions\" | HandoffFormat;\n\nexport const MINT_FORMATS: ReadonlyArray<{ value: MintFormat; icon: typeof ImagePlus; title: string; hint: string }> = [\n { value: \"single\", icon: ImagePlus, title: \"Single NFT\", hint: \"One copy, yours to keep or sell\" },\n { value: \"editions\", icon: Layers, title: \"Limited Editions\", hint: \"Numbered copies people can collect\" },\n { value: \"pop\", icon: Award, title: \"POP badge\", hint: \"A badge people claim to show they took part\" },\n { value: \"tickets\", icon: Ticket, title: \"IP Ticket\", hint: \"Tickets people hold and show at the door\" },\n { value: \"club\", icon: Users, title: \"IP Club\", hint: \"Membership cards for your community\" },\n];\n\nexport function FormatPicker({\n value, onChange, editionCount, onEditionCount,\n}: {\n value: MintFormat;\n onChange: (format: MintFormat) => void;\n editionCount: string;\n onEditionCount: (count: string) => void;\n}) {\n return (\n <>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\" id=\"fast-mint-format\">What do you want to make with it?</label>\n <div role=\"radiogroup\" aria-labelledby=\"fast-mint-format\" className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n {MINT_FORMATS.map(({ value: format, icon: Icon, title, hint }) => (\n <button\n key={format}\n type=\"button\"\n role=\"radio\"\n aria-checked={value === format}\n onClick={() => onChange(format)}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n value === format ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Icon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", value === format ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">{title}</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">{hint}</span>\n </span>\n </button>\n ))}\n </div>\n </div>\n\n {value === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => onEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCM;AAlCN,mBAAkB;AAClB,0BAAyF;AACzF,mBAAsB;AACtB,0BAA6B;AAE7B,2BAA0B;AAC1B,gBAAmB;AAInB,MAAM,kBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AACZ;AAEO,SAAS,SAAS;AAAA,EACvB;AAAA,EAAM;AAAA,EAAM;AAAA,EAAS;AAAA,EAAK;AAAA,EAAW;AAAA,EAA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|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
|
+
import { ImagePlus } from 'lucide-react';
|
|
3
4
|
import { IPType } from '../../data/ip.cjs';
|
|
4
|
-
import {
|
|
5
|
+
import { HandoffFormat } from '../../utils/launchpad-handoff.cjs';
|
|
5
6
|
import { MediaKind } from './types.cjs';
|
|
6
|
-
import '@medialane/sdk';
|
|
7
7
|
import 'starknet';
|
|
8
|
+
import '@medialane/sdk';
|
|
8
9
|
import '@medialane/sdk/starknet';
|
|
9
10
|
|
|
10
11
|
declare function MediaRow({ file, kind, preview, uri, uploading, ipType, inputRef, onSelect, }: {
|
|
@@ -23,11 +24,18 @@ declare function CoverUpload({ preview, uploading, inputRef, onSelect, }: {
|
|
|
23
24
|
inputRef: RefObject<HTMLInputElement | null>;
|
|
24
25
|
onSelect: (file: File) => void;
|
|
25
26
|
}): react_jsx_runtime.JSX.Element;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
type MintFormat = "single" | "editions" | HandoffFormat;
|
|
28
|
+
declare const MINT_FORMATS: ReadonlyArray<{
|
|
29
|
+
value: MintFormat;
|
|
30
|
+
icon: typeof ImagePlus;
|
|
31
|
+
title: string;
|
|
32
|
+
hint: string;
|
|
33
|
+
}>;
|
|
34
|
+
declare function FormatPicker({ value, onChange, editionCount, onEditionCount, }: {
|
|
35
|
+
value: MintFormat;
|
|
36
|
+
onChange: (format: MintFormat) => void;
|
|
29
37
|
editionCount: string;
|
|
30
38
|
onEditionCount: (count: string) => void;
|
|
31
39
|
}): react_jsx_runtime.JSX.Element;
|
|
32
40
|
|
|
33
|
-
export {
|
|
41
|
+
export { CoverUpload, FormatPicker, MINT_FORMATS, MediaRow, type MintFormat };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
|
+
import { ImagePlus } from 'lucide-react';
|
|
3
4
|
import { IPType } from '../../data/ip.js';
|
|
4
|
-
import {
|
|
5
|
+
import { HandoffFormat } from '../../utils/launchpad-handoff.js';
|
|
5
6
|
import { MediaKind } from './types.js';
|
|
6
|
-
import '@medialane/sdk';
|
|
7
7
|
import 'starknet';
|
|
8
|
+
import '@medialane/sdk';
|
|
8
9
|
import '@medialane/sdk/starknet';
|
|
9
10
|
|
|
10
11
|
declare function MediaRow({ file, kind, preview, uri, uploading, ipType, inputRef, onSelect, }: {
|
|
@@ -23,11 +24,18 @@ declare function CoverUpload({ preview, uploading, inputRef, onSelect, }: {
|
|
|
23
24
|
inputRef: RefObject<HTMLInputElement | null>;
|
|
24
25
|
onSelect: (file: File) => void;
|
|
25
26
|
}): react_jsx_runtime.JSX.Element;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
type MintFormat = "single" | "editions" | HandoffFormat;
|
|
28
|
+
declare const MINT_FORMATS: ReadonlyArray<{
|
|
29
|
+
value: MintFormat;
|
|
30
|
+
icon: typeof ImagePlus;
|
|
31
|
+
title: string;
|
|
32
|
+
hint: string;
|
|
33
|
+
}>;
|
|
34
|
+
declare function FormatPicker({ value, onChange, editionCount, onEditionCount, }: {
|
|
35
|
+
value: MintFormat;
|
|
36
|
+
onChange: (format: MintFormat) => void;
|
|
29
37
|
editionCount: string;
|
|
30
38
|
onEditionCount: (count: string) => void;
|
|
31
39
|
}): react_jsx_runtime.JSX.Element;
|
|
32
40
|
|
|
33
|
-
export {
|
|
41
|
+
export { CoverUpload, FormatPicker, MINT_FORMATS, MediaRow, type MintFormat };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Image from "next/image";
|
|
4
|
-
import {
|
|
4
|
+
import { Award, FileText, ImagePlus, Layers, Loader2, Music, Ticket, Users, Video } from "lucide-react";
|
|
5
5
|
import { Input } from "../input.js";
|
|
6
6
|
import { IP_TEMPLATES } from "../../data/ip-templates.js";
|
|
7
7
|
import { acceptFor } from "../../utils/upload-limits.js";
|
|
@@ -102,11 +102,14 @@ function CoverUpload({
|
|
|
102
102
|
] })
|
|
103
103
|
] });
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
{ value: "single", icon:
|
|
107
|
-
{ value: "editions", icon: Layers, title: "Limited Editions
|
|
105
|
+
const MINT_FORMATS = [
|
|
106
|
+
{ value: "single", icon: ImagePlus, title: "Single NFT", hint: "One copy, yours to keep or sell" },
|
|
107
|
+
{ value: "editions", icon: Layers, title: "Limited Editions", hint: "Numbered copies people can collect" },
|
|
108
|
+
{ value: "pop", icon: Award, title: "POP badge", hint: "A badge people claim to show they took part" },
|
|
109
|
+
{ value: "tickets", icon: Ticket, title: "IP Ticket", hint: "Tickets people hold and show at the door" },
|
|
110
|
+
{ value: "club", icon: Users, title: "IP Club", hint: "Membership cards for your community" }
|
|
108
111
|
];
|
|
109
|
-
function
|
|
112
|
+
function FormatPicker({
|
|
110
113
|
value,
|
|
111
114
|
onChange,
|
|
112
115
|
editionCount,
|
|
@@ -114,25 +117,27 @@ function AssetTypePicker({
|
|
|
114
117
|
}) {
|
|
115
118
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
116
119
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
117
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "
|
|
118
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3", children:
|
|
120
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", id: "fast-mint-format", children: "What do you want to make with it?" }),
|
|
121
|
+
/* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-labelledby": "fast-mint-format", className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: MINT_FORMATS.map(({ value: format, icon: Icon, title, hint }) => /* @__PURE__ */ jsxs(
|
|
119
122
|
"button",
|
|
120
123
|
{
|
|
121
124
|
type: "button",
|
|
122
|
-
|
|
125
|
+
role: "radio",
|
|
126
|
+
"aria-checked": value === format,
|
|
127
|
+
onClick: () => onChange(format),
|
|
123
128
|
className: cn(
|
|
124
129
|
"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors",
|
|
125
|
-
value ===
|
|
130
|
+
value === format ? "border-brand-blue bg-brand-blue/5" : "border-border hover:bg-muted/40"
|
|
126
131
|
),
|
|
127
132
|
children: [
|
|
128
|
-
/* @__PURE__ */ jsx(Icon, { className: cn("h-5 w-5 shrink-0 mt-0.5", value ===
|
|
133
|
+
/* @__PURE__ */ jsx(Icon, { className: cn("h-5 w-5 shrink-0 mt-0.5", value === format ? "text-brand-blue" : "text-muted-foreground") }),
|
|
129
134
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
130
135
|
/* @__PURE__ */ jsx("span", { className: "block text-sm font-semibold", children: title }),
|
|
131
136
|
/* @__PURE__ */ jsx("span", { className: "block text-xs mt-0.5 text-muted-foreground", children: hint })
|
|
132
137
|
] })
|
|
133
138
|
]
|
|
134
139
|
},
|
|
135
|
-
|
|
140
|
+
format
|
|
136
141
|
)) })
|
|
137
142
|
] }),
|
|
138
143
|
value === "editions" && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -151,8 +156,9 @@ function AssetTypePicker({
|
|
|
151
156
|
] });
|
|
152
157
|
}
|
|
153
158
|
export {
|
|
154
|
-
AssetTypePicker,
|
|
155
159
|
CoverUpload,
|
|
160
|
+
FormatPicker,
|
|
161
|
+
MINT_FORMATS,
|
|
156
162
|
MediaRow
|
|
157
163
|
};
|
|
158
164
|
//# sourceMappingURL=asset-form-parts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/asset-form-parts.tsx"],"sourcesContent":["\"use client\";\n\nimport type { RefObject } from \"react\";\nimport Image from \"next/image\";\nimport { FileText, ImagePlus, ImagePlus as SingleIcon, Layers, Loader2, Music, Video } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport type { IPType } from \"../../data/ip.js\";\nimport { acceptFor } from \"../../utils/upload-limits.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { MintAssetType } from \"./mintable-collections.js\";\nimport type { MediaKind } from \"./types.js\";\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nexport function MediaRow({\n file, kind, preview, uri, uploading, ipType, inputRef, onSelect,\n}: {\n file: File;\n kind: MediaKind;\n preview: string | null;\n uri: string | null;\n uploading: boolean;\n ipType: IPType;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n const KindIcon = MEDIA_KIND_ICON[kind];\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {kind === \"image\" && preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{file.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {uploading ? \"Uploading…\" : uri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {uri && (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => inputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={inputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n );\n}\n\nexport function CoverUpload({\n preview, uploading, inputRef, onSelect,\n}: {\n preview: string | null;\n uploading: boolean;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n return (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !uploading && inputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !uploading) { e.preventDefault(); inputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={inputRef} type=\"file\" accept={acceptFor(\"image\")} className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n );\n}\n\nconst ASSET_TYPES = [\n { value: \"single\", icon: SingleIcon, title: \"Single Edition NFT\", hint: \"Minted once\" },\n { value: \"editions\", icon: Layers, title: \"Limited Editions NFT\", hint: \"Several numbered copies\" },\n] as const;\n\nexport function AssetTypePicker({\n value, onChange, editionCount, onEditionCount,\n}: {\n value: MintAssetType;\n onChange: (type: MintAssetType) => void;\n editionCount: string;\n onEditionCount: (count: string) => void;\n}) {\n return (\n <>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Asset Type</label>\n <div className=\"grid grid-cols-2 gap-3\">\n {ASSET_TYPES.map(({ value: type, icon: Icon, title, hint }) => (\n <button\n key={type}\n type=\"button\"\n onClick={() => onChange(type)}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n value === type ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Icon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", value === type ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">{title}</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">{hint}</span>\n </span>\n </button>\n ))}\n </div>\n </div>\n\n {value === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => onEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n </>\n );\n}\n"],"mappings":";AAqCM,SAgGF,UA9FM,KAFJ;AAlCN,OAAO,WAAW;AAClB,SAAS,UAAU,WAAW,aAAa,YAAY,QAAQ,SAAS,OAAO,aAAa;AAC5F,SAAS,aAAa;AACtB,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAInB,MAAM,kBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AACZ;AAEO,SAAS,SAAS;AAAA,EACvB;AAAA,EAAM;AAAA,EAAM;AAAA,EAAS;AAAA,EAAK;AAAA,EAAW;AAAA,EAAQ;AAAA,EAAU;AACzD,GASG;AACD,QAAM,WAAW,gBAAgB,IAAI;AACrC,QAAM,WAAW,aAAa,MAAM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SAAI,WAAU,0BACZ,sBAAY,IAAI,CAAC,EAAE,OAAO,MAAM,MAAM,MAAM,OAAO,KAAK,MACvD;AAAA,QAAC;AAAA;AAAA,UAEC,MAAK;AAAA,UACL,SAAS,MAAM,SAAS,IAAI;AAAA,UAC5B,WAAW;AAAA,YAAG;AAAA,YACZ,UAAU,OAAO,sCAAsC;AAAA,UAAiC;AAAA,UAE1F;AAAA,gCAAC,QAAK,WAAW,GAAG,2BAA2B,UAAU,OAAO,oBAAoB,uBAAuB,GAAG;AAAA,YAC9G,qBAAC,UACC;AAAA,kCAAC,UAAK,WAAU,+BAA+B,iBAAM;AAAA,cACrD,oBAAC,UAAK,WAAU,8CAA8C,gBAAK;AAAA,eACrE;AAAA;AAAA;AAAA,QAVK;AAAA,MAWP,CACD,GACH;AAAA,OACF;AAAA,IAEC,UAAU,cACT,qBAAC,SAAI,WAAU,aACb;AAAA,0BAAC,WAAM,WAAU,uBAAsB,8BAAgB;AAAA,MACvD;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,KAAK;AAAA,UACL,OAAO;AAAA,UACP,UAAU,CAAC,MAAM,eAAe,EAAE,OAAO,KAAK;AAAA,UAC9C,WAAU;AAAA;AAAA,MACZ;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/asset-form-parts.tsx"],"sourcesContent":["\"use client\";\n\nimport type { RefObject } from \"react\";\nimport Image from \"next/image\";\nimport { Award, FileText, ImagePlus, Layers, Loader2, Music, Ticket, Users, Video } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport type { IPType } from \"../../data/ip.js\";\nimport { acceptFor } from \"../../utils/upload-limits.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { HandoffFormat } from \"../../utils/launchpad-handoff.js\";\nimport type { MediaKind } from \"./types.js\";\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nexport function MediaRow({\n file, kind, preview, uri, uploading, ipType, inputRef, onSelect,\n}: {\n file: File;\n kind: MediaKind;\n preview: string | null;\n uri: string | null;\n uploading: boolean;\n ipType: IPType;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n const KindIcon = MEDIA_KIND_ICON[kind];\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {kind === \"image\" && preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{file.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {uploading ? \"Uploading…\" : uri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {uri && (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => inputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={inputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n );\n}\n\nexport function CoverUpload({\n preview, uploading, inputRef, onSelect,\n}: {\n preview: string | null;\n uploading: boolean;\n inputRef: RefObject<HTMLInputElement | null>;\n onSelect: (file: File) => void;\n}) {\n return (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !uploading && inputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !uploading) { e.preventDefault(); inputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {preview ? (\n <Image src={preview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {uploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={inputRef} type=\"file\" accept={acceptFor(\"image\")} className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n );\n}\n\nexport type MintFormat = \"single\" | \"editions\" | HandoffFormat;\n\nexport const MINT_FORMATS: ReadonlyArray<{ value: MintFormat; icon: typeof ImagePlus; title: string; hint: string }> = [\n { value: \"single\", icon: ImagePlus, title: \"Single NFT\", hint: \"One copy, yours to keep or sell\" },\n { value: \"editions\", icon: Layers, title: \"Limited Editions\", hint: \"Numbered copies people can collect\" },\n { value: \"pop\", icon: Award, title: \"POP badge\", hint: \"A badge people claim to show they took part\" },\n { value: \"tickets\", icon: Ticket, title: \"IP Ticket\", hint: \"Tickets people hold and show at the door\" },\n { value: \"club\", icon: Users, title: \"IP Club\", hint: \"Membership cards for your community\" },\n];\n\nexport function FormatPicker({\n value, onChange, editionCount, onEditionCount,\n}: {\n value: MintFormat;\n onChange: (format: MintFormat) => void;\n editionCount: string;\n onEditionCount: (count: string) => void;\n}) {\n return (\n <>\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\" id=\"fast-mint-format\">What do you want to make with it?</label>\n <div role=\"radiogroup\" aria-labelledby=\"fast-mint-format\" className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n {MINT_FORMATS.map(({ value: format, icon: Icon, title, hint }) => (\n <button\n key={format}\n type=\"button\"\n role=\"radio\"\n aria-checked={value === format}\n onClick={() => onChange(format)}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n value === format ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Icon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", value === format ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">{title}</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">{hint}</span>\n </span>\n </button>\n ))}\n </div>\n </div>\n\n {value === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => onEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n </>\n );\n}\n"],"mappings":";AAqCM,SAqGF,UAnGM,KAFJ;AAlCN,OAAO,WAAW;AAClB,SAAS,OAAO,UAAU,WAAW,QAAQ,SAAS,OAAO,QAAQ,OAAO,aAAa;AACzF,SAAS,aAAa;AACtB,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAInB,MAAM,kBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AACZ;AAEO,SAAS,SAAS;AAAA,EACvB;AAAA,EAAM;AAAA,EAAM;AAAA,EAAS;AAAA,EAAK;AAAA,EA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= require("../dialog.js");
|
|
|
38
38
|
var import_dropzone = require("./dropzone.js");
|
|
39
39
|
var import_success_view = require("./success-view.js");
|
|
40
40
|
var import_asset_form_parts = require("./asset-form-parts.js");
|
|
41
|
+
var import_launchpad_handoff = require("../../utils/launchpad-handoff.js");
|
|
41
42
|
var import_collection_section = require("./collection-section.js");
|
|
42
43
|
var import_licensing_section = require("./licensing-section.js");
|
|
43
44
|
var import_ip_type_section = require("./ip-type-section.js");
|
|
@@ -54,6 +55,7 @@ function FastMint(props) {
|
|
|
54
55
|
onClose,
|
|
55
56
|
mediaKindLock,
|
|
56
57
|
onMinted,
|
|
58
|
+
onNavigate,
|
|
57
59
|
collections,
|
|
58
60
|
refetchCollections,
|
|
59
61
|
hasWallet,
|
|
@@ -73,7 +75,9 @@ function FastMint(props) {
|
|
|
73
75
|
const [mediaKind, setMediaKind] = (0, import_react.useState)("image");
|
|
74
76
|
const mediaInputRef = (0, import_react.useRef)(null);
|
|
75
77
|
const featureInputRef = (0, import_react.useRef)(null);
|
|
76
|
-
const [
|
|
78
|
+
const [format, setFormat] = (0, import_react.useState)("single");
|
|
79
|
+
const assetType = format === "editions" ? "editions" : "single";
|
|
80
|
+
const handoffFormat = format === "pop" || format === "tickets" || format === "club" ? format : null;
|
|
77
81
|
const [editionCount, setEditionCount] = (0, import_react.useState)("10");
|
|
78
82
|
const [collectionMode, setCollectionMode] = (0, import_react.useState)("existing");
|
|
79
83
|
const [existingCollectionId, setExistingCollectionId] = (0, import_react.useState)("");
|
|
@@ -123,6 +127,15 @@ function FastMint(props) {
|
|
|
123
127
|
media.clear();
|
|
124
128
|
if (mediaInputRef.current) mediaInputRef.current.value = "";
|
|
125
129
|
};
|
|
130
|
+
const handoffImageUri = mediaKind === "image" ? media.uri : feature.uri;
|
|
131
|
+
const handoffReady = !!media.uri && !media.uploading && !feature.uploading && !!handoffImageUri;
|
|
132
|
+
const continueToCreate = () => {
|
|
133
|
+
if (!handoffFormat || !handoffImageUri) return;
|
|
134
|
+
const href = (0, import_launchpad_handoff.handoffHref)(handoffFormat, { name, imageUri: handoffImageUri });
|
|
135
|
+
onClose?.();
|
|
136
|
+
if (onNavigate) onNavigate(href);
|
|
137
|
+
else window.location.assign(href);
|
|
138
|
+
};
|
|
126
139
|
const ready = !!media.uri && !media.uploading && name.trim().length > 0 && (mediaKind === "image" || !!feature.uri) && (collectionMode === "existing" ? assetType === "single" ? !!existingCollectionId : !!existingCollectionContract : draft.name.trim().length > 0 && draft.symbol.trim().length > 0);
|
|
127
140
|
const onSubmit = async (values) => {
|
|
128
141
|
if (!hasWallet) {
|
|
@@ -171,7 +184,7 @@ function FastMint(props) {
|
|
|
171
184
|
form.reset();
|
|
172
185
|
clearMedia();
|
|
173
186
|
feature.clear();
|
|
174
|
-
|
|
187
|
+
setFormat("single");
|
|
175
188
|
setEditionCount("10");
|
|
176
189
|
setCollectionMode("existing");
|
|
177
190
|
setExistingCollectionId("");
|
|
@@ -182,7 +195,8 @@ function FastMint(props) {
|
|
|
182
195
|
const busy = status === "minting";
|
|
183
196
|
const previewImage = mediaKind === "image" ? media.preview : feature.preview;
|
|
184
197
|
const selectedExistingCollection = assetType === "single" ? erc721Collections.find((c) => c.collectionId === existingCollectionId) : erc1155Collections.find((c) => c.contractAddress === existingCollectionContract);
|
|
185
|
-
const
|
|
198
|
+
const formatTitle = import_asset_form_parts.MINT_FORMATS.find((f) => f.value === format)?.title ?? "";
|
|
199
|
+
const collectionLabel = handoffFormat ? void 0 : media.uri ? collectionMode === "new" ? draft.name || "New collection" : selectedExistingCollection?.name || "IP Asset" : void 0;
|
|
186
200
|
const wrap = (node) => {
|
|
187
201
|
if (presentation !== "dialog") return node;
|
|
188
202
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open, onOpenChange: (next) => {
|
|
@@ -242,8 +256,20 @@ function FastMint(props) {
|
|
|
242
256
|
),
|
|
243
257
|
media.uri && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-8 items-start", children: [
|
|
244
258
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-5", children: [
|
|
259
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
260
|
+
import_asset_form_parts.FormatPicker,
|
|
261
|
+
{
|
|
262
|
+
value: format,
|
|
263
|
+
onChange: setFormat,
|
|
264
|
+
editionCount,
|
|
265
|
+
onEditionCount: setEditionCount
|
|
266
|
+
}
|
|
267
|
+
),
|
|
245
268
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
246
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "text-sm font-medium", children: [
|
|
270
|
+
"Title",
|
|
271
|
+
!handoffFormat && " *"
|
|
272
|
+
] }),
|
|
247
273
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
248
274
|
import_input.Input,
|
|
249
275
|
{
|
|
@@ -253,31 +279,33 @@ function FastMint(props) {
|
|
|
253
279
|
}
|
|
254
280
|
)
|
|
255
281
|
] }),
|
|
256
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
257
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
269
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "text-sm font-medium", children: [
|
|
270
|
-
"External link ",
|
|
271
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
|
|
282
|
+
!handoffFormat && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", children: "Description" }),
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
286
|
+
import_textarea.Textarea,
|
|
287
|
+
{
|
|
288
|
+
value: description,
|
|
289
|
+
onChange: (e) => form.setValue("description", e.target.value),
|
|
290
|
+
placeholder: "Describe your work, its story, and any context for buyers\u2026",
|
|
291
|
+
rows: 3
|
|
292
|
+
}
|
|
293
|
+
)
|
|
272
294
|
] }),
|
|
273
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
295
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "text-sm font-medium", children: [
|
|
297
|
+
"External link ",
|
|
298
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
|
|
299
|
+
] }),
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
301
|
+
import_input.Input,
|
|
302
|
+
{
|
|
303
|
+
value: form.watch("external_url"),
|
|
304
|
+
onChange: (e) => form.setValue("external_url", e.target.value),
|
|
305
|
+
placeholder: "https://yourwebsite.com"
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
] })
|
|
281
309
|
] }),
|
|
282
310
|
mediaKind !== "image" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
283
311
|
import_asset_form_parts.CoverUpload,
|
|
@@ -288,59 +316,69 @@ function FastMint(props) {
|
|
|
288
316
|
onSelect: (file) => void feature.start(file, (f) => uploadFile(f, "image"), setErrorMsg)
|
|
289
317
|
}
|
|
290
318
|
),
|
|
291
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
ipType,
|
|
320
|
-
onIpTypeChange: setIpType,
|
|
321
|
-
fieldsRef: templateFieldsRef,
|
|
322
|
-
uploadDocument: (file) => uploadFile(file, "document"),
|
|
323
|
-
existingDocument: mediaKind === "document" ? { uri: media.uri, name: mediaFile.name } : null
|
|
324
|
-
}
|
|
325
|
-
),
|
|
319
|
+
!handoffFormat && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
320
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
321
|
+
import_collection_section.CollectionSection,
|
|
322
|
+
{
|
|
323
|
+
assetType,
|
|
324
|
+
mode: collectionMode,
|
|
325
|
+
onModeChange: setCollectionMode,
|
|
326
|
+
collections: assetType === "single" ? erc721Collections : erc1155Collections,
|
|
327
|
+
existingId: existingCollectionId,
|
|
328
|
+
existingContract: existingCollectionContract,
|
|
329
|
+
onExistingId: setExistingCollectionId,
|
|
330
|
+
onExistingContract: setExistingCollectionContract,
|
|
331
|
+
draft,
|
|
332
|
+
previewImage
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_licensing_section.LicensingSection, { form }),
|
|
336
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
337
|
+
import_ip_type_section.IpTypeSection,
|
|
338
|
+
{
|
|
339
|
+
ipType,
|
|
340
|
+
onIpTypeChange: setIpType,
|
|
341
|
+
fieldsRef: templateFieldsRef,
|
|
342
|
+
uploadDocument: (file) => uploadFile(file, "document"),
|
|
343
|
+
existingDocument: mediaKind === "document" ? { uri: media.uri, name: mediaFile.name } : null
|
|
344
|
+
}
|
|
345
|
+
)
|
|
346
|
+
] }),
|
|
326
347
|
status === "error" && errorMsg && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: errorMsg }),
|
|
327
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
348
|
+
handoffFormat ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
328
349
|
"button",
|
|
329
350
|
{
|
|
330
351
|
type: "button",
|
|
331
|
-
disabled:
|
|
332
|
-
onClick:
|
|
352
|
+
disabled: !handoffReady,
|
|
353
|
+
onClick: continueToCreate,
|
|
333
354
|
className: (0, import_cn.cn)(
|
|
334
355
|
"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] bg-brand-blue",
|
|
335
|
-
|
|
356
|
+
!handoffReady && "opacity-40 pointer-events-none"
|
|
336
357
|
),
|
|
337
|
-
children:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
]
|
|
358
|
+
children: [
|
|
359
|
+
"Continue to ",
|
|
360
|
+
formatTitle
|
|
361
|
+
]
|
|
341
362
|
}
|
|
342
|
-
),
|
|
343
|
-
|
|
363
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
type: "button",
|
|
368
|
+
disabled: submitBlocked,
|
|
369
|
+
onClick: form.handleSubmit(onSubmit),
|
|
370
|
+
className: (0, import_cn.cn)(
|
|
371
|
+
"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] bg-brand-blue",
|
|
372
|
+
submitBlocked && "opacity-40 pointer-events-none"
|
|
373
|
+
),
|
|
374
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
376
|
+
"Minting\u2026"
|
|
377
|
+
] }) : assetType === "single" ? "Mint NFT" : "Mint Editions"
|
|
378
|
+
}
|
|
379
|
+
),
|
|
380
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-center text-muted-foreground", children: "Zero platform fees to mint." })
|
|
381
|
+
] })
|
|
344
382
|
] }),
|
|
345
383
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "order-first lg:order-last lg:sticky lg:top-20 max-w-[260px] mx-auto w-full lg:max-w-none lg:mx-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
346
384
|
import_medialane_collection_card.MedialaneCollectionCard,
|