@medialane/ui 0.294.0 → 0.296.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/create-sponsorship-aside.cjs +52 -0
- package/dist/components/create-sponsorship-aside.cjs.map +1 -0
- package/dist/components/create-sponsorship-aside.d.cts +5 -0
- package/dist/components/create-sponsorship-aside.d.ts +5 -0
- package/dist/components/create-sponsorship-aside.js +28 -0
- package/dist/components/create-sponsorship-aside.js.map +1 -0
- package/dist/components/fast-mint/asset-form-parts.cjs +194 -0
- package/dist/components/fast-mint/asset-form-parts.cjs.map +1 -0
- package/dist/components/fast-mint/asset-form-parts.d.cts +33 -0
- package/dist/components/fast-mint/asset-form-parts.d.ts +33 -0
- package/dist/components/fast-mint/asset-form-parts.js +158 -0
- package/dist/components/fast-mint/asset-form-parts.js.map +1 -0
- package/dist/components/fast-mint/collection-section.cjs +211 -0
- package/dist/components/fast-mint/collection-section.cjs.map +1 -0
- package/dist/components/fast-mint/collection-section.d.cts +27 -0
- package/dist/components/fast-mint/collection-section.d.ts +27 -0
- package/dist/components/fast-mint/collection-section.js +176 -0
- package/dist/components/fast-mint/collection-section.js.map +1 -0
- package/dist/components/fast-mint/fast-mint.cjs +116 -653
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +115 -661
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/form.cjs +40 -0
- package/dist/components/fast-mint/form.cjs.map +1 -0
- package/dist/components/fast-mint/form.d.cts +15 -0
- package/dist/components/fast-mint/form.d.ts +15 -0
- package/dist/components/fast-mint/form.js +16 -0
- package/dist/components/fast-mint/form.js.map +1 -0
- package/dist/components/fast-mint/ip-type-section.cjs +76 -0
- package/dist/components/fast-mint/ip-type-section.cjs.map +1 -0
- package/dist/components/fast-mint/ip-type-section.d.cts +17 -0
- package/dist/components/fast-mint/ip-type-section.d.ts +17 -0
- package/dist/components/fast-mint/ip-type-section.js +52 -0
- package/dist/components/fast-mint/ip-type-section.js.map +1 -0
- package/dist/components/fast-mint/licensing-section.cjs +124 -0
- package/dist/components/fast-mint/licensing-section.cjs.map +1 -0
- package/dist/components/fast-mint/licensing-section.d.cts +14 -0
- package/dist/components/fast-mint/licensing-section.d.ts +14 -0
- package/dist/components/fast-mint/licensing-section.js +99 -0
- package/dist/components/fast-mint/licensing-section.js.map +1 -0
- package/dist/components/fast-mint/media-kind.cjs +48 -0
- package/dist/components/fast-mint/media-kind.cjs.map +1 -0
- package/dist/components/fast-mint/media-kind.d.cts +12 -0
- package/dist/components/fast-mint/media-kind.d.ts +12 -0
- package/dist/components/fast-mint/media-kind.js +22 -0
- package/dist/components/fast-mint/media-kind.js.map +1 -0
- package/dist/components/fast-mint/mint-asset.cjs +124 -0
- package/dist/components/fast-mint/mint-asset.cjs.map +1 -0
- package/dist/components/fast-mint/mint-asset.d.cts +41 -0
- package/dist/components/fast-mint/mint-asset.d.ts +41 -0
- package/dist/components/fast-mint/mint-asset.js +100 -0
- package/dist/components/fast-mint/mint-asset.js.map +1 -0
- package/dist/components/fast-mint/use-ipfs-upload.cjs +64 -0
- package/dist/components/fast-mint/use-ipfs-upload.cjs.map +1 -0
- package/dist/components/fast-mint/use-ipfs-upload.d.cts +9 -0
- package/dist/components/fast-mint/use-ipfs-upload.d.ts +9 -0
- package/dist/components/fast-mint/use-ipfs-upload.js +40 -0
- package/dist/components/fast-mint/use-ipfs-upload.js.map +1 -0
- package/dist/components/fast-mint/use-new-collection-draft.cjs +66 -0
- package/dist/components/fast-mint/use-new-collection-draft.cjs.map +1 -0
- package/dist/components/fast-mint/use-new-collection-draft.d.cts +13 -0
- package/dist/components/fast-mint/use-new-collection-draft.d.ts +13 -0
- package/dist/components/fast-mint/use-new-collection-draft.js +42 -0
- package/dist/components/fast-mint/use-new-collection-draft.js.map +1 -0
- package/dist/components/journey-content.cjs +156 -0
- package/dist/components/journey-content.cjs.map +1 -0
- package/dist/components/journey-content.d.cts +7 -0
- package/dist/components/journey-content.d.ts +7 -0
- package/dist/components/journey-content.js +122 -0
- package/dist/components/journey-content.js.map +1 -0
- package/dist/components/page-skeletons.cjs +152 -0
- package/dist/components/page-skeletons.cjs.map +1 -0
- package/dist/components/page-skeletons.d.cts +10 -0
- package/dist/components/page-skeletons.d.ts +10 -0
- package/dist/components/page-skeletons.js +123 -0
- package/dist/components/page-skeletons.js.map +1 -0
- package/dist/components/rewards-page.cjs +41 -0
- package/dist/components/rewards-page.cjs.map +1 -0
- package/dist/components/rewards-page.d.cts +5 -0
- package/dist/components/rewards-page.d.ts +5 -0
- package/dist/components/rewards-page.js +17 -0
- package/dist/components/rewards-page.js.map +1 -0
- package/dist/components/route-error.cjs +65 -0
- package/dist/components/route-error.cjs.map +1 -0
- package/dist/components/route-error.d.cts +10 -0
- package/dist/components/route-error.d.ts +10 -0
- package/dist/components/route-error.js +41 -0
- package/dist/components/route-error.js.map +1 -0
- package/dist/components/settings-snapshots.cjs +124 -0
- package/dist/components/settings-snapshots.cjs.map +1 -0
- package/dist/components/settings-snapshots.d.cts +12 -0
- package/dist/components/settings-snapshots.d.ts +12 -0
- package/dist/components/settings-snapshots.js +89 -0
- package/dist/components/settings-snapshots.js.map +1 -0
- package/dist/index.cjs +30 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
2
|
+
import { MedialaneClient } from '@medialane/sdk/starknet';
|
|
3
|
+
import { IPType } from '../../data/ip.js';
|
|
4
|
+
import { MetadataField } from '../ip-type-fields.js';
|
|
5
|
+
import { FormValues } from './form.js';
|
|
6
|
+
import { FastMintSigner, MediaKind, MintedAsset } from './types.js';
|
|
7
|
+
import { MintAssetType } from './mintable-collections.js';
|
|
8
|
+
import 'react/jsx-runtime';
|
|
9
|
+
import 'react';
|
|
10
|
+
import 'starknet';
|
|
11
|
+
|
|
12
|
+
type MintDestination = {
|
|
13
|
+
mode: "existing";
|
|
14
|
+
collectionId: string;
|
|
15
|
+
collectionContract: string;
|
|
16
|
+
} | {
|
|
17
|
+
mode: "new";
|
|
18
|
+
name: string;
|
|
19
|
+
symbol: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
interface MintAssetInput {
|
|
23
|
+
client: MedialaneClient;
|
|
24
|
+
signer: FastMintSigner;
|
|
25
|
+
walletAddress: string;
|
|
26
|
+
values: FormValues;
|
|
27
|
+
ipType: IPType;
|
|
28
|
+
templateFields: MetadataField[];
|
|
29
|
+
mediaKind: MediaKind;
|
|
30
|
+
mediaUri: string;
|
|
31
|
+
featureUri: string | null;
|
|
32
|
+
assetType: MintAssetType;
|
|
33
|
+
editionCount: string;
|
|
34
|
+
destination: MintDestination;
|
|
35
|
+
singleCollections: ApiCollection[];
|
|
36
|
+
refetchCollections: () => Promise<ApiCollection[]>;
|
|
37
|
+
getUploadToken: () => Promise<string | null>;
|
|
38
|
+
}
|
|
39
|
+
declare function mintAsset(input: MintAssetInput): Promise<MintedAsset | null>;
|
|
40
|
+
|
|
41
|
+
export { type MintAssetInput, type MintDestination, mintAsset };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { buildAssetMetadata } from "@medialane/sdk";
|
|
2
|
+
import { executeIntent, deployedCollectionFromReceipt, mintedTokenIdFromReceipt } from "@medialane/sdk/starknet";
|
|
3
|
+
import { uploadJsonToIpfs } from "../../utils/ipfs-upload.js";
|
|
4
|
+
async function pollForNewCollection(refetchCollections, name, symbol) {
|
|
5
|
+
for (let attempt = 0; attempt < 8; attempt++) {
|
|
6
|
+
const list = await refetchCollections();
|
|
7
|
+
const match = list.find((c) => c.name === name && c.symbol === symbol);
|
|
8
|
+
if (match?.collectionId) return match;
|
|
9
|
+
await new Promise((r) => setTimeout(r, 1500));
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
async function mintAsset(input) {
|
|
14
|
+
const { client, signer, walletAddress, values, destination } = input;
|
|
15
|
+
const image = input.mediaKind === "image" ? input.mediaUri : input.featureUri;
|
|
16
|
+
const built = buildAssetMetadata({
|
|
17
|
+
name: values.name,
|
|
18
|
+
description: values.description || "",
|
|
19
|
+
externalUrl: values.external_url || "",
|
|
20
|
+
imageUri: image,
|
|
21
|
+
creator: walletAddress,
|
|
22
|
+
ipType: input.ipType,
|
|
23
|
+
licenseType: values.licenseType,
|
|
24
|
+
commercialUse: values.commercialUse,
|
|
25
|
+
derivatives: values.derivatives,
|
|
26
|
+
attribution: values.attribution,
|
|
27
|
+
geographicScope: values.geographicScope,
|
|
28
|
+
aiPolicy: values.aiPolicy,
|
|
29
|
+
royalty: String(values.royalty),
|
|
30
|
+
templateTraits: input.templateFields.filter(({ traitType, value }) => traitType.trim() && value.trim()).map(({ traitType, value }) => ({ traitType, value }))
|
|
31
|
+
});
|
|
32
|
+
const metadata = { ...built };
|
|
33
|
+
if (input.mediaKind !== "image") metadata.animation_url = input.mediaUri;
|
|
34
|
+
const uploadToken = await input.getUploadToken();
|
|
35
|
+
if (!uploadToken) throw new Error("Sign in first");
|
|
36
|
+
const tokenUri = await uploadJsonToIpfs(client.api, metadata);
|
|
37
|
+
const royaltyBps = Math.round(values.royalty * 100);
|
|
38
|
+
let contractAddress;
|
|
39
|
+
let tokenId;
|
|
40
|
+
if (input.assetType === "single") {
|
|
41
|
+
let collectionId = destination.mode === "existing" ? destination.collectionId : "";
|
|
42
|
+
contractAddress = destination.mode === "existing" ? input.singleCollections.find((c) => c.collectionId === destination.collectionId)?.contractAddress ?? null : null;
|
|
43
|
+
if (destination.mode === "new") {
|
|
44
|
+
const created = await client.api.intents.create("create-collection", {
|
|
45
|
+
owner: walletAddress,
|
|
46
|
+
name: destination.name,
|
|
47
|
+
symbol: destination.symbol,
|
|
48
|
+
description: destination.description || void 0,
|
|
49
|
+
image
|
|
50
|
+
});
|
|
51
|
+
await executeIntent(signer, client, created);
|
|
52
|
+
const found = await pollForNewCollection(input.refetchCollections, destination.name, destination.symbol);
|
|
53
|
+
if (!found) throw new Error("Collection created, but it's still indexing \u2014 try minting again in a moment from My Collections.");
|
|
54
|
+
collectionId = found.collectionId;
|
|
55
|
+
contractAddress = found.contractAddress ?? null;
|
|
56
|
+
}
|
|
57
|
+
const minted = await client.api.intents.create("mint", {
|
|
58
|
+
owner: walletAddress,
|
|
59
|
+
collectionId,
|
|
60
|
+
recipient: walletAddress,
|
|
61
|
+
tokenUri,
|
|
62
|
+
royaltyBps
|
|
63
|
+
});
|
|
64
|
+
const result = await executeIntent(signer, client, minted);
|
|
65
|
+
tokenId = contractAddress ? mintedTokenIdFromReceipt(result.receipt, contractAddress) : null;
|
|
66
|
+
} else {
|
|
67
|
+
let collectionContract = destination.mode === "existing" ? destination.collectionContract : "";
|
|
68
|
+
if (destination.mode === "new") {
|
|
69
|
+
const created = await client.api.intents.create("create-collection", {
|
|
70
|
+
owner: walletAddress,
|
|
71
|
+
name: destination.name,
|
|
72
|
+
symbol: destination.symbol,
|
|
73
|
+
description: destination.description || void 0,
|
|
74
|
+
image,
|
|
75
|
+
baseUri: "",
|
|
76
|
+
service: "mip-erc1155"
|
|
77
|
+
});
|
|
78
|
+
const deployResult = await executeIntent(signer, client, created);
|
|
79
|
+
const deployed = deployedCollectionFromReceipt(deployResult.receipt, "mip-erc1155");
|
|
80
|
+
if (!deployed) throw new Error("Collection deployed, but its address couldn't be read \u2014 check My Collections to mint into it.");
|
|
81
|
+
collectionContract = deployed;
|
|
82
|
+
}
|
|
83
|
+
const minted = await client.api.intents.create("mint", {
|
|
84
|
+
owner: walletAddress,
|
|
85
|
+
recipient: walletAddress,
|
|
86
|
+
collectionContract,
|
|
87
|
+
tokenUri,
|
|
88
|
+
value: input.editionCount,
|
|
89
|
+
royaltyBps
|
|
90
|
+
});
|
|
91
|
+
const result = await executeIntent(signer, client, minted);
|
|
92
|
+
contractAddress = collectionContract;
|
|
93
|
+
tokenId = mintedTokenIdFromReceipt(result.receipt, collectionContract);
|
|
94
|
+
}
|
|
95
|
+
return contractAddress && tokenId ? { contract: contractAddress, tokenId, image } : null;
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
mintAsset
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=mint-asset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/mint-asset.ts"],"sourcesContent":["import { buildAssetMetadata, type ApiCollection } from \"@medialane/sdk\";\nimport { executeIntent, deployedCollectionFromReceipt, mintedTokenIdFromReceipt, type MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { IPType } from \"../../data/ip.js\";\nimport type { MetadataField } from \"../ip-type-fields.js\";\nimport { uploadJsonToIpfs } from \"../../utils/ipfs-upload.js\";\nimport type { FormValues } from \"./form.js\";\nimport type { FastMintSigner, MediaKind, MintedAsset } from \"./types.js\";\nimport type { MintAssetType } from \"./mintable-collections.js\";\n\nexport type MintDestination =\n | { mode: \"existing\"; collectionId: string; collectionContract: string }\n | { mode: \"new\"; name: string; symbol: string; description: string };\n\nexport interface MintAssetInput {\n client: MedialaneClient;\n signer: FastMintSigner;\n walletAddress: string;\n values: FormValues;\n ipType: IPType;\n templateFields: MetadataField[];\n mediaKind: MediaKind;\n mediaUri: string;\n featureUri: string | null;\n assetType: MintAssetType;\n editionCount: string;\n destination: MintDestination;\n singleCollections: ApiCollection[];\n refetchCollections: () => Promise<ApiCollection[]>;\n getUploadToken: () => Promise<string | null>;\n}\n\nasync function pollForNewCollection(\n refetchCollections: () => Promise<ApiCollection[]>,\n name: string,\n symbol: string,\n): Promise<ApiCollection | null> {\n for (let attempt = 0; attempt < 8; attempt++) {\n const list = await refetchCollections();\n const match = list.find((c) => c.name === name && c.symbol === symbol);\n if (match?.collectionId) return match;\n await new Promise((r) => setTimeout(r, 1500));\n }\n return null;\n}\n\nexport async function mintAsset(input: MintAssetInput): Promise<MintedAsset | null> {\n const { client, signer, walletAddress, values, destination } = input;\n\n const image = input.mediaKind === \"image\" ? input.mediaUri : input.featureUri!;\n const built = buildAssetMetadata({\n name: values.name,\n description: values.description || \"\",\n externalUrl: values.external_url || \"\",\n imageUri: image,\n creator: walletAddress,\n ipType: input.ipType,\n licenseType: values.licenseType,\n commercialUse: values.commercialUse,\n derivatives: values.derivatives,\n attribution: values.attribution,\n geographicScope: values.geographicScope,\n aiPolicy: values.aiPolicy,\n royalty: String(values.royalty),\n templateTraits: input.templateFields\n .filter(({ traitType, value }) => traitType.trim() && value.trim())\n .map(({ traitType, value }) => ({ traitType, value })),\n });\n const metadata: Record<string, unknown> = { ...built };\n if (input.mediaKind !== \"image\") metadata.animation_url = input.mediaUri;\n\n const uploadToken = await input.getUploadToken();\n if (!uploadToken) throw new Error(\"Sign in first\");\n const tokenUri = await uploadJsonToIpfs(client.api, metadata);\n\n const royaltyBps = Math.round(values.royalty * 100);\n let contractAddress: string | null;\n let tokenId: string | null;\n\n if (input.assetType === \"single\") {\n let collectionId = destination.mode === \"existing\" ? destination.collectionId : \"\";\n contractAddress = destination.mode === \"existing\"\n ? input.singleCollections.find((c) => c.collectionId === destination.collectionId)?.contractAddress ?? null\n : null;\n\n if (destination.mode === \"new\") {\n const created = await client.api.intents.create(\"create-collection\", {\n owner: walletAddress,\n name: destination.name,\n symbol: destination.symbol,\n description: destination.description || undefined,\n image,\n });\n await executeIntent(signer, client, created);\n\n const found = await pollForNewCollection(input.refetchCollections, destination.name, destination.symbol);\n if (!found) throw new Error(\"Collection created, but it's still indexing — try minting again in a moment from My Collections.\");\n collectionId = found.collectionId!;\n contractAddress = found.contractAddress ?? null;\n }\n\n const minted = await client.api.intents.create(\"mint\", {\n owner: walletAddress,\n collectionId,\n recipient: walletAddress,\n tokenUri,\n royaltyBps,\n });\n const result = await executeIntent(signer, client, minted);\n tokenId = contractAddress ? mintedTokenIdFromReceipt(result.receipt, contractAddress) : null;\n } else {\n let collectionContract = destination.mode === \"existing\" ? destination.collectionContract : \"\";\n\n if (destination.mode === \"new\") {\n const created = await client.api.intents.create(\"create-collection\", {\n owner: walletAddress,\n name: destination.name,\n symbol: destination.symbol,\n description: destination.description || undefined,\n image,\n baseUri: \"\",\n service: \"mip-erc1155\",\n });\n const deployResult = await executeIntent(signer, client, created);\n\n const deployed = deployedCollectionFromReceipt(deployResult.receipt, \"mip-erc1155\");\n if (!deployed) throw new Error(\"Collection deployed, but its address couldn't be read — check My Collections to mint into it.\");\n collectionContract = deployed;\n }\n\n const minted = await client.api.intents.create(\"mint\", {\n owner: walletAddress,\n recipient: walletAddress,\n collectionContract,\n tokenUri,\n value: input.editionCount,\n royaltyBps,\n });\n const result = await executeIntent(signer, client, minted);\n contractAddress = collectionContract;\n tokenId = mintedTokenIdFromReceipt(result.receipt, collectionContract);\n }\n\n return contractAddress && tokenId ? { contract: contractAddress, tokenId, image } : null;\n}\n"],"mappings":"AAAA,SAAS,0BAA8C;AACvD,SAAS,eAAe,+BAA+B,gCAAsD;AAG7G,SAAS,wBAAwB;AA2BjC,eAAe,qBACb,oBACA,MACA,QAC+B;AAC/B,WAAS,UAAU,GAAG,UAAU,GAAG,WAAW;AAC5C,UAAM,OAAO,MAAM,mBAAmB;AACtC,UAAM,QAAQ,KAAK,KAAK,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,WAAW,MAAM;AACrE,QAAI,OAAO,aAAc,QAAO;AAChC,UAAM,IAAI,QAAQ,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAAA,EAC9C;AACA,SAAO;AACT;AAEA,eAAsB,UAAU,OAAoD;AAClF,QAAM,EAAE,QAAQ,QAAQ,eAAe,QAAQ,YAAY,IAAI;AAE/D,QAAM,QAAQ,MAAM,cAAc,UAAU,MAAM,WAAW,MAAM;AACnE,QAAM,QAAQ,mBAAmB;AAAA,IAC/B,MAAM,OAAO;AAAA,IACb,aAAa,OAAO,eAAe;AAAA,IACnC,aAA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","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var use_ipfs_upload_exports = {};
|
|
21
|
+
__export(use_ipfs_upload_exports, {
|
|
22
|
+
useIpfsUpload: () => useIpfsUpload
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(use_ipfs_upload_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_ipfs_upload = require("../../utils/ipfs-upload.js");
|
|
27
|
+
function useIpfsUpload() {
|
|
28
|
+
const [preview, setPreview] = (0, import_react.useState)(null);
|
|
29
|
+
const [uri, setUri] = (0, import_react.useState)(null);
|
|
30
|
+
const [uploading, setUploading] = (0, import_react.useState)(false);
|
|
31
|
+
const previewRef = (0, import_react.useRef)(null);
|
|
32
|
+
const revoke = () => {
|
|
33
|
+
if (previewRef.current) URL.revokeObjectURL(previewRef.current);
|
|
34
|
+
previewRef.current = null;
|
|
35
|
+
};
|
|
36
|
+
(0, import_react.useEffect)(() => revoke, []);
|
|
37
|
+
const start = async (file, upload, onError) => {
|
|
38
|
+
revoke();
|
|
39
|
+
const objectUrl = URL.createObjectURL(file);
|
|
40
|
+
previewRef.current = objectUrl;
|
|
41
|
+
setPreview(objectUrl);
|
|
42
|
+
setUri(null);
|
|
43
|
+
setUploading(true);
|
|
44
|
+
try {
|
|
45
|
+
setUri(await upload(file));
|
|
46
|
+
} catch (err) {
|
|
47
|
+
const toast = (0, import_ipfs_upload.uploadFailureToast)(err);
|
|
48
|
+
onError(toast.description ?? toast.title);
|
|
49
|
+
} finally {
|
|
50
|
+
setUploading(false);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const clear = () => {
|
|
54
|
+
revoke();
|
|
55
|
+
setPreview(null);
|
|
56
|
+
setUri(null);
|
|
57
|
+
};
|
|
58
|
+
return { preview, uri, uploading, start, clear };
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
useIpfsUpload
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=use-ipfs-upload.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/use-ipfs-upload.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { uploadFailureToast } from \"../../utils/ipfs-upload.js\";\n\nexport function useIpfsUpload() {\n const [preview, setPreview] = useState<string | null>(null);\n const [uri, setUri] = useState<string | null>(null);\n const [uploading, setUploading] = useState(false);\n const previewRef = useRef<string | null>(null);\n\n const revoke = () => {\n if (previewRef.current) URL.revokeObjectURL(previewRef.current);\n previewRef.current = null;\n };\n\n useEffect(() => revoke, []);\n\n const start = async (file: File, upload: (file: File) => Promise<string>, onError: (message: string) => void) => {\n revoke();\n const objectUrl = URL.createObjectURL(file);\n previewRef.current = objectUrl;\n setPreview(objectUrl);\n setUri(null);\n setUploading(true);\n try {\n setUri(await upload(file));\n } catch (err) {\n const toast = uploadFailureToast(err);\n onError(toast.description ?? toast.title);\n } finally {\n setUploading(false);\n }\n };\n\n const clear = () => {\n revoke();\n setPreview(null);\n setUri(null);\n };\n\n return { preview, uri, uploading, start, clear };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA4C;AAC5C,yBAAmC;AAE5B,SAAS,gBAAgB;AAC9B,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAwB,IAAI;AAC1D,QAAM,CAAC,KAAK,MAAM,QAAI,uBAAwB,IAAI;AAClD,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,KAAK;AAChD,QAAM,iBAAa,qBAAsB,IAAI;AAE7C,QAAM,SAAS,MAAM;AACnB,QAAI,WAAW,QAAS,KAAI,gBAAgB,WAAW,OAAO;AAC9D,eAAW,UAAU;AAAA,EACvB;AAEA,8BAAU,MAAM,QAAQ,CAAC,CAAC;AAE1B,QAAM,QAAQ,OAAO,MAAY,QAAyC,YAAuC;AAC/G,WAAO;AACP,UAAM,YAAY,IAAI,gBAAgB,IAAI;AAC1C,eAAW,UAAU;AACrB,eAAW,SAAS;AACpB,WAAO,IAAI;AACX,iBAAa,IAAI;AACjB,QAAI;AACF,aAAO,MAAM,OAAO,IAAI,CAAC;AAAA,IAC3B,SAAS,KAAK;AACZ,YAAM,YAAQ,uCAAmB,GAAG;AACpC,cAAQ,MAAM,eAAe,MAAM,KAAK;AAAA,IAC1C,UAAE;AACA,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,QAAQ,MAAM;AAClB,WAAO;AACP,eAAW,IAAI;AACf,WAAO,IAAI;AAAA,EACb;AAEA,SAAO,EAAE,SAAS,KAAK,WAAW,OAAO,MAAM;AACjD;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare function useIpfsUpload(): {
|
|
2
|
+
preview: string | null;
|
|
3
|
+
uri: string | null;
|
|
4
|
+
uploading: boolean;
|
|
5
|
+
start: (file: File, upload: (file: File) => Promise<string>, onError: (message: string) => void) => Promise<void>;
|
|
6
|
+
clear: () => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { useIpfsUpload };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare function useIpfsUpload(): {
|
|
2
|
+
preview: string | null;
|
|
3
|
+
uri: string | null;
|
|
4
|
+
uploading: boolean;
|
|
5
|
+
start: (file: File, upload: (file: File) => Promise<string>, onError: (message: string) => void) => Promise<void>;
|
|
6
|
+
clear: () => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { useIpfsUpload };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { uploadFailureToast } from "../../utils/ipfs-upload.js";
|
|
4
|
+
function useIpfsUpload() {
|
|
5
|
+
const [preview, setPreview] = useState(null);
|
|
6
|
+
const [uri, setUri] = useState(null);
|
|
7
|
+
const [uploading, setUploading] = useState(false);
|
|
8
|
+
const previewRef = useRef(null);
|
|
9
|
+
const revoke = () => {
|
|
10
|
+
if (previewRef.current) URL.revokeObjectURL(previewRef.current);
|
|
11
|
+
previewRef.current = null;
|
|
12
|
+
};
|
|
13
|
+
useEffect(() => revoke, []);
|
|
14
|
+
const start = async (file, upload, onError) => {
|
|
15
|
+
revoke();
|
|
16
|
+
const objectUrl = URL.createObjectURL(file);
|
|
17
|
+
previewRef.current = objectUrl;
|
|
18
|
+
setPreview(objectUrl);
|
|
19
|
+
setUri(null);
|
|
20
|
+
setUploading(true);
|
|
21
|
+
try {
|
|
22
|
+
setUri(await upload(file));
|
|
23
|
+
} catch (err) {
|
|
24
|
+
const toast = uploadFailureToast(err);
|
|
25
|
+
onError(toast.description ?? toast.title);
|
|
26
|
+
} finally {
|
|
27
|
+
setUploading(false);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const clear = () => {
|
|
31
|
+
revoke();
|
|
32
|
+
setPreview(null);
|
|
33
|
+
setUri(null);
|
|
34
|
+
};
|
|
35
|
+
return { preview, uri, uploading, start, clear };
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
useIpfsUpload
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=use-ipfs-upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/use-ipfs-upload.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { uploadFailureToast } from \"../../utils/ipfs-upload.js\";\n\nexport function useIpfsUpload() {\n const [preview, setPreview] = useState<string | null>(null);\n const [uri, setUri] = useState<string | null>(null);\n const [uploading, setUploading] = useState(false);\n const previewRef = useRef<string | null>(null);\n\n const revoke = () => {\n if (previewRef.current) URL.revokeObjectURL(previewRef.current);\n previewRef.current = null;\n };\n\n useEffect(() => revoke, []);\n\n const start = async (file: File, upload: (file: File) => Promise<string>, onError: (message: string) => void) => {\n revoke();\n const objectUrl = URL.createObjectURL(file);\n previewRef.current = objectUrl;\n setPreview(objectUrl);\n setUri(null);\n setUploading(true);\n try {\n setUri(await upload(file));\n } catch (err) {\n const toast = uploadFailureToast(err);\n onError(toast.description ?? toast.title);\n } finally {\n setUploading(false);\n }\n };\n\n const clear = () => {\n revoke();\n setPreview(null);\n setUri(null);\n };\n\n return { preview, uri, uploading, start, clear };\n}\n"],"mappings":";AAEA,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,0BAA0B;AAE5B,SAAS,gBAAgB;AAC9B,QAAM,CAAC,SAAS,UAAU,IAAI,SAAwB,IAAI;AAC1D,QAAM,CAAC,KAAK,MAAM,IAAI,SAAwB,IAAI;AAClD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,aAAa,OAAsB,IAAI;AAE7C,QAAM,SAAS,MAAM;AACnB,QAAI,WAAW,QAAS,KAAI,gBAAgB,WAAW,OAAO;AAC9D,eAAW,UAAU;AAAA,EACvB;AAEA,YAAU,MAAM,QAAQ,CAAC,CAAC;AAE1B,QAAM,QAAQ,OAAO,MAAY,QAAyC,YAAuC;AAC/G,WAAO;AACP,UAAM,YAAY,IAAI,gBAAgB,IAAI;AAC1C,eAAW,UAAU;AACrB,eAAW,SAAS;AACpB,WAAO,IAAI;AACX,iBAAa,IAAI;AACjB,QAAI;AACF,aAAO,MAAM,OAAO,IAAI,CAAC;AAAA,IAC3B,SAAS,KAAK;AACZ,YAAM,QAAQ,mBAAmB,GAAG;AACpC,cAAQ,MAAM,eAAe,MAAM,KAAK;AAAA,IAC1C,UAAE;AACA,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,QAAQ,MAAM;AAClB,WAAO;AACP,eAAW,IAAI;AACf,WAAO,IAAI;AAAA,EACb;AAEA,SAAO,EAAE,SAAS,KAAK,WAAW,OAAO,MAAM;AACjD;","names":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var use_new_collection_draft_exports = {};
|
|
21
|
+
__export(use_new_collection_draft_exports, {
|
|
22
|
+
useNewCollectionDraft: () => useNewCollectionDraft
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(use_new_collection_draft_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_launchpad_defaults = require("../../utils/launchpad-defaults.js");
|
|
27
|
+
function useNewCollectionDraft(assetName, assetDescription) {
|
|
28
|
+
const [name, setName] = (0, import_react.useState)("");
|
|
29
|
+
const [symbol, setSymbol] = (0, import_react.useState)("");
|
|
30
|
+
const [description, setDescription] = (0, import_react.useState)("");
|
|
31
|
+
const [autoSymbol, setAutoSymbol] = (0, import_react.useState)("");
|
|
32
|
+
const [autoName, setAutoName] = (0, import_react.useState)("");
|
|
33
|
+
const [autoDescription, setAutoDescription] = (0, import_react.useState)("");
|
|
34
|
+
(0, import_react.useEffect)(() => {
|
|
35
|
+
const suggested = (0, import_launchpad_defaults.suggestLaunchpadSymbol)(assetName);
|
|
36
|
+
if (!suggested) return;
|
|
37
|
+
if (!symbol || symbol === autoSymbol) {
|
|
38
|
+
setSymbol(suggested);
|
|
39
|
+
setAutoSymbol(suggested);
|
|
40
|
+
}
|
|
41
|
+
if (!name || name === autoName) {
|
|
42
|
+
setName(assetName);
|
|
43
|
+
setAutoName(assetName);
|
|
44
|
+
}
|
|
45
|
+
}, [assetName, autoSymbol, autoName, symbol, name]);
|
|
46
|
+
(0, import_react.useEffect)(() => {
|
|
47
|
+
if (!description || description === autoDescription) {
|
|
48
|
+
setDescription(assetDescription);
|
|
49
|
+
setAutoDescription(assetDescription);
|
|
50
|
+
}
|
|
51
|
+
}, [assetDescription, autoDescription, description]);
|
|
52
|
+
const reset = () => {
|
|
53
|
+
setName("");
|
|
54
|
+
setSymbol("");
|
|
55
|
+
setDescription("");
|
|
56
|
+
setAutoSymbol("");
|
|
57
|
+
setAutoName("");
|
|
58
|
+
setAutoDescription("");
|
|
59
|
+
};
|
|
60
|
+
return { name, symbol, description, setName, setSymbol, setDescription, reset };
|
|
61
|
+
}
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
useNewCollectionDraft
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=use-new-collection-draft.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/use-new-collection-draft.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\n\nexport function useNewCollectionDraft(assetName: string, assetDescription: string) {\n const [name, setName] = useState(\"\");\n const [symbol, setSymbol] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [autoName, setAutoName] = useState(\"\");\n const [autoDescription, setAutoDescription] = useState(\"\");\n\n useEffect(() => {\n const suggested = suggestLaunchpadSymbol(assetName);\n if (!suggested) return;\n if (!symbol || symbol === autoSymbol) {\n setSymbol(suggested);\n setAutoSymbol(suggested);\n }\n if (!name || name === autoName) {\n setName(assetName);\n setAutoName(assetName);\n }\n }, [assetName, autoSymbol, autoName, symbol, name]);\n\n useEffect(() => {\n if (!description || description === autoDescription) {\n setDescription(assetDescription);\n setAutoDescription(assetDescription);\n }\n }, [assetDescription, autoDescription, description]);\n\n const reset = () => {\n setName(\"\");\n setSymbol(\"\");\n setDescription(\"\");\n setAutoSymbol(\"\");\n setAutoName(\"\");\n setAutoDescription(\"\");\n };\n\n return { name, symbol, description, setName, setSymbol, setDescription, reset };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AACpC,gCAAuC;AAEhC,SAAS,sBAAsB,WAAmB,kBAA0B;AACjF,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,EAAE;AACnC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,EAAE;AACvC,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,EAAE;AACjD,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAS,EAAE;AAC/C,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,EAAE;AAC3C,QAAM,CAAC,iBAAiB,kBAAkB,QAAI,uBAAS,EAAE;AAEzD,8BAAU,MAAM;AACd,UAAM,gBAAY,kDAAuB,SAAS;AAClD,QAAI,CAAC,UAAW;AAChB,QAAI,CAAC,UAAU,WAAW,YAAY;AACpC,gBAAU,SAAS;AACnB,oBAAc,SAAS;AAAA,IACzB;AACA,QAAI,CAAC,QAAQ,SAAS,UAAU;AAC9B,cAAQ,SAAS;AACjB,kBAAY,SAAS;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,WAAW,YAAY,UAAU,QAAQ,IAAI,CAAC;AAElD,8BAAU,MAAM;AACd,QAAI,CAAC,eAAe,gBAAgB,iBAAiB;AACnD,qBAAe,gBAAgB;AAC/B,yBAAmB,gBAAgB;AAAA,IACrC;AAAA,EACF,GAAG,CAAC,kBAAkB,iBAAiB,WAAW,CAAC;AAEnD,QAAM,QAAQ,MAAM;AAClB,YAAQ,EAAE;AACV,cAAU,EAAE;AACZ,mBAAe,EAAE;AACjB,kBAAc,EAAE;AAChB,gBAAY,EAAE;AACd,uBAAmB,EAAE;AAAA,EACvB;AAEA,SAAO,EAAE,MAAM,QAAQ,aAAa,SAAS,WAAW,gBAAgB,MAAM;AAChF;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare function useNewCollectionDraft(assetName: string, assetDescription: string): {
|
|
4
|
+
name: string;
|
|
5
|
+
symbol: string;
|
|
6
|
+
description: string;
|
|
7
|
+
setName: React.Dispatch<React.SetStateAction<string>>;
|
|
8
|
+
setSymbol: React.Dispatch<React.SetStateAction<string>>;
|
|
9
|
+
setDescription: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { useNewCollectionDraft };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare function useNewCollectionDraft(assetName: string, assetDescription: string): {
|
|
4
|
+
name: string;
|
|
5
|
+
symbol: string;
|
|
6
|
+
description: string;
|
|
7
|
+
setName: React.Dispatch<React.SetStateAction<string>>;
|
|
8
|
+
setSymbol: React.Dispatch<React.SetStateAction<string>>;
|
|
9
|
+
setDescription: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { useNewCollectionDraft };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { suggestLaunchpadSymbol } from "../../utils/launchpad-defaults.js";
|
|
4
|
+
function useNewCollectionDraft(assetName, assetDescription) {
|
|
5
|
+
const [name, setName] = useState("");
|
|
6
|
+
const [symbol, setSymbol] = useState("");
|
|
7
|
+
const [description, setDescription] = useState("");
|
|
8
|
+
const [autoSymbol, setAutoSymbol] = useState("");
|
|
9
|
+
const [autoName, setAutoName] = useState("");
|
|
10
|
+
const [autoDescription, setAutoDescription] = useState("");
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const suggested = suggestLaunchpadSymbol(assetName);
|
|
13
|
+
if (!suggested) return;
|
|
14
|
+
if (!symbol || symbol === autoSymbol) {
|
|
15
|
+
setSymbol(suggested);
|
|
16
|
+
setAutoSymbol(suggested);
|
|
17
|
+
}
|
|
18
|
+
if (!name || name === autoName) {
|
|
19
|
+
setName(assetName);
|
|
20
|
+
setAutoName(assetName);
|
|
21
|
+
}
|
|
22
|
+
}, [assetName, autoSymbol, autoName, symbol, name]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!description || description === autoDescription) {
|
|
25
|
+
setDescription(assetDescription);
|
|
26
|
+
setAutoDescription(assetDescription);
|
|
27
|
+
}
|
|
28
|
+
}, [assetDescription, autoDescription, description]);
|
|
29
|
+
const reset = () => {
|
|
30
|
+
setName("");
|
|
31
|
+
setSymbol("");
|
|
32
|
+
setDescription("");
|
|
33
|
+
setAutoSymbol("");
|
|
34
|
+
setAutoName("");
|
|
35
|
+
setAutoDescription("");
|
|
36
|
+
};
|
|
37
|
+
return { name, symbol, description, setName, setSymbol, setDescription, reset };
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
useNewCollectionDraft
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=use-new-collection-draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/use-new-collection-draft.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\n\nexport function useNewCollectionDraft(assetName: string, assetDescription: string) {\n const [name, setName] = useState(\"\");\n const [symbol, setSymbol] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [autoName, setAutoName] = useState(\"\");\n const [autoDescription, setAutoDescription] = useState(\"\");\n\n useEffect(() => {\n const suggested = suggestLaunchpadSymbol(assetName);\n if (!suggested) return;\n if (!symbol || symbol === autoSymbol) {\n setSymbol(suggested);\n setAutoSymbol(suggested);\n }\n if (!name || name === autoName) {\n setName(assetName);\n setAutoName(assetName);\n }\n }, [assetName, autoSymbol, autoName, symbol, name]);\n\n useEffect(() => {\n if (!description || description === autoDescription) {\n setDescription(assetDescription);\n setAutoDescription(assetDescription);\n }\n }, [assetDescription, autoDescription, description]);\n\n const reset = () => {\n setName(\"\");\n setSymbol(\"\");\n setDescription(\"\");\n setAutoSymbol(\"\");\n setAutoName(\"\");\n setAutoDescription(\"\");\n };\n\n return { name, symbol, description, setName, setSymbol, setDescription, reset };\n}\n"],"mappings":";AAEA,SAAS,WAAW,gBAAgB;AACpC,SAAS,8BAA8B;AAEhC,SAAS,sBAAsB,WAAmB,kBAA0B;AACjF,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,EAAE;AACvC,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AACjD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,EAAE;AAC/C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,EAAE;AAC3C,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAS,EAAE;AAEzD,YAAU,MAAM;AACd,UAAM,YAAY,uBAAuB,SAAS;AAClD,QAAI,CAAC,UAAW;AAChB,QAAI,CAAC,UAAU,WAAW,YAAY;AACpC,gBAAU,SAAS;AACnB,oBAAc,SAAS;AAAA,IACzB;AACA,QAAI,CAAC,QAAQ,SAAS,UAAU;AAC9B,cAAQ,SAAS;AACjB,kBAAY,SAAS;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,WAAW,YAAY,UAAU,QAAQ,IAAI,CAAC;AAElD,YAAU,MAAM;AACd,QAAI,CAAC,eAAe,gBAAgB,iBAAiB;AACnD,qBAAe,gBAAgB;AAC/B,yBAAmB,gBAAgB;AAAA,IACrC;AAAA,EACF,GAAG,CAAC,kBAAkB,iBAAiB,WAAW,CAAC;AAEnD,QAAM,QAAQ,MAAM;AAClB,YAAQ,EAAE;AACV,cAAU,EAAE;AACZ,mBAAe,EAAE;AACjB,kBAAc,EAAE;AAChB,gBAAY,EAAE;AACd,uBAAmB,EAAE;AAAA,EACvB;AAEA,SAAO,EAAE,MAAM,QAAQ,aAAa,SAAS,WAAW,gBAAgB,MAAM;AAChF;","names":[]}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var journey_content_exports = {};
|
|
31
|
+
__export(journey_content_exports, {
|
|
32
|
+
JourneyContent: () => JourneyContent
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(journey_content_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
37
|
+
var import_lucide_react = require("lucide-react");
|
|
38
|
+
var import_medialane_app = require("./medialane-app.js");
|
|
39
|
+
var import_level_journey_list = require("./rewards/level-journey-list.js");
|
|
40
|
+
var import_badge_catalog = require("./rewards/badge-catalog.js");
|
|
41
|
+
var import_skeleton = require("./skeleton.js");
|
|
42
|
+
var import_use_rewards = require("../utils/use-rewards.js");
|
|
43
|
+
const EXAMPLE_ACTION_TYPES = [
|
|
44
|
+
"mint_asset",
|
|
45
|
+
"buy_asset",
|
|
46
|
+
"create_collection",
|
|
47
|
+
"comment",
|
|
48
|
+
"launch_launchpad",
|
|
49
|
+
"make_offer",
|
|
50
|
+
"join_club",
|
|
51
|
+
"list_asset"
|
|
52
|
+
];
|
|
53
|
+
function Hero() {
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "py-14 space-y-5", children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-brand-orange to-brand-maeve text-white shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, { className: "h-5 w-5" }) }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h1", { className: "text-5xl sm:text-6xl font-black tracking-tight leading-[1.02]", children: [
|
|
58
|
+
"Your",
|
|
59
|
+
" ",
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "bg-gradient-to-r from-brand-orange to-brand-maeve bg-clip-text text-transparent", children: "Journey" })
|
|
61
|
+
] })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-lg text-foreground/70 max-w-xl leading-relaxed font-medium", children: [
|
|
64
|
+
"Every level, every badge, every way to earn \u2014 the whole system, in one place. Check",
|
|
65
|
+
" ",
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/rewards", className: "text-foreground underline underline-offset-2 hover:text-brand-orange transition-colors", children: "your own score" }),
|
|
67
|
+
" ",
|
|
68
|
+
"on Rewards."
|
|
69
|
+
] })
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
function LevelsSection() {
|
|
73
|
+
const { data: config, isLoading } = (0, import_use_rewards.useRewardsConfig)();
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "py-14 space-y-6", children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-black tracking-tight", children: "The Level Ladder" }),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-base text-foreground/60 mt-1.5 font-medium", children: "50 levels, from Starter to Genesis." })
|
|
78
|
+
] }),
|
|
79
|
+
isLoading || !config ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-96 w-full rounded-2xl" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_level_journey_list.LevelJourneyList, { levels: config.levels })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function HowXpWorksSection() {
|
|
83
|
+
const { data: config, isLoading } = (0, import_use_rewards.useRewardsConfig)();
|
|
84
|
+
const examples = config?.actions.filter((a) => EXAMPLE_ACTION_TYPES.includes(a.type)) ?? [];
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "py-14 space-y-6", children: [
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-2xl", children: [
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-black tracking-tight", children: "How XP works" }),
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-base text-foreground/60 mt-1.5 font-medium leading-relaxed", children: "Every action earns real XP, automatically \u2014 no buying points, no gaming the system. Some early actions and loyalty count extra. Scores and badges are recalculated weekly." })
|
|
89
|
+
] }),
|
|
90
|
+
isLoading || !config ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-40 w-full rounded-2xl" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3", children: examples.map((a) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl bg-foreground/[0.04] p-4", children: [
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-lg font-black text-brand-orange", children: [
|
|
92
|
+
"+",
|
|
93
|
+
a.xp
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-foreground/60 mt-1 leading-snug", children: a.label })
|
|
96
|
+
] }, a.type)) })
|
|
97
|
+
] });
|
|
98
|
+
}
|
|
99
|
+
function BadgesSection() {
|
|
100
|
+
const { data: config, isLoading } = (0, import_use_rewards.useRewardsConfig)();
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "py-14 space-y-6", children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-black tracking-tight", children: "Badges" }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-base text-foreground/60 mt-1.5 font-medium", children: "What's achievable, not just what you've done." })
|
|
105
|
+
] }),
|
|
106
|
+
isLoading || !config ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-64 w-full rounded-2xl" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_badge_catalog.BadgeCatalog, { badges: config.badges })
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
109
|
+
function CtaSection({ startHint }) {
|
|
110
|
+
const { onRequireWallet } = (0, import_medialane_app.useMedialaneApp)();
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "py-14 pb-20 grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
113
|
+
"button",
|
|
114
|
+
{
|
|
115
|
+
type: "button",
|
|
116
|
+
onClick: onRequireWallet,
|
|
117
|
+
className: "flex items-center justify-between rounded-2xl bg-gradient-to-br from-brand-orange to-brand-maeve p-6 text-left text-white",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-black text-lg", children: "New here?" }),
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium text-white/80", children: startHint })
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-5 w-5 shrink-0" })
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
128
|
+
import_link.default,
|
|
129
|
+
{
|
|
130
|
+
href: "/rewards",
|
|
131
|
+
className: "flex items-center justify-between rounded-2xl bg-foreground/[0.04] hover:bg-foreground/[0.07] p-6 transition-colors",
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-black text-lg", children: "Already earning?" }),
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium text-foreground/60", children: "Check your score." })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-5 w-5 shrink-0" })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
function JourneyContent({ startHint }) {
|
|
144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Hero, {}),
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LevelsSection, {}),
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(HowXpWorksSection, {}),
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BadgesSection, {}),
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CtaSection, { startHint })
|
|
150
|
+
] });
|
|
151
|
+
}
|
|
152
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
153
|
+
0 && (module.exports = {
|
|
154
|
+
JourneyContent
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=journey-content.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/journey-content.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { Sparkles, ArrowRight } from \"lucide-react\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { LevelJourneyList } from \"./rewards/level-journey-list.js\";\nimport { BadgeCatalog } from \"./rewards/badge-catalog.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { useRewardsConfig } from \"../utils/use-rewards.js\";\n\nconst EXAMPLE_ACTION_TYPES = [\n \"mint_asset\", \"buy_asset\", \"create_collection\", \"comment\",\n \"launch_launchpad\", \"make_offer\", \"join_club\", \"list_asset\",\n];\n\nfunction Hero() {\n return (\n <section className=\"py-14 space-y-5\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-brand-orange to-brand-maeve text-white shrink-0\">\n <Sparkles className=\"h-5 w-5\" />\n </div>\n <h1 className=\"text-5xl sm:text-6xl font-black tracking-tight leading-[1.02]\">\n Your{\" \"}\n <span className=\"bg-gradient-to-r from-brand-orange to-brand-maeve bg-clip-text text-transparent\">\n Journey\n </span>\n </h1>\n </div>\n <p className=\"text-lg text-foreground/70 max-w-xl leading-relaxed font-medium\">\n Every level, every badge, every way to earn — the whole system, in one place. Check{\" \"}\n <Link href=\"/rewards\" className=\"text-foreground underline underline-offset-2 hover:text-brand-orange transition-colors\">\n your own score\n </Link>{\" \"}\n on Rewards.\n </p>\n </section>\n );\n}\n\nfunction LevelsSection() {\n const { data: config, isLoading } = useRewardsConfig();\n return (\n <section className=\"py-14 space-y-6\">\n <div>\n <h2 className=\"text-2xl font-black tracking-tight\">The Level Ladder</h2>\n <p className=\"text-base text-foreground/60 mt-1.5 font-medium\">50 levels, from Starter to Genesis.</p>\n </div>\n {isLoading || !config ? (\n <Skeleton className=\"h-96 w-full rounded-2xl\" />\n ) : (\n <LevelJourneyList levels={config.levels} />\n )}\n </section>\n );\n}\n\nfunction HowXpWorksSection() {\n const { data: config, isLoading } = useRewardsConfig();\n const examples = config?.actions.filter((a) => EXAMPLE_ACTION_TYPES.includes(a.type)) ?? [];\n\n return (\n <section className=\"py-14 space-y-6\">\n <div className=\"max-w-2xl\">\n <h2 className=\"text-2xl font-black tracking-tight\">How XP works</h2>\n <p className=\"text-base text-foreground/60 mt-1.5 font-medium leading-relaxed\">\n Every action earns real XP, automatically — no buying points, no gaming the system.\n Some early actions and loyalty count extra. Scores and badges are\n recalculated weekly.\n </p>\n </div>\n {isLoading || !config ? (\n <Skeleton className=\"h-40 w-full rounded-2xl\" />\n ) : (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n {examples.map((a) => (\n <div key={a.type} className=\"rounded-2xl bg-foreground/[0.04] p-4\">\n <p className=\"text-lg font-black text-brand-orange\">+{a.xp}</p>\n <p className=\"text-xs font-semibold text-foreground/60 mt-1 leading-snug\">{a.label}</p>\n </div>\n ))}\n </div>\n )}\n </section>\n );\n}\n\nfunction BadgesSection() {\n const { data: config, isLoading } = useRewardsConfig();\n return (\n <section className=\"py-14 space-y-6\">\n <div>\n <h2 className=\"text-2xl font-black tracking-tight\">Badges</h2>\n <p className=\"text-base text-foreground/60 mt-1.5 font-medium\">What's achievable, not just what you've done.</p>\n </div>\n {isLoading || !config ? (\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n ) : (\n <BadgeCatalog badges={config.badges} />\n )}\n </section>\n );\n}\n\nfunction CtaSection({ startHint }: { startHint: string }) {\n const { onRequireWallet } = useMedialaneApp();\n return (\n <section className=\"py-14 pb-20 grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <button\n type=\"button\"\n onClick={onRequireWallet}\n className=\"flex items-center justify-between rounded-2xl bg-gradient-to-br from-brand-orange to-brand-maeve p-6 text-left text-white\"\n >\n <div>\n <p className=\"font-black text-lg\">New here?</p>\n <p className=\"text-sm font-medium text-white/80\">{startHint}</p>\n </div>\n <ArrowRight className=\"h-5 w-5 shrink-0\" />\n </button>\n <Link\n href=\"/rewards\"\n className=\"flex items-center justify-between rounded-2xl bg-foreground/[0.04] hover:bg-foreground/[0.07] p-6 transition-colors\"\n >\n <div>\n <p className=\"font-black text-lg\">Already earning?</p>\n <p className=\"text-sm font-medium text-foreground/60\">Check your score.</p>\n </div>\n <ArrowRight className=\"h-5 w-5 shrink-0\" />\n </Link>\n </section>\n );\n}\n\nexport function JourneyContent({ startHint }: { startHint: string }) {\n return (\n <>\n <Hero />\n <LevelsSection />\n <HowXpWorksSection />\n <BadgesSection />\n <CtaSection startHint={startHint} />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBU;AAlB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