@medialane/ui 0.366.0 → 0.368.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/alert.d.cts +1 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/approve-mint-dialog.d.cts +0 -1
- package/dist/components/approve-mint-dialog.d.ts +0 -1
- package/dist/components/asset-card.cjs +3 -3
- package/dist/components/asset-card.cjs.map +1 -1
- package/dist/components/asset-card.js +3 -3
- package/dist/components/asset-card.js.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/collection-card.cjs +3 -3
- package/dist/components/collection-card.cjs.map +1 -1
- package/dist/components/collection-card.js +3 -3
- package/dist/components/collection-card.js.map +1 -1
- package/dist/components/collection-page.cjs +1 -1
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.js +1 -1
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/fast-mint/asset-form-parts.cjs +25 -51
- package/dist/components/fast-mint/asset-form-parts.cjs.map +1 -1
- package/dist/components/fast-mint/asset-form-parts.d.cts +11 -14
- package/dist/components/fast-mint/asset-form-parts.d.ts +11 -14
- package/dist/components/fast-mint/asset-form-parts.js +27 -52
- 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 +96 -167
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +98 -169
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/formats/nft.cjs +236 -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 +217 -0
- package/dist/components/fast-mint/formats/nft.js.map +1 -0
- package/dist/components/fast-mint/formats/pop.cjs +161 -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 +137 -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 -3
- package/dist/components/fast-mint/types.d.ts +0 -3
- package/dist/components/launchpad/collection-create-form.cjs +9 -18
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +9 -18
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.cjs +3 -4
- package/dist/components/launchpad/edition-mint-schema.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.ts +1 -1
- package/dist/components/launchpad/edition-mint-schema.js +3 -4
- package/dist/components/launchpad/edition-mint-schema.js.map +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs +8 -6
- 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 +7 -6
- package/dist/components/launchpad/pop-create-fields.js.map +1 -1
- package/dist/components/launchpad/pop-create-schema.cjs +3 -4
- package/dist/components/launchpad/pop-create-schema.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-schema.js +3 -4
- package/dist/components/launchpad/pop-create-schema.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs +12 -25
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js +12 -25
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs +2 -1
- package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/single-edition-mint.js +2 -1
- package/dist/components/launchpad/single-edition-mint.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +11 -27
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +9 -25
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad-page.cjs +1 -2
- package/dist/components/launchpad-page.cjs.map +1 -1
- package/dist/components/launchpad-page.js +1 -2
- package/dist/components/launchpad-page.js.map +1 -1
- package/dist/components/page-skeletons.cjs +79 -47
- package/dist/components/page-skeletons.cjs.map +1 -1
- package/dist/components/page-skeletons.d.cts +3 -1
- package/dist/components/page-skeletons.d.ts +3 -1
- package/dist/components/page-skeletons.js +77 -47
- package/dist/components/page-skeletons.js.map +1 -1
- package/dist/components/pop-burn-button.cjs +1 -1
- package/dist/components/pop-burn-button.cjs.map +1 -1
- package/dist/components/pop-burn-button.js +1 -1
- package/dist/components/pop-burn-button.js.map +1 -1
- package/dist/components/pop-claim-button.cjs +3 -3
- package/dist/components/pop-claim-button.cjs.map +1 -1
- package/dist/components/pop-claim-button.js +3 -3
- package/dist/components/pop-claim-button.js.map +1 -1
- package/dist/components/pop-manage-page.cjs +3 -3
- package/dist/components/pop-manage-page.cjs.map +1 -1
- package/dist/components/pop-manage-page.js +3 -3
- package/dist/components/pop-manage-page.js.map +1 -1
- package/dist/components/service-collections-page.cjs +3 -2
- package/dist/components/service-collections-page.cjs.map +1 -1
- package/dist/components/service-collections-page.d.cts +2 -2
- package/dist/components/service-collections-page.d.ts +2 -2
- package/dist/components/service-collections-page.js +3 -2
- package/dist/components/service-collections-page.js.map +1 -1
- package/dist/components/token-card.cjs +7 -4
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +7 -4
- package/dist/components/token-card.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 +48 -27
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.d.cts +11 -1
- package/dist/data/launchpad-services.d.ts +11 -1
- package/dist/data/launchpad-services.js +44 -26
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/drop/actions.d.cts +0 -1
- package/dist/utils/drop/actions.d.ts +0 -1
- package/dist/utils/drop/draft.cjs +3 -2
- package/dist/utils/drop/draft.cjs.map +1 -1
- package/dist/utils/drop/draft.js +3 -2
- package/dist/utils/drop/draft.js.map +1 -1
- package/dist/utils/drop/sale.cjs +2 -1
- package/dist/utils/drop/sale.cjs.map +1 -1
- package/dist/utils/drop/sale.js +2 -1
- package/dist/utils/drop/sale.js.map +1 -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/launchpad-rules.cjs +77 -0
- package/dist/utils/launchpad-rules.cjs.map +1 -0
- package/dist/utils/launchpad-rules.d.cts +13 -0
- package/dist/utils/launchpad-rules.d.ts +13 -0
- package/dist/utils/launchpad-rules.js +35 -0
- package/dist/utils/launchpad-rules.js.map +1 -0
- package/dist/utils/success-messages.cjs +5 -5
- package/dist/utils/success-messages.cjs.map +1 -1
- package/dist/utils/success-messages.d.cts +1 -1
- package/dist/utils/success-messages.d.ts +1 -1
- package/dist/utils/success-messages.js +5 -5
- package/dist/utils/success-messages.js.map +1 -1
- 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
- package/dist/utils/launchpad-handoff.cjs +0 -62
- package/dist/utils/launchpad-handoff.cjs.map +0 -1
- package/dist/utils/launchpad-handoff.d.cts +0 -11
- package/dist/utils/launchpad-handoff.d.ts +0 -11
- package/dist/utils/launchpad-handoff.js +0 -35
- package/dist/utils/launchpad-handoff.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';
|
|
@@ -24,7 +23,6 @@ interface FastMintProps {
|
|
|
24
23
|
onClose?: () => void;
|
|
25
24
|
mediaKindLock?: MediaKind;
|
|
26
25
|
onMinted?: (asset: MintedAsset) => void;
|
|
27
|
-
onNavigate?: (href: string) => void;
|
|
28
26
|
collections: ApiCollection[];
|
|
29
27
|
refetchCollections: () => Promise<ApiCollection[]>;
|
|
30
28
|
hasWallet: boolean;
|
|
@@ -34,7 +32,6 @@ interface FastMintProps {
|
|
|
34
32
|
getUploadToken: () => Promise<string | null>;
|
|
35
33
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
36
34
|
client: MedialaneClient;
|
|
37
|
-
successFooter?: ReactNode;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
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';
|
|
@@ -24,7 +23,6 @@ interface FastMintProps {
|
|
|
24
23
|
onClose?: () => void;
|
|
25
24
|
mediaKindLock?: MediaKind;
|
|
26
25
|
onMinted?: (asset: MintedAsset) => void;
|
|
27
|
-
onNavigate?: (href: string) => void;
|
|
28
26
|
collections: ApiCollection[];
|
|
29
27
|
refetchCollections: () => Promise<ApiCollection[]>;
|
|
30
28
|
hasWallet: boolean;
|
|
@@ -34,7 +32,6 @@ interface FastMintProps {
|
|
|
34
32
|
getUploadToken: () => Promise<string | null>;
|
|
35
33
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
36
34
|
client: MedialaneClient;
|
|
37
|
-
successFooter?: ReactNode;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
export type { FastMintProps, FastMintSigner, MediaKind, MintedAsset };
|
|
@@ -56,27 +56,25 @@ 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");
|
|
62
|
-
var import_launchpad_handoff = require("../../utils/launchpad-handoff.js");
|
|
63
|
-
var import_ipfs = require("../../utils/ipfs.js");
|
|
64
63
|
var import_portfolio_cache = require("../../utils/portfolio-cache.js");
|
|
65
64
|
var import_launchpad_defaults = require("../../utils/launchpad-defaults.js");
|
|
65
|
+
var import_launchpad_rules = require("../../utils/launchpad-rules.js");
|
|
66
66
|
const schema = z.object({
|
|
67
67
|
name: z.string().min(1, "Name required").max(import_field_limits.FIELD_LIMITS.name),
|
|
68
|
-
symbol:
|
|
68
|
+
symbol: (0, import_launchpad_rules.symbolField)(),
|
|
69
69
|
description: z.string().max(import_field_limits.FIELD_LIMITS.description).optional(),
|
|
70
|
-
external_link:
|
|
71
|
-
message: "Must start with http:// or https://"
|
|
72
|
-
}).optional()
|
|
70
|
+
external_link: (0, import_launchpad_rules.webLinkField)()
|
|
73
71
|
});
|
|
74
72
|
function CollectionCreateForm({ preset, aside }) {
|
|
75
73
|
const app = (0, import_medialane_app.useMedialaneApp)();
|
|
76
74
|
const walletAddress = app.walletAddress;
|
|
77
75
|
const tx = (0, import_use_transaction.useTransaction)();
|
|
78
76
|
const upload = (0, import_use_launchpad_image_upload.useLaunchpadImageUpload)({ successMessage: "Image uploaded" });
|
|
79
|
-
const { imageFile, imagePreview, imageUri, imageUploading, uploadError, fileInputRef, handleImageSelect, clearImage
|
|
77
|
+
const { imageFile, imagePreview, imageUri, imageUploading, uploadError, fileInputRef, handleImageSelect, clearImage } = upload;
|
|
80
78
|
const [autoSymbol, setAutoSymbol] = (0, import_react.useState)("");
|
|
81
79
|
const [viewHref, setViewHref] = (0, import_react.useState)(null);
|
|
82
80
|
const Icon = preset.icon;
|
|
@@ -85,13 +83,6 @@ function CollectionCreateForm({ preset, aside }) {
|
|
|
85
83
|
defaultValues: { name: "", symbol: "", description: "", external_link: "" }
|
|
86
84
|
});
|
|
87
85
|
const name = form.watch("name");
|
|
88
|
-
(0, import_launchpad_handoff.useAppliedHandoff)(({ name: carriedName, imageUri: carried }) => {
|
|
89
|
-
if (carriedName) form.setValue("name", carriedName);
|
|
90
|
-
if (carried) {
|
|
91
|
-
setImageUri(carried);
|
|
92
|
-
setImagePreview((0, import_ipfs.ipfsToHttp)(carried));
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
86
|
(0, import_react.useEffect)(() => {
|
|
96
87
|
if (!preset.suggestSymbol) return;
|
|
97
88
|
const suggested = (0, import_launchpad_defaults.suggestLaunchpadSymbol)(name);
|
|
@@ -147,12 +138,12 @@ function CollectionCreateForm({ preset, aside }) {
|
|
|
147
138
|
);
|
|
148
139
|
await (0, import_run_intent_calls.runIntentCalls)(
|
|
149
140
|
signer,
|
|
150
|
-
() =>
|
|
141
|
+
() => (0, import_launchpad_actions.serviceCollectionIntent)(api, {
|
|
151
142
|
owner: walletAddress,
|
|
152
143
|
name: values.name,
|
|
153
144
|
symbol: values.symbol,
|
|
154
145
|
baseUri,
|
|
155
|
-
|
|
146
|
+
service: preset.service ?? void 0
|
|
156
147
|
})
|
|
157
148
|
);
|
|
158
149
|
(0, import_portfolio_cache.invalidatePortfolioCache)(walletAddress);
|
|
@@ -233,8 +224,8 @@ function CollectionCreateForm({ preset, aside }) {
|
|
|
233
224
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { type: "button", variant: "outline", size: "sm", disabled: imageUploading, onClick: () => fileInputRef.current?.click(), children: imageUploading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
234
225
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3.5 w-3.5 mr-1.5 animate-spin" }),
|
|
235
226
|
"Uploading\u2026"
|
|
236
|
-
] }) : imageFile
|
|
237
|
-
|
|
227
|
+
] }) : imageFile ? "Change image" : "Upload image" }),
|
|
228
|
+
imageFile && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
238
229
|
"button",
|
|
239
230
|
{
|
|
240
231
|
type: "button",
|