@medialane/ui 0.365.0 → 0.367.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/approve-mint-dialog.d.cts +0 -1
- package/dist/components/approve-mint-dialog.d.ts +0 -1
- package/dist/components/fast-mint/asset-form-parts.cjs +28 -47
- package/dist/components/fast-mint/asset-form-parts.cjs.map +1 -1
- package/dist/components/fast-mint/asset-form-parts.d.cts +13 -8
- package/dist/components/fast-mint/asset-form-parts.d.ts +13 -8
- package/dist/components/fast-mint/asset-form-parts.js +29 -48
- package/dist/components/fast-mint/asset-form-parts.js.map +1 -1
- package/dist/components/fast-mint/collection-section.cjs +11 -21
- package/dist/components/fast-mint/collection-section.cjs.map +1 -1
- package/dist/components/fast-mint/collection-section.d.cts +5 -7
- package/dist/components/fast-mint/collection-section.d.ts +5 -7
- package/dist/components/fast-mint/collection-section.js +11 -21
- package/dist/components/fast-mint/collection-section.js.map +1 -1
- package/dist/components/fast-mint/create-then-add.cjs +55 -0
- package/dist/components/fast-mint/create-then-add.cjs.map +1 -0
- package/dist/components/fast-mint/create-then-add.d.cts +24 -0
- package/dist/components/fast-mint/create-then-add.d.ts +24 -0
- package/dist/components/fast-mint/create-then-add.js +30 -0
- package/dist/components/fast-mint/create-then-add.js.map +1 -0
- package/dist/components/fast-mint/dropzone.d.cts +0 -1
- package/dist/components/fast-mint/dropzone.d.ts +0 -1
- package/dist/components/fast-mint/fast-mint.cjs +68 -102
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +70 -104
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/formats/nft.cjs +233 -0
- package/dist/components/fast-mint/formats/nft.cjs.map +1 -0
- package/dist/components/fast-mint/formats/nft.d.cts +19 -0
- package/dist/components/fast-mint/formats/nft.d.ts +19 -0
- package/dist/components/fast-mint/formats/nft.js +214 -0
- package/dist/components/fast-mint/formats/nft.js.map +1 -0
- package/dist/components/fast-mint/formats/pop.cjs +160 -0
- package/dist/components/fast-mint/formats/pop.cjs.map +1 -0
- package/dist/components/fast-mint/formats/pop.d.cts +18 -0
- package/dist/components/fast-mint/formats/pop.d.ts +18 -0
- package/dist/components/fast-mint/formats/pop.js +136 -0
- package/dist/components/fast-mint/formats/pop.js.map +1 -0
- package/dist/components/fast-mint/formats/registry.cjs +42 -0
- package/dist/components/fast-mint/formats/registry.cjs.map +1 -0
- package/dist/components/fast-mint/formats/registry.d.cts +20 -0
- package/dist/components/fast-mint/formats/registry.d.ts +20 -0
- package/dist/components/fast-mint/formats/registry.js +16 -0
- package/dist/components/fast-mint/formats/registry.js.map +1 -0
- package/dist/components/fast-mint/formats/tiers.cjs +206 -0
- package/dist/components/fast-mint/formats/tiers.cjs.map +1 -0
- package/dist/components/fast-mint/formats/tiers.d.cts +19 -0
- package/dist/components/fast-mint/formats/tiers.d.ts +19 -0
- package/dist/components/fast-mint/formats/tiers.js +181 -0
- package/dist/components/fast-mint/formats/tiers.js.map +1 -0
- package/dist/components/fast-mint/formats/types.cjs +31 -0
- package/dist/components/fast-mint/formats/types.cjs.map +1 -0
- package/dist/components/fast-mint/formats/types.d.cts +71 -0
- package/dist/components/fast-mint/formats/types.d.ts +71 -0
- package/dist/components/fast-mint/formats/types.js +7 -0
- package/dist/components/fast-mint/formats/types.js.map +1 -0
- package/dist/components/fast-mint/media-kind.d.cts +0 -1
- package/dist/components/fast-mint/media-kind.d.ts +0 -1
- package/dist/components/fast-mint/success-view.cjs +18 -59
- package/dist/components/fast-mint/success-view.cjs.map +1 -1
- package/dist/components/fast-mint/success-view.d.cts +13 -8
- package/dist/components/fast-mint/success-view.d.ts +13 -8
- package/dist/components/fast-mint/success-view.js +19 -60
- package/dist/components/fast-mint/success-view.js.map +1 -1
- package/dist/components/fast-mint/types.cjs.map +1 -1
- package/dist/components/fast-mint/types.d.cts +0 -2
- package/dist/components/fast-mint/types.d.ts +0 -2
- package/dist/components/launchpad/collection-create-form.cjs +3 -2
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +3 -2
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs +5 -3
- package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-fields.d.cts +8 -2
- package/dist/components/launchpad/pop-create-fields.d.ts +8 -2
- package/dist/components/launchpad/pop-create-fields.js +4 -3
- package/dist/components/launchpad/pop-create-fields.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs +8 -12
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js +8 -12
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +8 -25
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +6 -23
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/transfer-dialog.d.cts +0 -1
- package/dist/components/transfer-dialog.d.ts +0 -1
- package/dist/data/launchpad-services.cjs +12 -12
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.js +12 -12
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/utils/drop/actions.d.cts +0 -1
- package/dist/utils/drop/actions.d.ts +0 -1
- package/dist/utils/drop/types.d.cts +0 -1
- package/dist/utils/drop/types.d.ts +0 -1
- package/dist/utils/launchpad-actions.cjs +90 -0
- package/dist/utils/launchpad-actions.cjs.map +1 -0
- package/dist/utils/launchpad-actions.d.cts +39 -0
- package/dist/utils/launchpad-actions.d.ts +39 -0
- package/dist/utils/launchpad-actions.js +60 -0
- package/dist/utils/launchpad-actions.js.map +1 -0
- package/dist/utils/use-transaction.d.cts +0 -1
- package/dist/utils/use-transaction.d.ts +0 -1
- package/package.json +1 -1
- package/dist/components/fast-mint/mint-asset.cjs +0 -124
- package/dist/components/fast-mint/mint-asset.cjs.map +0 -1
- package/dist/components/fast-mint/mint-asset.d.cts +0 -41
- package/dist/components/fast-mint/mint-asset.d.ts +0 -41
- package/dist/components/fast-mint/mint-asset.js +0 -100
- package/dist/components/fast-mint/mint-asset.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ComponentType, MutableRefObject } from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
4
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
5
|
+
import { MedialaneClient } from '@medialane/sdk/starknet';
|
|
6
|
+
import { IPType } from '../../../data/ip.js';
|
|
7
|
+
import { MetadataField } from '../../ip-type-fields.js';
|
|
8
|
+
import { FormValues } from '../form.js';
|
|
9
|
+
import { MintedAsset, MediaKind, FastMintSigner } from '../types.js';
|
|
10
|
+
import { useNewCollectionDraft } from '../use-new-collection-draft.js';
|
|
11
|
+
import { StepInfo } from '../create-then-add.js';
|
|
12
|
+
import 'react/jsx-runtime';
|
|
13
|
+
import 'starknet';
|
|
14
|
+
|
|
15
|
+
type MintFormat = "single" | "editions" | "pop" | "tickets" | "club";
|
|
16
|
+
interface FormatShared {
|
|
17
|
+
form: UseFormReturn<FormValues>;
|
|
18
|
+
draft: ReturnType<typeof useNewCollectionDraft>;
|
|
19
|
+
collections: ApiCollection[];
|
|
20
|
+
walletAddress: string;
|
|
21
|
+
mediaKind: MediaKind;
|
|
22
|
+
mediaUri: string;
|
|
23
|
+
mediaName: string;
|
|
24
|
+
image: string;
|
|
25
|
+
previewImage: string | null;
|
|
26
|
+
ipType: IPType;
|
|
27
|
+
onIpTypeChange: (type: IPType) => void;
|
|
28
|
+
templateFieldsRef: MutableRefObject<MetadataField[]>;
|
|
29
|
+
uploadDocument: (file: File) => Promise<string>;
|
|
30
|
+
}
|
|
31
|
+
interface FormatRuntime {
|
|
32
|
+
client: MedialaneClient;
|
|
33
|
+
signer: FastMintSigner;
|
|
34
|
+
getUploadToken: () => Promise<string | null>;
|
|
35
|
+
resume: unknown;
|
|
36
|
+
onStep: (step: StepInfo) => void;
|
|
37
|
+
}
|
|
38
|
+
interface FormatLink {
|
|
39
|
+
href: string;
|
|
40
|
+
label: string;
|
|
41
|
+
icon: LucideIcon;
|
|
42
|
+
}
|
|
43
|
+
interface FormatResult {
|
|
44
|
+
headline: string;
|
|
45
|
+
detail: string;
|
|
46
|
+
name: string;
|
|
47
|
+
collectionLabel?: string;
|
|
48
|
+
links: FormatLink[];
|
|
49
|
+
reward: string;
|
|
50
|
+
asset?: MintedAsset;
|
|
51
|
+
}
|
|
52
|
+
interface FormatFieldsProps<S> {
|
|
53
|
+
shared: FormatShared;
|
|
54
|
+
state: S;
|
|
55
|
+
update: (patch: Partial<S>) => void;
|
|
56
|
+
}
|
|
57
|
+
interface FormatDefinition<S = unknown> {
|
|
58
|
+
key: MintFormat;
|
|
59
|
+
title: string;
|
|
60
|
+
hint: string;
|
|
61
|
+
icon: LucideIcon;
|
|
62
|
+
submitLabel: (state: S) => string;
|
|
63
|
+
initial: () => S;
|
|
64
|
+
Fields: ComponentType<FormatFieldsProps<S>>;
|
|
65
|
+
isReady: (shared: FormatShared, state: S) => boolean;
|
|
66
|
+
previewLabel: (shared: FormatShared, state: S) => string | undefined;
|
|
67
|
+
submit: (shared: FormatShared, state: S, runtime: FormatRuntime) => Promise<FormatResult>;
|
|
68
|
+
}
|
|
69
|
+
declare function defineFormat<S>(format: FormatDefinition<S>): FormatDefinition;
|
|
70
|
+
|
|
71
|
+
export { type FormatDefinition, type FormatFieldsProps, type FormatLink, type FormatResult, type FormatRuntime, type FormatShared, type MintFormat, defineFormat };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/fast-mint/formats/types.ts"],"sourcesContent":["import type { ComponentType, MutableRefObject } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { IPType } from \"../../../data/ip.js\";\nimport type { MetadataField } from \"../../ip-type-fields.js\";\nimport type { FormValues } from \"../form.js\";\nimport type { FastMintSigner, MediaKind, MintedAsset } from \"../types.js\";\nimport type { useNewCollectionDraft } from \"../use-new-collection-draft.js\";\nimport type { StepInfo } from \"../create-then-add.js\";\n\nexport type MintFormat = \"single\" | \"editions\" | \"pop\" | \"tickets\" | \"club\";\n\nexport interface FormatShared {\n form: UseFormReturn<FormValues>;\n draft: ReturnType<typeof useNewCollectionDraft>;\n collections: ApiCollection[];\n walletAddress: string;\n mediaKind: MediaKind;\n mediaUri: string;\n mediaName: string;\n image: string;\n previewImage: string | null;\n ipType: IPType;\n onIpTypeChange: (type: IPType) => void;\n templateFieldsRef: MutableRefObject<MetadataField[]>;\n uploadDocument: (file: File) => Promise<string>;\n}\n\nexport interface FormatRuntime {\n client: MedialaneClient;\n signer: FastMintSigner;\n getUploadToken: () => Promise<string | null>;\n resume: unknown;\n onStep: (step: StepInfo) => void;\n}\n\nexport interface FormatLink {\n href: string;\n label: string;\n icon: LucideIcon;\n}\n\nexport interface FormatResult {\n headline: string;\n detail: string;\n name: string;\n collectionLabel?: string;\n links: FormatLink[];\n reward: string;\n asset?: MintedAsset;\n}\n\nexport interface FormatFieldsProps<S> {\n shared: FormatShared;\n state: S;\n update: (patch: Partial<S>) => void;\n}\n\nexport interface FormatDefinition<S = unknown> {\n key: MintFormat;\n title: string;\n hint: string;\n icon: LucideIcon;\n submitLabel: (state: S) => string;\n initial: () => S;\n Fields: ComponentType<FormatFieldsProps<S>>;\n isReady: (shared: FormatShared, state: S) => boolean;\n previewLabel: (shared: FormatShared, state: S) => string | undefined;\n submit: (shared: FormatShared, state: S, runtime: FormatRuntime) => Promise<FormatResult>;\n}\n\nexport function defineFormat<S>(format: FormatDefinition<S>): FormatDefinition {\n return format as unknown as FormatDefinition;\n}\n"],"mappings":"AAyEO,SAAS,aAAgB,QAA+C;AAC7E,SAAO;AACT;","names":[]}
|
|
@@ -38,72 +38,31 @@ var import_lucide_react = require("lucide-react");
|
|
|
38
38
|
var import_cn = require("../../utils/cn.js");
|
|
39
39
|
var import_button = require("../button.js");
|
|
40
40
|
var import_medialane_collection_card = require("../medialane-collection-card.js");
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
previewImage,
|
|
44
|
-
name,
|
|
45
|
-
collectionLabel,
|
|
46
|
-
mintedAsset,
|
|
47
|
-
footer,
|
|
48
|
-
onPublishAnother
|
|
49
|
-
}) {
|
|
41
|
+
var import_reward_earned = require("../rewards/reward-earned.js");
|
|
42
|
+
function SuccessView({ presentation = "inline", previewImage, result, onPublishAnother }) {
|
|
50
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: (0, import_cn.cn)(presentation === "dialog" ? "" : "rounded-2xl border border-border p-6 sm:p-8"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-6 items-start", children: [
|
|
51
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_medialane_collection_card.MedialaneCollectionCard, { image: previewImage, name, collection: collectionLabel }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_medialane_collection_card.MedialaneCollectionCard, { image: previewImage, name: result.name, collection: result.collectionLabel }),
|
|
52
45
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-5", children: [
|
|
53
46
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
54
47
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-green-500", children: [
|
|
55
48
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckCircle2, { className: "h-5 w-5" }),
|
|
56
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children:
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: result.headline })
|
|
57
50
|
] }),
|
|
58
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children:
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: result.detail })
|
|
59
52
|
] }),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
import_link.default,
|
|
74
|
-
{
|
|
75
|
-
href: `/asset/STARKNET/${mintedAsset.contract}/${mintedAsset.tokenId}?action=list`,
|
|
76
|
-
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Tag, { className: "h-4 w-4 text-muted-foreground" }),
|
|
79
|
-
"Sell on marketplace"
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
84
|
-
import_link.default,
|
|
85
|
-
{
|
|
86
|
-
href: `/asset/STARKNET/${mintedAsset.contract}/${mintedAsset.tokenId}?action=transfer`,
|
|
87
|
-
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRightLeft, { className: "h-4 w-4 text-muted-foreground" }),
|
|
90
|
-
"Transfer"
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
),
|
|
94
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
95
|
-
import_link.default,
|
|
96
|
-
{
|
|
97
|
-
href: `/create/remix/${mintedAsset.contract}/${mintedAsset.tokenId}`,
|
|
98
|
-
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
99
|
-
children: [
|
|
100
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.GitBranch, { className: "h-4 w-4 text-muted-foreground" }),
|
|
101
|
-
"Create a remix"
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
] }),
|
|
106
|
-
footer,
|
|
53
|
+
result.links.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-2.5", children: result.links.map(({ href, label, icon: Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
54
|
+
import_link.default,
|
|
55
|
+
{
|
|
56
|
+
href,
|
|
57
|
+
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-4 w-4 text-muted-foreground" }),
|
|
60
|
+
label
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
href
|
|
64
|
+
)) }),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reward_earned.RewardEarned, { actionType: result.reward }),
|
|
107
66
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", onClick: onPublishAnother, className: "w-full sm:w-auto", children: "Publish another" })
|
|
108
67
|
] })
|
|
109
68
|
] }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/success-view.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/success-view.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"../link.js\";\nimport { CheckCircle2 } from \"lucide-react\";\nimport { cn } from \"../../utils/cn.js\";\nimport { Button } from \"../button.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { RewardEarned } from \"../rewards/reward-earned.js\";\nimport type { FormatResult } from \"./formats/types.js\";\n\nexport interface SuccessViewProps {\n presentation?: \"inline\" | \"dialog\";\n previewImage: string | null;\n result: FormatResult;\n onPublishAnother: () => void;\n}\n\nexport function SuccessView({ presentation = \"inline\", previewImage, result, onPublishAnother }: SuccessViewProps) {\n return (\n <section className={cn(presentation === \"dialog\" ? \"\" : \"rounded-2xl border border-border p-6 sm:p-8\")}>\n <div className=\"grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-6 items-start\">\n <MedialaneCollectionCard image={previewImage} name={result.name} collection={result.collectionLabel} />\n <div className=\"space-y-5\">\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-2 text-green-500\">\n <CheckCircle2 className=\"h-5 w-5\" />\n <p className=\"text-sm font-semibold\">{result.headline}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">{result.detail}</p>\n </div>\n\n {result.links.length > 0 && (\n <div className=\"grid grid-cols-2 gap-2.5\">\n {result.links.map(({ href, label, icon: Icon }) => (\n <Link\n key={href}\n href={href}\n className=\"flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors\"\n >\n <Icon className=\"h-4 w-4 text-muted-foreground\" />\n {label}\n </Link>\n ))}\n </div>\n )}\n\n <RewardEarned actionType={result.reward} />\n\n <Button variant=\"outline\" onClick={onPublishAnother} className=\"w-full sm:w-auto\">\n Publish another\n </Button>\n </div>\n </div>\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBQ;AAnBR,kBAAiB;AACjB,0BAA6B;AAC7B,gBAAmB;AACnB,oBAAuB;AACvB,uCAAwC;AACxC,2BAA6B;AAUtB,SAAS,YAAY,EAAE,eAAe,UAAU,cAAc,QAAQ,iBAAiB,GAAqB;AACjH,SACE,4CAAC,aAAQ,eAAW,cAAG,iBAAiB,WAAW,KAAK,6CAA6C,GACnG,uDAAC,SAAI,WAAU,+DACb;AAAA,gDAAC,4DAAwB,OAAO,cAAc,MAAM,OAAO,MAAM,YAAY,OAAO,iBAAiB;AAAA,IACrG,6CAAC,SAAI,WAAU,aACb;AAAA,mDAAC,SAAI,WAAU,eACb;AAAA,qDAAC,SAAI,WAAU,0CACb;AAAA,sDAAC,oCAAa,WAAU,WAAU;AAAA,UAClC,4CAAC,OAAE,WAAU,yBAAyB,iBAAO,UAAS;AAAA,WACxD;AAAA,QACA,4CAAC,OAAE,WAAU,iCAAiC,iBAAO,QAAO;AAAA,SAC9D;AAAA,MAEC,OAAO,MAAM,SAAS,KACrB,4CAAC,SAAI,WAAU,4BACZ,iBAAO,MAAM,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,KAAK,MAC3C;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UAEC;AAAA,UACA,WAAU;AAAA,UAEV;AAAA,wDAAC,QAAK,WAAU,iCAAgC;AAAA,YAC/C;AAAA;AAAA;AAAA,QALI;AAAA,MAMP,CACD,GACH;AAAA,MAGF,4CAAC,qCAAa,YAAY,OAAO,QAAQ;AAAA,MAEzC,4CAAC,wBAAO,SAAQ,WAAU,SAAS,kBAAkB,WAAU,oBAAmB,6BAElF;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":["Link"]}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import '
|
|
2
|
+
import { FormatResult } from './formats/types.cjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'lucide-react';
|
|
5
|
+
import 'react-hook-form';
|
|
5
6
|
import '@medialane/sdk';
|
|
6
7
|
import '@medialane/sdk/starknet';
|
|
8
|
+
import '../../data/ip.cjs';
|
|
9
|
+
import '../ip-type-fields.cjs';
|
|
10
|
+
import './form.cjs';
|
|
11
|
+
import './types.cjs';
|
|
12
|
+
import 'starknet';
|
|
13
|
+
import './use-new-collection-draft.cjs';
|
|
14
|
+
import './create-then-add.cjs';
|
|
7
15
|
|
|
8
16
|
interface SuccessViewProps {
|
|
9
17
|
presentation?: "inline" | "dialog";
|
|
10
18
|
previewImage: string | null;
|
|
11
|
-
|
|
12
|
-
collectionLabel?: string;
|
|
13
|
-
mintedAsset: MintedAsset | null;
|
|
19
|
+
result: FormatResult;
|
|
14
20
|
onPublishAnother: () => void;
|
|
15
|
-
footer?: ReactNode;
|
|
16
21
|
}
|
|
17
|
-
declare function SuccessView({ presentation, previewImage,
|
|
22
|
+
declare function SuccessView({ presentation, previewImage, result, onPublishAnother }: SuccessViewProps): react_jsx_runtime.JSX.Element;
|
|
18
23
|
|
|
19
24
|
export { SuccessView, type SuccessViewProps };
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import '
|
|
2
|
+
import { FormatResult } from './formats/types.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'lucide-react';
|
|
5
|
+
import 'react-hook-form';
|
|
5
6
|
import '@medialane/sdk';
|
|
6
7
|
import '@medialane/sdk/starknet';
|
|
8
|
+
import '../../data/ip.js';
|
|
9
|
+
import '../ip-type-fields.js';
|
|
10
|
+
import './form.js';
|
|
11
|
+
import './types.js';
|
|
12
|
+
import 'starknet';
|
|
13
|
+
import './use-new-collection-draft.js';
|
|
14
|
+
import './create-then-add.js';
|
|
7
15
|
|
|
8
16
|
interface SuccessViewProps {
|
|
9
17
|
presentation?: "inline" | "dialog";
|
|
10
18
|
previewImage: string | null;
|
|
11
|
-
|
|
12
|
-
collectionLabel?: string;
|
|
13
|
-
mintedAsset: MintedAsset | null;
|
|
19
|
+
result: FormatResult;
|
|
14
20
|
onPublishAnother: () => void;
|
|
15
|
-
footer?: ReactNode;
|
|
16
21
|
}
|
|
17
|
-
declare function SuccessView({ presentation, previewImage,
|
|
22
|
+
declare function SuccessView({ presentation, previewImage, result, onPublishAnother }: SuccessViewProps): react_jsx_runtime.JSX.Element;
|
|
18
23
|
|
|
19
24
|
export { SuccessView, type SuccessViewProps };
|
|
@@ -1,76 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Link from "../link.js";
|
|
4
|
-
import { CheckCircle2
|
|
4
|
+
import { CheckCircle2 } from "lucide-react";
|
|
5
5
|
import { cn } from "../../utils/cn.js";
|
|
6
6
|
import { Button } from "../button.js";
|
|
7
7
|
import { MedialaneCollectionCard } from "../medialane-collection-card.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
previewImage,
|
|
11
|
-
name,
|
|
12
|
-
collectionLabel,
|
|
13
|
-
mintedAsset,
|
|
14
|
-
footer,
|
|
15
|
-
onPublishAnother
|
|
16
|
-
}) {
|
|
8
|
+
import { RewardEarned } from "../rewards/reward-earned.js";
|
|
9
|
+
function SuccessView({ presentation = "inline", previewImage, result, onPublishAnother }) {
|
|
17
10
|
return /* @__PURE__ */ jsx("section", { className: cn(presentation === "dialog" ? "" : "rounded-2xl border border-border p-6 sm:p-8"), children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-6 items-start", children: [
|
|
18
|
-
/* @__PURE__ */ jsx(MedialaneCollectionCard, { image: previewImage, name, collection: collectionLabel }),
|
|
11
|
+
/* @__PURE__ */ jsx(MedialaneCollectionCard, { image: previewImage, name: result.name, collection: result.collectionLabel }),
|
|
19
12
|
/* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
20
13
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
21
14
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-green-500", children: [
|
|
22
15
|
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5" }),
|
|
23
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children:
|
|
16
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: result.headline })
|
|
24
17
|
] }),
|
|
25
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
18
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: result.detail })
|
|
26
19
|
] }),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Link,
|
|
41
|
-
{
|
|
42
|
-
href: `/asset/STARKNET/${mintedAsset.contract}/${mintedAsset.tokenId}?action=list`,
|
|
43
|
-
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ jsx(Tag, { className: "h-4 w-4 text-muted-foreground" }),
|
|
46
|
-
"Sell on marketplace"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ jsxs(
|
|
51
|
-
Link,
|
|
52
|
-
{
|
|
53
|
-
href: `/asset/STARKNET/${mintedAsset.contract}/${mintedAsset.tokenId}?action=transfer`,
|
|
54
|
-
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-4 w-4 text-muted-foreground" }),
|
|
57
|
-
"Transfer"
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
/* @__PURE__ */ jsxs(
|
|
62
|
-
Link,
|
|
63
|
-
{
|
|
64
|
-
href: `/create/remix/${mintedAsset.contract}/${mintedAsset.tokenId}`,
|
|
65
|
-
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
66
|
-
children: [
|
|
67
|
-
/* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4 text-muted-foreground" }),
|
|
68
|
-
"Create a remix"
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] }),
|
|
73
|
-
footer,
|
|
20
|
+
result.links.length > 0 && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2.5", children: result.links.map(({ href, label, icon: Icon }) => /* @__PURE__ */ jsxs(
|
|
21
|
+
Link,
|
|
22
|
+
{
|
|
23
|
+
href,
|
|
24
|
+
className: "flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 text-muted-foreground" }),
|
|
27
|
+
label
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
href
|
|
31
|
+
)) }),
|
|
32
|
+
/* @__PURE__ */ jsx(RewardEarned, { actionType: result.reward }),
|
|
74
33
|
/* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onPublishAnother, className: "w-full sm:w-auto", children: "Publish another" })
|
|
75
34
|
] })
|
|
76
35
|
] }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/success-view.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/success-view.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"../link.js\";\nimport { CheckCircle2 } from \"lucide-react\";\nimport { cn } from \"../../utils/cn.js\";\nimport { Button } from \"../button.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { RewardEarned } from \"../rewards/reward-earned.js\";\nimport type { FormatResult } from \"./formats/types.js\";\n\nexport interface SuccessViewProps {\n presentation?: \"inline\" | \"dialog\";\n previewImage: string | null;\n result: FormatResult;\n onPublishAnother: () => void;\n}\n\nexport function SuccessView({ presentation = \"inline\", previewImage, result, onPublishAnother }: SuccessViewProps) {\n return (\n <section className={cn(presentation === \"dialog\" ? \"\" : \"rounded-2xl border border-border p-6 sm:p-8\")}>\n <div className=\"grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-6 items-start\">\n <MedialaneCollectionCard image={previewImage} name={result.name} collection={result.collectionLabel} />\n <div className=\"space-y-5\">\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-2 text-green-500\">\n <CheckCircle2 className=\"h-5 w-5\" />\n <p className=\"text-sm font-semibold\">{result.headline}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">{result.detail}</p>\n </div>\n\n {result.links.length > 0 && (\n <div className=\"grid grid-cols-2 gap-2.5\">\n {result.links.map(({ href, label, icon: Icon }) => (\n <Link\n key={href}\n href={href}\n className=\"flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-sm font-semibold hover:bg-muted/40 transition-colors\"\n >\n <Icon className=\"h-4 w-4 text-muted-foreground\" />\n {label}\n </Link>\n ))}\n </div>\n )}\n\n <RewardEarned actionType={result.reward} />\n\n <Button variant=\"outline\" onClick={onPublishAnother} className=\"w-full sm:w-auto\">\n Publish another\n </Button>\n </div>\n </div>\n </section>\n );\n}\n"],"mappings":";AAqBQ,cAGI,YAHJ;AAnBR,OAAO,UAAU;AACjB,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,+BAA+B;AACxC,SAAS,oBAAoB;AAUtB,SAAS,YAAY,EAAE,eAAe,UAAU,cAAc,QAAQ,iBAAiB,GAAqB;AACjH,SACE,oBAAC,aAAQ,WAAW,GAAG,iBAAiB,WAAW,KAAK,6CAA6C,GACnG,+BAAC,SAAI,WAAU,+DACb;AAAA,wBAAC,2BAAwB,OAAO,cAAc,MAAM,OAAO,MAAM,YAAY,OAAO,iBAAiB;AAAA,IACrG,qBAAC,SAAI,WAAU,aACb;AAAA,2BAAC,SAAI,WAAU,eACb;AAAA,6BAAC,SAAI,WAAU,0CACb;AAAA,8BAAC,gBAAa,WAAU,WAAU;AAAA,UAClC,oBAAC,OAAE,WAAU,yBAAyB,iBAAO,UAAS;AAAA,WACxD;AAAA,QACA,oBAAC,OAAE,WAAU,iCAAiC,iBAAO,QAAO;AAAA,SAC9D;AAAA,MAEC,OAAO,MAAM,SAAS,KACrB,oBAAC,SAAI,WAAU,4BACZ,iBAAO,MAAM,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,KAAK,MAC3C;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA,WAAU;AAAA,UAEV;AAAA,gCAAC,QAAK,WAAU,iCAAgC;AAAA,YAC/C;AAAA;AAAA;AAAA,QALI;AAAA,MAMP,CACD,GACH;AAAA,MAGF,oBAAC,gBAAa,YAAY,OAAO,QAAQ;AAAA,MAEzC,oBAAC,UAAO,SAAQ,WAAU,SAAS,kBAAkB,WAAU,oBAAmB,6BAElF;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/types.ts"],"sourcesContent":["import type { Call, TypedData } from \"starknet\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\n\nexport type MediaKind = \"image\" | \"audio\" | \"video\" | \"document\";\n\nexport interface FastMintSigner {\n readonly address: string;\n execute(calls: Call[], opts?: { intentIds?: string[] }): Promise<{ txHash: string }>;\n signTypedData(data: TypedData): Promise<string[]>;\n}\n\nexport interface MintedAsset {\n contract: string;\n tokenId: string;\n image: string | null;\n}\n\nexport interface FastMintProps {\n presentation?: \"inline\" | \"dialog\";\n open?: boolean;\n onClose?: () => void;\n\n mediaKindLock?: MediaKind;\n onMinted?: (asset: MintedAsset) => void;\n\n collections: ApiCollection[];\n refetchCollections: () => Promise<ApiCollection[]>;\n\n hasWallet: boolean;\n walletAddress: string | null;\n onRequireWallet: () => void;\n connectLabel?: string;\n getUploadToken: () => Promise<string | null>;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n client: MedialaneClient;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { Call, TypedData } from 'starknet';
|
|
3
2
|
import { ApiCollection } from '@medialane/sdk';
|
|
4
3
|
import { MedialaneClient } from '@medialane/sdk/starknet';
|
|
@@ -33,7 +32,6 @@ interface FastMintProps {
|
|
|
33
32
|
getUploadToken: () => Promise<string | null>;
|
|
34
33
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
35
34
|
client: MedialaneClient;
|
|
36
|
-
successFooter?: ReactNode;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
export type { FastMintProps, FastMintSigner, MediaKind, MintedAsset };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { Call, TypedData } from 'starknet';
|
|
3
2
|
import { ApiCollection } from '@medialane/sdk';
|
|
4
3
|
import { MedialaneClient } from '@medialane/sdk/starknet';
|
|
@@ -33,7 +32,6 @@ interface FastMintProps {
|
|
|
33
32
|
getUploadToken: () => Promise<string | null>;
|
|
34
33
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
35
34
|
client: MedialaneClient;
|
|
36
|
-
successFooter?: ReactNode;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
export type { FastMintProps, FastMintSigner, MediaKind, MintedAsset };
|
|
@@ -56,6 +56,7 @@ var import_wallet_required = require("../wallet-required.js");
|
|
|
56
56
|
var import_medialane_app = require("../medialane-app.js");
|
|
57
57
|
var import_reward_earned = require("../rewards/reward-earned.js");
|
|
58
58
|
var import_run_intent_calls = require("../../utils/run-intent-calls.js");
|
|
59
|
+
var import_launchpad_actions = require("../../utils/launchpad-actions.js");
|
|
59
60
|
var import_ipfs_upload = require("../../utils/ipfs-upload.js");
|
|
60
61
|
var import_use_transaction = require("../../utils/use-transaction.js");
|
|
61
62
|
var import_use_launchpad_image_upload = require("../../utils/use-launchpad-image-upload.js");
|
|
@@ -138,12 +139,12 @@ function CollectionCreateForm({ preset, aside }) {
|
|
|
138
139
|
);
|
|
139
140
|
await (0, import_run_intent_calls.runIntentCalls)(
|
|
140
141
|
signer,
|
|
141
|
-
() =>
|
|
142
|
+
() => (0, import_launchpad_actions.serviceCollectionIntent)(api, {
|
|
142
143
|
owner: walletAddress,
|
|
143
144
|
name: values.name,
|
|
144
145
|
symbol: values.symbol,
|
|
145
146
|
baseUri,
|
|
146
|
-
|
|
147
|
+
service: preset.service ?? void 0
|
|
147
148
|
})
|
|
148
149
|
);
|
|
149
150
|
(0, import_portfolio_cache.invalidatePortfolioCache)(walletAddress);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/launchpad/collection-create-form.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { ImagePlus, Loader2, X } from \"lucide-react\";\nimport { buildCollectionMetadata, collectionHref, getCoordinates, profileHref } from \"@medialane/sdk\";\nimport { acceptFor } from \"../../utils/upload-limits.js\";\nimport { FIELD_LIMITS } from \"../../utils/field-limits.js\";\nimport { createdCollectionAddress, createdCollectionFromReceipt, deployedCollectionFromReceipt } from \"@medialane/sdk/starknet\";\nimport Image from \"../image.js\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from \"../form.js\";\nimport { ClaimRouteShell } from \"../claim-route-shell.js\";\nimport { TransactionSuccess } from \"../transaction-success.js\";\nimport { ExternalLinkField } from \"../external-link-field.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { TransactionDialog } from \"../transaction-dialog.js\";\nimport { WalletRequired } from \"../wallet-required.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { RewardEarned } from \"../rewards/reward-earned.js\";\nimport { runIntentCalls } from \"../../utils/run-intent-calls.js\";\nimport { uploadJsonToIpfs } from \"../../utils/ipfs-upload.js\";\nimport { useTransaction } from \"../../utils/use-transaction.js\";\nimport { useLaunchpadImageUpload } from \"../../utils/use-launchpad-image-upload.js\";\nimport { invalidatePortfolioCache } from \"../../utils/portfolio-cache.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport type { CollectionCreatePreset } from \"./collection-create-presets.js\";\n\nconst schema = z.object({\n name: z.string().min(1, \"Name required\").max(FIELD_LIMITS.name),\n symbol: z\n .string()\n .min(1, \"Symbol required\")\n .max(FIELD_LIMITS.symbol, `Max ${FIELD_LIMITS.symbol} characters`)\n .regex(/^[A-Z0-9]+$/, \"Uppercase letters and numbers only\"),\n description: z.string().max(FIELD_LIMITS.description).optional(),\n external_link: z\n .string()\n .max(500)\n .refine((v) => !v || v.startsWith(\"http://\") || v.startsWith(\"https://\"), {\n message: \"Must start with http:// or https://\",\n })\n .optional(),\n});\ntype FormValues = z.infer<typeof schema>;\n\nexport interface CollectionCreateFormProps {\n preset: CollectionCreatePreset;\n aside?: ReactNode;\n}\n\nexport function CollectionCreateForm({ preset, aside }: CollectionCreateFormProps) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const tx = useTransaction();\n const upload = useLaunchpadImageUpload({ successMessage: \"Image uploaded\" });\n const { imageFile, imagePreview, imageUri, imageUploading, uploadError, fileInputRef, handleImageSelect, clearImage } = upload;\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [viewHref, setViewHref] = useState<string | null>(null);\n const Icon = preset.icon;\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { name: \"\", symbol: \"\", description: \"\", external_link: \"\" },\n });\n const name = form.watch(\"name\");\n\n useEffect(() => {\n if (!preset.suggestSymbol) return;\n const suggested = suggestLaunchpadSymbol(name);\n if (!suggested) return;\n const current = form.getValues(\"symbol\");\n if (!current || current === autoSymbol) {\n form.setValue(\"symbol\", suggested, { shouldDirty: false });\n setAutoSymbol(suggested);\n }\n }, [autoSymbol, name, form, preset.suggestSymbol]);\n\n const deployedAddress =\n tx.receipt && preset.service ? deployedCollectionFromReceipt(tx.receipt, preset.service) : null;\n const createdId =\n tx.receipt && !preset.service ? createdCollectionFromReceipt(tx.receipt, getCoordinates(\"STARKNET\").collection721)?.collectionId ?? null : null;\n\n useEffect(() => {\n if (tx.phase !== \"success\") return;\n let alive = true;\n const client = app.getClient();\n if (deployedAddress) {\n setViewHref(collectionHref(\"STARKNET\", deployedAddress));\n if (preset.registerAfterDeploy) void client.api.collections.register(deployedAddress).catch(() => {});\n } else if (createdId) {\n createdCollectionAddress(client.provider, getCoordinates(\"STARKNET\").collection721, createdId)\n .then((address) => {\n if (alive && address) setViewHref(collectionHref(\"STARKNET\", address));\n })\n .catch(() => {});\n }\n return () => {\n alive = false;\n };\n }, [tx.phase, deployedAddress, createdId, app, preset.registerAfterDeploy]);\n\n const handleAgain = () => {\n tx.reset();\n setViewHref(null);\n setAutoSymbol(\"\");\n form.reset();\n clearImage();\n };\n\n const onSubmit = (values: FormValues) => {\n if (imageFile && !imageUri && !imageUploading) return;\n if (!walletAddress) return;\n void tx.run(async (signer) => {\n await app.ensureSignedIn?.();\n const api = app.getClient().api;\n const baseUri = await uploadJsonToIpfs(\n api,\n buildCollectionMetadata({\n name: values.name,\n description: values.description,\n image: imageUri,\n externalLink: values.external_link,\n owner: walletAddress,\n }),\n );\n await runIntentCalls(signer, () =>\n api.intents.create(\"create-collection\", {\n owner: walletAddress,\n name: values.name,\n symbol: values.symbol,\n baseUri,\n ...(preset.service ? { service: preset.service } : {}),\n }),\n );\n invalidatePortfolioCache(walletAddress);\n });\n };\n\n const { copy } = preset;\n const busy = tx.phase !== \"idle\" || imageUploading;\n const actions = preset.actions({ address: deployedAddress, collectionHref: viewHref });\n\n return (\n <WalletRequired icon={Icon} iconClassName={preset.iconClass} title={preset.signedOut.title} description={preset.signedOut.description}>\n <TransactionDialog tx={tx} title={preset.dialog.title} workingLabel={preset.dialog.workingLabel} firstStepLabel={preset.dialog.firstStepLabel}>\n <TransactionSuccess\n name={name || preset.success.fallbackName}\n image={imagePreview}\n title={preset.success.title}\n description={preset.success.description}\n actions={[actions.primary, actions.secondary, { label: preset.success.againLabel, onClick: handleAgain }]}\n >\n <RewardEarned actionType={preset.success.reward} />\n </TransactionSuccess>\n </TransactionDialog>\n\n <ClaimRouteShell\n icon={<Icon className=\"h-4 w-4 text-white\" />}\n title={preset.shell.title}\n subtitle={preset.shell.subtitle}\n aside={\n <>\n <MedialaneCollectionCard\n image={imagePreview}\n name={name}\n collection={form.watch(\"symbol\") || preset.cardFallbackSymbol}\n creator={walletAddress ? `${walletAddress.slice(0, 6)}…${walletAddress.slice(-4)}` : undefined}\n creatorHref={walletAddress ? profileHref({ address: walletAddress }) : undefined}\n />\n {aside}\n </>\n }\n >\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-5\">\n <div className=\"space-y-2\">\n <p className=\"text-sm font-medium\">{copy.imageHeading}</p>\n <div className=\"flex items-start gap-4\">\n <div\n className=\"relative h-28 w-28 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 role=\"button\"\n tabIndex={0}\n aria-label={`Upload ${copy.imageHeading.toLowerCase()}`}\n onClick={() => !imageUploading && fileInputRef.current?.click()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (!imageUploading) fileInputRef.current?.click();\n }\n }}\n >\n {imagePreview ? (\n <Image src={imagePreview} alt={copy.imageHeading} fill unoptimized className=\"object-cover\" />\n ) : (\n <ImagePlus className=\"h-8 w-8 text-muted-foreground\" />\n )}\n {imageUploading && (\n <div className=\"absolute inset-0 bg-background/70 flex items-center justify-center\">\n <Loader2 className=\"h-5 w-5 animate-spin text-primary\" />\n </div>\n )}\n </div>\n <div className=\"space-y-2 flex-1\">\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={acceptFor(\"image\")}\n className=\"hidden\"\n onChange={(e) => {\n const f = e.target.files?.[0];\n if (f) void handleImageSelect(f);\n }}\n />\n <Button type=\"button\" variant=\"outline\" size=\"sm\" disabled={imageUploading} onClick={() => fileInputRef.current?.click()}>\n {imageUploading ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 mr-1.5 animate-spin\" />\n Uploading…\n </>\n ) : imageFile ? (\n \"Change image\"\n ) : (\n \"Upload image\"\n )}\n </Button>\n {imageFile && (\n <button\n type=\"button\"\n onClick={clearImage}\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors\"\n >\n <X className=\"h-3 w-3\" /> Remove\n </button>\n )}\n <p className=\"text-xs text-muted-foreground\">\n JPG, PNG, GIF, SVG or WebP\n {imageUri && <span className=\"ml-2 text-emerald-500 font-medium\">✓ Uploaded</span>}\n </p>\n {copy.imageHelp && <p className=\"text-xs text-muted-foreground\">{copy.imageHelp}</p>}\n {uploadError && <p className=\"text-xs text-destructive\">{uploadError}</p>}\n </div>\n </div>\n </div>\n\n <FormField control={form.control} name=\"name\" render={({ field }) => (\n <FormItem>\n <FormLabel>{copy.nameLabel}</FormLabel>\n <FormControl><Input placeholder={copy.namePlaceholder} {...field} /></FormControl>\n <FormDescription>{copy.nameHint}</FormDescription>\n <FormMessage />\n </FormItem>\n )} />\n\n <FormField control={form.control} name=\"symbol\" render={({ field }) => (\n <FormItem>\n <FormLabel>Symbol *</FormLabel>\n <FormControl>\n <Input\n placeholder={copy.symbolPlaceholder}\n maxLength={FIELD_LIMITS.symbol}\n {...field}\n onChange={(e) => field.onChange(e.target.value.toUpperCase())}\n />\n </FormControl>\n <FormDescription>{copy.symbolHint}</FormDescription>\n <FormMessage />\n </FormItem>\n )} />\n\n <FormField control={form.control} name=\"description\" render={({ field }) => (\n <FormItem>\n <FormLabel>Description <span className=\"text-muted-foreground font-normal\">(optional)</span></FormLabel>\n <FormControl><Textarea placeholder={copy.descriptionPlaceholder} rows={3} {...field} /></FormControl>\n {copy.descriptionHint && <FormDescription>{copy.descriptionHint}</FormDescription>}\n <FormMessage />\n </FormItem>\n )} />\n\n <ExternalLinkField form={form} address={walletAddress} />\n\n <button\n type=\"submit\"\n disabled={busy}\n 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\" : \"\"}`}\n >\n <Icon className=\"h-4 w-4\" />\n {copy.submit}\n </button>\n {copy.footnotes.map((note) => (\n <p key={note} className=\"text-xs text-center text-muted-foreground\">{note}</p>\n ))}\n </form>\n </Form>\n </ClaimRouteShell>\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6JU;AA3JV,mBAAoD;AACpD,6BAAwB;AACxB,iBAA4B;AAC5B,QAAmB;AACnB,0BAAsC;AACtC,iBAAqF;AACrF,2BAA0B;AAC1B,0BAA6B;AAC7B,sBAAsG;AACtG,mBAAkB;AAClB,oBAAuB;AACvB,mBAAsB;AACtB,sBAAyB;AACzB,kBAAgG;AAChG,+BAAgC;AAChC,iCAAmC;AACnC,iCAAkC;AAClC,uCAAwC;AACxC,gCAAkC;AA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AAA;AAAA,UACR;AAAA,UACC,KAAK,UAAU,IAAI,CAAC,SACnB,4CAAC,OAAa,WAAU,6CAA6C,kBAA7D,IAAkE,CAC3E;AAAA,WACH,GACF;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["Image"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/launchpad/collection-create-form.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { ImagePlus, Loader2, X } from \"lucide-react\";\nimport { buildCollectionMetadata, collectionHref, getCoordinates, profileHref } from \"@medialane/sdk\";\nimport { acceptFor } from \"../../utils/upload-limits.js\";\nimport { FIELD_LIMITS } from \"../../utils/field-limits.js\";\nimport { createdCollectionAddress, createdCollectionFromReceipt, deployedCollectionFromReceipt } from \"@medialane/sdk/starknet\";\nimport Image from \"../image.js\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from \"../form.js\";\nimport { ClaimRouteShell } from \"../claim-route-shell.js\";\nimport { TransactionSuccess } from \"../transaction-success.js\";\nimport { ExternalLinkField } from \"../external-link-field.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { TransactionDialog } from \"../transaction-dialog.js\";\nimport { WalletRequired } from \"../wallet-required.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { RewardEarned } from \"../rewards/reward-earned.js\";\nimport { runIntentCalls } from \"../../utils/run-intent-calls.js\";\nimport { serviceCollectionIntent } from \"../../utils/launchpad-actions.js\";\nimport { uploadJsonToIpfs } from \"../../utils/ipfs-upload.js\";\nimport { useTransaction } from \"../../utils/use-transaction.js\";\nimport { useLaunchpadImageUpload } from \"../../utils/use-launchpad-image-upload.js\";\nimport { invalidatePortfolioCache } from \"../../utils/portfolio-cache.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport type { CollectionCreatePreset } from \"./collection-create-presets.js\";\n\nconst schema = z.object({\n name: z.string().min(1, \"Name required\").max(FIELD_LIMITS.name),\n symbol: z\n .string()\n .min(1, \"Symbol required\")\n .max(FIELD_LIMITS.symbol, `Max ${FIELD_LIMITS.symbol} characters`)\n .regex(/^[A-Z0-9]+$/, \"Uppercase letters and numbers only\"),\n description: z.string().max(FIELD_LIMITS.description).optional(),\n external_link: z\n .string()\n .max(500)\n .refine((v) => !v || v.startsWith(\"http://\") || v.startsWith(\"https://\"), {\n message: \"Must start with http:// or https://\",\n })\n .optional(),\n});\ntype FormValues = z.infer<typeof schema>;\n\nexport interface CollectionCreateFormProps {\n preset: CollectionCreatePreset;\n aside?: ReactNode;\n}\n\nexport function CollectionCreateForm({ preset, aside }: CollectionCreateFormProps) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const tx = useTransaction();\n const upload = useLaunchpadImageUpload({ successMessage: \"Image uploaded\" });\n const { imageFile, imagePreview, imageUri, imageUploading, uploadError, fileInputRef, handleImageSelect, clearImage } = upload;\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [viewHref, setViewHref] = useState<string | null>(null);\n const Icon = preset.icon;\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { name: \"\", symbol: \"\", description: \"\", external_link: \"\" },\n });\n const name = form.watch(\"name\");\n\n useEffect(() => {\n if (!preset.suggestSymbol) return;\n const suggested = suggestLaunchpadSymbol(name);\n if (!suggested) return;\n const current = form.getValues(\"symbol\");\n if (!current || current === autoSymbol) {\n form.setValue(\"symbol\", suggested, { shouldDirty: false });\n setAutoSymbol(suggested);\n }\n }, [autoSymbol, name, form, preset.suggestSymbol]);\n\n const deployedAddress =\n tx.receipt && preset.service ? deployedCollectionFromReceipt(tx.receipt, preset.service) : null;\n const createdId =\n tx.receipt && !preset.service ? createdCollectionFromReceipt(tx.receipt, getCoordinates(\"STARKNET\").collection721)?.collectionId ?? null : null;\n\n useEffect(() => {\n if (tx.phase !== \"success\") return;\n let alive = true;\n const client = app.getClient();\n if (deployedAddress) {\n setViewHref(collectionHref(\"STARKNET\", deployedAddress));\n if (preset.registerAfterDeploy) void client.api.collections.register(deployedAddress).catch(() => {});\n } else if (createdId) {\n createdCollectionAddress(client.provider, getCoordinates(\"STARKNET\").collection721, createdId)\n .then((address) => {\n if (alive && address) setViewHref(collectionHref(\"STARKNET\", address));\n })\n .catch(() => {});\n }\n return () => {\n alive = false;\n };\n }, [tx.phase, deployedAddress, createdId, app, preset.registerAfterDeploy]);\n\n const handleAgain = () => {\n tx.reset();\n setViewHref(null);\n setAutoSymbol(\"\");\n form.reset();\n clearImage();\n };\n\n const onSubmit = (values: FormValues) => {\n if (imageFile && !imageUri && !imageUploading) return;\n if (!walletAddress) return;\n void tx.run(async (signer) => {\n await app.ensureSignedIn?.();\n const api = app.getClient().api;\n const baseUri = await uploadJsonToIpfs(\n api,\n buildCollectionMetadata({\n name: values.name,\n description: values.description,\n image: imageUri,\n externalLink: values.external_link,\n owner: walletAddress,\n }),\n );\n await runIntentCalls(signer, () =>\n serviceCollectionIntent(api, {\n owner: walletAddress,\n name: values.name,\n symbol: values.symbol,\n baseUri,\n service: preset.service ?? undefined,\n }),\n );\n invalidatePortfolioCache(walletAddress);\n });\n };\n\n const { copy } = preset;\n const busy = tx.phase !== \"idle\" || imageUploading;\n const actions = preset.actions({ address: deployedAddress, collectionHref: viewHref });\n\n return (\n <WalletRequired icon={Icon} iconClassName={preset.iconClass} title={preset.signedOut.title} description={preset.signedOut.description}>\n <TransactionDialog tx={tx} title={preset.dialog.title} workingLabel={preset.dialog.workingLabel} firstStepLabel={preset.dialog.firstStepLabel}>\n <TransactionSuccess\n name={name || preset.success.fallbackName}\n image={imagePreview}\n title={preset.success.title}\n description={preset.success.description}\n actions={[actions.primary, actions.secondary, { label: preset.success.againLabel, onClick: handleAgain }]}\n >\n <RewardEarned actionType={preset.success.reward} />\n </TransactionSuccess>\n </TransactionDialog>\n\n <ClaimRouteShell\n icon={<Icon className=\"h-4 w-4 text-white\" />}\n title={preset.shell.title}\n subtitle={preset.shell.subtitle}\n aside={\n <>\n <MedialaneCollectionCard\n image={imagePreview}\n name={name}\n collection={form.watch(\"symbol\") || preset.cardFallbackSymbol}\n creator={walletAddress ? `${walletAddress.slice(0, 6)}…${walletAddress.slice(-4)}` : undefined}\n creatorHref={walletAddress ? profileHref({ address: walletAddress }) : undefined}\n />\n {aside}\n </>\n }\n >\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-5\">\n <div className=\"space-y-2\">\n <p className=\"text-sm font-medium\">{copy.imageHeading}</p>\n <div className=\"flex items-start gap-4\">\n <div\n className=\"relative h-28 w-28 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 role=\"button\"\n tabIndex={0}\n aria-label={`Upload ${copy.imageHeading.toLowerCase()}`}\n onClick={() => !imageUploading && fileInputRef.current?.click()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (!imageUploading) fileInputRef.current?.click();\n }\n }}\n >\n {imagePreview ? (\n <Image src={imagePreview} alt={copy.imageHeading} fill unoptimized className=\"object-cover\" />\n ) : (\n <ImagePlus className=\"h-8 w-8 text-muted-foreground\" />\n )}\n {imageUploading && (\n <div className=\"absolute inset-0 bg-background/70 flex items-center justify-center\">\n <Loader2 className=\"h-5 w-5 animate-spin text-primary\" />\n </div>\n )}\n </div>\n <div className=\"space-y-2 flex-1\">\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={acceptFor(\"image\")}\n className=\"hidden\"\n onChange={(e) => {\n const f = e.target.files?.[0];\n if (f) void handleImageSelect(f);\n }}\n />\n <Button type=\"button\" variant=\"outline\" size=\"sm\" disabled={imageUploading} onClick={() => fileInputRef.current?.click()}>\n {imageUploading ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 mr-1.5 animate-spin\" />\n Uploading…\n </>\n ) : imageFile ? (\n \"Change image\"\n ) : (\n \"Upload image\"\n )}\n </Button>\n {imageFile && (\n <button\n type=\"button\"\n onClick={clearImage}\n className=\"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors\"\n >\n <X className=\"h-3 w-3\" /> Remove\n </button>\n )}\n <p className=\"text-xs text-muted-foreground\">\n JPG, PNG, GIF, SVG or WebP\n {imageUri && <span className=\"ml-2 text-emerald-500 font-medium\">✓ Uploaded</span>}\n </p>\n {copy.imageHelp && <p className=\"text-xs text-muted-foreground\">{copy.imageHelp}</p>}\n {uploadError && <p className=\"text-xs text-destructive\">{uploadError}</p>}\n </div>\n </div>\n </div>\n\n <FormField control={form.control} name=\"name\" render={({ field }) => (\n <FormItem>\n <FormLabel>{copy.nameLabel}</FormLabel>\n <FormControl><Input placeholder={copy.namePlaceholder} {...field} /></FormControl>\n <FormDescription>{copy.nameHint}</FormDescription>\n <FormMessage />\n </FormItem>\n )} />\n\n <FormField control={form.control} name=\"symbol\" render={({ field }) => (\n <FormItem>\n <FormLabel>Symbol *</FormLabel>\n <FormControl>\n <Input\n placeholder={copy.symbolPlaceholder}\n maxLength={FIELD_LIMITS.symbol}\n {...field}\n onChange={(e) => field.onChange(e.target.value.toUpperCase())}\n />\n </FormControl>\n <FormDescription>{copy.symbolHint}</FormDescription>\n <FormMessage />\n </FormItem>\n )} />\n\n <FormField control={form.control} name=\"description\" render={({ field }) => (\n <FormItem>\n <FormLabel>Description <span className=\"text-muted-foreground font-normal\">(optional)</span></FormLabel>\n <FormControl><Textarea placeholder={copy.descriptionPlaceholder} rows={3} {...field} /></FormControl>\n {copy.descriptionHint && <FormDescription>{copy.descriptionHint}</FormDescription>}\n <FormMessage />\n </FormItem>\n )} />\n\n <ExternalLinkField form={form} address={walletAddress} />\n\n <button\n type=\"submit\"\n disabled={busy}\n 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\" : \"\"}`}\n >\n <Icon className=\"h-4 w-4\" />\n {copy.submit}\n </button>\n {copy.footnotes.map((note) => (\n <p key={note} className=\"text-xs text-center text-muted-foreground\">{note}</p>\n ))}\n </form>\n </Form>\n </ClaimRouteShell>\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8JU;AA5JV,mBAAoD;AACpD,6BAAwB;AACxB,iBAA4B;AAC5B,QAAmB;AACnB,0BAAsC;AACtC,iBAAqF;AACrF,2BAA0B;AAC1B,0BAA6B;AAC7B,sBAAsG;AACtG,mBAAkB;AAClB,oBAAuB;AACvB,mBAAsB;AACtB,sBAAyB;AACzB,kBAAgG;AAChG,+BAAgC;AAChC,iCAAmC;AACnC,iCAAkC;AAClC,uCAAwC;AACxC,gCAAkC;AAClC,6BAA+B;AAC/B,2BAAgC;AAChC,2BAA6B;AAC7B,8BAA+B;AAC/B,+BAAwC;AACxC,yBAAiC;AACjC,6BAA+B;AAC/B,wCAAwC;AACxC,6BAAyC;AACzC,gCAAuC;AAGvC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,eAAe,EAAE,IAAI,iCAAa,IAAI;AAAA,EAC9D,QAAQ,EACL,OAAO,EACP,IAAI,GAAG,iBAAiB,EACxB,IAAI,iCAAa,QAAQ,OAAO,iCAAa,MAAM,aAAa,EAChE,MAAM,eAAe,oCAAoC;AAAA,EAC5D,aAAa,EAAE,OAAO,EAAE,IAAI,iCAAa,WAAW,EAAE,SAAS;AAAA,EAC/D,eAAe,EACZ,OAAO,EACP,IAAI,GAAG,EACP,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,SAAS,KAAK,EAAE,WAAW,UAAU,GAAG;A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,yBAAU,SAAS,KAAK,SAAS,MAAK,eAAc,QAAQ,CAAC,EAAE,MAAM,MACpE,6CAAC,wBACC;AAAA,yDAAC,yBAAU;AAAA;AAAA,cAAY,4CAAC,UAAK,WAAU,qCAAoC,wBAAU;AAAA,eAAO;AAAA,YAC5F,4CAAC,2BAAY,sDAAC,4BAAS,aAAa,KAAK,wBAAwB,MAAM,GAAI,GAAG,OAAO,GAAE;AAAA,YACtF,KAAK,mBAAmB,4CAAC,+BAAiB,eAAK,iBAAgB;AAAA,YAChE,4CAAC,2BAAY;AAAA,aACf,GACC;AAAA,UAEH,4CAAC,gDAAkB,MAAY,SAAS,eAAe;AAAA,UAEvD;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,WAAW,4JAA4J,OAAO,WAAW,IAAI,OAAO,mCAAmC,EAAE;AAAA,cAEzO;AAAA,4DAAC,QAAK,WAAU,WAAU;AAAA,gBACzB,KAAK;AAAA;AAAA;AAAA,UACR;AAAA,UACC,KAAK,UAAU,IAAI,CAAC,SACnB,4CAAC,OAAa,WAAU,6CAA6C,kBAA7D,IAAkE,CAC3E;AAAA,WACH,GACF;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["Image"]}
|
|
@@ -23,6 +23,7 @@ import { WalletRequired } from "../wallet-required.js";
|
|
|
23
23
|
import { useMedialaneApp } from "../medialane-app.js";
|
|
24
24
|
import { RewardEarned } from "../rewards/reward-earned.js";
|
|
25
25
|
import { runIntentCalls } from "../../utils/run-intent-calls.js";
|
|
26
|
+
import { serviceCollectionIntent } from "../../utils/launchpad-actions.js";
|
|
26
27
|
import { uploadJsonToIpfs } from "../../utils/ipfs-upload.js";
|
|
27
28
|
import { useTransaction } from "../../utils/use-transaction.js";
|
|
28
29
|
import { useLaunchpadImageUpload } from "../../utils/use-launchpad-image-upload.js";
|
|
@@ -105,12 +106,12 @@ function CollectionCreateForm({ preset, aside }) {
|
|
|
105
106
|
);
|
|
106
107
|
await runIntentCalls(
|
|
107
108
|
signer,
|
|
108
|
-
() => api
|
|
109
|
+
() => serviceCollectionIntent(api, {
|
|
109
110
|
owner: walletAddress,
|
|
110
111
|
name: values.name,
|
|
111
112
|
symbol: values.symbol,
|
|
112
113
|
baseUri,
|
|
113
|
-
|
|
114
|
+
service: preset.service ?? void 0
|
|
114
115
|
})
|
|
115
116
|
);
|
|
116
117
|
invalidatePortfolioCache(walletAddress);
|