@medialane/ui 0.397.0 → 0.398.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/account/add-guardian-dialog.cjs +3 -2
- package/dist/components/account/add-guardian-dialog.cjs.map +1 -1
- package/dist/components/account/add-guardian-dialog.js +3 -2
- package/dist/components/account/add-guardian-dialog.js.map +1 -1
- package/dist/components/alert.d.cts +1 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/approve-mint-dialog.cjs +7 -7
- package/dist/components/approve-mint-dialog.cjs.map +1 -1
- package/dist/components/approve-mint-dialog.js +7 -7
- package/dist/components/approve-mint-dialog.js.map +1 -1
- package/dist/components/asset-picker.cjs +5 -5
- package/dist/components/asset-picker.cjs.map +1 -1
- package/dist/components/asset-picker.js +5 -5
- package/dist/components/asset-picker.js.map +1 -1
- package/dist/components/asset-search-picker.cjs +1 -1
- package/dist/components/asset-search-picker.cjs.map +1 -1
- package/dist/components/asset-search-picker.js +1 -1
- package/dist/components/asset-search-picker.js.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/coin-launch-preview.cjs +1 -1
- package/dist/components/coin-launch-preview.cjs.map +1 -1
- package/dist/components/coin-launch-preview.js +1 -1
- package/dist/components/coin-launch-preview.js.map +1 -1
- package/dist/components/create-aside.cjs +140 -0
- package/dist/components/create-aside.cjs.map +1 -0
- package/dist/components/create-aside.d.cts +101 -0
- package/dist/components/create-aside.d.ts +101 -0
- package/dist/components/create-aside.js +133 -0
- package/dist/components/create-aside.js.map +1 -0
- package/dist/components/create-sponsorship-aside.cjs +1 -1
- package/dist/components/create-sponsorship-aside.cjs.map +1 -1
- package/dist/components/create-sponsorship-aside.js +1 -1
- package/dist/components/create-sponsorship-aside.js.map +1 -1
- package/dist/components/drop/create/asset-editor.cjs +38 -33
- package/dist/components/drop/create/asset-editor.cjs.map +1 -1
- package/dist/components/drop/create/asset-editor.js +39 -34
- package/dist/components/drop/create/asset-editor.js.map +1 -1
- package/dist/components/drop/create/assets-panel.cjs +9 -9
- package/dist/components/drop/create/assets-panel.cjs.map +1 -1
- package/dist/components/drop/create/assets-panel.js +9 -9
- package/dist/components/drop/create/assets-panel.js.map +1 -1
- package/dist/components/drop/create/collection-panel.cjs +20 -8
- package/dist/components/drop/create/collection-panel.cjs.map +1 -1
- package/dist/components/drop/create/collection-panel.js +21 -9
- package/dist/components/drop/create/collection-panel.js.map +1 -1
- package/dist/components/drop/create/drop-create.cjs +2 -2
- package/dist/components/drop/create/drop-create.cjs.map +1 -1
- package/dist/components/drop/create/drop-create.js +2 -2
- package/dist/components/drop/create/drop-create.js.map +1 -1
- package/dist/components/drop/create/drop-fields.cjs +4 -5
- package/dist/components/drop/create/drop-fields.cjs.map +1 -1
- package/dist/components/drop/create/drop-fields.js +4 -5
- package/dist/components/drop/create/drop-fields.js.map +1 -1
- package/dist/components/drop/create/launch-dialog.cjs +1 -1
- package/dist/components/drop/create/launch-dialog.cjs.map +1 -1
- package/dist/components/drop/create/launch-dialog.js +1 -1
- package/dist/components/drop/create/launch-dialog.js.map +1 -1
- package/dist/components/drop/create/settings-panel.cjs +1 -1
- package/dist/components/drop/create/settings-panel.cjs.map +1 -1
- package/dist/components/drop/create/settings-panel.js +1 -1
- package/dist/components/drop/create/settings-panel.js.map +1 -1
- package/dist/components/external-link-field.cjs +1 -2
- package/dist/components/external-link-field.cjs.map +1 -1
- package/dist/components/external-link-field.js +2 -3
- package/dist/components/external-link-field.js.map +1 -1
- package/dist/components/fast-mint/asset-form-parts.d.cts +2 -0
- package/dist/components/fast-mint/asset-form-parts.d.ts +2 -0
- package/dist/components/fast-mint/collection-section.cjs +8 -9
- package/dist/components/fast-mint/collection-section.cjs.map +1 -1
- package/dist/components/fast-mint/collection-section.d.cts +2 -2
- package/dist/components/fast-mint/collection-section.d.ts +2 -2
- package/dist/components/fast-mint/collection-section.js +8 -9
- package/dist/components/fast-mint/collection-section.js.map +1 -1
- package/dist/components/fast-mint/create-then-add.cjs +4 -5
- package/dist/components/fast-mint/create-then-add.cjs.map +1 -1
- package/dist/components/fast-mint/create-then-add.d.cts +2 -3
- package/dist/components/fast-mint/create-then-add.d.ts +2 -3
- package/dist/components/fast-mint/create-then-add.js +4 -5
- package/dist/components/fast-mint/create-then-add.js.map +1 -1
- package/dist/components/fast-mint/dropzone.cjs +8 -1
- package/dist/components/fast-mint/dropzone.cjs.map +1 -1
- package/dist/components/fast-mint/dropzone.js +8 -1
- package/dist/components/fast-mint/dropzone.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +25 -16
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +25 -16
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/formats/nft.cjs +12 -12
- package/dist/components/fast-mint/formats/nft.cjs.map +1 -1
- package/dist/components/fast-mint/formats/nft.d.cts +2 -0
- package/dist/components/fast-mint/formats/nft.d.ts +2 -0
- package/dist/components/fast-mint/formats/nft.js +12 -12
- package/dist/components/fast-mint/formats/nft.js.map +1 -1
- package/dist/components/fast-mint/formats/pop.cjs +4 -4
- package/dist/components/fast-mint/formats/pop.cjs.map +1 -1
- package/dist/components/fast-mint/formats/pop.d.cts +2 -0
- package/dist/components/fast-mint/formats/pop.d.ts +2 -0
- package/dist/components/fast-mint/formats/pop.js +4 -4
- package/dist/components/fast-mint/formats/pop.js.map +1 -1
- package/dist/components/fast-mint/formats/registry.d.cts +2 -0
- package/dist/components/fast-mint/formats/registry.d.ts +2 -0
- package/dist/components/fast-mint/formats/tiers.cjs +25 -16
- package/dist/components/fast-mint/formats/tiers.cjs.map +1 -1
- package/dist/components/fast-mint/formats/tiers.d.cts +2 -0
- package/dist/components/fast-mint/formats/tiers.d.ts +2 -0
- package/dist/components/fast-mint/formats/tiers.js +25 -16
- package/dist/components/fast-mint/formats/tiers.js.map +1 -1
- package/dist/components/fast-mint/formats/types.cjs.map +1 -1
- package/dist/components/fast-mint/formats/types.d.cts +3 -1
- package/dist/components/fast-mint/formats/types.d.ts +3 -1
- package/dist/components/fast-mint/formats/types.js.map +1 -1
- package/dist/components/fast-mint/ip-type-section.cjs +2 -2
- package/dist/components/fast-mint/ip-type-section.cjs.map +1 -1
- package/dist/components/fast-mint/ip-type-section.js +2 -2
- package/dist/components/fast-mint/ip-type-section.js.map +1 -1
- package/dist/components/fast-mint/success-view.d.cts +2 -0
- package/dist/components/fast-mint/success-view.d.ts +2 -0
- package/dist/components/image-upload-field.cjs +2 -3
- package/dist/components/image-upload-field.cjs.map +1 -1
- package/dist/components/image-upload-field.d.cts +2 -2
- package/dist/components/image-upload-field.d.ts +2 -2
- package/dist/components/image-upload-field.js +2 -3
- package/dist/components/image-upload-field.js.map +1 -1
- package/dist/components/ip-type-fields.cjs +7 -6
- package/dist/components/ip-type-fields.cjs.map +1 -1
- package/dist/components/ip-type-fields.js +7 -6
- package/dist/components/ip-type-fields.js.map +1 -1
- package/dist/components/launchpad/coin-create.cjs +2 -2
- package/dist/components/launchpad/coin-create.cjs.map +1 -1
- package/dist/components/launchpad/coin-create.js +2 -2
- package/dist/components/launchpad/coin-create.js.map +1 -1
- package/dist/components/launchpad/collection-create-form.cjs +11 -12
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +11 -12
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs +31 -37
- package/dist/components/launchpad/collection-create-presets.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-presets.d.cts +0 -3
- package/dist/components/launchpad/collection-create-presets.d.ts +0 -3
- package/dist/components/launchpad/collection-create-presets.js +31 -37
- package/dist/components/launchpad/collection-create-presets.js.map +1 -1
- package/dist/components/launchpad/edition-mint-fields.cjs +13 -22
- package/dist/components/launchpad/edition-mint-fields.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint-fields.d.cts +1 -0
- package/dist/components/launchpad/edition-mint-fields.d.ts +1 -0
- package/dist/components/launchpad/edition-mint-fields.js +14 -23
- package/dist/components/launchpad/edition-mint-fields.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.cjs +5 -4
- package/dist/components/launchpad/edition-mint-schema.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.js +5 -4
- package/dist/components/launchpad/edition-mint-schema.js.map +1 -1
- package/dist/components/launchpad/edition-mint.cjs +16 -14
- package/dist/components/launchpad/edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint.js +16 -14
- package/dist/components/launchpad/edition-mint.js.map +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs +34 -39
- package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-fields.d.cts +1 -0
- package/dist/components/launchpad/pop-create-fields.d.ts +1 -0
- package/dist/components/launchpad/pop-create-fields.js +34 -39
- package/dist/components/launchpad/pop-create-fields.js.map +1 -1
- package/dist/components/launchpad/pop-create-schema.cjs +2 -2
- package/dist/components/launchpad/pop-create-schema.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-schema.js +2 -2
- package/dist/components/launchpad/pop-create-schema.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs +4 -4
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js +4 -4
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad/remix-mint.cjs +32 -26
- package/dist/components/launchpad/remix-mint.cjs.map +1 -1
- package/dist/components/launchpad/remix-mint.js +32 -26
- package/dist/components/launchpad/remix-mint.js.map +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs +27 -24
- package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/single-edition-mint.js +27 -24
- package/dist/components/launchpad/single-edition-mint.js.map +1 -1
- package/dist/components/launchpad/sponsorship-create.cjs +17 -16
- package/dist/components/launchpad/sponsorship-create.cjs.map +1 -1
- package/dist/components/launchpad/sponsorship-create.js +17 -16
- package/dist/components/launchpad/sponsorship-create.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +8 -16
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +8 -16
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.cjs +21 -17
- package/dist/components/launchpad/tier-mint-presets.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.d.cts +2 -0
- package/dist/components/launchpad/tier-mint-presets.d.ts +2 -0
- package/dist/components/launchpad/tier-mint-presets.js +21 -17
- package/dist/components/launchpad/tier-mint-presets.js.map +1 -1
- package/dist/components/license-terms-builder.cjs +4 -4
- package/dist/components/license-terms-builder.cjs.map +1 -1
- package/dist/components/license-terms-builder.js +4 -4
- package/dist/components/license-terms-builder.js.map +1 -1
- package/dist/components/medialane-collection-card.cjs +1 -1
- package/dist/components/medialane-collection-card.cjs.map +1 -1
- package/dist/components/medialane-collection-card.js +1 -1
- package/dist/components/medialane-collection-card.js.map +1 -1
- package/dist/components/report-dialog.cjs +3 -3
- package/dist/components/report-dialog.cjs.map +1 -1
- package/dist/components/report-dialog.js +3 -3
- package/dist/components/report-dialog.js.map +1 -1
- package/dist/components/transaction-dialog.cjs +2 -2
- package/dist/components/transaction-dialog.cjs.map +1 -1
- package/dist/components/transaction-dialog.js +2 -2
- package/dist/components/transaction-dialog.js.map +1 -1
- package/dist/components/transfer-dialog.cjs +2 -1
- package/dist/components/transfer-dialog.cjs.map +1 -1
- package/dist/components/transfer-dialog.js +2 -1
- package/dist/components/transfer-dialog.js.map +1 -1
- package/dist/components/wallet/export-key-section.cjs +3 -2
- package/dist/components/wallet/export-key-section.cjs.map +1 -1
- package/dist/components/wallet/export-key-section.js +3 -2
- package/dist/components/wallet/export-key-section.js.map +1 -1
- package/dist/data/ip-templates.cjs +3 -3
- package/dist/data/ip-templates.cjs.map +1 -1
- package/dist/data/ip-templates.js +3 -3
- package/dist/data/ip-templates.js.map +1 -1
- package/dist/data/launchpad-services.cjs +21 -21
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.js +21 -21
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/data/nav-commands.cjs +5 -5
- package/dist/data/nav-commands.cjs.map +1 -1
- package/dist/data/nav-commands.js +5 -5
- package/dist/data/nav-commands.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +276 -200
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +276 -200
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/i18n/tools/scan.cjs +47 -2
- package/dist/i18n/tools/scan.cjs.map +1 -1
- package/dist/i18n/tools/scan.d.cts +6 -1
- package/dist/i18n/tools/scan.d.ts +6 -1
- package/dist/i18n/tools/scan.js +45 -1
- package/dist/i18n/tools/scan.js.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/drop/draft.cjs +3 -3
- package/dist/utils/drop/draft.cjs.map +1 -1
- package/dist/utils/drop/draft.js +3 -3
- package/dist/utils/drop/draft.js.map +1 -1
- package/dist/utils/ipfs-upload.cjs +10 -1
- package/dist/utils/ipfs-upload.cjs.map +1 -1
- package/dist/utils/ipfs-upload.d.cts +2 -1
- package/dist/utils/ipfs-upload.d.ts +2 -1
- package/dist/utils/ipfs-upload.js +10 -2
- package/dist/utils/ipfs-upload.js.map +1 -1
- package/dist/utils/launchpad-rules.cjs +4 -3
- package/dist/utils/launchpad-rules.cjs.map +1 -1
- package/dist/utils/launchpad-rules.d.cts +1 -1
- package/dist/utils/launchpad-rules.d.ts +1 -1
- package/dist/utils/launchpad-rules.js +4 -3
- package/dist/utils/launchpad-rules.js.map +1 -1
- package/dist/utils/order-form.cjs +3 -2
- package/dist/utils/order-form.cjs.map +1 -1
- package/dist/utils/order-form.js +3 -2
- package/dist/utils/order-form.js.map +1 -1
- package/dist/utils/upload-limits.cjs +10 -4
- package/dist/utils/upload-limits.cjs.map +1 -1
- package/dist/utils/upload-limits.d.cts +2 -1
- package/dist/utils/upload-limits.d.ts +2 -1
- package/dist/utils/upload-limits.js +11 -5
- package/dist/utils/upload-limits.js.map +1 -1
- package/dist/utils/use-file-upload.cjs +1 -1
- package/dist/utils/use-file-upload.cjs.map +1 -1
- package/dist/utils/use-file-upload.d.cts +2 -1
- package/dist/utils/use-file-upload.d.ts +2 -1
- package/dist/utils/use-file-upload.js +1 -1
- package/dist/utils/use-file-upload.js.map +1 -1
- package/dist/utils/use-image-upload.d.cts +1 -0
- package/dist/utils/use-image-upload.d.ts +1 -0
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ var import_types = require("./types.js");
|
|
|
40
40
|
var import_provider = require("../../../i18n/provider.js");
|
|
41
41
|
var import_translate = require("../../../i18n/translate.js");
|
|
42
42
|
function makeTierFormat(config) {
|
|
43
|
-
const { preset,
|
|
43
|
+
const { preset, text } = config;
|
|
44
44
|
const copy = (0, import_launchpad_services.getMintFormatCopy)(config.service);
|
|
45
45
|
const ownCollections = (shared) => shared.collections.filter((c) => (0, import_sdk.getService)(c.service)?.id === preset.service && !!c.contractAddress);
|
|
46
46
|
function Fields({ shared, state, update }) {
|
|
@@ -49,7 +49,7 @@ function makeTierFormat(config) {
|
|
|
49
49
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
50
|
import_collection_section.CollectionSection,
|
|
51
51
|
{
|
|
52
|
-
|
|
52
|
+
label: text.collectionLabel,
|
|
53
53
|
mode: state.mode,
|
|
54
54
|
onModeChange: (mode) => update({ mode }),
|
|
55
55
|
collections: ownCollections(shared),
|
|
@@ -61,10 +61,7 @@ function makeTierFormat(config) {
|
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
64
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
65
|
-
t(config.supplyLabel),
|
|
66
|
-
" *"
|
|
67
|
-
] }),
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", htmlFor: `fast-mint-${config.key}-supply`, children: t(config.supplyLabel) }),
|
|
68
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
66
|
import_input.Input,
|
|
70
67
|
{
|
|
@@ -83,7 +80,7 @@ function makeTierFormat(config) {
|
|
|
83
80
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "date", "aria-label": t("Valid from"), value: state.startDate, onChange: (e) => update({ startDate: e.target.value }) }),
|
|
84
81
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "date", "aria-label": t("Valid until"), value: state.endDate, onChange: (e) => update({ endDate: e.target.value }) })
|
|
85
82
|
] }),
|
|
86
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: preset.copy.validUntilHint })
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: t(preset.copy.validUntilHint) })
|
|
87
84
|
] }),
|
|
88
85
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_licensing_section.LicensingSection, { form: shared.form })
|
|
89
86
|
] });
|
|
@@ -101,19 +98,19 @@ function makeTierFormat(config) {
|
|
|
101
98
|
if (state.mode === "new") return shared.draft.name.trim().length > 0 && shared.draft.symbol.trim().length > 0;
|
|
102
99
|
return state.existingContract !== "";
|
|
103
100
|
},
|
|
104
|
-
previewLabel: (shared, state) => state.mode === "new" ? shared.draft.name ||
|
|
101
|
+
previewLabel: (shared, state, t) => state.mode === "new" ? shared.draft.name || t(text.newCollection) : ownCollections(shared).find((c) => c.contractAddress === state.existingContract)?.name || void 0,
|
|
105
102
|
submit: async (shared, state, runtime) => {
|
|
106
103
|
const { client, signer, onStep } = runtime;
|
|
107
104
|
const owner = shared.walletAddress;
|
|
108
105
|
const values = shared.form.getValues();
|
|
109
106
|
const supply = state.supply.trim();
|
|
110
107
|
const uploadToken = await runtime.getUploadToken();
|
|
111
|
-
if (!uploadToken) throw new Error("Sign in first");
|
|
108
|
+
if (!uploadToken) throw new Error((0, import_translate.msg)("Sign in first"));
|
|
112
109
|
const existing = runtime.resume ?? (state.mode === "existing" && state.existingContract ? state.existingContract : null);
|
|
113
110
|
const contract = await (0, import_create_then_add.createThenAdd)({
|
|
114
111
|
existing,
|
|
115
|
-
|
|
116
|
-
labels: { create:
|
|
112
|
+
unfinished: text.unfinished,
|
|
113
|
+
labels: { create: text.creating, add: text.adding },
|
|
117
114
|
onStep,
|
|
118
115
|
create: async () => {
|
|
119
116
|
const baseUri = await (0, import_ipfs_upload.uploadJsonToIpfs)(
|
|
@@ -135,7 +132,7 @@ function makeTierFormat(config) {
|
|
|
135
132
|
});
|
|
136
133
|
const { receipt } = await (0, import_starknet.executeIntent)(signer, client, created);
|
|
137
134
|
const deployed = (0, import_starknet.deployedCollectionFromReceipt)(receipt, preset.service);
|
|
138
|
-
if (!deployed) throw new Error(
|
|
135
|
+
if (!deployed) throw new Error(text.unreadable);
|
|
139
136
|
return deployed;
|
|
140
137
|
},
|
|
141
138
|
add: async (address) => {
|
|
@@ -186,20 +183,32 @@ const TICKETS_FORMAT = makeTierFormat({
|
|
|
186
183
|
preset: import_tier_mint_presets.TICKETS_TIER_PRESET,
|
|
187
184
|
service: "ip-tickets",
|
|
188
185
|
icon: import_lucide_react.Ticket,
|
|
189
|
-
noun: "ticket collection",
|
|
190
186
|
supplyLabel: (0, import_translate.msg)("Number of tickets"),
|
|
191
187
|
submitLabel: (0, import_translate.msg)("Create tickets"),
|
|
192
|
-
|
|
188
|
+
text: {
|
|
189
|
+
collectionLabel: (0, import_translate.msg)("Ticket collection"),
|
|
190
|
+
newCollection: (0, import_translate.msg)("New ticket collection"),
|
|
191
|
+
creating: (0, import_translate.msg)("Creating the ticket collection"),
|
|
192
|
+
adding: (0, import_translate.msg)("Publishing tickets"),
|
|
193
|
+
unfinished: (0, import_translate.msg)("Your ticket collection was created, but the last step did not finish."),
|
|
194
|
+
unreadable: (0, import_translate.msg)("The ticket collection was created, but its address couldn't be read \u2014 check My Collections.")
|
|
195
|
+
}
|
|
193
196
|
});
|
|
194
197
|
const CLUB_FORMAT = makeTierFormat({
|
|
195
198
|
key: "club",
|
|
196
199
|
preset: import_tier_mint_presets.CLUB_TIER_PRESET,
|
|
197
200
|
service: "ip-club",
|
|
198
201
|
icon: import_lucide_react.Users,
|
|
199
|
-
noun: "club",
|
|
200
202
|
supplyLabel: (0, import_translate.msg)("Number of memberships"),
|
|
201
203
|
submitLabel: (0, import_translate.msg)("Create membership"),
|
|
202
|
-
|
|
204
|
+
text: {
|
|
205
|
+
collectionLabel: (0, import_translate.msg)("Club"),
|
|
206
|
+
newCollection: (0, import_translate.msg)("New club"),
|
|
207
|
+
creating: (0, import_translate.msg)("Creating the club"),
|
|
208
|
+
adding: (0, import_translate.msg)("Publishing memberships"),
|
|
209
|
+
unfinished: (0, import_translate.msg)("Your club was created, but the last step did not finish."),
|
|
210
|
+
unreadable: (0, import_translate.msg)("The club was created, but its address couldn't be read \u2014 check My Collections.")
|
|
211
|
+
}
|
|
203
212
|
});
|
|
204
213
|
// Annotate the CommonJS export names for ESM import in node:
|
|
205
214
|
0 && (module.exports = {
|
|
@@ -1 +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 { getMintFormatCopy } from \"../../../data/launchpad-services.js\";\nimport { pinAssetMetadata, uploadJsonToIpfs } from \"../../../utils/ipfs-upload.js\";\nimport { isPositiveInteger } from \"../../../utils/launchpad-rules.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\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { msg } from \"../../../i18n/translate.js\";\n\ninterface TierState {\n mode: CollectionMode;\n existingContract: string;\n supply: string;\n startDate: string;\n endDate: string;\n}\n\nfunction makeTierFormat(config: {\n key: \"tickets\" | \"club\";\n service: string;\n preset: TierMintPreset;\n icon: typeof Ticket;\n noun: string;\n supplyLabel: string;\n submitLabel: string;\n addLabel: string;\n}) {\n const { preset, noun } = config;\n const copy = getMintFormatCopy(config.service);\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 const t = useT();\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`}>{t(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\">{t(\"Valid\")}</label>\n <div className=\"grid grid-cols-2 gap-2\">\n <Input type=\"date\" aria-label={t(\"Valid from\")} value={state.startDate} onChange={(e) => update({ startDate: e.target.value })} />\n <Input type=\"date\" aria-label={t(\"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: copy.name,\n hint: copy.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 (!isPositiveInteger(state.supply)) 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: msg(\"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 service: \"ip-tickets\",\n icon: Ticket,\n noun: \"ticket collection\",\n supplyLabel: msg(\"Number of tickets\"),\n submitLabel: msg(\"Create tickets\"),\n addLabel: msg(\"Minting tickets\"),\n});\n\nexport const CLUB_FORMAT = makeTierFormat({\n key: \"club\",\n preset: CLUB_TIER_PRESET,\n service: \"ip-club\",\n icon: Users,\n noun: \"club\",\n supplyLabel: msg(\"Number of memberships\"),\n submitLabel: msg(\"Create membership\"),\n addLabel: msg(\"Min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AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEO,MAAM,iBAAiB,eAAe;AAAA,EAC3C,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,iBAAa,sBAAI,mBAAmB;AAAA,EACpC,iBAAa,sBAAI,gBAAgB;AAAA,EACjC,cAAU,sBAAI,iBAAiB;AACjC,CAAC;AAEM,MAAM,cAAc,eAAe;AAAA,EACxC,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,iBAAa,sBAAI,uBAAuB;AAAA,EACxC,iBAAa,sBAAI,mBAAmB;AAAA,EACpC,cAAU,sBAAI,qBAAqB;AACrC,CAAC;","names":[]}
|
|
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 { getMintFormatCopy } from \"../../../data/launchpad-services.js\";\nimport { pinAssetMetadata, uploadJsonToIpfs } from \"../../../utils/ipfs-upload.js\";\nimport { isPositiveInteger } from \"../../../utils/launchpad-rules.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\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { msg } from \"../../../i18n/translate.js\";\n\ninterface TierState {\n mode: CollectionMode;\n existingContract: string;\n supply: string;\n startDate: string;\n endDate: string;\n}\n\ninterface TierText {\n collectionLabel: string;\n newCollection: string;\n creating: string;\n adding: string;\n unfinished: string;\n unreadable: string;\n}\n\nfunction makeTierFormat(config: {\n key: \"tickets\" | \"club\";\n service: string;\n preset: TierMintPreset;\n icon: typeof Ticket;\n supplyLabel: string;\n submitLabel: string;\n text: TierText;\n}) {\n const { preset, text } = config;\n const copy = getMintFormatCopy(config.service);\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 const t = useT();\n return (\n <>\n <CollectionSection\n label={text.collectionLabel}\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`}>{t(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\">{t(\"Valid\")}</label>\n <div className=\"grid grid-cols-2 gap-2\">\n <Input type=\"date\" aria-label={t(\"Valid from\")} value={state.startDate} onChange={(e) => update({ startDate: e.target.value })} />\n <Input type=\"date\" aria-label={t(\"Valid until\")} value={state.endDate} onChange={(e) => update({ endDate: e.target.value })} />\n </div>\n <p className=\"text-xs text-muted-foreground\">{t(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: copy.name,\n hint: copy.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 (!isPositiveInteger(state.supply)) 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, t) =>\n state.mode === \"new\"\n ? shared.draft.name || t(text.newCollection)\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(msg(\"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 unfinished: text.unfinished,\n labels: { create: text.creating, add: text.adding },\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(text.unreadable);\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: msg(\"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 service: \"ip-tickets\",\n icon: Ticket,\n supplyLabel: msg(\"Number of tickets\"),\n submitLabel: msg(\"Create tickets\"),\n text: {\n collectionLabel: msg(\"Ticket collection\"),\n newCollection: msg(\"New ticket collection\"),\n creating: msg(\"Creating the ticket collection\"),\n adding: msg(\"Publishing tickets\"),\n unfinished: msg(\"Your ticket collection was created, but the last step did not finish.\"),\n unreadable: msg(\"The ticket collection was created, but its address couldn't be read — check My Collections.\"),\n },\n});\n\nexport const CLUB_FORMAT = makeTierFormat({\n key: \"club\",\n preset: CLUB_TIER_PRESET,\n service: \"ip-club\",\n icon: Users,\n supplyLabel: msg(\"Number of memberships\"),\n submitLabel: msg(\"Create membership\"),\n text: {\n collectionLabel: msg(\"Club\"),\n newCollection: msg(\"New club\"),\n creating: msg(\"Creating the club\"),\n adding: msg(\"Publishing memberships\"),\n unfinished: msg(\"Your club was created, but the last step did not finish.\"),\n unreadable: msg(\"The club was created, but its address couldn't be read — check My Collections.\"),\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqDM;AAnDN,0BAAmC;AACnC,iBAAoE;AACpE,sBAA6E;AAC7E,mBAAsB;AACt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AAAA,EACN,iBAAa,sBAAI,mBAAmB;AAAA,EACpC,iBAAa,sBAAI,gBAAgB;AAAA,EACjC,MAAM;AAAA,IACJ,qBAAiB,sBAAI,mBAAmB;AAAA,IACxC,mBAAe,sBAAI,uBAAuB;AAAA,IAC1C,cAAU,sBAAI,gCAAgC;AAAA,IAC9C,YAAQ,sBAAI,oBAAoB;AAAA,IAChC,gBAAY,sBAAI,uEAAuE;AAAA,IACvF,gBAAY,sBAAI,kGAA6F;AAAA,EAC/G;AACF,CAAC;AAEM,MAAM,cAAc,eAAe;AAAA,EACxC,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,iBAAa,sBAAI,uBAAuB;AAAA,EACxC,iBAAa,sBAAI,mBAAmB;AAAA,EACpC,MAAM;AAAA,IACJ,qBAAiB,sBAAI,MAAM;AAAA,IAC3B,mBAAe,sBAAI,UAAU;AAAA,IAC7B,cAAU,sBAAI,mBAAmB;AAAA,IACjC,YAAQ,sBAAI,wBAAwB;AAAA,IACpC,gBAAY,sBAAI,0DAA0D;AAAA,IAC1E,gBAAY,sBAAI,qFAAgF;AAAA,EAClG;AACF,CAAC;","names":[]}
|
|
@@ -12,6 +12,8 @@ import '../types.cjs';
|
|
|
12
12
|
import 'starknet';
|
|
13
13
|
import '../use-new-collection-draft.cjs';
|
|
14
14
|
import '../create-then-add.cjs';
|
|
15
|
+
import '../../../i18n/make-t.cjs';
|
|
16
|
+
import '../../../i18n/translate.cjs';
|
|
15
17
|
|
|
16
18
|
declare const TICKETS_FORMAT: FormatDefinition<unknown>;
|
|
17
19
|
declare const CLUB_FORMAT: FormatDefinition<unknown>;
|
|
@@ -12,6 +12,8 @@ import '../types.js';
|
|
|
12
12
|
import 'starknet';
|
|
13
13
|
import '../use-new-collection-draft.js';
|
|
14
14
|
import '../create-then-add.js';
|
|
15
|
+
import '../../../i18n/make-t.js';
|
|
16
|
+
import '../../../i18n/translate.js';
|
|
15
17
|
|
|
16
18
|
declare const TICKETS_FORMAT: FormatDefinition<unknown>;
|
|
17
19
|
declare const CLUB_FORMAT: FormatDefinition<unknown>;
|
|
@@ -16,7 +16,7 @@ import { defineFormat } from "./types.js";
|
|
|
16
16
|
import { useT } from "../../../i18n/provider.js";
|
|
17
17
|
import { msg } from "../../../i18n/translate.js";
|
|
18
18
|
function makeTierFormat(config) {
|
|
19
|
-
const { preset,
|
|
19
|
+
const { preset, text } = config;
|
|
20
20
|
const copy = getMintFormatCopy(config.service);
|
|
21
21
|
const ownCollections = (shared) => shared.collections.filter((c) => getService(c.service)?.id === preset.service && !!c.contractAddress);
|
|
22
22
|
function Fields({ shared, state, update }) {
|
|
@@ -25,7 +25,7 @@ function makeTierFormat(config) {
|
|
|
25
25
|
/* @__PURE__ */ jsx(
|
|
26
26
|
CollectionSection,
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
label: text.collectionLabel,
|
|
29
29
|
mode: state.mode,
|
|
30
30
|
onModeChange: (mode) => update({ mode }),
|
|
31
31
|
collections: ownCollections(shared),
|
|
@@ -37,10 +37,7 @@ function makeTierFormat(config) {
|
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
t(config.supplyLabel),
|
|
42
|
-
" *"
|
|
43
|
-
] }),
|
|
40
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: `fast-mint-${config.key}-supply`, children: t(config.supplyLabel) }),
|
|
44
41
|
/* @__PURE__ */ jsx(
|
|
45
42
|
Input,
|
|
46
43
|
{
|
|
@@ -59,7 +56,7 @@ function makeTierFormat(config) {
|
|
|
59
56
|
/* @__PURE__ */ jsx(Input, { type: "date", "aria-label": t("Valid from"), value: state.startDate, onChange: (e) => update({ startDate: e.target.value }) }),
|
|
60
57
|
/* @__PURE__ */ jsx(Input, { type: "date", "aria-label": t("Valid until"), value: state.endDate, onChange: (e) => update({ endDate: e.target.value }) })
|
|
61
58
|
] }),
|
|
62
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: preset.copy.validUntilHint })
|
|
59
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(preset.copy.validUntilHint) })
|
|
63
60
|
] }),
|
|
64
61
|
/* @__PURE__ */ jsx(LicensingSection, { form: shared.form })
|
|
65
62
|
] });
|
|
@@ -77,19 +74,19 @@ function makeTierFormat(config) {
|
|
|
77
74
|
if (state.mode === "new") return shared.draft.name.trim().length > 0 && shared.draft.symbol.trim().length > 0;
|
|
78
75
|
return state.existingContract !== "";
|
|
79
76
|
},
|
|
80
|
-
previewLabel: (shared, state) => state.mode === "new" ? shared.draft.name ||
|
|
77
|
+
previewLabel: (shared, state, t) => state.mode === "new" ? shared.draft.name || t(text.newCollection) : ownCollections(shared).find((c) => c.contractAddress === state.existingContract)?.name || void 0,
|
|
81
78
|
submit: async (shared, state, runtime) => {
|
|
82
79
|
const { client, signer, onStep } = runtime;
|
|
83
80
|
const owner = shared.walletAddress;
|
|
84
81
|
const values = shared.form.getValues();
|
|
85
82
|
const supply = state.supply.trim();
|
|
86
83
|
const uploadToken = await runtime.getUploadToken();
|
|
87
|
-
if (!uploadToken) throw new Error("Sign in first");
|
|
84
|
+
if (!uploadToken) throw new Error(msg("Sign in first"));
|
|
88
85
|
const existing = runtime.resume ?? (state.mode === "existing" && state.existingContract ? state.existingContract : null);
|
|
89
86
|
const contract = await createThenAdd({
|
|
90
87
|
existing,
|
|
91
|
-
|
|
92
|
-
labels: { create:
|
|
88
|
+
unfinished: text.unfinished,
|
|
89
|
+
labels: { create: text.creating, add: text.adding },
|
|
93
90
|
onStep,
|
|
94
91
|
create: async () => {
|
|
95
92
|
const baseUri = await uploadJsonToIpfs(
|
|
@@ -111,7 +108,7 @@ function makeTierFormat(config) {
|
|
|
111
108
|
});
|
|
112
109
|
const { receipt } = await executeIntent(signer, client, created);
|
|
113
110
|
const deployed = deployedCollectionFromReceipt(receipt, preset.service);
|
|
114
|
-
if (!deployed) throw new Error(
|
|
111
|
+
if (!deployed) throw new Error(text.unreadable);
|
|
115
112
|
return deployed;
|
|
116
113
|
},
|
|
117
114
|
add: async (address) => {
|
|
@@ -162,20 +159,32 @@ const TICKETS_FORMAT = makeTierFormat({
|
|
|
162
159
|
preset: TICKETS_TIER_PRESET,
|
|
163
160
|
service: "ip-tickets",
|
|
164
161
|
icon: Ticket,
|
|
165
|
-
noun: "ticket collection",
|
|
166
162
|
supplyLabel: msg("Number of tickets"),
|
|
167
163
|
submitLabel: msg("Create tickets"),
|
|
168
|
-
|
|
164
|
+
text: {
|
|
165
|
+
collectionLabel: msg("Ticket collection"),
|
|
166
|
+
newCollection: msg("New ticket collection"),
|
|
167
|
+
creating: msg("Creating the ticket collection"),
|
|
168
|
+
adding: msg("Publishing tickets"),
|
|
169
|
+
unfinished: msg("Your ticket collection was created, but the last step did not finish."),
|
|
170
|
+
unreadable: msg("The ticket collection was created, but its address couldn't be read \u2014 check My Collections.")
|
|
171
|
+
}
|
|
169
172
|
});
|
|
170
173
|
const CLUB_FORMAT = makeTierFormat({
|
|
171
174
|
key: "club",
|
|
172
175
|
preset: CLUB_TIER_PRESET,
|
|
173
176
|
service: "ip-club",
|
|
174
177
|
icon: Users,
|
|
175
|
-
noun: "club",
|
|
176
178
|
supplyLabel: msg("Number of memberships"),
|
|
177
179
|
submitLabel: msg("Create membership"),
|
|
178
|
-
|
|
180
|
+
text: {
|
|
181
|
+
collectionLabel: msg("Club"),
|
|
182
|
+
newCollection: msg("New club"),
|
|
183
|
+
creating: msg("Creating the club"),
|
|
184
|
+
adding: msg("Publishing memberships"),
|
|
185
|
+
unfinished: msg("Your club was created, but the last step did not finish."),
|
|
186
|
+
unreadable: msg("The club was created, but its address couldn't be read \u2014 check My Collections.")
|
|
187
|
+
}
|
|
179
188
|
});
|
|
180
189
|
export {
|
|
181
190
|
CLUB_FORMAT,
|
|
@@ -1 +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 { getMintFormatCopy } from \"../../../data/launchpad-services.js\";\nimport { pinAssetMetadata, uploadJsonToIpfs } from \"../../../utils/ipfs-upload.js\";\nimport { isPositiveInteger } from \"../../../utils/launchpad-rules.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\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { msg } from \"../../../i18n/translate.js\";\n\ninterface TierState {\n mode: CollectionMode;\n existingContract: string;\n supply: string;\n startDate: string;\n endDate: string;\n}\n\nfunction makeTierFormat(config: {\n key: \"tickets\" | \"club\";\n service: string;\n preset: TierMintPreset;\n icon: typeof Ticket;\n noun: string;\n supplyLabel: string;\n submitLabel: string;\n addLabel: string;\n}) {\n const { preset, noun } = config;\n const copy = getMintFormatCopy(config.service);\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 const t = useT();\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`}>{t(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\">{t(\"Valid\")}</label>\n <div className=\"grid grid-cols-2 gap-2\">\n <Input type=\"date\" aria-label={t(\"Valid from\")} value={state.startDate} onChange={(e) => update({ startDate: e.target.value })} />\n <Input type=\"date\" aria-label={t(\"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: copy.name,\n hint: copy.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 (!isPositiveInteger(state.supply)) 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: msg(\"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 service: \"ip-tickets\",\n icon: Ticket,\n noun: \"ticket collection\",\n supplyLabel: msg(\"Number of tickets\"),\n submitLabel: msg(\"Create tickets\"),\n addLabel: msg(\"Minting tickets\"),\n});\n\nexport const CLUB_FORMAT = makeTierFormat({\n key: \"club\",\n preset: CLUB_TIER_PRESET,\n service: \"ip-club\",\n icon: Users,\n noun: \"club\",\n supplyLabel: msg(\"Number of memberships\"),\n submitLabel: msg(\"Create membership\"),\n addLabel: msg(\"Minting memberships\"),\n});\n"],"mappings":";AA6CM,mBACE,KAaE,YAdJ;AA3CN,SAAS,KAAK,QAAQ,aAAa;AACnC,SAAS,yBAAyB,gBAAgB,kBAAkB;AACpE,SAAS,+BAA+B,eAAe,sBAAsB;AAC7E,SAAS,aAAa;AACtB,SAAS,yBAAyB;AAClC,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,yBAAyB;AAClC,SAAS,qBAAqB,yBAAyB,aAAa,kBAAkB;AACtF,SAAS,kBAAkB,2BAAgD;AAC3E,SAAS,yBAA8C;AACvD,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,oBAA+D;AACxE,SAAS,YAAY;AACrB,SAAS,WAAW;AAUpB,SAAS,eAAe,QASrB;AACD,QAAM,EAAE,QAAQ,KAAK,IAAI;AACzB,QAAM,OAAO,kBAAkB,OAAO,OAAO;AAE7C,QAAM,iBAAiB,CAAC,WACtB,OAAO,YAAY,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,OAAO,WAAW,CAAC,CAAC,EAAE,eAAe;AAEtG,WAAS,OAAO,EAAE,QAAQ,OAAO,OAAO,GAAiC;AACzE,UAAM,IAAI,KAAK;AACb,WACE,iCACE;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,CAA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AAU,OAAO,QAAQ;AAAA,QACzB,QAAQ,OAAO,QAAQ;AAAA,QACvB,MAAM,OAAO;AAAA,QACb,iBAAiB,eAAe,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,oBAAoB,QAAQ,GAAG,SAAS,MAAM,SAAS,QAAQ,OAAO,MAAM,OAAO;AAAA,QACzI,OAAO,CAAC,EAAE,MAAM,eAAe,YAAY,QAAQ,GAAG,OAAO,IAAI,iBAAiB,GAAG,MAAM,IAAI,CAAC;AAAA,QAChG,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEO,MAAM,iBAAiB,eAAe;AAAA,EAC3C,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa,IAAI,mBAAmB;AAAA,EACpC,aAAa,IAAI,gBAAgB;AAAA,EACjC,UAAU,IAAI,iBAAiB;AACjC,CAAC;AAEM,MAAM,cAAc,eAAe;AAAA,EACxC,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa,IAAI,uBAAuB;AAAA,EACxC,aAAa,IAAI,mBAAmB;AAAA,EACpC,UAAU,IAAI,qBAAqB;AACrC,CAAC;","names":[]}
|
|
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 { getMintFormatCopy } from \"../../../data/launchpad-services.js\";\nimport { pinAssetMetadata, uploadJsonToIpfs } from \"../../../utils/ipfs-upload.js\";\nimport { isPositiveInteger } from \"../../../utils/launchpad-rules.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\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { msg } from \"../../../i18n/translate.js\";\n\ninterface TierState {\n mode: CollectionMode;\n existingContract: string;\n supply: string;\n startDate: string;\n endDate: string;\n}\n\ninterface TierText {\n collectionLabel: string;\n newCollection: string;\n creating: string;\n adding: string;\n unfinished: string;\n unreadable: string;\n}\n\nfunction makeTierFormat(config: {\n key: \"tickets\" | \"club\";\n service: string;\n preset: TierMintPreset;\n icon: typeof Ticket;\n supplyLabel: string;\n submitLabel: string;\n text: TierText;\n}) {\n const { preset, text } = config;\n const copy = getMintFormatCopy(config.service);\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 const t = useT();\n return (\n <>\n <CollectionSection\n label={text.collectionLabel}\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`}>{t(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\">{t(\"Valid\")}</label>\n <div className=\"grid grid-cols-2 gap-2\">\n <Input type=\"date\" aria-label={t(\"Valid from\")} value={state.startDate} onChange={(e) => update({ startDate: e.target.value })} />\n <Input type=\"date\" aria-label={t(\"Valid until\")} value={state.endDate} onChange={(e) => update({ endDate: e.target.value })} />\n </div>\n <p className=\"text-xs text-muted-foreground\">{t(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: copy.name,\n hint: copy.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 (!isPositiveInteger(state.supply)) 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, t) =>\n state.mode === \"new\"\n ? shared.draft.name || t(text.newCollection)\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(msg(\"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 unfinished: text.unfinished,\n labels: { create: text.creating, add: text.adding },\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(text.unreadable);\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: msg(\"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 service: \"ip-tickets\",\n icon: Ticket,\n supplyLabel: msg(\"Number of tickets\"),\n submitLabel: msg(\"Create tickets\"),\n text: {\n collectionLabel: msg(\"Ticket collection\"),\n newCollection: msg(\"New ticket collection\"),\n creating: msg(\"Creating the ticket collection\"),\n adding: msg(\"Publishing tickets\"),\n unfinished: msg(\"Your ticket collection was created, but the last step did not finish.\"),\n unreadable: msg(\"The ticket collection was created, but its address couldn't be read — check My Collections.\"),\n },\n});\n\nexport const CLUB_FORMAT = makeTierFormat({\n key: \"club\",\n preset: CLUB_TIER_PRESET,\n service: \"ip-club\",\n icon: Users,\n supplyLabel: msg(\"Number of memberships\"),\n submitLabel: msg(\"Create membership\"),\n text: {\n collectionLabel: msg(\"Club\"),\n newCollection: msg(\"New club\"),\n creating: msg(\"Creating the club\"),\n adding: msg(\"Publishing memberships\"),\n unfinished: msg(\"Your club was created, but the last step did not finish.\"),\n unreadable: msg(\"The club was created, but its address couldn't be read — check My Collections.\"),\n },\n});\n"],"mappings":";AAqDM,mBACE,KAYA,YAbF;AAnDN,SAAS,KAAK,QAAQ,aAAa;AACnC,SAAS,yBAAyB,gBAAgB,kBAAkB;AACpE,SAAS,+BAA+B,eAAe,sBAAsB;AAC7E,SAAS,aAAa;AACtB,SAAS,yBAAyB;AAClC,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,yBAAyB;AAClC,SAAS,qBAAqB,yBAAyB,aAAa,kBAAkB;AACtF,SAAS,kBAAkB,2BAAgD;AAC3E,SAAS,yBAA8C;AACvD,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,oBAA+D;AACxE,SAAS,YAAY;AACrB,SAAS,WAAW;AAmBpB,SAAS,eAAe,QAQrB;AACD,QAAM,EAAE,QAAQ,KAAK,IAAI;AACzB,QAAM,OAAO,kBAAkB,OAAO,OAAO;AAE7C,QAAM,iBAAiB,CAAC,WACtB,OAAO,YAAY,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,OAAO,WAAW,CAAC,CAAC,EAAE,eAAe;AAEtG,WAAS,OAAO,EAAE,QAAQ,OAAO,OAAO,GAAiC;AACzE,UAAM,IAAI,KAAK;AACb,WACE,iCACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,KAAK;AAAA,UACZ,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;AA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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;
|
|
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\";\nimport type { T } from \"../../../i18n/make-t.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, t: T) => 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;AA0EO,SAAS,aAAgB,QAA+C;AAC7E,SAAO;AACT;","names":[]}
|
|
@@ -9,8 +9,10 @@ import { FormValues } from '../form.cjs';
|
|
|
9
9
|
import { MintedAsset, MediaKind, FastMintSigner } from '../types.cjs';
|
|
10
10
|
import { useNewCollectionDraft } from '../use-new-collection-draft.cjs';
|
|
11
11
|
import { StepInfo } from '../create-then-add.cjs';
|
|
12
|
+
import { T } from '../../../i18n/make-t.cjs';
|
|
12
13
|
import 'react/jsx-runtime';
|
|
13
14
|
import 'starknet';
|
|
15
|
+
import '../../../i18n/translate.cjs';
|
|
14
16
|
|
|
15
17
|
type MintFormat = "single" | "editions" | "pop" | "tickets" | "club";
|
|
16
18
|
interface FormatShared {
|
|
@@ -63,7 +65,7 @@ interface FormatDefinition<S = unknown> {
|
|
|
63
65
|
initial: () => S;
|
|
64
66
|
Fields: ComponentType<FormatFieldsProps<S>>;
|
|
65
67
|
isReady: (shared: FormatShared, state: S) => boolean;
|
|
66
|
-
previewLabel: (shared: FormatShared, state: S) => string | undefined;
|
|
68
|
+
previewLabel: (shared: FormatShared, state: S, t: T) => string | undefined;
|
|
67
69
|
submit: (shared: FormatShared, state: S, runtime: FormatRuntime) => Promise<FormatResult>;
|
|
68
70
|
}
|
|
69
71
|
declare function defineFormat<S>(format: FormatDefinition<S>): FormatDefinition;
|
|
@@ -9,8 +9,10 @@ import { FormValues } from '../form.js';
|
|
|
9
9
|
import { MintedAsset, MediaKind, FastMintSigner } from '../types.js';
|
|
10
10
|
import { useNewCollectionDraft } from '../use-new-collection-draft.js';
|
|
11
11
|
import { StepInfo } from '../create-then-add.js';
|
|
12
|
+
import { T } from '../../../i18n/make-t.js';
|
|
12
13
|
import 'react/jsx-runtime';
|
|
13
14
|
import 'starknet';
|
|
15
|
+
import '../../../i18n/translate.js';
|
|
14
16
|
|
|
15
17
|
type MintFormat = "single" | "editions" | "pop" | "tickets" | "club";
|
|
16
18
|
interface FormatShared {
|
|
@@ -63,7 +65,7 @@ interface FormatDefinition<S = unknown> {
|
|
|
63
65
|
initial: () => S;
|
|
64
66
|
Fields: ComponentType<FormatFieldsProps<S>>;
|
|
65
67
|
isReady: (shared: FormatShared, state: S) => boolean;
|
|
66
|
-
previewLabel: (shared: FormatShared, state: S) => string | undefined;
|
|
68
|
+
previewLabel: (shared: FormatShared, state: S, t: T) => string | undefined;
|
|
67
69
|
submit: (shared: FormatShared, state: S, runtime: FormatRuntime) => Promise<FormatResult>;
|
|
68
70
|
}
|
|
69
71
|
declare function defineFormat<S>(format: FormatDefinition<S>): FormatDefinition;
|
|
@@ -1 +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":"
|
|
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\";\nimport type { T } from \"../../../i18n/make-t.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, t: T) => 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":"AA0EO,SAAS,aAAgB,QAA+C;AAC7E,SAAO;AACT;","names":[]}
|
|
@@ -44,14 +44,14 @@ function IpTypeSection({
|
|
|
44
44
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors", children: [
|
|
45
45
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
46
46
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: "h-4 w-4 text-primary" }),
|
|
47
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-semibold", children: t("
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-semibold", children: t("More details") }),
|
|
48
48
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground font-normal", children: t("Optional") })
|
|
49
49
|
] }),
|
|
50
50
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { className: (0, import_cn.cn)("h-4 w-4 text-muted-foreground transition-transform", open && "rotate-180") })
|
|
51
51
|
] }) }),
|
|
52
52
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-4 pb-4 space-y-4 border-t border-border/60 pt-4", children: [
|
|
53
53
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
54
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("Type of work") }),
|
|
55
55
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select, { value: ipType, onValueChange: (v) => onIpTypeChange(v), children: [
|
|
56
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, {}) }),
|
|
57
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { children: import_ip.IP_TYPES.map((t2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: t2, children: t2 }, t2)) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/ip-type-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type MutableRefObject } from \"react\";\nimport { ChevronDown, Layers } from \"lucide-react\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport { IP_TYPES, type IPType } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\nexport function IpTypeSection({\n ipType, onIpTypeChange, fieldsRef, uploadDocument, existingDocument,\n}: {\n ipType: IPType;\n onIpTypeChange: (type: IPType) => void;\n fieldsRef: MutableRefObject<MetadataField[]>;\n uploadDocument: (file: File) => Promise<string>;\n existingDocument: { uri: string; name: string } | null;\n}) {\n const t = useT();\n const [open, setOpen] = useState(false);\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <div className=\"panel overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">{t(\"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/ip-type-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type MutableRefObject } from \"react\";\nimport { ChevronDown, Layers } from \"lucide-react\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport { IP_TYPES, type IPType } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\nexport function IpTypeSection({\n ipType, onIpTypeChange, fieldsRef, uploadDocument, existingDocument,\n}: {\n ipType: IPType;\n onIpTypeChange: (type: IPType) => void;\n fieldsRef: MutableRefObject<MetadataField[]>;\n uploadDocument: (file: File) => Promise<string>;\n existingDocument: { uri: string; name: string } | null;\n}) {\n const t = useT();\n const [open, setOpen] = useState(false);\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <div className=\"panel overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">{t(\"More details\")}</span>\n <span className=\"text-xs text-muted-foreground font-normal\">{t(\"Optional\")}</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", open && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Type of work\")}</label>\n <Select value={ipType} onValueChange={(v) => onIpTypeChange(v as IPType)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <IPTypeFields\n ipType={ipType}\n onChange={(fields) => { fieldsRef.current = fields; }}\n uploadDocument={uploadDocument}\n existingDocument={existingDocument}\n />\n </div>\n </CollapsibleContent>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,UACA,UAAU,CAAC,WAAW;AAAE,sBAAU,UAAU;AAAA,UAAQ;AAAA,UACpD;AAAA,UACA;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,KACF,GACF;AAEJ;","names":["t"]}
|
|
@@ -21,14 +21,14 @@ function IpTypeSection({
|
|
|
21
21
|
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: "w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors", children: [
|
|
22
22
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
23
23
|
/* @__PURE__ */ jsx(Layers, { className: "h-4 w-4 text-primary" }),
|
|
24
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: t("
|
|
24
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: t("More details") }),
|
|
25
25
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground font-normal", children: t("Optional") })
|
|
26
26
|
] }),
|
|
27
27
|
/* @__PURE__ */ jsx(ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-transform", open && "rotate-180") })
|
|
28
28
|
] }) }),
|
|
29
29
|
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsxs("div", { className: "px-4 pb-4 space-y-4 border-t border-border/60 pt-4", children: [
|
|
30
30
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
31
|
-
/* @__PURE__ */ jsx("label", { className: "text-xs font-medium text-muted-foreground", children: t("
|
|
31
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs font-medium text-muted-foreground", children: t("Type of work") }),
|
|
32
32
|
/* @__PURE__ */ jsxs(Select, { value: ipType, onValueChange: (v) => onIpTypeChange(v), children: [
|
|
33
33
|
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
34
34
|
/* @__PURE__ */ jsx(SelectContent, { children: IP_TYPES.map((t2) => /* @__PURE__ */ jsx(SelectItem, { value: t2, children: t2 }, t2)) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/ip-type-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type MutableRefObject } from \"react\";\nimport { ChevronDown, Layers } from \"lucide-react\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport { IP_TYPES, type IPType } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\nexport function IpTypeSection({\n ipType, onIpTypeChange, fieldsRef, uploadDocument, existingDocument,\n}: {\n ipType: IPType;\n onIpTypeChange: (type: IPType) => void;\n fieldsRef: MutableRefObject<MetadataField[]>;\n uploadDocument: (file: File) => Promise<string>;\n existingDocument: { uri: string; name: string } | null;\n}) {\n const t = useT();\n const [open, setOpen] = useState(false);\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <div className=\"panel overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">{t(\"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/ip-type-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type MutableRefObject } from \"react\";\nimport { ChevronDown, Layers } from \"lucide-react\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport { IP_TYPES, type IPType } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\nexport function IpTypeSection({\n ipType, onIpTypeChange, fieldsRef, uploadDocument, existingDocument,\n}: {\n ipType: IPType;\n onIpTypeChange: (type: IPType) => void;\n fieldsRef: MutableRefObject<MetadataField[]>;\n uploadDocument: (file: File) => Promise<string>;\n existingDocument: { uri: string; name: string } | null;\n}) {\n const t = useT();\n const [open, setOpen] = useState(false);\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <div className=\"panel overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">{t(\"More details\")}</span>\n <span className=\"text-xs text-muted-foreground font-normal\">{t(\"Optional\")}</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", open && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Type of work\")}</label>\n <Select value={ipType} onValueChange={(v) => onIpTypeChange(v as IPType)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <IPTypeFields\n ipType={ipType}\n onChange={(fields) => { fieldsRef.current = fields; }}\n uploadDocument={uploadDocument}\n existingDocument={existingDocument}\n />\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n );\n}\n"],"mappings":";AA4BY,SACE,KADF;AA1BZ,SAAS,gBAAuC;AAChD,SAAS,aAAa,cAAc;AACpC,SAAS,QAAQ,eAAe,YAAY,eAAe,mBAAmB;AAC9E,SAAS,aAAa,oBAA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","names":["t"]}
|
|
@@ -12,6 +12,8 @@ import './types.cjs';
|
|
|
12
12
|
import 'starknet';
|
|
13
13
|
import './use-new-collection-draft.cjs';
|
|
14
14
|
import './create-then-add.cjs';
|
|
15
|
+
import '../../i18n/make-t.cjs';
|
|
16
|
+
import '../../i18n/translate.cjs';
|
|
15
17
|
|
|
16
18
|
interface SuccessViewProps {
|
|
17
19
|
presentation?: "inline" | "dialog";
|
|
@@ -12,6 +12,8 @@ import './types.js';
|
|
|
12
12
|
import 'starknet';
|
|
13
13
|
import './use-new-collection-draft.js';
|
|
14
14
|
import './create-then-add.js';
|
|
15
|
+
import '../../i18n/make-t.js';
|
|
16
|
+
import '../../i18n/translate.js';
|
|
15
17
|
|
|
16
18
|
interface SuccessViewProps {
|
|
17
19
|
presentation?: "inline" | "dialog";
|
|
@@ -40,7 +40,7 @@ var import_button = require("./button.js");
|
|
|
40
40
|
var import_upload_limits = require("../utils/upload-limits.js");
|
|
41
41
|
var import_cn = require("../utils/cn.js");
|
|
42
42
|
var import_provider = require("../i18n/provider.js");
|
|
43
|
-
function ImageUploadField({ upload, label, ariaLabel, alt = "",
|
|
43
|
+
function ImageUploadField({ upload, label, ariaLabel, alt = "", optional, hint, buttonLabel, round, currentImage }) {
|
|
44
44
|
const t = (0, import_provider.useT)();
|
|
45
45
|
const inputRef = (0, import_react.useRef)(null);
|
|
46
46
|
const { status, error, uploading } = upload;
|
|
@@ -61,7 +61,6 @@ function ImageUploadField({ upload, label, ariaLabel, alt = "", required, option
|
|
|
61
61
|
children: [
|
|
62
62
|
label ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-medium", children: [
|
|
63
63
|
label,
|
|
64
|
-
required ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-destructive", children: " *" }) : null,
|
|
65
64
|
optional ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-muted-foreground font-normal", children: [
|
|
66
65
|
" ",
|
|
67
66
|
t("(optional)")
|
|
@@ -125,7 +124,7 @@ function ImageUploadField({ upload, label, ariaLabel, alt = "", required, option
|
|
|
125
124
|
]
|
|
126
125
|
}
|
|
127
126
|
) : null,
|
|
128
|
-
error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: error }) :
|
|
127
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: error }) : status === "uploaded" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-primary", children: t("\u2713 Uploaded") }) : null,
|
|
129
128
|
hint ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: hint }) : null
|
|
130
129
|
] })
|
|
131
130
|
] })
|