@medialane/ui 0.366.0 → 0.367.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/components/account/input-otp.d.cts +2 -2
  2. package/dist/components/account/input-otp.d.ts +2 -2
  3. package/dist/components/approve-mint-dialog.d.cts +0 -1
  4. package/dist/components/approve-mint-dialog.d.ts +0 -1
  5. package/dist/components/button.d.cts +2 -2
  6. package/dist/components/button.d.ts +2 -2
  7. package/dist/components/fast-mint/asset-form-parts.cjs +25 -51
  8. package/dist/components/fast-mint/asset-form-parts.cjs.map +1 -1
  9. package/dist/components/fast-mint/asset-form-parts.d.cts +11 -14
  10. package/dist/components/fast-mint/asset-form-parts.d.ts +11 -14
  11. package/dist/components/fast-mint/asset-form-parts.js +27 -52
  12. package/dist/components/fast-mint/asset-form-parts.js.map +1 -1
  13. package/dist/components/fast-mint/collection-section.cjs +11 -21
  14. package/dist/components/fast-mint/collection-section.cjs.map +1 -1
  15. package/dist/components/fast-mint/collection-section.d.cts +5 -7
  16. package/dist/components/fast-mint/collection-section.d.ts +5 -7
  17. package/dist/components/fast-mint/collection-section.js +11 -21
  18. package/dist/components/fast-mint/collection-section.js.map +1 -1
  19. package/dist/components/fast-mint/create-then-add.cjs +55 -0
  20. package/dist/components/fast-mint/create-then-add.cjs.map +1 -0
  21. package/dist/components/fast-mint/create-then-add.d.cts +24 -0
  22. package/dist/components/fast-mint/create-then-add.d.ts +24 -0
  23. package/dist/components/fast-mint/create-then-add.js +30 -0
  24. package/dist/components/fast-mint/create-then-add.js.map +1 -0
  25. package/dist/components/fast-mint/dropzone.d.cts +0 -1
  26. package/dist/components/fast-mint/dropzone.d.ts +0 -1
  27. package/dist/components/fast-mint/fast-mint.cjs +95 -167
  28. package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
  29. package/dist/components/fast-mint/fast-mint.js +97 -169
  30. package/dist/components/fast-mint/fast-mint.js.map +1 -1
  31. package/dist/components/fast-mint/formats/nft.cjs +233 -0
  32. package/dist/components/fast-mint/formats/nft.cjs.map +1 -0
  33. package/dist/components/fast-mint/formats/nft.d.cts +19 -0
  34. package/dist/components/fast-mint/formats/nft.d.ts +19 -0
  35. package/dist/components/fast-mint/formats/nft.js +214 -0
  36. package/dist/components/fast-mint/formats/nft.js.map +1 -0
  37. package/dist/components/fast-mint/formats/pop.cjs +160 -0
  38. package/dist/components/fast-mint/formats/pop.cjs.map +1 -0
  39. package/dist/components/fast-mint/formats/pop.d.cts +18 -0
  40. package/dist/components/fast-mint/formats/pop.d.ts +18 -0
  41. package/dist/components/fast-mint/formats/pop.js +136 -0
  42. package/dist/components/fast-mint/formats/pop.js.map +1 -0
  43. package/dist/components/fast-mint/formats/registry.cjs +42 -0
  44. package/dist/components/fast-mint/formats/registry.cjs.map +1 -0
  45. package/dist/components/fast-mint/formats/registry.d.cts +20 -0
  46. package/dist/components/fast-mint/formats/registry.d.ts +20 -0
  47. package/dist/components/fast-mint/formats/registry.js +16 -0
  48. package/dist/components/fast-mint/formats/registry.js.map +1 -0
  49. package/dist/components/fast-mint/formats/tiers.cjs +206 -0
  50. package/dist/components/fast-mint/formats/tiers.cjs.map +1 -0
  51. package/dist/components/fast-mint/formats/tiers.d.cts +19 -0
  52. package/dist/components/fast-mint/formats/tiers.d.ts +19 -0
  53. package/dist/components/fast-mint/formats/tiers.js +181 -0
  54. package/dist/components/fast-mint/formats/tiers.js.map +1 -0
  55. package/dist/components/fast-mint/formats/types.cjs +31 -0
  56. package/dist/components/fast-mint/formats/types.cjs.map +1 -0
  57. package/dist/components/fast-mint/formats/types.d.cts +71 -0
  58. package/dist/components/fast-mint/formats/types.d.ts +71 -0
  59. package/dist/components/fast-mint/formats/types.js +7 -0
  60. package/dist/components/fast-mint/formats/types.js.map +1 -0
  61. package/dist/components/fast-mint/media-kind.d.cts +0 -1
  62. package/dist/components/fast-mint/media-kind.d.ts +0 -1
  63. package/dist/components/fast-mint/success-view.cjs +18 -59
  64. package/dist/components/fast-mint/success-view.cjs.map +1 -1
  65. package/dist/components/fast-mint/success-view.d.cts +13 -8
  66. package/dist/components/fast-mint/success-view.d.ts +13 -8
  67. package/dist/components/fast-mint/success-view.js +19 -60
  68. package/dist/components/fast-mint/success-view.js.map +1 -1
  69. package/dist/components/fast-mint/types.cjs.map +1 -1
  70. package/dist/components/fast-mint/types.d.cts +0 -3
  71. package/dist/components/fast-mint/types.d.ts +0 -3
  72. package/dist/components/launchpad/collection-create-form.cjs +6 -14
  73. package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
  74. package/dist/components/launchpad/collection-create-form.js +6 -14
  75. package/dist/components/launchpad/collection-create-form.js.map +1 -1
  76. package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
  77. package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
  78. package/dist/components/launchpad/pop-create-fields.cjs +5 -3
  79. package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
  80. package/dist/components/launchpad/pop-create-fields.d.cts +8 -2
  81. package/dist/components/launchpad/pop-create-fields.d.ts +8 -2
  82. package/dist/components/launchpad/pop-create-fields.js +4 -3
  83. package/dist/components/launchpad/pop-create-fields.js.map +1 -1
  84. package/dist/components/launchpad/pop-create.cjs +9 -22
  85. package/dist/components/launchpad/pop-create.cjs.map +1 -1
  86. package/dist/components/launchpad/pop-create.js +9 -22
  87. package/dist/components/launchpad/pop-create.js.map +1 -1
  88. package/dist/components/launchpad/tier-mint-form.cjs +8 -25
  89. package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
  90. package/dist/components/launchpad/tier-mint-form.js +6 -23
  91. package/dist/components/launchpad/tier-mint-form.js.map +1 -1
  92. package/dist/components/transfer-dialog.d.cts +0 -1
  93. package/dist/components/transfer-dialog.d.ts +0 -1
  94. package/dist/data/launchpad-services.cjs +12 -12
  95. package/dist/data/launchpad-services.cjs.map +1 -1
  96. package/dist/data/launchpad-services.js +12 -12
  97. package/dist/data/launchpad-services.js.map +1 -1
  98. package/dist/index.d.cts +4 -0
  99. package/dist/index.d.ts +4 -0
  100. package/dist/utils/drop/actions.d.cts +0 -1
  101. package/dist/utils/drop/actions.d.ts +0 -1
  102. package/dist/utils/drop/types.d.cts +0 -1
  103. package/dist/utils/drop/types.d.ts +0 -1
  104. package/dist/utils/launchpad-actions.cjs +90 -0
  105. package/dist/utils/launchpad-actions.cjs.map +1 -0
  106. package/dist/utils/launchpad-actions.d.cts +39 -0
  107. package/dist/utils/launchpad-actions.d.ts +39 -0
  108. package/dist/utils/launchpad-actions.js +60 -0
  109. package/dist/utils/launchpad-actions.js.map +1 -0
  110. package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
  111. package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
  112. package/dist/utils/use-transaction.d.cts +0 -1
  113. package/dist/utils/use-transaction.d.ts +0 -1
  114. package/package.json +1 -1
  115. package/dist/components/fast-mint/mint-asset.cjs +0 -124
  116. package/dist/components/fast-mint/mint-asset.cjs.map +0 -1
  117. package/dist/components/fast-mint/mint-asset.d.cts +0 -41
  118. package/dist/components/fast-mint/mint-asset.d.ts +0 -41
  119. package/dist/components/fast-mint/mint-asset.js +0 -100
  120. package/dist/components/fast-mint/mint-asset.js.map +0 -1
  121. package/dist/utils/launchpad-handoff.cjs +0 -62
  122. package/dist/utils/launchpad-handoff.cjs.map +0 -1
  123. package/dist/utils/launchpad-handoff.d.cts +0 -11
  124. package/dist/utils/launchpad-handoff.d.ts +0 -11
  125. package/dist/utils/launchpad-handoff.js +0 -35
  126. package/dist/utils/launchpad-handoff.js.map +0 -1
@@ -0,0 +1,206 @@
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 tiers_exports = {};
21
+ __export(tiers_exports, {
22
+ CLUB_FORMAT: () => CLUB_FORMAT,
23
+ TICKETS_FORMAT: () => TICKETS_FORMAT
24
+ });
25
+ module.exports = __toCommonJS(tiers_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_sdk = require("@medialane/sdk");
29
+ var import_starknet = require("@medialane/sdk/starknet");
30
+ var import_input = require("../../input.js");
31
+ var import_ipfs_upload = require("../../../utils/ipfs-upload.js");
32
+ var import_launchpad_actions = require("../../../utils/launchpad-actions.js");
33
+ var import_tier_mint_presets = require("../../launchpad/tier-mint-presets.js");
34
+ var import_collection_section = require("../collection-section.js");
35
+ var import_licensing_section = require("../licensing-section.js");
36
+ var import_create_then_add = require("../create-then-add.js");
37
+ var import_types = require("./types.js");
38
+ const SUPPLY_PATTERN = /^[1-9]\d*$/;
39
+ function makeTierFormat(config) {
40
+ const { preset, noun } = config;
41
+ const ownCollections = (shared) => shared.collections.filter((c) => (0, import_sdk.getService)(c.service)?.id === preset.service && !!c.contractAddress);
42
+ function Fields({ shared, state, update }) {
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
44
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
+ import_collection_section.CollectionSection,
46
+ {
47
+ noun,
48
+ mode: state.mode,
49
+ onModeChange: (mode) => update({ mode }),
50
+ collections: ownCollections(shared),
51
+ value: state.existingContract,
52
+ onValue: (existingContract) => update({ existingContract }),
53
+ valueOf: (c) => c.contractAddress,
54
+ draft: shared.draft,
55
+ previewImage: shared.previewImage
56
+ }
57
+ ),
58
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "text-sm font-medium", htmlFor: `fast-mint-${config.key}-supply`, children: [
60
+ config.supplyLabel,
61
+ " *"
62
+ ] }),
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
64
+ import_input.Input,
65
+ {
66
+ id: `fast-mint-${config.key}-supply`,
67
+ type: "number",
68
+ min: 1,
69
+ value: state.supply,
70
+ onChange: (e) => update({ supply: e.target.value }),
71
+ className: "max-w-[160px]"
72
+ }
73
+ )
74
+ ] }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", children: "Valid" }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "date", "aria-label": "Valid from", value: state.startDate, onChange: (e) => update({ startDate: e.target.value }) }),
79
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "date", "aria-label": "Valid until", value: state.endDate, onChange: (e) => update({ endDate: e.target.value }) })
80
+ ] }),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: preset.copy.validUntilHint })
82
+ ] }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_licensing_section.LicensingSection, { form: shared.form })
84
+ ] });
85
+ }
86
+ return (0, import_types.defineFormat)({
87
+ key: config.key,
88
+ title: config.title,
89
+ hint: config.hint,
90
+ icon: config.icon,
91
+ submitLabel: () => config.submitLabel,
92
+ initial: () => ({ mode: "existing", existingContract: "", supply: "100", startDate: "", endDate: "" }),
93
+ Fields,
94
+ isReady: (shared, state) => {
95
+ if (!SUPPLY_PATTERN.test(state.supply.trim())) return false;
96
+ if (state.mode === "new") return shared.draft.name.trim().length > 0 && shared.draft.symbol.trim().length > 0;
97
+ return state.existingContract !== "";
98
+ },
99
+ previewLabel: (shared, state) => state.mode === "new" ? shared.draft.name || `New ${noun}` : ownCollections(shared).find((c) => c.contractAddress === state.existingContract)?.name || void 0,
100
+ submit: async (shared, state, runtime) => {
101
+ const { client, signer, onStep } = runtime;
102
+ const owner = shared.walletAddress;
103
+ const values = shared.form.getValues();
104
+ const supply = state.supply.trim();
105
+ const uploadToken = await runtime.getUploadToken();
106
+ if (!uploadToken) throw new Error("Sign in first");
107
+ const existing = runtime.resume ?? (state.mode === "existing" && state.existingContract ? state.existingContract : null);
108
+ const contract = await (0, import_create_then_add.createThenAdd)({
109
+ existing,
110
+ noun,
111
+ labels: { create: `Creating the ${noun}`, add: config.addLabel },
112
+ onStep,
113
+ create: async () => {
114
+ const baseUri = await (0, import_ipfs_upload.uploadJsonToIpfs)(
115
+ client.api,
116
+ (0, import_sdk.buildCollectionMetadata)({
117
+ name: shared.draft.name,
118
+ description: shared.draft.description,
119
+ image: shared.image,
120
+ externalLink: values.external_url,
121
+ owner
122
+ })
123
+ );
124
+ const created = await (0, import_launchpad_actions.serviceCollectionIntent)(client.api, {
125
+ owner,
126
+ name: shared.draft.name,
127
+ symbol: shared.draft.symbol,
128
+ baseUri,
129
+ service: preset.service
130
+ });
131
+ const { receipt } = await (0, import_starknet.executeIntent)(signer, client, created);
132
+ const deployed = (0, import_starknet.deployedCollectionFromReceipt)(receipt, preset.service);
133
+ if (!deployed) throw new Error(`The ${noun} was deployed, but its address couldn't be read \u2014 check My Collections.`);
134
+ return deployed;
135
+ },
136
+ add: async (address) => {
137
+ const pinned = await (0, import_ipfs_upload.pinAssetMetadata)(client.api, {
138
+ name: values.name,
139
+ description: values.description,
140
+ imageUri: shared.image,
141
+ externalUrl: values.external_url,
142
+ ipType: "NFT",
143
+ licenseType: values.licenseType,
144
+ commercialUse: values.commercialUse,
145
+ derivatives: values.derivatives,
146
+ attribution: values.attribution,
147
+ geographicScope: values.geographicScope,
148
+ aiPolicy: values.aiPolicy,
149
+ royalty: String(values.royalty),
150
+ creator: owner,
151
+ templateTraits: (0, import_launchpad_actions.tierTraits)(preset.traitType, supply, address)
152
+ });
153
+ const intents = await (0, import_launchpad_actions.tierIntents)(client.api, {
154
+ owner,
155
+ contract: address,
156
+ service: preset.service,
157
+ tierId: await preset.predictNextId(client.api, address),
158
+ maxSupply: supply,
159
+ startTime: (0, import_launchpad_actions.dateToUnixTimestamp)(state.startDate),
160
+ endTime: (0, import_launchpad_actions.dateToUnixTimestamp)(state.endDate),
161
+ royaltyBps: Math.round(values.royalty * 100),
162
+ metadataUri: pinned.uri
163
+ });
164
+ await (0, import_starknet.executeIntents)(signer, client, intents);
165
+ return address;
166
+ }
167
+ });
168
+ return {
169
+ headline: preset.success.title,
170
+ detail: preset.success.description,
171
+ name: values.name,
172
+ collectionLabel: ownCollections(shared).find((c) => c.contractAddress === contract)?.name || (state.mode === "new" ? shared.draft.name : void 0),
173
+ links: [{ href: (0, import_sdk.collectionHref)("STARKNET", contract), label: "View collection", icon: import_lucide_react.Eye }],
174
+ reward: "launch_launchpad"
175
+ };
176
+ }
177
+ });
178
+ }
179
+ const TICKETS_FORMAT = makeTierFormat({
180
+ key: "tickets",
181
+ preset: import_tier_mint_presets.TICKETS_TIER_PRESET,
182
+ title: "IP Ticket",
183
+ hint: "Tickets people hold and show at the door",
184
+ icon: import_lucide_react.Ticket,
185
+ noun: "ticket collection",
186
+ supplyLabel: "Number of tickets",
187
+ submitLabel: "Create tickets",
188
+ addLabel: "Minting tickets"
189
+ });
190
+ const CLUB_FORMAT = makeTierFormat({
191
+ key: "club",
192
+ preset: import_tier_mint_presets.CLUB_TIER_PRESET,
193
+ title: "IP Club",
194
+ hint: "Membership cards for your community",
195
+ icon: import_lucide_react.Users,
196
+ noun: "club",
197
+ supplyLabel: "Number of memberships",
198
+ submitLabel: "Create membership",
199
+ addLabel: "Minting memberships"
200
+ });
201
+ // Annotate the CommonJS export names for ESM import in node:
202
+ 0 && (module.exports = {
203
+ CLUB_FORMAT,
204
+ TICKETS_FORMAT
205
+ });
206
+ //# sourceMappingURL=tiers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/fast-mint/formats/tiers.tsx"],"sourcesContent":["\"use client\";\n\nimport { Eye, Ticket, Users } from \"lucide-react\";\nimport { buildCollectionMetadata, collectionHref, getService } from \"@medialane/sdk\";\nimport { deployedCollectionFromReceipt, executeIntent, executeIntents } from \"@medialane/sdk/starknet\";\nimport { Input } from \"../../input.js\";\nimport { pinAssetMetadata, uploadJsonToIpfs } from \"../../../utils/ipfs-upload.js\";\nimport { dateToUnixTimestamp, serviceCollectionIntent, tierIntents, tierTraits } from \"../../../utils/launchpad-actions.js\";\nimport { CLUB_TIER_PRESET, TICKETS_TIER_PRESET, type TierMintPreset } from \"../../launchpad/tier-mint-presets.js\";\nimport { CollectionSection, type CollectionMode } from \"../collection-section.js\";\nimport { LicensingSection } from \"../licensing-section.js\";\nimport { createThenAdd } from \"../create-then-add.js\";\nimport { defineFormat, type FormatFieldsProps, type FormatShared } from \"./types.js\";\n\ninterface TierState {\n mode: CollectionMode;\n existingContract: string;\n supply: string;\n startDate: string;\n endDate: string;\n}\n\nconst SUPPLY_PATTERN = /^[1-9]\\d*$/;\n\nfunction makeTierFormat(config: {\n key: \"tickets\" | \"club\";\n preset: TierMintPreset;\n title: string;\n hint: string;\n icon: typeof Ticket;\n noun: string;\n supplyLabel: string;\n submitLabel: string;\n addLabel: string;\n}) {\n const { preset, noun } = config;\n\n const ownCollections = (shared: FormatShared) =>\n shared.collections.filter((c) => getService(c.service)?.id === preset.service && !!c.contractAddress);\n\n function Fields({ shared, state, update }: FormatFieldsProps<TierState>) {\n return (\n <>\n <CollectionSection\n noun={noun}\n mode={state.mode}\n onModeChange={(mode) => update({ mode })}\n collections={ownCollections(shared)}\n value={state.existingContract}\n onValue={(existingContract) => update({ existingContract })}\n valueOf={(c) => c.contractAddress}\n draft={shared.draft}\n previewImage={shared.previewImage}\n />\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\" htmlFor={`fast-mint-${config.key}-supply`}>{config.supplyLabel} *</label>\n <Input\n id={`fast-mint-${config.key}-supply`}\n type=\"number\"\n min={1}\n value={state.supply}\n onChange={(e) => update({ supply: e.target.value })}\n className=\"max-w-[160px]\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Valid</label>\n <div className=\"grid grid-cols-2 gap-2\">\n <Input type=\"date\" aria-label=\"Valid from\" value={state.startDate} onChange={(e) => update({ startDate: e.target.value })} />\n <Input type=\"date\" aria-label=\"Valid until\" value={state.endDate} onChange={(e) => update({ endDate: e.target.value })} />\n </div>\n <p className=\"text-xs text-muted-foreground\">{preset.copy.validUntilHint}</p>\n </div>\n\n <LicensingSection form={shared.form} />\n </>\n );\n }\n\n return defineFormat<TierState>({\n key: config.key,\n title: config.title,\n hint: config.hint,\n icon: config.icon,\n submitLabel: () => config.submitLabel,\n initial: () => ({ mode: \"existing\", existingContract: \"\", supply: \"100\", startDate: \"\", endDate: \"\" }),\n Fields,\n isReady: (shared, state) => {\n if (!SUPPLY_PATTERN.test(state.supply.trim())) return false;\n if (state.mode === \"new\") return shared.draft.name.trim().length > 0 && shared.draft.symbol.trim().length > 0;\n return state.existingContract !== \"\";\n },\n previewLabel: (shared, state) =>\n state.mode === \"new\"\n ? shared.draft.name || `New ${noun}`\n : ownCollections(shared).find((c) => c.contractAddress === state.existingContract)?.name || undefined,\n submit: async (shared, state, runtime) => {\n const { client, signer, onStep } = runtime;\n const owner = shared.walletAddress;\n const values = shared.form.getValues();\n const supply = state.supply.trim();\n\n const uploadToken = await runtime.getUploadToken();\n if (!uploadToken) throw new Error(\"Sign in first\");\n\n const existing = (runtime.resume as string | null) ?? (state.mode === \"existing\" && state.existingContract ? state.existingContract : null);\n\n const contract = await createThenAdd<string, string>({\n existing,\n noun,\n labels: { create: `Creating the ${noun}`, add: config.addLabel },\n onStep,\n create: async () => {\n const baseUri = await uploadJsonToIpfs(\n client.api,\n buildCollectionMetadata({\n name: shared.draft.name,\n description: shared.draft.description,\n image: shared.image,\n externalLink: values.external_url,\n owner,\n }),\n );\n const created = await serviceCollectionIntent(client.api, {\n owner,\n name: shared.draft.name,\n symbol: shared.draft.symbol,\n baseUri,\n service: preset.service,\n });\n const { receipt } = await executeIntent(signer, client, created);\n const deployed = deployedCollectionFromReceipt(receipt, preset.service);\n if (!deployed) throw new Error(`The ${noun} was deployed, but its address couldn't be read — check My Collections.`);\n return deployed;\n },\n add: async (address) => {\n const pinned = await pinAssetMetadata(client.api, {\n name: values.name,\n description: values.description,\n imageUri: shared.image,\n externalUrl: values.external_url,\n ipType: \"NFT\",\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 creator: owner,\n templateTraits: tierTraits(preset.traitType, supply, address),\n });\n const intents = await tierIntents(client.api, {\n owner,\n contract: address,\n service: preset.service,\n tierId: await preset.predictNextId(client.api, address),\n maxSupply: supply,\n startTime: dateToUnixTimestamp(state.startDate),\n endTime: dateToUnixTimestamp(state.endDate),\n royaltyBps: Math.round(values.royalty * 100),\n metadataUri: pinned.uri,\n });\n await executeIntents(signer, client, intents);\n return address;\n },\n });\n\n return {\n headline: preset.success.title,\n detail: preset.success.description,\n name: values.name,\n collectionLabel: ownCollections(shared).find((c) => c.contractAddress === contract)?.name || (state.mode === \"new\" ? shared.draft.name : undefined),\n links: [{ href: collectionHref(\"STARKNET\", contract), label: \"View collection\", icon: Eye }],\n reward: \"launch_launchpad\",\n };\n },\n });\n}\n\nexport const TICKETS_FORMAT = makeTierFormat({\n key: \"tickets\",\n preset: TICKETS_TIER_PRESET,\n title: \"IP Ticket\",\n hint: \"Tickets people hold and show at the door\",\n icon: Ticket,\n noun: \"ticket collection\",\n supplyLabel: \"Number of tickets\",\n submitLabel: \"Create tickets\",\n addLabel: \"Minting tickets\",\n});\n\nexport const CLUB_FORMAT = makeTierFormat({\n key: \"club\",\n preset: CLUB_TIER_PRESET,\n title: \"IP Club\",\n hint: \"Membership cards for your community\",\n icon: Users,\n noun: \"club\",\n supplyLabel: \"Number of memberships\",\n submitLabel: \"Create membership\",\n addLabel: \"Minting memberships\",\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CM;AAxCN,0BAAmC;AACnC,iBAAoE;AACpE,sBAA6E;AAC7E,mBAAsB;AACtB,yBAAmD;AACnD,+BAAsF;AACtF,+BAA2E;AAC3E,gCAAuD;AACvD,+BAAiC;AACjC,6BAA8B;AAC9B,mBAAwE;AAUxE,MAAM,iBAAiB;AAEvB,SAAS,eAAe,QAUrB;AACD,QAAM,EAAE,QAAQ,KAAK,IAAI;AAEzB,QAAM,iBAAiB,CAAC,WACtB,OAAO,YAAY,OAAO,CAAC,UAAM,uBAAW,EAAE,OAAO,GAAG,OAAO,OAAO,WAAW,CAAC,CAAC,EAAE,eAAe;AAEtG,WAAS,OAAO,EAAE,QAAQ,OAAO,OAAO,GAAiC;AACvE,WACE,4EACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,MAAM,MAAM;AAAA,UACZ,cAAc,CAAC,SAAS,OAAO,EAAE,KAAK,CAAC;AAAA,UACvC,aAAa,eAAe,MAAM;AAAA,UAClC,OAAO,MAAM;AAAA,UACb,SAAS,CAAC,qBAAqB,OAAO,EAAE,iBAAiB,CAAC;AAAA,UAC1D,SAAS,CAAC,MAAM,EAAE;AAAA,UAClB,OAAO,OAAO;AAAA,UACd,cAAc,OAAO;AAAA;AAAA,MACvB;AAAA,MAEA,6CAAC,SAAI,WAAU,aACb;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oBAAoB,QAAQ,GAAG,SAAS,MAAM,SAAS,QAAQ,OAAO,MAAM,OAAO;AAAA,QACzI,OAAO,CAAC,EAAE,UAAM,2BAAe,YAAY,QAAQ,GAAG,OAAO,mBAAmB,MAAM,wBAAI,CAAC;AAAA,QAC3F,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEO,MAAM,iBAAiB,eAAe;AAAA,EAC3C,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AACZ,CAAC;AAEM,MAAM,cAAc,eAAe;AAAA,EACxC,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AACZ,CAAC;","names":[]}
@@ -0,0 +1,19 @@
1
+ import { FormatDefinition } from './types.cjs';
2
+ import 'react';
3
+ import 'lucide-react';
4
+ import 'react-hook-form';
5
+ import '@medialane/sdk';
6
+ import '@medialane/sdk/starknet';
7
+ import '../../../data/ip.cjs';
8
+ import '../../ip-type-fields.cjs';
9
+ import 'react/jsx-runtime';
10
+ import '../form.cjs';
11
+ import '../types.cjs';
12
+ import 'starknet';
13
+ import '../use-new-collection-draft.cjs';
14
+ import '../create-then-add.cjs';
15
+
16
+ declare const TICKETS_FORMAT: FormatDefinition<unknown>;
17
+ declare const CLUB_FORMAT: FormatDefinition<unknown>;
18
+
19
+ export { CLUB_FORMAT, TICKETS_FORMAT };
@@ -0,0 +1,19 @@
1
+ import { FormatDefinition } from './types.js';
2
+ import 'react';
3
+ import 'lucide-react';
4
+ import 'react-hook-form';
5
+ import '@medialane/sdk';
6
+ import '@medialane/sdk/starknet';
7
+ import '../../../data/ip.js';
8
+ import '../../ip-type-fields.js';
9
+ import 'react/jsx-runtime';
10
+ import '../form.js';
11
+ import '../types.js';
12
+ import 'starknet';
13
+ import '../use-new-collection-draft.js';
14
+ import '../create-then-add.js';
15
+
16
+ declare const TICKETS_FORMAT: FormatDefinition<unknown>;
17
+ declare const CLUB_FORMAT: FormatDefinition<unknown>;
18
+
19
+ export { CLUB_FORMAT, TICKETS_FORMAT };
@@ -0,0 +1,181 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Eye, Ticket, Users } from "lucide-react";
4
+ import { buildCollectionMetadata, collectionHref, getService } from "@medialane/sdk";
5
+ import { deployedCollectionFromReceipt, executeIntent, executeIntents } from "@medialane/sdk/starknet";
6
+ import { Input } from "../../input.js";
7
+ import { pinAssetMetadata, uploadJsonToIpfs } from "../../../utils/ipfs-upload.js";
8
+ import { dateToUnixTimestamp, serviceCollectionIntent, tierIntents, tierTraits } from "../../../utils/launchpad-actions.js";
9
+ import { CLUB_TIER_PRESET, TICKETS_TIER_PRESET } from "../../launchpad/tier-mint-presets.js";
10
+ import { CollectionSection } from "../collection-section.js";
11
+ import { LicensingSection } from "../licensing-section.js";
12
+ import { createThenAdd } from "../create-then-add.js";
13
+ import { defineFormat } from "./types.js";
14
+ const SUPPLY_PATTERN = /^[1-9]\d*$/;
15
+ function makeTierFormat(config) {
16
+ const { preset, noun } = config;
17
+ const ownCollections = (shared) => shared.collections.filter((c) => getService(c.service)?.id === preset.service && !!c.contractAddress);
18
+ function Fields({ shared, state, update }) {
19
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
20
+ /* @__PURE__ */ jsx(
21
+ CollectionSection,
22
+ {
23
+ noun,
24
+ mode: state.mode,
25
+ onModeChange: (mode) => update({ mode }),
26
+ collections: ownCollections(shared),
27
+ value: state.existingContract,
28
+ onValue: (existingContract) => update({ existingContract }),
29
+ valueOf: (c) => c.contractAddress,
30
+ draft: shared.draft,
31
+ previewImage: shared.previewImage
32
+ }
33
+ ),
34
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
35
+ /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium", htmlFor: `fast-mint-${config.key}-supply`, children: [
36
+ config.supplyLabel,
37
+ " *"
38
+ ] }),
39
+ /* @__PURE__ */ jsx(
40
+ Input,
41
+ {
42
+ id: `fast-mint-${config.key}-supply`,
43
+ type: "number",
44
+ min: 1,
45
+ value: state.supply,
46
+ onChange: (e) => update({ supply: e.target.value }),
47
+ className: "max-w-[160px]"
48
+ }
49
+ )
50
+ ] }),
51
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
52
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Valid" }),
53
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
54
+ /* @__PURE__ */ jsx(Input, { type: "date", "aria-label": "Valid from", value: state.startDate, onChange: (e) => update({ startDate: e.target.value }) }),
55
+ /* @__PURE__ */ jsx(Input, { type: "date", "aria-label": "Valid until", value: state.endDate, onChange: (e) => update({ endDate: e.target.value }) })
56
+ ] }),
57
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: preset.copy.validUntilHint })
58
+ ] }),
59
+ /* @__PURE__ */ jsx(LicensingSection, { form: shared.form })
60
+ ] });
61
+ }
62
+ return defineFormat({
63
+ key: config.key,
64
+ title: config.title,
65
+ hint: config.hint,
66
+ icon: config.icon,
67
+ submitLabel: () => config.submitLabel,
68
+ initial: () => ({ mode: "existing", existingContract: "", supply: "100", startDate: "", endDate: "" }),
69
+ Fields,
70
+ isReady: (shared, state) => {
71
+ if (!SUPPLY_PATTERN.test(state.supply.trim())) return false;
72
+ if (state.mode === "new") return shared.draft.name.trim().length > 0 && shared.draft.symbol.trim().length > 0;
73
+ return state.existingContract !== "";
74
+ },
75
+ previewLabel: (shared, state) => state.mode === "new" ? shared.draft.name || `New ${noun}` : ownCollections(shared).find((c) => c.contractAddress === state.existingContract)?.name || void 0,
76
+ submit: async (shared, state, runtime) => {
77
+ const { client, signer, onStep } = runtime;
78
+ const owner = shared.walletAddress;
79
+ const values = shared.form.getValues();
80
+ const supply = state.supply.trim();
81
+ const uploadToken = await runtime.getUploadToken();
82
+ if (!uploadToken) throw new Error("Sign in first");
83
+ const existing = runtime.resume ?? (state.mode === "existing" && state.existingContract ? state.existingContract : null);
84
+ const contract = await createThenAdd({
85
+ existing,
86
+ noun,
87
+ labels: { create: `Creating the ${noun}`, add: config.addLabel },
88
+ onStep,
89
+ create: async () => {
90
+ const baseUri = await uploadJsonToIpfs(
91
+ client.api,
92
+ buildCollectionMetadata({
93
+ name: shared.draft.name,
94
+ description: shared.draft.description,
95
+ image: shared.image,
96
+ externalLink: values.external_url,
97
+ owner
98
+ })
99
+ );
100
+ const created = await serviceCollectionIntent(client.api, {
101
+ owner,
102
+ name: shared.draft.name,
103
+ symbol: shared.draft.symbol,
104
+ baseUri,
105
+ service: preset.service
106
+ });
107
+ const { receipt } = await executeIntent(signer, client, created);
108
+ const deployed = deployedCollectionFromReceipt(receipt, preset.service);
109
+ if (!deployed) throw new Error(`The ${noun} was deployed, but its address couldn't be read \u2014 check My Collections.`);
110
+ return deployed;
111
+ },
112
+ add: async (address) => {
113
+ const pinned = await pinAssetMetadata(client.api, {
114
+ name: values.name,
115
+ description: values.description,
116
+ imageUri: shared.image,
117
+ externalUrl: values.external_url,
118
+ ipType: "NFT",
119
+ licenseType: values.licenseType,
120
+ commercialUse: values.commercialUse,
121
+ derivatives: values.derivatives,
122
+ attribution: values.attribution,
123
+ geographicScope: values.geographicScope,
124
+ aiPolicy: values.aiPolicy,
125
+ royalty: String(values.royalty),
126
+ creator: owner,
127
+ templateTraits: tierTraits(preset.traitType, supply, address)
128
+ });
129
+ const intents = await tierIntents(client.api, {
130
+ owner,
131
+ contract: address,
132
+ service: preset.service,
133
+ tierId: await preset.predictNextId(client.api, address),
134
+ maxSupply: supply,
135
+ startTime: dateToUnixTimestamp(state.startDate),
136
+ endTime: dateToUnixTimestamp(state.endDate),
137
+ royaltyBps: Math.round(values.royalty * 100),
138
+ metadataUri: pinned.uri
139
+ });
140
+ await executeIntents(signer, client, intents);
141
+ return address;
142
+ }
143
+ });
144
+ return {
145
+ headline: preset.success.title,
146
+ detail: preset.success.description,
147
+ name: values.name,
148
+ collectionLabel: ownCollections(shared).find((c) => c.contractAddress === contract)?.name || (state.mode === "new" ? shared.draft.name : void 0),
149
+ links: [{ href: collectionHref("STARKNET", contract), label: "View collection", icon: Eye }],
150
+ reward: "launch_launchpad"
151
+ };
152
+ }
153
+ });
154
+ }
155
+ const TICKETS_FORMAT = makeTierFormat({
156
+ key: "tickets",
157
+ preset: TICKETS_TIER_PRESET,
158
+ title: "IP Ticket",
159
+ hint: "Tickets people hold and show at the door",
160
+ icon: Ticket,
161
+ noun: "ticket collection",
162
+ supplyLabel: "Number of tickets",
163
+ submitLabel: "Create tickets",
164
+ addLabel: "Minting tickets"
165
+ });
166
+ const CLUB_FORMAT = makeTierFormat({
167
+ key: "club",
168
+ preset: CLUB_TIER_PRESET,
169
+ title: "IP Club",
170
+ hint: "Membership cards for your community",
171
+ icon: Users,
172
+ noun: "club",
173
+ supplyLabel: "Number of memberships",
174
+ submitLabel: "Create membership",
175
+ addLabel: "Minting memberships"
176
+ });
177
+ export {
178
+ CLUB_FORMAT,
179
+ TICKETS_FORMAT
180
+ };
181
+ //# sourceMappingURL=tiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/fast-mint/formats/tiers.tsx"],"sourcesContent":["\"use client\";\n\nimport { Eye, Ticket, Users } from \"lucide-react\";\nimport { buildCollectionMetadata, collectionHref, getService } from \"@medialane/sdk\";\nimport { deployedCollectionFromReceipt, executeIntent, executeIntents } from \"@medialane/sdk/starknet\";\nimport { Input } from \"../../input.js\";\nimport { pinAssetMetadata, uploadJsonToIpfs } from \"../../../utils/ipfs-upload.js\";\nimport { dateToUnixTimestamp, serviceCollectionIntent, tierIntents, tierTraits } from \"../../../utils/launchpad-actions.js\";\nimport { CLUB_TIER_PRESET, TICKETS_TIER_PRESET, type TierMintPreset } from \"../../launchpad/tier-mint-presets.js\";\nimport { CollectionSection, type CollectionMode } from \"../collection-section.js\";\nimport { LicensingSection } from \"../licensing-section.js\";\nimport { createThenAdd } from \"../create-then-add.js\";\nimport { defineFormat, type FormatFieldsProps, type FormatShared } from \"./types.js\";\n\ninterface TierState {\n mode: CollectionMode;\n existingContract: string;\n supply: string;\n startDate: string;\n endDate: string;\n}\n\nconst SUPPLY_PATTERN = /^[1-9]\\d*$/;\n\nfunction makeTierFormat(config: {\n key: \"tickets\" | \"club\";\n preset: TierMintPreset;\n title: string;\n hint: string;\n icon: typeof Ticket;\n noun: string;\n supplyLabel: string;\n submitLabel: string;\n addLabel: string;\n}) {\n const { preset, noun } = config;\n\n const ownCollections = (shared: FormatShared) =>\n shared.collections.filter((c) => getService(c.service)?.id === preset.service && !!c.contractAddress);\n\n function Fields({ shared, state, update }: FormatFieldsProps<TierState>) {\n return (\n <>\n <CollectionSection\n noun={noun}\n mode={state.mode}\n onModeChange={(mode) => update({ mode })}\n collections={ownCollections(shared)}\n value={state.existingContract}\n onValue={(existingContract) => update({ existingContract })}\n valueOf={(c) => c.contractAddress}\n draft={shared.draft}\n previewImage={shared.previewImage}\n />\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\" htmlFor={`fast-mint-${config.key}-supply`}>{config.supplyLabel} *</label>\n <Input\n id={`fast-mint-${config.key}-supply`}\n type=\"number\"\n min={1}\n value={state.supply}\n onChange={(e) => update({ supply: e.target.value })}\n className=\"max-w-[160px]\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Valid</label>\n <div className=\"grid grid-cols-2 gap-2\">\n <Input type=\"date\" aria-label=\"Valid from\" value={state.startDate} onChange={(e) => update({ startDate: e.target.value })} />\n <Input type=\"date\" aria-label=\"Valid until\" value={state.endDate} onChange={(e) => update({ endDate: e.target.value })} />\n </div>\n <p className=\"text-xs text-muted-foreground\">{preset.copy.validUntilHint}</p>\n </div>\n\n <LicensingSection form={shared.form} />\n </>\n );\n }\n\n return defineFormat<TierState>({\n key: config.key,\n title: config.title,\n hint: config.hint,\n icon: config.icon,\n submitLabel: () => config.submitLabel,\n initial: () => ({ mode: \"existing\", existingContract: \"\", supply: \"100\", startDate: \"\", endDate: \"\" }),\n Fields,\n isReady: (shared, state) => {\n if (!SUPPLY_PATTERN.test(state.supply.trim())) return false;\n if (state.mode === \"new\") return shared.draft.name.trim().length > 0 && shared.draft.symbol.trim().length > 0;\n return state.existingContract !== \"\";\n },\n previewLabel: (shared, state) =>\n state.mode === \"new\"\n ? shared.draft.name || `New ${noun}`\n : ownCollections(shared).find((c) => c.contractAddress === state.existingContract)?.name || undefined,\n submit: async (shared, state, runtime) => {\n const { client, signer, onStep } = runtime;\n const owner = shared.walletAddress;\n const values = shared.form.getValues();\n const supply = state.supply.trim();\n\n const uploadToken = await runtime.getUploadToken();\n if (!uploadToken) throw new Error(\"Sign in first\");\n\n const existing = (runtime.resume as string | null) ?? (state.mode === \"existing\" && state.existingContract ? state.existingContract : null);\n\n const contract = await createThenAdd<string, string>({\n existing,\n noun,\n labels: { create: `Creating the ${noun}`, add: config.addLabel },\n onStep,\n create: async () => {\n const baseUri = await uploadJsonToIpfs(\n client.api,\n buildCollectionMetadata({\n name: shared.draft.name,\n description: shared.draft.description,\n image: shared.image,\n externalLink: values.external_url,\n owner,\n }),\n );\n const created = await serviceCollectionIntent(client.api, {\n owner,\n name: shared.draft.name,\n symbol: shared.draft.symbol,\n baseUri,\n service: preset.service,\n });\n const { receipt } = await executeIntent(signer, client, created);\n const deployed = deployedCollectionFromReceipt(receipt, preset.service);\n if (!deployed) throw new Error(`The ${noun} was deployed, but its address couldn't be read — check My Collections.`);\n return deployed;\n },\n add: async (address) => {\n const pinned = await pinAssetMetadata(client.api, {\n name: values.name,\n description: values.description,\n imageUri: shared.image,\n externalUrl: values.external_url,\n ipType: \"NFT\",\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 creator: owner,\n templateTraits: tierTraits(preset.traitType, supply, address),\n });\n const intents = await tierIntents(client.api, {\n owner,\n contract: address,\n service: preset.service,\n tierId: await preset.predictNextId(client.api, address),\n maxSupply: supply,\n startTime: dateToUnixTimestamp(state.startDate),\n endTime: dateToUnixTimestamp(state.endDate),\n royaltyBps: Math.round(values.royalty * 100),\n metadataUri: pinned.uri,\n });\n await executeIntents(signer, client, intents);\n return address;\n },\n });\n\n return {\n headline: preset.success.title,\n detail: preset.success.description,\n name: values.name,\n collectionLabel: ownCollections(shared).find((c) => c.contractAddress === contract)?.name || (state.mode === \"new\" ? shared.draft.name : undefined),\n links: [{ href: collectionHref(\"STARKNET\", contract), label: \"View collection\", icon: Eye }],\n reward: \"launch_launchpad\",\n };\n },\n });\n}\n\nexport const TICKETS_FORMAT = makeTierFormat({\n key: \"tickets\",\n preset: TICKETS_TIER_PRESET,\n title: \"IP Ticket\",\n hint: \"Tickets people hold and show at the door\",\n icon: Ticket,\n noun: \"ticket collection\",\n supplyLabel: \"Number of tickets\",\n submitLabel: \"Create tickets\",\n addLabel: \"Minting tickets\",\n});\n\nexport const CLUB_FORMAT = makeTierFormat({\n key: \"club\",\n preset: CLUB_TIER_PRESET,\n title: \"IP Club\",\n hint: \"Membership cards for your community\",\n icon: Users,\n noun: \"club\",\n supplyLabel: \"Number of memberships\",\n submitLabel: \"Create membership\",\n addLabel: \"Minting memberships\",\n});\n"],"mappings":";AA0CM,mBACE,KAaE,YAdJ;AAxCN,SAAS,KAAK,QAAQ,aAAa;AACnC,SAAS,yBAAyB,gBAAgB,kBAAkB;AACpE,SAAS,+BAA+B,eAAe,sBAAsB;AAC7E,SAAS,aAAa;AACtB,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,qBAAqB,yBAAyB,aAAa,kBAAkB;AACtF,SAAS,kBAAkB,2B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M;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AACZ,CAAC;","names":[]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var types_exports = {};
20
+ __export(types_exports, {
21
+ defineFormat: () => defineFormat
22
+ });
23
+ module.exports = __toCommonJS(types_exports);
24
+ function defineFormat(format) {
25
+ return format;
26
+ }
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ defineFormat
30
+ });
31
+ //# sourceMappingURL=types.cjs.map
@@ -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":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEO,SAAS,aAAgB,QAA+C;AAC7E,SAAO;AACT;","names":[]}
@@ -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.cjs';
7
+ import { MetadataField } from '../../ip-type-fields.cjs';
8
+ import { FormValues } from '../form.cjs';
9
+ import { MintedAsset, MediaKind, FastMintSigner } from '../types.cjs';
10
+ import { useNewCollectionDraft } from '../use-new-collection-draft.cjs';
11
+ import { StepInfo } from '../create-then-add.cjs';
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 };